UNPKG

616 kBJavaScriptView Raw
1/**
2 * vis-network - network
3 * http://visjs.org/
4 *
5 * A dynamic, browser-based visualization library.
6 *
7 * @version 6.4.0
8 * @date 2019-11-10T19:38:00Z
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 */
26var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function i(t,e){return t(e={exports:{}},e.exports),e.exports}var n,o,r,s=function(t){return t&&t.Math==Math&&t},a=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof t&&t)||Function("return this")(),h=function(t){try{return!!t()}catch(t){return!0}},d=!h((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),l={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,c={f:u&&!l.call({1:2},1)?function(t){var e=u(this,t);return!!e&&e.enumerable}:l},f=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},p={}.toString,v=function(t){return p.call(t).slice(8,-1)},g="".split,y=h((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?g.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},b=function(t){return y(m(t))},_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t,e){if(!_(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!_(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!_(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!_(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")},k={}.hasOwnProperty,x=function(t,e){return k.call(t,e)},S=a.document,O=_(S)&&_(S.createElement),D=function(t){return O?S.createElement(t):{}},M=!d&&!h((function(){return 7!=Object.defineProperty(D("div"),"a",{get:function(){return 7}}).a})),E=Object.getOwnPropertyDescriptor,T={f:d?E:function(t,e){if(t=b(t),e=w(e,!0),M)try{return E(t,e)}catch(t){}if(x(t,e))return f(!c.f.call(t,e),t[e])}},C=function(t){if(!_(t))throw TypeError(String(t)+" is not an object");return t},P=Object.defineProperty,I={f:d?P:function(t,e,i){if(C(t),e=w(e,!0),C(i),M)try{return P(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},N=d?function(t,e,i){return I.f(t,e,f(1,i))}:function(t,e,i){return t[e]=i,t},F=function(t,e){try{N(a,t,e)}catch(i){a[t]=e}return e},A=a["__core-js_shared__"]||F("__core-js_shared__",{}),R=i((function(t){(t.exports=function(t,e){return A[t]||(A[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.3.4",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),Y=R("native-function-to-string",Function.toString),j=a.WeakMap,z="function"==typeof j&&/native code/.test(Y.call(j)),L=0,B=Math.random(),H=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++L+B).toString(36)},W=R("keys"),V=function(t){return W[t]||(W[t]=H(t))},U={},G=a.WeakMap;if(z){var q=new G,Z=q.get,X=q.has,$=q.set;n=function(t,e){return $.call(q,t,e),e},o=function(t){return Z.call(q,t)||{}},r=function(t){return X.call(q,t)}}else{var K=V("state");U[K]=!0,n=function(t,e){return N(t,K,e),e},o=function(t){return x(t,K)?t[K]:{}},r=function(t){return x(t,K)}}var J,Q={set:n,get:o,has:r,enforce:function(t){return r(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!_(e)||(i=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}},tt=i((function(t){var e=Q.get,i=Q.enforce,n=String(Y).split("toString");R("inspectSource",(function(t){return Y.call(t)})),(t.exports=function(t,e,o,r){var s=!!r&&!!r.unsafe,h=!!r&&!!r.enumerable,d=!!r&&!!r.noTargetGet;"function"==typeof o&&("string"!=typeof e||x(o,"name")||N(o,"name",e),i(o).source=n.join("string"==typeof e?e:"")),t!==a?(s?!d&&t[e]&&(h=!0):delete t[e],h?t[e]=o:N(t,e,o)):h?t[e]=o:F(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||Y.call(this)}))})),et=a,it=function(t){return"function"==typeof t?t:void 0},nt=function(t,e){return arguments.length<2?it(et[t])||it(a[t]):et[t]&&et[t][e]||a[t]&&a[t][e]},ot=Math.ceil,rt=Math.floor,st=function(t){return isNaN(t=+t)?0:(t>0?rt:ot)(t)},at=Math.min,ht=function(t){return t>0?at(st(t),9007199254740991):0},dt=Math.max,lt=Math.min,ut=function(t,e){var i=st(t);return i<0?dt(i+e,0):lt(i,e)},ct=function(t){return function(e,i,n){var o,r=b(e),s=ht(r.length),a=ut(n,s);if(t&&i!=i){for(;s>a;)if((o=r[a++])!=o)return!0}else for(;s>a;a++)if((t||a in r)&&r[a]===i)return t||a||0;return!t&&-1}},ft={includes:ct(!0),indexOf:ct(!1)},pt=ft.indexOf,vt=function(t,e){var i,n=b(t),o=0,r=[];for(i in n)!x(U,i)&&x(n,i)&&r.push(i);for(;e.length>o;)x(n,i=e[o++])&&(~pt(r,i)||r.push(i));return r},gt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yt=gt.concat("length","prototype"),mt={f:Object.getOwnPropertyNames||function(t){return vt(t,yt)}},bt={f:Object.getOwnPropertySymbols},_t=nt("Reflect","ownKeys")||function(t){var e=mt.f(C(t)),i=bt.f;return i?e.concat(i(t)):e},wt=function(t,e){for(var i=_t(e),n=I.f,o=T.f,r=0;r<i.length;r++){var s=i[r];x(t,s)||n(t,s,o(e,s))}},kt=/#|\.prototype\./,xt=function(t,e){var i=Ot[St(t)];return i==Mt||i!=Dt&&("function"==typeof e?h(e):!!e)},St=xt.normalize=function(t){return String(t).replace(kt,".").toLowerCase()},Ot=xt.data={},Dt=xt.NATIVE="N",Mt=xt.POLYFILL="P",Et=xt,Tt=T.f,Ct=function(t,e){var i,n,o,r,s,h=t.target,d=t.global,l=t.stat;if(i=d?a:l?a[h]||F(h,{}):(a[h]||{}).prototype)for(n in e){if(r=e[n],o=t.noTargetGet?(s=Tt(i,n))&&s.value:i[n],!Et(d?n:h+(l?".":"#")+n,t.forced)&&void 0!==o){if(typeof r==typeof o)continue;wt(r,o)}(t.sham||o&&o.sham)&&N(r,"sham",!0),tt(i,n,r,t)}},Pt=!!Object.getOwnPropertySymbols&&!h((function(){return!String(Symbol())})),It=a.Symbol,Nt=R("wks"),Ft=function(t){return Nt[t]||(Nt[t]=Pt&&It[t]||(Pt?It:H)("Symbol."+t))},At=Ft("toStringTag"),Rt="Arguments"==v(function(){return arguments}()),Yt=function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),At))?i:Rt?v(e):"Object"==(n=v(e))&&"function"==typeof e.callee?"Arguments":n},jt=function(t){return Object(m(t))},zt=!h((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Lt=V("IE_PROTO"),Bt=Object.prototype,Ht=zt?Object.getPrototypeOf:function(t){return t=jt(t),x(t,Lt)?t[Lt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Bt:null},Wt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return C(i),function(t){if(!_(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(i,n):i.__proto__=n,i}}():void 0),Vt=I.f,Ut=a.DataView,Gt=Ut&&Ut.prototype,qt=a.Int8Array,Zt=qt&&qt.prototype,Xt=a.Uint8ClampedArray,$t=Xt&&Xt.prototype,Kt=qt&&Ht(qt),Jt=Zt&&Ht(Zt),Qt=Object.prototype,te=Qt.isPrototypeOf,ee=Ft("toStringTag"),ie=H("TYPED_ARRAY_TAG"),ne=!(!a.ArrayBuffer||!Ut),oe=ne&&!!Wt&&"Opera"!==Yt(a.opera),re=!1,se={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ae=function(t){return _(t)&&x(se,Yt(t))};for(J in se)a[J]||(oe=!1);if((!oe||"function"!=typeof Kt||Kt===Function.prototype)&&(Kt=function(){throw TypeError("Incorrect invocation")},oe))for(J in se)a[J]&&Wt(a[J],Kt);if((!oe||!Jt||Jt===Qt)&&(Jt=Kt.prototype,oe))for(J in se)a[J]&&Wt(a[J].prototype,Jt);if(oe&&Ht($t)!==Jt&&Wt($t,Jt),d&&!x(Jt,ee))for(J in re=!0,Vt(Jt,ee,{get:function(){return _(this)?this[ie]:void 0}}),se)a[J]&&N(a[J],ie,J);ne&&Wt&&Ht(Gt)!==Qt&&Wt(Gt,Qt);var he={NATIVE_ARRAY_BUFFER:ne,NATIVE_ARRAY_BUFFER_VIEWS:oe,TYPED_ARRAY_TAG:re&&ie,aTypedArray:function(t){if(ae(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(Wt){if(te.call(Kt,t))return t}else for(var e in se)if(x(se,J)){var i=a[e];if(i&&(t===i||te.call(i,t)))return t}throw TypeError("Target is not a typed array constructor")},exportProto:function(t,e,i){if(d){if(i)for(var n in se){var o=a[n];o&&x(o.prototype,t)&&delete o.prototype[t]}Jt[t]&&!i||tt(Jt,t,i?e:oe&&Zt[t]||e)}},exportStatic:function(t,e,i){var n,o;if(d){if(Wt){if(i)for(n in se)(o=a[n])&&x(o,t)&&delete o[t];if(Kt[t]&&!i)return;try{return tt(Kt,t,i?e:oe&&qt[t]||e)}catch(t){}}for(n in se)!(o=a[n])||o[t]&&!i||tt(o,t,e)}},isView:function(t){var e=Yt(t);return"DataView"===e||x(se,e)},isTypedArray:ae,TypedArray:Kt,TypedArrayPrototype:Jt},de=function(t,e,i){for(var n in e)tt(t,n,e[n],i);return t},le=function(t,e,i){if(!(t instanceof e))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return t},ue=function(t){if(void 0===t)return 0;var e=st(t),i=ht(e);if(e!==i)throw RangeError("Wrong length or index");return i},ce=function(t){for(var e=jt(this),i=ht(e.length),n=arguments.length,o=ut(n>1?arguments[1]:void 0,i),r=n>2?arguments[2]:void 0,s=void 0===r?i:ut(r,i);s>o;)e[o++]=t;return e},fe=I.f,pe=Ft("toStringTag"),ve=function(t,e,i){t&&!x(t=i?t:t.prototype,pe)&&fe(t,pe,{configurable:!0,value:e})},ge=he.NATIVE_ARRAY_BUFFER,ye=mt.f,me=I.f,be=Q.get,_e=Q.set,we=a.ArrayBuffer,ke=we,xe=a.DataView,Se=a.Math,Oe=a.RangeError,De=Se.abs,Me=Se.pow,Ee=Se.floor,Te=Se.log,Ce=Se.LN2,Pe=function(t,e,i){var n,o,r,s=new Array(i),a=8*i-e-1,h=(1<<a)-1,d=h>>1,l=23===e?Me(2,-24)-Me(2,-77):0,u=t<0||0===t&&1/t<0?1:0,c=0;for((t=De(t))!=t||t===1/0?(o=t!=t?1:0,n=h):(n=Ee(Te(t)/Ce),t*(r=Me(2,-n))<1&&(n--,r*=2),(t+=n+d>=1?l/r:l*Me(2,1-d))*r>=2&&(n++,r/=2),n+d>=h?(o=0,n=h):n+d>=1?(o=(t*r-1)*Me(2,e),n+=d):(o=t*Me(2,d-1)*Me(2,e),n=0));e>=8;s[c++]=255&o,o/=256,e-=8);for(n=n<<e|o,a+=e;a>0;s[c++]=255&n,n/=256,a-=8);return s[--c]|=128*u,s},Ie=function(t,e){var i,n=t.length,o=8*n-e-1,r=(1<<o)-1,s=r>>1,a=o-7,h=n-1,d=t[h--],l=127&d;for(d>>=7;a>0;l=256*l+t[h],h--,a-=8);for(i=l&(1<<-a)-1,l>>=-a,a+=e;a>0;i=256*i+t[h],h--,a-=8);if(0===l)l=1-s;else{if(l===r)return i?NaN:d?-1/0:1/0;i+=Me(2,e),l-=s}return(d?-1:1)*i*Me(2,l-e)},Ne=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Fe=function(t){return[255&t]},Ae=function(t){return[255&t,t>>8&255]},Re=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Ye=function(t){return Pe(t,23,4)},je=function(t){return Pe(t,52,8)},ze=function(t,e){me(t.prototype,e,{get:function(){return be(this)[e]}})},Le=function(t,e,i,n){var o=ue(+i),r=be(t);if(o+e>r.byteLength)throw Oe("Wrong index");var s=be(r.buffer).bytes,a=o+r.byteOffset,h=s.slice(a,a+e);return n?h:h.reverse()},Be=function(t,e,i,n,o,r){var s=ue(+i),a=be(t);if(s+e>a.byteLength)throw Oe("Wrong index");for(var h=be(a.buffer).bytes,d=s+a.byteOffset,l=n(+o),u=0;u<e;u++)h[d+u]=l[r?u:e-u-1]};if(ge){if(!h((function(){we(1)}))||!h((function(){new we(-1)}))||h((function(){return new we,new we(1.5),new we(NaN),"ArrayBuffer"!=we.name}))){for(var He,We=(ke=function(t){return le(this,ke),new we(ue(t))}).prototype=we.prototype,Ve=ye(we),Ue=0;Ve.length>Ue;)(He=Ve[Ue++])in ke||N(ke,He,we[He]);We.constructor=ke}var Ge=new xe(new ke(2)),qe=xe.prototype.setInt8;Ge.setInt8(0,2147483648),Ge.setInt8(1,2147483649),!Ge.getInt8(0)&&Ge.getInt8(1)||de(xe.prototype,{setInt8:function(t,e){qe.call(this,t,e<<24>>24)},setUint8:function(t,e){qe.call(this,t,e<<24>>24)}},{unsafe:!0})}else ke=function(t){le(this,ke,"ArrayBuffer");var e=ue(t);_e(this,{bytes:ce.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},xe=function(t,e,i){le(this,xe,"DataView"),le(t,ke,"DataView");var n=be(t).byteLength,o=st(e);if(o<0||o>n)throw Oe("Wrong offset");if(o+(i=void 0===i?n-o:ht(i))>n)throw Oe("Wrong length");_e(this,{buffer:t,byteLength:i,byteOffset:o}),d||(this.buffer=t,this.byteLength=i,this.byteOffset=o)},d&&(ze(ke,"byteLength"),ze(xe,"buffer"),ze(xe,"byteLength"),ze(xe,"byteOffset")),de(xe.prototype,{getInt8:function(t){return Le(this,1,t)[0]<<24>>24},getUint8:function(t){return Le(this,1,t)[0]},getInt16:function(t){var e=Le(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Le(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return Ne(Le(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return Ne(Le(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return Ie(Le(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return Ie(Le(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){Be(this,1,t,Fe,e)},setUint8:function(t,e){Be(this,1,t,Fe,e)},setInt16:function(t,e){Be(this,2,t,Ae,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){Be(this,2,t,Ae,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){Be(this,4,t,Re,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){Be(this,4,t,Re,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){Be(this,4,t,Ye,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){Be(this,8,t,je,e,arguments.length>2?arguments[2]:void 0)}});ve(ke,"ArrayBuffer"),ve(xe,"DataView");var Ze={ArrayBuffer:ke,DataView:xe},Xe=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},$e=Ft("species"),Ke=function(t,e){var i,n=C(t).constructor;return void 0===n||null==(i=C(n)[$e])?e:Xe(i)},Je=Ze.ArrayBuffer,Qe=Ze.DataView,ti=Je.prototype.slice,ei=h((function(){return!new Je(2).slice(1,void 0).byteLength}));Ct({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:ei},{slice:function(t,e){if(void 0!==ti&&void 0===e)return ti.call(C(this),t);for(var i=C(this).byteLength,n=ut(t,i),o=ut(void 0===e?i:e,i),r=new(Ke(this,Je))(ht(o-n)),s=new Qe(this),a=new Qe(r),h=0;n<o;)a.setUint8(h++,s.getUint8(n++));return r}}),Ct({global:!0,forced:!he.NATIVE_ARRAY_BUFFER},{DataView:Ze.DataView});var ii={};ii[Ft("toStringTag")]="z";var ni="[object z]"!==String(ii)?function(){return"[object "+Yt(this)+"]"}:ii.toString,oi=Object.prototype;ni!==oi.toString&&tt(oi,"toString",ni,{unsafe:!0}),"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(t,e,i){this.beginPath(),this.arc(t,e,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(t,e,i){this.beginPath(),this.rect(t-i,e-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(t,e,i){this.beginPath(),e+=.275*(i*=1.15);var n=2*i,o=n/2,r=Math.sqrt(3)/6*n,s=Math.sqrt(n*n-o*o);this.moveTo(t,e-(s-r)),this.lineTo(t+o,e+r),this.lineTo(t-o,e+r),this.lineTo(t,e-(s-r)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(t,e,i){this.beginPath(),e-=.275*(i*=1.15);var n=2*i,o=n/2,r=Math.sqrt(3)/6*n,s=Math.sqrt(n*n-o*o);this.moveTo(t,e+(s-r)),this.lineTo(t+o,e-r),this.lineTo(t-o,e-r),this.lineTo(t,e+(s-r)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(t,e,i){this.beginPath(),e+=.1*(i*=.82);for(var n=0;n<10;n++){var o=n%2==0?1.3*i:.5*i;this.lineTo(t+o*Math.sin(2*n*Math.PI/10),e-o*Math.cos(2*n*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(t,e,i){this.beginPath(),this.lineTo(t,e+i),this.lineTo(t+i,e),this.lineTo(t,e-i),this.lineTo(t-i,e),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,n,o){var r=Math.PI/180;i-2*o<0&&(o=i/2),n-2*o<0&&(o=n/2),this.beginPath(),this.moveTo(t+o,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,270*r,360*r,!1),this.lineTo(t+i,e+n-o),this.arc(t+i-o,e+n-o,o,0,90*r,!1),this.lineTo(t+o,e+n),this.arc(t+o,e+n-o,o,90*r,180*r,!1),this.lineTo(t,e+o),this.arc(t+o,e+o,o,180*r,270*r,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse_vis=function(t,e,i,n){var o=i/2*.5522848,r=n/2*.5522848,s=t+i,a=e+n,h=t+i/2,d=e+n/2;this.beginPath(),this.moveTo(t,d),this.bezierCurveTo(t,d-r,h-o,e,h,e),this.bezierCurveTo(h+o,e,s,d-r,s,d),this.bezierCurveTo(s,d+r,h+o,a,h,a),this.bezierCurveTo(h-o,a,t,d+r,t,d),this.closePath()},CanvasRenderingContext2D.prototype.database=function(t,e,i,n){var o=n*(1/3),r=i/2*.5522848,s=o/2*.5522848,a=t+i,h=e+o,d=t+i/2,l=e+o/2,u=e+(n-o/2),c=e+n;this.beginPath(),this.moveTo(a,l),this.bezierCurveTo(a,l+s,d+r,h,d,h),this.bezierCurveTo(d-r,h,t,l+s,t,l),this.bezierCurveTo(t,l-s,d-r,e,d,e),this.bezierCurveTo(d+r,e,a,l-s,a,l),this.lineTo(a,u),this.bezierCurveTo(a,u+s,d+r,c,d,c),this.bezierCurveTo(d-r,c,t,u+s,t,u),this.lineTo(t,l)},CanvasRenderingContext2D.prototype.dashedLine=function(t,e,i,n,o){this.beginPath(),this.moveTo(t,e);for(var r=o.length,s=i-t,a=n-e,h=a/s,d=Math.sqrt(s*s+a*a),l=0,u=!0,c=0,f=+o[0];d>=.1;)(f=+o[l++%r])>d&&(f=d),c=Math.sqrt(f*f/(1+h*h)),t+=c=s<0?-c:c,e+=h*c,!0===u?this.lineTo(t,e):this.moveTo(t,e),d-=f,u=!u},CanvasRenderingContext2D.prototype.hexagon=function(t,e,i){this.beginPath();var n=2*Math.PI/6;this.moveTo(t+i,e);for(var o=1;o<6;o++)this.lineTo(t+i*Math.cos(n*o),e+i*Math.sin(n*o));this.closePath()});var ri=i((function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((i=n[o])===e||i.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){n=0;for(var o=(i=i.slice(0)).length;n<o;++n)i[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function si(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function ai(t,e){return t(e={exports:{}},e.exports),e.exports}var hi=ai((function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)})),di=ai((function(t){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)})),li=(di.version,ai((function(t){var e=hi["__core-js_shared__"]||(hi["__core-js_shared__"]={});(t.exports=function(t,i){return e[t]||(e[t]=void 0!==i?i:{})})("versions",[]).push({version:di.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}))),ui=0,ci=Math.random(),fi=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++ui+ci).toString(36))},pi=ai((function(t){var e=li("wks"),i=hi.Symbol,n="function"==typeof i;(t.exports=function(t){return e[t]||(e[t]=n&&i[t]||(n?i:fi)("Symbol."+t))}).store=e})),vi={f:pi},gi=function(t){return"object"==typeof t?null!==t:"function"==typeof t},yi=function(t){if(!gi(t))throw TypeError(t+" is not an object!");return t},mi=function(t){try{return!!t()}catch(t){return!0}},bi=!mi((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),_i=hi.document,wi=gi(_i)&&gi(_i.createElement),ki=function(t){return wi?_i.createElement(t):{}},xi=!bi&&!mi((function(){return 7!=Object.defineProperty(ki("div"),"a",{get:function(){return 7}}).a})),Si=function(t,e){if(!gi(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!gi(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!gi(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!gi(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")},Oi=Object.defineProperty,Di={f:bi?Object.defineProperty:function(t,e,i){if(yi(t),e=Si(e,!0),yi(i),xi)try{return Oi(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},Mi=Di.f,Ei=function(t){var e=di.Symbol||(di.Symbol=hi.Symbol||{});"_"==t.charAt(0)||t in e||Mi(e,t,{value:vi.f(t)})};Ei("asyncIterator");var Ti={}.hasOwnProperty,Ci=function(t,e){return Ti.call(t,e)},Pi=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Ii=bi?function(t,e,i){return Di.f(t,e,Pi(1,i))}:function(t,e,i){return t[e]=i,t},Ni=li("native-function-to-string",Function.toString),Fi=ai((function(t){var e=fi("src"),i=(""+Ni).split("toString");di.inspectSource=function(t){return Ni.call(t)},(t.exports=function(t,n,o,r){var s="function"==typeof o;s&&(Ci(o,"name")||Ii(o,"name",n)),t[n]!==o&&(s&&(Ci(o,e)||Ii(o,e,t[n]?""+t[n]:i.join(String(n)))),t===hi?t[n]=o:r?t[n]?t[n]=o:Ii(t,n,o):(delete t[n],Ii(t,n,o)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[e]||Ni.call(this)}))})),Ai=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},Ri=function(t,e,i){if(Ai(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}},Yi=function(t,e,i){var n,o,r,s,a=t&Yi.F,h=t&Yi.G,d=t&Yi.S,l=t&Yi.P,u=t&Yi.B,c=h?hi:d?hi[e]||(hi[e]={}):(hi[e]||{}).prototype,f=h?di:di[e]||(di[e]={}),p=f.prototype||(f.prototype={});for(n in h&&(i=e),i)r=((o=!a&&c&&void 0!==c[n])?c:i)[n],s=u&&o?Ri(r,hi):l&&"function"==typeof r?Ri(Function.call,r):r,c&&Fi(c,n,r,t&Yi.U),f[n]!=r&&Ii(f,n,s),l&&p[n]!=r&&(p[n]=r)};hi.core=di,Yi.F=1,Yi.G=2,Yi.S=4,Yi.P=8,Yi.B=16,Yi.W=32,Yi.U=64,Yi.R=128;var ji,zi=Yi,Li=ai((function(t){var e=fi("meta"),i=Di.f,n=0,o=Object.isExtensible||function(){return!0},r=!mi((function(){return o(Object.preventExtensions({}))})),s=function(t){i(t,e,{value:{i:"O"+ ++n,w:{}}})},a=t.exports={KEY:e,NEED:!1,fastKey:function(t,i){if(!gi(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Ci(t,e)){if(!o(t))return"F";if(!i)return"E";s(t)}return t[e].i},getWeak:function(t,i){if(!Ci(t,e)){if(!o(t))return!0;if(!i)return!1;s(t)}return t[e].w},onFreeze:function(t){return r&&a.NEED&&o(t)&&!Ci(t,e)&&s(t),t}}})),Bi=(Li.KEY,Li.NEED,Li.fastKey,Li.getWeak,Li.onFreeze,Di.f),Hi=pi("toStringTag"),Wi=function(t,e,i){t&&!Ci(t=i?t:t.prototype,Hi)&&Bi(t,Hi,{configurable:!0,value:e})},Vi={}.toString,Ui=function(t){return Vi.call(t).slice(8,-1)},Gi=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==Ui(t)?t.split(""):Object(t)},qi=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},Zi=function(t){return Gi(qi(t))},Xi=Math.ceil,$i=Math.floor,Ki=function(t){return isNaN(t=+t)?0:(t>0?$i:Xi)(t)},Ji=Math.min,Qi=function(t){return t>0?Ji(Ki(t),9007199254740991):0},tn=Math.max,en=Math.min,nn=li("keys"),on=function(t){return nn[t]||(nn[t]=fi(t))},rn=(ji=!1,function(t,e,i){var n,o=Zi(t),r=Qi(o.length),s=function(t,e){return(t=Ki(t))<0?tn(t+e,0):en(t,e)}(i,r);if(ji&&e!=e){for(;r>s;)if((n=o[s++])!=n)return!0}else for(;r>s;s++)if((ji||s in o)&&o[s]===e)return ji||s||0;return!ji&&-1}),sn=on("IE_PROTO"),an=function(t,e){var i,n=Zi(t),o=0,r=[];for(i in n)i!=sn&&Ci(n,i)&&r.push(i);for(;e.length>o;)Ci(n,i=e[o++])&&(~rn(r,i)||r.push(i));return r},hn="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),dn=Object.keys||function(t){return an(t,hn)},ln={f:Object.getOwnPropertySymbols},un={f:{}.propertyIsEnumerable},cn=Array.isArray||function(t){return"Array"==Ui(t)},fn=function(t){return Object(qi(t))},pn=bi?Object.defineProperties:function(t,e){yi(t);for(var i,n=dn(e),o=n.length,r=0;o>r;)Di.f(t,i=n[r++],e[i]);return t},vn=hi.document,gn=vn&&vn.documentElement,yn=on("IE_PROTO"),mn=function(){},bn=function(){var t,e=ki("iframe"),i=hn.length;for(e.style.display="none",gn.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),bn=t.F;i--;)delete bn.prototype[hn[i]];return bn()},_n=Object.create||function(t,e){var i;return null!==t?(mn.prototype=yi(t),i=new mn,mn.prototype=null,i[yn]=t):i=bn(),void 0===e?i:pn(i,e)},wn=hn.concat("length","prototype"),kn={f:Object.getOwnPropertyNames||function(t){return an(t,wn)}},xn=kn.f,Sn={}.toString,On="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Dn={f:function(t){return On&&"[object Window]"==Sn.call(t)?function(t){try{return xn(t)}catch(t){return On.slice()}}(t):xn(Zi(t))}},Mn=Object.getOwnPropertyDescriptor,En={f:bi?Mn:function(t,e){if(t=Zi(t),e=Si(e,!0),xi)try{return Mn(t,e)}catch(t){}if(Ci(t,e))return Pi(!un.f.call(t,e),t[e])}},Tn=Li.KEY,Cn=En.f,Pn=Di.f,In=Dn.f,Nn=hi.Symbol,Fn=hi.JSON,An=Fn&&Fn.stringify,Rn=pi("_hidden"),Yn=pi("toPrimitive"),jn={}.propertyIsEnumerable,zn=li("symbol-registry"),Ln=li("symbols"),Bn=li("op-symbols"),Hn=Object.prototype,Wn="function"==typeof Nn&&!!ln.f,Vn=hi.QObject,Un=!Vn||!Vn.prototype||!Vn.prototype.findChild,Gn=bi&&mi((function(){return 7!=_n(Pn({},"a",{get:function(){return Pn(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=Cn(Hn,e);n&&delete Hn[e],Pn(t,e,i),n&&t!==Hn&&Pn(Hn,e,n)}:Pn,qn=function(t){var e=Ln[t]=_n(Nn.prototype);return e._k=t,e},Zn=Wn&&"symbol"==typeof Nn.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Nn},Xn=function(t,e,i){return t===Hn&&Xn(Bn,e,i),yi(t),e=Si(e,!0),yi(i),Ci(Ln,e)?(i.enumerable?(Ci(t,Rn)&&t[Rn][e]&&(t[Rn][e]=!1),i=_n(i,{enumerable:Pi(0,!1)})):(Ci(t,Rn)||Pn(t,Rn,Pi(1,{})),t[Rn][e]=!0),Gn(t,e,i)):Pn(t,e,i)},$n=function(t,e){yi(t);for(var i,n=function(t){var e=dn(t),i=ln.f;if(i)for(var n,o=i(t),r=un.f,s=0;o.length>s;)r.call(t,n=o[s++])&&e.push(n);return e}(e=Zi(e)),o=0,r=n.length;r>o;)Xn(t,i=n[o++],e[i]);return t},Kn=function(t){var e=jn.call(this,t=Si(t,!0));return!(this===Hn&&Ci(Ln,t)&&!Ci(Bn,t))&&(!(e||!Ci(this,t)||!Ci(Ln,t)||Ci(this,Rn)&&this[Rn][t])||e)},Jn=function(t,e){if(t=Zi(t),e=Si(e,!0),t!==Hn||!Ci(Ln,e)||Ci(Bn,e)){var i=Cn(t,e);return!i||!Ci(Ln,e)||Ci(t,Rn)&&t[Rn][e]||(i.enumerable=!0),i}},Qn=function(t){for(var e,i=In(Zi(t)),n=[],o=0;i.length>o;)Ci(Ln,e=i[o++])||e==Rn||e==Tn||n.push(e);return n},to=function(t){for(var e,i=t===Hn,n=In(i?Bn:Zi(t)),o=[],r=0;n.length>r;)!Ci(Ln,e=n[r++])||i&&!Ci(Hn,e)||o.push(Ln[e]);return o};Wn||(Fi((Nn=function(){if(this instanceof Nn)throw TypeError("Symbol is not a constructor!");var t=fi(arguments.length>0?arguments[0]:void 0),e=function(i){this===Hn&&e.call(Bn,i),Ci(this,Rn)&&Ci(this[Rn],t)&&(this[Rn][t]=!1),Gn(this,t,Pi(1,i))};return bi&&Un&&Gn(Hn,t,{configurable:!0,set:e}),qn(t)}).prototype,"toString",(function(){return this._k})),En.f=Jn,Di.f=Xn,kn.f=Dn.f=Qn,un.f=Kn,ln.f=to,bi&&Fi(Hn,"propertyIsEnumerable",Kn,!0),vi.f=function(t){return qn(pi(t))}),zi(zi.G+zi.W+zi.F*!Wn,{Symbol:Nn});for(var eo="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),io=0;eo.length>io;)pi(eo[io++]);for(var no=dn(pi.store),oo=0;no.length>oo;)Ei(no[oo++]);zi(zi.S+zi.F*!Wn,"Symbol",{for:function(t){return Ci(zn,t+="")?zn[t]:zn[t]=Nn(t)},keyFor:function(t){if(!Zn(t))throw TypeError(t+" is not a symbol!");for(var e in zn)if(zn[e]===t)return e},useSetter:function(){Un=!0},useSimple:function(){Un=!1}}),zi(zi.S+zi.F*!Wn,"Object",{create:function(t,e){return void 0===e?_n(t):$n(_n(t),e)},defineProperty:Xn,defineProperties:$n,getOwnPropertyDescriptor:Jn,getOwnPropertyNames:Qn,getOwnPropertySymbols:to});var ro=mi((function(){ln.f(1)}));function so(t){return(so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ao(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ho(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function lo(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}zi(zi.S+zi.F*ro,"Object",{getOwnPropertySymbols:function(t){return ln.f(fn(t))}}),Fn&&zi(zi.S+zi.F*(!Wn||mi((function(){var t=Nn();return"[null]"!=An([t])||"{}"!=An({a:t})||"{}"!=An(Object(t))}))),"JSON",{stringify:function(t){for(var e,i,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);if(i=e=n[1],(gi(e)||void 0!==t)&&!Zn(t))return cn(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!Zn(e))return e}),n[1]=e,An.apply(Fn,n)}}),Nn.prototype[Yn]||Ii(Nn.prototype,Yn,Nn.prototype.valueOf),Wi(Nn,"Symbol"),Wi(Math,"Math",!0),Wi(hi.JSON,"JSON",!0);var uo,co,fo,po;uo="keys",co=function(){return function(t){return dn(fn(t))}},fo=(di.Object||{})[uo]||Object[uo],(po={})[uo]=co(fo),zi(zi.S+zi.F*mi((function(){fo(1)})),"Object",po);var vo=function(){var t=yi(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};bi&&"g"!=/./g.flags&&Di.f(RegExp.prototype,"flags",{configurable:!0,get:vo});var go=/./.toString,yo=function(t){Fi(RegExp.prototype,"toString",t,!0)};mi((function(){return"/a/b"!=go.call({source:"a",flags:"b"})}))?yo((function(){var t=yi(this);return"/".concat(t.source,"/","flags"in t?t.flags:!bi&&t instanceof RegExp?vo.call(t):void 0)})):"toString"!=go.name&&yo((function(){return go.call(this)}));var mo=function(t){return function(e,i){var n,o,r=String(qi(e)),s=Ki(i),a=r.length;return s<0||s>=a?t?"":void 0:(n=r.charCodeAt(s))<55296||n>56319||s+1===a||(o=r.charCodeAt(s+1))<56320||o>57343?t?r.charAt(s):n:t?r.slice(s,s+2):o-56320+(n-55296<<10)+65536}}(!0),bo=function(t,e,i){return e+(i?mo(t,e).length:1)},_o=pi("toStringTag"),wo="Arguments"==Ui(function(){return arguments}()),ko=function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),_o))?i:wo?Ui(e):"Object"==(n=Ui(e))&&"function"==typeof e.callee?"Arguments":n},xo=RegExp.prototype.exec,So=function(t,e){var i=t.exec;if("function"==typeof i){var n=i.call(t,e);if("object"!=typeof n)throw new TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==ko(t))throw new TypeError("RegExp#exec called on incompatible receiver");return xo.call(t,e)},Oo=RegExp.prototype.exec,Do=String.prototype.replace,Mo=Oo,Eo=function(){var t=/a/,e=/b*/g;return Oo.call(t,"a"),Oo.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),To=void 0!==/()??/.exec("")[1];(Eo||To)&&(Mo=function(t){var e,i,n,o,r=this;return To&&(i=new RegExp("^"+r.source+"$(?!\\s)",vo.call(r))),Eo&&(e=r.lastIndex),n=Oo.call(r,t),Eo&&n&&(r.lastIndex=r.global?n.index+n[0].length:e),To&&n&&n.length>1&&Do.call(n[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n});var Co=Mo;zi({target:"RegExp",proto:!0,forced:Co!==/./.exec},{exec:Co});var Po=pi("species"),Io=!mi((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),No=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2===i.length&&"a"===i[0]&&"b"===i[1]}(),Fo=function(t,e,i){var n=pi(t),o=!mi((function(){var e={};return e[n]=function(){return 7},7!=""[t](e)})),r=o?!mi((function(){var e=!1,i=/a/;return i.exec=function(){return e=!0,null},"split"===t&&(i.constructor={},i.constructor[Po]=function(){return i}),i[n](""),!e})):void 0;if(!o||!r||"replace"===t&&!Io||"split"===t&&!No){var s=/./[n],a=i(qi,n,""[t],(function(t,e,i,n,r){return e.exec===Co?o&&!r?{done:!0,value:s.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}})),h=a[0],d=a[1];Fi(String.prototype,t,h),Ii(RegExp.prototype,n,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)})}},Ao=Math.max,Ro=Math.min,Yo=Math.floor,jo=/\$([$&`']|\d\d?|<[^>]*>)/g,zo=/\$([$&`']|\d\d?)/g;Fo("replace",2,(function(t,e,i,n){return[function(n,o){var r=t(this),s=null==n?void 0:n[e];return void 0!==s?s.call(n,r,o):i.call(String(r),n,o)},function(t,e){var r=n(i,t,this,e);if(r.done)return r.value;var s=yi(t),a=String(this),h="function"==typeof e;h||(e=String(e));var d=s.global;if(d){var l=s.unicode;s.lastIndex=0}for(var u=[];;){var c=So(s,a);if(null===c)break;if(u.push(c),!d)break;""===String(c[0])&&(s.lastIndex=bo(a,Qi(s.lastIndex),l))}for(var f,p="",v=0,g=0;g<u.length;g++){c=u[g];for(var y=String(c[0]),m=Ao(Ro(Ki(c.index),a.length),0),b=[],_=1;_<c.length;_++)b.push(void 0===(f=c[_])?f:String(f));var w=c.groups;if(h){var k=[y].concat(b,m,a);void 0!==w&&k.push(w);var x=String(e.apply(void 0,k))}else x=o(y,a,m,b,w,e);m>=v&&(p+=a.slice(v,m)+x,v=m+y.length)}return p+a.slice(v)}];function o(t,e,n,o,r,s){var a=n+t.length,h=o.length,d=zo;return void 0!==r&&(r=fn(r),d=jo),i.call(s,d,(function(i,s){var d;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(a);case"<":d=r[s.slice(1,-1)];break;default:var l=+s;if(0===l)return i;if(l>h){var u=Yo(l/10);return 0===u?i:u<=h?void 0===o[u-1]?s.charAt(1):o[u-1]+s.charAt(1):i}d=o[l-1]}return void 0===d?"":d}))}}));var Lo=pi("unscopables"),Bo=Array.prototype;null==Bo[Lo]&&Ii(Bo,Lo,{});var Ho=function(t){Bo[Lo][t]=!0},Wo=function(t,e){return{value:e,done:!!t}},Vo={},Uo={};Ii(Uo,pi("iterator"),(function(){return this}));var Go=function(t,e,i){t.prototype=_n(Uo,{next:Pi(1,i)}),Wi(t,e+" Iterator")},qo=on("IE_PROTO"),Zo=Object.prototype,Xo=Object.getPrototypeOf||function(t){return t=fn(t),Ci(t,qo)?t[qo]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Zo:null},$o=pi("iterator"),Ko=!([].keys&&"next"in[].keys()),Jo=function(){return this},Qo=function(t,e,i,n,o,r,s){Go(i,e,n);var a,h,d,l=function(t){if(!Ko&&t in p)return p[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},u=e+" Iterator",c="values"==o,f=!1,p=t.prototype,v=p[$o]||p["@@iterator"]||o&&p[o],g=v||l(o),y=o?c?l("entries"):g:void 0,m="Array"==e&&p.entries||v;if(m&&(d=Xo(m.call(new t)))!==Object.prototype&&d.next&&(Wi(d,u,!0),"function"!=typeof d[$o]&&Ii(d,$o,Jo)),c&&v&&"values"!==v.name&&(f=!0,g=function(){return v.call(this)}),(Ko||f||!p[$o])&&Ii(p,$o,g),Vo[e]=g,Vo[u]=Jo,o)if(a={values:c?g:l("values"),keys:r?g:l("keys"),entries:y},s)for(h in a)h in p||Fi(p,h,a[h]);else zi(zi.P+zi.F*(Ko||f),e,a);return a}(Array,"Array",(function(t,e){this._t=Zi(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,Wo(1)):Wo(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])}),"values");Vo.Arguments=Vo.Array,Ho("keys"),Ho("values"),Ho("entries");for(var tr=pi("iterator"),er=pi("toStringTag"),ir=Vo.Array,nr={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},or=dn(nr),rr=0;rr<or.length;rr++){var sr,ar=or[rr],hr=nr[ar],dr=hi[ar],lr=dr&&dr.prototype;if(lr&&(lr[tr]||Ii(lr,tr,ir),lr[er]||Ii(lr,er,ar),Vo[ar]=ir,hr))for(sr in Qo)lr[sr]||Fi(lr,sr,Qo[sr],!0)}var ur={};ur[pi("toStringTag")]="z",ur+""!="[object z]"&&Fi(Object.prototype,"toString",(function(){return"[object "+ko(this)+"]"}),!0);var cr,fr=un.f,pr=(cr=!1,function(t){for(var e,i=Zi(t),n=dn(i),o=n.length,r=0,s=[];o>r;)e=n[r++],bi&&!fr.call(i,e)||s.push(cr?[e,i[e]]:i[e]);return s});zi(zi.S,"Object",{values:function(t){return pr(t)}});var vr=pi("match"),gr=pi("species"),yr=Math.min,mr=[].push,br=!mi((function(){RegExp(4294967295,"y")}));Fo("split",2,(function(t,e,i,n){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var n,o,r=String(this);if(void 0===t&&0===e)return[];if(!gi(n=t)||(void 0!==(o=n[vr])?!o:"RegExp"!=Ui(n)))return i.call(r,t,e);for(var s,a,h,d=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),u=0,c=void 0===e?4294967295:e>>>0,f=new RegExp(t.source,l+"g");(s=Co.call(f,r))&&!((a=f.lastIndex)>u&&(d.push(r.slice(u,s.index)),s.length>1&&s.index<r.length&&mr.apply(d,s.slice(1)),h=s[0].length,u=a,d.length>=c));)f.lastIndex===s.index&&f.lastIndex++;return u===r.length?!h&&f.test("")||d.push(""):d.push(r.slice(u)),d.length>c?d.slice(0,c):d}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)}:i,[function(i,n){var r=t(this),s=null==i?void 0:i[e];return void 0!==s?s.call(i,r,n):o.call(String(r),i,n)},function(t,e){var r=n(o,t,this,e,o!==i);if(r.done)return r.value;var s=yi(t),a=String(this),h=function(t,e){var i,n=yi(t).constructor;return void 0===n||null==(i=yi(n)[gr])?e:Ai(i)}(s,RegExp),d=s.unicode,l=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(br?"y":"g"),u=new h(br?s:"^(?:"+s.source+")",l),c=void 0===e?4294967295:e>>>0;if(0===c)return[];if(0===a.length)return null===So(u,a)?[a]:[];for(var f=0,p=0,v=[];p<a.length;){u.lastIndex=br?p:0;var g,y=So(u,br?a:a.slice(p));if(null===y||(g=yr(Qi(u.lastIndex+(br?0:p)),a.length))===f)p=bo(a,p,d);else{if(v.push(a.slice(f,p)),v.length===c)return v;for(var m=1;m<=y.length-1;m++)if(v.push(y[m]),v.length===c)return v;p=f=g}}return v.push(a.slice(f)),v}]}));var _r=Object.assign,wr=!_r||mi((function(){var t={},e={},i=Symbol(),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach((function(t){e[t]=t})),7!=_r({},t)[i]||Object.keys(_r({},e)).join("")!=n}))?function(t,e){for(var i=fn(t),n=arguments.length,o=1,r=ln.f,s=un.f;n>o;)for(var a,h=Gi(arguments[o++]),d=r?dn(h).concat(r(h)):dn(h),l=d.length,u=0;l>u;)a=d[u++],bi&&!s.call(h,a)||(i[a]=h[a]);return i}:_r;zi(zi.S+zi.F,"Object",{assign:wr});var kr=function(t,e){if(yi(t),!gi(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},xr={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{(i=Ri(Function.call,En.f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return kr(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:kr}.set,Sr=function(t,e,i){var n,o=e.constructor;return o!==i&&"function"==typeof o&&(n=o.prototype)!==i.prototype&&gi(n)&&xr&&xr(t,n),t},Or="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff",Dr="["+Or+"]",Mr=RegExp("^"+Dr+Dr+"*"),Er=RegExp(Dr+Dr+"*$"),Tr=function(t,e,i){var n={},o=mi((function(){return!!Or[t]()||"​…"!="​…"[t]()})),r=n[t]=o?e(Cr):Or[t];i&&(n[i]=r),zi(zi.P+zi.F*o,"String",n)},Cr=Tr.trim=function(t,e){return t=String(qi(t)),1&e&&(t=t.replace(Mr,"")),2&e&&(t=t.replace(Er,"")),t},Pr=Tr,Ir=kn.f,Nr=En.f,Fr=Di.f,Ar=Pr.trim,Rr=hi.Number,Yr=Rr,jr=Rr.prototype,zr="Number"==Ui(_n(jr)),Lr="trim"in String.prototype,Br=function(t){var e=Si(t,!1);if("string"==typeof e&&e.length>2){var i,n,o,r=(e=Lr?e.trim():Ar(e,3)).charCodeAt(0);if(43===r||45===r){if(88===(i=e.charCodeAt(2))||120===i)return NaN}else if(48===r){switch(e.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+e}for(var s,a=e.slice(2),h=0,d=a.length;h<d;h++)if((s=a.charCodeAt(h))<48||s>o)return NaN;return parseInt(a,n)}}return+e};if(!Rr(" 0o1")||!Rr("0b1")||Rr("+0x1")){Rr=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof Rr&&(zr?mi((function(){jr.valueOf.call(i)})):"Number"!=Ui(i))?Sr(new Yr(Br(e)),i,Rr):Br(e)};for(var Hr,Wr=bi?Ir(Yr):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Vr=0;Wr.length>Vr;Vr++)Ci(Yr,Hr=Wr[Vr])&&!Ci(Rr,Hr)&&Fr(Rr,Hr,Nr(Yr,Hr));Rr.prototype=jr,jr.constructor=Rr,Fi(hi,"Number",Rr)}for(var Ur=ai((function(t,e){t.exports=function(){var e,i;function n(){return e.apply(null,arguments)}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function a(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function u(t,e){for(var i in e)l(e,i)&&(t[i]=e[i]);return l(e,"toString")&&(t.toString=e.toString),l(e,"valueOf")&&(t.valueOf=e.valueOf),t}function c(t,e,i,n){return Ie(t,e,i,n,!0).utc()}function f(t){return null==t._pf&&(t._pf={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}),t._pf}function p(t){if(null==t._isValid){var e=f(t),n=i.call(e.parsedDateParts,(function(t){return null!=t})),o=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(o=o&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return o;t._isValid=o}return t._isValid}function v(t){var e=c(NaN);return null!=t?u(f(e),t):f(e).userInvalidated=!0,e}i=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;n<i;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};var g=n.momentProperties=[];function y(t,e){var i,n,o;if(s(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),s(e._i)||(t._i=e._i),s(e._f)||(t._f=e._f),s(e._l)||(t._l=e._l),s(e._strict)||(t._strict=e._strict),s(e._tzm)||(t._tzm=e._tzm),s(e._isUTC)||(t._isUTC=e._isUTC),s(e._offset)||(t._offset=e._offset),s(e._pf)||(t._pf=f(e)),s(e._locale)||(t._locale=e._locale),g.length>0)for(i=0;i<g.length;i++)s(o=e[n=g[i]])||(t[n]=o);return t}var m=!1;function b(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===m&&(m=!0,n.updateOffset(this),m=!1)}function _(t){return t instanceof b||null!=t&&null!=t._isAMomentObject}function w(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function k(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=w(e)),i}function x(t,e,i){var n,o=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),s=0;for(n=0;n<o;n++)(i&&t[n]!==e[n]||!i&&k(t[n])!==k(e[n]))&&s++;return s+r}function S(t){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function O(t,e){var i=!0;return u((function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,t),i){for(var o,r=[],s=0;s<arguments.length;s++){if(o="","object"==typeof arguments[s]){for(var a in o+="\n["+s+"] ",arguments[0])o+=a+": "+arguments[0][a]+", ";o=o.slice(0,-2)}else o=arguments[s];r.push(o)}S(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return e.apply(this,arguments)}),e)}var D,M={};function E(t,e){null!=n.deprecationHandler&&n.deprecationHandler(t,e),M[t]||(S(e),M[t]=!0)}function T(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function C(t,e){var i,n=u({},t);for(i in e)l(e,i)&&(r(t[i])&&r(e[i])?(n[i]={},u(n[i],t[i]),u(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);for(i in t)l(t,i)&&!l(e,i)&&r(t[i])&&(n[i]=u({},n[i]));return n}function P(t){null!=t&&this.set(t)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,D=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)l(t,e)&&i.push(e);return i};var I={};function N(t,e){var i=t.toLowerCase();I[i]=I[i+"s"]=I[e]=t}function F(t){return"string"==typeof t?I[t]||I[t.toLowerCase()]:void 0}function A(t){var e,i,n={};for(i in t)l(t,i)&&(e=F(i))&&(n[e]=t[i]);return n}var R={};function Y(t,e){R[t]=e}function j(t,e,i){var n=""+Math.abs(t),o=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var z=/(\[[^\[]*\])|(\\)?([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,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,B={},H={};function W(t,e,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),t&&(H[t]=o),e&&(H[e[0]]=function(){return j(o.apply(this,arguments),e[1],e[2])}),i&&(H[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function V(t,e){return t.isValid()?(e=U(e,t.localeData()),B[e]=B[e]||function(t){var e,i,n,o=t.match(z);for(e=0,i=o.length;e<i;e++)H[o[e]]?o[e]=H[o[e]]:o[e]=(n=o[e]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(e){var n,r="";for(n=0;n<i;n++)r+=T(o[n])?o[n].call(e,t):o[n];return r}}(e),B[e](t)):t.localeData().invalidDate()}function U(t,e){var i=5;function n(t){return e.longDateFormat(t)||t}for(L.lastIndex=0;i>=0&&L.test(t);)t=t.replace(L,n),L.lastIndex=0,i-=1;return t}var G=/\d/,q=/\d\d/,Z=/\d{3}/,X=/\d{4}/,$=/[+-]?\d{6}/,K=/\d\d?/,J=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,tt=/\d{1,3}/,et=/\d{1,4}/,it=/[+-]?\d{1,6}/,nt=/\d+/,ot=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,at=/[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,ht={};function dt(t,e,i){ht[t]=T(e)?e:function(t,n){return t&&i?i:e}}function lt(t,e){return l(ht,t)?ht[t](e._strict,e._locale):new RegExp(ut(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,o){return e||i||n||o}))))}function ut(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ct={};function ft(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),a(e)&&(n=function(t,i){i[e]=k(t)}),i=0;i<t.length;i++)ct[t[i]]=n}function pt(t,e){ft(t,(function(t,i,n,o){n._w=n._w||{},e(t,n._w,n,o)}))}function vt(t,e,i){null!=e&&l(ct,t)&&ct[t](e,i._a,i,t)}var gt=0,yt=1,mt=2,bt=3,_t=4,wt=5,kt=6,xt=7,St=8;function Ot(t){return Dt(t)?366:365}function Dt(t){return t%4==0&&t%100!=0||t%400==0}W("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),W(0,["YY",2],0,(function(){return this.year()%100})),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),N("year","y"),Y("year",1),dt("Y",ot),dt("YY",K,q),dt("YYYY",et,X),dt("YYYYY",it,$),dt("YYYYYY",it,$),ft(["YYYYY","YYYYYY"],gt),ft("YYYY",(function(t,e){e[gt]=2===t.length?n.parseTwoDigitYear(t):k(t)})),ft("YY",(function(t,e){e[gt]=n.parseTwoDigitYear(t)})),ft("Y",(function(t,e){e[gt]=parseInt(t,10)})),n.parseTwoDigitYear=function(t){return k(t)+(k(t)>68?1900:2e3)};var Mt,Et=Tt("FullYear",!0);function Tt(t,e){return function(i){return null!=i?(Pt(this,t,i),n.updateOffset(this,e),this):Ct(this,t)}}function Ct(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Pt(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Dt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),It(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function It(t,e){if(isNaN(t)||isNaN(e))return NaN;var i,n=(e%(i=12)+i)%i;return t+=(e-n)/12,1===n?Dt(t)?29:28:31-n%7%2}Mt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},W("M",["MM",2],"Mo",(function(){return this.month()+1})),W("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),W("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),N("month","M"),Y("month",8),dt("M",K),dt("MM",K,q),dt("MMM",(function(t,e){return e.monthsShortRegex(t)})),dt("MMMM",(function(t,e){return e.monthsRegex(t)})),ft(["M","MM"],(function(t,e){e[yt]=k(t)-1})),ft(["MMM","MMMM"],(function(t,e,i,n){var o=i._locale.monthsParse(t,n,i._strict);null!=o?e[yt]=o:f(i).invalidMonth=t}));var Nt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ft="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),At="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Rt(t,e,i){var n,o,r,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=c([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(o=Mt.call(this._shortMonthsParse,s))?o:null:-1!==(o=Mt.call(this._longMonthsParse,s))?o:null:"MMM"===e?-1!==(o=Mt.call(this._shortMonthsParse,s))?o:-1!==(o=Mt.call(this._longMonthsParse,s))?o:null:-1!==(o=Mt.call(this._longMonthsParse,s))?o:-1!==(o=Mt.call(this._shortMonthsParse,s))?o:null}function Yt(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=k(e);else if(!a(e=t.localeData().monthsParse(e)))return t;return i=Math.min(t.date(),It(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function jt(t){return null!=t?(Yt(this,t),n.updateOffset(this,!0),this):Ct(this,"Month")}var zt=at,Lt=at;function Bt(){function t(t,e){return e.length-t.length}var e,i,n=[],o=[],r=[];for(e=0;e<12;e++)i=c([2e3,e]),n.push(this.monthsShort(i,"")),o.push(this.months(i,"")),r.push(this.months(i,"")),r.push(this.monthsShort(i,""));for(n.sort(t),o.sort(t),r.sort(t),e=0;e<12;e++)n[e]=ut(n[e]),o[e]=ut(o[e]);for(e=0;e<24;e++)r[e]=ut(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Ht(t,e,i,n,o,r,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,i,n,o,r,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,o,r,s),a}function Wt(t){var e;if(t<100&&t>=0){var i=Array.prototype.slice.call(arguments);i[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Vt(t,e,i){var n=7+e-i;return-(7+Wt(t,0,n).getUTCDay()-e)%7+n-1}function Ut(t,e,i,n,o){var r,s,a=1+7*(e-1)+(7+i-n)%7+Vt(t,n,o);return a<=0?s=Ot(r=t-1)+a:a>Ot(t)?(r=t+1,s=a-Ot(t)):(r=t,s=a),{year:r,dayOfYear:s}}function Gt(t,e,i){var n,o,r=Vt(t.year(),e,i),s=Math.floor((t.dayOfYear()-r-1)/7)+1;return s<1?n=s+qt(o=t.year()-1,e,i):s>qt(t.year(),e,i)?(n=s-qt(t.year(),e,i),o=t.year()+1):(o=t.year(),n=s),{week:n,year:o}}function qt(t,e,i){var n=Vt(t,e,i),o=Vt(t+1,e,i);return(Ot(t)-n+o)/7}function Zt(t,e){return t.slice(e,7).concat(t.slice(0,e))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),Y("week",5),Y("isoWeek",5),dt("w",K),dt("ww",K,q),dt("W",K),dt("WW",K,q),pt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=k(t)})),W("d",0,"do","day"),W("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),W("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),W("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),dt("d",K),dt("e",K),dt("E",K),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),pt(["dd","ddd","dddd"],(function(t,e,i,n){var o=i._locale.weekdaysParse(t,n,i._strict);null!=o?e.d=o:f(i).invalidWeekday=t})),pt(["d","e","E"],(function(t,e,i,n){e[n]=k(t)}));var Xt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$t="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Kt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Jt(t,e,i){var n,o,r,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=c([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(o=Mt.call(this._weekdaysParse,s))?o:null:"ddd"===e?-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:null:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:null:"dddd"===e?-1!==(o=Mt.call(this._weekdaysParse,s))?o:-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:null:"ddd"===e?-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:-1!==(o=Mt.call(this._weekdaysParse,s))?o:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:null:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:-1!==(o=Mt.call(this._weekdaysParse,s))?o:-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:null}var Qt=at,te=at,ee=at;function ie(){function t(t,e){return e.length-t.length}var e,i,n,o,r,s=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=c([2e3,1]).day(e),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),r=this.weekdays(i,""),s.push(n),a.push(o),h.push(r),d.push(n),d.push(o),d.push(r);for(s.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=ut(a[e]),h[e]=ut(h[e]),d[e]=ut(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function ne(){return this.hours()%12||12}function oe(t,e){W(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function re(t,e){return e._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,ne),W("k",["kk",2],0,(function(){return this.hours()||24})),W("hmm",0,0,(function(){return""+ne.apply(this)+j(this.minutes(),2)})),W("hmmss",0,0,(function(){return""+ne.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)})),W("Hmm",0,0,(function(){return""+this.hours()+j(this.minutes(),2)})),W("Hmmss",0,0,(function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)})),oe("a",!0),oe("A",!1),N("hour","h"),Y("hour",13),dt("a",re),dt("A",re),dt("H",K),dt("h",K),dt("k",K),dt("HH",K,q),dt("hh",K,q),dt("kk",K,q),dt("hmm",J),dt("hmmss",Q),dt("Hmm",J),dt("Hmmss",Q),ft(["H","HH"],bt),ft(["k","kk"],(function(t,e,i){var n=k(t);e[bt]=24===n?0:n})),ft(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),ft(["h","hh"],(function(t,e,i){e[bt]=k(t),f(i).bigHour=!0})),ft("hmm",(function(t,e,i){var n=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n)),f(i).bigHour=!0})),ft("hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n,2)),e[wt]=k(t.substr(o)),f(i).bigHour=!0})),ft("Hmm",(function(t,e,i){var n=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n))})),ft("Hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n,2)),e[wt]=k(t.substr(o))}));var se,ae=Tt("Hours",!0),he={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:/\d{1,2}/,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:Ft,monthsShort:At,week:{dow:0,doy:6},weekdays:Xt,weekdaysMin:Kt,weekdaysShort:$t,meridiemParse:/[ap]\.?m?\.?/i},de={},le={};function ue(t){return t?t.toLowerCase().replace("_","-"):t}function ce(e){var i=null;if(!de[e]&&t&&t.exports)try{i=se._abbr,si(),fe(i)}catch(t){}return de[e]}function fe(t,e){var i;return t&&((i=s(e)?ve(t):pe(t,e))?se=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),se._abbr}function pe(t,e){if(null!==e){var i,n=he;if(e.abbr=t,null!=de[t])E("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."),n=de[t]._config;else if(null!=e.parentLocale)if(null!=de[e.parentLocale])n=de[e.parentLocale]._config;else{if(null==(i=ce(e.parentLocale)))return le[e.parentLocale]||(le[e.parentLocale]=[]),le[e.parentLocale].push({name:t,config:e}),null;n=i._config}return de[t]=new P(C(n,e)),le[t]&&le[t].forEach((function(t){pe(t.name,t.config)})),fe(t),de[t]}return delete de[t],null}function ve(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return se;if(!o(t)){if(e=ce(t))return e;t=[t]}return function(t){for(var e,i,n,o,r=0;r<t.length;){for(e=(o=ue(t[r]).split("-")).length,i=(i=ue(t[r+1]))?i.split("-"):null;e>0;){if(n=ce(o.slice(0,e).join("-")))return n;if(i&&i.length>=e&&x(o,i,!0)>=e-1)break;e--}r++}return se}(t)}function ge(t){var e,i=t._a;return i&&-2===f(t).overflow&&(e=i[yt]<0||i[yt]>11?yt:i[mt]<1||i[mt]>It(i[gt],i[yt])?mt:i[bt]<0||i[bt]>24||24===i[bt]&&(0!==i[_t]||0!==i[wt]||0!==i[kt])?bt:i[_t]<0||i[_t]>59?_t:i[wt]<0||i[wt]>59?wt:i[kt]<0||i[kt]>999?kt:-1,f(t)._overflowDayOfYear&&(e<gt||e>mt)&&(e=mt),f(t)._overflowWeeks&&-1===e&&(e=xt),f(t)._overflowWeekday&&-1===e&&(e=St),f(t).overflow=e),t}function ye(t,e,i){return null!=t?t:null!=e?e:i}function me(t){var e,i,o,r,s,a=[];if(!t._d){for(o=function(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[mt]&&null==t._a[yt]&&function(t){var e,i,n,o,r,s,a,h;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,s=4,i=ye(e.GG,t._a[gt],Gt(Ne(),1,4).year),n=ye(e.W,1),((o=ye(e.E,1))<1||o>7)&&(h=!0);else{r=t._locale._week.dow,s=t._locale._week.doy;var d=Gt(Ne(),r,s);i=ye(e.gg,t._a[gt],d.year),n=ye(e.w,d.week),null!=e.d?((o=e.d)<0||o>6)&&(h=!0):null!=e.e?(o=e.e+r,(e.e<0||e.e>6)&&(h=!0)):o=r}n<1||n>qt(i,r,s)?f(t)._overflowWeeks=!0:null!=h?f(t)._overflowWeekday=!0:(a=Ut(i,n,o,r,s),t._a[gt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=ye(t._a[gt],o[gt]),(t._dayOfYear>Ot(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=Wt(s,0,t._dayOfYear),t._a[yt]=i.getUTCMonth(),t._a[mt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=o[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[bt]&&0===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[bt]=0),t._d=(t._useUTC?Wt:Ht).apply(null,a),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[bt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(f(t).weekdayMismatch=!0)}}var be=/^\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)?)?$/,_e=/^\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)?)?$/,we=/Z|[+-]\d\d(?::?\d\d)?/,ke=[["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}/]],xe=[["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/]],Se=/^\/?Date\((\-?\d+)/i;function Oe(t){var e,i,n,o,r,s,a=t._i,h=be.exec(a)||_e.exec(a);if(h){for(f(t).iso=!0,e=0,i=ke.length;e<i;e++)if(ke[e][1].exec(h[1])){o=ke[e][0],n=!1!==ke[e][2];break}if(null==o)return void(t._isValid=!1);if(h[3]){for(e=0,i=xe.length;e<i;e++)if(xe[e][1].exec(h[3])){r=(h[2]||" ")+xe[e][0];break}if(null==r)return void(t._isValid=!1)}if(!n&&null!=r)return void(t._isValid=!1);if(h[4]){if(!we.exec(h[4]))return void(t._isValid=!1);s="Z"}t._f=o+(r||"")+(s||""),Ce(t)}else t._isValid=!1}var De=/^(?:(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}))$/;function Me(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}var Ee={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Te(t){var e,i,n,o,r,s,a,h=De.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(h){var d=(e=h[4],i=h[3],n=h[2],o=h[5],r=h[6],s=h[7],a=[Me(e),At.indexOf(i),parseInt(n,10),parseInt(o,10),parseInt(r,10)],s&&a.push(parseInt(s,10)),a);if(!function(t,e,i){return!t||$t.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(f(i).weekdayMismatch=!0,i._isValid=!1,!1)}(h[1],d,t))return;t._a=d,t._tzm=function(t,e,i){if(t)return Ee[t];if(e)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}(h[8],h[9],h[10]),t._d=Wt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),f(t).rfc2822=!0}else t._isValid=!1}function Ce(t){if(t._f!==n.ISO_8601)if(t._f!==n.RFC_2822){t._a=[],f(t).empty=!0;var e,i,o,r,s,a=""+t._i,h=a.length,d=0;for(o=U(t._f,t._locale).match(z)||[],e=0;e<o.length;e++)r=o[e],(i=(a.match(lt(r,t))||[])[0])&&((s=a.substr(0,a.indexOf(i))).length>0&&f(t).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),d+=i.length),H[r]?(i?f(t).empty=!1:f(t).unusedTokens.push(r),vt(r,i,t)):t._strict&&!i&&f(t).unusedTokens.push(r);f(t).charsLeftOver=h-d,a.length>0&&f(t).unusedInput.push(a),t._a[bt]<=12&&!0===f(t).bigHour&&t._a[bt]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[bt]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[bt],t._meridiem),me(t),ge(t)}else Te(t);else Oe(t)}function Pe(t){var e=t._i,i=t._f;return t._locale=t._locale||ve(t._l),null===e||void 0===i&&""===e?v({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new b(ge(e)):(h(e)?t._d=e:o(i)?function(t){var e,i,n,o,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;o<t._f.length;o++)r=0,e=y({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[o],Ce(e),p(e)&&(r+=f(e).charsLeftOver,r+=10*f(e).unusedTokens.length,f(e).score=r,(null==n||r<n)&&(n=r,i=e));u(t,i||e)}(t):i?Ce(t):function(t){var e=t._i;s(e)?t._d=new Date(n.now()):h(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=Se.exec(t._i);null===e?(Oe(t),!1===t._isValid&&(delete t._isValid,Te(t),!1===t._isValid&&(delete t._isValid,n.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):o(e)?(t._a=d(e.slice(0),(function(t){return parseInt(t,10)})),me(t)):r(e)?function(t){if(!t._d){var e=A(t._i);t._a=d([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),me(t)}}(t):a(e)?t._d=new Date(e):n.createFromInputFallback(t)}(t),p(t)||(t._d=null),t))}function Ie(t,e,i,n,s){var a,h={};return!0!==i&&!1!==i||(n=i,i=void 0),(r(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||o(t)&&0===t.length)&&(t=void 0),h._isAMomentObject=!0,h._useUTC=h._isUTC=s,h._l=i,h._i=t,h._f=e,h._strict=n,(a=new b(ge(Pe(h))))._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function Ne(t,e,i,n){return Ie(t,e,i,n,!1)}n.createFromInputFallback=O("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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),n.ISO_8601=function(){},n.RFC_2822=function(){};var Fe=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Ne.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:v()})),Ae=O("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Ne.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:v()}));function Re(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Ne();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}var Ye=["year","quarter","month","week","day","hour","minute","second","millisecond"];function je(t){var e=A(t),i=e.year||0,n=e.quarter||0,o=e.month||0,r=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,h=e.minute||0,d=e.second||0,l=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===Mt.call(Ye,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var i=!1,n=0;n<Ye.length;++n)if(t[Ye[n]]){if(i)return!1;parseFloat(t[Ye[n]])!==k(t[Ye[n]])&&(i=!0)}return!0}(e),this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+s+7*r,this._months=+o+3*n+12*i,this._data={},this._locale=ve(),this._bubble()}function ze(t){return t instanceof je}function Le(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Be(t,e){W(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+j(~~(t/60),2)+e+j(~~t%60,2)}))}Be("Z",":"),Be("ZZ",""),dt("Z",st),dt("ZZ",st),ft(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=We(st,t)}));var He=/([\+\-]|\d\d)/gi;function We(t,e){var i=(e||"").match(t);if(null===i)return null;var n=((i[i.length-1]||[])+"").match(He)||["-",0,0],o=60*n[1]+k(n[2]);return 0===o?0:"+"===n[0]?o:-o}function Ve(t,e){var i,o;return e._isUTC?(i=e.clone(),o=(_(t)||h(t)?t.valueOf():Ne(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+o),n.updateOffset(i,!1),i):Ne(t).local()}function Ue(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ge(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var qe=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ze=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Xe(t,e){var i,n,o,r,s,h,d=t,u=null;return ze(t)?d={ms:t._milliseconds,d:t._days,M:t._months}:a(t)?(d={},e?d[e]=t:d.milliseconds=t):(u=qe.exec(t))?(i="-"===u[1]?-1:1,d={y:0,d:k(u[mt])*i,h:k(u[bt])*i,m:k(u[_t])*i,s:k(u[wt])*i,ms:k(Le(1e3*u[kt]))*i}):(u=Ze.exec(t))?(i="-"===u[1]?-1:1,d={y:$e(u[2],i),M:$e(u[3],i),w:$e(u[4],i),d:$e(u[5],i),h:$e(u[6],i),m:$e(u[7],i),s:$e(u[8],i)}):null==d?d={}:"object"==typeof d&&("from"in d||"to"in d)&&(r=Ne(d.from),s=Ne(d.to),o=r.isValid()&&s.isValid()?(s=Ve(s,r),r.isBefore(s)?h=Ke(r,s):((h=Ke(s,r)).milliseconds=-h.milliseconds,h.months=-h.months),h):{milliseconds:0,months:0},(d={}).ms=o.milliseconds,d.M=o.months),n=new je(d),ze(t)&&l(t,"_locale")&&(n._locale=t._locale),n}function $e(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Ke(t,e){var i={};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Je(t,e){return function(i,n){var o;return null===n||isNaN(+n)||(E(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),Qe(this,Xe(i="string"==typeof i?+i:i,n),t),this}}function Qe(t,e,i,o){var r=e._milliseconds,s=Le(e._days),a=Le(e._months);t.isValid()&&(o=null==o||o,a&&Yt(t,Ct(t,"Month")+a*i),s&&Pt(t,"Date",Ct(t,"Date")+s*i),r&&t._d.setTime(t._d.valueOf()+r*i),o&&n.updateOffset(t,s||a))}Xe.fn=je.prototype,Xe.invalid=function(){return Xe(NaN)};var ti=Je(1,"add"),ei=Je(-1,"subtract");function ii(t,e){var i=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(i,"months");return-(i+(e-n<0?(e-n)/(n-t.clone().add(i-1,"months")):(e-n)/(t.clone().add(i+1,"months")-n)))||0}function ni(t){var e;return void 0===t?this._locale._abbr:(null!=(e=ve(t))&&(this._locale=e),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var oi=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function ri(){return this._locale}var ai=1e3,hi=60*ai,di=60*hi,li=3506328*di;function ui(t,e){return(t%e+e)%e}function ci(t,e,i){return t<100&&t>=0?new Date(t+400,e,i)-li:new Date(t,e,i).valueOf()}function fi(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-li:Date.UTC(t,e,i)}function pi(t,e){W(0,[t,t.length],0,e)}function vi(t,e,i,n,o){var r;return null==t?Gt(this,n,o).year:(e>(r=qt(t,n,o))&&(e=r),gi.call(this,t,e,i,n,o))}function gi(t,e,i,n,o){var r=Ut(t,e,i,n,o),s=Wt(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}W(0,["gg",2],0,(function(){return this.weekYear()%100})),W(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),pi("gggg","weekYear"),pi("ggggg","weekYear"),pi("GGGG","isoWeekYear"),pi("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),dt("G",ot),dt("g",ot),dt("GG",K,q),dt("gg",K,q),dt("GGGG",et,X),dt("gggg",et,X),dt("GGGGG",it,$),dt("ggggg",it,$),pt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=k(t)})),pt(["gg","GG"],(function(t,e,i,o){e[o]=n.parseTwoDigitYear(t)})),W("Q",0,"Qo","quarter"),N("quarter","Q"),Y("quarter",7),dt("Q",G),ft("Q",(function(t,e){e[yt]=3*(k(t)-1)})),W("D",["DD",2],"Do","date"),N("date","D"),Y("date",9),dt("D",K),dt("DD",K,q),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),ft(["D","DD"],mt),ft("Do",(function(t,e){e[mt]=k(t.match(K)[0])}));var yi=Tt("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),Y("dayOfYear",4),dt("DDD",tt),dt("DDDD",Z),ft(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=k(t)})),W("m",["mm",2],0,"minute"),N("minute","m"),Y("minute",14),dt("m",K),dt("mm",K,q),ft(["m","mm"],_t);var mi=Tt("Minutes",!1);W("s",["ss",2],0,"second"),N("second","s"),Y("second",15),dt("s",K),dt("ss",K,q),ft(["s","ss"],wt);var bi,_i=Tt("Seconds",!1);for(W("S",0,0,(function(){return~~(this.millisecond()/100)})),W(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),W(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),W(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),W(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),W(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),W(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),N("millisecond","ms"),Y("millisecond",16),dt("S",tt,G),dt("SS",tt,q),dt("SSS",tt,Z),bi="SSSS";bi.length<=9;bi+="S")dt(bi,nt);function wi(t,e){e[kt]=k(1e3*("0."+t))}for(bi="S";bi.length<=9;bi+="S")ft(bi,wi);var ki=Tt("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var xi=b.prototype;function Si(t){return t}xi.add=ti,xi.calendar=function(t,e){var i=t||Ne(),o=Ve(i,this).startOf("day"),r=n.calendarFormat(this,o)||"sameElse",s=e&&(T(e[r])?e[r].call(this,i):e[r]);return this.format(s||this.localeData().calendar(r,this,Ne(i)))},xi.clone=function(){return new b(this)},xi.diff=function(t,e,i){var n,o,r;if(!this.isValid())return NaN;if(!(n=Ve(t,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),e=F(e)){case"year":r=ii(this,n)/12;break;case"month":r=ii(this,n);break;case"quarter":r=ii(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-o)/864e5;break;case"week":r=(this-n-o)/6048e5;break;default:r=this-n}return i?r:w(r)},xi.endOf=function(t){var e;if(void 0===(t=F(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?fi:ci;switch(t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=di-ui(e+(this._isUTC?0:this.utcOffset()*hi),di)-1;break;case"minute":e=this._d.valueOf(),e+=hi-ui(e,hi)-1;break;case"second":e=this._d.valueOf(),e+=ai-ui(e,ai)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},xi.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)},xi.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Ne(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},xi.fromNow=function(t){return this.from(Ne(),t)},xi.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Ne(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},xi.toNow=function(t){return this.to(Ne(),t)},xi.get=function(t){return T(this[t=F(t)])?this[t]():this},xi.invalidAt=function(){return f(this).overflow},xi.isAfter=function(t,e){var i=_(t)?t:Ne(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())},xi.isBefore=function(t,e){var i=_(t)?t:Ne(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())},xi.isBetween=function(t,e,i,n){var o=_(t)?t:Ne(t),r=_(e)?e:Ne(e);return!!(this.isValid()&&o.isValid()&&r.isValid())&&("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(r,i):!this.isAfter(r,i))},xi.isSame=function(t,e){var i,n=_(t)?t:Ne(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))},xi.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},xi.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},xi.isValid=function(){return p(this)},xi.lang=oi,xi.locale=ni,xi.localeData=ri,xi.max=Ae,xi.min=Fe,xi.parsingFlags=function(){return u({},f(this))},xi.set=function(t,e){if("object"==typeof t)for(var i=function(t){var e=[];for(var i in t)e.push({unit:i,priority:R[i]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=A(t)),n=0;n<i.length;n++)this[i[n].unit](t[i[n].unit]);else if(T(this[t=F(t)]))return this[t](e);return this},xi.startOf=function(t){var e;if(void 0===(t=F(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?fi:ci;switch(t){case"year":e=i(this.year(),0,1);break;case"quarter":e=i(this.year(),this.month()-this.month()%3,1);break;case"month":e=i(this.year(),this.month(),1);break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=i(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=ui(e+(this._isUTC?0:this.utcOffset()*hi),di);break;case"minute":e=this._d.valueOf(),e-=ui(e,hi);break;case"second":e=this._d.valueOf(),e-=ui(e,ai)}return this._d.setTime(e),n.updateOffset(this,!0),this},xi.subtract=ei,xi.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},xi.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},xi.toDate=function(){return new Date(this.valueOf())},xi.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,i=e?this.clone().utc():this;return i.year()<0||i.year()>9999?V(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(i,"Z")):V(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},xi.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+o)},xi.toJSON=function(){return this.isValid()?this.toISOString():null},xi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},xi.unix=function(){return Math.floor(this.valueOf()/1e3)},xi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},xi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},xi.year=Et,xi.isLeapYear=function(){return Dt(this.year())},xi.weekYear=function(t){return vi.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},xi.isoWeekYear=function(t){return vi.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},xi.quarter=xi.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},xi.month=jt,xi.daysInMonth=function(){return It(this.year(),this.month())},xi.week=xi.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},xi.isoWeek=xi.isoWeeks=function(t){var e=Gt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},xi.weeksInYear=function(){var t=this.localeData()._week;return qt(this.year(),t.dow,t.doy)},xi.isoWeeksInYear=function(){return qt(this.year(),1,4)},xi.date=yi,xi.day=xi.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},xi.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},xi.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},xi.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},xi.hour=xi.hours=ae,xi.minute=xi.minutes=mi,xi.second=xi.seconds=_i,xi.millisecond=xi.milliseconds=ki,xi.utcOffset=function(t,e,i){var o,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=We(st,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(o=Ue(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!e||this._changeInProgress?Qe(this,Xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ue(this)},xi.utc=function(t){return this.utcOffset(0,t)},xi.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ue(this),"m")),this},xi.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=We(rt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},xi.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ne(t).utcOffset():0,(this.utcOffset()-t)%60==0)},xi.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},xi.isLocal=function(){return!!this.isValid()&&!this._isUTC},xi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},xi.isUtc=Ge,xi.isUTC=Ge,xi.zoneAbbr=function(){return this._isUTC?"UTC":""},xi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},xi.dates=O("dates accessor is deprecated. Use date instead.",yi),xi.months=O("months accessor is deprecated. Use month instead",jt),xi.years=O("years accessor is deprecated. Use year instead",Et),xi.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),xi.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=Pe(t))._a){var e=t._isUTC?c(t._a):Ne(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Oi=P.prototype;function Di(t,e,i,n){var o=ve(),r=c().set(n,e);return o[i](r,t)}function Mi(t,e,i){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return Di(t,e,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=Di(t,n,i,"month");return o}function Ei(t,e,i,n){"boolean"==typeof t?(a(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,a(e)&&(i=e,e=void 0),e=e||"");var o,r=ve(),s=t?r._week.dow:0;if(null!=i)return Di(e,(i+s)%7,n,"day");var h=[];for(o=0;o<7;o++)h[o]=Di(e,(o+s)%7,n,"day");return h}Oi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return T(n)?n.call(e,i):n},Oi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Oi.invalidDate=function(){return this._invalidDate},Oi.ordinal=function(t){return this._ordinal.replace("%d",t)},Oi.preparse=Si,Oi.postformat=Si,Oi.relativeTime=function(t,e,i,n){var o=this._relativeTime[i];return T(o)?o(t,e,i,n):o.replace(/%d/i,t)},Oi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return T(i)?i(e):i.replace(/%s/i,e)},Oi.set=function(t){var e,i;for(i in t)T(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Oi.months=function(t,e){return t?o(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Nt).test(e)?"format":"standalone"][t.month()]:o(this._months)?this._months:this._months.standalone},Oi.monthsShort=function(t,e){return t?o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Nt.test(e)?"format":"standalone"][t.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Oi.monthsParse=function(t,e,i){var n,o,r;if(this._monthsParseExact)return Rt.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=c([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},Oi.monthsRegex=function(t){return this._monthsParseExact?(l(this,"_monthsRegex")||Bt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=Lt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Oi.monthsShortRegex=function(t){return this._monthsParseExact?(l(this,"_monthsRegex")||Bt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=zt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Oi.week=function(t){return Gt(t,this._week.dow,this._week.doy).week},Oi.firstDayOfYear=function(){return this._week.doy},Oi.firstDayOfWeek=function(){return this._week.dow},Oi.weekdays=function(t,e){var i=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Zt(i,this._week.dow):t?i[t.day()]:i},Oi.weekdaysMin=function(t){return!0===t?Zt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Oi.weekdaysShort=function(t){return!0===t?Zt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Oi.weekdaysParse=function(t,e,i){var n,o,r;if(this._weekdaysParseExact)return Jt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=c([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},Oi.weekdaysRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Qt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Oi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=te),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Oi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ee),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Oi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Oi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},fe("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=O("moment.lang is deprecated. Use moment.locale instead.",fe),n.langData=O("moment.langData is deprecated. Use moment.localeData instead.",ve);var Ti=Math.abs;function Ci(t,e,i,n){var o=Xe(e,i);return t._milliseconds+=n*o._milliseconds,t._days+=n*o._days,t._months+=n*o._months,t._bubble()}function Pi(t){return t<0?Math.floor(t):Math.ceil(t)}function Ii(t){return 4800*t/146097}function Ni(t){return 146097*t/4800}function Fi(t){return function(){return this.as(t)}}var Ai=Fi("ms"),Ri=Fi("s"),Yi=Fi("m"),ji=Fi("h"),zi=Fi("d"),Li=Fi("w"),Bi=Fi("M"),Hi=Fi("Q"),Wi=Fi("y");function Vi(t){return function(){return this.isValid()?this._data[t]:NaN}}var Ui=Vi("milliseconds"),Gi=Vi("seconds"),qi=Vi("minutes"),Zi=Vi("hours"),Xi=Vi("days"),$i=Vi("months"),Ki=Vi("years"),Ji=Math.round,Qi={ss:44,s:45,m:45,h:22,d:26,M:11};function tn(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}var en=Math.abs;function nn(t){return(t>0)-(t<0)||+t}function on(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=en(this._milliseconds)/1e3,n=en(this._days),o=en(this._months);t=w(i/60),e=w(t/60),i%=60,t%=60;var r=w(o/12),s=o%=12,a=n,h=e,d=t,l=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",f=nn(this._months)!==nn(u)?"-":"",p=nn(this._days)!==nn(u)?"-":"",v=nn(this._milliseconds)!==nn(u)?"-":"";return c+"P"+(r?f+r+"Y":"")+(s?f+s+"M":"")+(a?p+a+"D":"")+(h||d||l?"T":"")+(h?v+h+"H":"")+(d?v+d+"M":"")+(l?v+l+"S":"")}var rn=je.prototype;return rn.isValid=function(){return this._isValid},rn.abs=function(){var t=this._data;return this._milliseconds=Ti(this._milliseconds),this._days=Ti(this._days),this._months=Ti(this._months),t.milliseconds=Ti(t.milliseconds),t.seconds=Ti(t.seconds),t.minutes=Ti(t.minutes),t.hours=Ti(t.hours),t.months=Ti(t.months),t.years=Ti(t.years),this},rn.add=function(t,e){return Ci(this,t,e,1)},rn.subtract=function(t,e){return Ci(this,t,e,-1)},rn.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=F(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Ii(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Ni(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},rn.asMilliseconds=Ai,rn.asSeconds=Ri,rn.asMinutes=Yi,rn.asHours=ji,rn.asDays=zi,rn.asWeeks=Li,rn.asMonths=Bi,rn.asQuarters=Hi,rn.asYears=Wi,rn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},rn._bubble=function(){var t,e,i,n,o,r=this._milliseconds,s=this._days,a=this._months,h=this._data;return r>=0&&s>=0&&a>=0||r<=0&&s<=0&&a<=0||(r+=864e5*Pi(Ni(a)+s),s=0,a=0),h.milliseconds=r%1e3,t=w(r/1e3),h.seconds=t%60,e=w(t/60),h.minutes=e%60,i=w(e/60),h.hours=i%24,s+=w(i/24),o=w(Ii(s)),a+=o,s-=Pi(Ni(o)),n=w(a/12),a%=12,h.days=s,h.months=a,h.years=n,this},rn.clone=function(){return Xe(this)},rn.get=function(t){return t=F(t),this.isValid()?this[t+"s"]():NaN},rn.milliseconds=Ui,rn.seconds=Gi,rn.minutes=qi,rn.hours=Zi,rn.days=Xi,rn.weeks=function(){return w(this.days()/7)},rn.months=$i,rn.years=Ki,rn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=function(t,e,i){var n=Xe(t).abs(),o=Ji(n.as("s")),r=Ji(n.as("m")),s=Ji(n.as("h")),a=Ji(n.as("d")),h=Ji(n.as("M")),d=Ji(n.as("y")),l=o<=Qi.ss&&["s",o]||o<Qi.s&&["ss",o]||r<=1&&["m"]||r<Qi.m&&["mm",r]||s<=1&&["h"]||s<Qi.h&&["hh",s]||a<=1&&["d"]||a<Qi.d&&["dd",a]||h<=1&&["M"]||h<Qi.M&&["MM",h]||d<=1&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=i,tn.apply(null,l)}(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},rn.toISOString=on,rn.toString=on,rn.toJSON=on,rn.locale=ni,rn.localeData=ri,rn.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",on),rn.lang=oi,W("X",0,0,"unix"),W("x",0,0,"valueOf"),dt("x",ot),dt("X",/[+-]?\d+(\.\d{1,3})?/),ft("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),ft("x",(function(t,e,i){i._d=new Date(k(t))})),n.version="2.24.0",e=Ne,n.fn=xi,n.min=function(){return Re("isBefore",[].slice.call(arguments,0))},n.max=function(){return Re("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=c,n.unix=function(t){return Ne(1e3*t)},n.months=function(t,e){return Mi(t,e,"months")},n.isDate=h,n.locale=fe,n.invalid=v,n.duration=Xe,n.isMoment=_,n.weekdays=function(t,e,i){return Ei(t,e,i,"weekdays")},n.parseZone=function(){return Ne.apply(null,arguments).parseZone()},n.localeData=ve,n.isDuration=ze,n.monthsShort=function(t,e){return Mi(t,e,"monthsShort")},n.weekdaysMin=function(t,e,i){return Ei(t,e,i,"weekdaysMin")},n.defineLocale=pe,n.updateLocale=function(t,e){if(null!=e){var i,n,o=he;null!=(n=ce(t))&&(o=n._config),e=C(o,e),(i=new P(e)).parentLocale=de[t],de[t]=i,fe(t)}else null!=de[t]&&(null!=de[t].parentLocale?de[t]=de[t].parentLocale:null!=de[t]&&delete de[t]);return de[t]},n.locales=function(){return D(de)},n.weekdaysShort=function(t,e,i){return Ei(t,e,i,"weekdaysShort")},n.normalizeUnits=F,n.relativeTimeRounding=function(t){return void 0===t?Ji:"function"==typeof t&&(Ji=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Qi[t]&&(void 0===e?Qi[t]:(Qi[t]=e,"s"===t&&(Qi.ss=e-1),!0))},n.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},n.prototype=xi,n.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"},n}()})),Gr=[],qr=0;qr<256;qr++)Gr[qr]=(qr+256).toString(16).substr(1);for(var Zr=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var t=new Uint8Array(16);return function(){return crypto.getRandomValues(t),t}}var e=new Array(16);return function(){for(var t,i=0;i<16;i++)0==(3&i)&&(t=4294967296*Math.random()),e[i]=t>>>((3&i)<<3)&255;return e}}(),Xr=[],$r=0;$r<256;$r++)Xr[$r]=($r+256).toString(16).substr(1);var Kr=Zr();Kr[0],Kr[1],Kr[2],Kr[3],Kr[4],Kr[5],Kr[6],Kr[7];function Jr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=e&&i||0;"string"==typeof t&&(e="binary"===t?new Array(16):void 0,t={});var o=t.random||(t.rng||Zr)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var r=0;r<16;r++)e[n+r]=o[r];return e||function(t,e){var i=e||0,n=Gr;return n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]}(o)}var Qr=/^\/?Date\((-?\d+)/i,ts=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,es=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,is=/^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,ns=/^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;function os(t){return t instanceof Number||"number"==typeof t}function rs(t){if(t)for(;!0===t.hasChildNodes();){var e=t.firstChild;e&&(rs(e),t.removeChild(e))}}function ss(t){return t instanceof String||"string"==typeof t}function as(t){return"object"===so(t)&&null!==t}function hs(t){if(t instanceof Date)return!0;if(ss(t)){if(Qr.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1}function ds(t){return Ur.isMoment(t)}function ls(t,e,i,n){var o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}function us(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var n in t)if(void 0!==e[n])if(null===e[n]||"object"!==so(e[n]))ls(t,e,n,i);else{var o=t[n],r=e[n];as(o)&&as(r)&&us(o,r,i)}}var cs=Object.assign;function fs(t,e){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var i=arguments.length,n=new Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];for(var r=0,s=n;r<s.length;r++)for(var a=s[r],h=0;h<t.length;h++){var d=t[h];a&&Object.prototype.hasOwnProperty.call(a,d)&&(e[d]=a[d])}return e}function ps(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o=0;o<t.length;o++){var r=t[o];if(Object.prototype.hasOwnProperty.call(i,r))if(i[r]&&i[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r].constructor===Object?gs(e[r],i[r],!1,n):ls(e,i,r,n);else{if(Array.isArray(i[r]))throw new TypeError("Arrays are not supported by deepExtend");ls(e,i,r,n)}}return e}function vs(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&-1===t.indexOf(o))if(i[o]&&i[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?gs(e[o],i[o]):ls(e,i,o,n);else if(Array.isArray(i[o])){e[o]=[];for(var r=0;r<i[o].length;r++)e[o].push(i[o][r])}else ls(e,i,o,n);return e}function gs(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var o in e)(Object.prototype.hasOwnProperty.call(e,o)||!0===i)&&("object"===so(e[o])&&null!==e[o]&&Object.getPrototypeOf(e[o])===Object.prototype?void 0===t[o]?t[o]=gs({},e[o],i):"object"===so(t[o])&&null!==t[o]&&Object.getPrototypeOf(t[o])===Object.prototype?gs(t[o],e[o],i):ls(t,e,o,n):Array.isArray(e[o])?t[o]=e[o].slice():ls(t,e,o,n));return t}function ys(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!=e[i])return!1;return!0}function ms(t,e){var i;if(void 0!==t){if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return ss(t)&&!isNaN(Date.parse(t))?Ur(t).valueOf():Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(os(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(ds(t))return new Date(t.valueOf());if(ss(t))return(i=Qr.exec(t))?new Date(Number(i[1])):Ur(new Date(t)).toDate();throw new Error("Cannot convert object of type "+bs(t)+" to type Date");case"Moment":if(os(t))return Ur(t);if(t instanceof Date)return Ur(t.valueOf());if(ds(t))return Ur(t);if(ss(t))return i=Qr.exec(t),Ur(i?Number(i[1]):t);throw new Error("Cannot convert object of type "+bs(t)+" to type Date");case"ISODate":if(os(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(ds(t))return t.toDate().toISOString();if(ss(t))return(i=Qr.exec(t))?new Date(Number(i[1])).toISOString():Ur(t).format();throw new Error("Cannot convert object of type "+bs(t)+" to type ISODate");case"ASPDate":if(os(t))return"/Date("+t+")/";if(t instanceof Date||ds(t))return"/Date("+t.valueOf()+")/";if(ss(t))return"/Date("+((i=Qr.exec(t))?new Date(Number(i[1])).valueOf():new Date(t).valueOf())+")/";throw new Error("Cannot convert object of type "+bs(t)+" to type ASPDate");default:throw new Error("Unknown type ".concat(e))}}}function bs(t){var e=so(t);return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function _s(t,e){return[].concat(lo(t),[e])}function ws(t){return t.slice()}function ks(t){return t.getBoundingClientRect().left}function xs(t){return t.getBoundingClientRect().right}function Ss(t){return t.getBoundingClientRect().top}function Os(t,e){var i=t.className.split(" "),n=e.split(" ");i=i.concat(n.filter((function(t){return i.indexOf(t)<0}))),t.className=i.join(" ")}function Ds(t,e){var i=t.className.split(" "),n=e.split(" ");i=i.filter((function(t){return n.indexOf(t)<0})),t.className=i.join(" ")}function Ms(t,e){if(Array.isArray(t))for(var i=t.length,n=0;n<i;n++)e(t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e(t[o],o,t)}var Es=Object.values;function Ts(t,e,i){return t[e]!==i&&(t[e]=i,!0)}function Cs(t){var e=!1;return function(){e||(e=!0,requestAnimationFrame((function(){e=!1,t()})))}}function Ps(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)}function Is(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)}function Ns(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}function Fs(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,e=null;return t&&(t.target?e=t.target:t.srcElement&&(e=t.srcElement)),e instanceof Element&&(null==e.nodeType||3!=e.nodeType||(e=e.parentNode)instanceof Element)?e:null}function As(t,e){for(var i=t;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1}var Rs={asBoolean:function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},asNumber:function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},asString:function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},asSize:function(t,e){return"function"==typeof t&&(t=t()),ss(t)?t:os(t)?t+"px":e||null},asElement:function(t,e){return"function"==typeof t&&(t=t()),t||e||null}};function Ys(t){var e;switch(t.length){case 3:case 4:return(e=es.exec(t))?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return(e=ts.exec(t))?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function js(t,e){if(-1!==t.indexOf("rgba"))return t;if(-1!==t.indexOf("rgb")){var i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}var n=Ys(t);return null==n?t:"rgba("+n.r+","+n.g+","+n.b+","+e+")"}function zs(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function Ls(t,e){if(ss(t)){var i=t;if(Xs(i)){var n=i.substr(4).substr(0,i.length-5).split(",").map((function(t){return parseInt(t)}));i=zs(n[0],n[1],n[2])}if(!0===Zs(i)){var o=qs(i),r={h:o.h,s:.8*o.s,v:Math.min(1,1.02*o.v)},s={h:o.h,s:Math.min(1,1.25*o.s),v:.8*o.v},a=Gs(s.h,s.s,s.v),h=Gs(r.h,r.s,r.v);return{background:i,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}return{background:i,border:i,highlight:{background:i,border:i},hover:{background:i,border:i}}}return e?{background:t.background||e.background,border:t.border||e.border,highlight:ss(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||e.highlight.background,border:t.highlight&&t.highlight.border||e.highlight.border},hover:ss(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||e.hover.border,background:t.hover&&t.hover.background||e.hover.background}}:{background:t.background||void 0,border:t.border||void 0,highlight:ss(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:ss(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}}function Bs(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,Math.min(e,i)),o=Math.max(t,Math.max(e,i));return n===o?{h:0,s:0,v:n}:{h:60*((t===n?3:i===n?1:5)-(t===n?e-i:i===n?t-e:i-t)/(o-n))/360,s:(o-n)/o,v:o}}var Hs={split:function(t){var e={};return t.split(";").forEach((function(t){if(""!=t.trim()){var i=t.split(":"),n=i[0].trim(),o=i[1].trim();e[n]=o}})),e},join:function(t){return Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")}};function Ws(t,e){var i=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ho(i,!0).forEach((function(e){ao(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ho(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},Hs.split(t.style.cssText),{},Hs.split(e));t.style.cssText=Hs.join(i)}function Vs(t,e){var i=Hs.split(t.style.cssText),n=Hs.split(e);for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&delete i[o];t.style.cssText=Hs.join(i)}function Us(t,e,i){var n,o,r,s=Math.floor(6*t),a=6*t-s,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(s%6){case 0:n=i,o=l,r=h;break;case 1:n=d,o=i,r=h;break;case 2:n=h,o=i,r=l;break;case 3:n=h,o=d,r=i;break;case 4:n=l,o=h,r=i;break;case 5:n=i,o=h,r=d}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*r)}}function Gs(t,e,i){var n=Us(t,e,i);return zs(n.r,n.g,n.b)}function qs(t){var e=Ys(t);if(!e)throw new TypeError("'".concat(t,"' is not a valid color."));return Bs(e.r,e.g,e.b)}function Zs(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function Xs(t){return is.test(t)}function $s(t){return ns.test(t)}function Ks(t,e){if(null!==e&&"object"===so(e)){for(var i=Object.create(e),n=0;n<t.length;n++)Object.prototype.hasOwnProperty.call(e,t[n])&&"object"==so(e[t[n]])&&(i[t[n]]=Js(e[t[n]]));return i}return null}function Js(t){if(null===t||"object"!==so(t))return null;if(t instanceof Element)return t;var e=Object.create(t);for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"object"==so(t[i])&&(e[i]=Js(t[i]));return e}function Qs(t,e){for(var i=0;i<t.length;i++){var n=t[i],o=void 0;for(o=i;o>0&&e(n,t[o-1])<0;o--)t[o]=t[o-1];t[o]=n}return t}function ta(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=function(t){return null!=t},r=function(t){return null!==t&&"object"===so(t)};if(!r(t))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!o(i))throw new Error("Parameter option must have a value");if(!r(n))throw new Error("Parameter globalOptions must be an object");var s=e[i],a=r(n)&&!function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[i]:void 0,h=a?a.enabled:void 0;if(void 0!==s){if("boolean"==typeof s)return r(t[i])||(t[i]={}),void(t[i].enabled=s);if(null===s&&!r(t[i])){if(!o(a))return;t[i]=Object.create(a)}if(r(s)){var d=!0;void 0!==s.enabled?d=s.enabled:void 0!==h&&(d=a.enabled),function(t,e,i){r(t[i])||(t[i]={});var n=e[i],o=t[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}(t,e,i),t[i].enabled=d}}}function ea(t,e,i,n){for(var o=0,r=0,s=t.length-1;r<=s&&o<1e4;){var a=Math.floor((r+s)/2),h=t[a],d=e(void 0===n?h[i]:h[i][n]);if(0==d)return a;-1==d?r=a+1:s=a-1,o++}return-1}function ia(t,e,i,n,o){var r,s,a,h,d=0,l=0,u=t.length-1;for(o=null!=o?o:function(t,e){return t==e?0:t<e?-1:1};l<=u&&d<1e4;){if(h=Math.floor(.5*(u+l)),r=t[Math.max(0,h-1)][i],s=t[h][i],a=t[Math.min(t.length-1,h+1)][i],0==o(s,e))return h;if(o(r,e)<0&&o(s,e)>0)return"before"==n?Math.max(0,h-1):h;if(o(s,e)<0&&o(a,e)>0)return"before"==n?h:Math.min(t.length-1,h+1);o(s,e)<0?l=h+1:u=h-1,d++}return-1}var na={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}};function oa(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),i-n}function ra(t,e){var i;Array.isArray(e)||(e=[e]);var n=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var h=s.value;if(h){i=h[e[0]];for(var d=1;d<e.length;d++)i&&(i=i[e[d]]);if(void 0!==i)break}}}catch(t){o=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw r}}return i}var sa=Object.freeze({isNumber:os,recursiveDOMDelete:rs,isString:ss,isObject:as,isDate:hs,isMoment:ds,fillIfDefined:us,extend:cs,selectiveExtend:fs,selectiveDeepExtend:ps,selectiveNotDeepExtend:vs,deepExtend:gs,equalArray:ys,convert:ms,getType:bs,copyAndExtendArray:_s,copyArray:ws,getAbsoluteLeft:ks,getAbsoluteRight:xs,getAbsoluteTop:Ss,addClassName:Os,removeClassName:Ds,forEach:Ms,toArray:Es,updateProperty:Ts,throttle:Cs,addEventListener:Ps,removeEventListener:Is,preventDefault:Ns,getTarget:Fs,hasParent:As,option:Rs,hexToRGB:Ys,overrideOpacity:js,RGBToHex:zs,parseColor:Ls,RGBToHSV:Bs,addCssText:Ws,removeCssText:Vs,HSVToRGB:Us,HSVToHex:Gs,hexToHSV:qs,isValidHex:Zs,isValidRGB:Xs,isValidRGBA:$s,selectiveBridgeObject:Ks,bridgeObject:Js,insertSort:Qs,mergeOptions:ta,binarySearchCustom:ea,binarySearchValue:ia,easingFunctions:na,getScrollBarWidth:oa,topMost:ra,randomUUID:Jr}),aa=Object.freeze({__proto__:null,default:sa,HSVToHex:Gs,HSVToRGB:Us,RGBToHSV:Bs,RGBToHex:zs,addClassName:Os,addCssText:Ws,addEventListener:Ps,binarySearchCustom:ea,binarySearchValue:ia,bridgeObject:Js,convert:ms,copyAndExtendArray:_s,copyArray:ws,deepExtend:gs,easingFunctions:na,equalArray:ys,extend:cs,fillIfDefined:us,forEach:Ms,getAbsoluteLeft:ks,getAbsoluteRight:xs,getAbsoluteTop:Ss,getScrollBarWidth:oa,getTarget:Fs,getType:bs,hasParent:As,hexToHSV:qs,hexToRGB:Ys,insertSort:Qs,isDate:hs,isMoment:ds,isNumber:os,isObject:as,isString:ss,isValidHex:Zs,isValidRGB:Xs,isValidRGBA:$s,mergeOptions:ta,option:Rs,overrideOpacity:js,parseColor:Ls,preventDefault:Ns,randomUUID:Jr,recursiveDOMDelete:rs,removeClassName:Ds,removeCssText:Vs,removeEventListener:Is,selectiveBridgeObject:Ks,selectiveDeepExtend:ps,selectiveExtend:fs,selectiveNotDeepExtend:vs,throttle:Cs,toArray:Es,topMost:ra,updateProperty:Ts}),ha=function(t,e,i){if(Xe(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}},da=Array.isArray||function(t){return"Array"==v(t)},la=Ft("species"),ua=function(t,e){var i;return da(t)&&("function"!=typeof(i=t.constructor)||i!==Array&&!da(i.prototype)?_(i)&&null===(i=i[la])&&(i=void 0):i=void 0),new(void 0===i?Array:i)(0===e?0:e)},ca=[].push,fa=function(t){var e=1==t,i=2==t,n=3==t,o=4==t,r=6==t,s=5==t||r;return function(a,h,d,l){for(var u,c,f=jt(a),p=y(f),v=ha(h,d,3),g=ht(p.length),m=0,b=l||ua,_=e?b(a,g):i?b(a,0):void 0;g>m;m++)if((s||m in p)&&(c=v(u=p[m],m,f),t))if(e)_[m]=c;else if(c)switch(t){case 3:return!0;case 5:return u;case 6:return m;case 2:ca.call(_,u)}else if(o)return!1;return r?-1:n||o?o:_}},pa={forEach:fa(0),map:fa(1),filter:fa(2),some:fa(3),every:fa(4),find:fa(5),findIndex:fa(6)},va=function(t,e){var i=[][t];return!i||!h((function(){i.call(null,e||function(){throw 1},1)}))},ga=pa.forEach,ya=va("forEach")?function(t){return ga(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach;Ct({target:"Array",proto:!0,forced:[].forEach!=ya},{forEach:ya});var ma=Object.keys||function(t){return vt(t,gt)},ba=d?Object.defineProperties:function(t,e){C(t);for(var i,n=ma(e),o=n.length,r=0;o>r;)I.f(t,i=n[r++],e[i]);return t},_a=nt("document","documentElement"),wa=V("IE_PROTO"),ka=function(){},xa=function(){var t,e=D("iframe"),i=gt.length;for(e.style.display="none",_a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),xa=t.F;i--;)delete xa.prototype[gt[i]];return xa()},Sa=Object.create||function(t,e){var i;return null!==t?(ka.prototype=C(t),i=new ka,ka.prototype=null,i[wa]=t):i=xa(),void 0===e?i:ba(i,e)};U[wa]=!0;var Oa=Ft("unscopables"),Da=Array.prototype;null==Da[Oa]&&N(Da,Oa,Sa(null));var Ma=function(t){Da[Oa][t]=!0},Ea=ft.includes;Ct({target:"Array",proto:!0},{includes:function(t){return Ea(this,t,arguments.length>1?arguments[1]:void 0)}}),Ma("includes");var Ta=ft.indexOf,Ca=[].indexOf,Pa=!!Ca&&1/[1].indexOf(1,-0)<0,Ia=va("indexOf");Ct({target:"Array",proto:!0,forced:Pa||Ia},{indexOf:function(t){return Pa?Ca.apply(this,arguments)||0:Ta(this,t,arguments.length>1?arguments[1]:void 0)}});var Na,Fa,Aa=function(t,e,i){var n=w(e);n in t?I.f(t,n,f(0,i)):t[n]=i},Ra=nt("navigator","userAgent")||"",Ya=a.process,ja=Ya&&Ya.versions,za=ja&&ja.v8;za?Fa=(Na=za.split("."))[0]+Na[1]:Ra&&(Na=Ra.match(/Chrome\/(\d+)/))&&(Fa=Na[1]);var La=Fa&&+Fa,Ba=Ft("species"),Ha=function(t){return La>=51||!h((function(){var e=[];return(e.constructor={})[Ba]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Wa=Math.max,Va=Math.min;Ct({target:"Array",proto:!0,forced:!Ha("splice")},{splice:function(t,e){var i,n,o,r,s,a,h=jt(this),d=ht(h.length),l=ut(t,d),u=arguments.length;if(0===u?i=n=0:1===u?(i=0,n=d-l):(i=u-2,n=Va(Wa(st(e),0),d-l)),d+i-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(o=ua(h,n),r=0;r<n;r++)(s=l+r)in h&&Aa(o,r,h[s]);if(o.length=n,i<n){for(r=l;r<d-n;r++)a=r+i,(s=r+n)in h?h[a]=h[s]:delete h[a];for(r=d;r>d-n+i;r--)delete h[r-1]}else if(i>n)for(r=d-n;r>l;r--)a=r+i-1,(s=r+n-1)in h?h[a]=h[s]:delete h[a];for(r=0;r<i;r++)h[r+l]=arguments[r+2];return h.length=d-n+i,o}});var Ua=I.f,Ga=Function.prototype,qa=Ga.toString,Za=/^\s*function ([^ (]*)/;!d||"name"in Ga||Ua(Ga,"name",{configurable:!0,get:function(){try{return qa.call(this).match(Za)[1]}catch(t){return""}}});var Xa=function(t,e,i){var n,o;return Wt&&"function"==typeof(n=e.constructor)&&n!==i&&_(o=n.prototype)&&o!==i.prototype&&Wt(t,o),t},$a="\t\n\v\f\r                 \u2028\u2029\ufeff",Ka="["+$a+"]",Ja=RegExp("^"+Ka+Ka+"*"),Qa=RegExp(Ka+Ka+"*$"),th=function(t){return function(e){var i=String(m(e));return 1&t&&(i=i.replace(Ja,"")),2&t&&(i=i.replace(Qa,"")),i}},eh={start:th(1),end:th(2),trim:th(3)},ih=mt.f,nh=T.f,oh=I.f,rh=eh.trim,sh=a.Number,ah=sh.prototype,hh="Number"==v(Sa(ah)),dh=function(t){var e,i,n,o,r,s,a,h,d=w(t,!1);if("string"==typeof d&&d.length>2)if(43===(e=(d=rh(d)).charCodeAt(0))||45===e){if(88===(i=d.charCodeAt(2))||120===i)return NaN}else if(48===e){switch(d.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+d}for(s=(r=d.slice(2)).length,a=0;a<s;a++)if((h=r.charCodeAt(a))<48||h>o)return NaN;return parseInt(r,n)}return+d};if(Et("Number",!sh(" 0o1")||!sh("0b1")||sh("+0x1"))){for(var lh,uh=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof uh&&(hh?h((function(){ah.valueOf.call(i)})):"Number"!=v(i))?Xa(new sh(dh(e)),i,uh):dh(e)},ch=d?ih(sh):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),fh=0;ch.length>fh;fh++)x(sh,lh=ch[fh])&&!x(uh,lh)&&oh(uh,lh,nh(sh,lh));uh.prototype=ah,ah.constructor=uh,tt(a,"Number",uh)}var ph=function(){var t=C(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},vh=RegExp.prototype.exec,gh=String.prototype.replace,yh=vh,mh=function(){var t=/a/,e=/b*/g;return vh.call(t,"a"),vh.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),bh=void 0!==/()??/.exec("")[1];(mh||bh)&&(yh=function(t){var e,i,n,o,r=this;return bh&&(i=new RegExp("^"+r.source+"$(?!\\s)",ph.call(r))),mh&&(e=r.lastIndex),n=vh.call(r,t),mh&&n&&(r.lastIndex=r.global?n.index+n[0].length:e),bh&&n&&n.length>1&&gh.call(n[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n});var _h=yh;Ct({target:"RegExp",proto:!0,forced:/./.exec!==_h},{exec:_h});var wh=Ft("match"),kh=function(t){var e;return _(t)&&(void 0!==(e=t[wh])?!!e:"RegExp"==v(t))},xh=function(t){if(kh(t))throw TypeError("The method doesn't accept regular expressions");return t},Sh=Ft("match");Ct({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[Sh]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(m(this)).indexOf(xh(t),arguments.length>1?arguments[1]:void 0)}});var Oh=Ft("species"),Dh=!h((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Mh=!h((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2!==i.length||"a"!==i[0]||"b"!==i[1]})),Eh=function(t,e,i,n){var o=Ft(t),r=!h((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),s=r&&!h((function(){var e=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[Oh]=function(){return i},i.flags="",i[o]=/./[o]),i.exec=function(){return e=!0,null},i[o](""),!e}));if(!r||!s||"replace"===t&&!Dh||"split"===t&&!Mh){var a=/./[o],d=i(o,""[t],(function(t,e,i,n,o){return e.exec===_h?r&&!o?{done:!0,value:a.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}})),l=d[0],u=d[1];tt(String.prototype,t,l),tt(RegExp.prototype,o,2==e?function(t,e){return u.call(t,this,e)}:function(t){return u.call(t,this)}),n&&N(RegExp.prototype[o],"sham",!0)}},Th=function(t){return function(e,i){var n,o,r=String(m(e)),s=st(i),a=r.length;return s<0||s>=a?t?"":void 0:(n=r.charCodeAt(s))<55296||n>56319||s+1===a||(o=r.charCodeAt(s+1))<56320||o>57343?t?r.charAt(s):n:t?r.slice(s,s+2):o-56320+(n-55296<<10)+65536}},Ch={codeAt:Th(!1),charAt:Th(!0)},Ph=Ch.charAt,Ih=function(t,e,i){return e+(i?Ph(t,e).length:1)},Nh=function(t,e){var i=t.exec;if("function"==typeof i){var n=i.call(t,e);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==v(t))throw TypeError("RegExp#exec called on incompatible receiver");return _h.call(t,e)},Fh=[].push,Ah=Math.min,Rh=!h((function(){return!RegExp(4294967295,"y")}));Eh("split",2,(function(t,e,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,i){var n=String(m(this)),o=void 0===i?4294967295:i>>>0;if(0===o)return[];if(void 0===t)return[n];if(!kh(t))return e.call(n,t,o);for(var r,s,a,h=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,u=new RegExp(t.source,d+"g");(r=_h.call(u,n))&&!((s=u.lastIndex)>l&&(h.push(n.slice(l,r.index)),r.length>1&&r.index<n.length&&Fh.apply(h,r.slice(1)),a=r[0].length,l=s,h.length>=o));)u.lastIndex===r.index&&u.lastIndex++;return l===n.length?!a&&u.test("")||h.push(""):h.push(n.slice(l)),h.length>o?h.slice(0,o):h}:"0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:e.call(this,t,i)}:e,[function(e,i){var o=m(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,o,i):n.call(String(o),e,i)},function(t,o){var r=i(n,t,this,o,n!==e);if(r.done)return r.value;var s=C(t),a=String(this),h=Ke(s,RegExp),d=s.unicode,l=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(Rh?"y":"g"),u=new h(Rh?s:"^(?:"+s.source+")",l),c=void 0===o?4294967295:o>>>0;if(0===c)return[];if(0===a.length)return null===Nh(u,a)?[a]:[];for(var f=0,p=0,v=[];p<a.length;){u.lastIndex=Rh?p:0;var g,y=Nh(u,Rh?a:a.slice(p));if(null===y||(g=Ah(ht(u.lastIndex+(Rh?0:p)),a.length))===f)p=Ih(a,p,d);else{if(v.push(a.slice(f,p)),v.length===c)return v;for(var m=1;m<=y.length-1;m++)if(v.push(y[m]),v.length===c)return v;p=f=g}}return v.push(a.slice(f)),v}]}),!Rh);var Yh={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var jh in Yh){var zh=a[jh],Lh=zh&&zh.prototype;if(Lh&&Lh.forEach!==ya)try{N(Lh,"forEach",ya)}catch(t){Lh.forEach=ya}}function Bh(t){return Gh=t,function(){var t={};qh=0,void(Zh=Gh.charAt(0)),sd(),"strict"===Xh&&(t.strict=!0,sd());"graph"!==Xh&&"digraph"!==Xh||(t.type=Xh,sd());$h===Vh.IDENTIFIER&&(t.id=Xh,sd());if("{"!=Xh)throw cd("Angle bracket { expected");if(sd(),ad(t),"}"!=Xh)throw cd("Angle bracket } expected");if(sd(),""!==Xh)throw cd("End of file expected");return sd(),delete t.node,delete t.edge,delete t.graph,t}()}var Hh={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Wh=Object.create(Hh);Wh.color="color.color",Wh.style="dashes";var Vh={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Uh={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Gh="",qh=0,Zh="",Xh="",$h=Vh.NULL;function Kh(){qh++,Zh=Gh.charAt(qh)}function Jh(){return Gh.charAt(qh+1)}var Qh=/[a-zA-Z_0-9.:#]/;function td(t){return Qh.test(t)}function ed(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function id(t,e,i){for(var n=e.split("."),o=t;n.length;){var r=n.shift();n.length?(o[r]||(o[r]={}),o=o[r]):o[r]=i}}function nd(t,e){for(var i,n,o=null,r=[t],s=t;s.parent;)r.push(s.parent),s=s.parent;if(s.nodes)for(i=0,n=s.nodes.length;i<n;i++)if(e.id===s.nodes[i].id){o=s.nodes[i];break}for(o||(o={id:e.id},t.node&&(o.attr=ed(o.attr,t.node))),i=r.length-1;i>=0;i--){var a=r[i];a.nodes||(a.nodes=[]),-1===a.nodes.indexOf(o)&&a.nodes.push(o)}e.attr&&(o.attr=ed(o.attr,e.attr))}function od(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=ed({},t.edge);e.attr=ed(i,e.attr)}}function rd(t,e,i,n,o){var r={from:e,to:i,type:n};return t.edge&&(r.attr=ed({},t.edge)),r.attr=ed(r.attr||{},o),null!=o&&o.hasOwnProperty("arrows")&&null!=o.arrows&&(r.arrows={to:{enabled:!0,type:o.arrows.type}},o.arrows=null),r}function sd(){for($h=Vh.NULL,Xh="";" "===Zh||"\t"===Zh||"\n"===Zh||"\r"===Zh;)Kh();do{var t=!1;if("#"===Zh){for(var e=qh-1;" "===Gh.charAt(e)||"\t"===Gh.charAt(e);)e--;if("\n"===Gh.charAt(e)||""===Gh.charAt(e)){for(;""!=Zh&&"\n"!=Zh;)Kh();t=!0}}if("/"===Zh&&"/"===Jh()){for(;""!=Zh&&"\n"!=Zh;)Kh();t=!0}if("/"===Zh&&"*"===Jh()){for(;""!=Zh;){if("*"===Zh&&"/"===Jh()){Kh(),Kh();break}Kh()}t=!0}for(;" "===Zh||"\t"===Zh||"\n"===Zh||"\r"===Zh;)Kh()}while(t);if(""!==Zh){var i=Zh+Jh();if(Uh[i])return $h=Vh.DELIMITER,Xh=i,Kh(),void Kh();if(Uh[Zh])return $h=Vh.DELIMITER,Xh=Zh,void Kh();if(td(Zh)||"-"===Zh){for(Xh+=Zh,Kh();td(Zh);)Xh+=Zh,Kh();return"false"===Xh?Xh=!1:"true"===Xh?Xh=!0:isNaN(Number(Xh))||(Xh=Number(Xh)),void($h=Vh.IDENTIFIER)}if('"'===Zh){for(Kh();""!=Zh&&('"'!=Zh||'"'===Zh&&'"'===Jh());)'"'===Zh?(Xh+=Zh,Kh()):"\\"===Zh&&"n"===Jh()?(Xh+="\n",Kh()):Xh+=Zh,Kh();if('"'!=Zh)throw cd('End of string " expected');return Kh(),void($h=Vh.IDENTIFIER)}for($h=Vh.UNKNOWN;""!=Zh;)Xh+=Zh,Kh();throw new SyntaxError('Syntax error in part "'+fd(Xh,30)+'"')}$h=Vh.DELIMITER}function ad(t){for(;""!==Xh&&"}"!=Xh;)hd(t),";"===Xh&&sd()}function hd(t){var e=dd(t);if(e)ld(t,e);else if(!function(t){if("node"===Xh)return sd(),t.node=ud(),"node";if("edge"===Xh)return sd(),t.edge=ud(),"edge";if("graph"===Xh)return sd(),t.graph=ud(),"graph";return null}(t)){if($h!=Vh.IDENTIFIER)throw cd("Identifier expected");var i=Xh;if(sd(),"="===Xh){if(sd(),$h!=Vh.IDENTIFIER)throw cd("Identifier expected");t[i]=Xh,sd()}else!function(t,e){var i={id:e},n=ud();n&&(i.attr=n);nd(t,i),ld(t,e)}(t,i)}}function dd(t){var e=null;if("subgraph"===Xh&&((e={}).type="subgraph",sd(),$h===Vh.IDENTIFIER&&(e.id=Xh,sd())),"{"===Xh){if(sd(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,ad(e),"}"!=Xh)throw cd("Angle bracket } expected");sd(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function ld(t,e){for(;"->"===Xh||"--"===Xh;){var i,n=Xh;sd();var o=dd(t);if(o)i=o;else{if($h!=Vh.IDENTIFIER)throw cd("Identifier or subgraph expected");nd(t,{id:i=Xh}),sd()}od(t,rd(t,e,i,n,ud())),e=i}}function ud(){for(var t,e,i=null,n={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"},r=new Array,s=new Array;"["===Xh;){for(sd(),i={};""!==Xh&&"]"!=Xh;){if($h!=Vh.IDENTIFIER)throw cd("Attribute name expected");var a=Xh;if(sd(),"="!=Xh)throw cd("Equal sign = expected");if(sd(),$h!=Vh.IDENTIFIER)throw cd("Attribute value expected");var h=Xh;"style"===a&&(h=n[h]),"arrowhead"===a&&(a="arrows",h={to:{enabled:!0,type:o[h]}}),"arrowtail"===a&&(a="arrows",h={from:{enabled:!0,type:o[h]}}),r.push({attr:i,name:a,value:h}),s.push(a),sd(),","==Xh&&sd()}if("]"!=Xh)throw cd("Bracket ] expected");sd()}if(s.includes("dir")){var d={arrows:{}};for(t=0;t<r.length;t++)if("arrows"===r[t].name)if(null!=r[t].value.to)d.arrows.to=t;else{if(null==r[t].value.from)throw cd("Invalid value of arrows");d.arrows.from=t}else"dir"===r[t].name&&(d.dir=t);var l,u,c=r[d.dir].value;if(!s.includes("arrows"))if("both"===c)r.push({attr:r[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=r.length-1,r.push({attr:r[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=r.length-1;else if("forward"===c)r.push({attr:r[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=r.length-1;else if("back"===c)r.push({attr:r[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=r.length-1;else{if("none"!==c)throw cd('Invalid dir type "'+c+'"');r.push({attr:r[d.dir].attr,name:"arrows",value:""}),d.arrows.to=r.length-1}if("both"===c)d.arrows.to&&d.arrows.from?(u=r[d.arrows.to].value.to.type,l=r[d.arrows.from].value.from.type,r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}},r.splice(d.arrows.from,1)):d.arrows.to?(u=r[d.arrows.to].value.to.type,l="arrow",r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}):d.arrows.from&&(u="arrow",l=r[d.arrows.from].value.from.type,r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}});else if("back"===c)d.arrows.to&&d.arrows.from?(u="",l=r[d.arrows.from].value.from.type,r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}):d.arrows.to?(u="",l="arrow",d.arrows.from=d.arrows.to,r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}):d.arrows.from&&(u="",l=r[d.arrows.from].value.from.type,r[d.arrows.to]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}),r[d.arrows.from]={attr:r[d.arrows.from].attr,name:r[d.arrows.from].name,value:{from:{enabled:!0,type:r[d.arrows.from].value.from.type}}};else if("none"===c){var f;r[f=d.arrows.to?d.arrows.to:d.arrows.from]={attr:r[f].attr,name:r[f].name,value:""}}else{if("forward"!==c)throw cd('Invalid dir type "'+c+'"');d.arrows.to&&d.arrows.from?(u=r[d.arrows.to].value.to.type,l="",r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}):d.arrows.to?(u=r[d.arrows.to].value.to.type,l="",r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}):d.arrows.from&&(u="arrow",l="",d.arrows.to=d.arrows.from,r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:l}}}),r[d.arrows.to]={attr:r[d.arrows.to].attr,name:r[d.arrows.to].name,value:{to:{enabled:!0,type:r[d.arrows.to].value.to.type}}}}r.splice(d.dir,1)}if(s.includes("penwidth")){var p=[];for(e=r.length,t=0;t<e;t++)"width"!==r[t].name&&("penwidth"===r[t].name&&(r[t].name="width"),p.push(r[t]));r=p}for(e=r.length,t=0;t<e;t++)id(r[t].attr,r[t].name,r[t].value);return i}function cd(t){return new SyntaxError(t+', got "'+fd(Xh,30)+'" (char '+qh+")")}function fd(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function pd(t,e,i){for(var n=e.split("."),o=n.pop(),r=t,s=0;s<n.length;s++){var a=n[s];a in r||(r[a]={}),r=r[a]}return r[o]=i,t}function vd(t,e){var i={};for(var n in t)if(t.hasOwnProperty(n)){var o=e[n];Array.isArray(o)?o.forEach((function(e){pd(i,e,t[n])})):pd(i,"string"==typeof o?o:n,t[n])}return i}var gd=Bh,yd=function(t){var e=Bh(t),i={nodes:[],edges:[],options:{}};if(e.nodes&&e.nodes.forEach((function(t){var e={id:t.id,label:String(t.label||t.id)};ed(e,vd(t.attr,Hh)),e.image&&(e.shape="image"),i.nodes.push(e)})),e.edges){var n=function(t){var e={from:t.from,to:t.to};return ed(e,vd(t.attr,Wh)),null==e.arrows&&"->"===t.type&&(e.arrows="to"),e};e.edges.forEach((function(t){var e,o;e=t.from instanceof Object?t.from.nodes:{id:t.from},o=t.to instanceof Object?t.to.nodes:{id:t.to},t.from instanceof Object&&t.from.edges&&t.from.edges.forEach((function(t){var e=n(t);i.edges.push(e)})),function(t,e,i){Array.isArray(t)?t.forEach((function(t){Array.isArray(e)?e.forEach((function(e){i(t,e)})):i(t,e)})):Array.isArray(e)?e.forEach((function(e){i(t,e)})):i(t,e)}(e,o,(function(e,o){var r=rd(i,e.id,o.id,t.type,t.attr),s=n(r);i.edges.push(s)})),t.to instanceof Object&&t.to.edges&&t.to.edges.forEach((function(t){var e=n(t);i.edges.push(e)}))}))}return e.attr&&(i.options=e.attr),i},md={parseDOT:gd,DOTToGraph:yd},bd=Object.freeze({__proto__:null,default:md,__moduleExports:md,parseDOT:gd,DOTToGraph:yd}),_d=pa.map;Ct({target:"Array",proto:!0,forced:!Ha("map")},{map:function(t){return _d(this,t,arguments.length>1?arguments[1]:void 0)}});var wd=/"/g,kd=function(t,e,i,n){var o=String(m(t)),r="<"+e;return""!==i&&(r+=" "+i+'="'+String(n).replace(wd,"&quot;")+'"'),r+">"+o+"</"+e+">"},xd=function(t){return h((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))};function Sd(t,e){var i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=e&&(null!=e.fixed&&(i.nodes.fixed=e.fixed),null!=e.parseColor&&(i.nodes.parseColor=e.parseColor),null!=e.inheritColor&&(i.edges.inheritColor=e.inheritColor));var n=t.edges.map((function(t){var e={from:t.source,id:t.id,to:t.target};return null!=t.attributes&&(e.attributes=t.attributes),null!=t.label&&(e.label=t.label),null!=t.attributes&&null!=t.attributes.title&&(e.title=t.attributes.title),"Directed"===t.type&&(e.arrows="to"),t.color&&!1===i.edges.inheritColor&&(e.color=t.color),e}));return{nodes:t.nodes.map((function(t){var e={id:t.id,fixed:i.nodes.fixed&&null!=t.x&&null!=t.y};return null!=t.attributes&&(e.attributes=t.attributes),null!=t.label&&(e.label=t.label),null!=t.size&&(e.size=t.size),null!=t.attributes&&null!=t.attributes.title&&(e.title=t.attributes.title),null!=t.title&&(e.title=t.title),null!=t.x&&(e.x=t.x),null!=t.y&&(e.y=t.y),null!=t.color&&(!0===i.nodes.parseColor?e.color=t.color:e.color={background:t.color,border:t.color,highlight:{background:t.color,border:t.color},hover:{background:t.color,border:t.color}}),e})),edges:n}}Ct({target:"String",proto:!0,forced:xd("fixed")},{fixed:function(){return kd(this,"tt","","")}});var Od=Object.freeze({__proto__:null,parseGephi:Sd}),Dd=Object.freeze({__proto__:null,default:void 0}),Md=i((function(t,e){t.exports=function(t){var e,i=t&&t.preventDefault||!1,n=t&&t.container||window,o={},r={keydown:{},keyup:{}},s={};for(e=97;e<=122;e++)s[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)s[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)s[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)s["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)s["num"+e]={code:96+e,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 a=function(t){d(t,"keydown")},h=function(t){d(t,"keyup")},d=function(t,e){if(void 0!==r[e][t.keyCode]){for(var n=r[e][t.keyCode],o=0;o<n.length;o++)void 0===n[o].shift?n[o].fn(t):1==n[o].shift&&1==t.shiftKey?n[o].fn(t):0==n[o].shift&&0==t.shiftKey&&n[o].fn(t);1==i&&t.preventDefault()}};return o.bind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===s[t])throw new Error("unsupported key: "+t);void 0===r[i][s[t].code]&&(r[i][s[t].code]=[]),r[i][s[t].code].push({fn:e,shift:s[t].shift})},o.bindAll=function(t,e){for(var i in void 0===e&&(e="keydown"),s)s.hasOwnProperty(i)&&o.bind(i,t,e)},o.getKey=function(t){for(var e in s)if(s.hasOwnProperty(e)){if(1==t.shiftKey&&1==s[e].shift&&t.keyCode==s[e].code)return e;if(0==t.shiftKey&&0==s[e].shift&&t.keyCode==s[e].code)return e;if(t.keyCode==s[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},o.unbind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===s[t])throw new Error("unsupported key: "+t);if(void 0!==e){var n=[],o=r[i][s[t].code];if(void 0!==o)for(var a=0;a<o.length;a++)o[a].fn==e&&o[a].shift==s[t].shift||n.push(r[i][s[t].code][a]);r[i][s[t].code]=n}else r[i][s[t].code]=[]},o.reset=function(){r={keydown:{},keyup:{}}},o.destroy=function(){r={keydown:{},keyup:{}},n.removeEventListener("keydown",a,!0),n.removeEventListener("keyup",h,!0)},n.addEventListener("keydown",a,!0),n.addEventListener("keyup",h,!0),o}})),Ed=Object.freeze({__proto__:null,default:Md,__moduleExports:Md});function Td(){return(Td=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function Cd(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Pd(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Id,Nd="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign,Fd=["","webkit","Moz","MS","ms","o"],Ad="undefined"==typeof document?{style:{}}:document.createElement("div"),Rd="function",Yd=Math.round,jd=Math.abs,zd=Date.now;function Ld(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),r=0;r<Fd.length;){if((n=(i=Fd[r])?i+o:e)in t)return n;r++}}Id="undefined"==typeof window?{}:window;var Bd=Ld(Ad.style,"touchAction"),Hd=void 0!==Bd;var Wd="auto",Vd="manipulation",Ud="none",Gd="pan-x",qd="pan-y",Zd=function(){if(!Hd)return!1;var t={},e=Id.CSS&&Id.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){return t[i]=!e||Id.CSS.supports("touch-action",i)})),t}(),Xd="ontouchstart"in Id,$d=void 0!==Ld(Id,"PointerEvent"),Kd=Xd&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Jd="touch",Qd="mouse",tl=25,el=1,il=2,nl=4,ol=8,rl=1,sl=2,al=4,hl=8,dl=16,ll=sl|al,ul=hl|dl,cl=ll|ul,fl=["x","y"],pl=["clientX","clientY"];function vl(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function gl(t,e){return typeof t===Rd?t.apply(e&&e[0]||void 0,e):t}function yl(t,e){return t.indexOf(e)>-1}var ml=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){"compute"===t&&(t=this.compute()),Hd&&this.manager.element.style&&Zd[t]&&(this.manager.element.style[Bd]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return vl(this.manager.recognizers,(function(e){gl(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(yl(t,Ud))return Ud;var e=yl(t,Gd),i=yl(t,qd);return e&&i?Ud:e||i?e?Gd:qd:yl(t,Vd)?Vd:Wd}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=yl(n,Ud)&&!Zd[Ud],r=yl(n,qd)&&!Zd[qd],s=yl(n,Gd)&&!Zd[Gd];if(o){var a=1===t.pointers.length,h=t.distance<2,d=t.deltaTime<250;if(a&&h&&d)return}if(!s||!r)return o||r&&i&ll||s&&i&ul?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function bl(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function _l(t){var e=t.length;if(1===e)return{x:Yd(t[0].clientX),y:Yd(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:Yd(i/e),y:Yd(n/e)}}function wl(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:Yd(t.pointers[i].clientX),clientY:Yd(t.pointers[i].clientY)},i++;return{timeStamp:zd(),pointers:e,center:_l(e),deltaX:t.deltaX,deltaY:t.deltaY}}function kl(t,e,i){i||(i=fl);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function xl(t,e,i){i||(i=fl);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function Sl(t,e){return t===e?rl:jd(t)>=jd(e)?t<0?sl:al:e<0?hl:dl}function Ol(t,e,i){return{x:e/t||0,y:i/t||0}}function Dl(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=wl(e)),o>1&&!i.firstMultiple?i.firstMultiple=wl(e):1===o&&(i.firstMultiple=!1);var r=i.firstInput,s=i.firstMultiple,a=s?s.center:r.center,h=e.center=_l(n);e.timeStamp=zd(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=xl(a,h),e.distance=kl(a,h),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},r=t.prevInput||{};e.eventType!==el&&r.eventType!==nl||(o=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=Sl(e.deltaX,e.deltaY);var d,l,u=Ol(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=jd(u.x)>jd(u.y)?u.x:u.y,e.scale=s?(d=s.pointers,kl((l=n)[0],l[1],pl)/kl(d[0],d[1],pl)):1,e.rotation=s?function(t,e){return xl(e[1],e[0],pl)+xl(t[1],t[0],pl)}(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,r,s=t.lastInterval||e,a=e.timeStamp-s.timeStamp;if(e.eventType!==ol&&(a>tl||void 0===s.velocity)){var h=e.deltaX-s.deltaX,d=e.deltaY-s.deltaY,l=Ol(a,h,d);n=l.x,o=l.y,i=jd(l.x)>jd(l.y)?l.x:l.y,r=Sl(h,d),t.lastInterval=e}else i=s.velocity,n=s.velocityX,o=s.velocityY,r=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=r}(i,e);var c=t.element;bl(e.srcEvent.target,c)&&(c=e.srcEvent.target),e.target=c}function Ml(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,r=e&el&&n-o==0,s=e&(nl|ol)&&n-o==0;i.isFirst=!!r,i.isFinal=!!s,r&&(t.session={}),i.eventType=e,Dl(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function El(t){return t.trim().split(/\s+/g)}function Tl(t,e,i){vl(El(e),(function(e){t.addEventListener(e,i,!1)}))}function Cl(t,e,i){vl(El(e),(function(e){t.removeEventListener(e,i,!1)}))}function Pl(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Il=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){gl(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Tl(this.element,this.evEl,this.domHandler),this.evTarget&&Tl(this.target,this.evTarget,this.domHandler),this.evWin&&Tl(Pl(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Cl(this.element,this.evEl,this.domHandler),this.evTarget&&Cl(this.target,this.evTarget,this.domHandler),this.evWin&&Cl(Pl(this.element),this.evWin,this.domHandler)},t}();function Nl(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}var Fl={pointerdown:el,pointermove:il,pointerup:nl,pointercancel:ol,pointerout:ol},Al={2:Jd,3:"pen",4:Qd,5:"kinect"},Rl="pointerdown",Yl="pointermove pointerup pointercancel";Id.MSPointerEvent&&!Id.PointerEvent&&(Rl="MSPointerDown",Yl="MSPointerMove MSPointerUp MSPointerCancel");var jl=function(t){function e(){var i,n=e.prototype;return n.evEl=Rl,n.evWin=Yl,(i=t.apply(this,arguments)||this).store=i.manager.session.pointerEvents=[],i}return Cd(e,t),e.prototype.handler=function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),o=Fl[n],r=Al[t.pointerType]||t.pointerType,s=r===Jd,a=Nl(e,t.pointerId,"pointerId");o&el&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):o&(nl|ol)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(a,1))},e}(Il);function zl(t){return Array.prototype.slice.call(t,0)}function Ll(t,e,i){for(var n=[],o=[],r=0;r<t.length;){var s=e?t[r][e]:t[r];Nl(o,s)<0&&n.push(t[r]),o[r]=s,r++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}var Bl={touchstart:el,touchmove:il,touchend:nl,touchcancel:ol},Hl="touchstart touchmove touchend touchcancel",Wl=function(t){function e(){var i;return e.prototype.evTarget=Hl,(i=t.apply(this,arguments)||this).targetIds={},i}return Cd(e,t),e.prototype.handler=function(t){var e=Bl[t.type],i=Vl.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Jd,srcEvent:t})},e}(Il);function Vl(t,e){var i,n,o=zl(t.touches),r=this.targetIds;if(e&(el|il)&&1===o.length)return r[o[0].identifier]=!0,[o,o];var s=zl(t.changedTouches),a=[],h=this.target;if(n=o.filter((function(t){return bl(t.target,h)})),e===el)for(i=0;i<n.length;)r[n[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),e&(nl|ol)&&delete r[s[i].identifier],i++;return a.length?[Ll(n.concat(a),"identifier",!0),a]:void 0}var Ul={mousedown:el,mousemove:il,mouseup:nl},Gl="mousedown",ql="mousemove mouseup",Zl=function(t){function e(){var i,n=e.prototype;return n.evEl=Gl,n.evWin=ql,(i=t.apply(this,arguments)||this).pressed=!1,i}return Cd(e,t),e.prototype.handler=function(t){var e=Ul[t.type];e&el&&0===t.button&&(this.pressed=!0),e&il&&1!==t.which&&(e=nl),this.pressed&&(e&nl&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Qd,srcEvent:t}))},e}(Il),Xl=2500,$l=25;function Kl(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY},n=this.lastTouches;this.lastTouches.push(i);setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),Xl)}}function Jl(t,e){t&el?(this.primaryTouch=e.changedPointers[0].identifier,Kl.call(this,e)):t&(nl|ol)&&Kl.call(this,e)}function Ql(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],r=Math.abs(e-o.x),s=Math.abs(i-o.y);if(r<=$l&&s<=$l)return!0}return!1}var tu=function(){return function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).handler=function(t,e,i){var o=i.pointerType===Jd,r=i.pointerType===Qd;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)Jl.call(Pd(Pd(n)),e,i);else if(r&&Ql.call(Pd(Pd(n)),i))return;n.callback(t,e,i)}},n.touch=new Wl(n.manager,n.handler),n.mouse=new Zl(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}return Cd(e,t),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(Il)}();function eu(t,e,i){return!!Array.isArray(t)&&(vl(t,i[e],i),!0)}var iu=1,nu=2,ou=4,ru=8,su=ru,au=16,hu=1;function du(t,e){var i=e.manager;return i?i.get(t):t}function lu(t){return t&au?"cancel":t&ru?"end":t&ou?"move":t&nu?"start":""}var uu=function(){function t(t){void 0===t&&(t={}),this.options=Td({enable:!0},t),this.id=hu++,this.manager=null,this.state=iu,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return Nd(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(eu(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=du(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return eu(t,"dropRecognizeWith",this)?this:(t=du(t,this),delete this.simultaneous[t.id],this)},e.requireFailure=function(t){if(eu(t,"requireFailure",this))return this;var e=this.requireFail;return-1===Nl(e,t=du(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(eu(t,"dropRequireFailure",this))return this;t=du(t,this);var e=Nl(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<ru&&n(e.options.event+lu(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=ru&&n(e.options.event+lu(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=32},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|iu)))return!1;t++}return!0},e.recognize=function(t){var e=Nd({},t);if(!gl(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(su|au|32)&&(this.state=iu),this.state=this.process(e),this.state&(nu|ou|ru|au)&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),cu={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function fu(t,e){var i,n=t.element;n.style&&(vl(t.options.cssProps,(function(o,r){i=Ld(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var pu=function(){function t(t,e){var i,n=this;this.options=Nd({},cu,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||($d?jl:Kd?Wl:Xd?tu:Zl))(i,Ml),this.touchAction=new ml(this,this.options.touchAction),fu(this,!0),vl(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return Nd(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&o.state&su)&&(e.curRecognizer=null,o=null);for(var r=0;r<n.length;)i=n[r],2===e.stopped||o&&i!==o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&i.state&(nu|ou|ru)&&(e.curRecognizer=i,o=i),r++}},e.get=function(t){if(t instanceof uu)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event===t)return e[i];return null},e.add=function(t){if(eu(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(eu(t,"remove",this))return this;var e=this.get(t);if(t){var i=this.recognizers,n=Nl(i,e);-1!==n&&(i.splice(n,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var i=this.handlers;return vl(El(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this},e.off=function(t,e){if(void 0===t)return this;var i=this.handlers;return vl(El(t),(function(t){e?i[t]&&i[t].splice(Nl(i[t],e),1):delete i[t]})),this},e.emit=function(t,e){this.options.domEvents&&function(t,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},e.destroy=function(){this.element&&fu(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),vu={touchstart:el,touchmove:il,touchend:nl,touchcancel:ol},gu="touchstart",yu="touchstart touchmove touchend touchcancel",mu=function(t){function e(){var i,n=e.prototype;return n.evTarget=gu,n.evWin=yu,(i=t.apply(this,arguments)||this).started=!1,i}return Cd(e,t),e.prototype.handler=function(t){var e=vu[t.type];if(e===el&&(this.started=!0),this.started){var i=bu.call(this,t,e);e&(nl|ol)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Jd,srcEvent:t})}},e}(Il);function bu(t,e){var i=zl(t.touches),n=zl(t.changedTouches);return e&(nl|ol)&&(i=Ll(i.concat(n),"identifier",!0)),[i,n]}var _u=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Td({pointers:1},e))||this}Cd(e,t);var i=e.prototype;return i.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},i.process=function(t){var e=this.state,i=t.eventType,n=e&(nu|ou),o=this.attrTest(t);return n&&(i&ol||!o)?e|au:n||o?i&nl?e|ru:e&nu?e|ou:nu:32},e}(uu),wu=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Td({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e))||this).pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}Cd(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Vd]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,r=t.deltaTime<i.time;if(this.reset(),t.eventType&el&&0===this.count)return this.failTimeout();if(o&&r&&n){if(t.eventType!==nl)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<i.interval,a=!this.pCenter||kl(this.pCenter,t.center)<i.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t,0===this.count%i.taps)return this.hasRequireFailures()?(this._timer=setTimeout((function(){e.state=su,e.tryEmit()}),i.interval),nu):su}return 32},i.failTimeout=function(){var t=this;return this._timer=setTimeout((function(){t.state=32}),this.options.interval),32},i.reset=function(){clearTimeout(this._timer)},i.emit=function(){this.state===su&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(uu);function ku(t){return t===dl?"down":t===hl?"up":t===sl?"left":t===al?"right":""}var xu=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Td({event:"pan",threshold:10,pointers:1,direction:cl},e))||this).pX=null,i.pY=null,i}Cd(e,t);var i=e.prototype;return i.getTouchAction=function(){var t=this.options.direction,e=[];return t&ll&&e.push(qd),t&ul&&e.push(Gd),e},i.directionTest=function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,r=t.deltaX,s=t.deltaY;return o&e.direction||(e.direction&ll?(o=0===r?rl:r<0?sl:al,i=r!==this.pX,n=Math.abs(t.deltaX)):(o=0===s?rl:s<0?hl:dl,i=s!==this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},i.attrTest=function(t){return _u.prototype.attrTest.call(this,t)&&(this.state&nu||!(this.state&nu)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=ku(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(_u),Su=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Td({event:"swipe",threshold:10,velocity:.3,direction:ll|ul,pointers:1},e))||this}Cd(e,t);var i=e.prototype;return i.getTouchAction=function(){return xu.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return n&(ll|ul)?i=e.overallVelocity:n&ll?i=e.overallVelocityX:n&ul&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&jd(i)>this.options.velocity&&e.eventType&nl},i.emit=function(t){var e=ku(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(_u),Ou=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Td({event:"pinch",threshold:0,pointers:2},e))||this}Cd(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Ud]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&nu)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(_u),Du=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Td({event:"rotate",threshold:0,pointers:2},e))||this}Cd(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Ud]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&nu)},e}(_u),Mu=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Td({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}Cd(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Wd]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,r=t.deltaTime>i.time;if(this._input=t,!o||!n||t.eventType&(nl|ol)&&!r)this.reset();else if(t.eventType&el)this.reset(),this._timer=setTimeout((function(){e.state=su,e.tryEmit()}),i.time);else if(t.eventType&nl)return su;return 32},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){this.state===su&&(t&&t.eventType&nl?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=zd(),this.manager.emit(this.options.event,this._input)))},e}(uu);function Eu(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var Tu=Eu((function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&void 0===t[n[o]])&&(t[n[o]]=e[n[o]]),o++;return t}),"extend","Use `assign`."),Cu=Eu((function(t,e){return Tu(t,e,!0)}),"merge","Use `assign`.");function Pu(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&Nd(n,i)}function Iu(t,e){return function(){return t.apply(e,arguments)}}var Nu,Fu=function(){var t=function(t,e){return void 0===e&&(e={}),new pu(t,Td({recognizers:[[Du,{enable:!1}],[Ou,{enable:!1},["rotate"]],[Su,{direction:ll}],[xu,{direction:ll},["swipe"]],[wu],[wu,{event:"doubletap",taps:2},["tap"]],[Mu]]},e))};return t.VERSION="2.0.15",t.DIRECTION_ALL=cl,t.DIRECTION_DOWN=dl,t.DIRECTION_LEFT=sl,t.DIRECTION_RIGHT=al,t.DIRECTION_UP=hl,t.DIRECTION_HORIZONTAL=ll,t.DIRECTION_VERTICAL=ul,t.DIRECTION_NONE=rl,t.DIRECTION_DOWN=dl,t.INPUT_START=el,t.INPUT_MOVE=il,t.INPUT_END=nl,t.INPUT_CANCEL=ol,t.STATE_POSSIBLE=iu,t.STATE_BEGAN=nu,t.STATE_CHANGED=ou,t.STATE_ENDED=ru,t.STATE_RECOGNIZED=su,t.STATE_CANCELLED=au,t.STATE_FAILED=32,t.Manager=pu,t.Input=Il,t.TouchAction=ml,t.TouchInput=Wl,t.MouseInput=Zl,t.PointerEventInput=jl,t.TouchMouseInput=tu,t.SingleTouchInput=mu,t.Recognizer=uu,t.AttrRecognizer=_u,t.Tap=wu,t.Pan=xu,t.Swipe=Su,t.Pinch=Ou,t.Rotate=Du,t.Press=Mu,t.on=Tl,t.off=Cl,t.each=vl,t.merge=Cu,t.extend=Tu,t.bindFn=Iu,t.assign=Nd,t.inherit=Pu,t.bindFn=Iu,t.prefixed=Ld,t.toArray=zl,t.inArray=Nl,t.uniqueArray=Ll,t.splitStr=El,t.boolOrFn=gl,t.hasParent=bl,t.addEventListeners=Tl,t.removeEventListeners=Cl,t.defaults=cu,t}(),Au=i((function(t){if("undefined"!=typeof window){var e=window.Hammer||Fu;t.exports=e}else t.exports=function(){return{on:t=function(){},off:t,destroy:t,emit:t,get:function(e){return{set:t}}};var t}})),Ru=Object.freeze({__proto__:null,default:Au,__moduleExports:Au});function Yu(t){var e=this;this.active=!1,this.dom={container:t},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=Au(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((function(t){e.hammer.on(t,(function(t){t.srcEvent.stopPropagation()}))})),document&&document.body&&(this.onClick=function(i){(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(i.target,t)||e.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=Md(),this.escListener=this.deactivate.bind(this)}(Nu=Dd)&&Nu.default,ri(Yu.prototype),Yu.current=null,Yu.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=null,this.hammer.destroy(),this.hammer=null},Yu.prototype.activate=function(){Yu.current&&Yu.current.deactivate(),Yu.current=this,this.active=!0,this.dom.overlay.style.display="none",sa.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},Yu.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="block",sa.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},Yu.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};var ju=Yu,zu=i((function(t,e){e.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."},e.en_EN=e.en,e.en_US=e.en,e.de={edit:"Editieren",del:"Lösche Auswahl",back:"Zurück",addNode:"Knoten hinzufügen",addEdge:"Kante hinzufügen",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öglich, Kanten mit Clustern zu verbinden.",deleteClusterError:"Cluster können nicht gelöscht werden.",editClusterError:"Cluster können nicht editiert werden."},e.de_DE=e.de,e.es={edit:"Editar",del:"Eliminar selección",back:"Atrás",addNode:"Añadir nodo",addEdge:"Añadir arista",editNode:"Editar nodo",editEdge:"Editar arista",addDescription:"Haga clic en un lugar vacío 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."},e.es_ES=e.es,e.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."},e.it_IT=e.it,e.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."},e.nl_NL=e.nl,e.nl_BE=e.nl,e["pt-br"]={edit:"Editar",del:"Remover selecionado",back:"Voltar",addNode:"Adicionar nó",addEdge:"Adicionar aresta",editNode:"Editar nó",editEdge:"Editar aresta",addDescription:"Clique em um espaço em branco para adicionar um novo nó",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",createEdgeError:"Não foi possível linkar arestas a um cluster.",deleteClusterError:"Clusters não puderam ser removidos.",editClusterError:"Clusters não puderam ser editados."},e["pt-BR"]=e["pt-br"],e.pt_BR=e["pt-br"],e.pt_br=e["pt-br"],e.ru={edit:"Редактировать",del:"Удалить выбранное",back:"Назад",addNode:"Добавить узел",addEdge:"Добавить ребро",editNode:"Редактировать узел",editEdge:"Редактировать ребро",addDescription:"Кликните в свободное место, чтобы добавить новый узел.",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",createEdgeError:"Невозможно соединить ребра в кластер.",deleteClusterError:"Кластеры не могут быть удалены",editClusterError:"Кластеры недоступны для редактирования."},e.ru_RU=e.ru,e.cn={edit:"编辑",del:"删除选定",back:"返回",addNode:"添加节点",addEdge:"添加连接线",editNode:"编辑节点",editEdge:"编辑连接线",addDescription:"单击空白处放置新节点。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",createEdgeError:"无法将连接线连接到群集。",deleteClusterError:"无法删除群集。",editClusterError:"无法编辑群集。"},e.zh_CN=e.cn,e.uk={edit:"Редагувати",del:"Видалити обране",back:"Назад",addNode:"Додати вузол",addEdge:"Додати край",editNode:"Редагувати вузол",editEdge:"Редагувати край",addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",createEdgeError:"Не можливо об'єднати краї в групу.",deleteClusterError:"Групи не можуть бути видалені.",editClusterError:"Групи недоступні для редагування."},e.uk_UA=e.uk,e.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ôle et glissez-les pour connecter un noeud.",createEdgeError:"Impossible de créer un lien vers un cluster.",deleteClusterError:"Les clusters ne peuvent pas être éffacés.",editClusterError:"Les clusters ne peuvent pas être édites."},e.fr_FR=e.fr,e.cs={edit:"Upravit",del:"Smazat výběr",back:"Zpět",addNode:"Přidat vrchol",addEdge:"Přidat hranu",editNode:"Upravit vrchol",editEdge:"Upravit hranu",addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",createEdgeError:"Nelze připojit hranu ke shluku.",deleteClusterError:"Nelze mazat shluky.",editClusterError:"Nelze upravovat shluky."},e.cs_CZ=e.cs}));function Lu(t){return(Lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hu(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Wu(t,e,i){return e&&Hu(t.prototype,e),i&&Hu(t,i),t}function Vu(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Uu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Gu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Uu(i,!0).forEach((function(e){Vu(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Uu(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function qu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xu(t,e)}function Zu(t){return(Zu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xu(t,e){return(Xu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ku(t,e,i){return(Ku="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zu(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Ju(t){throw new Error('"'+t+'" is read-only')}function Qu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var i=[],n=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){o=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var tc=function(){function t(){Bu(this,t),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return Wu(t,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var t=this.image.width,e=this.image.height;this.width=t,this.height=e;var i=Math.floor(e/2),n=Math.floor(e/4),o=Math.floor(e/8),r=Math.floor(e/16),s=Math.floor(t/2),a=Math.floor(t/4),h=Math.floor(t/8),d=Math.floor(t/16);this.canvas.width=3*a,this.canvas.height=i,this.coordinates=[[0,0,s,i],[s,0,a,n],[s,n,h,o],[5*h,n,d,r]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var t=this.canvas.getContext("2d"),e=this.coordinates[0];t.drawImage(this.image,e[0],e[1],e[2],e[3]);for(var i=1;i<this.NUM_ITERATIONS;i++){var n=this.coordinates[i-1],o=this.coordinates[i];t.drawImage(this.canvas,n[0],n[1],n[2],n[3],o[0],o[1],o[2],o[3])}}},{key:"drawImageAtPosition",value:function(t,e,i,n,o,r){if(this.initialized())if(e>2){e*=.5;for(var s=0;e>2&&s<this.NUM_ITERATIONS;)e*=.5,s+=1;s>=this.NUM_ITERATIONS&&(s=this.NUM_ITERATIONS-1);var a=this.coordinates[s];t.drawImage(this.canvas,a[0],a[1],a[2],a[3],i,n,o,r)}else t.drawImage(this.image,i,n,o,r)}}]),t}(),ec=function(){function t(e){Bu(this,t),this.images={},this.imageBroken={},this.callback=e}return Wu(t,[{key:"_tryloadBrokenUrl",value:function(t,e,i){void 0!==t&&void 0!==i&&(void 0!==e?(i.image.onerror=function(){console.error("Could not load brokenImage:",e)},i.image.src=e):console.warn("No broken url image defined"))}},{key:"_redrawWithImage",value:function(t){this.callback&&this.callback(t)}},{key:"load",value:function(t,e){var i=this,n=this.images[t];if(n)return n;var o=new tc;return this.images[t]=o,o.image.onload=function(){i._fixImageCoordinates(o.image),o.init(),i._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",t),i._tryloadBrokenUrl(t,e,o)},o.image.src=t,o}},{key:"_fixImageCoordinates",value:function(t){0===t.width&&(document.body.appendChild(t),t.width=t.offsetWidth,t.height=t.offsetHeight,document.body.removeChild(t))}}]),t}(),ic=function(){function t(){Bu(this,t),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},cs(this.options,this.defaultOptions)}return Wu(t,[{key:"setOptions",value:function(t){var e=["useDefaultGroups"];if(void 0!==t)for(var i in t)if(t.hasOwnProperty(i)&&-1===e.indexOf(i)){var n=t[i];this.add(i,n)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.groups[t];if(void 0===i&&e)if(!1===this.options.useDefaultGroups&&this.groupsArray.length>0){var n=this.groupIndex%this.groupsArray.length;this.groupIndex++,(i={}).color=this.groups[this.groupsArray[n]],this.groups[t]=i}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,(i={}).color=this.defaultGroups[o],this.groups[t]=i}return i}},{key:"add",value:function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e}}]),t}(),nc=pa.some;
27/**
28 * vis-data - data
29 * http://visjs.org/
30 *
31 * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
32 *
33 * @version 6.2.1
34 * @date 2019-09-13T21:24:53Z
35 *
36 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
37 * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs
38 *
39 * @license
40 * vis.js is dual licensed under both
41 *
42 * 1. The Apache 2.0 License
43 * http://www.apache.org/licenses/LICENSE-2.0
44 *
45 * and
46 *
47 * 2. The MIT License
48 * http://opensource.org/licenses/MIT
49 *
50 * vis.js may be distributed under either license.
51 */
52function oc(t,e){return t(e={exports:{}},e.exports),e.exports}Ct({target:"Array",proto:!0,forced:va("some")},{some:function(t){return nc(this,t,arguments.length>1?arguments[1]:void 0)}});var rc=oc((function(t){var e=function(t){var e,i=Object.prototype,n=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},r=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function h(t,e,i,n){var o=e&&e.prototype instanceof v?e:v,r=Object.create(o.prototype),s=new M(n||[]);return r._invoke=function(t,e,i){var n=l;return function(o,r){if(n===c)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw r;return T()}for(i.method=o,i.arg=r;;){var s=i.delegate;if(s){var a=S(s,i);if(a){if(a===p)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===l)throw n=f,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=c;var h=d(t,e,i);if("normal"===h.type){if(n=i.done?f:u,h.arg===p)continue;return{value:h.arg,done:i.done}}"throw"===h.type&&(n=f,i.method="throw",i.arg=h.arg)}}}(t,i,s),r}function d(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var l="suspendedStart",u="suspendedYield",c="executing",f="completed",p={};function v(){}function g(){}function y(){}var m={};m[r]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(E([])));_&&_!==i&&n.call(_,r)&&(m=_);var w=y.prototype=v.prototype=Object.create(m);function k(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function x(t){var e;this._invoke=function(i,o){function r(){return new Promise((function(e,r){!function e(i,o,r,s){var a=d(t[i],t,o);if("throw"!==a.type){var h=a.arg,l=h.value;return l&&"object"==typeof l&&n.call(l,"__await")?Promise.resolve(l.__await).then((function(t){e("next",t,r,s)}),(function(t){e("throw",t,r,s)})):Promise.resolve(l).then((function(t){h.value=t,r(h)}),(function(t){return e("throw",t,r,s)}))}s(a.arg)}(i,o,e,r)}))}return e=e?e.then(r,r):r()}}function S(t,i){var n=t.iterator[i.method];if(n===e){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=e,S(t,i),"throw"===i.method))return p;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=d(n,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,p;var r=o.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,p):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,p)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function E(t){if(t){var i=t[r];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function i(){for(;++o<t.length;)if(n.call(t,o))return i.value=t[o],i.done=!1,i;return i.value=e,i.done=!0,i};return s.next=s}}return{next:T}}function T(){return{value:e,done:!0}}return g.prototype=w.constructor=y,y.constructor=g,y[a]=g.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},k(x.prototype),x.prototype[s]=function(){return this},t.AsyncIterator=x,t.async=function(e,i,n,o){var r=new x(h(e,i,n,o));return t.isGeneratorFunction(i)?r:r.next().then((function(t){return t.done?t.value:r.next()}))},k(w),w[a]="Generator",w[r]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var n=e.pop();if(n in t)return i.value=n,i.done=!1,i}return i.done=!0,i}},t.values=E,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function o(n,o){return a.type="throw",a.arg=t,i.next=n,o&&(i.method="next",i.arg=e),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var h=n.call(s,"catchLoc"),d=n.call(s,"finallyLoc");if(h&&d){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(h){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var s=r?r.completion:{};return s.type=t,s.arg=e,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),D(i),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;D(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:E(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));var sc=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t};var ac=function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}};var hc=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var dc=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var lc=function(t){return ac(t)||hc(t)||dc()},uc=oc((function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(n){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=i=function(t){return e(t)}:t.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},i(n)}t.exports=i}));var cc=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function fc(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var pc=function(t,e,i){return e&&fc(t.prototype,e),i&&fc(t,i),t};var vc=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var gc=function(t,e){return!e||"object"!==uc(e)&&"function"!=typeof e?vc(t):e},yc=oc((function(t){function e(i){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(i)}t.exports=e})),mc=oc((function(t){function e(i,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(i,n)}t.exports=e}));for(var bc=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mc(t,e)},_c=[],wc=0;wc<256;wc++)_c[wc]=(wc+256).toString(16).substr(1);for(var kc=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var t=new Uint8Array(16);return function(){return crypto.getRandomValues(t),t}}var e=new Array(16);return function(){for(var t,i=0;i<16;i++)0==(3&i)&&(t=4294967296*Math.random()),e[i]=t>>>((3&i)<<3)&255;return e}}(),xc=[],Sc=0;Sc<256;Sc++)xc[Sc]=(Sc+256).toString(16).substr(1);var Oc=kc();Oc[0],Oc[1],Oc[2],Oc[3],Oc[4],Oc[5],Oc[6],Oc[7];function Dc(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=e&&i||0;"string"==typeof t&&(e="binary"===t?new Array(16):void 0,t={});var o=t.random||(t.rng||kc)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var r=0;r<16;r++)e[n+r]=o[r];return e||function(t,e){var i=e||0,n=_c;return n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]}(o)}function Mc(t){return(Mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ec(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}for(var Tc=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports=function(){var e,i;function n(){return e.apply(null,arguments)}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function a(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function u(t,e){for(var i in e)l(e,i)&&(t[i]=e[i]);return l(e,"toString")&&(t.toString=e.toString),l(e,"valueOf")&&(t.valueOf=e.valueOf),t}function c(t,e,i,n){return Ie(t,e,i,n,!0).utc()}function f(t){return null==t._pf&&(t._pf={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}),t._pf}function p(t){if(null==t._isValid){var e=f(t),n=i.call(e.parsedDateParts,(function(t){return null!=t})),o=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(o=o&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return o;t._isValid=o}return t._isValid}function v(t){var e=c(NaN);return null!=t?u(f(e),t):f(e).userInvalidated=!0,e}i=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;n<i;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};var g=n.momentProperties=[];function y(t,e){var i,n,o;if(s(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),s(e._i)||(t._i=e._i),s(e._f)||(t._f=e._f),s(e._l)||(t._l=e._l),s(e._strict)||(t._strict=e._strict),s(e._tzm)||(t._tzm=e._tzm),s(e._isUTC)||(t._isUTC=e._isUTC),s(e._offset)||(t._offset=e._offset),s(e._pf)||(t._pf=f(e)),s(e._locale)||(t._locale=e._locale),g.length>0)for(i=0;i<g.length;i++)s(o=e[n=g[i]])||(t[n]=o);return t}var m=!1;function b(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===m&&(m=!0,n.updateOffset(this),m=!1)}function _(t){return t instanceof b||null!=t&&null!=t._isAMomentObject}function w(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function k(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=w(e)),i}function x(t,e,i){var n,o=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),s=0;for(n=0;n<o;n++)(i&&t[n]!==e[n]||!i&&k(t[n])!==k(e[n]))&&s++;return s+r}function S(t){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function O(t,e){var i=!0;return u((function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,t),i){for(var o,r=[],s=0;s<arguments.length;s++){if(o="","object"==typeof arguments[s]){for(var a in o+="\n["+s+"] ",arguments[0])o+=a+": "+arguments[0][a]+", ";o=o.slice(0,-2)}else o=arguments[s];r.push(o)}S(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return e.apply(this,arguments)}),e)}var D,M={};function E(t,e){null!=n.deprecationHandler&&n.deprecationHandler(t,e),M[t]||(S(e),M[t]=!0)}function T(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function C(t,e){var i,n=u({},t);for(i in e)l(e,i)&&(r(t[i])&&r(e[i])?(n[i]={},u(n[i],t[i]),u(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);for(i in t)l(t,i)&&!l(e,i)&&r(t[i])&&(n[i]=u({},n[i]));return n}function P(t){null!=t&&this.set(t)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,D=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)l(t,e)&&i.push(e);return i};var I={};function N(t,e){var i=t.toLowerCase();I[i]=I[i+"s"]=I[e]=t}function F(t){return"string"==typeof t?I[t]||I[t.toLowerCase()]:void 0}function A(t){var e,i,n={};for(i in t)l(t,i)&&(e=F(i))&&(n[e]=t[i]);return n}var R={};function Y(t,e){R[t]=e}function j(t,e,i){var n=""+Math.abs(t),o=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var z=/(\[[^\[]*\])|(\\)?([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,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,B={},H={};function W(t,e,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),t&&(H[t]=o),e&&(H[e[0]]=function(){return j(o.apply(this,arguments),e[1],e[2])}),i&&(H[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function V(t,e){return t.isValid()?(e=U(e,t.localeData()),B[e]=B[e]||function(t){var e,i,n,o=t.match(z);for(e=0,i=o.length;e<i;e++)H[o[e]]?o[e]=H[o[e]]:o[e]=(n=o[e]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(e){var n,r="";for(n=0;n<i;n++)r+=T(o[n])?o[n].call(e,t):o[n];return r}}(e),B[e](t)):t.localeData().invalidDate()}function U(t,e){var i=5;function n(t){return e.longDateFormat(t)||t}for(L.lastIndex=0;i>=0&&L.test(t);)t=t.replace(L,n),L.lastIndex=0,i-=1;return t}var G=/\d/,q=/\d\d/,Z=/\d{3}/,X=/\d{4}/,$=/[+-]?\d{6}/,K=/\d\d?/,J=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,tt=/\d{1,3}/,et=/\d{1,4}/,it=/[+-]?\d{1,6}/,nt=/\d+/,ot=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,at=/[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,ht={};function dt(t,e,i){ht[t]=T(e)?e:function(t,n){return t&&i?i:e}}function lt(t,e){return l(ht,t)?ht[t](e._strict,e._locale):new RegExp(ut(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,o){return e||i||n||o}))))}function ut(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ct={};function ft(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),a(e)&&(n=function(t,i){i[e]=k(t)}),i=0;i<t.length;i++)ct[t[i]]=n}function pt(t,e){ft(t,(function(t,i,n,o){n._w=n._w||{},e(t,n._w,n,o)}))}function vt(t,e,i){null!=e&&l(ct,t)&&ct[t](e,i._a,i,t)}var gt=0,yt=1,mt=2,bt=3,_t=4,wt=5,kt=6,xt=7,St=8;function Ot(t){return Dt(t)?366:365}function Dt(t){return t%4==0&&t%100!=0||t%400==0}W("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),W(0,["YY",2],0,(function(){return this.year()%100})),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),N("year","y"),Y("year",1),dt("Y",ot),dt("YY",K,q),dt("YYYY",et,X),dt("YYYYY",it,$),dt("YYYYYY",it,$),ft(["YYYYY","YYYYYY"],gt),ft("YYYY",(function(t,e){e[gt]=2===t.length?n.parseTwoDigitYear(t):k(t)})),ft("YY",(function(t,e){e[gt]=n.parseTwoDigitYear(t)})),ft("Y",(function(t,e){e[gt]=parseInt(t,10)})),n.parseTwoDigitYear=function(t){return k(t)+(k(t)>68?1900:2e3)};var Mt,Et=Tt("FullYear",!0);function Tt(t,e){return function(i){return null!=i?(Pt(this,t,i),n.updateOffset(this,e),this):Ct(this,t)}}function Ct(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Pt(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Dt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),It(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function It(t,e){if(isNaN(t)||isNaN(e))return NaN;var i=function(t,e){return(t%e+e)%e}(e,12);return t+=(e-i)/12,1===i?Dt(t)?29:28:31-i%7%2}Mt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},W("M",["MM",2],"Mo",(function(){return this.month()+1})),W("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),W("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),N("month","M"),Y("month",8),dt("M",K),dt("MM",K,q),dt("MMM",(function(t,e){return e.monthsShortRegex(t)})),dt("MMMM",(function(t,e){return e.monthsRegex(t)})),ft(["M","MM"],(function(t,e){e[yt]=k(t)-1})),ft(["MMM","MMMM"],(function(t,e,i,n){var o=i._locale.monthsParse(t,n,i._strict);null!=o?e[yt]=o:f(i).invalidMonth=t}));var Nt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ft="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),At="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Rt(t,e,i){var n,o,r,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=c([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(o=Mt.call(this._shortMonthsParse,s))?o:null:-1!==(o=Mt.call(this._longMonthsParse,s))?o:null:"MMM"===e?-1!==(o=Mt.call(this._shortMonthsParse,s))?o:-1!==(o=Mt.call(this._longMonthsParse,s))?o:null:-1!==(o=Mt.call(this._longMonthsParse,s))?o:-1!==(o=Mt.call(this._shortMonthsParse,s))?o:null}function Yt(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=k(e);else if(!a(e=t.localeData().monthsParse(e)))return t;return i=Math.min(t.date(),It(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function jt(t){return null!=t?(Yt(this,t),n.updateOffset(this,!0),this):Ct(this,"Month")}var zt=at,Lt=at;function Bt(){function t(t,e){return e.length-t.length}var e,i,n=[],o=[],r=[];for(e=0;e<12;e++)i=c([2e3,e]),n.push(this.monthsShort(i,"")),o.push(this.months(i,"")),r.push(this.months(i,"")),r.push(this.monthsShort(i,""));for(n.sort(t),o.sort(t),r.sort(t),e=0;e<12;e++)n[e]=ut(n[e]),o[e]=ut(o[e]);for(e=0;e<24;e++)r[e]=ut(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Ht(t,e,i,n,o,r,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,i,n,o,r,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,o,r,s),a}function Wt(t){var e;if(t<100&&t>=0){var i=Array.prototype.slice.call(arguments);i[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Vt(t,e,i){var n=7+e-i;return-(7+Wt(t,0,n).getUTCDay()-e)%7+n-1}function Ut(t,e,i,n,o){var r,s,a=1+7*(e-1)+(7+i-n)%7+Vt(t,n,o);return a<=0?s=Ot(r=t-1)+a:a>Ot(t)?(r=t+1,s=a-Ot(t)):(r=t,s=a),{year:r,dayOfYear:s}}function Gt(t,e,i){var n,o,r=Vt(t.year(),e,i),s=Math.floor((t.dayOfYear()-r-1)/7)+1;return s<1?n=s+qt(o=t.year()-1,e,i):s>qt(t.year(),e,i)?(n=s-qt(t.year(),e,i),o=t.year()+1):(o=t.year(),n=s),{week:n,year:o}}function qt(t,e,i){var n=Vt(t,e,i),o=Vt(t+1,e,i);return(Ot(t)-n+o)/7}function Zt(t,e){return t.slice(e,7).concat(t.slice(0,e))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),Y("week",5),Y("isoWeek",5),dt("w",K),dt("ww",K,q),dt("W",K),dt("WW",K,q),pt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=k(t)})),W("d",0,"do","day"),W("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),W("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),W("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),dt("d",K),dt("e",K),dt("E",K),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),pt(["dd","ddd","dddd"],(function(t,e,i,n){var o=i._locale.weekdaysParse(t,n,i._strict);null!=o?e.d=o:f(i).invalidWeekday=t})),pt(["d","e","E"],(function(t,e,i,n){e[n]=k(t)}));var Xt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$t="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Kt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Jt(t,e,i){var n,o,r,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=c([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(o=Mt.call(this._weekdaysParse,s))?o:null:"ddd"===e?-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:null:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:null:"dddd"===e?-1!==(o=Mt.call(this._weekdaysParse,s))?o:-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:null:"ddd"===e?-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:-1!==(o=Mt.call(this._weekdaysParse,s))?o:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:null:-1!==(o=Mt.call(this._minWeekdaysParse,s))?o:-1!==(o=Mt.call(this._weekdaysParse,s))?o:-1!==(o=Mt.call(this._shortWeekdaysParse,s))?o:null}var Qt=at,te=at,ee=at;function ie(){function t(t,e){return e.length-t.length}var e,i,n,o,r,s=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=c([2e3,1]).day(e),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),r=this.weekdays(i,""),s.push(n),a.push(o),h.push(r),d.push(n),d.push(o),d.push(r);for(s.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=ut(a[e]),h[e]=ut(h[e]),d[e]=ut(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function ne(){return this.hours()%12||12}function oe(t,e){W(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function re(t,e){return e._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,ne),W("k",["kk",2],0,(function(){return this.hours()||24})),W("hmm",0,0,(function(){return""+ne.apply(this)+j(this.minutes(),2)})),W("hmmss",0,0,(function(){return""+ne.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)})),W("Hmm",0,0,(function(){return""+this.hours()+j(this.minutes(),2)})),W("Hmmss",0,0,(function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)})),oe("a",!0),oe("A",!1),N("hour","h"),Y("hour",13),dt("a",re),dt("A",re),dt("H",K),dt("h",K),dt("k",K),dt("HH",K,q),dt("hh",K,q),dt("kk",K,q),dt("hmm",J),dt("hmmss",Q),dt("Hmm",J),dt("Hmmss",Q),ft(["H","HH"],bt),ft(["k","kk"],(function(t,e,i){var n=k(t);e[bt]=24===n?0:n})),ft(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),ft(["h","hh"],(function(t,e,i){e[bt]=k(t),f(i).bigHour=!0})),ft("hmm",(function(t,e,i){var n=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n)),f(i).bigHour=!0})),ft("hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n,2)),e[wt]=k(t.substr(o)),f(i).bigHour=!0})),ft("Hmm",(function(t,e,i){var n=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n))})),ft("Hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[bt]=k(t.substr(0,n)),e[_t]=k(t.substr(n,2)),e[wt]=k(t.substr(o))}));var se,ae=Tt("Hours",!0),he={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:/\d{1,2}/,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:Ft,monthsShort:At,week:{dow:0,doy:6},weekdays:Xt,weekdaysMin:Kt,weekdaysShort:$t,meridiemParse:/[ap]\.?m?\.?/i},de={},le={};function ue(t){return t?t.toLowerCase().replace("_","-"):t}function ce(e){var i=null;if(!de[e]&&t&&t.exports)try{i=se._abbr,Ec(),fe(i)}catch(t){}return de[e]}function fe(t,e){var i;return t&&((i=s(e)?ve(t):pe(t,e))?se=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),se._abbr}function pe(t,e){if(null!==e){var i,n=he;if(e.abbr=t,null!=de[t])E("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."),n=de[t]._config;else if(null!=e.parentLocale)if(null!=de[e.parentLocale])n=de[e.parentLocale]._config;else{if(null==(i=ce(e.parentLocale)))return le[e.parentLocale]||(le[e.parentLocale]=[]),le[e.parentLocale].push({name:t,config:e}),null;n=i._config}return de[t]=new P(C(n,e)),le[t]&&le[t].forEach((function(t){pe(t.name,t.config)})),fe(t),de[t]}return delete de[t],null}function ve(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return se;if(!o(t)){if(e=ce(t))return e;t=[t]}return function(t){for(var e,i,n,o,r=0;r<t.length;){for(e=(o=ue(t[r]).split("-")).length,i=(i=ue(t[r+1]))?i.split("-"):null;e>0;){if(n=ce(o.slice(0,e).join("-")))return n;if(i&&i.length>=e&&x(o,i,!0)>=e-1)break;e--}r++}return se}(t)}function ge(t){var e,i=t._a;return i&&-2===f(t).overflow&&(e=i[yt]<0||i[yt]>11?yt:i[mt]<1||i[mt]>It(i[gt],i[yt])?mt:i[bt]<0||i[bt]>24||24===i[bt]&&(0!==i[_t]||0!==i[wt]||0!==i[kt])?bt:i[_t]<0||i[_t]>59?_t:i[wt]<0||i[wt]>59?wt:i[kt]<0||i[kt]>999?kt:-1,f(t)._overflowDayOfYear&&(e<gt||e>mt)&&(e=mt),f(t)._overflowWeeks&&-1===e&&(e=xt),f(t)._overflowWeekday&&-1===e&&(e=St),f(t).overflow=e),t}function ye(t,e,i){return null!=t?t:null!=e?e:i}function me(t){var e,i,o,r,s,a=[];if(!t._d){for(o=function(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[mt]&&null==t._a[yt]&&function(t){var e,i,n,o,r,s,a,h;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,s=4,i=ye(e.GG,t._a[gt],Gt(Ne(),1,4).year),n=ye(e.W,1),((o=ye(e.E,1))<1||o>7)&&(h=!0);else{r=t._locale._week.dow,s=t._locale._week.doy;var d=Gt(Ne(),r,s);i=ye(e.gg,t._a[gt],d.year),n=ye(e.w,d.week),null!=e.d?((o=e.d)<0||o>6)&&(h=!0):null!=e.e?(o=e.e+r,(e.e<0||e.e>6)&&(h=!0)):o=r}n<1||n>qt(i,r,s)?f(t)._overflowWeeks=!0:null!=h?f(t)._overflowWeekday=!0:(a=Ut(i,n,o,r,s),t._a[gt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=ye(t._a[gt],o[gt]),(t._dayOfYear>Ot(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=Wt(s,0,t._dayOfYear),t._a[yt]=i.getUTCMonth(),t._a[mt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=o[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[bt]&&0===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[bt]=0),t._d=(t._useUTC?Wt:Ht).apply(null,a),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[bt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(f(t).weekdayMismatch=!0)}}var be=/^\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)?)?$/,_e=/^\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)?)?$/,we=/Z|[+-]\d\d(?::?\d\d)?/,ke=[["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}/]],xe=[["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/]],Se=/^\/?Date\((\-?\d+)/i;function Oe(t){var e,i,n,o,r,s,a=t._i,h=be.exec(a)||_e.exec(a);if(h){for(f(t).iso=!0,e=0,i=ke.length;e<i;e++)if(ke[e][1].exec(h[1])){o=ke[e][0],n=!1!==ke[e][2];break}if(null==o)return void(t._isValid=!1);if(h[3]){for(e=0,i=xe.length;e<i;e++)if(xe[e][1].exec(h[3])){r=(h[2]||" ")+xe[e][0];break}if(null==r)return void(t._isValid=!1)}if(!n&&null!=r)return void(t._isValid=!1);if(h[4]){if(!we.exec(h[4]))return void(t._isValid=!1);s="Z"}t._f=o+(r||"")+(s||""),Ce(t)}else t._isValid=!1}var De=/^(?:(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}))$/;function Me(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}var Ee={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Te(t){var e,i,n,o,r,s,a,h=De.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(h){var d=(e=h[4],i=h[3],n=h[2],o=h[5],r=h[6],s=h[7],a=[Me(e),At.indexOf(i),parseInt(n,10),parseInt(o,10),parseInt(r,10)],s&&a.push(parseInt(s,10)),a);if(!function(t,e,i){return!t||$t.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(f(i).weekdayMismatch=!0,i._isValid=!1,!1)}(h[1],d,t))return;t._a=d,t._tzm=function(t,e,i){if(t)return Ee[t];if(e)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}(h[8],h[9],h[10]),t._d=Wt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),f(t).rfc2822=!0}else t._isValid=!1}function Ce(t){if(t._f!==n.ISO_8601)if(t._f!==n.RFC_2822){t._a=[],f(t).empty=!0;var e,i,o,r,s,a=""+t._i,h=a.length,d=0;for(o=U(t._f,t._locale).match(z)||[],e=0;e<o.length;e++)r=o[e],(i=(a.match(lt(r,t))||[])[0])&&((s=a.substr(0,a.indexOf(i))).length>0&&f(t).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),d+=i.length),H[r]?(i?f(t).empty=!1:f(t).unusedTokens.push(r),vt(r,i,t)):t._strict&&!i&&f(t).unusedTokens.push(r);f(t).charsLeftOver=h-d,a.length>0&&f(t).unusedInput.push(a),t._a[bt]<=12&&!0===f(t).bigHour&&t._a[bt]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[bt]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[bt],t._meridiem),me(t),ge(t)}else Te(t);else Oe(t)}function Pe(t){var e=t._i,i=t._f;return t._locale=t._locale||ve(t._l),null===e||void 0===i&&""===e?v({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new b(ge(e)):(h(e)?t._d=e:o(i)?function(t){var e,i,n,o,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;o<t._f.length;o++)r=0,e=y({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[o],Ce(e),p(e)&&(r+=f(e).charsLeftOver,r+=10*f(e).unusedTokens.length,f(e).score=r,(null==n||r<n)&&(n=r,i=e));u(t,i||e)}(t):i?Ce(t):function(t){var e=t._i;s(e)?t._d=new Date(n.now()):h(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=Se.exec(t._i);null===e?(Oe(t),!1===t._isValid&&(delete t._isValid,Te(t),!1===t._isValid&&(delete t._isValid,n.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):o(e)?(t._a=d(e.slice(0),(function(t){return parseInt(t,10)})),me(t)):r(e)?function(t){if(!t._d){var e=A(t._i);t._a=d([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),me(t)}}(t):a(e)?t._d=new Date(e):n.createFromInputFallback(t)}(t),p(t)||(t._d=null),t))}function Ie(t,e,i,n,s){var a,h={};return!0!==i&&!1!==i||(n=i,i=void 0),(r(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||o(t)&&0===t.length)&&(t=void 0),h._isAMomentObject=!0,h._useUTC=h._isUTC=s,h._l=i,h._i=t,h._f=e,h._strict=n,(a=new b(ge(Pe(h))))._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function Ne(t,e,i,n){return Ie(t,e,i,n,!1)}n.createFromInputFallback=O("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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),n.ISO_8601=function(){},n.RFC_2822=function(){};var Fe=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Ne.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:v()})),Ae=O("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Ne.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:v()}));function Re(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Ne();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}var Ye=["year","quarter","month","week","day","hour","minute","second","millisecond"];function je(t){var e=A(t),i=e.year||0,n=e.quarter||0,o=e.month||0,r=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,h=e.minute||0,d=e.second||0,l=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===Mt.call(Ye,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var i=!1,n=0;n<Ye.length;++n)if(t[Ye[n]]){if(i)return!1;parseFloat(t[Ye[n]])!==k(t[Ye[n]])&&(i=!0)}return!0}(e),this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+s+7*r,this._months=+o+3*n+12*i,this._data={},this._locale=ve(),this._bubble()}function ze(t){return t instanceof je}function Le(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Be(t,e){W(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+j(~~(t/60),2)+e+j(~~t%60,2)}))}Be("Z",":"),Be("ZZ",""),dt("Z",st),dt("ZZ",st),ft(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=We(st,t)}));var He=/([\+\-]|\d\d)/gi;function We(t,e){var i=(e||"").match(t);if(null===i)return null;var n=((i[i.length-1]||[])+"").match(He)||["-",0,0],o=60*n[1]+k(n[2]);return 0===o?0:"+"===n[0]?o:-o}function Ve(t,e){var i,o;return e._isUTC?(i=e.clone(),o=(_(t)||h(t)?t.valueOf():Ne(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+o),n.updateOffset(i,!1),i):Ne(t).local()}function Ue(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ge(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var qe=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ze=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Xe(t,e){var i,n,o,r,s,h,d=t,u=null;return ze(t)?d={ms:t._milliseconds,d:t._days,M:t._months}:a(t)?(d={},e?d[e]=t:d.milliseconds=t):(u=qe.exec(t))?(i="-"===u[1]?-1:1,d={y:0,d:k(u[mt])*i,h:k(u[bt])*i,m:k(u[_t])*i,s:k(u[wt])*i,ms:k(Le(1e3*u[kt]))*i}):(u=Ze.exec(t))?(i="-"===u[1]?-1:1,d={y:$e(u[2],i),M:$e(u[3],i),w:$e(u[4],i),d:$e(u[5],i),h:$e(u[6],i),m:$e(u[7],i),s:$e(u[8],i)}):null==d?d={}:"object"==typeof d&&("from"in d||"to"in d)&&(r=Ne(d.from),s=Ne(d.to),o=r.isValid()&&s.isValid()?(s=Ve(s,r),r.isBefore(s)?h=Ke(r,s):((h=Ke(s,r)).milliseconds=-h.milliseconds,h.months=-h.months),h):{milliseconds:0,months:0},(d={}).ms=o.milliseconds,d.M=o.months),n=new je(d),ze(t)&&l(t,"_locale")&&(n._locale=t._locale),n}function $e(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Ke(t,e){var i={};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Je(t,e){return function(i,n){var o;return null===n||isNaN(+n)||(E(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),Qe(this,Xe(i="string"==typeof i?+i:i,n),t),this}}function Qe(t,e,i,o){var r=e._milliseconds,s=Le(e._days),a=Le(e._months);t.isValid()&&(o=null==o||o,a&&Yt(t,Ct(t,"Month")+a*i),s&&Pt(t,"Date",Ct(t,"Date")+s*i),r&&t._d.setTime(t._d.valueOf()+r*i),o&&n.updateOffset(t,s||a))}Xe.fn=je.prototype,Xe.invalid=function(){return Xe(NaN)};var ti=Je(1,"add"),ei=Je(-1,"subtract");function ii(t,e){var i=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(i,"months");return-(i+(e-n<0?(e-n)/(n-t.clone().add(i-1,"months")):(e-n)/(t.clone().add(i+1,"months")-n)))||0}function ni(t){var e;return void 0===t?this._locale._abbr:(null!=(e=ve(t))&&(this._locale=e),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var oi=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function ri(){return this._locale}var si=1e3,ai=60*si,hi=60*ai,di=3506328*hi;function li(t,e){return(t%e+e)%e}function ui(t,e,i){return t<100&&t>=0?new Date(t+400,e,i)-di:new Date(t,e,i).valueOf()}function ci(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-di:Date.UTC(t,e,i)}function fi(t,e){W(0,[t,t.length],0,e)}function pi(t,e,i,n,o){var r;return null==t?Gt(this,n,o).year:(e>(r=qt(t,n,o))&&(e=r),vi.call(this,t,e,i,n,o))}function vi(t,e,i,n,o){var r=Ut(t,e,i,n,o),s=Wt(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}W(0,["gg",2],0,(function(){return this.weekYear()%100})),W(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),fi("gggg","weekYear"),fi("ggggg","weekYear"),fi("GGGG","isoWeekYear"),fi("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),dt("G",ot),dt("g",ot),dt("GG",K,q),dt("gg",K,q),dt("GGGG",et,X),dt("gggg",et,X),dt("GGGGG",it,$),dt("ggggg",it,$),pt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=k(t)})),pt(["gg","GG"],(function(t,e,i,o){e[o]=n.parseTwoDigitYear(t)})),W("Q",0,"Qo","quarter"),N("quarter","Q"),Y("quarter",7),dt("Q",G),ft("Q",(function(t,e){e[yt]=3*(k(t)-1)})),W("D",["DD",2],"Do","date"),N("date","D"),Y("date",9),dt("D",K),dt("DD",K,q),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),ft(["D","DD"],mt),ft("Do",(function(t,e){e[mt]=k(t.match(K)[0])}));var gi=Tt("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),Y("dayOfYear",4),dt("DDD",tt),dt("DDDD",Z),ft(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=k(t)})),W("m",["mm",2],0,"minute"),N("minute","m"),Y("minute",14),dt("m",K),dt("mm",K,q),ft(["m","mm"],_t);var yi=Tt("Minutes",!1);W("s",["ss",2],0,"second"),N("second","s"),Y("second",15),dt("s",K),dt("ss",K,q),ft(["s","ss"],wt);var mi,bi=Tt("Seconds",!1);for(W("S",0,0,(function(){return~~(this.millisecond()/100)})),W(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),W(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),W(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),W(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),W(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),W(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),N("millisecond","ms"),Y("millisecond",16),dt("S",tt,G),dt("SS",tt,q),dt("SSS",tt,Z),mi="SSSS";mi.length<=9;mi+="S")dt(mi,nt);function _i(t,e){e[kt]=k(1e3*("0."+t))}for(mi="S";mi.length<=9;mi+="S")ft(mi,_i);var wi=Tt("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var ki=b.prototype;function xi(t){return t}ki.add=ti,ki.calendar=function(t,e){var i=t||Ne(),o=Ve(i,this).startOf("day"),r=n.calendarFormat(this,o)||"sameElse",s=e&&(T(e[r])?e[r].call(this,i):e[r]);return this.format(s||this.localeData().calendar(r,this,Ne(i)))},ki.clone=function(){return new b(this)},ki.diff=function(t,e,i){var n,o,r;if(!this.isValid())return NaN;if(!(n=Ve(t,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),e=F(e)){case"year":r=ii(this,n)/12;break;case"month":r=ii(this,n);break;case"quarter":r=ii(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-o)/864e5;break;case"week":r=(this-n-o)/6048e5;break;default:r=this-n}return i?r:w(r)},ki.endOf=function(t){var e;if(void 0===(t=F(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?ci:ui;switch(t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=hi-li(e+(this._isUTC?0:this.utcOffset()*ai),hi)-1;break;case"minute":e=this._d.valueOf(),e+=ai-li(e,ai)-1;break;case"second":e=this._d.valueOf(),e+=si-li(e,si)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},ki.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)},ki.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Ne(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},ki.fromNow=function(t){return this.from(Ne(),t)},ki.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Ne(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},ki.toNow=function(t){return this.to(Ne(),t)},ki.get=function(t){return T(this[t=F(t)])?this[t]():this},ki.invalidAt=function(){return f(this).overflow},ki.isAfter=function(t,e){var i=_(t)?t:Ne(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())},ki.isBefore=function(t,e){var i=_(t)?t:Ne(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())},ki.isBetween=function(t,e,i,n){var o=_(t)?t:Ne(t),r=_(e)?e:Ne(e);return!!(this.isValid()&&o.isValid()&&r.isValid())&&("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(r,i):!this.isAfter(r,i))},ki.isSame=function(t,e){var i,n=_(t)?t:Ne(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=F(e)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))},ki.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},ki.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},ki.isValid=function(){return p(this)},ki.lang=oi,ki.locale=ni,ki.localeData=ri,ki.max=Ae,ki.min=Fe,ki.parsingFlags=function(){return u({},f(this))},ki.set=function(t,e){if("object"==typeof t)for(var i=function(t){var e=[];for(var i in t)e.push({unit:i,priority:R[i]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=A(t)),n=0;n<i.length;n++)this[i[n].unit](t[i[n].unit]);else if(T(this[t=F(t)]))return this[t](e);return this},ki.startOf=function(t){var e;if(void 0===(t=F(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?ci:ui;switch(t){case"year":e=i(this.year(),0,1);break;case"quarter":e=i(this.year(),this.month()-this.month()%3,1);break;case"month":e=i(this.year(),this.month(),1);break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=i(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=li(e+(this._isUTC?0:this.utcOffset()*ai),hi);break;case"minute":e=this._d.valueOf(),e-=li(e,ai);break;case"second":e=this._d.valueOf(),e-=li(e,si)}return this._d.setTime(e),n.updateOffset(this,!0),this},ki.subtract=ei,ki.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},ki.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},ki.toDate=function(){return new Date(this.valueOf())},ki.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,i=e?this.clone().utc():this;return i.year()<0||i.year()>9999?V(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(i,"Z")):V(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},ki.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+o)},ki.toJSON=function(){return this.isValid()?this.toISOString():null},ki.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ki.unix=function(){return Math.floor(this.valueOf()/1e3)},ki.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ki.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ki.year=Et,ki.isLeapYear=function(){return Dt(this.year())},ki.weekYear=function(t){return pi.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ki.isoWeekYear=function(t){return pi.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},ki.quarter=ki.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},ki.month=jt,ki.daysInMonth=function(){return It(this.year(),this.month())},ki.week=ki.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},ki.isoWeek=ki.isoWeeks=function(t){var e=Gt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},ki.weeksInYear=function(){var t=this.localeData()._week;return qt(this.year(),t.dow,t.doy)},ki.isoWeeksInYear=function(){return qt(this.year(),1,4)},ki.date=gi,ki.day=ki.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},ki.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},ki.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},ki.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},ki.hour=ki.hours=ae,ki.minute=ki.minutes=yi,ki.second=ki.seconds=bi,ki.millisecond=ki.milliseconds=wi,ki.utcOffset=function(t,e,i){var o,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=We(st,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(o=Ue(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!e||this._changeInProgress?Qe(this,Xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ue(this)},ki.utc=function(t){return this.utcOffset(0,t)},ki.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ue(this),"m")),this},ki.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=We(rt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},ki.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ne(t).utcOffset():0,(this.utcOffset()-t)%60==0)},ki.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ki.isLocal=function(){return!!this.isValid()&&!this._isUTC},ki.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ki.isUtc=Ge,ki.isUTC=Ge,ki.zoneAbbr=function(){return this._isUTC?"UTC":""},ki.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ki.dates=O("dates accessor is deprecated. Use date instead.",gi),ki.months=O("months accessor is deprecated. Use month instead",jt),ki.years=O("years accessor is deprecated. Use year instead",Et),ki.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),ki.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=Pe(t))._a){var e=t._isUTC?c(t._a):Ne(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Si=P.prototype;function Oi(t,e,i,n){var o=ve(),r=c().set(n,e);return o[i](r,t)}function Di(t,e,i){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return Oi(t,e,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=Oi(t,n,i,"month");return o}function Mi(t,e,i,n){"boolean"==typeof t?(a(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,a(e)&&(i=e,e=void 0),e=e||"");var o,r=ve(),s=t?r._week.dow:0;if(null!=i)return Oi(e,(i+s)%7,n,"day");var h=[];for(o=0;o<7;o++)h[o]=Oi(e,(o+s)%7,n,"day");return h}Si.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return T(n)?n.call(e,i):n},Si.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Si.invalidDate=function(){return this._invalidDate},Si.ordinal=function(t){return this._ordinal.replace("%d",t)},Si.preparse=xi,Si.postformat=xi,Si.relativeTime=function(t,e,i,n){var o=this._relativeTime[i];return T(o)?o(t,e,i,n):o.replace(/%d/i,t)},Si.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return T(i)?i(e):i.replace(/%s/i,e)},Si.set=function(t){var e,i;for(i in t)T(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Si.months=function(t,e){return t?o(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Nt).test(e)?"format":"standalone"][t.month()]:o(this._months)?this._months:this._months.standalone},Si.monthsShort=function(t,e){return t?o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Nt.test(e)?"format":"standalone"][t.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Si.monthsParse=function(t,e,i){var n,o,r;if(this._monthsParseExact)return Rt.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=c([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},Si.monthsRegex=function(t){return this._monthsParseExact?(l(this,"_monthsRegex")||Bt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=Lt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Si.monthsShortRegex=function(t){return this._monthsParseExact?(l(this,"_monthsRegex")||Bt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=zt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Si.week=function(t){return Gt(t,this._week.dow,this._week.doy).week},Si.firstDayOfYear=function(){return this._week.doy},Si.firstDayOfWeek=function(){return this._week.dow},Si.weekdays=function(t,e){var i=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Zt(i,this._week.dow):t?i[t.day()]:i},Si.weekdaysMin=function(t){return!0===t?Zt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Si.weekdaysShort=function(t){return!0===t?Zt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Si.weekdaysParse=function(t,e,i){var n,o,r;if(this._weekdaysParseExact)return Jt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=c([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},Si.weekdaysRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Qt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Si.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=te),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Si.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ee),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Si.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Si.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},fe("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=O("moment.lang is deprecated. Use moment.locale instead.",fe),n.langData=O("moment.langData is deprecated. Use moment.localeData instead.",ve);var Ei=Math.abs;function Ti(t,e,i,n){var o=Xe(e,i);return t._milliseconds+=n*o._milliseconds,t._days+=n*o._days,t._months+=n*o._months,t._bubble()}function Ci(t){return t<0?Math.floor(t):Math.ceil(t)}function Pi(t){return 4800*t/146097}function Ii(t){return 146097*t/4800}function Ni(t){return function(){return this.as(t)}}var Fi=Ni("ms"),Ai=Ni("s"),Ri=Ni("m"),Yi=Ni("h"),ji=Ni("d"),zi=Ni("w"),Li=Ni("M"),Bi=Ni("Q"),Hi=Ni("y");function Wi(t){return function(){return this.isValid()?this._data[t]:NaN}}var Vi=Wi("milliseconds"),Ui=Wi("seconds"),Gi=Wi("minutes"),qi=Wi("hours"),Zi=Wi("days"),Xi=Wi("months"),$i=Wi("years"),Ki=Math.round,Ji={ss:44,s:45,m:45,h:22,d:26,M:11};function Qi(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}var tn=Math.abs;function en(t){return(t>0)-(t<0)||+t}function nn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=tn(this._milliseconds)/1e3,n=tn(this._days),o=tn(this._months);t=w(i/60),e=w(t/60),i%=60,t%=60;var r=w(o/12),s=o%=12,a=n,h=e,d=t,l=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",f=en(this._months)!==en(u)?"-":"",p=en(this._days)!==en(u)?"-":"",v=en(this._milliseconds)!==en(u)?"-":"";return c+"P"+(r?f+r+"Y":"")+(s?f+s+"M":"")+(a?p+a+"D":"")+(h||d||l?"T":"")+(h?v+h+"H":"")+(d?v+d+"M":"")+(l?v+l+"S":"")}var on=je.prototype;return on.isValid=function(){return this._isValid},on.abs=function(){var t=this._data;return this._milliseconds=Ei(this._milliseconds),this._days=Ei(this._days),this._months=Ei(this._months),t.milliseconds=Ei(t.milliseconds),t.seconds=Ei(t.seconds),t.minutes=Ei(t.minutes),t.hours=Ei(t.hours),t.months=Ei(t.months),t.years=Ei(t.years),this},on.add=function(t,e){return Ti(this,t,e,1)},on.subtract=function(t,e){return Ti(this,t,e,-1)},on.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=F(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Pi(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Ii(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},on.asMilliseconds=Fi,on.asSeconds=Ai,on.asMinutes=Ri,on.asHours=Yi,on.asDays=ji,on.asWeeks=zi,on.asMonths=Li,on.asQuarters=Bi,on.asYears=Hi,on.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},on._bubble=function(){var t,e,i,n,o,r=this._milliseconds,s=this._days,a=this._months,h=this._data;return r>=0&&s>=0&&a>=0||r<=0&&s<=0&&a<=0||(r+=864e5*Ci(Ii(a)+s),s=0,a=0),h.milliseconds=r%1e3,t=w(r/1e3),h.seconds=t%60,e=w(t/60),h.minutes=e%60,i=w(e/60),h.hours=i%24,s+=w(i/24),o=w(Pi(s)),a+=o,s-=Ci(Ii(o)),n=w(a/12),a%=12,h.days=s,h.months=a,h.years=n,this},on.clone=function(){return Xe(this)},on.get=function(t){return t=F(t),this.isValid()?this[t+"s"]():NaN},on.milliseconds=Vi,on.seconds=Ui,on.minutes=Gi,on.hours=qi,on.days=Zi,on.weeks=function(){return w(this.days()/7)},on.months=Xi,on.years=$i,on.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=function(t,e,i){var n=Xe(t).abs(),o=Ki(n.as("s")),r=Ki(n.as("m")),s=Ki(n.as("h")),a=Ki(n.as("d")),h=Ki(n.as("M")),d=Ki(n.as("y")),l=o<=Ji.ss&&["s",o]||o<Ji.s&&["ss",o]||r<=1&&["m"]||r<Ji.m&&["mm",r]||s<=1&&["h"]||s<Ji.h&&["hh",s]||a<=1&&["d"]||a<Ji.d&&["dd",a]||h<=1&&["M"]||h<Ji.M&&["MM",h]||d<=1&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=i,Qi.apply(null,l)}(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},on.toISOString=nn,on.toString=nn,on.toJSON=nn,on.locale=ni,on.localeData=ri,on.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",nn),on.lang=oi,W("X",0,0,"unix"),W("x",0,0,"valueOf"),dt("x",ot),dt("X",/[+-]?\d+(\.\d{1,3})?/),ft("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),ft("x",(function(t,e,i){i._d=new Date(k(t))})),n.version="2.24.0",e=Ne,n.fn=ki,n.min=function(){return Re("isBefore",[].slice.call(arguments,0))},n.max=function(){return Re("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=c,n.unix=function(t){return Ne(1e3*t)},n.months=function(t,e){return Di(t,e,"months")},n.isDate=h,n.locale=fe,n.invalid=v,n.duration=Xe,n.isMoment=_,n.weekdays=function(t,e,i){return Mi(t,e,i,"weekdays")},n.parseZone=function(){return Ne.apply(null,arguments).parseZone()},n.localeData=ve,n.isDuration=ze,n.monthsShort=function(t,e){return Di(t,e,"monthsShort")},n.weekdaysMin=function(t,e,i){return Mi(t,e,i,"weekdaysMin")},n.defineLocale=pe,n.updateLocale=function(t,e){if(null!=e){var i,n,o=he;null!=(n=ce(t))&&(o=n._config),e=C(o,e),(i=new P(e)).parentLocale=de[t],de[t]=i,fe(t)}else null!=de[t]&&(null!=de[t].parentLocale?de[t]=de[t].parentLocale:null!=de[t]&&delete de[t]);return de[t]},n.locales=function(){return D(de)},n.weekdaysShort=function(t,e,i){return Mi(t,e,i,"weekdaysShort")},n.normalizeUnits=F,n.relativeTimeRounding=function(t){return void 0===t?Ki:"function"==typeof t&&(Ki=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Ji[t]&&(void 0===e?Ji[t]:(Ji[t]=e,"s"===t&&(Ji.ss=e-1),!0))},n.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},n.prototype=ki,n.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"},n}()})),Cc=[],Pc=0;Pc<256;Pc++)Cc[Pc]=(Pc+256).toString(16).substr(1);for(var Ic=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var t=new Uint8Array(16);return function(){return crypto.getRandomValues(t),t}}var e=new Array(16);return function(){for(var t,i=0;i<16;i++)0==(3&i)&&(t=4294967296*Math.random()),e[i]=t>>>((3&i)<<3)&255;return e}}(),Nc=[],Fc=0;Fc<256;Fc++)Nc[Fc]=(Fc+256).toString(16).substr(1);var Ac=Ic(),Rc=(Ac[0],Ac[1],Ac[2],Ac[3],Ac[4],Ac[5],Ac[6],Ac[7],/^\/?Date\((-?\d+)/i);function Yc(t){return t instanceof Number||"number"==typeof t}function jc(t){return t instanceof String||"string"==typeof t}function zc(t){return Tc.isMoment(t)}function Lc(t,e,i,n){var o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}function Bc(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)||!0===i)if(e[o]&&e[o].constructor===Object)void 0===t[o]&&(t[o]={}),t[o].constructor===Object?Bc(t[o],e[o],i):Lc(t,e,o,n);else if(Array.isArray(e[o])){t[o]=[];for(var r=0;r<e[o].length;r++)t[o].push(e[o][r])}else Lc(t,e,o,n);return t}function Hc(t,e){var i;if(void 0!==t){if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return jc(t)&&!isNaN(Date.parse(t))?Tc(t).valueOf():Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(Yc(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(zc(t))return new Date(t.valueOf());if(jc(t))return(i=Rc.exec(t))?new Date(Number(i[1])):Tc(new Date(t)).toDate();throw new Error("Cannot convert object of type "+Wc(t)+" to type Date");case"Moment":if(Yc(t))return Tc(t);if(t instanceof Date)return Tc(t.valueOf());if(zc(t))return Tc(t);if(jc(t))return i=Rc.exec(t),Tc(i?Number(i[1]):t);throw new Error("Cannot convert object of type "+Wc(t)+" to type Date");case"ISODate":if(Yc(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(zc(t))return t.toDate().toISOString();if(jc(t))return(i=Rc.exec(t))?new Date(Number(i[1])).toISOString():Tc(t).format();throw new Error("Cannot convert object of type "+Wc(t)+" to type ISODate");case"ASPDate":if(Yc(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(jc(t))return"/Date("+((i=Rc.exec(t))?new Date(Number(i[1])).valueOf():new Date(t).valueOf())+")/";throw new Error("Cannot convert object of type "+Wc(t)+" to type ASPDate");default:throw new Error("Unknown type ".concat(e))}}}function Wc(t){var e=Mc(t);return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function Vc(t){return"string"==typeof t||"number"==typeof t}var Uc=function(){function t(e){cc(this,t),this._queue=[],this._timeout=null,this._extended=null,this.delay=null,this.max=1/0,this.setOptions(e)}return pc(t,[{key:"setOptions",value:function(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,e=this._extended.methods,i=0;i<e.length;i++){var n=e[i];n.original?t[n.name]=n.original:delete t[n.name]}this._extended=null}}},{key:"replace",value:function(t,e){var i=this,n=t[e];if(!n)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];i.queue({args:e,fn:n,context:this})}}},{key:"queue",value:function(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var t=this;this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=setTimeout((function(){t.flush()}),this.delay))}},{key:"flush",value:function(){this._queue.splice(0).forEach((function(t){t.fn.apply(t.context||t.fn,t.args||[])}))}}],[{key:"extend",value:function(e,i){var n=new t(i);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){n.flush()};var o=[{name:"flush",original:void 0}];if(i&&i.replace)for(var r=0;r<i.replace.length;r++){var s=i.replace[r];o.push({name:s,original:e[s]}),n.replace(e,s)}return n._extended={object:e,methods:o},n}}]),t}(),Gc=function(){function t(){cc(this,t),this._subscribers={"*":[],add:[],remove:[],update:[]},this.subscribe=t.prototype.on,this.unsubscribe=t.prototype.off}return pc(t,[{key:"_trigger",value:function(t,e,i){if("*"===t)throw new Error("Cannot trigger event *");[].concat(lc(this._subscribers[t]),lc(this._subscribers["*"])).forEach((function(n){n(t,e,null!=i?i:null)}))}},{key:"on",value:function(t,e){"function"==typeof e&&this._subscribers[t].push(e)}},{key:"off",value:function(t,e){this._subscribers[t]=this._subscribers[t].filter((function(t){return t!==e}))}}]),t}();var qc=function(t){if(Array.isArray(t))return t};var Zc=function(t,e){var i=[],n=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){o=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw r}}return i};var Xc=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var $c=function(t,e){return qc(t)||Zc(t,e)||Xc()},Kc=function(){function t(e){cc(this,t),this._pairs=e}return pc(t,[{key:Symbol.iterator,value:rc.mark((function t(){var e,i,n,o,r,s,a,h;return rc.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=!0,i=!1,n=void 0,t.prev=3,o=this._pairs[Symbol.iterator]();case 5:if(e=(r=o.next()).done){t.next=12;break}return s=$c(r.value,2),a=s[0],h=s[1],t.next=9,[a,h];case 9:e=!0,t.next=5;break;case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(3),i=!0,n=t.t0;case 18:t.prev=18,t.prev=19,e||null==o.return||o.return();case 21:if(t.prev=21,!i){t.next=24;break}throw n;case 24:return t.finish(21);case 25:return t.finish(18);case 26:case"end":return t.stop()}}),t,this,[[3,14,18,26],[19,,21,25]])}))},{key:"entries",value:rc.mark((function t(){var e,i,n,o,r,s,a,h;return rc.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=!0,i=!1,n=void 0,t.prev=3,o=this._pairs[Symbol.iterator]();case 5:if(e=(r=o.next()).done){t.next=12;break}return s=$c(r.value,2),a=s[0],h=s[1],t.next=9,[a,h];case 9:e=!0,t.next=5;break;case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(3),i=!0,n=t.t0;case 18:t.prev=18,t.prev=19,e||null==o.return||o.return();case 21:if(t.prev=21,!i){t.next=24;break}throw n;case 24:return t.finish(21);case 25:return t.finish(18);case 26:case"end":return t.stop()}}),t,this,[[3,14,18,26],[19,,21,25]])}))},{key:"keys",value:rc.mark((function t(){var e,i,n,o,r,s,a;return rc.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=!0,i=!1,n=void 0,t.prev=3,o=this._pairs[Symbol.iterator]();case 5:if(e=(r=o.next()).done){t.next=12;break}return s=$c(r.value,1),a=s[0],t.next=9,a;case 9:e=!0,t.next=5;break;case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(3),i=!0,n=t.t0;case 18:t.prev=18,t.prev=19,e||null==o.return||o.return();case 21:if(t.prev=21,!i){t.next=24;break}throw n;case 24:return t.finish(21);case 25:return t.finish(18);case 26:case"end":return t.stop()}}),t,this,[[3,14,18,26],[19,,21,25]])}))},{key:"values",value:rc.mark((function t(){var e,i,n,o,r,s,a;return rc.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=!0,i=!1,n=void 0,t.prev=3,o=this._pairs[Symbol.iterator]();case 5:if(e=(r=o.next()).done){t.next=12;break}return s=$c(r.value,2),a=s[1],t.next=9,a;case 9:e=!0,t.next=5;break;case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(3),i=!0,n=t.t0;case 18:t.prev=18,t.prev=19,e||null==o.return||o.return();case 21:if(t.prev=21,!i){t.next=24;break}throw n;case 24:return t.finish(21);case 25:return t.finish(18);case 26:case"end":return t.stop()}}),t,this,[[3,14,18,26],[19,,21,25]])}))},{key:"toIdArray",value:function(){return lc(this._pairs).map((function(t){return t[0]}))}},{key:"toItemArray",value:function(){return lc(this._pairs).map((function(t){return t[1]}))}},{key:"toEntryArray",value:function(){return lc(this._pairs)}},{key:"toObjectMap",value:function(){var t=Object.create(null),e=!0,i=!1,n=void 0;try{for(var o,r=this._pairs[Symbol.iterator]();!(e=(o=r.next()).done);e=!0){var s=$c(o.value,2),a=s[0],h=s[1];t[a]=h}}catch(t){i=!0,n=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw n}}return t}},{key:"toMap",value:function(){return new Map(this._pairs)}},{key:"toIdSet",value:function(){return new Set(this.toIdArray())}},{key:"toItemSet",value:function(){return new Set(this.toItemArray())}},{key:"cache",value:function(){return new t(lc(this._pairs))}},{key:"distinct",value:function(t){var e=new Set,i=!0,n=!1,o=void 0;try{for(var r,s=this._pairs[Symbol.iterator]();!(i=(r=s.next()).done);i=!0){var a=$c(r.value,2),h=a[0],d=a[1];e.add(t(d,h))}}catch(t){n=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(n)throw o}}return e}},{key:"filter",value:function(e){var i=this._pairs;return new t(sc({},Symbol.iterator,rc.mark((function t(){var n,o,r,s,a,h,d,l;return rc.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!0,o=!1,r=void 0,t.prev=3,s=i[Symbol.iterator]();case 5:if(n=(a=s.next()).done){t.next=13;break}if(h=$c(a.value,2),d=h[0],l=h[1],!e(l,d)){t.next=10;break}return t.next=10,[d,l];case 10:n=!0,t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),o=!0,r=t.t0;case 19:t.prev=19,t.prev=20,n||null==s.return||s.return();case 22:if(t.prev=22,!o){t.next=25;break}throw r;case 25:return t.finish(22);case 26:return t.finish(19);case 27:case"end":return t.stop()}}),t,null,[[3,15,19,27],[20,,22,26]])}))))}},{key:"forEach",value:function(t){var e=!0,i=!1,n=void 0;try{for(var o,r=this._pairs[Symbol.iterator]();!(e=(o=r.next()).done);e=!0){var s=$c(o.value,2),a=s[0];t(s[1],a)}}catch(t){i=!0,n=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw n}}}},{key:"map",value:function(e){var i=this._pairs;return new t(sc({},Symbol.iterator,rc.mark((function t(){var n,o,r,s,a,h,d,l;return rc.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!0,o=!1,r=void 0,t.prev=3,s=i[Symbol.iterator]();case 5:if(n=(a=s.next()).done){t.next=12;break}return h=$c(a.value,2),d=h[0],l=h[1],t.next=9,[d,e(l,d)];case 9:n=!0,t.next=5;break;case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(3),o=!0,r=t.t0;case 18:t.prev=18,t.prev=19,n||null==s.return||s.return();case 21:if(t.prev=21,!o){t.next=24;break}throw r;case 24:return t.finish(21);case 25:return t.finish(18);case 26:case"end":return t.stop()}}),t,null,[[3,14,18,26],[19,,21,25]])}))))}},{key:"max",value:function(t){var e=this._pairs[Symbol.iterator](),i=e.next();if(i.done)return null;for(var n=i.value[1],o=t(i.value[1],i.value[0]);!(i=e.next()).done;){var r=$c(i.value,2),s=r[0],a=r[1],h=t(a,s);h>o&&(o=h,n=a)}return n}},{key:"min",value:function(t){var e=this._pairs[Symbol.iterator](),i=e.next();if(i.done)return null;for(var n=i.value[1],o=t(i.value[1],i.value[0]);!(i=e.next()).done;){var r=$c(i.value,2),s=r[0],a=r[1],h=t(a,s);h<o&&(o=h,n=a)}return n}},{key:"reduce",value:function(t,e){var i=!0,n=!1,o=void 0;try{for(var r,s=this._pairs[Symbol.iterator]();!(i=(r=s.next()).done);i=!0){var a=$c(r.value,2),h=a[0];e=t(e,a[1],h)}}catch(t){n=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(n)throw o}}return e}},{key:"sort",value:function(e){var i=this;return new t(sc({},Symbol.iterator,(function(){return lc(i._pairs).sort((function(t,i){var n=$c(t,2),o=n[0],r=n[1],s=$c(i,2),a=s[0],h=s[1];return e(r,h,o,a)}))[Symbol.iterator]()})))}}]),t}();function Jc(t,e){var i=Object.keys(t);return Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t)),e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i}var Qc=function(t){function e(t,i){var n;if(cc(this,e),n=gc(this,yc(e).call(this)),t&&!Array.isArray(t)&&(i=t,t=[]),n._options=i||{},n._data=new Map,n.length=0,n._idProp=n._options.fieldId||"id",n._type={},n._options.type)for(var o=Object.keys(n._options.type),r=0,s=o.length;r<s;r++){var a=o[r],h=n._options.type[a];n._type[a]="Date"==h||"ISODate"==h||"ASPDate"==h?"Date":h}return t&&t.length&&n.add(t),n.setOptions(i),n}return bc(e,Gc),pc(e,[{key:"setOptions",value:function(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=Uc.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"===uc(t.queue)&&this._queue.setOptions(t.queue)))}},{key:"add",value:function(t,e){var i,n=this,o=[];if(Array.isArray(t)){if(t.map((function(t){return t[n._idProp]})).some((function(t){return n._data.has(t)})))throw new Error("A duplicate id was found in the parameter array.");for(var r=0,s=t.length;r<s;r++)i=this._addItem(t[r]),o.push(i)}else{if(!t||"object"!==uc(t))throw new Error("Unknown dataType");i=this._addItem(t),o.push(i)}return o.length&&this._trigger("add",{items:o},e),o}},{key:"update",value:function(t,e){var i=this,n=[],o=[],r=[],s=[],a=this._idProp,h=function(t){var e=t[a];if(null!=e&&i._data.has(e)){var h=t,d=Object.assign({},i._data.get(e)),l=i._updateItem(h);o.push(l),s.push(h),r.push(d)}else{var u=i._addItem(t);n.push(u)}};if(Array.isArray(t))for(var d=0,l=t.length;d<l;d++)t[d]&&"object"===uc(t[d])?h(t[d]):console.warn("Ignoring input item, which is not an object at index "+d);else{if(!t||"object"!==uc(t))throw new Error("Unknown dataType");h(t)}if(n.length&&this._trigger("add",{items:n},e),o.length){var u={items:o,oldData:r,data:s};this._trigger("update",u,e)}return n.concat(o)}},{key:"updateOnly",value:function(t,e){var i=this;Array.isArray(t)||(t=[t]);var n=t.map((function(t){var e=i._data.get(t[i._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}})).map((function(t){var e=t.oldData,n=t.update,o=e[i._idProp],r=Bc(Bc({},e),n);return i._data.set(o,r),{id:o,oldData:e,updatedData:r}}));if(n.length){var o={items:n.map((function(t){return t.id})),oldData:n.map((function(t){return t.oldData})),data:n.map((function(t){return t.updatedData}))};return this._trigger("update",o,e),o.items}return[]}},{key:"get",value:function(t,e){var i=void 0,n=void 0,o=void 0;Vc(t)?(i=t,o=e):Array.isArray(t)?(n=t,o=e):o=t;var r=o&&"Object"===o.returnType?"Object":"Array",s=o&&o.type||this._options.type,a=o&&o.filter,h=[],d=null,l=null,u=null;if(null!=i)(d=this._getItem(i,s))&&a&&!a(d)&&(d=null);else if(null!=n)for(var c=0,f=n.length;c<f;c++)null==(d=this._getItem(n[c],s))||a&&!a(d)||h.push(d);else for(var p=0,v=(l=lc(this._data.keys())).length;p<v;p++)u=l[p],null==(d=this._getItem(u,s))||a&&!a(d)||h.push(d);if(o&&o.order&&null==i&&this._sort(h,o.order),o&&o.fields){var g=o.fields;if(null!=i&&null!=d)d=this._filterFields(d,g);else for(var y=0,m=h.length;y<m;y++)h[y]=this._filterFields(h[y],g)}if("Object"==r){for(var b={},_=0,w=h.length;_<w;_++){var k=h[_];b[k[this._idProp]]=k}return b}return null!=i?d:h}},{key:"getIds",value:function(t){var e,i,n=this._data,o=t&&t.filter,r=t&&t.order,s=t&&t.type||this._options.type,a=lc(n.keys()),h=[];if(o)if(r){i=[];for(var d=0,l=a.length;d<l;d++){var u=a[d];o(e=this._getItem(u,s))&&i.push(e)}this._sort(i,r);for(var c=0,f=i.length;c<f;c++)h.push(i[c][this._idProp])}else for(var p=0,v=a.length;p<v;p++){var g=a[p];o(e=this._getItem(g,s))&&h.push(e[this._idProp])}else if(r){i=[];for(var y=0,m=a.length;y<m;y++){var b=a[y];i.push(n.get(b))}this._sort(i,r);for(var _=0,w=i.length;_<w;_++)h.push(i[_][this._idProp])}else for(var k=0,x=a.length;k<x;k++){var S=a[k];e=n.get(S),h.push(e[this._idProp])}return h}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(t,e){var i=e&&e.filter,n=e&&e.type||this._options.type,o=this._data,r=lc(o.keys());if(e&&e.order)for(var s=this.get(e),a=0,h=s.length;a<h;a++){var d=s[a];t(d,d[this._idProp])}else for(var l=0,u=r.length;l<u;l++){var c=r[l],f=this._getItem(c,n);i&&!i(f)||t(f,c)}}},{key:"map",value:function(t,e){for(var i=e&&e.filter,n=e&&e.type||this._options.type,o=[],r=this._data,s=lc(r.keys()),a=0,h=s.length;a<h;a++){var d=s[a],l=this._getItem(d,n);i&&!i(l)||o.push(t(l,d))}return e&&e.order&&this._sort(o,e.order),o}},{key:"_filterFields",value:function(t,e){return t?(Array.isArray(e)?e:Object.keys(e)).reduce((function(e,i){return e[i]=t[i],e}),{}):t}},{key:"_sort",value:function(t,e){if("string"==typeof e){var i=e;t.sort((function(t,e){var n=t[i],o=e[i];return n>o?1:n<o?-1:0}))}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}}},{key:"remove",value:function(t,e){for(var i=[],n=[],o=Array.isArray(t)?t:[t],r=0,s=o.length;r<s;r++){var a=this._remove(o[r]);if(a){var h=a[this._idProp];null!=h&&(i.push(h),n.push(a))}}return i.length&&this._trigger("remove",{items:i,oldData:n},e),i}},{key:"_remove",value:function(t){var e;if(Vc(t)?e=t:t&&"object"===uc(t)&&(e=t[this._idProp]),null!=e&&this._data.has(e)){var i=this._data.get(e)||null;return this._data.delete(e),--this.length,i}return null}},{key:"clear",value:function(t){for(var e=lc(this._data.keys()),i=[],n=0,o=e.length;n<o;n++)i.push(this._data.get(e[n]));return this._data.clear(),this.length=0,this._trigger("remove",{items:e,oldData:i},t),e}},{key:"max",value:function(t){var e=null,i=null,n=!0,o=!1,r=void 0;try{for(var s,a=this._data.values()[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var h=s.value,d=h[t];"number"==typeof d&&(null==i||d>i)&&(e=h,i=d)}}catch(t){o=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw r}}return e||null}},{key:"min",value:function(t){var e=null,i=null,n=!0,o=!1,r=void 0;try{for(var s,a=this._data.values()[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var h=s.value,d=h[t];"number"==typeof d&&(null==i||d<i)&&(e=h,i=d)}}catch(t){o=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw r}}return e||null}},{key:"distinct",value:function(t){for(var e=this._data,i=lc(e.keys()),n=[],o=this._options.type&&this._options.type[t]||null,r=0,s=0,a=i.length;s<a;s++){for(var h=i[s],d=e.get(h)[t],l=!1,u=0;u<r;u++)if(n[u]==d){l=!0;break}l||void 0===d||(n[r]=d,r++)}if(o)for(var c=0,f=n.length;c<f;c++)n[c]=Hc(n[c],o);return n}},{key:"_addItem",value:function(t){var e=t[this._idProp];if(null!=e){if(this._data.has(e))throw new Error("Cannot add item: item with id "+e+" already exists")}else e=Dc(),t[this._idProp]=e;for(var i={},n=Object.keys(t),o=0,r=n.length;o<r;o++){var s=n[o],a=this._type[s];i[s]=Hc(t[s],a)}return this._data.set(e,i),++this.length,e}},{key:"_getItem",value:function(t,e){var i,n=this._data.get(t);if(!n)return null;var o=Object.keys(n);if(e){i={};for(var r=0,s=o.length;r<s;r++){var a=o[r],h=n[a];i[a]=Hc(h,e[a])}}else i=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Jc(i,!0).forEach((function(e){sc(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Jc(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},n);return null==i[this._idProp]&&(i[this._idProp]=n.id),i}},{key:"_updateItem",value:function(t){var e=t[this._idProp];if(null==e)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this._data.get(e);if(!i)throw new Error("Cannot update item: no item with id "+e+" found");for(var n=Object.keys(t),o=0,r=n.length;o<r;o++){var s=n[o],a=this._type[s];i[s]=Hc(t[s],a)}return e}},{key:"stream",value:function(t){if(t){var e=this._data;return new Kc(sc({},Symbol.iterator,rc.mark((function i(){var n,o,r,s,a,h,d;return rc.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:n=!0,o=!1,r=void 0,i.prev=3,s=t[Symbol.iterator]();case 5:if(n=(a=s.next()).done){i.next=14;break}if(h=a.value,null==(d=e.get(h))){i.next=11;break}return i.next=11,[h,d];case 11:n=!0,i.next=5;break;case 14:i.next=20;break;case 16:i.prev=16,i.t0=i.catch(3),o=!0,r=i.t0;case 20:i.prev=20,i.prev=21,n||null==s.return||s.return();case 23:if(i.prev=23,!o){i.next=26;break}throw r;case 26:return i.finish(23);case 27:return i.finish(20);case 28:case"end":return i.stop()}}),i,null,[[3,16,20,28],[21,,23,27]])}))))}return new Kc(sc({},Symbol.iterator,this._data.entries.bind(this._data)))}}]),e}(),tf=function(t){function e(t,i){var n;return cc(this,e),(n=gc(this,yc(e).call(this))).length=0,n._ids=new Set,n._options=i||{},n._listener=n._onEvent.bind(vc(n)),n.setData(t),n}return bc(e,Gc),pc(e,[{key:"setData",value:function(t){if(this._data){this._data.off&&this._data.off("*",this._listener);var e=this._data.getIds({filter:this._options.filter}),i=this._data.get(e);this._ids.clear(),this.length=0,this._trigger("remove",{items:e,oldData:i})}if(null!=t){this._data=t;for(var n=this._data.getIds({filter:this._options.filter}),o=0,r=n.length;o<r;o++){var s=n[o];this._ids.add(s)}this.length=n.length,this._trigger("add",{items:n})}else this._data=new Qc;this._data.on&&this._data.on("*",this._listener)}},{key:"refresh",value:function(){for(var t=this._data.getIds({filter:this._options.filter}),e=lc(this._ids),i={},n=[],o=[],r=[],s=0,a=t.length;s<a;s++){var h=t[s];i[h]=!0,this._ids.has(h)||(n.push(h),this._ids.add(h))}for(var d=0,l=e.length;d<l;d++){var u=e[d],c=this._data.get(u);null==c?console.error("If you see this, report it please."):i[u]||(o.push(u),r.push(c),this._ids.delete(u))}this.length+=n.length-o.length,n.length&&this._trigger("add",{items:n}),o.length&&this._trigger("remove",{items:o,oldData:r})}},{key:"get",value:function(t,e){if(null==this._data)return null;var i,n=null;Vc(t)||Array.isArray(t)?(n=t,i=e):i=t;var o=Object.assign({},this._options,i),r=this._options.filter,s=i&&i.filter;return r&&s&&(o.filter=function(t){return r(t)&&s(t)}),null==n?this._data.get(o):this._data.get(n,o)}},{key:"getIds",value:function(t){if(this._data.length){var e,i=this._options.filter,n=null!=t?t.filter:null;return e=n?i?function(t){return i(t)&&n(t)}:n:i,this._data.getIds({filter:e,order:t&&t.order})}return[]}},{key:"forEach",value:function(t,e){if(this._data){var i,n=this._options.filter,o=e&&e.filter;i=o?n?function(t){return n(t)&&o(t)}:o:n,this._data.forEach(t,{filter:i,order:e&&e.order})}}},{key:"map",value:function(t,e){if(this._data){var i,n=this._options.filter,o=e&&e.filter;return i=o?n?function(t){return n(t)&&o(t)}:o:n,this._data.map(t,{filter:i,order:e&&e.order})}return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"stream",value:function(t){return this._data.stream(t||sc({},Symbol.iterator,this._ids.keys.bind(this._ids)))}},{key:"_onEvent",value:function(t,e,i){if(e&&e.items&&this._data){var n=e.items,o=[],r=[],s=[],a=[],h=[],d=[];switch(t){case"add":for(var l=0,u=n.length;l<u;l++){var c=n[l];this.get(c)&&(this._ids.add(c),o.push(c))}break;case"update":for(var f=0,p=n.length;f<p;f++){var v=n[f];this.get(v)?this._ids.has(v)?(r.push(v),h.push(e.data[f]),a.push(e.oldData[f])):(this._ids.add(v),o.push(v)):this._ids.has(v)&&(this._ids.delete(v),s.push(v),d.push(e.oldData[f]))}break;case"remove":for(var g=0,y=n.length;g<y;g++){var m=n[g];this._ids.has(m)&&(this._ids.delete(m),s.push(m),d.push(e.oldData[g]))}}this.length+=o.length-s.length,o.length&&this._trigger("add",{items:o},i),r.length&&this._trigger("update",{items:r,oldData:a,data:h},i),s.length&&this._trigger("remove",{items:s,oldData:d},i)}}}]),e}(),ef={DataSet:Qc,DataView:tf,Queue:Uc},nf=Object.freeze({__proto__:null,default:ef,DataSet:Qc,DataStream:Kc,DataView:tf,Queue:Uc}),of=eh.trim,rf=a.parseFloat,sf=1/rf($a+"-0")!=-1/0?function(t){var e=of(String(t)),i=rf(e);return 0===i&&"-"==e.charAt(0)?-0:i}:rf;Ct({global:!0,forced:parseFloat!=sf},{parseFloat:sf});var af=eh.trim,hf=a.parseInt,df=/^[+-]?0[Xx]/,lf=8!==hf($a+"08")||22!==hf($a+"0x16")?function(t,e){var i=af(String(t));return hf(i,e>>>0||(df.test(i)?16:10))}:hf;Ct({global:!0,forced:parseInt!=lf},{parseInt:lf});var uf=Math.max,cf=Math.min,ff=Math.floor,pf=/\$([$&'`]|\d\d?|<[^>]*>)/g,vf=/\$([$&'`]|\d\d?)/g;Eh("replace",2,(function(t,e,i){return[function(i,n){var o=m(this),r=null==i?void 0:i[t];return void 0!==r?r.call(i,o,n):e.call(String(o),i,n)},function(t,o){var r=i(e,t,this,o);if(r.done)return r.value;var s=C(t),a=String(this),h="function"==typeof o;h||(o=String(o));var d=s.global;if(d){var l=s.unicode;s.lastIndex=0}for(var u=[];;){var c=Nh(s,a);if(null===c)break;if(u.push(c),!d)break;""===String(c[0])&&(s.lastIndex=Ih(a,ht(s.lastIndex),l))}for(var f,p="",v=0,g=0;g<u.length;g++){c=u[g];for(var y=String(c[0]),m=uf(cf(st(c.index),a.length),0),b=[],_=1;_<c.length;_++)b.push(void 0===(f=c[_])?f:String(f));var w=c.groups;if(h){var k=[y].concat(b,m,a);void 0!==w&&k.push(w);var x=String(o.apply(void 0,k))}else x=n(y,a,m,b,w,o);m>=v&&(p+=a.slice(v,m)+x,v=m+y.length)}return p+a.slice(v)}];function n(t,i,n,o,r,s){var a=n+t.length,h=o.length,d=vf;return void 0!==r&&(r=jt(r),d=pf),e.call(s,d,(function(e,s){var d;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return i.slice(0,n);case"'":return i.slice(a);case"<":d=r[s.slice(1,-1)];break;default:var l=+s;if(0===l)return e;if(l>h){var u=ff(l/10);return 0===u?e:u<=h?void 0===o[u-1]?s.charAt(1):o[u-1]+s.charAt(1):e}d=o[l-1]}return void 0===d?"":d}))}}));var gf=[].join,yf=y!=Object,mf=va("join",",");Ct({target:"Array",proto:!0,forced:yf||mf},{join:function(t){return gf.call(b(this),void 0===t?",":t)}});var bf=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"choosify",value:function(t,e){var i=["node","edge","label"],n=!0,o=ra(e,"chosen");if("boolean"==typeof o)n=o;else if("object"===Lu(o)){if(-1===i.indexOf(t))throw new Error("choosify: subOption '"+t+"' should be one of '"+i.join("', '")+"'");var r=ra(e,["chosen",t]);"boolean"!=typeof r&&"function"!=typeof r||(n=r)}return n}},{key:"pointInRect",value:function(t,e,i){if(t.width<=0||t.height<=0)return!1;if(void 0!==i){var n={x:e.x-i.x,y:e.y-i.y};if(0!==i.angle){var o=-i.angle;e={x:Math.cos(o)*n.x-Math.sin(o)*n.y,y:Math.sin(o)*n.x+Math.cos(o)*n.y}}else e=n}var r=t.x+t.width,s=t.y+t.width;return t.left<e.x&&r>e.x&&t.top<e.y&&s>e.y}},{key:"isValidLabel",value:function(t){return"string"==typeof t&&""!==t}}]),t}(),_f=Ft("species"),wf=[].slice,kf=Math.max;Ct({target:"Array",proto:!0,forced:!Ha("slice")},{slice:function(t,e){var i,n,o,r=b(this),s=ht(r.length),a=ut(t,s),h=ut(void 0===e?s:e,s);if(da(r)&&("function"!=typeof(i=r.constructor)||i!==Array&&!da(i.prototype)?_(i)&&null===(i=i[_f])&&(i=void 0):i=void 0,i===Array||void 0===i))return wf.call(r,a,h);for(n=new(void 0===i?Array:i)(kf(h-a,0)),o=0;a<h;a++,o++)a in r&&Aa(n,o,r[a]);return n.length=o,n}});var xf=Ft("species"),Sf=function(t){var e=nt(t),i=I.f;d&&e&&!e[xf]&&i(e,xf,{configurable:!0,get:function(){return this}})},Of=I.f,Df=mt.f,Mf=Ft("match"),Ef=a.RegExp,Tf=Ef.prototype,Cf=/a/g,Pf=/a/g,If=new Ef(Cf)!==Cf;if(d&&Et("RegExp",!If||h((function(){return Pf[Mf]=!1,Ef(Cf)!=Cf||Ef(Pf)==Pf||"/a/i"!=Ef(Cf,"i")})))){for(var Nf=function(t,e){var i=this instanceof Nf,n=kh(t),o=void 0===e;return!i&&n&&t.constructor===Nf&&o?t:Xa(If?new Ef(n&&!o?t.source:t,e):Ef((n=t instanceof Nf)?t.source:t,n&&o?ph.call(t):e),i?this:Tf,Nf)},Ff=function(t){t in Nf||Of(Nf,t,{configurable:!0,get:function(){return Ef[t]},set:function(e){Ef[t]=e}})},Af=Df(Ef),Rf=0;Af.length>Rf;)Ff(Af[Rf++]);Tf.constructor=Nf,Nf.prototype=Tf,tt(a,"RegExp",Nf)}Sf("RegExp");var Yf=RegExp.prototype,jf=Yf.toString,zf=h((function(){return"/a/b"!=jf.call({source:"a",flags:"b"})})),Lf="toString"!=jf.name;(zf||Lf)&&tt(RegExp.prototype,"toString",(function(){var t=C(this),e=String(t.source),i=t.flags;return"/"+e+"/"+String(void 0===i&&t instanceof RegExp&&!("flags"in Yf)?ph.call(t):i)}),{unsafe:!0}),Eh("match",1,(function(t,e,i){return[function(e){var i=m(this),n=null==e?void 0:e[t];return void 0!==n?n.call(e,i):new RegExp(e)[t](String(i))},function(t){var n=i(e,t,this);if(n.done)return n.value;var o=C(t),r=String(this);if(!o.global)return Nh(o,r);var s=o.unicode;o.lastIndex=0;for(var a,h=[],d=0;null!==(a=Nh(o,r));){var l=String(a[0]);h[d]=l,""===l&&(o.lastIndex=Ih(r,ht(o.lastIndex),s)),d++}return 0===d?null:h}]})),Ct({target:"String",proto:!0,forced:xd("bold")},{bold:function(){return kd(this,"b","","")}});var Bf,Hf,Wf,Vf={},Uf=Ft("iterator"),Gf=!1;[].keys&&("next"in(Wf=[].keys())?(Hf=Ht(Ht(Wf)))!==Object.prototype&&(Bf=Hf):Gf=!0),null==Bf&&(Bf={}),x(Bf,Uf)||N(Bf,Uf,(function(){return this}));var qf={IteratorPrototype:Bf,BUGGY_SAFARI_ITERATORS:Gf},Zf=qf.IteratorPrototype,Xf=function(){return this},$f=qf.IteratorPrototype,Kf=qf.BUGGY_SAFARI_ITERATORS,Jf=Ft("iterator"),Qf=function(){return this},tp=function(t,e,i,n,o,r,s){!function(t,e,i){var n=e+" Iterator";t.prototype=Sa(Zf,{next:f(1,i)}),ve(t,n,!1),Vf[n]=Xf}(i,e,n);var a,h,d,l=function(t){if(t===o&&g)return g;if(!Kf&&t in p)return p[t];switch(t){case"keys":case"values":case"entries":return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",c=!1,p=t.prototype,v=p[Jf]||p["@@iterator"]||o&&p[o],g=!Kf&&v||l(o),y="Array"==e&&p.entries||v;if(y&&(a=Ht(y.call(new t)),$f!==Object.prototype&&a.next&&(Ht(a)!==$f&&(Wt?Wt(a,$f):"function"!=typeof a[Jf]&&N(a,Jf,Qf)),ve(a,u,!0))),"values"==o&&v&&"values"!==v.name&&(c=!0,g=function(){return v.call(this)}),p[Jf]!==g&&N(p,Jf,g),Vf[e]=g,o)if(h={values:l("values"),keys:r?g:l("keys"),entries:l("entries")},s)for(d in h)!Kf&&!c&&d in p||tt(p,d,h[d]);else Ct({target:e,proto:!0,forced:Kf||c},h);return h},ep=Q.set,ip=Q.getterFor("Array Iterator"),np=tp(Array,"Array",(function(t,e){ep(this,{type:"Array Iterator",target:b(t),index:0,kind:e})}),(function(){var t=ip(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");Vf.Arguments=Vf.Array,Ma("keys"),Ma("values"),Ma("entries");var op=Object.assign,rp=!op||h((function(){var t={},e={},i=Symbol();return t[i]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=op({},t)[i]||"abcdefghijklmnopqrst"!=ma(op({},e)).join("")}))?function(t,e){for(var i=jt(t),n=arguments.length,o=1,r=bt.f,s=c.f;n>o;)for(var a,h=y(arguments[o++]),l=r?ma(h).concat(r(h)):ma(h),u=l.length,f=0;u>f;)a=l[f++],d&&!s.call(h,a)||(i[a]=h[a]);return i}:op;Ct({target:"Object",stat:!0,forced:Object.assign!==rp},{assign:rp});var sp=Ft("iterator"),ap=Ft("toStringTag"),hp=np.values;for(var dp in Yh){var lp=a[dp],up=lp&&lp.prototype;if(up){if(up[sp]!==hp)try{N(up,sp,hp)}catch(t){up[sp]=hp}if(up[ap]||N(up,ap,dp),Yh[dp])for(var cp in np)if(up[cp]!==np[cp])try{N(up,cp,np[cp])}catch(t){up[cp]=np[cp]}}}var fp=function(){function t(e){Bu(this,t),this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}return Wu(t,[{key:"_add",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[t]&&(this.lines[t]={width:0,height:0,blocks:[]});var n=e;void 0!==e&&""!==e||(n=" ");var o=this.measureText(n,i),r=Object.assign({},o.values);r.text=e,r.width=o.width,r.mod=i,void 0!==e&&""!==e||(r.width=0),this.lines[t].blocks.push(r),this.lines[t].width+=r.width}},{key:"curWidth",value:function(){var t=this.lines[this.current];return void 0===t?0:t.width}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e)}},{key:"newLine",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e),this.current++}},{key:"determineLineHeights",value:function(){for(var t=0;t<this.lines.length;t++){var e=this.lines[t],i=0;if(void 0!==e.blocks)for(var n=0;n<e.blocks.length;n++){var o=e.blocks[n];i<o.height&&(i=o.height)}e.height=i}}},{key:"determineLabelSize",value:function(){for(var t=0,e=0,i=0;i<this.lines.length;i++){var n=this.lines[i];n.width>t&&(t=n.width),e+=n.height}this.width=t,this.height=e}},{key:"removeEmptyBlocks",value:function(){for(var t=[],e=0;e<this.lines.length;e++){var i=this.lines[e];if(0!==i.blocks.length&&(e!==this.lines.length-1||0!==i.width)){var n={};Object.assign(n,i),n.blocks=[];for(var o=void 0,r=[],s=0;s<i.blocks.length;s++){var a=i.blocks[s];0!==a.width?r.push(a):void 0===o&&(o=a)}0===r.length&&void 0!==o&&r.push(o),n.blocks=r,t.push(n)}}return t}},{key:"finalize",value:function(){this.determineLineHeights(),this.determineLabelSize();var t=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:t}}}]),t}(),pp={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/\_/,"`":/`/,afterBold:/[^\*]/,afterItal:/[^_]/,afterMono:/[^`]/},vp=function(){function t(e){Bu(this,t),this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return Wu(t,[{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),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(t){" "===t&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)}},{key:"parseWS",value:function(t){return!!/[ \t]/.test(t)&&(this.mono?this.add(t):this.spacing=!0,!0)}},{key:"setTag",value:function(t){this.emitBlock(),this[t]=!0,this.modStack.unshift(t)}},{key:"unsetTag",value:function(t){this.emitBlock(),this[t]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(t,e){return!(this.mono||this[t]||!this.match(e))&&(this.setTag(t),!0)}},{key:"match",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.prepareRegExp(t),n=Qu(i,2),o=n[0],r=n[1],s=o.test(this.text.substr(this.position,r));return s&&e&&(this.position+=r-1),s}},{key:"parseEndTag",value:function(t,e,i){var n=this.mod()===t;return!(!(n="mono"===t?n&&this.mono:n&&!this.mono)||!this.match(e))&&(void 0!==i?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(t):this.unsetTag(t),!0)}},{key:"replace",value:function(t,e){return!!this.match(t)&&(this.add(e),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(t){var e,i;if(t instanceof RegExp)i=t,e=1;else{var n=pp[t];i=void 0!==n?n:new RegExp(t),e=t.length}return[i,e]}}]),t}(),gp=function(){function t(e,i,n,o){var r=this;Bu(this,t),this.ctx=e,this.parent=i,this.selected=n,this.hover=o;this.lines=new fp((function(t,i){if(void 0===t)return 0;var s=r.parent.getFormattingValues(e,n,o,i),a=0;""!==t&&(a=r.ctx.measureText(t).width);return{width:a,values:s}}))}return Wu(t,[{key:"process",value:function(t){if(!bf.isValidLabel(t))return this.lines.finalize();var e=this.parent.fontOptions;t=(t=t.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");var i=String(t).split("\n"),n=i.length;if(e.multi)for(var o=0;o<n;o++){var r=this.splitBlocks(i[o],e.multi);if(void 0!==r)if(0!==r.length){if(e.maxWdt>0)for(var s=0;s<r.length;s++){var a=r[s].mod,h=r[s].text;this.splitStringIntoLines(h,a,!0)}else for(var d=0;d<r.length;d++){var l=r[d].mod,u=r[d].text;this.lines.append(u,l)}this.lines.newLine()}else this.lines.newLine("")}else if(e.maxWdt>0)for(var c=0;c<n;c++)this.splitStringIntoLines(i[c]);else for(var f=0;f<n;f++)this.lines.newLine(i[f]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(t){var e="none";return"markdown"===t||"md"===t?e="markdown":!0!==t&&"html"!==t||(e="html"),e}},{key:"splitHtmlBlocks",value:function(t){for(var e=new vp(t),i=function(t){return!!/&/.test(t)&&(e.replace(e.text,"&lt;","<")||e.replace(e.text,"&amp;","&")||e.add("&"),!0)};e.position<e.text.length;){var n=e.text.charAt(e.position);e.parseWS(n)||/</.test(n)&&(e.parseStartTag("bold","<b>")||e.parseStartTag("ital","<i>")||e.parseStartTag("mono","<code>")||e.parseEndTag("bold","</b>")||e.parseEndTag("ital","</i>")||e.parseEndTag("mono","</code>"))||i(n)||e.add(n),e.position++}return e.emitBlock(),e.blocks}},{key:"splitMarkdownBlocks",value:function(t){for(var e=this,i=new vp(t),n=!0,o=function(t){return!!/\\/.test(t)&&(i.position<e.text.length+1&&(i.position++,t=e.text.charAt(i.position),/ \t/.test(t)?i.spacing=!0:(i.add(t),n=!1)),!0)};i.position<i.text.length;){var r=i.text.charAt(i.position);i.parseWS(r)||o(r)||(n||i.spacing)&&(i.parseStartTag("bold","*")||i.parseStartTag("ital","_")||i.parseStartTag("mono","`"))||i.parseEndTag("bold","*","afterBold")||i.parseEndTag("ital","_","afterItal")||i.parseEndTag("mono","`","afterMono")||(i.add(r),n=!1),i.position++}return i.emitBlock(),i.blocks}},{key:"splitBlocks",value:function(t,e){var i=this.decodeMarkupSystem(e);return"none"===i?[{text:t,mod:"normal"}]:"markdown"===i?this.splitMarkdownBlocks(t):"html"===i?this.splitHtmlBlocks(t):void 0}},{key:"overMaxWidth",value:function(t){var e=this.ctx.measureText(t).width;return this.lines.curWidth()+e>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(t){for(var e="",i=0;i<t.length;){var n=e+(""===e?"":" ")+t[i];if(this.overMaxWidth(n))break;e=n,i++}return i}},{key:"getLongestFitWord",value:function(t){for(var e=0;e<t.length&&!this.overMaxWidth(t.slice(0,e));)e++;return e}},{key:"splitStringIntoLines",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,e);for(var n=(t=(t=t.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");n.length>0;){var o=this.getLongestFit(n);if(0===o){var r=n[0],s=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,s),e),n[0]=r.slice(s)}else{var a=o;" "===n[o-1]?o--:" "===n[a]&&a++;var h=n.slice(0,o).join("");o==n.length&&i?this.lines.append(h,e):this.lines.newLine(h,e),n=n.slice(a)}}}}]),t}(),yp=["bold","ital","boldital","mono"],mp=function(){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Bu(this,t),this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return Wu(t,[{key:"setOptions",value:function(t){if(this.elementOptions=t,this.initFontOptions(t.font),bf.isValidLabel(t.label)?this.labelDirty=!0:t.label=void 0,void 0!==t.font&&null!==t.font)if("string"==typeof t.font)this.baseSize=this.fontOptions.size;else if("object"===Lu(t.font)){var e=t.font.size;void 0!==e&&(this.baseSize=e)}}},{key:"initFontOptions",value:function(e){var i=this;Ms(yp,(function(t){i.fontOptions[t]={}})),t.parseFontString(this.fontOptions,e)?this.fontOptions.vadjust=0:Ms(e,(function(t,e){null!=t&&"object"!==Lu(t)&&(i.fontOptions[e]=t)}))}},{key:"constrain",value:function(t){var e={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=ra(t,"widthConstraint");if("number"==typeof i)e.maxWdt=Number(i),e.minWdt=Number(i);else if("object"===Lu(i)){var n=ra(t,["widthConstraint","maximum"]);"number"==typeof n&&(e.maxWdt=Number(n));var o=ra(t,["widthConstraint","minimum"]);"number"==typeof o&&(e.minWdt=Number(o))}var r=ra(t,"heightConstraint");if("number"==typeof r)e.minHgt=Number(r);else if("object"===Lu(r)){var s=ra(t,["heightConstraint","minimum"]);"number"==typeof s&&(e.minHgt=Number(s));var a=ra(t,["heightConstraint","valign"]);"string"==typeof a&&("top"!==a&&"bottom"!==a||(e.valign=a))}return e}},{key:"update",value:function(t,e){this.setOptions(t,!0),this.propagateFonts(e),gs(this.fontOptions,this.constrain(e)),this.fontOptions.chooser=bf.choosify("label",e)}},{key:"adjustSizes",value:function(t){var e=t?t.right+t.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=e,this.fontOptions.minWdt-=e);var i=t?t.top+t.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}},{key:"addFontOptionsToPile",value:function(t,e){for(var i=0;i<e.length;++i)this.addFontToPile(t,e[i])}},{key:"addFontToPile",value:function(t,e){if(void 0!==e&&void 0!==e.font&&null!==e.font){var i=e.font;t.push(i)}}},{key:"getBasicOptions",value:function(e){for(var i={},n=0;n<e.length;++n){var o=e[n],r={};t.parseFontString(r,o)&&(o=r),Ms(o,(function(t,e){void 0!==t&&(i.hasOwnProperty(e)||(-1!==yp.indexOf(e)?i[e]={}:i[e]=t))}))}return i}},{key:"getFontOption",value:function(e,i,n){for(var o,r=0;r<e.length;++r){var s=e[r];if(s.hasOwnProperty(i)){if(null==(o=s[i]))continue;var a={};if(t.parseFontString(a,o)&&(o=a),o.hasOwnProperty(n))return o[n]}}if(this.fontOptions.hasOwnProperty(n))return this.fontOptions[n];throw new Error("Did not find value for multi-font for property: '"+n+"'")}},{key:"getFontOptions",value:function(t,e){for(var i={},n=["color","size","face","mod","vadjust"],o=0;o<n.length;++o){var r=n[o];i[r]=this.getFontOption(t,e,r)}return i}},{key:"propagateFonts",value:function(t){var e=this,i=[];this.addFontOptionsToPile(i,t),this.fontOptions=this.getBasicOptions(i);for(var n=function(t){var n=yp[t],o=e.fontOptions[n];Ms(e.getFontOptions(i,n),(function(t,e){o[e]=t})),o.size=Number(o.size),o.vadjust=Number(o.vadjust)},o=0;o<yp.length;++o)n(o)}},{key:"draw",value:function(t,e,i,n,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&s<this.elementOptions.scaling.label.drawThreshold-1||(s>=this.elementOptions.scaling.label.maxVisible&&(s=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(t,n,o,e,i,r),this._drawBackground(t),this._drawText(t,e,this.size.yLine,r,s))}}},{key:"_drawBackground",value:function(t){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){t.fillStyle=this.fontOptions.background;var e=this.getSize();t.fillRect(e.left,e.top,e.width,e.height)}}},{key:"_drawText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,r=this._setAlignment(t,e,i,n),s=Qu(r,2);e=s[0],i=s[1],t.textAlign="left",e-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(i-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(i+=(this.size.height-this.size.labelHeight)/2));for(var a=0;a<this.lineCount;a++){var h=this.lines[a];if(h&&h.blocks){var d=0;this.isEdgeLabel||"center"===this.fontOptions.align?d+=(this.size.width-h.width)/2:"right"===this.fontOptions.align&&(d+=this.size.width-h.width);for(var l=0;l<h.blocks.length;l++){var u=h.blocks[l];t.font=u.font;var c=this._getColor(u.color,o,u.strokeColor),f=Qu(c,2),p=f[0],v=f[1];u.strokeWidth>0&&(t.lineWidth=u.strokeWidth,t.strokeStyle=v,t.lineJoin="round"),t.fillStyle=p,u.strokeWidth>0&&t.strokeText(u.text,e+d,i+u.vadjust),t.fillText(u.text,e+d,i+u.vadjust),d+=u.width}i+=h.height}}}},{key:"_setAlignment",value:function(t,e,i,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){e=0,i=0;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=4):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=4):t.textBaseline="middle"}else t.textBaseline=n;return[e,i]}},{key:"_getColor",value:function(t,e,i){var n=t||"#000000",o=i||"#ffffff";if(e<=this.elementOptions.scaling.label.drawThreshold){var r=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-e)));n=js(n,r),o=js(o,r)}return[n,o]}},{key:"getTextSize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(t,e,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var t=this.size.left,e=this.size.top-1;if(this.isEdgeLabel){var i=.5*-this.size.width;switch(this.fontOptions.align){case"middle":t=i,e=.5*-this.size.height;break;case"top":t=i,e=-(this.size.height+2);break;case"bottom":t=i,e=2}}return{left:t,top:e,width:this.size.width,height:this.size.height}}},{key:"calculateLabelSize",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(t,e,i),this.size.left=n-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===r&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(t,e,i,n){var o=function(t,e,i){return"normal"===e?"mod"===i?"":t[i]:void 0!==t[e][i]?t[e][i]:t[i]},r={color:o(this.fontOptions,n,"color"),size:o(this.fontOptions,n,"size"),face:o(this.fontOptions,n,"face"),mod:o(this.fontOptions,n,"mod"),vadjust:o(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(e||i)&&("normal"===n&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?r.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(r,this.elementOptions.id,e,i));var s="";return void 0!==r.mod&&""!==r.mod&&(s+=r.mod+" "),s+=r.size+"px "+r.face,t.font=s.replace(/"/g,""),r.font=t.font,r.height=r.size,r}},{key:"differentState",value:function(t,e){return t!==this.selectedState||e!==this.hoverState}},{key:"_processLabelText",value:function(t,e,i,n){return new gp(t,this,e,i).process(n)}},{key:"_processLabel",value:function(t,e,i){if(!1!==this.labelDirty||this.differentState(e,i)){var n=this._processLabelText(t,e,i,this.elementOptions.label);this.fontOptions.minWdt>0&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,this.fontOptions.minHgt>0&&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=e,this.hoverState=i,this.labelDirty=!1}}},{key:"visible",value:function(){return 0!==this.size.width&&0!==this.size.height&&void 0!==this.elementOptions.label&&!(this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(t,e){if(!e||"string"!=typeof e)return!1;var i=e.split(" ");return t.size=+i[0].replace("px",""),t.face=i[1],t.color=i[2],!0}}]),t}();Ct({target:"Array",proto:!0},{fill:ce}),Ma("fill");var bp=function(){function t(e,i,n){Bu(this,t),this.body=i,this.labelModule=n,this.setOptions(e),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 Wu(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"_setMargins",value:function(t){this.margin={},this.options.margin&&("object"==Lu(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)),t.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(t,e){var i=this.options.borderWidth;return this.resize(t),Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}},{key:"enableShadow",value:function(t,e){e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(t,e){if(!1!==e.borderDashes)if(void 0!==t.setLineDash){var i=e.borderDashes;!0===i&&(i=[5,15]),t.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1}},{key:"disableBorderDashes",value:function(t,e){!1!==e.borderDashes&&(void 0!==t.setLineDash?t.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1))}},{key:"needsRefresh",value:function(t,e){return!0===this.refreshNeeded?(this.refreshNeeded=!1,!0):void 0===this.width||this.labelModule.differentState(t,e)}},{key:"initContextForDraw",value:function(t,e){var i=e.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,i),t.strokeStyle=e.borderColor,t.fillStyle=e.color}},{key:"performStroke",value:function(t,e){var i=e.borderWidth/this.body.view.scale;t.save(),i>0&&(this.enableBorderDashes(t,e),t.stroke(),this.disableBorderDashes(t,e)),t.restore()}},{key:"performFill",value:function(t,e){this.enableShadow(t,e),t.fill(),this.disableShadow(t,e),this.performStroke(t,e)}},{key:"_addBoundingBoxMargin",value:function(t){this.boundingBox.left-=t,this.boundingBox.top-=t,this.boundingBox.bottom+=t,this.boundingBox.right+=t}},{key:"_updateBoundingBox",value:function(t,e,i,n,o){void 0!==i&&this.resize(i,n,o),this.left=t-this.width/2,this.top=e-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(t,e,i,n,o){this._updateBoundingBox(t,e,i,n,o)}},{key:"getDimensionsFromLabel",value:function(t,e,i){this.textSize=this.labelModule.getTextSize(t,e,i);var n=this.textSize.width,o=this.textSize.height;return 0===n&&(n=14,o=14),{width:n,height:o}}}]),t}(),_p=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n)))._setMargins(n),o}return qu(e,bp),Wu(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i);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(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this.initContextForDraw(t,r),t.roundRect(this.left,this.top,this.width,this.height,r.borderRadius),this.performFill(t,r),this.updateBoundingBox(e,i,t,n,o),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}},{key:"updateBoundingBox",value:function(t,e,i,n,o){this._updateBoundingBox(t,e,i,n,o);var r=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(r)}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}}]),e}(),wp=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n))).labelOffset=0,o.selected=!1,o}return qu(e,bp),Wu(e,[{key:"setOptions",value:function(t,e,i){this.options=t,void 0===e&&void 0===i||this.setImages(e,i)}},{key:"setImages",value:function(t,e){e&&this.selected?(this.imageObj=e,this.imageObjAlt=t):(this.imageObj=t,this.imageObjAlt=e)}},{key:"switchImages",value:function(t){var e=t&&!this.selected||!t&&this.selected;if(this.selected=t,void 0!==this.imageObjAlt&&e){var i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}},{key:"_getImagePadding",value:function(){var t={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var e=this.options.imagePadding;"object"==Lu(e)?(t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left):(t.top=e,t.right=e,t.bottom=e,t.left=e)}return t}},{key:"_resizeImage",value:function(){var t,e;if(!1===this.options.shapeProperties.useImageSize){var i=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),t=2*this.options.size*i,e=2*this.options.size*n}else{var o=this._getImagePadding();t=this.imageObj.width+o.left+o.right,e=this.imageObj.height+o.top+o.bottom}this.width=t,this.height=e,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(t,e,i,n){this.initContextForDraw(t,n),t.circle(e,i,n.size),this.performFill(t,n)}},{key:"_drawImageAtPosition",value:function(t,e){if(0!=this.imageObj.width){t.globalAlpha=1,this.enableShadow(t,e);var i=1;!0===this.options.shapeProperties.interpolation&&(i=this.imageObj.width/this.width/this.body.view.scale);var n=this._getImagePadding(),o=this.left+n.left,r=this.top+n.top,s=this.width-n.left-n.right,a=this.height-n.top-n.bottom;this.imageObj.drawImageAtPosition(t,i,o,r,s,a),this.disableShadow(t,e)}}},{key:"_drawImageLabel",value:function(t,e,i,n,o){var r,s=0;if(void 0!==this.height){s=.5*this.height;var a=this.labelModule.getTextSize(t,n,o);a.lineCount>=1&&(s+=a.height/2)}r=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(t,e,r,n,o,"hanging")}}]),e}(),kp=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n)))._setMargins(n),o}return qu(e,wp),Wu(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i),o=Math.max(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,r),this.updateBoundingBox(e,i),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,i,n,o)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),.5*this.width}}]),e}(),xp=function(t){function e(t,i,n,o,r){var s;return Bu(this,e),(s=$u(this,Zu(e).call(this,t,i,n))).setImages(o,r),s}return qu(e,wp),Wu(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,n=void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height;if(n){var o=2*this.options.size;return this.width=o,this.height=o,void(this.radius=.5*this.width)}this.needsRefresh(e,i)&&this._resizeImage()}},{key:"draw",value:function(t,e,i,n,o,r){this.switchImages(n),this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,r),t.save(),t.clip(),this._drawImageAtPosition(t,r),t.restore(),this._drawImageLabel(t,e,i,n,o),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size,this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),.5*this.width}}]),e}(),Sp=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n)))._setMargins(n),o}return qu(e,bp),Wu(e,[{key:"resize",value:function(t,e,i){if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i).width+this.margin.right+this.margin.left;this.width=n,this.height=n,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this.initContextForDraw(t,r),t.database(e-this.width/2,i-this.height/2,this.width,this.height),this.performFill(t,r),this.updateBoundingBox(e,i,t,n,o),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Op=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,bp),Wu(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(e,i)){this.labelModule.getTextSize(t,e,i);var o=2*n.size;this.width=o,this.height=o,this.radius=.5*this.width}}},{key:"_drawShape",value:function(t,e,i,n,o,r,s,a){if(this.resize(t,r,s,a),this.left=n-this.width/2,this.top=o-this.height/2,this.initContextForDraw(t,a),t[e](n,o,a.size),this.performFill(t,a),void 0!==this.options.icon&&void 0!==this.options.icon.code&&(t.font=(r?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",t.fillText(this.options.icon.code,n,o)),void 0!==this.options.label){this.labelModule.calculateLabelSize(t,r,s,n,o,"hanging");var h=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(t,n,h,r,s,"hanging")}this.updateBoundingBox(n,o)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),e}(),Dp=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"diamond",4,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Mp=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"circle",2,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),this.options.size}}]),e}(),Ep=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,bp),Wu(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var n=this.getDimensionsFromLabel(t,e,i);this.height=2*n.height,this.width=n.width+n.height,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-.5*this.width,this.top=i-.5*this.height,this.initContextForDraw(t,r),t.ellipse_vis(this.left,this.top,this.width,this.height),this.performFill(t,r),this.updateBoundingBox(e,i,t,n,o),this.labelModule.draw(t,e,i,n,o)}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=.5*this.width,n=.5*this.height,o=Math.sin(e)*i,r=Math.cos(e)*n;return i*n/Math.sqrt(o*o+r*r)}}]),e}(),Tp=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n)))._setMargins(n),o}return qu(e,bp),Wu(e,[{key:"resize",value:function(t,e,i){this.needsRefresh(e,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(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(t,e,i,n,o,r){if(this.resize(t,n,o),this.options.icon.size=this.options.icon.size||50,this.left=e-this.width/2,this.top=i-this.height/2,this._icon(t,e,i,n,o,r),void 0!==this.options.label){this.labelModule.draw(t,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,n)}this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){if(this.boundingBox.top=e-.5*this.options.icon.size,this.boundingBox.left=t-.5*this.options.icon.size,this.boundingBox.right=t+.5*this.options.icon.size,this.boundingBox.bottom=e+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(t,e,i,n,o,r){var s=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=[null!=this.options.icon.weight?this.options.icon.weight:n?"bold":"",(null!=this.options.icon.weight&&n?5:0)+s+"px",this.options.icon.face].join(" "),t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t,r),t.fillText(this.options.icon.code,e,i),this.disableShadow(t,r)):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.")}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Cp=function(t){function e(t,i,n,o,r){var s;return Bu(this,e),(s=$u(this,Zu(e).call(this,t,i,n))).setImages(o,r),s}return qu(e,wp),Wu(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,n=void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height;if(n){var o=2*this.options.size;return this.width=o,void(this.height=o)}this.needsRefresh(e,i)&&this._resizeImage()}},{key:"draw",value:function(t,e,i,n,o,r){if(this.switchImages(n),this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,!0===this.options.shapeProperties.useBorderWithImage){var s=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(n?a:s)/this.body.view.scale;t.lineWidth=Math.min(this.width,h),t.beginPath(),t.strokeStyle=n?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,t.fillStyle=n?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background,t.rect(this.left-.5*t.lineWidth,this.top-.5*t.lineWidth,this.width+t.lineWidth,this.height+t.lineWidth),t.fill(),this.performStroke(t,r),t.closePath()}this._drawImageAtPosition(t,r),this._drawImageLabel(t,e,i,n,o),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.resize(),this._updateBoundingBox(t,e),void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Pp=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"square",2,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Ip=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"hexagon",4,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Np=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"star",4,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Fp=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n)))._setMargins(n),o}return qu(e,bp),Wu(e,[{key:"resize",value:function(t,e,i){this.needsRefresh(e,i)&&(this.textSize=this.labelModule.getTextSize(t,e,i),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(t,e,i,n,o,r){this.resize(t,n,o),this.left=e-this.width/2,this.top=i-this.height/2,this.enableShadow(t,r),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o),this.disableShadow(t,r),this.updateBoundingBox(e,i,t,n,o)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Ap=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"triangle",3,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Rp=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Op),Wu(e,[{key:"draw",value:function(t,e,i,n,o,r){this._drawShape(t,"triangleDown",3,e,i,n,o,r)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(),Yp=Date.prototype,jp=Yp.toString,zp=Yp.getTime;new Date(NaN)+""!="Invalid Date"&&tt(Yp,"toString",(function(){var t=zp.call(this);return t==t?jp.call(this):"Invalid Date"}));var Lp=h((function(){ma(1)}));Ct({target:"Object",stat:!0,forced:Lp},{keys:function(t){return ma(jt(t))}});var Bp,Hp=!1,Wp="background: #FFeeee; color: #dd0000",Vp=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"validate",value:function(e,i,n){Hp=!1,Bp=i;var o=i;return void 0!==n&&(o=i[n]),t.parse(e,o,[]),Hp}},{key:"parse",value:function(e,i,n){for(var o in e)e.hasOwnProperty(o)&&t.check(o,e,i,n)}},{key:"check",value:function(e,i,n,o){if(void 0!==n[e]||void 0!==n.__any__){var r=e,s=!0;void 0===n[e]&&void 0!==n.__any__&&(r="__any__",s="object"===t.getType(i[e]));var a=n[r];s&&void 0!==a.__type__&&(a=a.__type__),t.checkFields(e,i,n,r,a,o)}else t.getSuggestion(e,n,o)}},{key:"checkFields",value:function(e,i,n,o,r,s){var a=function(i){console.log("%c"+i+t.printLocation(s,e),Wp)},h=t.getType(i[e]),d=r[h];void 0!==d?"array"===t.getType(d)&&-1===d.indexOf(i[e])?(a('Invalid option detected in "'+e+'". Allowed values are:'+t.print(d)+' not "'+i[e]+'". '),Hp=!0):"object"===h&&"__any__"!==o&&(s=_s(s,e),t.parse(i[e],n[o],s)):void 0===r.any&&(a('Invalid type received for "'+e+'". Expected: '+t.print(Object.keys(r))+". Received ["+h+'] "'+i[e]+'"'),Hp=!0)}},{key:"getType",value:function(t){var e=Lu(t);return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}},{key:"getSuggestion",value:function(e,i,n){var o,r=t.findInOptions(e,i,n,!1),s=t.findInOptions(e,Bp,[],!0);o=void 0!==r.indexMatch?" in "+t.printLocation(r.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+r.indexMatch+'"?\n\n':s.distance<=4&&r.distance>s.distance?" in "+t.printLocation(r.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""):r.distance<=8?'. Did you mean "'+r.closestMatch+'"?'+t.printLocation(r.path,e):". Did you mean one of these: "+t.print(Object.keys(i))+t.printLocation(n,e),console.log('%cUnknown option detected: "'+e+'"'+o,Wp),Hp=!0}},{key:"findInOptions",value:function(e,i,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=1e9,s="",a=[],h=e.toLowerCase(),d=void 0;for(var l in i){var u=void 0;if(void 0!==i[l].__type__&&!0===o){var c=t.findInOptions(e,i[l],_s(n,l));r>c.distance&&(s=c.closestMatch,a=c.path,r=c.distance,d=c.indexMatch)}else-1!==l.toLowerCase().indexOf(h)&&(d=l),r>(u=t.levenshteinDistance(e,l))&&(s=l,a=ws(n),r=u)}return{closestMatch:s,path:a,distance:r,indexMatch:d}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",n="\n\n"+i+"options = {\n",o=0;o<t.length;o++){for(var r=0;r<o+1;r++)n+=" ";n+=t[o]+": {\n"}for(var s=0;s<t.length+1;s++)n+=" ";n+=e+"\n";for(var a=0;a<t.length+1;a++){for(var h=0;h<t.length-a;h++)n+=" ";n+="}\n"}return n+"\n\n"}},{key:"print",value:function(t){return JSON.stringify(t).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}},{key:"levenshteinDistance",value:function(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var i,n,o=[];for(i=0;i<=e.length;i++)o[i]=[i];for(n=0;n<=t.length;n++)o[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)==t.charAt(n-1)?o[i][n]=o[i-1][n-1]:o[i][n]=Math.min(o[i-1][n-1]+1,Math.min(o[i][n-1]+1,o[i-1][n]+1));return o[e.length][t.length]}}]),t}(),Up=function(){function t(e,i,n,o,r,s){Bu(this,t),this.options=Js(r),this.globalOptions=r,this.defaultOptions=s,this.body=i,this.edges=[],this.id=void 0,this.imagelist=n,this.grouplist=o,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 mp(this.body,this.options,!1),this.setOptions(e)}return Wu(t,[{key:"attachEdge",value:function(t){-1===this.edges.indexOf(t)&&this.edges.push(t)}},{key:"detachEdge",value:function(t){var e=this.edges.indexOf(t);-1!=e&&this.edges.splice(e,1)}},{key:"setOptions",value:function(e){var i=this.options.shape;if(e){if(void 0!==e.color&&(this._localColor=e.color),void 0!==e.id&&(this.id=e.id),void 0===this.id)throw new Error("Node must have an id");t.checkMass(e,this.id),void 0!==e.x&&(null===e.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(e.x),this.predefinedPosition=!0)),void 0!==e.y&&(null===e.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(e.y),this.predefinedPosition=!0)),void 0!==e.size&&(this.baseSize=e.size),void 0!==e.value&&(e.value=parseFloat(e.value)),t.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);var n=[e,this.options,this.defaultOptions];return this.chooser=bf.choosify("node",n),this._load_images(),this.updateLabelModule(e),this.updateShape(i),void 0!==e.hidden||void 0!==e.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),void 0!==this.options.image.selected?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}},{key:"getFormattingValues",value:function(){var t={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?(t.borderWidth*=2,t.color=this.options.color.highlight.background,t.borderColor=this.options.color.highlight.border,t.shadow=this.options.shadow.enabled):this.hover&&(t.color=this.options.color.hover.background,t.borderColor=this.options.color.hover.border,t.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(t,this.options.id,this.selected,this.hover),!1===t.shadow&&(t.shadowColor===this.options.shadow.color&&t.shadowSize===this.options.shadow.size&&t.shadowX===this.options.shadow.x&&t.shadowY===this.options.shadow.y||(t.shadow=!0))):t.shadow=this.options.shadow.enabled,t}},{key:"updateLabelModule",value:function(e){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),t.updateGroupOptions(this.options,Gu({},e,{color:e&&e.color||this._localColor||void 0}),this.grouplist);var i=this.grouplist.get(this.options.group,!1),n=[e,this.options,i,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,n),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(t){if(t===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new _p(this.options,this.body,this.labelModule);break;case"circle":this.shape=new kp(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new xp(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"database":this.shape=new Sp(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Dp(this.options,this.body,this.labelModule);break;case"dot":this.shape=new Mp(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new Ep(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Tp(this.options,this.body,this.labelModule);break;case"image":this.shape=new Cp(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Pp(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new Ip(this.options,this.body,this.labelModule);break;case"star":this.shape=new Np(this.options,this.body,this.labelModule);break;case"text":this.shape=new Fp(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Ap(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Rp(this.options,this.body,this.labelModule);break;default:this.shape=new Ep(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(t,e){return this.shape.distanceToBorder(t,e)}},{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(t,e,i){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(t,e,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var r=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*r}this.options.size=this.options.scaling.min+n*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(t){var e=this.getFormattingValues();this.shape.draw(t,this.x,this.y,this.selected,this.hover,e)}},{key:"updateBoundingBox",value:function(t){this.shape.updateBoundingBox(this.x,this.y,t)}},{key:"resize",value:function(t){var e=this.getFormattingValues();this.shape.resize(t,this.selected,this.hover,e)}},{key:"getItemsOnPoint",value:function(t){var e=[];return this.labelModule.visible()&&bf.pointInRect(this.labelModule.getSize(),t)&&e.push({nodeId:this.id,labelId:0}),bf.pointInRect(this.shape.boundingBox,t)&&e.push({nodeId:this.id}),e}},{key:"isOverlappingWith",value:function(t){return this.shape.left<t.right&&this.shape.left+this.shape.width>t.left&&this.shape.top<t.bottom&&this.shape.top+this.shape.height>t.top}},{key:"isBoundingBoxOverlappingWith",value:function(t){return this.shape.boundingBox.left<t.right&&this.shape.boundingBox.right>t.left&&this.shape.boundingBox.top<t.bottom&&this.shape.boundingBox.bottom>t.top}}],[{key:"updateGroupOptions",value:function(t,e,i){if(void 0!==i){var n=t.group;if(void 0!==e&&void 0!==e.group&&n!==e.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof n||"string"==typeof n&&""!=n){var o=i.get(n),r=["font"];void 0!==e&&void 0!==e.color&&null!=e.color&&r.push("color"),vs(r,t,o),t.color=Ls(t.color)}}}},{key:"parseOptions",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0,s=["color","fixed","shadow"];if(vs(s,e,i,n),t.checkMass(i),ta(e,i,"shadow",o),void 0!==i.color&&null!==i.color){var a=Ls(i.color);us(e.color,a)}else!0===n&&null===i.color&&(e.color=Js(o.color));void 0!==i.fixed&&null!==i.fixed&&("boolean"==typeof i.fixed?(e.fixed.x=i.fixed,e.fixed.y=i.fixed):(void 0!==i.fixed.x&&"boolean"==typeof i.fixed.x&&(e.fixed.x=i.fixed.x),void 0!==i.fixed.y&&"boolean"==typeof i.fixed.y&&(e.fixed.y=i.fixed.y))),!0===n&&null===i.font&&(e.font=Js(o.font)),t.updateGroupOptions(e,i,r),void 0!==i.scaling&&ta(e.scaling,i.scaling,"label",o.scaling)}},{key:"checkMass",value:function(t,e){if(void 0!==t.mass&&t.mass<=0){var i="";void 0!==e&&(i=" in node id: "+e),console.log("%cNegative or zero mass disallowed"+i+", setting mass to 1.",Wp),t.mass=1}}}]),t}(),Gp=function(){function t(e,i,n,o){var r=this;if(Bu(this,t),this.body=e,this.images=i,this.groups=n,this.layoutEngine=o,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(t,e){r.add(e.items)},update:function(t,e){r.update(e.items,e.data,e.oldData)},remove:function(t,e){r.remove(e.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(t,e,i,n){if(e===t)return.5;var o=1/(e-t);return Math.max(0,(n-t)*o)}},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},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Js(this.defaultOptions),this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=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(){Ms(t.nodesListeners,(function(e,i){t.body.data.nodes&&t.body.data.nodes.off(i,e)})),delete t.body.functions.createNode,delete t.nodesListeners.add,delete t.nodesListeners.update,delete t.nodesListeners.remove,delete t.nodesListeners}))}},{key:"setOptions",value:function(t){if(void 0!==t){if(Up.parseOptions(this.options,t),void 0!==t.shape)for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&this.body.nodes[e].updateShape();if(void 0!==t.font)for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i].needsRefresh());if(void 0!==t.size)for(var n in this.body.nodes)this.body.nodes.hasOwnProperty(n)&&this.body.nodes[n].needsRefresh();void 0===t.hidden&&void 0===t.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.data.nodes;if(t instanceof Qc||t instanceof tf)this.body.data.nodes=t;else if(Array.isArray(t))this.body.data.nodes=new Qc,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new Qc}if(i&&Ms(this.nodesListeners,(function(t,e){i.off(e,t)})),this.body.nodes={},this.body.data.nodes){var n=this;Ms(this.nodesListeners,(function(t,e){n.body.data.nodes.on(e,t)}));var o=this.body.data.nodes.getIds();this.add(o,!0)}!1===e&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=0;o<t.length;o++){e=t[o];var r=this.body.data.nodes.get(e),s=this.create(r);n.push(s),this.body.nodes[e]=s}this.layoutEngine.positionInitially(n),!1===i&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(t,e,i){for(var n=this.body.nodes,o=!1,r=0;r<t.length;r++){var s=t[r],a=n[s],h=e[r];void 0!==a?a.setOptions(h)&&(o=!0):(o=!0,a=this.create(h),n[s]=a)}o||void 0===i||(o=e.some((function(t,e){var n=i[e];return n&&n.level!==t.level}))),!0===o?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(t){for(var e=this.body.nodes,i=0;i<t.length;i++){delete e[t[i]]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Up;return new e(t,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Ms(this.body.nodes,(function(i,n){var o=t.body.data.nodes.get(n);void 0!==o&&(!0===e&&i.setOptions({x:null,y:null}),i.setOptions({fixed:!1}),i.setOptions(o))}))}},{key:"getPositions",value:function(t){var e={};if(void 0!==t){if(!0===Array.isArray(t)){for(var i=0;i<t.length;i++)if(void 0!==this.body.nodes[t[i]]){var n=this.body.nodes[t[i]];e[t[i]]={x:Math.round(n.x),y:Math.round(n.y)}}}else if(void 0!==this.body.nodes[t]){var o=this.body.nodes[t];e[t]={x:Math.round(o.x),y:Math.round(o.y)}}}else for(var r=0;r<this.body.nodeIndices.length;r++){var s=this.body.nodes[this.body.nodeIndices[r]];e[this.body.nodeIndices[r]]={x:Math.round(s.x),y:Math.round(s.y)}}return e}},{key:"storePositions",value:function(){var t=[],e=this.body.data.nodes.getDataSet();for(var i in e._data)if(e._data.hasOwnProperty(i)){var n=this.body.nodes[i];e._data[i].x==Math.round(n.x)&&e._data[i].y==Math.round(n.y)||t.push({id:n.id,x:Math.round(n.x),y:Math.round(n.y)})}e.update(t)}},{key:"getBoundingBox",value:function(t){if(void 0!==this.body.nodes[t])return this.body.nodes[t].shape.boundingBox}},{key:"getConnectedNodes",value:function(t,e){var i=[];if(void 0!==this.body.nodes[t])for(var n=this.body.nodes[t],o={},r=0;r<n.edges.length;r++){var s=n.edges[r];"to"!==e&&s.toId==n.id?void 0===o[s.fromId]&&(i.push(s.fromId),o[s.fromId]=!0):"from"!==e&&s.fromId==n.id&&void 0===o[s.toId]&&(i.push(s.toId),o[s.toId]=!0)}return i}},{key:"getConnectedEdges",value:function(t){var e=[];if(void 0!==this.body.nodes[t])for(var i=this.body.nodes[t],n=0;n<i.edges.length;n++)e.push(i.edges[n].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",t);return e}},{key:"moveNode",value:function(t,e,i){var n=this;void 0!==this.body.nodes[t]?(this.body.nodes[t].x=Number(e),this.body.nodes[t].y=Number(i),setTimeout((function(){n.body.emitter.emit("startSimulation")}),0)):console.log("Node id supplied to moveNode does not exist. Provided: ",t)}}]),t}(),qp=Math.hypot,Zp=Math.abs,Xp=Math.sqrt,$p=!!qp&&qp(1/0,NaN)!==1/0;Ct({target:"Math",stat:!0,forced:$p},{hypot:function(t,e){for(var i,n,o=0,r=0,s=arguments.length,a=0;r<s;)a<(i=Zp(arguments[r++]))?(o=o*(n=a/i)*n+1,a=i):o+=i>0?(n=i/a)*n:i;return a===1/0?1/0:a*Xp(o)}});var Kp=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"transform",value:function(t,e){Array.isArray(t)||(t=[t]);for(var i=e.point.x,n=e.point.y,o=e.angle,r=e.length,s=0;s<t.length;++s){var a=t[s],h=a.x*Math.cos(o)-a.y*Math.sin(o),d=a.x*Math.sin(o)+a.y*Math.cos(o);a.x=i+r*h,a.y=n+r*d}}},{key:"drawPath",value:function(t,e){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(var i=1;i<e.length;++i)t.lineTo(e[i].x,e[i].y);t.closePath()}}]),t}(),Jp=function(t){function e(){return Bu(this,e),$u(this,Zu(e).apply(this,arguments))}return qu(e,Kp),Wu(e,null,[{key:"draw",value:function(t,e){if(e.image){t.save(),t.translate(e.point.x,e.point.y),t.rotate(Math.PI/2+e.angle);var i=null!=e.imageWidth?e.imageWidth:e.image.width,n=null!=e.imageHeight?e.imageHeight:e.image.height;e.image.drawImageAtPosition(t,1,-i/2,0,i,n),t.restore()}return!1}}]),e}(),Qp=function(t){function e(){return Bu(this,e),$u(this,Zu(e).apply(this,arguments))}return qu(e,Kp),Wu(e,null,[{key:"draw",value:function(t,e){var i=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),e}(),tv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),ev=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i={x:-.4,y:0};Kp.transform(i,e),t.strokeStyle=t.fillStyle,t.fillStyle="rgba(0, 0, 0, 0)";var n=Math.PI,o=e.angle-n/2,r=e.angle+n/2;return t.beginPath(),t.arc(i.x,i.y,.4*e.length,o,r,!1),t.stroke(),!0}}]),t}(),iv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i={x:-.3,y:0};Kp.transform(i,e),t.strokeStyle=t.fillStyle,t.fillStyle="rgba(0, 0, 0, 0)";var n=Math.PI,o=e.angle+n/2,r=e.angle+3*n/2;return t.beginPath(),t.arc(i.x,i.y,.4*e.length,o,r,!1),t.stroke(),!0}}]),t}(),nv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),ov=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),rv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i={x:-.4,y:0};return Kp.transform(i,e),t.circle(i.x,i.y,.4*e.length),!0}}]),t}(),sv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),av=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),hv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),dv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return Kp.transform(i,e),Kp.drawPath(t,i),!0}}]),t}(),lv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"draw",value:function(t,e){var i;switch(e.type&&(i=e.type.toLowerCase()),i){case"image":return Jp.draw(t,e);case"circle":return rv.draw(t,e);case"box":return av.draw(t,e);case"crow":return tv.draw(t,e);case"curve":return ev.draw(t,e);case"diamond":return hv.draw(t,e);case"inv_curve":return iv.draw(t,e);case"triangle":return nv.draw(t,e);case"inv_triangle":return ov.draw(t,e);case"bar":return sv.draw(t,e);case"vee":return dv.draw(t,e);case"arrow":default:return Qp.draw(t,e)}}}]),t}(),uv=function(){function t(e,i,n){Bu(this,t),this._body=i,this._labelModule=n,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}return Wu(t,[{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(t){this.options=t,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(t,e,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();t.strokeStyle=this.getColor(t,e),t.lineWidth=e.width,!1!==e.dashes?this._drawDashedLine(t,e,o):this._drawLine(t,e,o)}},{key:"_drawLine",value:function(t,e,i,n,o){if(this.from!=this.to)this._line(t,e,i,n,o);else{var r=Qu(this._getCircleData(t),3),s=r[0],a=r[1],h=r[2];this._circle(t,e,s,a,h)}}},{key:"_drawDashedLine",value:function(t,e,i,n,o){t.lineCap="round";var r=Array.isArray(e.dashes)?e.dashes:[5,5];if(void 0!==t.setLineDash){if(t.save(),t.setLineDash(r),t.lineDashOffset=0,this.from!=this.to)this._line(t,e,i);else{var s=Qu(this._getCircleData(t),3),a=s[0],h=s[1],d=s[2];this._circle(t,e,a,h,d)}t.setLineDash([0]),t.lineDashOffset=0,t.restore()}else{if(this.from!=this.to)t.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,r);else{var l=Qu(this._getCircleData(t),3),u=l[0],c=l[1],f=l[2];this._circle(t,e,u,c,f)}this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}}},{key:"findBorderPosition",value:function(t,e,i){return this.from!=this.to?this._findBorderPosition(t,e,i):this._findBorderPositionCircle(t,e,i)}},{key:"findBorderPositions",value:function(t){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,t),to:this._findBorderPosition(this.to,t)};var e=Qu(this._getCircleData(t).slice(0,2),2),i=e[0],n=e[1];return{from:this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,t,{x:i,y:n,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(t){var e,i,n=this.from,o=this.options.selfReferenceSize;return void 0!==t&&void 0===n.shape.width&&n.shape.resize(t),n.shape.width>n.shape.height?(e=n.x+.5*n.shape.width,i=n.y-o):(e=n.x+o,i=n.y-.5*n.shape.height),[e,i,o]}},{key:"_pointOnCircle",value:function(t,e,i,n){var o=2*n*Math.PI;return{x:t+i*Math.cos(o),y:e-i*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){var n,o=i.x,r=i.y,s=i.low,a=i.high,h=i.direction,d=this.options.selfReferenceSize,l=.5*(s+a),u=0;do{l=.5*(s+a),n=this._pointOnCircle(o,r,d,l);var c=Math.atan2(t.y-n.y,t.x-n.x),f=t.distanceToBorder(e,c)-Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));if(Math.abs(f)<.05)break;f>0?h>0?s=l:a=l:h>0?a=l:s=l,++u}while(s<=a&&u<10);return Gu({},n,{t:l})}},{key:"getLineWidth",value:function(t,e){return!0===t?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===e?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(t,e){if(!1!==e.inheritsColor){if("both"===e.inheritsColor&&this.from.id!==this.to.id){var i=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),n=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(n=js(this.from.options.color.border,e.opacity),o=js(this.to.options.color.border,e.opacity)):!0===this.from.selected&&!1===this.to.selected?o=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(n=this.from.options.color.border),i.addColorStop(0,n),i.addColorStop(1,o),i}return"to"===e.inheritsColor?js(this.to.options.color.border,e.opacity):js(this.from.options.color.border,e.opacity)}return js(e.color,e.opacity)}},{key:"_circle",value:function(t,e,i,n,o){this.enableShadow(t,e),t.beginPath(),t.arc(i,n,o,0,2*Math.PI,!1),t.stroke(),this.disableShadow(t,e)}},{key:"getDistanceToEdge",value:function(t,e,i,n,o,r){if(this.from!=this.to)return this._getDistanceToEdge(t,e,i,n,o,r);var s=Qu(this._getCircleData(void 0),3),a=s[0],h=s[1],d=s[2],l=a-o,u=h-r;return Math.abs(Math.sqrt(l*l+u*u)-d)}},{key:"_getDistanceToLine",value:function(t,e,i,n,o,r){var s=i-t,a=n-e,h=((o-t)*s+(r-e)*a)/(s*s+a*a);h>1?h=1:h<0&&(h=0);var d=t+h*s-o,l=e+h*a-r;return Math.sqrt(d*d+l*l)}},{key:"getArrowData",value:function(t,e,i,n,o,r){var s,a,h,d,l,u,c,f=r.width;"from"===e?(h=this.from,d=this.to,l=r.fromArrowScale<0,u=Math.abs(r.fromArrowScale),c=r.fromArrowType):"to"===e?(h=this.to,d=this.from,l=r.toArrowScale<0,u=Math.abs(r.toArrowScale),c=r.toArrowType):(h=this.to,d=this.from,l=r.middleArrowScale<0,u=Math.abs(r.middleArrowScale),c=r.middleArrowType);var p=15*u+3*f;if(h!=d){var v=p/Math.hypot(h.x-d.x,h.y-d.y);if("middle"!==e)if(!0===this.options.smooth.enabled){var g=this._findBorderPosition(h,t,{via:i}),y=this.getPoint(g.t+v*("from"===e?1:-1),i);s=Math.atan2(g.y-y.y,g.x-y.x),a=g}else s=Math.atan2(h.y-d.y,h.x-d.x),a=this._findBorderPosition(h,t);else{var m=(l?-v:v)/2,b=this.getPoint(.5+m,i),_=this.getPoint(.5-m,i);s=Math.atan2(b.y-_.y,b.x-_.x),a=this.getPoint(.5,i)}}else{var w=Qu(this._getCircleData(t),3),k=w[0],x=w[1],S=w[2];if("from"===e){var O=this._findBorderPositionCircle(this.from,t,{x:k,y:x,low:.25,high:.6,direction:-1});s=-2*O.t*Math.PI+1.5*Math.PI+.1*Math.PI,a=O}else if("to"===e){var D=this._findBorderPositionCircle(this.from,t,{x:k,y:x,low:.6,high:1,direction:1});s=-2*D.t*Math.PI+1.5*Math.PI-1.1*Math.PI,a=D}else a=this._pointOnCircle(k,x,S,.175),s=3.9269908169872414}return{point:a,core:{x:a.x-.9*p*Math.cos(s),y:a.y-.9*p*Math.sin(s)},angle:s,length:p,type:c}}},{key:"drawArrowHead",value:function(t,e,i,n,o){t.strokeStyle=this.getColor(t,e),t.fillStyle=t.strokeStyle,t.lineWidth=e.width,lv.draw(t,o)&&(this.enableShadow(t,e),t.fill(),this.disableShadow(t,e))}},{key:"enableShadow",value:function(t,e){!0===e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){!0===e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},{key:"drawBackground",value:function(t,e){if(!1!==e.background){var i={strokeStyle:t.strokeStyle,lineWidth:t.lineWidth,dashes:t.dashes};t.strokeStyle=e.backgroundColor,t.lineWidth=e.backgroundSize,this.setStrokeDashed(t,e.backgroundDashes),t.stroke(),t.strokeStyle=i.strokeStyle,t.lineWidth=i.lineWidth,t.dashes=i.dashes,this.setStrokeDashed(t,e.dashes)}}},{key:"setStrokeDashed",value:function(t,e){if(!1!==e)if(void 0!==t.setLineDash){var i=Array.isArray(e)?e:[5,5];t.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==t.setLineDash?t.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),t}(),cv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,uv),Wu(e,[{key:"_findBorderPositionBezier",value:function(t,e){var i,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),r=10,s=.2,a=!1,h=1,d=0,l=this.to;t.id===this.from.id&&(l=this.from,a=!0);var u=0;do{n=.5*(d+h),i=this.getPoint(n,o);var c=Math.atan2(l.y-i.y,l.x-i.x),f=l.distanceToBorder(e,c),p=Math.sqrt(Math.pow(i.x-l.x,2)+Math.pow(i.y-l.y,2)),v=f-p;if(Math.abs(v)<s)break;v<0?!1===a?d=n:h=n:!1===a?h=n:d=n,++u}while(d<=h&&u<r);return Gu({},i,{t:n})}},{key:"_getDistanceToBezierEdge",value:function(t,e,i,n,o,r,s){var a,h,d,l,u,c=1e9,f=t,p=e;for(h=1;h<10;h++)d=.1*h,l=Math.pow(1-d,2)*t+2*d*(1-d)*s.x+Math.pow(d,2)*i,u=Math.pow(1-d,2)*e+2*d*(1-d)*s.y+Math.pow(d,2)*n,h>0&&(c=(a=this._getDistanceToLine(f,p,l,u,o,r))<c?a:c),f=l,p=u;return c}},{key:"_bezierCurve",value:function(t,e,i,n){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),null!=i&&null!=i.x?null!=n&&null!=n.x?t.bezierCurveTo(i.x,i.y,n.x,n.y,this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y):t.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(t,e),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),e}(),fv=function(t){function e(t,i,n){var o;return Bu(this,e),(o=$u(this,Zu(e).call(this,t,i,n))).via=o.via,o._boundFunction=function(){o.positionBezierNode()},o._body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return qu(e,cv),Wu(e,[{key:"setOptions",value:function(t){Ku(Zu(e.prototype),"setOptions",this).call(this,t);var i=!1;this.options.physics!==t.physics&&(i=!0),this.options=t,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===i&&(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 t="edgeId:"+this.id,e=this._body.functions.createNode({id:t,shape:"circle",physics:!0,hidden:!0});this._body.nodes[t]=e,this.via=e,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(t,e,i){this._bezierCurve(t,e,i)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){var i=this._getCircleData(),n=Qu(i,3),o=n[0],r=n[1],s=n[2],a=2*Math.PI*(1-t);return{x:o+s*Math.sin(a),y:r+s-s*(1-Math.cos(a))}}return{x:Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*e.x+Math.pow(t,2)*this.toPoint.x,y:Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*e.y+Math.pow(t,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){return this._getDistanceToBezierEdge(t,e,i,n,o,r,this.via)}}]),e}(),pv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,cv),Wu(e,[{key:"_line",value:function(t,e,i){this._bezierCurve(t,e,i)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var t,e,i=this.options.smooth.roundness,n=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),r=Math.abs(this.from.y-this.to.y);if("discrete"===n||"diagonalCross"===n){var s,a;s=a=o<=r?i*r:i*o,this.from.x>this.to.x&&(s=-s),this.from.y>=this.to.y&&(a=-a);var h=this.from.x+s,d=this.from.y+a;return"discrete"===n&&(o<=r?h=o<i*r?this.from.x:h:d=r<i*o?this.from.y:d),{x:h,y:d}}if("straightCross"===n){var l=(1-i)*o,u=(1-i)*r;return o<=r?(l=0,this.from.y<this.to.y&&(u=-u)):(this.from.x<this.to.x&&(l=-l),u=0),{x:this.to.x+l,y:this.to.y+u}}if("horizontal"===n){var c=(1-i)*o;return this.from.x<this.to.x&&(c=-c),{x:this.to.x+c,y:this.from.y}}if("vertical"===n){var f=(1-i)*r;return this.from.y<this.to.y&&(f=-f),{x:this.from.x,y:this.to.y+f}}if("curvedCW"===n){o=this.to.x-this.from.x,r=this.from.y-this.to.y;var p=Math.sqrt(o*o+r*r),v=Math.PI,g=(Math.atan2(r,o)+(.5*i+.5)*v)%(2*v);return{x:this.from.x+(.5*i+.5)*p*Math.sin(g),y:this.from.y+(.5*i+.5)*p*Math.cos(g)}}if("curvedCCW"===n){o=this.to.x-this.from.x,r=this.from.y-this.to.y;var y=Math.sqrt(o*o+r*r),m=Math.PI,b=(Math.atan2(r,o)+(.5*-i+.5)*m)%(2*m);return{x:this.from.x+(.5*i+.5)*y*Math.sin(b),y:this.from.y+(.5*i+.5)*y*Math.cos(b)}}t=e=o<=r?i*r:i*o,this.from.x>this.to.x&&(t=-t),this.from.y>=this.to.y&&(e=-e);var _=this.from.x+t,w=this.from.y+e;return o<=r?_=this.from.x<=this.to.x?this.to.x<_?this.to.x:_:this.to.x>_?this.to.x:_:w=this.from.y>=this.to.y?this.to.y>w?this.to.y:w:this.to.y<w?this.to.y:w,{x:_,y:w}}},{key:"_findBorderPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,n,o,r,s)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=t,n=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,o=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:n,y:o}}}]),e}(),vv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,cv),Wu(e,[{key:"_getDistanceToBezierEdge2",value:function(t,e,i,n,o,r,s,a){for(var h=1e9,d=t,l=e,u=[0,0,0,0],c=1;c<10;c++){var f=.1*c;u[0]=Math.pow(1-f,3),u[1]=3*f*Math.pow(1-f,2),u[2]=3*Math.pow(f,2)*(1-f),u[3]=Math.pow(f,3);var p=u[0]*t+u[1]*s.x+u[2]*a.x+u[3]*i,v=u[0]*e+u[1]*s.y+u[2]*a.y+u[3]*n;if(c>0){var g=this._getDistanceToLine(d,l,p,v,o,r);h=g<h?g:h}d=p,l=v}return h}}]),e}(),gv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,vv),Wu(e,[{key:"_line",value:function(t,e,i){var n=i[0],o=i[1];this._bezierCurve(t,e,n,o)}},{key:"_getViaCoordinates",value:function(){var t,e,i,n,o=this.from.x-this.to.x,r=this.from.y-this.to.y,s=this.options.smooth.roundness;return(Math.abs(o)>Math.abs(r)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(e=this.from.y,n=this.to.y,t=this.from.x-s*o,i=this.to.x+s*o):(e=this.from.y-s*r,n=this.to.y+s*r,t=this.from.x,i=this.to.x),[{x:t,y:e},{x:i,y:n}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),a=Qu(s,2),h=a[0],d=a[1];return this._getDistanceToBezierEdge2(t,e,i,n,o,r,h,d)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=Qu(e,2),n=i[0],o=i[1],r=t,s=[Math.pow(1-r,3),3*r*Math.pow(1-r,2),3*Math.pow(r,2)*(1-r),Math.pow(r,3)],a=s[0]*this.fromPoint.x+s[1]*n.x+s[2]*o.x+s[3]*this.toPoint.x,h=s[0]*this.fromPoint.y+s[1]*n.y+s[2]*o.y+s[3]*this.toPoint.y;return{x:a,y:h}}}]),e}(),yv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,uv),Wu(e,[{key:"_line",value:function(t,e){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),t.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(t){return{x:(1-t)*this.fromPoint.x+t*this.toPoint.x,y:(1-t)*this.fromPoint.y+t*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){var i=this.to,n=this.from;t.id===this.from.id&&(i=this.from,n=this.to);var o=Math.atan2(i.y-n.y,i.x-n.x),r=i.x-n.x,s=i.y-n.y,a=Math.sqrt(r*r+s*s),h=(a-t.distanceToBorder(e,o))/a;return{x:(1-h)*n.x+h*i.x,y:(1-h)*n.y+h*i.y,t:0}}},{key:"_getDistanceToEdge",value:function(t,e,i,n,o,r){return this._getDistanceToLine(t,e,i,n,o,r)}}]),e}(),mv=function(){function t(e,i,n,o,r){if(Bu(this,t),void 0===i)throw new Error("No body provided");this.options=Js(o),this.globalOptions=o,this.defaultOptions=r,this.body=i,this.imagelist=n,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 mp(this.body,this.options,!0),this.setOptions(e)}return Wu(t,[{key:"setOptions",value:function(e){if(e){var i=void 0!==e.physics&&this.options.physics!==e.physics||void 0!==e.hidden&&(this.options.hidden||!1)!==(e.hidden||!1)||void 0!==e.from&&this.options.from!==e.from||void 0!==e.to&&this.options.to!==e.to;t.parseOptions(this.options,e,!0,this.globalOptions),void 0!==e.id&&(this.id=e.id),void 0!==e.from&&(this.fromId=e.from),void 0!==e.to&&(this.toId=e.to),void 0!==e.title&&(this.title=e.title),void 0!==e.value&&(e.value=parseFloat(e.value));var n=[e,this.options,this.defaultOptions];return this.chooser=bf.choosify("edge",n),this.updateLabelModule(e),i=this.updateEdgeType()||i,this._setInteractionWidths(),this.connect(),i}}},{key:"getFormattingValues",value:function(){var t=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,e=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,i=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,n=this.options.color.inherit,o={toArrow:t,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:e,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,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)if(!0===this.chooser){if(this.selected){var r=this.options.selectionWidth;"function"==typeof r?o.width=r(o.width):"number"==typeof r&&(o.width+=r),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var s=this.options.hoverWidth;"function"==typeof s?o.width=s(o.width):"number"==typeof s&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(o,this.options.id,this.selected,this.hover),void 0!==o.color&&(o.inheritsColor=!1),!1===o.shadow&&(o.shadowColor===this.options.shadow.color&&o.shadowSize===this.options.shadow.size&&o.shadowX===this.options.shadow.x&&o.shadowY===this.options.shadow.y||(o.shadow=!0)));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(t){var e=[t,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,e),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var t=this.options.smooth,e=!1,i=!0;return void 0!==this.edgeType&&((this.edgeType instanceof fv&&!0===t.enabled&&"dynamic"===t.type||this.edgeType instanceof gv&&!0===t.enabled&&"cubicBezier"===t.type||this.edgeType instanceof pv&&!0===t.enabled&&"dynamic"!==t.type&&"cubicBezier"!==t.type||this.edgeType instanceof yv&&!1===t.type.enabled)&&(i=!1),!0===i&&(e=this.cleanup())),!0===i?!0===t.enabled?"dynamic"===t.type?(e=!0,this.edgeType=new fv(this.options,this.body,this.labelModule)):"cubicBezier"===t.type?this.edgeType=new gv(this.options,this.body,this.labelModule):this.edgeType=new pv(this.options,this.body,this.labelModule):this.edgeType=new yv(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),e}},{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(t,e,i){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(t,e,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var r=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*r}this.options.width=this.options.scaling.min+n*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(t){var e=this.getFormattingValues();if(!e.hidden){var i=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,e.fromArrow&&(n.from=this.edgeType.getArrowData(t,"from",i,this.selected,this.hover,e),!1===e.arrowStrikethrough&&(this.edgeType.fromPoint=n.from.core),e.fromArrowSrc&&(n.from.image=this.imagelist.load(e.fromArrowSrc)),e.fromArrowImageWidth&&(n.from.imageWidth=e.fromArrowImageWidth),e.fromArrowImageHeight&&(n.from.imageHeight=e.fromArrowImageHeight)),e.toArrow&&(n.to=this.edgeType.getArrowData(t,"to",i,this.selected,this.hover,e),!1===e.arrowStrikethrough&&(this.edgeType.toPoint=n.to.core),e.toArrowSrc&&(n.to.image=this.imagelist.load(e.toArrowSrc)),e.toArrowImageWidth&&(n.to.imageWidth=e.toArrowImageWidth),e.toArrowImageHeight&&(n.to.imageHeight=e.toArrowImageHeight)),e.middleArrow&&(n.middle=this.edgeType.getArrowData(t,"middle",i,this.selected,this.hover,e),e.middleArrowSrc&&(n.middle.image=this.imagelist.load(e.middleArrowSrc)),e.middleArrowImageWidth&&(n.middle.imageWidth=e.middleArrowImageWidth),e.middleArrowImageHeight&&(n.middle.imageHeight=e.middleArrowImageHeight)),this.edgeType.drawLine(t,e,this.selected,this.hover,i),this.drawArrows(t,n,e),this.drawLabel(t,i)}}},{key:"drawArrows",value:function(t,e,i){i.fromArrow&&this.edgeType.drawArrowHead(t,i,this.selected,this.hover,e.from),i.middleArrow&&this.edgeType.drawArrowHead(t,i,this.selected,this.hover,e.middle),i.toArrow&&this.edgeType.drawArrowHead(t,i,this.selected,this.hover,e.to)}},{key:"drawLabel",value:function(t,e){if(void 0!==this.options.label){var i=this.from,n=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(t,this.selected,this.hover),i.id!=n.id){this.labelModule.pointToSelf=!1;var o=this.edgeType.getPoint(.5,e);t.save();var r=this._getRotation(t);0!=r.angle&&(t.translate(r.x,r.y),t.rotate(r.angle)),this.labelModule.draw(t,o.x,o.y,this.selected,this.hover),t.restore()}else{var s,a;this.labelModule.pointToSelf=!0;var h=this.options.selfReferenceSize;i.shape.width>i.shape.height?(s=i.x+.5*i.shape.width,a=i.y-h):(s=i.x+h,a=i.y-.5*i.shape.height),o=this._pointOnCircle(s,a,h,.125),this.labelModule.draw(t,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(t){var e=[];if(this.labelModule.visible()){var i=this._getRotation();bf.pointInRect(this.labelModule.getSize(),t,i)&&e.push({edgeId:this.id,labelId:0})}var n={left:t.x,top:t.y};return this.isOverlappingWith(n)&&e.push({edgeId:this.id}),e}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=this.from.x,i=this.from.y,n=this.to.x,o=this.to.y,r=t.left,s=t.top;return this.edgeType.getDistanceToEdge(e,i,n,o,r,s)<10}return!1}},{key:"_getRotation",value:function(t){var e=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,e);void 0!==t&&this.labelModule.calculateLabelSize(t,this.selected,this.hover,i.x,i.y);var n={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return n;if("horizontal"===this.options.font.align)return n;var o=this.from.y-this.to.y,r=this.from.x-this.to.x,s=Math.atan2(o,r);return(s<-1&&r<0||s>0&&r<0)&&(s+=Math.PI),n.angle=s,n}},{key:"_pointOnCircle",value:function(t,e,i,n){var o=2*n*Math.PI;return{x:t+i*Math.cos(o),y:e-i*Math.sin(o)}}},{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(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=["arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width","font","chosen","widthConstraint"];if(ps(r,t,e,i),bf.isValidLabel(e.label)?t.label=e.label:bf.isValidLabel(t.label)||(t.label=void 0),ta(t,e,"smooth",n),ta(t,e,"shadow",n),ta(t,e,"background",n),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:!0===i&&null===e.dashes&&(t.dashes=Object.create(n.dashes)),void 0!==e.scaling&&null!==e.scaling?(void 0!==e.scaling.min&&(t.scaling.min=e.scaling.min),void 0!==e.scaling.max&&(t.scaling.max=e.scaling.max),ta(t.scaling,e.scaling,"label",n.scaling)):!0===i&&null===e.scaling&&(t.scaling=Object.create(n.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var s=e.arrows.toLowerCase();t.arrows.to.enabled=-1!=s.indexOf("to"),t.arrows.middle.enabled=-1!=s.indexOf("middle"),t.arrows.from.enabled=-1!=s.indexOf("from")}else{if("object"!==Lu(e.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(e.arrows));ta(t.arrows,e.arrows,"to",n.arrows),ta(t.arrows,e.arrows,"middle",n.arrows),ta(t.arrows,e.arrows,"from",n.arrows)}else!0===i&&null===e.arrows&&(t.arrows=Object.create(n.arrows));if(void 0!==e.color&&null!==e.color){var a=ss(e.color)?{color:e.color,highlight:e.color,hover:e.color,inherit:!1,opacity:1}:e.color,h=t.color;if(o)gs(h,n.color,!1,i);else for(var d in h)h.hasOwnProperty(d)&&delete h[d];if(ss(h))h.color=h,h.highlight=h,h.hover=h,h.inherit=!1,void 0===a.opacity&&(h.opacity=1);else{var l=!1;void 0!==a.color&&(h.color=a.color,l=!0),void 0!==a.highlight&&(h.highlight=a.highlight,l=!0),void 0!==a.hover&&(h.hover=a.hover,l=!0),void 0!==a.inherit&&(h.inherit=a.inherit),void 0!==a.opacity&&(h.opacity=Math.min(1,Math.max(0,a.opacity))),!0===l?h.inherit=!1:void 0===h.inherit&&(h.inherit="from")}}else!0===i&&null===e.color&&(t.color=Js(n.color));!0===i&&null===e.font&&(t.font=Js(n.font))}}]),t}(),bv=function(){function t(e,i,n){var o=this;Bu(this,t),this.body=e,this.images=i,this.groups=n,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(t,e){o.add(e.items)},update:function(t,e){o.update(e.items)},remove:function(t,e){o.remove(e.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(t,e,i,n){if(e===t)return.5;var o=1/(e-t);return Math.max(0,(n-t)*o)}},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},gs(this.options,this.defaultOptions),this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===e&&(e="continuous");var n=!1;for(var o in t.body.edges)if(t.body.edges.hasOwnProperty(o)){var r=t.body.edges[o],s=t.body.data.edges._data[o];if(void 0!==s){var a=s.smooth;void 0!==a&&!0===a.enabled&&"dynamic"===a.type&&(void 0===e?r.setOptions({smooth:!1}):r.setOptions({smooth:{type:e}}),n=!0)}}!0===i&&!0===n&&t.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(function(){t.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(){Ms(t.edgesListeners,(function(e,i){t.body.data.edges&&t.body.data.edges.off(i,e)})),delete t.body.functions.createEdge,delete t.edgesListeners.add,delete t.edgesListeners.update,delete t.edgesListeners.remove,delete t.edgesListeners}))}},{key:"setOptions",value:function(t){if(void 0!==t){mv.parseOptions(this.options,t,!0,this.defaultOptions,!0);var e=!1;if(void 0!==t.smooth)for(var i in this.body.edges)this.body.edges.hasOwnProperty(i)&&(e=this.body.edges[i].updateEdgeType()||e);if(void 0!==t.font)for(var n in this.body.edges)this.body.edges.hasOwnProperty(n)&&this.body.edges[n].updateLabelModule();void 0===t.hidden&&void 0===t.physics&&!0!==e||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.body.data.edges;if(t instanceof Qc||t instanceof tf)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new Qc,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new Qc}if(n&&Ms(this.edgesListeners,(function(t,e){n.off(e,t)})),this.body.edges={},this.body.data.edges){Ms(this.edgesListeners,(function(t,i){e.body.data.edges.on(i,t)}));var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===i&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,n=this.body.data.edges,o=0;o<t.length;o++){var r=t[o],s=i[r];s&&s.disconnect();var a=n.get(r,{showInternalIds:!0});i[r]=this.create(a)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===e&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(t){for(var e=this.body.edges,i=this.body.data.edges,n=!1,o=0;o<t.length;o++){var r=t[o],s=i.get(r),a=e[r];void 0!==a?(a.disconnect(),n=a.setOptions(s)||n,a.connect()):(this.body.edges[r]=this.create(s),n=!0)}!0===n?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(0!==t.length){var i=this.body.edges;Ms(t,(function(t){var e=i[t];void 0!==e&&e.remove()})),e&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var t=this;Ms(this.body.edges,(function(e,i){var n=t.body.data.edges._data[i];void 0!==n&&e.setOptions(n)}))}},{key:"create",value:function(t){return new mv(t,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var t,e=this.body.nodes,i=this.body.edges;for(t in e)e.hasOwnProperty(t)&&(e[t].edges=[]);for(t in i)if(i.hasOwnProperty(t)){var n=i[t];n.from=null,n.to=null,n.connect()}}},{key:"getConnectedNodes",value:function(t){var e=[];if(void 0!==this.body.edges[t]){var i=this.body.edges[t];void 0!==i.fromId&&e.push(i.fromId),void 0!==i.toId&&e.push(i.toId)}return e}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var t=this,e=[];Ms(this.body.edges,(function(i,n){var o=t.body.nodes[i.toId],r=t.body.nodes[i.fromId];void 0!==o&&!0===o.isCluster||void 0!==r&&!0===r.isCluster||void 0!==o&&void 0!==r||e.push(n)})),this.remove(e,!1)}},{key:"_addMissingEdges",value:function(){var t=this.body.data.edges;if(null!=t){var e=this.body.edges,i=[];t.forEach((function(t,n){void 0===e[n]&&i.push(n)})),this.add(i,!0)}}}]),t}(),_v=function(){function t(e,i,n){Bu(this,t),this.body=e,this.physicsBody=i,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return Wu(t,[{key:"setOptions",value:function(t){this.options=t,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var t,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=i.length,o=this._formBarnesHutTree(e,i);this.barnesHutTree=o;for(var r=0;r<n;r++)(t=e[i[r]]).options.mass>0&&this._getForceContributions(o.root,t)}}},{key:"_getForceContributions",value:function(t,e){this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)}},{key:"_getForceContribution",value:function(t,e){var i,n,o;t.childrenCount>0&&(i=t.centerOfMass.x-e.x,n=t.centerOfMass.y-e.y,(o=Math.sqrt(i*i+n*n))*t.calcSize>this.thetaInversed?this._calculateForces(o,i,n,e,t):4===t.childrenCount?this._getForceContributions(t,e):t.children.data.id!=e.id&&this._calculateForces(o,i,n,e,t))}},{key:"_calculateForces",value:function(t,e,i,n,o){0===t&&(e=t=.1),this.overlapAvoidanceFactor<1&&n.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,t-n.shape.radius));var r=this.options.gravitationalConstant*o.mass*n.options.mass/Math.pow(t,3),s=e*r,a=i*r;this.physicsBody.forces[n.id].x+=s,this.physicsBody.forces[n.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i,n=e.length,o=t[e[0]].x,r=t[e[0]].y,s=t[e[0]].x,a=t[e[0]].y,h=1;h<n;h++){var d=t[e[h]],l=d.x,u=d.y;d.options.mass>0&&(l<o&&(o=l),l>s&&(s=l),u<r&&(r=u),u>a&&(a=u))}var c=Math.abs(s-o)-Math.abs(a-r);c>0?(r-=.5*c,a+=.5*c):(o+=.5*c,s-=.5*c);var f=Math.max(1e-5,Math.abs(s-o)),p=.5*f,v=.5*(o+s),g=.5*(r+a),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:g-p,maxY:g+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(var m=0;m<n;m++)(i=t[e[m]]).options.mass>0&&this._placeInTree(y.root,i);return y}},{key:"_updateBranchMass",value:function(t,e){var i=t.centerOfMass,n=t.mass+e.options.mass,o=1/n;i.x=i.x*t.mass+e.x*e.options.mass,i.x*=o,i.y=i.y*t.mass+e.y*e.options.mass,i.y*=o,t.mass=n;var r=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidth<r?r:t.maxWidth}},{key:"_placeInTree",value:function(t,e,i){1==i&&void 0!==i||this._updateBranchMass(t,e);var n,o=t.children.NW.range;n=o.maxX>e.x?o.maxY>e.y?"NW":"SW":o.maxY>e.y?"NE":"SE",this._placeInRegion(t,e,n)}},{key:"_placeInRegion",value:function(t,e,i){var n=t.children[i];switch(n.childrenCount){case 0:n.children.data=e,n.childrenCount=1,this._updateBranchMass(n,e);break;case 1:n.children.data.x===e.x&&n.children.data.y===e.y?(e.x+=this.seededRandom(),e.y+=this.seededRandom()):(this._splitBranch(n),this._placeInTree(n,e));break;case 4:this._placeInTree(n,e)}}},{key:"_splitBranch",value:function(t){var e=null;1===t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)}},{key:"_insertRegion",value:function(t,e){var i,n,o,r,s=.5*t.size;switch(e){case"NW":i=t.range.minX,n=t.range.minX+s,o=t.range.minY,r=t.range.minY+s;break;case"NE":i=t.range.minX+s,n=t.range.maxX,o=t.range.minY,r=t.range.minY+s;break;case"SW":i=t.range.minX,n=t.range.minX+s,o=t.range.minY+s,r=t.range.maxY;break;case"SE":i=t.range.minX+s,n=t.range.maxX,o=t.range.minY+s,r=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:n,minY:o,maxY:r},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}}},{key:"_debug",value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}},{key:"_drawBranch",value:function(t,e,i){void 0===i&&(i="#FF0000"),4===t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}(),wv=function(){function t(e,i,n){Bu(this,t),this.body=e,this.physicsBody=i,this.setOptions(n)}return Wu(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,n,o,r,s,a,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,u=this.options.nodeDistance,c=-2/3/u,f=0;f<d.length-1;f++){s=h[d[f]];for(var p=f+1;p<d.length;p++)t=(a=h[d[p]]).x-s.x,e=a.y-s.y,0===(i=Math.sqrt(t*t+e*e))&&(t=i=.1*Math.random()),i<2*u&&(r=i<.5*u?1:c*i+4/3,n=t*(r/=i),o=e*r,l[s.id].x-=n,l[s.id].y-=o,l[a.id].x+=n,l[a.id].y+=o)}}}]),t}(),kv=function(){function t(e,i,n){Bu(this,t),this.body=e,this.physicsBody=i,this.setOptions(n)}return Wu(t,[{key:"setOptions",value:function(t){this.options=t,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}},{key:"solve",value:function(){for(var t=this.body.nodes,e=this.physicsBody.physicsNodeIndices,i=this.physicsBody.forces,n=this.options.nodeDistance,o=0;o<e.length-1;o++)for(var r=t[e[o]],s=o+1;s<e.length;s++){var a=t[e[s]];if(r.level===a.level){var h=n+this.overlapAvoidanceFactor*((r.shape.radius||0)/2+(a.shape.radius||0)/2),d=a.x-r.x,l=a.y-r.y,u=Math.sqrt(d*d+l*l),c=void 0;c=u<h?-Math.pow(.05*u,2)+Math.pow(.05*h,2):0,0===u?(Ju("distance"),u=.01):c/=u;var f=d*c,p=l*c;i[r.id].x-=f,i[r.id].y-=p,i[a.id].x+=f,i[a.id].y+=p}}}}]),t}(),xv=function(){function t(e,i,n){Bu(this,t),this.body=e,this.physicsBody=i,this.setOptions(n)}return Wu(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,n,o,r=this.physicsBody.physicsEdgeIndices,s=this.body.edges,a=0;a<r.length;a++)!0===(e=s[r[a]]).connected&&e.toId!==e.fromId&&void 0!==this.body.nodes[e.toId]&&void 0!==this.body.nodes[e.fromId]&&(void 0!==e.edgeType.via?(t=void 0===e.options.length?this.options.springLength:e.options.length,i=e.to,n=e.edgeType.via,o=e.from,this._calculateSpringForce(i,n,.5*t),this._calculateSpringForce(n,o,.5*t)):(t=void 0===e.options.length?1.5*this.options.springLength:e.options.length,this._calculateSpringForce(e.from,e.to,t)))}},{key:"_calculateSpringForce",value:function(t,e,i){var n=t.x-e.x,o=t.y-e.y,r=Math.max(Math.sqrt(n*n+o*o),.01),s=this.options.springConstant*(i-r)/r,a=n*s,h=o*s;void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x+=a,this.physicsBody.forces[t.id].y+=h),void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x-=a,this.physicsBody.forces[e.id].y-=h)}}]),t}(),Sv=function(){function t(e,i,n){Bu(this,t),this.body=e,this.physicsBody=i,this.setOptions(n)}return Wu(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,n,o,r,s,a,h,d,l=this.body.edges,u=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces,p=0;p<c.length;p++){var v=c[p];f[v].springFx=0,f[v].springFy=0}for(var g=0;g<u.length;g++)!0===(e=l[u[g]]).connected&&(t=void 0===e.options.length?this.options.springLength:e.options.length,i=e.from.x-e.to.x,n=e.from.y-e.to.y,a=0===(a=Math.sqrt(i*i+n*n))?.01:a,o=i*(s=this.options.springConstant*(t-a)/a),r=n*s,e.to.level!=e.from.level?(void 0!==f[e.toId]&&(f[e.toId].springFx-=o,f[e.toId].springFy-=r),void 0!==f[e.fromId]&&(f[e.fromId].springFx+=o,f[e.fromId].springFy+=r)):(void 0!==f[e.toId]&&(f[e.toId].x-=.5*o,f[e.toId].y-=.5*r),void 0!==f[e.fromId]&&(f[e.fromId].x+=.5*o,f[e.fromId].y+=.5*r)));s=1;for(var y=0;y<c.length;y++){var m=c[y];h=Math.min(s,Math.max(-s,f[m].springFx)),d=Math.min(s,Math.max(-s,f[m].springFy)),f[m].x+=h,f[m].y+=d}for(var b=0,_=0,w=0;w<c.length;w++){var k=c[w];b+=f[k].x,_+=f[k].y}for(var x=b/c.length,S=_/c.length,O=0;O<c.length;O++){var D=c[O];f[D].x-=x,f[D].y-=S}}}]),t}(),Ov=function(){function t(e,i,n){Bu(this,t),this.body=e,this.physicsBody=i,this.setOptions(n)}return Wu(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,n,o=this.body.nodes,r=this.physicsBody.physicsNodeIndices,s=this.physicsBody.forces,a=0;a<r.length;a++){t=-(n=o[r[a]]).x,e=-n.y,i=Math.sqrt(t*t+e*e),this._calculateForces(i,t,e,s,n)}}},{key:"_calculateForces",value:function(t,e,i,n,o){var r=0===t?0:this.options.centralGravity/t;n[o.id].x=e*r,n[o.id].y=i*r}}]),t}(),Dv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,_v),Wu(e,[{key:"_calculateForces",value:function(t,e,i,n,o){0===t&&(e=t=.1*Math.random()),this.overlapAvoidanceFactor<1&&n.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,t-n.shape.radius));var r=n.edges.length+1,s=this.options.gravitationalConstant*o.mass*n.options.mass*r/Math.pow(t,2),a=e*s,h=i*s;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=h}}]),e}(),Mv=function(t){function e(t,i,n){return Bu(this,e),$u(this,Zu(e).call(this,t,i,n))}return qu(e,Ov),Wu(e,[{key:"_calculateForces",value:function(t,e,i,n,o){if(t>0){var r=o.edges.length+1,s=this.options.centralGravity*r*o.options.mass;n[o.id].x=e*s,n[o.id].y=i*s}}}]),e}(),Ev=function(){function t(e){Bu(this,t),this.body=e,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},cs(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("initPhysics",(function(){t.initPhysics()})),this.body.emitter.on("_layoutFailed",(function(){t.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(function(){t.stopSimulation(),t.ready=!1})),this.body.emitter.on("disablePhysics",(function(){t.physicsEnabled=!1,t.stopSimulation()})),this.body.emitter.on("restorePhysics",(function(){t.setOptions(t.options),!0===t.ready&&t.startSimulation()})),this.body.emitter.on("startSimulation",(function(){!0===t.ready&&t.startSimulation()})),this.body.emitter.on("stopSimulation",(function(){t.stopSimulation()})),this.body.emitter.on("destroy",(function(){t.stopSimulation(!1),t.body.emitter.off()})),this.body.emitter.on("_dataChanged",(function(){t.updatePhysicsData()}))}},{key:"setOptions",value:function(t){void 0!==t&&(!1===t?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):!0===t?(this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation()):(this.physicsEnabled=!0,vs(["stabilization"],this.options,t),ta(this.options,t,"stabilization"),void 0===t.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 t;"forceAtlas2Based"===this.options.solver?(t=this.options.forceAtlas2Based,this.nodesSolver=new Dv(this.body,this.physicsBody,t),this.edgesSolver=new xv(this.body,this.physicsBody,t),this.gravitySolver=new Mv(this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new wv(this.body,this.physicsBody,t),this.edgesSolver=new xv(this.body,this.physicsBody,t),this.gravitySolver=new Ov(this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new kv(this.body,this.physicsBody,t),this.edgesSolver=new Sv(this.body,this.physicsBody,t),this.gravitySolver=new Ov(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new _v(this.body,this.physicsBody,t),this.edgesSolver=new xv(this.body,this.physicsBody,t),this.gravitySolver=new Ov(this.body,this.physicsBody,t)),this.modelOptions=t}},{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 t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===t&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===t&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Date.now();this.physicsTick(),(Date.now()-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 t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&setTimeout((function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0}),0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),!0!==this.stabilized){if(!0===this.adaptiveTimestep&&!0===this.adaptiveTimestepEnabled)this.adaptiveCounter%this.adaptiveInterval==0?(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 t=this.body.nodes,e=this.body.edges;for(var i in t)t.hasOwnProperty(i)&&!0===t[i].options.physics&&this.physicsBody.physicsNodeIndices.push(t[i].id);for(var n in e)e.hasOwnProperty(n)&&!0===e[n].options.physics&&this.physicsBody.physicsEdgeIndices.push(e[n].id);for(var o=0;o<this.physicsBody.physicsNodeIndices.length;o++){var r=this.physicsBody.physicsNodeIndices[o];this.physicsBody.forces[r]={x:0,y:0},void 0===this.physicsBody.velocities[r]&&(this.physicsBody.velocities[r]={x:0,y:0})}for(var s in this.physicsBody.velocities)void 0===t[s]&&delete this.physicsBody.velocities[s]}},{key:"revert",value:function(){var t=Object.keys(this.previousStates),e=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var n=0;n<t.length;n++){var o=t[n];void 0!==e[o]?!0===e[o].options.physics&&(this.referenceState[o]={positions:{x:e[o].x,y:e[o].y}},i[o].x=this.previousStates[o].vx,i[o].y=this.previousStates[o].vy,e[o].x=this.previousStates[o].x,e[o].y=this.previousStates[o].y):delete this.previousStates[o]}}},{key:"_evaluateStepQuality",value:function(){var t,e,i=this.body.nodes,n=this.referenceState;for(var o in this.referenceState)if(this.referenceState.hasOwnProperty(o)&&void 0!==i[o]&&(t=i[o].x-n[o].positions.x,e=i[o].y-n[o].positions.y,Math.sqrt(Math.pow(t,2)+Math.pow(e,2))>.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=0,i=0,n=0;n<t.length;n++){var o=t[n],r=this._performStep(o);e=Math.max(e,r),i+=r}this.adaptiveTimestepEnabled=i/t.length<5,this.stabilized=e<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(t,e,i){t+=(e-this.modelOptions.damping*t)/i*this.timestep;var n=this.options.maxVelocity||1e9;return Math.abs(t)>n&&(t=t>0?n:-n),t}},{key:"_performStep",value:function(t){var e=this.body.nodes[t],i=this.physicsBody.forces[t],n=this.physicsBody.velocities[t];return this.previousStates[t]={x:e.x,y:e.y,vx:n.x,vy:n.y},!1===e.options.fixed.x?(n.x=this.calculateComponentVelocity(n.x,i.x,e.options.mass),e.x+=n.x*this.timestep):(i.x=0,n.x=0),!1===e.options.fixed.y?(n.y=this.calculateComponentVelocity(n.y,i.y,e.options.mass),e.y+=n.y*this.timestep):(i.y=0,n.y=0),Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)if(t.hasOwnProperty(e)&&t[e].x&&t[e].y){var i=t[e].options.fixed;this.freezeCache[e]={x:i.x,y:i.y},i.x=!0,i.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof e&&(e=this.options.stabilization.iterations,console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,setTimeout((function(){return t._stabilizationBatch()}),0)):this.ready=!0}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var t=this,e=function(){return!1===t.stabilized&&t.stabilizationIterations<t.targetIterations},i=function(){t.body.emitter.emit("stabilizationProgress",{iterations:t.stabilizationIterations,total:t.targetIterations})};this._startStabilizing()&&i();for(var n=0;e()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;i(),e()?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(t){for(var e=0;e<this.physicsBody.physicsNodeIndices.length;e++){var i=this.physicsBody.physicsNodeIndices[e],n=this.body.nodes[i],o=this.physicsBody.forces[i],r=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),s=Math.min(Math.max(5,r),15),a=3*s,h=Gs((180-180*Math.min(1,Math.max(0,.03*r)))/360,1,1),d={x:n.x+20*o.x,y:n.y+20*o.y};t.lineWidth=s,t.strokeStyle=h,t.beginPath(),t.moveTo(n.x,n.y),t.lineTo(d.x,d.y),t.stroke();var l=Math.atan2(o.y,o.x);t.fillStyle=h,lv.draw(t,{type:"arrow",point:d,angle:l,length:a}),t.fill()}}}]),t}(),Tv=[].reverse,Cv=[1,2];Ct({target:"Array",proto:!0,forced:String(Cv)===String(Cv.reverse())},{reverse:function(){return da(this)&&(this.length=this.length),Tv.call(this)}});var Pv=function(){function t(){Bu(this,t)}return Wu(t,null,[{key:"getRange",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,r=1e9,s=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)r>(e=t[i[a]]).shape.boundingBox.left&&(r=e.shape.boundingBox.left),s<e.shape.boundingBox.right&&(s=e.shape.boundingBox.right),n>e.shape.boundingBox.top&&(n=e.shape.boundingBox.top),o<e.shape.boundingBox.bottom&&(o=e.shape.boundingBox.bottom);return 1e9===r&&-1e9===s&&1e9===n&&-1e9===o&&(n=0,o=0,r=0,s=0),{minX:r,maxX:s,minY:n,maxY:o}}},{key:"getRangeCore",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,r=1e9,s=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)r>(e=t[i[a]]).x&&(r=e.x),s<e.x&&(s=e.x),n>e.y&&(n=e.y),o<e.y&&(o=e.y);return 1e9===r&&-1e9===s&&1e9===n&&-1e9===o&&(n=0,o=0,r=0,s=0),{minX:r,maxX:s,minY:n,maxY:o}}},{key:"findCenter",value:function(t){return{x:.5*(t.maxX+t.minX),y:.5*(t.maxY+t.minY)}}},{key:"cloneOptions",value:function(t,e){var i={};return void 0===e||"node"===e?(gs(i,t.options,!0),i.x=t.x,i.y=t.y,i.amountOfConnections=t.edges.length):gs(i,t.options,!0),i}}]),t}(),Iv=function(t){function e(t,i,n,o,r,s){var a;return Bu(this,e),(a=$u(this,Zu(e).call(this,t,i,n,o,r,s))).isCluster=!0,a.containedNodes={},a.containedEdges={},a}return qu(e,Up),Wu(e,[{key:"_openChildCluster",value:function(t){var e=this,i=this.body.nodes[t];if(void 0===this.containedNodes[t])throw new Error("node with id: "+t+" not in current cluster");if(!i.isCluster)throw new Error("node with id: "+t+" is not a cluster");delete this.containedNodes[t],Ms(i.edges,(function(t){delete e.containedEdges[t.id]})),Ms(i.containedNodes,(function(t,i){e.containedNodes[i]=t})),i.containedNodes={},Ms(i.containedEdges,(function(t,i){e.containedEdges[i]=t})),i.containedEdges={},Ms(i.edges,(function(t){Ms(e.edges,(function(i){var n=i.clusteringEdgeReplacingIds.indexOf(t.id);-1!==n&&(Ms(t.clusteringEdgeReplacingIds,(function(t){i.clusteringEdgeReplacingIds.push(t),e.body.edges[t].edgeReplacedById=i.id})),i.clusteringEdgeReplacingIds.splice(n,1))}))})),i.edges=[]}}]),e}(),Nv=function(){function t(e){var i=this;Bu(this,t),this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},cs(this.options,this.defaultOptions),this.body.emitter.on("_resetData",(function(){i.clusteredNodes={},i.clusteredEdges={}}))}return Wu(t,[{key:"clusterByHubsize",value:function(t,e){void 0===t?t=this._getHubSize():"object"===Lu(t)&&(e=this._checkOptions(t),t=this._getHubSize());for(var i=[],n=0;n<this.body.nodeIndices.length;n++){var o=this.body.nodes[this.body.nodeIndices[n]];o.edges.length>=t&&i.push(o.id)}for(var r=0;r<i.length;r++)this.clusterByConnection(i[r],e,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===e.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);var n={},o={};Ms(this.body.nodes,(function(i,r){i.options&&!0===e.joinCondition(i.options)&&(n[r]=i,Ms(i.edges,(function(e){void 0===t.clusteredEdges[e.id]&&(o[e.id]=e)})))})),this._cluster(n,o,e,i)}},{key:"clusterByEdgeCount",value:function(t,e){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);for(var o,r,s,a=[],h={},d=function(n){var d={},l={},f=i.body.nodeIndices[n],p=i.body.nodes[f];if(void 0===h[f]){s=0,r=[];for(var v=0;v<p.edges.length;v++)o=p.edges[v],void 0===i.clusteredEdges[o.id]&&(o.toId!==o.fromId&&s++,r.push(o));if(s===t){u=function(t){if(void 0===e.joinCondition||null===e.joinCondition)return!0;var i=Pv.cloneOptions(t);return e.joinCondition(i)};for(var g=!0,y=0;y<r.length;y++){o=r[y];var m=i._getConnectedId(o,f);if(!u(p)){g=!1;break}l[o.id]=o,d[f]=p,d[m]=i.body.nodes[m],h[f]=!0}if(Object.keys(d).length>0&&Object.keys(l).length>0&&!0===g)if(void 0!==(c=function(){for(var t=0;t<a.length;++t)for(var e in d)if(void 0!==a[t].nodes[e])return a[t]}())){for(var b in d)void 0===c.nodes[b]&&(c.nodes[b]=d[b]);for(var _ in l)void 0===c.edges[_]&&(c.edges[_]=l[_])}else a.push({nodes:d,edges:l})}}},l=0;l<this.body.nodeIndices.length;l++){var u,c;d(l)}for(var f=0;f<a.length;f++)this._cluster(a[f].nodes,a[f].edges,e,!1);!0===n&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[t])throw new Error("The nodeId given to clusterByConnection does not exist!");var n=this.body.nodes[t];void 0===(e=this._checkOptions(e,n)).clusterNodeProperties.x&&(e.clusterNodeProperties.x=n.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=n.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=n.options.fixed.x,e.clusterNodeProperties.fixed.y=n.options.fixed.y);var o={},r={},s=n.id,a=Pv.cloneOptions(n);o[s]=n;for(var h=0;h<n.edges.length;h++){var d=n.edges[h];if(void 0===this.clusteredEdges[d.id]){var l=this._getConnectedId(d,s);if(void 0===this.clusteredNodes[l])if(l!==s)if(void 0===e.joinCondition)r[d.id]=d,o[l]=this.body.nodes[l];else{var u=Pv.cloneOptions(this.body.nodes[l]);!0===e.joinCondition(a,u)&&(r[d.id]=d,o[l]=this.body.nodes[l])}else r[d.id]=d}}var c=Object.keys(o).map((function(t){return o[t].id}));for(f in o)if(o.hasOwnProperty(f))for(var f=o[f],p=0;p<f.edges.length;p++){var v=f.edges[p];c.indexOf(this._getConnectedId(v,f.id))>-1&&(r[v.id]=v)}this._cluster(o,r,e,i)}},{key:"_createClusterEdges",value:function(t,e,i,n){for(var o,r,s,a,h,d,l=Object.keys(t),u=[],c=0;c<l.length;c++){s=t[r=l[c]];for(var f=0;f<s.edges.length;f++)o=s.edges[f],void 0===this.clusteredEdges[o.id]&&(o.toId==o.fromId?e[o.id]=o:o.toId==r?(a=i.id,d=h=o.fromId):(a=o.toId,h=i.id,d=a),void 0===t[d]&&u.push({edge:o,fromId:h,toId:a}))}for(var p=[],v=function(t){for(var e=0;e<p.length;e++){var i=p[e],n=t.fromId===i.fromId&&t.toId===i.toId,o=t.fromId===i.toId&&t.toId===i.fromId;if(n||o)return i}return null},g=0;g<u.length;g++){var y=u[g],m=y.edge,b=v(y);null===b?(b=this._createClusteredEdge(y.fromId,y.toId,m,n),p.push(b)):b.clusteringEdgeReplacingIds.push(m.id),this.body.edges[m.id].edgeReplacedById=b.id,this._backupEdgeOptions(m),m.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=[];for(var r in t)t.hasOwnProperty(r)&&void 0!==this.clusteredNodes[r]&&o.push(r);for(var s=0;s<o.length;++s)delete t[o[s]];if(0!=Object.keys(t).length&&(1!=Object.keys(t).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){var a=gs({},i.clusterNodeProperties);if(void 0!==i.processProperties){var h=[];for(var d in t)if(t.hasOwnProperty(d)){var l=Pv.cloneOptions(t[d]);h.push(l)}var u=[];for(var c in e)if(e.hasOwnProperty(c)&&"clusterEdge:"!==c.substr(0,12)){var f=Pv.cloneOptions(e[c],"edge");u.push(f)}if(!(a=i.processProperties(a,h,u)))throw new Error("The processProperties function does not return properties!")}void 0===a.id&&(a.id="cluster:"+Jr());var p=a.id;void 0===a.label&&(a.label="cluster");var v=void 0;void 0===a.x&&(v=this._getClusterPosition(t),a.x=v.x),void 0===a.y&&(void 0===v&&(v=this._getClusterPosition(t)),a.y=v.y),a.id=p;var g=this.body.functions.createNode(a,Iv);g.containedNodes=t,g.containedEdges=e,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[a.id]=g,this._clusterEdges(t,e,a,i.clusterEdgeProperties),a.id=void 0,!0===n&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics})}},{key:"_restoreEdge",value:function(t){var e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics}),delete this.clusteredEdges[t.id])}},{key:"isCluster",value:function(t){return void 0!==this.body.nodes[t]?!0===this.body.nodes[t].isCluster:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(t){for(var e,i=Object.keys(t),n=t[i[0]].x,o=t[i[0]].x,r=t[i[0]].y,s=t[i[0]].y,a=1;a<i.length;a++)n=(e=t[i[a]]).x<n?e.x:n,o=e.x>o?e.x:o,r=e.y<r?e.y:r,s=e.y>s?e.y:s;return{x:.5*(n+o),y:.5*(r+s)}}},{key:"openCluster",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");var n=this.body.nodes[t];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:"+t+" is not a valid cluster.");var o=this.findNode(t),r=o.indexOf(t)-1;if(r>=0){var s=o[r],a=this.body.nodes[s];return a._openChildCluster(t),delete this.body.nodes[t],void(!0===i&&this.body.emitter.emit("_dataChanged"))}var h=n.containedNodes,d=n.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var l={},u={x:n.x,y:n.y};for(var c in h)if(h.hasOwnProperty(c)){var f=this.body.nodes[c];l[c]={x:f.x,y:f.y}}var p=e.releaseFunction(u,l);for(var v in h)if(h.hasOwnProperty(v)){var g=this.body.nodes[v];void 0!==p[v]&&(g.x=void 0===p[v].x?n.x:p[v].x,g.y=void 0===p[v].y?n.y:p[v].y)}}else Ms(h,(function(t){!1===t.options.fixed.x&&(t.x=n.x),!1===t.options.fixed.y&&(t.y=n.y)}));for(var y in h)if(h.hasOwnProperty(y)){var m=this.body.nodes[y];m.vx=n.vx,m.vy=n.vy,m.setOptions({physics:!0}),delete this.clusteredNodes[y]}for(var b=[],_=0;_<n.edges.length;_++)b.push(n.edges[_]);for(var w=0;w<b.length;w++){for(var k=b[w],x=this._getConnectedId(k,t),S=this.clusteredNodes[x],O=0;O<k.clusteringEdgeReplacingIds.length;O++){var D=k.clusteringEdgeReplacingIds[O],M=this.body.edges[D];if(void 0!==M)if(void 0!==S){var E=this.body.nodes[S.clusterId];E.containedEdges[M.id]=M,delete d[M.id];var T=M.fromId,C=M.toId;M.toId==x?C=S.clusterId:T=S.clusterId,this._createClusteredEdge(T,C,M,E.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(M)}k.remove()}for(var P in d)d.hasOwnProperty(P)&&this._restoreEdge(d[P]);delete this.body.nodes[t],!0===i&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(t){var e=[];if(!0===this.isCluster(t)){var i=this.body.nodes[t].containedNodes;for(var n in i)i.hasOwnProperty(n)&&e.push(this.body.nodes[n].id)}return e}},{key:"findNode",value:function(t){for(var e,i=[],n=0;void 0!==this.clusteredNodes[t]&&n<100;){if(void 0===(e=this.body.nodes[t]))return[];i.push(e.id),t=this.clusteredNodes[t].clusterId,n++}return void 0===(e=this.body.nodes[t])?[]:(i.push(e.id),i.reverse(),i)}},{key:"updateClusteredNode",value:function(t,e){if(void 0===t)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(void 0===e)throw new Error("No newOptions supplied to updateClusteredNode.");if(void 0===this.body.nodes[t])throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[t].setOptions(e),this.body.emitter.emit("_dataChanged")}},{key:"updateEdge",value:function(t,e){if(void 0===t)throw new Error("No startEdgeId supplied to updateEdge.");if(void 0===e)throw new Error("No newOptions supplied to updateEdge.");if(void 0===this.body.edges[t])throw new Error("The startEdgeId supplied to updateEdge does not exist.");for(var i=this.getClusteredEdges(t),n=0;n<i.length;n++){this.body.edges[i[n]].setOptions(e)}this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(t){for(var e=[],i=0;void 0!==t&&void 0!==this.body.edges[t]&&i<100;)e.push(this.body.edges[t].id),t=this.body.edges[t].edgeReplacedById,i++;return e.reverse(),e}},{key:"getBaseEdge",value:function(t){return this.getBaseEdges(t)[0]}},{key:"getBaseEdges",value:function(t){for(var e=[t],i=[],n=[],o=0;e.length>0&&o<100;){var r=e.pop();if(void 0!==r){var s=this.body.edges[r];if(void 0!==s){o++;var a=s.clusteringEdgeReplacingIds;if(void 0===a)n.push(r);else for(var h=0;h<a.length;++h){var d=a[h];-1===e.indexOf(a)&&-1===i.indexOf(a)&&e.push(d)}i.push(r)}}}return n}},{key:"_getConnectedId",value:function(t,e){return t.toId!=e?t.toId:(t.fromId,t.fromId)}},{key:"_getHubSize",value:function(){for(var t=0,e=0,i=0,n=0,o=0;o<this.body.nodeIndices.length;o++){var r=this.body.nodes[this.body.nodeIndices[o]];r.edges.length>n&&(n=r.edges.length),t+=r.edges.length,e+=Math.pow(r.edges.length,2),i+=1}t/=i;var s=(e/=i)-Math.pow(t,2),a=Math.sqrt(s),h=Math.floor(t+2*a);return h>n&&(h=n),h}},{key:"_createClusteredEdge",value:function(t,e,i,n,o){var r=Pv.cloneOptions(i,"edge");gs(r,n),r.from=t,r.to=e,r.id="clusterEdge:"+Jr(),void 0!==o&&gs(r,o);var s=this.body.functions.createEdge(r);return s.clusteringEdgeReplacingIds=[i.id],s.connect(),this.body.edges[s.id]=s,s}},{key:"_clusterEdges",value:function(t,e,i,n){if(e instanceof mv){var o=e,r={};r[o.id]=o,e=r}if(t instanceof Up){var s=t,a={};a[s.id]=s,t=a}if(null==i)throw new Error("_clusterEdges: parameter clusterNode required");for(var h in void 0===n&&(n=i.clusterEdgeProperties),this._createClusterEdges(t,e,i,n),e)if(e.hasOwnProperty(h)&&void 0!==this.body.edges[h]){var d=this.body.edges[h];this._backupEdgeOptions(d),d.setOptions({physics:!1})}for(var l in t)t.hasOwnProperty(l)&&(this.clusteredNodes[l]={clusterId:i.id,node:this.body.nodes[l]},this.body.nodes[l].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(t){if(void 0!==t){var e=this.clusteredNodes[t];if(void 0!==e){var i=e.clusterId;if(void 0!==i)return this.body.nodes[i]}}}},{key:"_filter",value:function(t,e){var i=[];return Ms(t,(function(t){e(t)&&i.push(t)})),i}},{key:"_updateState",value:function(){var t,e=this,i=[],n={},o=function(t){Ms(e.body.nodes,(function(e){!0===e.isCluster&&t(e)}))};for(t in this.clusteredNodes){if(this.clusteredNodes.hasOwnProperty(t))void 0===this.body.nodes[t]&&i.push(t)}o((function(t){for(var e=0;e<i.length;e++)delete t.containedNodes[i[e]]}));for(var r=0;r<i.length;r++)delete this.clusteredNodes[i[r]];Ms(this.clusteredEdges,(function(t){var i=e.body.edges[t];void 0!==i&&i.endPointsValid()||(n[t]=t)})),o((function(t){Ms(t.containedEdges,(function(t,e){t.endPointsValid()||n[e]||(n[e]=e)}))})),Ms(this.body.edges,(function(t,i){var o=!0,r=t.clusteringEdgeReplacingIds;if(void 0!==r){var s=0;Ms(r,(function(t){var i=e.body.edges[t];void 0!==i&&i.endPointsValid()&&(s+=1)})),o=s>0}t.endPointsValid()&&o||(n[i]=i)})),o((function(t){Ms(n,(function(i){delete t.containedEdges[i],Ms(t.edges,(function(o,r){o.id!==i?o.clusteringEdgeReplacingIds=e._filter(o.clusteringEdgeReplacingIds,(function(t){return!n[t]})):t.edges[r]=null})),t.edges=e._filter(t.edges,(function(t){return null!==t}))}))})),Ms(n,(function(t){delete e.clusteredEdges[t]})),Ms(n,(function(t){delete e.body.edges[t]})),Ms(Object.keys(this.body.edges),(function(t){var i=e.body.edges[t],n=e._isClusteredNode(i.fromId)||e._isClusteredNode(i.toId);if(n!==e._isClusteredEdge(i.id))if(n){var o=e._getClusterNodeForNode(i.fromId);void 0!==o&&e._clusterEdges(e.body.nodes[i.fromId],i,o);var r=e._getClusterNodeForNode(i.toId);void 0!==r&&e._clusterEdges(e.body.nodes[i.toId],i,r)}else delete e._clusterEdges[t],e._restoreEdge(i)}));for(var s=!1,a=!0,h=function(){var t=[];o((function(e){var i=Object.keys(e.containedNodes).length,n=!0===e.options.allowSingleNodeCluster;(n&&i<1||!n&&i<2)&&t.push(e.id)}));for(var i=0;i<t.length;++i)e.openCluster(t[i],{},!1);a=t.length>0,s=s||a};a;)h();s&&this._updateState()}},{key:"_isClusteredNode",value:function(t){return void 0!==this.clusteredNodes[t]}},{key:"_isClusteredEdge",value:function(t){return void 0!==this.clusteredEdges[t]}}]),t}();var Fv=function(){function t(e,i){var n;Bu(this,t),void 0!==window&&(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===n?function(t){t()}:n,this.body=e,this.canvas=i,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},cs(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("dragStart",(function(){t.dragging=!0})),this.body.emitter.on("dragEnd",(function(){t.dragging=!1})),this.body.emitter.on("zoom",(function(){t.zooming=!0,window.clearTimeout(t.zoomTimeoutId),t.zoomTimeoutId=window.setTimeout((function(){t.zooming=!1,t._requestRedraw.bind(t)()}),250)})),this.body.emitter.on("_resizeNodes",(function(){t._resizeNodes()})),this.body.emitter.on("_redraw",(function(){!1===t.renderingActive&&t._redraw()})),this.body.emitter.on("_blockRedraw",(function(){t.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(function(){t.allowRedraw=!0,t.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",(function(){t.renderRequests+=1,t.renderingActive=!0,t._startRendering()})),this.body.emitter.on("_stopRendering",(function(){t.renderRequests-=1,t.renderingActive=t.renderRequests>0,t.renderTimer=void 0})),this.body.emitter.on("destroy",(function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,!0===t.requiresTimeout?clearTimeout(t.renderTimer):window.cancelAnimationFrame(t.renderTimer),t.body.emitter.off()}))}},{key:"setOptions",value:function(t){if(void 0!==t){ps(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,t)}}},{key:"_requestNextFrame",value:function(t,e){if("undefined"!=typeof window){var i,n=window;return!0===this.requiresTimeout?i=n.setTimeout(t,e):n.requestAnimationFrame&&(i=n.requestAnimationFrame(t)),i}}},{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 t=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame((function(){t._redraw(!1)}),0))}},{key:"_redraw",value:function(){var t=arguments.length>0&&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 e=this.canvas.getContext(),i=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,n),0===this.canvas.frame.clientWidth)return;e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale),e.beginPath(),this.body.emitter.emit("beforeDrawing",e),e.closePath(),!1===t&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(e),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&this._drawNodes(e,t),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),!0===t&&e.clearRect(0,0,i,n)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var t=this.canvas.getContext();t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e,i=this.body.nodes;for(var n in i)i.hasOwnProperty(n)&&((e=i[n]).resize(t),e.updateBoundingBox(t,e.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.body.nodes,o=this.body.nodeIndices,r=[],s=20,a=this.canvas.DOMtoCanvas({x:-s,y:-s}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+s,y:this.canvas.frame.canvas.clientHeight+s}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l<o.length;l++)(e=n[o[l]]).isSelected()?r.push(o[l]):!0===i?e.draw(t):!0===e.isBoundingBoxOverlappingWith(d)?e.draw(t):e.updateBoundingBox(t,e.selected);for(var u=0;u<r.length;u++)(e=n[r[u]]).draw(t)}},{key:"_drawEdges",value:function(t){for(var e,i=this.body.edges,n=this.body.edgeIndices,o=0;o<n.length;o++)!0===(e=i[n[o]]).connected&&e.draw(t)}},{key:"_determineBrowserMethod",value:function(){if("undefined"!=typeof window){var t=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1!=t.indexOf("msie 9.0")?this.requiresTimeout=!0:-1!=t.indexOf("safari")&&t.indexOf("chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}}]),t}(),Av=i((function(t,e){e.onTouch=function(t,e){e.inputHandler=function(t){t.isFirst&&e(t)},t.on("hammer.input",e.inputHandler)},e.onRelease=function(t,e){return e.inputHandler=function(t){t.isFinal&&e(t)},t.on("hammer.input",e.inputHandler)},e.offTouch=function(t,e){t.off("hammer.input",e.inputHandler)},e.offRelease=e.offTouch,e.disablePreventDefaultVertically=function(t){return t.getTouchAction=function(){return["pan-y"]},t}})),Rv=(Av.onTouch,Av.onRelease,Av.offTouch,Av.offRelease,Av.disablePreventDefaultVertically,function(){function t(e){Bu(this,t),this.body=e,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%"},cs(this.options,this.defaultOptions),this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.once("resize",(function(e){0!==e.width&&(t.body.view.translation.x=.5*e.width),0!==e.height&&(t.body.view.translation.y=.5*e.height)})),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",(function(){t.hammerFrame.destroy(),t.hammer.destroy(),t._cleanUp()}))}},{key:"setOptions",value:function(t){var e=this;if(void 0!==t){ps(["width","height","autoResize"],this.options,t)}!0===this.options.autoResize&&(this._cleanUp(),this.resizeTimer=setInterval((function(){!0===e.setSize()&&e.body.emitter.emit("_requestRedraw")}),1e3),this.resizeFunction=this._onResize.bind(this),Ps(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),Is(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/t,this.cameraState.previousHeight=this.frame.canvas.height/t,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/t,y:.5*this.frame.canvas.height/t}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0){var t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=t&&1!=e?i=.5*this.cameraState.scale*(t+e):1!=t?i=this.cameraState.scale*t:1!=e&&(i=this.cameraState.scale*e),this.body.view.scale=i;var n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(-1!==t.indexOf("%")||-1!==t.indexOf("px"))return t;if(-1===t.indexOf("%"))return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{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)this._setPixelRatio(),this.setTransform();else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t)}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 t=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Au(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Au.DIRECTION_ALL}),Av.onTouch(this.hammer,(function(e){t.body.eventListeners.onTouch(e)})),this.hammer.on("tap",(function(e){t.body.eventListeners.onTap(e)})),this.hammer.on("doubletap",(function(e){t.body.eventListeners.onDoubleTap(e)})),this.hammer.on("press",(function(e){t.body.eventListeners.onHold(e)})),this.hammer.on("panstart",(function(e){t.body.eventListeners.onDragStart(e)})),this.hammer.on("panmove",(function(e){t.body.eventListeners.onDrag(e)})),this.hammer.on("panend",(function(e){t.body.eventListeners.onDragEnd(e)})),this.hammer.on("pinch",(function(e){t.body.eventListeners.onPinch(e)})),this.frame.canvas.addEventListener("wheel",(function(e){t.body.eventListeners.onMouseWheel(e)})),this.frame.canvas.addEventListener("mousemove",(function(e){t.body.eventListeners.onMouseMove(e)})),this.frame.canvas.addEventListener("contextmenu",(function(e){t.body.eventListeners.onContext(e)})),this.hammerFrame=new Au(this.frame),Av.onRelease(this.hammerFrame,(function(e){t.body.eventListeners.onRelease(e)}))}},{key:"setSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,n=this.frame.canvas.width,o=this.frame.canvas.height,r=this.pixelRatio;if(this._setPixelRatio(),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e)this._getCameraState(r),this.frame.style.width=t,this.frame.style.height=e,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=t,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{var s=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),a=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===s&&this.frame.canvas.height===a||this._getCameraState(r),this.frame.canvas.width!==s&&(this.frame.canvas.width=s,i=!0),this.frame.canvas.height!==a&&(this.frame.canvas.height=a,i=!0)}return!0===i&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(n/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var t=this.getContext();if(void 0===t)throw new Error("Could not get canvax context");var e=1;return"undefined"!=typeof window&&(e=window.devicePixelRatio||1),e/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var t=this.getContext();if(void 0===t)throw new Error("Could not get canvax context");t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}},{key:"DOMtoCanvas",value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}]),t}()),Yv=a.isFinite,jv=Number.isFinite||function(t){return"number"==typeof t&&Yv(t)};Ct({target:"Number",stat:!0},{isFinite:jv});var zv=function(){function t(e,i){var n=this;Bu(this,t),this.body=e,this.canvas=i,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 Wu(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t}},{key:"fit",value:function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0!==(i=Object.assign({},i)).nodes&&0!==i.nodes.length||(i.nodes=this.body.nodeIndices),!0===n){var o=0;for(var r in this.body.nodes)if(this.body.nodes.hasOwnProperty(r)){var s=this.body.nodes[r];!0===s.predefinedPosition&&(o+=1)}if(o>.5*this.body.nodeIndices.length)return void this.fit(i,!1);t=Pv.getRange(this.body.nodes,i.nodes);var a=this.body.nodeIndices.length;e=12.662/(a+7.4147)+.0964822;var h=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);e*=h}else{this.body.emitter.emit("_resizeNodes"),t=Pv.getRange(this.body.nodes,i.nodes);var d=1.1*Math.abs(t.maxX-t.minX),l=1.1*Math.abs(t.maxY-t.minY),u=this.canvas.frame.canvas.clientWidth/d,c=this.canvas.frame.canvas.clientHeight/l;e=u<=c?u:c}e>1?e=1:0===e&&(e=1);var f=Pv.findCenter(t),p={position:f,scale:e,animation:i.animation};this.moveTo(p)}},{key:"focus",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.log("Node: "+t+" cannot be found.")}},{key:"moveTo",value:function(t){if(void 0!==t){if(null!=t.offset){if(null!=t.offset.x){if(t.offset.x=+t.offset.x,!Number.isFinite(t.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else t.offset.x=0;if(null!=t.offset.y){if(t.offset.y=+t.offset.y,!Number.isFinite(t.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else t.offset.x=0}else t.offset={x:0,y:0};if(null!=t.position){if(null!=t.position.x){if(t.position.x=+t.position.x,!Number.isFinite(t.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else t.position.x=0;if(null!=t.position.y){if(t.position.y=+t.position.y,!Number.isFinite(t.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else t.position.x=0}else t.position=this.getViewPosition();if(null!=t.scale){if(t.scale=+t.scale,!(t.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else t.scale=this.body.view.scale;void 0===t.animation&&(t.animation={duration:0}),!1===t.animation&&(t.animation={duration:0}),!0===t.animation&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),this.animateView(t)}else t={}}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),!0===t.locked&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=t.scale,this.body.view.scale=this.targetScale;var e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i=e.x-t.position.x,n=e.y-t.position.y;this.targetTranslation={x:this.sourceTranslation.x+i*this.targetScale+t.offset.x,y:this.sourceTranslation.y+n*this.targetScale+t.offset.y},0===t.animation.duration?null!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.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 t=this.body.nodes[this.lockedOnNodeId].x,e=this.body.nodes[this.lockedOnNodeId].y,i=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n=i.x-t,o=i.y-e,r=this.body.view.translation,s={x:r.x+n*this.body.view.scale+this.lockedOnNodeOffset.x,y:r.y+o*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=s}},{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 t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===t?1:this.easingTime;var e=na[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1&&(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})}}]),t}(),Lv=function(){function t(e,i){var n=this;Bu(this,t),this.body=e,this.canvas=i,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 Wu(t,[{key:"setOptions",value:function(t){void 0!==t&&(this.options=t,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 t=0;t<this.navigationHammers.length;t++)this.navigationHammers[t].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 t=this;this.cleanNavigation(),this.navigationDOM={};var e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],i=["_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<e.length;n++){this.navigationDOM[e[n]]=document.createElement("div"),this.navigationDOM[e[n]].className="vis-button vis-"+e[n],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[n]]);var o=new Au(this.navigationDOM[e[n]]);"_fit"===i[n]?Av.onTouch(o,this._fit.bind(this)):Av.onTouch(o,this.bindToRedraw.bind(this,i[n])),this.navigationHammers.push(o)}var r=new Au(this.canvas.frame);Av.onRelease(r,(function(){t._stopMovement()})),this.navigationHammers.push(r),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(t){void 0===this.boundFunctions[t]&&(this.boundFunctions[t]=this[t].bind(this),this.body.emitter.on("initRedraw",this.boundFunctions[t]),this.body.emitter.emit("_startRendering"))}},{key:"unbindFromRedraw",value:function(t){void 0!==this.boundFunctions[t]&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[t])}},{key:"_fit",value:function(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var t in this.boundFunctions)this.boundFunctions.hasOwnProperty(t)&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),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 t=this.body.view.scale,e=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,n=e/t,o=(1-n)*this.canvas.canvasViewCenter.x+i.x*n,r=(1-n)*this.canvas.canvasViewCenter.y+i.y*n;this.body.view.scale=e,this.body.view.translation={x:o,y:r},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var t=this.body.view.scale,e=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,n=e/t,o=(1-n)*this.canvas.canvasViewCenter.x+i.x*n,r=(1-n)*this.canvas.canvasViewCenter.y+i.y*n;this.body.view.scale=e,this.body.view.translation={x:o,y:r},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var t=this;void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled&&(!0===this.options.keyboard.bindToWindow?this.keycharm=Md({container:window,preventDefault:!0}):this.keycharm=Md({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(this.keycharm.bind("up",(function(){t.bindToRedraw("_moveUp")}),"keydown"),this.keycharm.bind("down",(function(){t.bindToRedraw("_moveDown")}),"keydown"),this.keycharm.bind("left",(function(){t.bindToRedraw("_moveLeft")}),"keydown"),this.keycharm.bind("right",(function(){t.bindToRedraw("_moveRight")}),"keydown"),this.keycharm.bind("=",(function(){t.bindToRedraw("_zoomIn")}),"keydown"),this.keycharm.bind("num+",(function(){t.bindToRedraw("_zoomIn")}),"keydown"),this.keycharm.bind("num-",(function(){t.bindToRedraw("_zoomOut")}),"keydown"),this.keycharm.bind("-",(function(){t.bindToRedraw("_zoomOut")}),"keydown"),this.keycharm.bind("[",(function(){t.bindToRedraw("_zoomOut")}),"keydown"),this.keycharm.bind("]",(function(){t.bindToRedraw("_zoomIn")}),"keydown"),this.keycharm.bind("pageup",(function(){t.bindToRedraw("_zoomIn")}),"keydown"),this.keycharm.bind("pagedown",(function(){t.bindToRedraw("_zoomOut")}),"keydown"),this.keycharm.bind("up",(function(){t.unbindFromRedraw("_moveUp")}),"keyup"),this.keycharm.bind("down",(function(){t.unbindFromRedraw("_moveDown")}),"keyup"),this.keycharm.bind("left",(function(){t.unbindFromRedraw("_moveLeft")}),"keyup"),this.keycharm.bind("right",(function(){t.unbindFromRedraw("_moveRight")}),"keyup"),this.keycharm.bind("=",(function(){t.unbindFromRedraw("_zoomIn")}),"keyup"),this.keycharm.bind("num+",(function(){t.unbindFromRedraw("_zoomIn")}),"keyup"),this.keycharm.bind("num-",(function(){t.unbindFromRedraw("_zoomOut")}),"keyup"),this.keycharm.bind("-",(function(){t.unbindFromRedraw("_zoomOut")}),"keyup"),this.keycharm.bind("[",(function(){t.unbindFromRedraw("_zoomOut")}),"keyup"),this.keycharm.bind("]",(function(){t.unbindFromRedraw("_zoomIn")}),"keyup"),this.keycharm.bind("pageup",(function(){t.unbindFromRedraw("_zoomIn")}),"keyup"),this.keycharm.bind("pagedown",(function(){t.unbindFromRedraw("_zoomOut")}),"keyup")))}}]),t}(),Bv=function(){function t(e,i){Bu(this,t),this.container=e,this.overflowMethod=i||"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 Wu(t,[{key:"setPosition",value:function(t,e){this.x=parseInt(t),this.y=parseInt(e)}},{key:"setText",value:function(t){t instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(t)):this.frame.innerHTML=t}},{key:"show",value:function(t){if(void 0===t&&(t=!0),!0===t){var e=this.frame.clientHeight,i=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,r=0,s=0;if("flip"==this.overflowMethod){var a=!1,h=!0;this.y-e<this.padding&&(h=!1),this.x+i>o-this.padding&&(a=!0),r=a?this.x-i:this.x,s=h?this.y-e:this.y}else(s=this.y-e)+e+this.padding>n&&(s=n-e-this.padding),s<this.padding&&(s=this.padding),(r=this.x)+i+this.padding>o&&(r=o-i-this.padding),r<this.padding&&(r=this.padding);this.frame.style.left=r+"px",this.frame.style.top=s+"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)}}]),t}(),Hv=function(){function t(e,i,n){Bu(this,t),this.body=e,this.canvas=i,this.selectionHandler=n,this.navigationHandler=new Lv(e,i),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},cs(this.options,this.defaultOptions),this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("destroy",(function(){clearTimeout(t.popupTimer),delete t.body.functions.getPointer}))}},{key:"setOptions",value:function(t){if(void 0!==t){vs(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,t),ta(this.options,t,"keyboard"),t.tooltip&&(cs(this.options.tooltip,t.tooltip),t.tooltip.color&&(this.options.tooltip.color=Ls(t.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(t){return{x:t.x-ks(this.canvas.frame.canvas),y:t.y-Ss(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(t){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect&&(t.changedPointers[0].ctrlKey||t.changedPointers[0].metaKey);this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e)}},{key:"onDoubleTap",value:function(t){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("doubleClick",t,e)}},{key:"onHold",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e),this.selectionHandler._generateClickEvent("hold",t,e)}},{key:"onRelease",value:function(t){if((new Date).valueOf()-this.touchTime>10){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(t){var e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler._generateClickEvent("oncontext",t,e)}},{key:"checkSelectionChanges",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.selectionHandler.getSelection(),o=!1;o=!0===i?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t);var r=this.selectionHandler.getSelection(),s=this._determineDifference(n,r),a=this._determineDifference(r,n);s.edges.length>0&&(this.selectionHandler._generateClickEvent("deselectEdge",e,t,n),o=!0),s.nodes.length>0&&(this.selectionHandler._generateClickEvent("deselectNode",e,t,n),o=!0),a.nodes.length>0&&(this.selectionHandler._generateClickEvent("selectNode",e,t),o=!0),a.edges.length>0&&(this.selectionHandler._generateClickEvent("selectEdge",e,t),o=!0),!0===o&&this.selectionHandler._generateClickEvent("select",e,t)}},{key:"_determineDifference",value:function(t,e){var i=function(t,e){for(var i=[],n=0;n<t.length;n++){var o=t[n];-1===e.indexOf(o)&&i.push(o)}return i};return{nodes:i(t.nodes,e.nodes),edges:i(t.edges,e.edges)}}},{key:"onDragStart",value:function(t){void 0===this.drag.pointer&&this.onTouch(t);var e=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=cs({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==e&&!0===this.options.dragNodes){this.drag.nodeId=e.id,!1===e.isSelected()&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(e)),this.selectionHandler._generateClickEvent("dragStart",t,this.drag.pointer);var i=this.selectionHandler.selectionObj.nodes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n],r={id:o.id,node:o,x:o.x,y:o.y,xFixed:o.options.fixed.x,yFixed:o.options.fixed.y};o.options.fixed.x=!0,o.options.fixed.y=!0,this.drag.selection.push(r)}}else this.selectionHandler._generateClickEvent("dragStart",t,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(t){var e=this;if(!0!==this.drag.pinched){this.body.emitter.emit("unlockNode");var i=this.getPointer(t.center),n=this.drag.selection;if(n&&n.length&&!0===this.options.dragNodes){this.selectionHandler._generateClickEvent("dragging",t,i);var o=i.x-this.drag.pointer.x,r=i.y-this.drag.pointer.y;n.forEach((function(t){var i=t.node;!1===t.xFixed&&(i.x=e.canvas._XconvertDOMtoCanvas(e.canvas._XconvertCanvasToDOM(t.x)+o)),!1===t.yFixed&&(i.y=e.canvas._YconvertDOMtoCanvas(e.canvas._YconvertCanvasToDOM(t.y)+r))})),this.body.emitter.emit("startSimulation")}else if(!0===this.options.dragView){if(this.selectionHandler._generateClickEvent("dragging",t,i,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(t);var s=i.x-this.drag.pointer.x,a=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+s,y:this.drag.translation.y+a},this.body.emitter.emit("_requestRedraw")}}}},{key:"onDragEnd",value:function(t){this.drag.dragging=!1;var e=this.drag.selection;e&&e.length?(e.forEach((function(t){t.node.options.fixed.x=t.xFixed,t.node.options.fixed.y=t.yFixed})),this.selectionHandler._generateClickEvent("dragEnd",t,this.getPointer(t.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",t,this.getPointer(t.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(t){var e=this.getPointer(t.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var i=this.pinch.scale*t.scale;this.zoom(i,e)}},{key:"zoom",value:function(t,e){if(!0===this.options.zoomView){var i=this.body.view.scale;t<1e-5&&(t=1e-5),t>10&&(t=10);var n=void 0;void 0!==this.drag&&!0===this.drag.dragging&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,r=t/i,s=(1-r)*e.x+o.x*r,a=(1-r)*e.y+o.y*r;if(this.body.view.scale=t,this.body.view.translation={x:s,y:a},null!=n){var h=this.canvas.canvasToDOM(n);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),i<t?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:e}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:e})}}},{key:"onMouseWheel",value:function(t){if(!0===this.options.zoomView){if(0!==t.deltaY){var e=this.body.view.scale;e*=1+(t.deltaY<0?1:-1)*(.1*this.options.zoomSpeed);var i=this.getPointer({x:t.clientX,y:t.clientY});this.zoom(e,i)}t.preventDefault()}}},{key:"onMouseMove",value:function(t){var e=this,i=this.getPointer({x:t.clientX,y:t.clientY}),n=!1;void 0!==this.popup&&(!1===this.popup.hidden&&this._checkHidePopup(i),!1===this.popup.hidden&&(n=!0,this.popup.setPosition(i.x+3,i.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 e._checkShowPopup(i)}),this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(t,i)}},{key:"_checkShowPopup",value:function(t){var e=this.canvas._XconvertDOMtoCanvas(t.x),i=this.canvas._YconvertDOMtoCanvas(t.y),n={left:e,top:i,right:e,bottom:i},o=void 0===this.popupObj?void 0:this.popupObj.id,r=!1,s="node";if(void 0===this.popupObj){for(var a,h=this.body.nodeIndices,d=this.body.nodes,l=[],u=0;u<h.length;u++)!0===(a=d[h[u]]).isOverlappingWith(n)&&(r=!0,void 0!==a.getTitle()&&l.push(h[u]));l.length>0&&(this.popupObj=d[l[l.length-1]],r=!0)}if(void 0===this.popupObj&&!1===r){for(var c,f=this.body.edgeIndices,p=this.body.edges,v=[],g=0;g<f.length;g++)!0===(c=p[f[g]]).isOverlappingWith(n)&&!0===c.connected&&void 0!==c.getTitle()&&v.push(f[g]);v.length>0&&(this.popupObj=p[v[v.length-1]],s="edge")}void 0!==this.popupObj?this.popupObj.id!==o&&(void 0===this.popup&&(this.popup=new Bv(this.canvas.frame)),this.popup.popupTargetType=s,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(t){var e=this.selectionHandler._pointerToPositionObject(t),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&!0===(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e))){var n=this.selectionHandler.getNodeAt(t);i=void 0!==n&&n.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(t)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));!1===i&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}(),Wv=function(){function t(e,i){var n=this;Bu(this,t),this.body=e,this.canvas=i,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},cs(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",(function(){n.updateSelection()}))}return Wu(t,[{key:"setOptions",value:function(t){if(void 0!==t){ps(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,t)}}},{key:"selectOnPoint",value:function(t){var e=!1;if(!0===this.options.selectable){var i=this.getNodeAt(t)||this.getEdgeAt(t);this.unselectAll(),void 0!==i&&(e=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return e}},{key:"selectAdditionalOnPoint",value:function(t){var e=!1;if(!0===this.options.selectable){var i=this.getNodeAt(t)||this.getEdgeAt(t);void 0!==i&&(e=!0,!0===i.isSelected()?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return e}},{key:"_initBaseEvent",value:function(t,e){var i={};return i.pointer={DOM:{x:e.x,y:e.y},canvas:this.canvas.DOMtoCanvas(e)},i.event=t,i}},{key:"_generateClickEvent",value:function(t,e,i,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=this._initBaseEvent(e,i);if(!0===o)r.nodes=[],r.edges=[];else{var s=this.getSelection();r.nodes=s.nodes,r.edges=s.edges}void 0!==n&&(r.previousSelection=n),"click"==t&&(r.items=this.getClickedItems(i)),void 0!==e.controlEdge&&(r.controlEdge=e.controlEdge),this.body.emitter.emit(t,r)}},{key:"selectObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==t&&(t instanceof Up&&!0===e&&this._selectConnectedEdges(t),t.select(),this._addToSelection(t),!0)}},{key:"deselectObject",value:function(t){!0===t.isSelected()&&(t.selected=!1,this._removeFromSelection(t))}},{key:"_getAllNodesOverlappingWith",value:function(t){for(var e=[],i=this.body.nodes,n=0;n<this.body.nodeIndices.length;n++){var o=this.body.nodeIndices[n];i[o].isOverlappingWith(t)&&e.push(o)}return e}},{key:"_pointerToPositionObject",value:function(t){var e=this.canvas.DOMtoCanvas(t);return{left:e.x-1,top:e.y+1,right:e.x+1,bottom:e.y-1}}},{key:"getNodeAt",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(t),n=this._getAllNodesOverlappingWith(i);return n.length>0?!0===e?this.body.nodes[n[n.length-1]]:n[n.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,n=0;n<this.body.edgeIndices.length;n++){var o=this.body.edgeIndices[n];i[o].isOverlappingWith(t)&&e.push(o)}}},{key:"_getAllEdgesOverlappingWith",value:function(t){var e=[];return this._getEdgesOverlappingWith(t,e),e}},{key:"getEdgeAt",value:function(t){for(var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(t),n=10,o=null,r=this.body.edges,s=0;s<this.body.edgeIndices.length;s++){var a=this.body.edgeIndices[s],h=r[a];if(h.connected){var d=h.from.x,l=h.from.y,u=h.to.x,c=h.to.y,f=h.edgeType.getDistanceToEdge(d,l,u,c,i.x,i.y);f<n&&(o=a,n=f)}}return null!==o?!0===e?this.body.edges[o]:o:void 0}},{key:"_addToSelection",value:function(t){t instanceof Up?this.selectionObj.nodes[t.id]=t:this.selectionObj.edges[t.id]=t}},{key:"_addToHover",value:function(t){t instanceof Up?this.hoverObj.nodes[t.id]=t:this.hoverObj.edges[t.id]=t}},{key:"_removeFromSelection",value:function(t){t instanceof Up?(delete this.selectionObj.nodes[t.id],this._unselectConnectedEdges(t)):delete this.selectionObj.edges[t.id]}},{key:"unselectAll",value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&this.selectionObj.nodes[t].unselect();for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&this.selectionObj.edges[e].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);return t}},{key:"_getSelectedNode",value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return this.selectionObj.nodes[t]}},{key:"_getSelectedEdge",value:function(){for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return this.selectionObj.edges[t]}},{key:"_getSelectedEdgeCount",value:function(){var t=0;for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(t+=1);return t}},{key:"_getSelectedObjectCount",value:function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(t+=1);return t}},{key:"_selectionIsEmpty",value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return!1;for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t)&&this.selectionObj.nodes[t].clusterSize>1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(t){for(var e=0;e<t.edges.length;e++){var i=t.edges[e];i.select(),this._addToSelection(i)}}},{key:"_hoverConnectedEdges",value:function(t){for(var e=0;e<t.edges.length;e++){var i=t.edges[e];i.hover=!0,this._addToHover(i)}}},{key:"_unselectConnectedEdges",value:function(t){for(var e=0;e<t.edges.length;e++){var i=t.edges[e];i.unselect(),this._removeFromSelection(i)}}},{key:"emitBlurEvent",value:function(t,e,i){var n=this._initBaseEvent(t,e);!0===i.hover&&(i.hover=!1,i instanceof Up?(n.node=i.id,this.body.emitter.emit("blurNode",n)):(n.edge=i.id,this.body.emitter.emit("blurEdge",n)))}},{key:"emitHoverEvent",value:function(t,e,i){var n=this._initBaseEvent(t,e),o=!1;return!1===i.hover&&(i.hover=!0,this._addToHover(i),o=!0,i instanceof Up?(n.node=i.id,this.body.emitter.emit("hoverNode",n)):(n.edge=i.id,this.body.emitter.emit("hoverEdge",n))),o}},{key:"hoverObject",value:function(t,e){var i=this.getNodeAt(e);void 0===i&&(i=this.getEdgeAt(e));var n=!1;for(var o in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(o)&&(void 0===i||i instanceof Up&&i.id!=o||i instanceof mv)&&(this.emitBlurEvent(t,e,this.hoverObj.nodes[o]),delete this.hoverObj.nodes[o],n=!0);for(var r in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(r)&&(!0===n?(this.hoverObj.edges[r].hover=!1,delete this.hoverObj.edges[r]):(void 0===i||i instanceof mv&&i.id!=r||i instanceof Up&&!i.hover)&&(this.emitBlurEvent(t,e,this.hoverObj.edges[r]),delete this.hoverObj.edges[r],n=!0));if(void 0!==i){var s=Object.keys(this.hoverObj.edges).length,a=Object.keys(this.hoverObj.nodes).length;(n||i instanceof mv&&0===s&&0===a||i instanceof Up&&0===s&&0===a)&&(n=this.emitHoverEvent(t,e,i)),i instanceof Up&&!0===this.options.hoverConnectedEdges&&this._hoverConnectedEdges(i)}!0===n&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodes(),edges:this.getSelectedEdges()}}},{key:"getSelectedNodes",value:function(){var t=[];if(!0===this.options.selectable)for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&t.push(this.selectionObj.nodes[e].id);return t}},{key:"getSelectedEdges",value:function(){var t=[];if(!0===this.options.selectable)for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&t.push(this.selectionObj.edges[e].id);return t}},{key:"setSelection",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||!t.nodes&&!t.edges)throw"Selection must be an object with nodes and/or edges properties";if((n.unselectAll||void 0===n.unselectAll)&&this.unselectAll(),t.nodes)for(e=0;e<t.nodes.length;e++){i=t.nodes[e];var o=this.body.nodes[i];if(!o)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(o,n.highlightEdges)}if(t.edges)for(e=0;e<t.edges.length;e++){i=t.edges[e];var r=this.body.edges[i];if(!r)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(r)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({nodes:t},{highlightEdges:e})}},{key:"selectEdges",value:function(t){if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({edges:t})}},{key:"updateSelection",value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(this.body.nodes.hasOwnProperty(t)||delete this.selectionObj.nodes[t]);for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(this.body.edges.hasOwnProperty(e)||delete this.selectionObj.edges[e])}},{key:"getClickedItems",value:function(t){for(var e=this.canvas.DOMtoCanvas(t),i=[],n=this.body.nodeIndices,o=this.body.nodes,r=n.length-1;r>=0;r--){var s=o[n[r]].getItemsOnPoint(e);i.push.apply(i,s)}for(var a=this.body.edgeIndices,h=this.body.edges,d=a.length-1;d>=0;d--){var l=h[a[d]].getItemsOnPoint(e);i.push.apply(i,l)}return i}}]),t}(),Vv=[].sort,Uv=[1,2,3],Gv=h((function(){Uv.sort(void 0)})),qv=h((function(){Uv.sort(null)})),Zv=va("sort");Ct({target:"Array",proto:!0,forced:Gv||!qv||Zv},{sort:function(t){return void 0===t?Vv.call(jt(this)):Vv.call(jt(this),Xe(t))}});var Xv,$v=i((function(t,e){!function(t){t.__esModule=!0,t.sort=function(t,i,n,o){if(!Array.isArray(t))throw new TypeError("Can only sort arrays");i?"function"!=typeof i&&(o=n,n=i,i=s):i=s,n||(n=0),o||(o=t.length);var r=o-n;if(!(r<2)){var d=0;if(r<e)return d=a(t,n,o,i),void h(t,n,o,n+d,i);var l=new u(t,i),c=function(t){for(var i=0;t>=e;)i|=1&t,t>>=1;return t+i}(r);do{if((d=a(t,n,o,i))<c){var f=r;f>c&&(f=c),h(t,n,n+f,n+d,i),d=f}l.pushRun(n,d),l.mergeRuns(),r-=d,n+=d}while(0!==r);l.forceMergeRuns()}};var e=32,i=7,n=256,o=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function r(t){return t<1e5?t<100?t<10?0:1:t<1e4?t<1e3?2:3:4:t<1e7?t<1e6?5:6:t<1e9?t<1e8?7:8:9}function s(t,e){if(t===e)return 0;if(~~t===t&&~~e===e){if(0===t||0===e)return t<e?-1:1;if(t<0||e<0){if(e>=0)return-1;if(t>=0)return 1;t=-t,e=-e}var i=r(t),n=r(e),s=0;return i<n?(t*=o[n-i-1],e/=10,s=-1):i>n&&(e*=o[i-n-1],t/=10,s=1),t===e?s:t<e?-1:1}var a=String(t),h=String(e);return a===h?0:a<h?-1:1}function a(t,e,i,n){var o=e+1;if(o===i)return 1;if(n(t[o++],t[e])<0){for(;o<i&&n(t[o],t[o-1])<0;)o++;!function(t,e,i){for(i--;e<i;){var n=t[e];t[e++]=t[i],t[i--]=n}}(t,e,o)}else for(;o<i&&n(t[o],t[o-1])>=0;)o++;return o-e}function h(t,e,i,n,o){for(n===e&&n++;n<i;n++){for(var r=t[n],s=e,a=n;s<a;){var h=s+a>>>1;o(r,t[h])<0?a=h:s=h+1}var d=n-s;switch(d){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;d>0;)t[s+d]=t[s+d-1],d--}t[s]=r}}function d(t,e,i,n,o,r){var s=0,a=0,h=1;if(r(t,e[i+o])>0){for(a=n-o;h<a&&r(t,e[i+o+h])>0;)s=h,(h=1+(h<<1))<=0&&(h=a);h>a&&(h=a),s+=o,h+=o}else{for(a=o+1;h<a&&r(t,e[i+o-h])<=0;)s=h,(h=1+(h<<1))<=0&&(h=a);h>a&&(h=a);var d=s;s=o-h,h=o-d}for(s++;s<h;){var l=s+(h-s>>>1);r(t,e[i+l])>0?s=l+1:h=l}return h}function l(t,e,i,n,o,r){var s=0,a=0,h=1;if(r(t,e[i+o])<0){for(a=o+1;h<a&&r(t,e[i+o-h])<0;)s=h,(h=1+(h<<1))<=0&&(h=a);h>a&&(h=a);var d=s;s=o-h,h=o-d}else{for(a=n-o;h<a&&r(t,e[i+o+h])>=0;)s=h,(h=1+(h<<1))<=0&&(h=a);h>a&&(h=a),s+=o,h+=o}for(s++;s<h;){var l=s+(h-s>>>1);r(t,e[i+l])<0?h=l:s=l+1}return h}var u=function(){function t(e,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.array=null,this.compare=null,this.minGallop=i,this.length=0,this.tmpStorageLength=n,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=e,this.compare=o,this.length=e.length,this.length<2*n&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength)}return t.prototype.pushRun=function(t,e){this.runStart[this.stackSize]=t,this.runLength[this.stackSize]=e,this.stackSize+=1},t.prototype.mergeRuns=function(){for(;this.stackSize>1;){var t=this.stackSize-2;if(t>=1&&this.runLength[t-1]<=this.runLength[t]+this.runLength[t+1]||t>=2&&this.runLength[t-2]<=this.runLength[t]+this.runLength[t-1])this.runLength[t-1]<this.runLength[t+1]&&t--;else if(this.runLength[t]>this.runLength[t+1])break;this.mergeAt(t)}},t.prototype.forceMergeRuns=function(){for(;this.stackSize>1;){var t=this.stackSize-2;t>0&&this.runLength[t-1]<this.runLength[t+1]&&t--,this.mergeAt(t)}},t.prototype.mergeAt=function(t){var e=this.compare,i=this.array,n=this.runStart[t],o=this.runLength[t],r=this.runStart[t+1],s=this.runLength[t+1];this.runLength[t]=o+s,t===this.stackSize-3&&(this.runStart[t+1]=this.runStart[t+2],this.runLength[t+1]=this.runLength[t+2]),this.stackSize--;var a=l(i[r],i,n,o,0,e);n+=a,0!=(o-=a)&&0!==(s=d(i[n+o-1],i,r,s,s-1,e))&&(o<=s?this.mergeLow(n,o,r,s):this.mergeHigh(n,o,r,s))},t.prototype.mergeLow=function(t,e,n,o){var r=this.compare,s=this.array,a=this.tmp,h=0;for(h=0;h<e;h++)a[h]=s[t+h];var u=0,c=n,f=t;if(s[f++]=s[c++],0!=--o)if(1!==e){for(var p=this.minGallop;;){var v=0,g=0,y=!1;do{if(r(s[c],a[u])<0){if(s[f++]=s[c++],g++,v=0,0==--o){y=!0;break}}else if(s[f++]=a[u++],v++,g=0,1==--e){y=!0;break}}while((v|g)<p);if(y)break;do{if(0!==(v=l(s[c],a,u,e,0,r))){for(h=0;h<v;h++)s[f+h]=a[u+h];if(f+=v,u+=v,(e-=v)<=1){y=!0;break}}if(s[f++]=s[c++],0==--o){y=!0;break}if(0!==(g=d(a[u],s,c,o,0,r))){for(h=0;h<g;h++)s[f+h]=s[c+h];if(f+=g,c+=g,0==(o-=g)){y=!0;break}}if(s[f++]=a[u++],1==--e){y=!0;break}p--}while(v>=i||g>=i);if(y)break;p<0&&(p=0),p+=2}if(this.minGallop=p,p<1&&(this.minGallop=1),1===e){for(h=0;h<o;h++)s[f+h]=s[c+h];s[f+o]=a[u]}else{if(0===e)throw new Error("mergeLow preconditions were not respected");for(h=0;h<e;h++)s[f+h]=a[u+h]}}else{for(h=0;h<o;h++)s[f+h]=s[c+h];s[f+o]=a[u]}else for(h=0;h<e;h++)s[f+h]=a[u+h]},t.prototype.mergeHigh=function(t,e,n,o){var r=this.compare,s=this.array,a=this.tmp,h=0;for(h=0;h<o;h++)a[h]=s[n+h];var u=t+e-1,c=o-1,f=n+o-1,p=0,v=0;if(s[f--]=s[u--],0!=--e)if(1!==o){for(var g=this.minGallop;;){var y=0,m=0,b=!1;do{if(r(a[c],s[u])<0){if(s[f--]=s[u--],y++,m=0,0==--e){b=!0;break}}else if(s[f--]=a[c--],m++,y=0,1==--o){b=!0;break}}while((y|m)<g);if(b)break;do{if(0!=(y=e-l(a[c],s,t,e,e-1,r))){for(e-=y,v=1+(f-=y),p=1+(u-=y),h=y-1;h>=0;h--)s[v+h]=s[p+h];if(0===e){b=!0;break}}if(s[f--]=a[c--],1==--o){b=!0;break}if(0!=(m=o-d(s[u],a,0,o,o-1,r))){for(o-=m,v=1+(f-=m),p=1+(c-=m),h=0;h<m;h++)s[v+h]=a[p+h];if(o<=1){b=!0;break}}if(s[f--]=s[u--],0==--e){b=!0;break}g--}while(y>=i||m>=i);if(b)break;g<0&&(g=0),g+=2}if(this.minGallop=g,g<1&&(this.minGallop=1),1===o){for(v=1+(f-=e),p=1+(u-=e),h=e-1;h>=0;h--)s[v+h]=s[p+h];s[f]=a[c]}else{if(0===o)throw new Error("mergeHigh preconditions were not respected");for(p=f-(o-1),h=0;h<o;h++)s[p+h]=a[h]}}else{for(v=1+(f-=e),p=1+(u-=e),h=e-1;h>=0;h--)s[v+h]=s[p+h];s[f]=a[c]}else for(p=f-(o-1),h=0;h<o;h++)s[p+h]=a[h]},t}()}(e)}));(Xv=$v)&&Xv.__esModule&&Object.prototype.hasOwnProperty.call(Xv,"default")&&Xv.default;var Kv=$v,Jv=Kv.sort,Qv=function(){function t(){Bu(this,t)}return Wu(t,[{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(t){return this.fake_use(t),this.abstract()}},{key:"setPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(t,e,i),this.abstract()}},{key:"getTreeSize",value:function(t){return this.fake_use(t),this.abstract()}},{key:"sort",value:function(t){this.fake_use(t),this.abstract()}},{key:"fix",value:function(t,e){this.fake_use(t,e),this.abstract()}},{key:"shift",value:function(t,e){this.fake_use(t,e),this.abstract()}}]),t}(),tg=function(t){function e(t){var i;return Bu(this,e),(i=$u(this,Zu(e).call(this))).layout=t,i}return qu(e,Qv),Wu(e,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(t){return t.x}},{key:"setPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(t,i),t.x=e}},{key:"getTreeSize",value:function(t){var e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,t);return{min:e.min_x,max:e.max_x}}},{key:"sort",value:function(t){Jv(t,(function(t,e){return t.x-e.x}))}},{key:"fix",value:function(t,e){t.y=this.layout.options.hierarchical.levelSeparation*e,t.options.fixed.y=!0}},{key:"shift",value:function(t,e){this.layout.body.nodes[t].x+=e}}]),e}(),eg=function(t){function e(t){var i;return Bu(this,e),(i=$u(this,Zu(e).call(this))).layout=t,i}return qu(e,Qv),Wu(e,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(t){return t.y}},{key:"setPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(t,i),t.y=e}},{key:"getTreeSize",value:function(t){var e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,t);return{min:e.min_y,max:e.max_y}}},{key:"sort",value:function(t){Jv(t,(function(t,e){return t.y-e.y}))}},{key:"fix",value:function(t,e){t.x=this.layout.options.hierarchical.levelSeparation*e,t.options.fixed.x=!0}},{key:"shift",value:function(t,e){this.layout.body.nodes[t].y+=e}}]),e}(),ig=mt.f,ng={}.toString,og="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],rg={f:function(t){return og&&"[object Window]"==ng.call(t)?function(t){try{return ig(t)}catch(t){return og.slice()}}(t):ig(b(t))}},sg={f:Ft},ag=I.f,hg=function(t){var e=et.Symbol||(et.Symbol={});x(e,t)||ag(e,t,{value:sg.f(t)})},dg=pa.forEach,lg=V("hidden"),ug=Ft("toPrimitive"),cg=Q.set,fg=Q.getterFor("Symbol"),pg=Object.prototype,vg=a.Symbol,gg=a.JSON,yg=gg&&gg.stringify,mg=T.f,bg=I.f,_g=rg.f,wg=c.f,kg=R("symbols"),xg=R("op-symbols"),Sg=R("string-to-symbol-registry"),Og=R("symbol-to-string-registry"),Dg=R("wks"),Mg=a.QObject,Eg=!Mg||!Mg.prototype||!Mg.prototype.findChild,Tg=d&&h((function(){return 7!=Sa(bg({},"a",{get:function(){return bg(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=mg(pg,e);n&&delete pg[e],bg(t,e,i),n&&t!==pg&&bg(pg,e,n)}:bg,Cg=function(t,e){var i=kg[t]=Sa(vg.prototype);return cg(i,{type:"Symbol",tag:t,description:e}),d||(i.description=e),i},Pg=Pt&&"symbol"==typeof vg.iterator?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof vg},Ig=function(t,e,i){t===pg&&Ig(xg,e,i),C(t);var n=w(e,!0);return C(i),x(kg,n)?(i.enumerable?(x(t,lg)&&t[lg][n]&&(t[lg][n]=!1),i=Sa(i,{enumerable:f(0,!1)})):(x(t,lg)||bg(t,lg,f(1,{})),t[lg][n]=!0),Tg(t,n,i)):bg(t,n,i)},Ng=function(t,e){C(t);var i=b(e),n=ma(i).concat(Yg(i));return dg(n,(function(e){d&&!Fg.call(i,e)||Ig(t,e,i[e])})),t},Fg=function(t){var e=w(t,!0),i=wg.call(this,e);return!(this===pg&&x(kg,e)&&!x(xg,e))&&(!(i||!x(this,e)||!x(kg,e)||x(this,lg)&&this[lg][e])||i)},Ag=function(t,e){var i=b(t),n=w(e,!0);if(i!==pg||!x(kg,n)||x(xg,n)){var o=mg(i,n);return!o||!x(kg,n)||x(i,lg)&&i[lg][n]||(o.enumerable=!0),o}},Rg=function(t){var e=_g(b(t)),i=[];return dg(e,(function(t){x(kg,t)||x(U,t)||i.push(t)})),i},Yg=function(t){var e=t===pg,i=_g(e?xg:b(t)),n=[];return dg(i,(function(t){!x(kg,t)||e&&!x(pg,t)||n.push(kg[t])})),n};Pt||(tt((vg=function(){if(this instanceof vg)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=H(t),i=function(t){this===pg&&i.call(xg,t),x(this,lg)&&x(this[lg],e)&&(this[lg][e]=!1),Tg(this,e,f(1,t))};return d&&Eg&&Tg(pg,e,{configurable:!0,set:i}),Cg(e,t)}).prototype,"toString",(function(){return fg(this).tag})),c.f=Fg,I.f=Ig,T.f=Ag,mt.f=rg.f=Rg,bt.f=Yg,d&&(bg(vg.prototype,"description",{configurable:!0,get:function(){return fg(this).description}}),tt(pg,"propertyIsEnumerable",Fg,{unsafe:!0})),sg.f=function(t){return Cg(Ft(t),t)}),Ct({global:!0,wrap:!0,forced:!Pt,sham:!Pt},{Symbol:vg}),dg(ma(Dg),(function(t){hg(t)})),Ct({target:"Symbol",stat:!0,forced:!Pt},{for:function(t){var e=String(t);if(x(Sg,e))return Sg[e];var i=vg(e);return Sg[e]=i,Og[i]=e,i},keyFor:function(t){if(!Pg(t))throw TypeError(t+" is not a symbol");if(x(Og,t))return Og[t]},useSetter:function(){Eg=!0},useSimple:function(){Eg=!1}}),Ct({target:"Object",stat:!0,forced:!Pt,sham:!d},{create:function(t,e){return void 0===e?Sa(t):Ng(Sa(t),e)},defineProperty:Ig,defineProperties:Ng,getOwnPropertyDescriptor:Ag}),Ct({target:"Object",stat:!0,forced:!Pt},{getOwnPropertyNames:Rg,getOwnPropertySymbols:Yg}),Ct({target:"Object",stat:!0,forced:h((function(){bt.f(1)}))},{getOwnPropertySymbols:function(t){return bt.f(jt(t))}}),gg&&Ct({target:"JSON",stat:!0,forced:!Pt||h((function(){var t=vg();return"[null]"!=yg([t])||"{}"!=yg({a:t})||"{}"!=yg(Object(t))}))},{stringify:function(t){for(var e,i,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);if(i=e=n[1],(_(e)||void 0!==t)&&!Pg(t))return da(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!Pg(e))return e}),n[1]=e,yg.apply(gg,n)}}),vg.prototype[ug]||N(vg.prototype,ug,vg.prototype.valueOf),ve(vg,"Symbol"),U[lg]=!0;var jg=I.f,zg=a.Symbol;if(d&&"function"==typeof zg&&(!("description"in zg.prototype)||void 0!==zg().description)){var Lg={},Bg=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof Bg?new zg(t):void 0===t?zg():zg(t);return""===t&&(Lg[e]=!0),e};wt(Bg,zg);var Hg=Bg.prototype=zg.prototype;Hg.constructor=Bg;var Wg=Hg.toString,Vg="Symbol(test)"==String(zg("test")),Ug=/^Symbol\((.*)\)[^)]+$/;jg(Hg,"description",{configurable:!0,get:function(){var t=_(this)?this.valueOf():this,e=Wg.call(t);if(x(Lg,t))return"";var i=Vg?e.slice(7,-1):e.replace(Ug,"$1");return""===i?void 0:i}}),Ct({global:!0,forced:!0},{Symbol:Bg})}hg("iterator");var Gg=pa.every;Ct({target:"Array",proto:!0,forced:va("every")},{every:function(t){return Gg(this,t,arguments.length>1?arguments[1]:void 0)}});var qg=pa.filter;Ct({target:"Array",proto:!0,forced:!Ha("filter")},{filter:function(t){return qg(this,t,arguments.length>1?arguments[1]:void 0)}});var Zg=!h((function(){return Object.isExtensible(Object.preventExtensions({}))})),Xg=i((function(t){var e=I.f,i=H("meta"),n=0,o=Object.isExtensible||function(){return!0},r=function(t){e(t,i,{value:{objectID:"O"+ ++n,weakData:{}}})},s=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!_(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!x(t,i)){if(!o(t))return"F";if(!e)return"E";r(t)}return t[i].objectID},getWeakData:function(t,e){if(!x(t,i)){if(!o(t))return!0;if(!e)return!1;r(t)}return t[i].weakData},onFreeze:function(t){return Zg&&s.REQUIRED&&o(t)&&!x(t,i)&&r(t),t}};U[i]=!0})),$g=(Xg.REQUIRED,Xg.fastKey,Xg.getWeakData,Xg.onFreeze,Ft("iterator")),Kg=Array.prototype,Jg=Ft("iterator"),Qg=function(t,e,i,n){try{return n?e(C(i)[0],i[1]):e(i)}catch(e){var o=t.return;throw void 0!==o&&C(o.call(t)),e}},ty=i((function(t){var e=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,i,n,o,r){var s,a,h,d,l,u,c,f,p=ha(i,n,o?2:1);if(r)s=t;else{if("function"!=typeof(a=function(t){if(null!=t)return t[Jg]||t["@@iterator"]||Vf[Yt(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(f=a)&&(Vf.Array===f||Kg[$g]===f)){for(h=0,d=ht(t.length);d>h;h++)if((l=o?p(C(c=t[h])[0],c[1]):p(t[h]))&&l instanceof e)return l;return new e(!1)}s=a.call(t)}for(u=s.next;!(c=u.call(s)).done;)if("object"==typeof(l=Qg(s,p,c.value,o))&&l&&l instanceof e)return l;return new e(!1)}).stop=function(t){return new e(!0,t)}})),ey=Ft("iterator"),iy=!1;try{var ny=0,oy={next:function(){return{done:!!ny++}},return:function(){iy=!0}};oy[ey]=function(){return this},Array.from(oy,(function(){throw 2}))}catch(t){}var ry=I.f,sy=Xg.fastKey,ay=Q.set,hy=Q.getterFor,dy=(function(t,e,i,n,o){var r=a[t],s=r&&r.prototype,d=r,l=n?"set":"add",u={},c=function(t){var e=s[t];tt(s,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!_(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return o&&!_(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!_(t))&&e.call(this,0===t?0:t)}:function(t,i){return e.call(this,0===t?0:t,i),this})};if(Et(t,"function"!=typeof r||!(o||s.forEach&&!h((function(){(new r).entries().next()})))))d=i.getConstructor(e,t,n,l),Xg.REQUIRED=!0;else if(Et(t,!0)){var f=new d,p=f[l](o?{}:-0,1)!=f,v=h((function(){f.has(1)})),g=function(t,e){if(!e&&!iy)return!1;var i=!1;try{var n={};n[ey]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i}((function(t){new r(t)})),y=!o&&h((function(){for(var t=new r,e=5;e--;)t[l](e,e);return!t.has(-0)}));g||((d=e((function(e,i){le(e,d,t);var o=Xa(new r,e,d);return null!=i&&ty(i,o[l],o,n),o}))).prototype=s,s.constructor=d),(v||y)&&(c("delete"),c("has"),n&&c("get")),(y||p)&&c(l),o&&s.clear&&delete s.clear}u[t]=d,Ct({global:!0,forced:d!=r},u),ve(d,t),o||i.setStrong(d,t,n)}("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,e,i,n){var o=t((function(t,r){le(t,o,e),ay(t,{type:e,index:Sa(null),first:void 0,last:void 0,size:0}),d||(t.size=0),null!=r&&ty(r,t[n],t,i)})),r=hy(e),s=function(t,e,i){var n,o,s=r(t),h=a(t,e);return h?h.value=i:(s.last=h={index:o=sy(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=h),n&&(n.next=h),d?s.size++:t.size++,"F"!==o&&(s.index[o]=h)),t},a=function(t,e){var i,n=r(t),o=sy(e);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key==e)return i};return de(o.prototype,{clear:function(){for(var t=r(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,d?t.size=0:this.size=0},delete:function(t){var e=r(this),i=a(this,t);if(i){var n=i.next,o=i.previous;delete e.index[i.index],i.removed=!0,o&&(o.next=n),n&&(n.previous=o),e.first==i&&(e.first=n),e.last==i&&(e.last=o),d?e.size--:this.size--}return!!i},forEach:function(t){for(var e,i=r(this),n=ha(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!a(this,t)}}),de(o.prototype,i?{get:function(t){var e=a(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),d&&ry(o.prototype,"size",{get:function(){return r(this).size}}),o},setStrong:function(t,e,i){var n=e+" Iterator",o=hy(e),r=hy(n);tp(t,e,(function(t,e){ay(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=r(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?"keys"==e?{value:i.key,done:!1}:"values"==e?{value:i.value,done:!1}:{value:[i.key,i.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),i?"entries":"values",!i,!0),Sf(e)}}),Ch.charAt),ly=Q.set,uy=Q.getterFor("String Iterator");function cy(t,e){var i=new Set;return t.forEach((function(t){t.edges.forEach((function(t){t.connected&&i.add(t)}))})),i.forEach((function(t){var i=t.from.id,n=t.to.id;null==e[i]&&(e[i]=0),(null==e[n]||e[i]>=e[n])&&(e[n]=e[i]+1)})),e}function fy(t,e,i,n,o){var r=n.length,s=i+"Id",a="to"===i?1:-1,h=!0,d=!1,l=void 0;try{for(var u,c=function(){var h=u.value;if(t(h))return"continue";o[h.id]=0;for(var d=[h],l=0,c=void 0,f=function(){var t=o[c.id]+a;if(c.edges.filter((function(t){return t.connected&&t.to!==t.from&&t[i]!==c})).forEach((function(n){var r=n[s],a=o[r];(null==a||e(t,a))&&(o[r]=t,d.push(n[i]))})),l>r)return{v:{v:cy(n,o)}};++l};c=d.pop();){var p=f();if("object"===Lu(p))return p.v}},f=n[Symbol.iterator]();!(h=(u=f.next()).done);h=!0){var p=c();switch(p){case"continue":continue;default:if("object"===Lu(p))return p.v}}}catch(t){d=!0,l=t}finally{try{h||null==f.return||f.return()}finally{if(d)throw l}}return o}tp(String,"String",(function(t){ly(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=uy(this),i=e.string,n=e.index;return n>=i.length?{value:void 0,done:!0}:(t=dy(i,n),e.index+=t.length,{value:t,done:!1})}));var py=function(){function t(){Bu(this,t),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return Wu(t,[{key:"addRelation",value:function(t,e){void 0===this.childrenReference[t]&&(this.childrenReference[t]=[]),this.childrenReference[t].push(e),void 0===this.parentReference[e]&&(this.parentReference[e]=[]),this.parentReference[e].push(t)}},{key:"checkIfTree",value:function(){for(var t in this.parentReference)if(this.parentReference[t].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(t,e){void 0!==e&&void 0===this.trees[t.id]&&(this.trees[t.id]=e,this.treeIndex=Math.max(e,this.treeIndex))}},{key:"ensureLevel",value:function(t){void 0===this.levels[t]&&(this.levels[t]=0)}},{key:"getMaxLevel",value:function(t){var e=this,i={};return function t(n){if(void 0!==i[n])return i[n];var o=e.levels[n];if(e.childrenReference[n]){var r=e.childrenReference[n];if(r.length>0)for(var s=0;s<r.length;s++)o=Math.max(o,t(r[s]))}return i[n]=o,o}(t)}},{key:"levelDownstream",value:function(t,e){void 0===this.levels[e.id]&&(void 0===this.levels[t.id]&&(this.levels[t.id]=0),this.levels[e.id]=this.levels[t.id]+1)}},{key:"setMinLevelToZero",value:function(t){var e=1e9;for(var i in t)t.hasOwnProperty(i)&&void 0!==this.levels[i]&&(e=Math.min(this.levels[i],e));for(var n in t)t.hasOwnProperty(n)&&void 0!==this.levels[n]&&(this.levels[n]-=e)}},{key:"getTreeSize",value:function(t,e){var i=1e9,n=-1e9,o=1e9,r=-1e9;for(var s in this.trees)if(this.trees.hasOwnProperty(s)&&this.trees[s]===e){var a=t[s];i=Math.min(a.x,i),n=Math.max(a.x,n),o=Math.min(a.y,o),r=Math.max(a.y,r)}return{min_x:i,max_x:n,min_y:o,max_y:r}}},{key:"hasSameParent",value:function(t,e){var i=this.parentReference[t.id],n=this.parentReference[e.id];if(void 0===i||void 0===n)return!1;for(var o=0;o<i.length;o++)for(var r=0;r<n.length;r++)if(i[o]==n[r])return!0;return!1}},{key:"inSameSubNetwork",value:function(t,e){return this.trees[t.id]===this.trees[e.id]}},{key:"getLevels",value:function(){return Object.keys(this.distributionOrdering)}},{key:"addToOrdering",value:function(t,e){void 0===this.distributionOrdering[e]&&(this.distributionOrdering[e]=[]);var i=!1,n=this.distributionOrdering[e];for(var o in n)if(n[o]===t){i=!0;break}i||(this.distributionOrdering[e].push(t),this.distributionIndex[t.id]=this.distributionOrdering[e].length-1)}}]),t}(),vy=function(){function t(e){Bu(this,t),this.body=e,this.initialRandomSeed=Math.round(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"}},cs(this.options,this.defaultOptions),this.bindEventListeners()}return Wu(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("_dataChanged",(function(){t.setupHierarchicalLayout()})),this.body.emitter.on("_dataLoaded",(function(){t.layoutNetwork()})),this.body.emitter.on("_resetHierarchicalLayout",(function(){t.setupHierarchicalLayout()})),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",(function(){if(!0===t.options.hierarchical.enabled){var e=t.direction.curveType();t.body.emitter.emit("_forceDisableDynamicCurves",e,!1)}}))}},{key:"setOptions",value:function(t,e){if(void 0!==t){var i=this.options.hierarchical,n=i.enabled;if(ps(["randomSeed","improvedLayout","clusterThreshold"],this.options,t),ta(this.options,t,"hierarchical"),void 0!==t.randomSeed&&(this.initialRandomSeed=t.randomSeed),!0===i.enabled)return!0===n&&this.body.emitter.emit("refresh",!0),"RL"===i.direction||"DU"===i.direction?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(!0===n)return this.body.emitter.emit("refresh"),gs(e,this.optionsBackup)}return e}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(t){if(!0===this.options.hierarchical.enabled){var e=this.optionsBackup.physics;void 0===t.physics||!0===t.physics?(t.physics={enabled:void 0===e.enabled||e.enabled,solver:"hierarchicalRepulsion"},e.enabled=void 0===e.enabled||e.enabled,e.solver=e.solver||"barnesHut"):"object"===Lu(t.physics)?(e.enabled=void 0===t.physics.enabled||t.physics.enabled,e.solver=t.physics.solver||"barnesHut",t.physics.solver="hierarchicalRepulsion"):!1!==t.physics&&(e.solver="barnesHut",t.physics={solver:"hierarchicalRepulsion"});var i=this.direction.curveType();if(void 0===t.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1};else if(void 0===t.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1;else if("boolean"==typeof t.edges.smooth)this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:i};else{var n=t.edges.smooth;void 0!==n.type&&"dynamic"!==n.type&&(i=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},t.edges.smooth={enabled:void 0===n.enabled||n.enabled,type:i,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return t}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"positionInitially",value:function(t){if(!0!==this.options.hierarchical.enabled){this.randomSeed=this.initialRandomSeed;for(var e=t.length+50,i=0;i<t.length;i++){var n=t[i],o=2*Math.PI*this.seededRandom();void 0===n.x&&(n.x=e*Math.cos(o)),void 0===n.y&&(n.y=e*Math.sin(o))}}}},{key:"layoutNetwork",value:function(){if(!0!==this.options.hierarchical.enabled&&!0===this.options.improvedLayout){for(var t=this.body.nodeIndices,e=0,i=0;i<t.length;i++){!0===this.body.nodes[t[i]].predefinedPosition&&(e+=1)}if(e<.5*t.length){var n=0,o=this.options.clusterThreshold,r={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(t.length>o){for(var s=t.length;t.length>o&&n<=10;){n+=1;var a=t.length;if(n%3==0?this.body.modules.clustering.clusterBridges(r):this.body.modules.clustering.clusterOutliers(r),a==t.length&&n%3!=0)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:Math.max(150,2*s)})}n>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(t,this.body.edgeIndices,!0),this._shiftToCenter();for(var h=0;h<t.length;h++){var d=this.body.nodes[t[h]];!1===d.predefinedPosition&&(d.x+=70*(.5-this.seededRandom()),d.y+=70*(.5-this.seededRandom()))}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var t=Pv.getRangeCore(this.body.nodes,this.body.nodeIndices),e=Pv.findCenter(t),i=0;i<this.body.nodeIndices.length;i++){var n=this.body.nodes[this.body.nodeIndices[i]];n.x-=e.x,n.y-=e.y}}},{key:"_declusterAll",value:function(){for(var t=!0;!0===t;){t=!1;for(var e=0;e<this.body.nodeIndices.length;e++)!0===this.body.nodes[this.body.nodeIndices[e]].isCluster&&(t=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[e],{},!1));!0===t&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(!0===this.options.hierarchical.enabled&&this.body.nodeIndices.length>0){var t,e,i=!1,n=!1;for(e in this.lastNodeOnLevel={},this.hierarchical=new py,this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(void 0!==(t=this.body.nodes[e]).options.level?(i=!0,this.hierarchical.levels[e]=t.options.level):n=!0);if(!0===n&&!0===i)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===n){var o=this.options.hierarchical.sortMethod;"hubsize"===o?this._determineLevelsByHubsize():"directed"===o?this._determineLevelsDirected():"custom"===o&&this._determineLevelsCustomCallback()}for(var r in this.body.nodes)this.body.nodes.hasOwnProperty(r)&&this.hierarchical.ensureLevel(r);var s=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(s),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var t=this,e=!1,i={},n=function(e,i){var n=t.hierarchical.trees;for(var o in n)n.hasOwnProperty(o)&&n[o]===e&&t.direction.shift(o,i)},o=function(){for(var e=[],i=0;i<t.hierarchical.numTrees();i++)e.push(t.direction.getTreeSize(i));return e},r=function e(i,n){if(!n[i.id]&&(n[i.id]=!0,t.hierarchical.childrenReference[i.id])){var o=t.hierarchical.childrenReference[i.id];if(o.length>0)for(var r=0;r<o.length;r++)e(t.body.nodes[o[r]],n)}},s=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e9,n=1e9,o=1e9,r=1e9,s=-1e9;for(var a in e)if(e.hasOwnProperty(a)){var h=t.body.nodes[a],d=t.hierarchical.levels[h.id],l=t.direction.getPosition(h),u=t._getSpaceAroundNode(h,e),c=Qu(u,2),f=c[0],p=c[1];n=Math.min(f,n),o=Math.min(p,o),d<=i&&(r=Math.min(l,r),s=Math.max(l,s))}return[r,s,n,o]},a=function(e,i){var n=t.hierarchical.getMaxLevel(e.id),o=t.hierarchical.getMaxLevel(i.id);return Math.min(n,o)},h=function(e,i,n){for(var o=t.hierarchical,r=0;r<i.length;r++){var s=i[r],a=o.distributionOrdering[s];if(a.length>1)for(var h=0;h<a.length-1;h++){var d=a[h],l=a[h+1];o.hasSameParent(d,l)&&o.inSameSubNetwork(d,l)&&e(d,l,n)}}},d=function(i,n){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=t.direction.getPosition(i),d=t.direction.getPosition(n),l=Math.abs(d-h),u=t.options.hierarchical.nodeSpacing;if(l>u){var c={},f={};r(i,c),r(n,f);var p=a(i,n),v=s(c,p),g=s(f,p),y=v[1],m=g[0],b=g[2],_=Math.abs(y-m);if(_>u){var w=y-m+u;w<-b+u&&(w=-b+u),w<0&&(t._shiftBlock(n.id,w),e=!0,!0===o&&t._centerParent(n))}}},l=function(n,o){for(var a=o.id,h=o.edges,d=t.hierarchical.levels[o.id],l=t.options.hierarchical.levelSeparation*t.options.hierarchical.levelSeparation,u={},c=[],f=0;f<h.length;f++){var p=h[f];if(p.toId!=p.fromId){var v=p.toId==a?p.from:p.to;u[h[f].id]=v,t.hierarchical.levels[v.id]<d&&c.push(p)}}var g=function(e,i){for(var n=0,o=0;o<i.length;o++)if(void 0!==u[i[o].id]){var r=t.direction.getPosition(u[i[o].id])-e;n+=r/Math.sqrt(r*r+l)}return n},y=function(e,i){for(var n=0,o=0;o<i.length;o++)if(void 0!==u[i[o].id]){var r=t.direction.getPosition(u[i[o].id])-e;n-=l*Math.pow(r*r+l,-1.5)}return n},m=function(e,i){for(var n=t.direction.getPosition(o),r={},s=0;s<e;s++){var a=g(n,i),h=y(n,i);if(void 0!==r[n-=Math.max(-40,Math.min(40,Math.round(a/h)))])break;r[n]=s}return n},b=m(n,c);!function(n){var a=t.direction.getPosition(o);if(void 0===i[o.id]){var h={};r(o,h),i[o.id]=h}var d=s(i[o.id]),l=d[2],u=d[3],c=n-a,f=0;c>0?f=Math.min(c,u-t.options.hierarchical.nodeSpacing):c<0&&(f=-Math.min(-c,l-t.options.hierarchical.nodeSpacing)),0!=f&&(t._shiftBlock(o.id,f),e=!0)}(b),function(i){var n=t.direction.getPosition(o),r=Qu(t._getSpaceAroundNode(o),2),s=r[0],a=r[1],h=i-n,d=n;h>0?d=Math.min(n+(a-t.options.hierarchical.nodeSpacing),i):h<0&&(d=Math.max(n-(s-t.options.hierarchical.nodeSpacing),i)),d!==n&&(t.direction.setPosition(o,d),e=!0)}(b=m(n,h))};!0===this.options.hierarchical.blockShifting&&(function(i){var n=t.hierarchical.getLevels();n=n.reverse();for(var o=0;o<i&&(e=!1,h(d,n,!0),!0===e);o++);}(5),function(){for(var e in t.body.nodes)t.body.nodes.hasOwnProperty(e)&&t._centerParent(t.body.nodes[e])}()),!0===this.options.hierarchical.edgeMinimization&&function(i){var n=t.hierarchical.getLevels();n=n.reverse();for(var o=0;o<i;o++){e=!1;for(var r=0;r<n.length;r++)for(var s=n[r],a=t.hierarchical.distributionOrdering[s],h=0;h<a.length;h++)l(1e3,a[h]);if(!0!==e)break}}(20),!0===this.options.hierarchical.parentCentralization&&function(){var e=t.hierarchical.getLevels();e=e.reverse();for(var i=0;i<e.length;i++)for(var n=e[i],o=t.hierarchical.distributionOrdering[n],r=0;r<o.length;r++)t._centerParent(o[r])}(),function(){for(var e=o(),i=0,r=0;r<e.length-1;r++){i+=e[r].max-e[r+1].min+t.options.hierarchical.treeSpacing,n(r+1,i)}}()}},{key:"_getSpaceAroundNode",value:function(t,e){var i=!0;void 0===e&&(i=!1);var n=this.hierarchical.levels[t.id];if(void 0!==n){var o=this.hierarchical.distributionIndex[t.id],r=this.direction.getPosition(t),s=this.hierarchical.distributionOrdering[n],a=1e9,h=1e9;if(0!==o){var d=s[o-1];if(!0===i&&void 0===e[d.id]||!1===i)a=r-this.direction.getPosition(d)}if(o!=s.length-1){var l=s[o+1];if(!0===i&&void 0===e[l.id]||!1===i){var u=this.direction.getPosition(l);h=Math.min(h,u-r)}}return[a,h]}return[0,0]}},{key:"_centerParent",value:function(t){if(this.hierarchical.parentReference[t.id])for(var e=this.hierarchical.parentReference[t.id],i=0;i<e.length;i++){var n=e[i],o=this.body.nodes[n],r=this.hierarchical.childrenReference[n];if(void 0!==r){var s=this._getCenterPosition(r),a=this.direction.getPosition(o),h=Qu(this._getSpaceAroundNode(o),2),d=h[0],l=h[1],u=a-s;(u<0&&Math.abs(u)<l-this.options.hierarchical.nodeSpacing||u>0&&Math.abs(u)<d-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,s)}}}},{key:"_placeNodesByHierarchy",value:function(t){for(var e in this.positionedNodes={},t)if(t.hasOwnProperty(e)){var i=Object.keys(t[e]);i=this._indexArrayToNodes(i),this.direction.sort(i);for(var n=0,o=0;o<i.length;o++){var r=i[o];if(void 0===this.positionedNodes[r.id]){var s=this.options.hierarchical.nodeSpacing,a=s*n;n>0&&(a=this.direction.getPosition(i[o-1])+s),this.direction.setPosition(r,a,e),this._validatePositionAndContinue(r,e,a),n++}}}}},{key:"_placeBranchNodes",value:function(t,e){var i=this.hierarchical.childrenReference[t];if(void 0!==i){for(var n=[],o=0;o<i.length;o++)n.push(this.body.nodes[i[o]]);this.direction.sort(n);for(var r=0;r<n.length;r++){var s=n[r],a=this.hierarchical.levels[s.id];if(!(a>e&&void 0===this.positionedNodes[s.id]))return;var h=this.options.hierarchical.nodeSpacing,d=void 0;d=0===r?this.direction.getPosition(this.body.nodes[t]):this.direction.getPosition(n[r-1])+h,this.direction.setPosition(s,d,a),this._validatePositionAndContinue(s,a,d)}var l=this._getCenterPosition(n);this.direction.setPosition(this.body.nodes[t],l,e)}}},{key:"_validatePositionAndContinue",value:function(t,e,i){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[e]){var n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[e]]);if(i-n<this.options.hierarchical.nodeSpacing){var o=n+this.options.hierarchical.nodeSpacing-i,r=this._findCommonParent(this.lastNodeOnLevel[e],t.id);this._shiftBlock(r.withChild,o)}}this.lastNodeOnLevel[e]=t.id,this.positionedNodes[t.id]=!0,this._placeBranchNodes(t.id,e)}}},{key:"_indexArrayToNodes",value:function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.body.nodes[t[i]]);return e}},{key:"_getDistribution",value:function(){var t,e,i={};for(t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){e=this.body.nodes[t];var n=void 0===this.hierarchical.levels[t]?0:this.hierarchical.levels[t];this.direction.fix(e,n),void 0===i[n]&&(i[n]={}),i[n][t]=e}return i}},{key:"_getActiveEdges",value:function(t){var e=this,i=[];return Ms(t.edges,(function(t){-1!==e.body.edgeIndices.indexOf(t.id)&&i.push(t)})),i}},{key:"_getHubSizes",value:function(){var t=this,e={};Ms(this.body.nodeIndices,(function(i){var n=t.body.nodes[i],o=t._getActiveEdges(n).length;e[o]=!0}));var i=[];return Ms(e,(function(t){i.push(Number(t))})),Kv.sort(i,(function(t,e){return e-t})),i}},{key:"_determineLevelsByHubsize",value:function(){for(var t=this,e=function(e,i){t.hierarchical.levelDownstream(e,i)},i=this._getHubSizes(),n=function(n){var o=i[n];if(0===o)return"break";Ms(t.body.nodeIndices,(function(i){var n=t.body.nodes[i];o===t._getActiveEdges(n).length&&t._crawlNetwork(e,i)}))},o=0;o<i.length;++o){if("break"===n(o))break}}},{key:"_determineLevelsCustomCallback",value:function(){var t=this;this._crawlNetwork((function(e,i,n){var o=t.hierarchical.levels[e.id];void 0===o&&(o=t.hierarchical.levels[e.id]=1e5);var r=(Pv.cloneOptions(e,"node"),Pv.cloneOptions(i,"node"),void Pv.cloneOptions(n,"edge"));t.hierarchical.levels[i.id]=o+r})),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var t=this,e=this.body.nodeIndices.map((function(e){return t.body.nodes[e]}));this.hierarchical.levels;"roots"===this.options.hierarchical.shakeTowards?this.hierarchical.levels=function(t){return fy((function(t){return!t.edges.every((function(e){return e.from===t}))}),(function(t,e){return e<t}),"to",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null))}(e,this.hierarchical.levels):this.hierarchical.levels=function(t){return fy((function(t){return!t.edges.every((function(e){return e.to===t}))}),(function(t,e){return e>t}),"from",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null))}(e,this.hierarchical.levels),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var t=this;this._crawlNetwork((function(e,i){t.hierarchical.levels[i.id]>t.hierarchical.levels[e.id]&&t.hierarchical.addRelation(e.id,i.id)})),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments.length>1?arguments[1]:void 0,n={},o=function i(o,r){if(void 0===n[o.id]){var s;t.hierarchical.setTreeIndex(o,r),n[o.id]=!0;for(var a=t._getActiveEdges(o),h=0;h<a.length;h++){var d=a[h];!0===d.connected&&(s=d.toId==o.id?d.from:d.to,o.id!=s.id&&(e(o,s,d),i(s,r)))}}};if(void 0===i)for(var r=0,s=0;s<this.body.nodeIndices.length;s++){var a=this.body.nodeIndices[s];if(void 0===n[a]){var h=this.body.nodes[a];o(h,r),r+=1}}else{var d=this.body.nodes[i];if(void 0===d)return void console.error("Node not found:",i);o(d)}}},{key:"_shiftBlock",value:function(t,e){var i=this,n={};!function t(o){if(!n[o]){n[o]=!0,i.direction.shift(o,e);var r=i.hierarchical.childrenReference[o];if(void 0!==r)for(var s=0;s<r.length;s++)t(r[s])}}(t)}},{key:"_findCommonParent",value:function(t,e){var i=this,n={};return function t(e,n){var o=i.hierarchical.parentReference[n];if(void 0!==o)for(var r=0;r<o.length;r++){var s=o[r];e[s]=!0,t(e,s)}}(n,t),function t(e,n){var o=i.hierarchical.parentReference[n];if(void 0!==o)for(var r=0;r<o.length;r++){var s=o[r];if(void 0!==e[s])return{foundParent:s,withChild:n};var a=t(e,s);if(null!==a.foundParent)return a}return{foundParent:null,withChild:n}}(n,e)}},{key:"setDirectionStrategy",value:function(){var t="UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction;this.direction=t?new tg(this):new eg(this)}},{key:"_getCenterPosition",value:function(t){for(var e=1e9,i=-1e9,n=0;n<t.length;n++){var o=void 0;if(void 0!==t[n].id)o=t[n];else{var r=t[n];o=this.body.nodes[r]}var s=this.direction.getPosition(o);e=Math.min(e,s),i=Math.max(i,s)}return.5*(e+i)}}]),t}(),gy=function(){function t(e,i,n,o){var r=this;Bu(this,t),this.body=e,this.canvas=i,this.selectionHandler=n,this.interactionHandler=o,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}},cs(this.options,this.defaultOptions),this.body.emitter.on("destroy",(function(){r._clean()})),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return Wu(t,[{key:"_restore",value:function(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(t,e,i){void 0!==e&&(void 0!==e.locale?this.options.locale=e.locale:this.options.locale=i.locale,void 0!==e.locales?this.options.locales=e.locales:this.options.locales=i.locales),void 0!==t&&("boolean"==typeof t?this.options.enabled=t:(this.options.enabled=!0,gs(this.options,t)),!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 t=this.selectionHandler._getSelectedNodeCount(),e=this.selectionHandler._getSelectedEdgeCount(),i=t+e,n=this.options.locales[this.options.locale],o=!1;!1!==this.options.addNode&&(this._createAddNodeButton(n),o=!0),!1!==this.options.addEdge&&(!0===o?this._createSeperator(1):o=!0,this._createAddEdgeButton(n)),1===t&&"function"==typeof this.options.editNode?(!0===o?this._createSeperator(2):o=!0,this._createEditNodeButton(n)):1===e&&0===t&&!1!==this.options.editEdge&&(!0===o?this._createSeperator(3):o=!0,this._createEditEdgeButton(n)),0!==i&&(t>0&&!1!==this.options.deleteNode?(!0===o&&this._createSeperator(4),this._createDeleteButton(n)):0===t&&!1!==this.options.deleteEdge&&(!0===o&&this._createSeperator(4),this._createDeleteButton(n))),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 t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.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 t=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var e=this.selectionHandler._getSelectedNode();if(void 0!==e){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==e.isCluster){var i=gs({},e.options,!1);if(i.x=e.x,i.y=e.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,(function(e){null!=e&&"editNode"===t.inMode&&t.body.data.nodes.getDataSet().update(e),t.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.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"!==Lu(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0===this.edgeBeingEditedId)){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 e=this.body.edges[this.edgeBeingEditedId],i=this._getNewTargetNode(e.from.x,e.from.y),n=this._getNewTargetNode(e.to.x,e.to.y);this.temporaryIds.nodes.push(i.id),this.temporaryIds.nodes.push(n.id),this.body.nodes[i.id]=i,this.body.nodeIndices.push(i.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.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(t){var o=e.edgeType.findBorderPositions(t);!1===i.selected&&(i.x=o.from.x,i.y=o.from.y),!1===n.selected&&(n.x=o.to.x,n.y=o.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{var o=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(o.from.id,o.to.id)}}},{key:"deleteSelected",value:function(){var t=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),n=void 0;if(e.length>0){for(var o=0;o<e.length;o++)if(!0===this.body.nodes[e[o]].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 i.length>0&&"function"==typeof this.options.deleteEdge&&(n=this.options.deleteEdge);if("function"==typeof n){var r={nodes:e,edges:i};if(2!==n.length)throw new Error("The function for delete does not support two arguments (data, callback)");n(r,(function(e){null!=e&&"delete"===t.inMode?(t.body.data.edges.getDataSet().remove(e.edges),t.body.data.nodes.getDataSet().remove(e.nodes),t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar()):(t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(e),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",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="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(t,e){var i=gs({},this.options.controlNodeStyle);i.id="targetNode"+Jr(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;var n=this.body.functions.createNode(i);return n.shape.boundingBox={left:t,right:t,top:e,bottom:e},n}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},rs(this.editModeDiv);var t=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-button vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindHammerToDiv(e,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(rs(this.editModeDiv),rs(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 t=0;t<this.manipulationHammers.length;t++)this.manipulationHammers[t].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),rs(this.manipulationDiv),rs(this.editModeDiv),rs(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 t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+t]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+t].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+t])}},{key:"_createAddNodeButton",value:function(t){var e=this._createButton("addNode","vis-button vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(t){var e=this._createButton("addEdge","vis-button vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(t){var e=this._createButton("editNode","vis-button vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(t){var e=this._createButton("editEdge","vis-button vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(t){var e;e=this.options.rtl?"vis-button vis-delete-rtl":"vis-button vis-delete";var i=this._createButton("delete",e,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(t){var e=this._createButton("back","vis-button vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("div"),this.manipulationDOM[t+"Div"].className=e,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=n,this.manipulationDOM[t+"Label"].innerHTML=i,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}},{key:"_createDescription",value:function(t){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",t))}},{key:"_temporaryBindEvent",value:function(t,e){this.temporaryEventFunctions.push({event:t,boundFunction:e}),this.body.emitter.on(t,e)}},{key:"_temporaryBindUI",value:function(t,e){if(void 0===this.body.eventListeners[t])throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+JSON.stringify(Object.keys(this.body.eventListeners)));this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=e}},{key:"_unbindTemporaryUIs",value:function(){for(var t in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var t=0;t<this.temporaryEventFunctions.length;t++){var e=this.temporaryEventFunctions[t].event,i=this.temporaryEventFunctions[t].boundFunction;this.body.emitter.off(e,i)}this.temporaryEventFunctions=[]}},{key:"_bindHammerToDiv",value:function(t,e){var i=new Au(t,{});Av.onTouch(i,e),this.manipulationHammers.push(i)}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var t=0;t<this.temporaryIds.edges.length;t++){this.body.edges[this.temporaryIds.edges[t]].disconnect(),delete this.body.edges[this.temporaryIds.edges[t]];var e=this.body.edgeIndices.indexOf(this.temporaryIds.edges[t]);-1!==e&&this.body.edgeIndices.splice(e,1)}for(var i=0;i<this.temporaryIds.nodes.length;i++){delete this.body.nodes[this.temporaryIds.nodes[i]];var n=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);-1!==n&&this.body.nodeIndices.splice(n,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(t){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=cs({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(t){var e=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(e),n=this.body.nodes[this.temporaryIds.nodes[0]],o=this.body.nodes[this.temporaryIds.nodes[1]],r=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var s=n.isOverlappingWith(i),a=o.isOverlappingWith(i);!0===s?(this.selectedControlNode=n,r.edgeType.from=n):!0===a&&(this.selectedControlNode=o,r.edgeType.to=o),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(t){this.body.emitter.emit("disablePhysics");var e=this.body.functions.getPointer(t.center),i=this.canvas.DOMtoCanvas(e);void 0!==this.selectedControlNode?(this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y):this.interactionHandler.onDrag(t),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),n=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),r=void 0,s=o.length-1;s>=0;s--)if(o[s]!==this.selectedControlNode.id){r=this.body.nodes[o[s]];break}if(void 0!==r&&void 0!==this.selectedControlNode)if(!0===r.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(r.id,n.to.id):this._performEditEdge(n.from.id,r.id)}else n.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=cs({},this.body.view.translation);var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(!0===i.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var n=this._getNewTargetNode(i.x,i.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);var o=this.body.functions.createEdge({id:"connectionEdge"+Jr(),from:i.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(o.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),r=void 0,s=o.length-1;s>=0;s--)if(-1===this.temporaryIds.nodes.indexOf(o[s])){r=this.body.nodes[o[s]];break}if(t.controlEdge={from:n,to:r?r.id:void 0},this.selectionHandler._generateClickEvent("controlNodeDragging",t,e),void 0!==this.temporaryIds.nodes[0]){var a=this.body.nodes[this.temporaryIds.nodes[0]];a.x=this.canvas._XconvertDOMtoCanvas(e.x),a.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(t)}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),r=void 0,s=o.length-1;s>=0;s--)if(-1===this.temporaryIds.nodes.indexOf(o[s])){r=this.body.nodes[o[s]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==r&&(!0===r.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[r.id]&&this._performAddEdge(n,r.id)),t.controlEdge={from:n,to:r?r.id:void 0},this.selectionHandler._generateClickEvent("controlNodeDragEnd",t,e),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(t){var e=this.lastTouch;this.selectionHandler._generateClickEvent("dragStart",t,e,void 0,!0)}},{key:"_performAddNode",value:function(t){var e=this,i={id:Jr(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,(function(t){null!=t&&"addNode"===e.inMode&&e.body.data.nodes.getDataSet().add(t),e.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(t,e){var i=this,n={from:t,to:e};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(n,(function(t){null!=t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,n={id:this.edgeBeingEditedId,from:t,to:e,label:this.body.data.edges._data[this.edgeBeingEditedId].label},o=this.options.editEdge;if("object"===Lu(o)&&(o=o.editWithoutDrag),"function"==typeof o){if(2!==o.length)throw new Error("The function for edit does not support two arguments (data, callback)");o(n,(function(t){null==t||"editEdge"!==i.inMode?(i.body.edges[n.id].updateEdgeType(),i.body.emitter.emit("_redraw"),i.showManipulatorToolbar()):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}(),yy={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"},my=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;Bu(this,t),this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},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 Wu(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){if("string"==typeof t)return yy[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i,n=this._isColorString(t);if(void 0!==n&&(t=n),!0===ss(t)){if(!0===Xs(t)){var o=t.substr(4).substr(0,t.length-5).split(",");i={r:o[0],g:o[1],b:o[2],a:1}}else if(!0===$s(t)){var r=t.substr(5).substr(0,t.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(!0===Zs(t)){var s=Ys(t);i={r:s.r,g:s.g,b:s.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var a=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:a}}if(void 0===i)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(t));this._setColor(i,e)}}},{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 t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];!0===e&&(this.previousColor=cs({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((function(){void 0!==t.closeCallback&&(t.closeCallback(),t.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?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!0===e&&(this.initialColor=cs({},t)),this.color=t;var i=Bs(t.r,t.g,t.b),n=2*Math.PI,o=this.r*i.s,r=this.centerCoordinates.x+o*Math.sin(n*i.h),s=this.centerCoordinates.y+o*Math.cos(n*i.h);this.colorPickerSelector.style.left=r-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=s-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=Bs(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=Us(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=Bs(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.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 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)}else{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)}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(t){}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(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._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 t=this;this.drag={},this.pinch={},this.hammer=new Au(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),Av.onTouch(this.hammer,(function(e){t._moveSelector(e)})),this.hammer.on("tap",(function(e){t._moveSelector(e)})),this.hammer.on("panstart",(function(e){t._moveSelector(e)})),this.hammer.on("panmove",(function(e){t._moveSelector(e)})),this.hammer.on("panend",(function(e){t._moveSelector(e)}))}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e,i,n,o,r=this.colorPickerCanvas.clientWidth,s=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,r,s),this.centerCoordinates={x:.5*r,y:.5*s},this.r=.49*r;var a,h=2*Math.PI/360,d=1/this.r;for(n=0;n<360;n++)for(o=0;o<this.r;o++)e=this.centerCoordinates.x+o*Math.sin(h*n),i=this.centerCoordinates.y+o*Math.cos(h*n),a=Us(n*(1/360),o*d,1),t.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",t.fillRect(e-.5,i-.5,2,2);t.strokeStyle="rgba(0,0,0,1)",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),t.stroke(),this.hueCircle=t.getImageData(0,0,r,s)}this.generated=!0}},{key:"_moveSelector",value:function(t){var e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,n=t.center.y-e.top,o=.5*this.colorPickerDiv.clientHeight,r=.5*this.colorPickerDiv.clientWidth,s=i-r,a=n-o,h=Math.atan2(s,a),d=.98*Math.min(Math.sqrt(s*s+a*a),r),l=Math.cos(h)*d+o,u=Math.sin(h)*d+r;this.colorPickerSelector.style.top=l-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";var c=h/(2*Math.PI);c=c<0?c+1:c;var f=d/this.r,p=Bs(this.color.r,this.color.g,this.color.b);p.h=c,p.s=f;var v=Us(p.h,p.s,p.v);v.a=this.color.a,this.color=v,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+")"}}]),t}(),by=function(){function t(e,i,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Bu(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},cs(this.options,this.defaultOptions),this.configureOptions=n,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new my(o),this.wrapper=void 0}return Wu(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;if("string"==typeof t)this.options.filter=t;else if(t instanceof Array)this.options.filter=t.join();else if("object"===Lu(t)){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===this.options.filter&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,!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 t=this.options.filter,e=0,i=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?i=(i=t(n,[]))||this._handleObject(this.configureOptions[n],[n],!0):!0!==t&&-1===t.indexOf(n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);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 t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var t=0;t<this.domElements.length;t++)this.wrapper.removeChild(this.domElements[t]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(t){for(var e=this.moduleOptions,i=0;i<t.length;i++){if(void 0===e[t[i]]){e=void 0;break}e=e[t[i]]}return e}},{key:"_makeItem",value:function(t){if(!0===this.allowCreation){var e=document.createElement("div");e.className="vis-configuration vis-config-item vis-config-s"+t.length;for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return n.forEach((function(t){e.appendChild(t)})),this.domElements.push(e),this.domElements.length}return 0}},{key:"_makeHeader",value:function(t){var e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerHTML=t,this._makeItem([],e)}},{key:"_makeLabel",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+e.length,n.innerHTML=!0===i?"<i><b>"+t+":</b></i>":t+":",n}},{key:"_makeDropdown",value:function(t,e,i){var n=document.createElement("select");n.className="vis-configuration vis-config-select";var o=0;void 0!==e&&-1!==t.indexOf(e)&&(o=t.indexOf(e));for(var r=0;r<t.length;r++){var s=document.createElement("option");s.value=t[r],r===o&&(s.selected="selected"),s.innerHTML=t[r],n.appendChild(s)}var a=this;n.onchange=function(){a._update(this.value,i)};var h=this._makeLabel(i[i.length-1],i);this._makeItem(i,h,n)}},{key:"_makeRange",value:function(t,e,i){var n=t[0],o=t[1],r=t[2],s=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=o,a.max=r}catch(t){}a.step=s;var h="",d=0;if(void 0!==e){e<0&&1.2*e<o?(a.min=Math.ceil(1.2*e),d=a.min,h="range increased"):e/1.2<o&&(a.min=Math.ceil(e/1.2),d=a.min,h="range increased"),1.2*e>r&&1!==r&&(a.max=Math.ceil(1.2*e),d=a.max,h="range increased"),a.value=e}else a.value=n;var l=document.createElement("input");l.className="vis-configuration vis-config-rangeinput",l.value=a.value;var u=this;a.onchange=function(){l.value=this.value,u._update(Number(this.value),i)},a.oninput=function(){l.value=this.value};var c=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,c,a,l);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}},{key:"_makeButton",value:function(){var t=this;if(!0===this.options.showButton){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.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(e)}}},{key:"_setupPopup",value:function(t,e){var i=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=t,n.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:n,index:e}}}},{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 t=this;if(void 0!==this.popupDiv.html){var e=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=e.left+"px",this.popupDiv.html.style.top=e.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((function(){t.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((function(){t._removePopup()}),1800)}}},{key:"_makeCheckbox",value:function(t,e,i){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"===Lu(t)?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));var o=this;n.onchange=function(){o._update(this.checked,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}},{key:"_makeTextInput",value:function(t,e,i){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});var o=this;n.onchange=function(){o._update(this.value,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}},{key:"_makeColorField",value:function(t,e,i){var n=this,o=t[1],r=document.createElement("div");"none"!==(e=void 0===e?o:e)?(r.className="vis-configuration vis-config-colorBlock",r.style.backgroundColor=e):r.className="vis-configuration vis-config-colorBlock none",e=void 0===e?o:e,r.onclick=function(){n._showColorPicker(e,r,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,r)}},{key:"_showColorPicker",value:function(t,e,i){var n=this;e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((function(t){var o="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=o,n._update(o,i)})),this.colorPicker.setCloseCallback((function(){e.onclick=function(){n._showColorPicker(t,e,i)}}))}},{key:"_handleObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1,o=this.options.filter,r=!1;for(var s in t)if(t.hasOwnProperty(s)){n=!0;var a=t[s],h=_s(e,s);if("function"==typeof o&&!1===(n=o(s,e))&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,h,!0),this.allowCreation=!1===i),!1!==n){r=!0;var d=this._getValue(h);if(a instanceof Array)this._handleArray(a,d,h);else if("string"==typeof a)this._makeTextInput(a,d,h);else if("boolean"==typeof a)this._makeCheckbox(a,d,h);else if(a instanceof Object){var l=!0;if(-1!==e.indexOf("physics")&&this.moduleOptions.physics.solver!==s&&(l=!1),!0===l)if(void 0!==a.enabled){var u=_s(h,"enabled"),c=this._getValue(u);if(!0===c){var f=this._makeLabel(s,h,!0);this._makeItem(h,f),r=this._handleObject(a,h)||r}else this._makeCheckbox(a,c,h)}else{var p=this._makeLabel(s,h,!0);this._makeItem(h,p),r=this._handleObject(a,h)||r}}else console.error("dont know how to handle",a,s,h)}}return r}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}},{key:"_constructOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i;t="false"!==(t="true"===t||t)&&t;for(var o=0;o<e.length;o++)"global"!==e[o]&&(void 0===n[e[o]]&&(n[e[o]]={}),o!==e.length-1?n=n[e[o]]:n[e[o]]=t);return i}},{key:"_printOptions",value:function(){var t=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+JSON.stringify(t,null,2)+"</pre>"}},{key:"getOptions",value:function(){for(var t={},e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}}]),t}(),_y="string",wy="boolean",ky="number",xy="object",Sy=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Oy={configure:{enabled:{boolean:wy},filter:{boolean:wy,string:_y,array:"array",function:"function"},container:{dom:"dom"},showButton:{boolean:wy},__type__:{object:xy,boolean:wy,string:_y,array:"array",function:"function"}},edges:{arrows:{to:{enabled:{boolean:wy},scaleFactor:{number:ky},type:{string:Sy},imageHeight:{number:ky},imageWidth:{number:ky},src:{string:_y},__type__:{object:xy,boolean:wy}},middle:{enabled:{boolean:wy},scaleFactor:{number:ky},type:{string:Sy},imageWidth:{number:ky},imageHeight:{number:ky},src:{string:_y},__type__:{object:xy,boolean:wy}},from:{enabled:{boolean:wy},scaleFactor:{number:ky},type:{string:Sy},imageWidth:{number:ky},imageHeight:{number:ky},src:{string:_y},__type__:{object:xy,boolean:wy}},__type__:{string:["from","to","middle"],object:xy}},arrowStrikethrough:{boolean:wy},background:{enabled:{boolean:wy},color:{string:_y},size:{number:ky},dashes:{boolean:wy,array:"array"},__type__:{object:xy,boolean:wy}},chosen:{label:{boolean:wy,function:"function"},edge:{boolean:wy,function:"function"},__type__:{object:xy,boolean:wy}},color:{color:{string:_y},highlight:{string:_y},hover:{string:_y},inherit:{string:["from","to","both"],boolean:wy},opacity:{number:ky},__type__:{object:xy,string:_y}},dashes:{boolean:wy,array:"array"},font:{color:{string:_y},size:{number:ky},face:{string:_y},background:{string:_y},strokeWidth:{number:ky},strokeColor:{string:_y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:ky},multi:{boolean:wy,string:_y},bold:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},boldital:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},ital:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},mono:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},__type__:{object:xy,string:_y}},hidden:{boolean:wy},hoverWidth:{function:"function",number:ky},label:{string:_y,undefined:"undefined"},labelHighlightBold:{boolean:wy},length:{number:ky,undefined:"undefined"},physics:{boolean:wy},scaling:{min:{number:ky},max:{number:ky},label:{enabled:{boolean:wy},min:{number:ky},max:{number:ky},maxVisible:{number:ky},drawThreshold:{number:ky},__type__:{object:xy,boolean:wy}},customScalingFunction:{function:"function"},__type__:{object:xy}},selectionWidth:{function:"function",number:ky},selfReferenceSize:{number:ky},shadow:{enabled:{boolean:wy},color:{string:_y},size:{number:ky},x:{number:ky},y:{number:ky},__type__:{object:xy,boolean:wy}},smooth:{enabled:{boolean:wy},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:ky},forceDirection:{string:["horizontal","vertical","none"],boolean:wy},__type__:{object:xy,boolean:wy}},title:{string:_y,undefined:"undefined"},width:{number:ky},widthConstraint:{maximum:{number:ky},__type__:{object:xy,boolean:wy,number:ky}},value:{number:ky,undefined:"undefined"},__type__:{object:xy}},groups:{useDefaultGroups:{boolean:wy},__any__:"get from nodes, will be overwritten below",__type__:{object:xy}},interaction:{dragNodes:{boolean:wy},dragView:{boolean:wy},hideEdgesOnDrag:{boolean:wy},hideEdgesOnZoom:{boolean:wy},hideNodesOnDrag:{boolean:wy},hover:{boolean:wy},keyboard:{enabled:{boolean:wy},speed:{x:{number:ky},y:{number:ky},zoom:{number:ky},__type__:{object:xy}},bindToWindow:{boolean:wy},__type__:{object:xy,boolean:wy}},multiselect:{boolean:wy},navigationButtons:{boolean:wy},selectable:{boolean:wy},selectConnectedEdges:{boolean:wy},hoverConnectedEdges:{boolean:wy},tooltipDelay:{number:ky},zoomView:{boolean:wy},zoomSpeed:{number:ky},__type__:{object:xy}},layout:{randomSeed:{undefined:"undefined",number:ky},improvedLayout:{boolean:wy},clusterThreshold:{number:ky},hierarchical:{enabled:{boolean:wy},levelSeparation:{number:ky},nodeSpacing:{number:ky},treeSpacing:{number:ky},blockShifting:{boolean:wy},edgeMinimization:{boolean:wy},parentCentralization:{boolean:wy},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:xy,boolean:wy}},__type__:{object:xy}},manipulation:{enabled:{boolean:wy},initiallyActive:{boolean:wy},addNode:{boolean:wy,function:"function"},addEdge:{boolean:wy,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:xy,boolean:wy,function:"function"}},deleteNode:{boolean:wy,function:"function"},deleteEdge:{boolean:wy,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:xy,boolean:wy}},nodes:{borderWidth:{number:ky},borderWidthSelected:{number:ky,undefined:"undefined"},brokenImage:{string:_y,undefined:"undefined"},chosen:{label:{boolean:wy,function:"function"},node:{boolean:wy,function:"function"},__type__:{object:xy,boolean:wy}},color:{border:{string:_y},background:{string:_y},highlight:{border:{string:_y},background:{string:_y},__type__:{object:xy,string:_y}},hover:{border:{string:_y},background:{string:_y},__type__:{object:xy,string:_y}},__type__:{object:xy,string:_y}},fixed:{x:{boolean:wy},y:{boolean:wy},__type__:{object:xy,boolean:wy}},font:{align:{string:_y},color:{string:_y},size:{number:ky},face:{string:_y},background:{string:_y},strokeWidth:{number:ky},strokeColor:{string:_y},vadjust:{number:ky},multi:{boolean:wy,string:_y},bold:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},boldital:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},ital:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},mono:{color:{string:_y},size:{number:ky},face:{string:_y},mod:{string:_y},vadjust:{number:ky},__type__:{object:xy,string:_y}},__type__:{object:xy,string:_y}},group:{string:_y,number:ky,undefined:"undefined"},heightConstraint:{minimum:{number:ky},valign:{string:_y},__type__:{object:xy,boolean:wy,number:ky}},hidden:{boolean:wy},icon:{face:{string:_y},code:{string:_y},size:{number:ky},color:{string:_y},weight:{string:_y,number:ky},__type__:{object:xy}},id:{string:_y,number:ky},image:{selected:{string:_y,undefined:"undefined"},unselected:{string:_y,undefined:"undefined"},__type__:{object:xy,string:_y}},imagePadding:{top:{number:ky},right:{number:ky},bottom:{number:ky},left:{number:ky},__type__:{object:xy,number:ky}},label:{string:_y,undefined:"undefined"},labelHighlightBold:{boolean:wy},level:{number:ky,undefined:"undefined"},margin:{top:{number:ky},right:{number:ky},bottom:{number:ky},left:{number:ky},__type__:{object:xy,number:ky}},mass:{number:ky},physics:{boolean:wy},scaling:{min:{number:ky},max:{number:ky},label:{enabled:{boolean:wy},min:{number:ky},max:{number:ky},maxVisible:{number:ky},drawThreshold:{number:ky},__type__:{object:xy,boolean:wy}},customScalingFunction:{function:"function"},__type__:{object:xy}},shadow:{enabled:{boolean:wy},color:{string:_y},size:{number:ky},x:{number:ky},y:{number:ky},__type__:{object:xy,boolean:wy}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},shapeProperties:{borderDashes:{boolean:wy,array:"array"},borderRadius:{number:ky},interpolation:{boolean:wy},useImageSize:{boolean:wy},useBorderWithImage:{boolean:wy},__type__:{object:xy}},size:{number:ky},title:{string:_y,dom:"dom",undefined:"undefined"},value:{number:ky,undefined:"undefined"},widthConstraint:{minimum:{number:ky},maximum:{number:ky},__type__:{object:xy,boolean:wy,number:ky}},x:{number:ky},y:{number:ky},__type__:{object:xy}},physics:{enabled:{boolean:wy},barnesHut:{gravitationalConstant:{number:ky},centralGravity:{number:ky},springLength:{number:ky},springConstant:{number:ky},damping:{number:ky},avoidOverlap:{number:ky},__type__:{object:xy}},forceAtlas2Based:{gravitationalConstant:{number:ky},centralGravity:{number:ky},springLength:{number:ky},springConstant:{number:ky},damping:{number:ky},avoidOverlap:{number:ky},__type__:{object:xy}},repulsion:{centralGravity:{number:ky},springLength:{number:ky},springConstant:{number:ky},nodeDistance:{number:ky},damping:{number:ky},__type__:{object:xy}},hierarchicalRepulsion:{centralGravity:{number:ky},springLength:{number:ky},springConstant:{number:ky},nodeDistance:{number:ky},damping:{number:ky},avoidOverlap:{number:ky},__type__:{object:xy}},maxVelocity:{number:ky},minVelocity:{number:ky},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:wy},iterations:{number:ky},updateInterval:{number:ky},onlyDynamicEdges:{boolean:wy},fit:{boolean:wy},__type__:{object:xy,boolean:wy}},timestep:{number:ky},adaptiveTimestep:{boolean:wy},__type__:{object:xy,boolean:wy}},autoResize:{boolean:wy},clickToUse:{boolean:wy},locale:{string:_y},locales:{__any__:{any:"any"},__type__:{object:xy}},height:{string:_y},width:{string:_y},__type__:{object:xy}};Oy.groups.__any__=Oy.nodes,Oy.manipulation.controlNodeStyle=Oy.nodes;var Dy={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"],shakeTowards:["leaves","roots"]}},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],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]}},My=Object.freeze({__proto__:null,allOptions:Oy,configureOptions:Dy}),Ey=function(){function t(){Bu(this,t)}return Wu(t,[{key:"getDistances",value:function(t,e,i){for(var n={},o=t.edges,r=0;r<e.length;r++){var s={};n[e[r]]=s;for(var a=0;a<e.length;a++)s[e[a]]=r==a?0:1e9}for(var h=0;h<i.length;h++){var d=o[i[h]];!0===d.connected&&void 0!==n[d.fromId]&&void 0!==n[d.toId]&&(n[d.fromId][d.toId]=1,n[d.toId][d.fromId]=1)}for(var l=e.length,u=0;u<l;u++)for(var c=e[u],f=n[c],p=0;p<l-1;p++)for(var v=e[p],g=n[v],y=p+1;y<l;y++){var m=e[y],b=n[m],_=Math.min(g[m],g[c]+f[m]);g[m]=_,b[v]=_}return n}}]),t}(),Ty=function(){function t(e,i,n){Bu(this,t),this.body=e,this.springLength=i,this.springConstant=n,this.distanceSolver=new Ey}return Wu(t,[{key:"setOptions",value:function(t){t&&(t.springLength&&(this.springLength=t.springLength),t.springConstant&&(this.springConstant=t.springConstant))}},{key:"solve",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();for(var o=.01,r=1,s=0,a=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),h=5,d=1e9,l=0,u=0,c=0,f=0,p=0;d>o&&s<a;){s+=1;var v=this._getHighestEnergyNode(i),g=Qu(v,4);for(l=g[0],d=g[1],u=g[2],c=g[3],f=d,p=0;f>r&&p<h;){p+=1,this._moveNode(l,u,c);var y=this._getEnergy(l),m=Qu(y,3);f=m[0],u=m[1],c=m[2]}}}},{key:"_getHighestEnergyNode",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,n=0,o=e[0],r=0,s=0,a=0;a<e.length;a++){var h=e[a];if(!1===i[h].predefinedPosition||!0===i[h].isCluster&&!0===t||!0===i[h].options.fixed.x||!0===i[h].options.fixed.y){var d=Qu(this._getEnergy(h),3),l=d[0],u=d[1],c=d[2];n<l&&(n=l,o=h,r=u,s=c)}}return[o,n,r,s]}},{key:"_getEnergy",value:function(t){var e=Qu(this.E_sums[t],2),i=e[0],n=e[1];return[Math.sqrt(Math.pow(i,2)+Math.pow(n,2)),i,n]}},{key:"_moveNode",value:function(t,e,i){for(var n=this.body.nodeIndices,o=this.body.nodes,r=0,s=0,a=0,h=o[t].x,d=o[t].y,l=this.K_matrix[t],u=this.L_matrix[t],c=0;c<n.length;c++){var f=n[c];if(f!==t){var p=o[f].x,v=o[f].y,g=l[f],y=u[f],m=1/Math.pow(Math.pow(h-p,2)+Math.pow(d-v,2),1.5);r+=g*(1-y*Math.pow(d-v,2)*m),s+=g*(y*(h-p)*(d-v)*m),a+=g*(1-y*Math.pow(h-p,2)*m)}}var b=(e/r+i/s)/(s/r-a/s),_=-(s*b+e)/r;o[t].x+=_,o[t].y+=b,this._updateE_matrix(t)}},{key:"_createL_matrix",value:function(t){var e=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(var n=0;n<e.length;n++){this.L_matrix[e[n]]={};for(var o=0;o<e.length;o++)this.L_matrix[e[n]][e[o]]=i*t[e[n]][e[o]]}}},{key:"_createK_matrix",value:function(t){var e=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(var n=0;n<e.length;n++){this.K_matrix[e[n]]={};for(var o=0;o<e.length;o++)this.K_matrix[e[n]][e[o]]=i*Math.pow(t[e[n]][e[o]],-2)}}},{key:"_createE_matrix",value:function(){var t=this.body.nodeIndices,e=this.body.nodes;this.E_matrix={},this.E_sums={};for(var i=0;i<t.length;i++)this.E_matrix[t[i]]=[];for(var n=0;n<t.length;n++){for(var o=t[n],r=e[o].x,s=e[o].y,a=0,h=0,d=n;d<t.length;d++){var l=t[d];if(l!==o){var u=e[l].x,c=e[l].y,f=1/Math.sqrt(Math.pow(r-u,2)+Math.pow(s-c,2));this.E_matrix[o][d]=[this.K_matrix[o][l]*(r-u-this.L_matrix[o][l]*(r-u)*f),this.K_matrix[o][l]*(s-c-this.L_matrix[o][l]*(s-c)*f)],this.E_matrix[l][n]=this.E_matrix[o][d],a+=this.E_matrix[o][d][0],h+=this.E_matrix[o][d][1]}}this.E_sums[o]=[a,h]}}},{key:"_updateE_matrix",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,n=this.E_matrix[t],o=this.K_matrix[t],r=this.L_matrix[t],s=i[t].x,a=i[t].y,h=0,d=0,l=0;l<e.length;l++){var u=e[l];if(u!==t){var c=n[l],f=c[0],p=c[1],v=i[u].x,g=i[u].y,y=1/Math.sqrt(Math.pow(s-v,2)+Math.pow(a-g,2)),m=o[u]*(s-v-r[u]*(s-v)*y),b=o[u]*(a-g-r[u]*(a-g)*y);n[l]=[m,b],h+=m,d+=b;var _=this.E_sums[u];_[0]+=m-f,_[1]+=b-p}}this.E_sums[t]=[h,d]}}]),t}();function Cy(t,e,i){var n=this;if(!(this instanceof Cy))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:zu,clickToUse:!1},cs(this.options,this.defaultOptions),this.body={container:t,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 ec((function(){return n.body.emitter.emit("_requestRedraw")})),this.groups=new ic,this.canvas=new Rv(this.body),this.selectionHandler=new Wv(this.body,this.canvas),this.interactionHandler=new Hv(this.body,this.canvas,this.selectionHandler),this.view=new zv(this.body,this.canvas),this.renderer=new Fv(this.body,this.canvas),this.physics=new Ev(this.body),this.layoutEngine=new vy(this.body),this.clustering=new Nv(this.body),this.manipulation=new gy(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Gp(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new bv(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Ty(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(e)}ri(Cy.prototype),Cy.prototype.setOptions=function(t){var e=this;if(null===t&&(t=void 0),void 0!==t){!0===Vp.validate(t,Oy)&&console.log("%cErrors have been found in the supplied options object.",Wp);if(ps(["locale","locales","clickToUse"],this.options,t),t=this.layoutEngine.setOptions(t.layout,t),this.canvas.setOptions(t),this.groups.setOptions(t.groups),this.nodesHandler.setOptions(t.nodes),this.edgesHandler.setOptions(t.edges),this.physics.setOptions(t.physics),this.manipulation.setOptions(t.manipulation,t,this.options),this.interactionHandler.setOptions(t.interaction),this.renderer.setOptions(t.interaction),this.selectionHandler.setOptions(t.interaction),void 0!==t.groups&&this.body.emitter.emit("refreshNodes"),"configure"in t&&(this.configurator||(this.configurator=new by(this,this.body.container,Dy,this.canvas.pixelRatio)),this.configurator.setOptions(t.configure)),this.configurator&&!0===this.configurator.options.enabled){var i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};gs(i.nodes,this.nodesHandler.options),gs(i.edges,this.edgesHandler.options),gs(i.layout,this.layoutEngine.options),gs(i.interaction,this.selectionHandler.options),gs(i.interaction,this.renderer.options),gs(i.interaction,this.interactionHandler.options),gs(i.manipulation,this.manipulation.options),gs(i.physics,this.physics.options),gs(i.global,this.canvas.options),gs(i.global,this.options),this.configurator.setModuleOptions(i)}void 0!==t.clickToUse?!0===t.clickToUse?void 0===this.activator&&(this.activator=new ju(this.canvas.frame),this.activator.on("change",(function(){e.body.emitter.emit("activate")}))):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},Cy.prototype._updateVisibleIndices=function(){var t=this.body.nodes,e=this.body.edges;for(var i in this.body.nodeIndices=[],this.body.edgeIndices=[],t)t.hasOwnProperty(i)&&(this.clustering._isClusteredNode(i)||!1!==t[i].options.hidden||this.body.nodeIndices.push(t[i].id));for(var n in e)if(e.hasOwnProperty(n)){var o=e[n],r=t[o.fromId],s=t[o.toId],a=void 0!==r&&void 0!==s;!this.clustering._isClusteredEdge(n)&&!1===o.options.hidden&&a&&!1===r.options.hidden&&!1===s.options.hidden&&this.body.edgeIndices.push(o.id)}},Cy.prototype.bindEventListeners=function(){var t=this;this.body.emitter.on("_dataChanged",(function(){t.edgesHandler._updateState(),t.body.emitter.emit("_dataUpdated")})),this.body.emitter.on("_dataUpdated",(function(){t.clustering._updateState(),t._updateVisibleIndices(),t._updateValueRange(t.body.nodes),t._updateValueRange(t.body.edges),t.body.emitter.emit("startSimulation"),t.body.emitter.emit("_requestRedraw")}))},Cy.prototype.setData=function(t){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(t&&t.options),t&&t.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 e=md.DOTToGraph(t.dot);this.setData(e)}else if(t&&t.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 i=Sd(t.gephi);this.setData(i)}else this.nodesHandler.setData(t&&t.nodes,!0),this.edgesHandler.setData(t&&t.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},Cy.prototype.destroy=function(){for(var t 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(t)&&delete this.body.nodes[t];for(var e in this.body.edges)this.body.edges.hasOwnProperty(e)&&delete this.body.edges[e];rs(this.body.container)},Cy.prototype._updateValueRange=function(t){var e,i=void 0,n=void 0,o=0;for(e in t)if(t.hasOwnProperty(e)){var r=t[e].getValue();void 0!==r&&(i=void 0===i?r:Math.min(r,i),n=void 0===n?r:Math.max(r,n),o+=r)}if(void 0!==i&&void 0!==n)for(e in t)t.hasOwnProperty(e)&&t[e].setValueRange(i,n,o)},Cy.prototype.isActive=function(){return!this.activator||this.activator.active},Cy.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},Cy.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},Cy.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},Cy.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},Cy.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},Cy.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},Cy.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},Cy.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},Cy.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},Cy.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},Cy.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},Cy.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},Cy.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},Cy.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},Cy.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},Cy.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},Cy.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},Cy.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},Cy.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},Cy.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},Cy.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},Cy.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},Cy.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},Cy.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},Cy.prototype.getConnectedNodes=function(t){return void 0!==this.body.nodes[t]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},Cy.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},Cy.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},Cy.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},Cy.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},Cy.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},Cy.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},Cy.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},Cy.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},Cy.prototype.getNodeAt=function(){var t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},Cy.prototype.getEdgeAt=function(){var t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},Cy.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},Cy.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},Cy.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},Cy.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},Cy.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},Cy.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},Cy.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},Cy.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},Cy.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},Cy.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},Cy.prototype.getOptionsFromConfigurator=function(){var t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};var Py=i((function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i<t[e].redundant.length;i++)t[e].redundant[i].parentNode.removeChild(t[e].redundant[i]);t[e].redundant=[]}},e.resetElements=function(t){e.prepareElements(t),e.cleanupElements(t),e.prepareElements(t)},e.getSVGElement=function(t,e,i){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n},e.getDOMElement=function(t,e,i,n){var o;return e.hasOwnProperty(t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElement(t),void 0!==n?i.insertBefore(o,n):i.appendChild(o)):(o=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(o,n):i.appendChild(o)),e[t].used.push(o),o},e.drawPoint=function(t,i,n,o,r,s){var a;if("circle"==n.style?((a=e.getSVGElement("circle",o,r)).setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*n.size)):((a=e.getSVGElement("rect",o,r)).setAttributeNS(null,"x",t-.5*n.size),a.setAttributeNS(null,"y",i-.5*n.size),a.setAttributeNS(null,"width",n.size),a.setAttributeNS(null,"height",n.size)),void 0!==n.styles&&a.setAttributeNS(null,"style",n.styles),a.setAttributeNS(null,"class",n.className+" vis-point"),s){var h=e.getSVGElement("text",o,r);s.xOffset&&(t+=s.xOffset),s.yOffset&&(i+=s.yOffset),s.content&&(h.textContent=s.content),s.className&&h.setAttributeNS(null,"class",s.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,n,o,r,s,a,h){if(0!=o){o<0&&(i-=o*=-1);var d=e.getSVGElement("rect",s,a);d.setAttributeNS(null,"x",t-.5*n),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",n),d.setAttributeNS(null,"height",o),d.setAttributeNS(null,"class",r),h&&d.setAttributeNS(null,"style",h)}}})),Iy=Py.prepareElements,Ny=Py.cleanupElements,Fy=Py.resetElements,Ay=Py.getSVGElement,Ry=Py.getDOMElement,Yy=Py.drawPoint,jy=Py.drawBar,zy=Object.freeze({__proto__:null,default:Py,__moduleExports:Py,prepareElements:Iy,cleanupElements:Ny,resetElements:Fy,getSVGElement:Ay,getDOMElement:Ry,drawPoint:Yy,drawBar:jy}),Ly=i((function(t,i){t.exports=function(){var i,n;function o(){return i.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function s(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return void 0===t}function h(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function l(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function u(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){for(var i in e)u(e,i)&&(t[i]=e[i]);return u(e,"toString")&&(t.toString=e.toString),u(e,"valueOf")&&(t.valueOf=e.valueOf),t}function f(t,e,i,n){return Ne(t,e,i,n,!0).utc()}function p(t){return null==t._pf&&(t._pf={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}),t._pf}function v(t){if(null==t._isValid){var e=p(t),i=n.call(e.parsedDateParts,(function(t){return null!=t})),o=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i);if(t._strict&&(o=o&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return o;t._isValid=o}return t._isValid}function g(t){var e=f(NaN);return null!=t?c(p(e),t):p(e).userInvalidated=!0,e}n=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;n<i;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};var y=o.momentProperties=[];function m(t,e){var i,n,o;if(a(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),a(e._i)||(t._i=e._i),a(e._f)||(t._f=e._f),a(e._l)||(t._l=e._l),a(e._strict)||(t._strict=e._strict),a(e._tzm)||(t._tzm=e._tzm),a(e._isUTC)||(t._isUTC=e._isUTC),a(e._offset)||(t._offset=e._offset),a(e._pf)||(t._pf=p(e)),a(e._locale)||(t._locale=e._locale),y.length>0)for(i=0;i<y.length;i++)a(o=e[n=y[i]])||(t[n]=o);return t}var b=!1;function _(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,o.updateOffset(this),b=!1)}function w(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function k(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function x(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=k(e)),i}function S(t,e,i){var n,o=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),s=0;for(n=0;n<o;n++)(i&&t[n]!==e[n]||!i&&x(t[n])!==x(e[n]))&&s++;return s+r}function O(t){!1===o.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function D(t,e){var i=!0;return c((function(){if(null!=o.deprecationHandler&&o.deprecationHandler(null,t),i){for(var n,r=[],s=0;s<arguments.length;s++){if(n="","object"==typeof arguments[s]){for(var a in n+="\n["+s+"] ",arguments[0])n+=a+": "+arguments[0][a]+", ";n=n.slice(0,-2)}else n=arguments[s];r.push(n)}O(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return e.apply(this,arguments)}),e)}var M,E={};function T(t,e){null!=o.deprecationHandler&&o.deprecationHandler(t,e),E[t]||(O(e),E[t]=!0)}function C(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function P(t,e){var i,n=c({},t);for(i in e)u(e,i)&&(s(t[i])&&s(e[i])?(n[i]={},c(n[i],t[i]),c(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);for(i in t)u(t,i)&&!u(e,i)&&s(t[i])&&(n[i]=c({},n[i]));return n}function I(t){null!=t&&this.set(t)}o.suppressDeprecationWarnings=!1,o.deprecationHandler=null,M=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)u(t,e)&&i.push(e);return i};var N={};function F(t,e){var i=t.toLowerCase();N[i]=N[i+"s"]=N[e]=t}function A(t){return"string"==typeof t?N[t]||N[t.toLowerCase()]:void 0}function R(t){var e,i,n={};for(i in t)u(t,i)&&(e=A(i))&&(n[e]=t[i]);return n}var Y={};function j(t,e){Y[t]=e}function z(t,e,i){var n=""+Math.abs(t),o=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var L=/(\[[^\[]*\])|(\\)?([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,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},W={};function V(t,e,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),t&&(W[t]=o),e&&(W[e[0]]=function(){return z(o.apply(this,arguments),e[1],e[2])}),i&&(W[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=G(e,t.localeData()),H[e]=H[e]||function(t){var e,i,n,o=t.match(L);for(e=0,i=o.length;e<i;e++)W[o[e]]?o[e]=W[o[e]]:o[e]=(n=o[e]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(e){var n,r="";for(n=0;n<i;n++)r+=C(o[n])?o[n].call(e,t):o[n];return r}}(e),H[e](t)):t.localeData().invalidDate()}function G(t,e){var i=5;function n(t){return e.longDateFormat(t)||t}for(B.lastIndex=0;i>=0&&B.test(t);)t=t.replace(B,n),B.lastIndex=0,i-=1;return t}var q=/\d/,Z=/\d\d/,X=/\d{3}/,$=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,it=/\d{1,4}/,nt=/[+-]?\d{1,6}/,ot=/\d+/,rt=/[+-]?\d+/,st=/Z|[+-]\d\d:?\d\d/gi,at=/Z|[+-]\d\d(?::?\d\d)?/gi,ht=/[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,dt={};function lt(t,e,i){dt[t]=C(e)?e:function(t,n){return t&&i?i:e}}function ut(t,e){return u(dt,t)?dt[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,o){return e||i||n||o}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function pt(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),h(e)&&(n=function(t,i){i[e]=x(t)}),i=0;i<t.length;i++)ft[t[i]]=n}function vt(t,e){pt(t,(function(t,i,n,o){n._w=n._w||{},e(t,n._w,n,o)}))}function gt(t,e,i){null!=e&&u(ft,t)&&ft[t](e,i._a,i,t)}var yt=0,mt=1,bt=2,_t=3,wt=4,kt=5,xt=6,St=7,Ot=8;function Dt(t){return Mt(t)?366:365}function Mt(t){return t%4==0&&t%100!=0||t%400==0}V("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),V(0,["YY",2],0,(function(){return this.year()%100})),V(0,["YYYY",4],0,"year"),V(0,["YYYYY",5],0,"year"),V(0,["YYYYYY",6,!0],0,"year"),F("year","y"),j("year",1),lt("Y",rt),lt("YY",J,Z),lt("YYYY",it,$),lt("YYYYY",nt,K),lt("YYYYYY",nt,K),pt(["YYYYY","YYYYYY"],yt),pt("YYYY",(function(t,e){e[yt]=2===t.length?o.parseTwoDigitYear(t):x(t)})),pt("YY",(function(t,e){e[yt]=o.parseTwoDigitYear(t)})),pt("Y",(function(t,e){e[yt]=parseInt(t,10)})),o.parseTwoDigitYear=function(t){return x(t)+(x(t)>68?1900:2e3)};var Et,Tt=Ct("FullYear",!0);function Ct(t,e){return function(i){return null!=i?(It(this,t,i),o.updateOffset(this,e),this):Pt(this,t)}}function Pt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function It(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Mt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Nt(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function Nt(t,e){if(isNaN(t)||isNaN(e))return NaN;var i=function(t,e){return(t%e+e)%e}(e,12);return t+=(e-i)/12,1===i?Mt(t)?29:28:31-i%7%2}Et=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},V("M",["MM",2],"Mo",(function(){return this.month()+1})),V("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),V("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),F("month","M"),j("month",8),lt("M",J),lt("MM",J,Z),lt("MMM",(function(t,e){return e.monthsShortRegex(t)})),lt("MMMM",(function(t,e){return e.monthsRegex(t)})),pt(["M","MM"],(function(t,e){e[mt]=x(t)-1})),pt(["MMM","MMMM"],(function(t,e,i,n){var o=i._locale.monthsParse(t,n,i._strict);null!=o?e[mt]=o:p(i).invalidMonth=t}));var Ft=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,At="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Rt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Yt(t,e,i){var n,o,r,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(o=Et.call(this._shortMonthsParse,s))?o:null:-1!==(o=Et.call(this._longMonthsParse,s))?o:null:"MMM"===e?-1!==(o=Et.call(this._shortMonthsParse,s))?o:-1!==(o=Et.call(this._longMonthsParse,s))?o:null:-1!==(o=Et.call(this._longMonthsParse,s))?o:-1!==(o=Et.call(this._shortMonthsParse,s))?o:null}function jt(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=x(e);else if(!h(e=t.localeData().monthsParse(e)))return t;return i=Math.min(t.date(),Nt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function zt(t){return null!=t?(jt(this,t),o.updateOffset(this,!0),this):Pt(this,"Month")}var Lt=ht,Bt=ht;function Ht(){function t(t,e){return e.length-t.length}var e,i,n=[],o=[],r=[];for(e=0;e<12;e++)i=f([2e3,e]),n.push(this.monthsShort(i,"")),o.push(this.months(i,"")),r.push(this.months(i,"")),r.push(this.monthsShort(i,""));for(n.sort(t),o.sort(t),r.sort(t),e=0;e<12;e++)n[e]=ct(n[e]),o[e]=ct(o[e]);for(e=0;e<24;e++)r[e]=ct(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Wt(t,e,i,n,o,r,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,i,n,o,r,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,o,r,s),a}function Vt(t){var e;if(t<100&&t>=0){var i=Array.prototype.slice.call(arguments);i[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ut(t,e,i){var n=7+e-i;return-(7+Vt(t,0,n).getUTCDay()-e)%7+n-1}function Gt(t,e,i,n,o){var r,s,a=1+7*(e-1)+(7+i-n)%7+Ut(t,n,o);return a<=0?s=Dt(r=t-1)+a:a>Dt(t)?(r=t+1,s=a-Dt(t)):(r=t,s=a),{year:r,dayOfYear:s}}function qt(t,e,i){var n,o,r=Ut(t.year(),e,i),s=Math.floor((t.dayOfYear()-r-1)/7)+1;return s<1?n=s+Zt(o=t.year()-1,e,i):s>Zt(t.year(),e,i)?(n=s-Zt(t.year(),e,i),o=t.year()+1):(o=t.year(),n=s),{week:n,year:o}}function Zt(t,e,i){var n=Ut(t,e,i),o=Ut(t+1,e,i);return(Dt(t)-n+o)/7}function Xt(t,e){return t.slice(e,7).concat(t.slice(0,e))}V("w",["ww",2],"wo","week"),V("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),j("week",5),j("isoWeek",5),lt("w",J),lt("ww",J,Z),lt("W",J),lt("WW",J,Z),vt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=x(t)})),V("d",0,"do","day"),V("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),V("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),V("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),V("e",0,0,"weekday"),V("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),lt("d",J),lt("e",J),lt("E",J),lt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),lt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),lt("dddd",(function(t,e){return e.weekdaysRegex(t)})),vt(["dd","ddd","dddd"],(function(t,e,i,n){var o=i._locale.weekdaysParse(t,n,i._strict);null!=o?e.d=o:p(i).invalidWeekday=t})),vt(["d","e","E"],(function(t,e,i,n){e[n]=x(t)}));var $t="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Jt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qt(t,e,i){var n,o,r,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(o=Et.call(this._weekdaysParse,s))?o:null:"ddd"===e?-1!==(o=Et.call(this._shortWeekdaysParse,s))?o:null:-1!==(o=Et.call(this._minWeekdaysParse,s))?o:null:"dddd"===e?-1!==(o=Et.call(this._weekdaysParse,s))?o:-1!==(o=Et.call(this._shortWeekdaysParse,s))?o:-1!==(o=Et.call(this._minWeekdaysParse,s))?o:null:"ddd"===e?-1!==(o=Et.call(this._shortWeekdaysParse,s))?o:-1!==(o=Et.call(this._weekdaysParse,s))?o:-1!==(o=Et.call(this._minWeekdaysParse,s))?o:null:-1!==(o=Et.call(this._minWeekdaysParse,s))?o:-1!==(o=Et.call(this._weekdaysParse,s))?o:-1!==(o=Et.call(this._shortWeekdaysParse,s))?o:null}var te=ht,ee=ht,ie=ht;function ne(){function t(t,e){return e.length-t.length}var e,i,n,o,r,s=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=f([2e3,1]).day(e),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),r=this.weekdays(i,""),s.push(n),a.push(o),h.push(r),d.push(n),d.push(o),d.push(r);for(s.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=ct(a[e]),h[e]=ct(h[e]),d[e]=ct(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function oe(){return this.hours()%12||12}function re(t,e){V(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function se(t,e){return e._meridiemParse}V("H",["HH",2],0,"hour"),V("h",["hh",2],0,oe),V("k",["kk",2],0,(function(){return this.hours()||24})),V("hmm",0,0,(function(){return""+oe.apply(this)+z(this.minutes(),2)})),V("hmmss",0,0,(function(){return""+oe.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)})),V("Hmm",0,0,(function(){return""+this.hours()+z(this.minutes(),2)})),V("Hmmss",0,0,(function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)})),re("a",!0),re("A",!1),F("hour","h"),j("hour",13),lt("a",se),lt("A",se),lt("H",J),lt("h",J),lt("k",J),lt("HH",J,Z),lt("hh",J,Z),lt("kk",J,Z),lt("hmm",Q),lt("hmmss",tt),lt("Hmm",Q),lt("Hmmss",tt),pt(["H","HH"],_t),pt(["k","kk"],(function(t,e,i){var n=x(t);e[_t]=24===n?0:n})),pt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),pt(["h","hh"],(function(t,e,i){e[_t]=x(t),p(i).bigHour=!0})),pt("hmm",(function(t,e,i){var n=t.length-2;e[_t]=x(t.substr(0,n)),e[wt]=x(t.substr(n)),p(i).bigHour=!0})),pt("hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[_t]=x(t.substr(0,n)),e[wt]=x(t.substr(n,2)),e[kt]=x(t.substr(o)),p(i).bigHour=!0})),pt("Hmm",(function(t,e,i){var n=t.length-2;e[_t]=x(t.substr(0,n)),e[wt]=x(t.substr(n))})),pt("Hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[_t]=x(t.substr(0,n)),e[wt]=x(t.substr(n,2)),e[kt]=x(t.substr(o))}));var ae,he=Ct("Hours",!0),de={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:/\d{1,2}/,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:At,monthsShort:Rt,week:{dow:0,doy:6},weekdays:$t,weekdaysMin:Jt,weekdaysShort:Kt,meridiemParse:/[ap]\.?m?\.?/i},le={},ue={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(i){var n=null;if(!le[i]&&t&&t.exports)try{n=ae._abbr,e(),pe(n)}catch(t){}return le[i]}function pe(t,e){var i;return t&&((i=a(e)?ge(t):ve(t,e))?ae=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ae._abbr}function ve(t,e){if(null!==e){var i,n=de;if(e.abbr=t,null!=le[t])T("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."),n=le[t]._config;else if(null!=e.parentLocale)if(null!=le[e.parentLocale])n=le[e.parentLocale]._config;else{if(null==(i=fe(e.parentLocale)))return ue[e.parentLocale]||(ue[e.parentLocale]=[]),ue[e.parentLocale].push({name:t,config:e}),null;n=i._config}return le[t]=new I(P(n,e)),ue[t]&&ue[t].forEach((function(t){ve(t.name,t.config)})),pe(t),le[t]}return delete le[t],null}function ge(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ae;if(!r(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,i,n,o,r=0;r<t.length;){for(e=(o=ce(t[r]).split("-")).length,i=(i=ce(t[r+1]))?i.split("-"):null;e>0;){if(n=fe(o.slice(0,e).join("-")))return n;if(i&&i.length>=e&&S(o,i,!0)>=e-1)break;e--}r++}return ae}(t)}function ye(t){var e,i=t._a;return i&&-2===p(t).overflow&&(e=i[mt]<0||i[mt]>11?mt:i[bt]<1||i[bt]>Nt(i[yt],i[mt])?bt:i[_t]<0||i[_t]>24||24===i[_t]&&(0!==i[wt]||0!==i[kt]||0!==i[xt])?_t:i[wt]<0||i[wt]>59?wt:i[kt]<0||i[kt]>59?kt:i[xt]<0||i[xt]>999?xt:-1,p(t)._overflowDayOfYear&&(e<yt||e>bt)&&(e=bt),p(t)._overflowWeeks&&-1===e&&(e=St),p(t)._overflowWeekday&&-1===e&&(e=Ot),p(t).overflow=e),t}function me(t,e,i){return null!=t?t:null!=e?e:i}function be(t){var e,i,n,r,s,a=[];if(!t._d){for(n=function(t){var e=new Date(o.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[bt]&&null==t._a[mt]&&function(t){var e,i,n,o,r,s,a,h;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,s=4,i=me(e.GG,t._a[yt],qt(Fe(),1,4).year),n=me(e.W,1),((o=me(e.E,1))<1||o>7)&&(h=!0);else{r=t._locale._week.dow,s=t._locale._week.doy;var d=qt(Fe(),r,s);i=me(e.gg,t._a[yt],d.year),n=me(e.w,d.week),null!=e.d?((o=e.d)<0||o>6)&&(h=!0):null!=e.e?(o=e.e+r,(e.e<0||e.e>6)&&(h=!0)):o=r}n<1||n>Zt(i,r,s)?p(t)._overflowWeeks=!0:null!=h?p(t)._overflowWeekday=!0:(a=Gt(i,n,o,r,s),t._a[yt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=me(t._a[yt],n[yt]),(t._dayOfYear>Dt(s)||0===t._dayOfYear)&&(p(t)._overflowDayOfYear=!0),i=Vt(s,0,t._dayOfYear),t._a[mt]=i.getUTCMonth(),t._a[bt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=n[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&0===t._a[xt]&&(t._nextDay=!0,t._a[_t]=0),t._d=(t._useUTC?Vt:Wt).apply(null,a),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[_t]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(p(t).weekdayMismatch=!0)}}var _e=/^\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)?)?$/,we=/^\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)?)?$/,ke=/Z|[+-]\d\d(?::?\d\d)?/,xe=[["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}/]],Se=[["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/]],Oe=/^\/?Date\((\-?\d+)/i;function De(t){var e,i,n,o,r,s,a=t._i,h=_e.exec(a)||we.exec(a);if(h){for(p(t).iso=!0,e=0,i=xe.length;e<i;e++)if(xe[e][1].exec(h[1])){o=xe[e][0],n=!1!==xe[e][2];break}if(null==o)return void(t._isValid=!1);if(h[3]){for(e=0,i=Se.length;e<i;e++)if(Se[e][1].exec(h[3])){r=(h[2]||" ")+Se[e][0];break}if(null==r)return void(t._isValid=!1)}if(!n&&null!=r)return void(t._isValid=!1);if(h[4]){if(!ke.exec(h[4]))return void(t._isValid=!1);s="Z"}t._f=o+(r||"")+(s||""),Pe(t)}else t._isValid=!1}var Me=/^(?:(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}))$/;function Ee(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}var Te={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ce(t){var e,i,n,o,r,s,a,h=Me.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(h){var d=(e=h[4],i=h[3],n=h[2],o=h[5],r=h[6],s=h[7],a=[Ee(e),Rt.indexOf(i),parseInt(n,10),parseInt(o,10),parseInt(r,10)],s&&a.push(parseInt(s,10)),a);if(!function(t,e,i){return!t||Kt.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(p(i).weekdayMismatch=!0,i._isValid=!1,!1)}(h[1],d,t))return;t._a=d,t._tzm=function(t,e,i){if(t)return Te[t];if(e)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}(h[8],h[9],h[10]),t._d=Vt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),p(t).rfc2822=!0}else t._isValid=!1}function Pe(t){if(t._f!==o.ISO_8601)if(t._f!==o.RFC_2822){t._a=[],p(t).empty=!0;var e,i,n,r,s,a=""+t._i,h=a.length,d=0;for(n=G(t._f,t._locale).match(L)||[],e=0;e<n.length;e++)r=n[e],(i=(a.match(ut(r,t))||[])[0])&&((s=a.substr(0,a.indexOf(i))).length>0&&p(t).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),d+=i.length),W[r]?(i?p(t).empty=!1:p(t).unusedTokens.push(r),gt(r,i,t)):t._strict&&!i&&p(t).unusedTokens.push(r);p(t).charsLeftOver=h-d,a.length>0&&p(t).unusedInput.push(a),t._a[_t]<=12&&!0===p(t).bigHour&&t._a[_t]>0&&(p(t).bigHour=void 0),p(t).parsedDateParts=t._a.slice(0),p(t).meridiem=t._meridiem,t._a[_t]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[_t],t._meridiem),be(t),ye(t)}else Ce(t);else De(t)}function Ie(t){var e=t._i,i=t._f;return t._locale=t._locale||ge(t._l),null===e||void 0===i&&""===e?g({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),w(e)?new _(ye(e)):(d(e)?t._d=e:r(i)?function(t){var e,i,n,o,r;if(0===t._f.length)return p(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;o<t._f.length;o++)r=0,e=m({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[o],Pe(e),v(e)&&(r+=p(e).charsLeftOver,r+=10*p(e).unusedTokens.length,p(e).score=r,(null==n||r<n)&&(n=r,i=e));c(t,i||e)}(t):i?Pe(t):function(t){var e=t._i;a(e)?t._d=new Date(o.now()):d(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=Oe.exec(t._i);null===e?(De(t),!1===t._isValid&&(delete t._isValid,Ce(t),!1===t._isValid&&(delete t._isValid,o.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):r(e)?(t._a=l(e.slice(0),(function(t){return parseInt(t,10)})),be(t)):s(e)?function(t){if(!t._d){var e=R(t._i);t._a=l([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),be(t)}}(t):h(e)?t._d=new Date(e):o.createFromInputFallback(t)}(t),v(t)||(t._d=null),t))}function Ne(t,e,i,n,o){var a,h={};return!0!==i&&!1!==i||(n=i,i=void 0),(s(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||r(t)&&0===t.length)&&(t=void 0),h._isAMomentObject=!0,h._useUTC=h._isUTC=o,h._l=i,h._i=t,h._f=e,h._strict=n,(a=new _(ye(Ie(h))))._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function Fe(t,e,i,n){return Ne(t,e,i,n,!1)}o.createFromInputFallback=D("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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),o.ISO_8601=function(){},o.RFC_2822=function(){};var Ae=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Fe.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:g()})),Re=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Fe.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:g()}));function Ye(t,e){var i,n;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Fe();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}var je=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ze(t){var e=R(t),i=e.year||0,n=e.quarter||0,o=e.month||0,r=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,h=e.minute||0,d=e.second||0,l=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===Et.call(je,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var i=!1,n=0;n<je.length;++n)if(t[je[n]]){if(i)return!1;parseFloat(t[je[n]])!==x(t[je[n]])&&(i=!0)}return!0}(e),this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+s+7*r,this._months=+o+3*n+12*i,this._data={},this._locale=ge(),this._bubble()}function Le(t){return t instanceof ze}function Be(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function He(t,e){V(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+z(~~(t/60),2)+e+z(~~t%60,2)}))}He("Z",":"),He("ZZ",""),lt("Z",at),lt("ZZ",at),pt(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=Ve(at,t)}));var We=/([\+\-]|\d\d)/gi;function Ve(t,e){var i=(e||"").match(t);if(null===i)return null;var n=((i[i.length-1]||[])+"").match(We)||["-",0,0],o=60*n[1]+x(n[2]);return 0===o?0:"+"===n[0]?o:-o}function Ue(t,e){var i,n;return e._isUTC?(i=e.clone(),n=(w(t)||d(t)?t.valueOf():Fe(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),o.updateOffset(i,!1),i):Fe(t).local()}function Ge(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function qe(){return!!this.isValid()&&this._isUTC&&0===this._offset}o.updateOffset=function(){};var Ze=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Xe=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $e(t,e){var i,n,o,r,s,a,d=t,l=null;return Le(t)?d={ms:t._milliseconds,d:t._days,M:t._months}:h(t)?(d={},e?d[e]=t:d.milliseconds=t):(l=Ze.exec(t))?(i="-"===l[1]?-1:1,d={y:0,d:x(l[bt])*i,h:x(l[_t])*i,m:x(l[wt])*i,s:x(l[kt])*i,ms:x(Be(1e3*l[xt]))*i}):(l=Xe.exec(t))?(i="-"===l[1]?-1:1,d={y:Ke(l[2],i),M:Ke(l[3],i),w:Ke(l[4],i),d:Ke(l[5],i),h:Ke(l[6],i),m:Ke(l[7],i),s:Ke(l[8],i)}):null==d?d={}:"object"==typeof d&&("from"in d||"to"in d)&&(r=Fe(d.from),s=Fe(d.to),o=r.isValid()&&s.isValid()?(s=Ue(s,r),r.isBefore(s)?a=Je(r,s):((a=Je(s,r)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0},(d={}).ms=o.milliseconds,d.M=o.months),n=new ze(d),Le(t)&&u(t,"_locale")&&(n._locale=t._locale),n}function Ke(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Je(t,e){var i={};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Qe(t,e){return function(i,n){var o;return null===n||isNaN(+n)||(T(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),ti(this,$e(i="string"==typeof i?+i:i,n),t),this}}function ti(t,e,i,n){var r=e._milliseconds,s=Be(e._days),a=Be(e._months);t.isValid()&&(n=null==n||n,a&&jt(t,Pt(t,"Month")+a*i),s&&It(t,"Date",Pt(t,"Date")+s*i),r&&t._d.setTime(t._d.valueOf()+r*i),n&&o.updateOffset(t,s||a))}$e.fn=ze.prototype,$e.invalid=function(){return $e(NaN)};var ei=Qe(1,"add"),ii=Qe(-1,"subtract");function ni(t,e){var i=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(i,"months");return-(i+(e-n<0?(e-n)/(n-t.clone().add(i-1,"months")):(e-n)/(t.clone().add(i+1,"months")-n)))||0}function oi(t){var e;return void 0===t?this._locale._abbr:(null!=(e=ge(t))&&(this._locale=e),this)}o.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",o.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ri=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function si(){return this._locale}var ai=1e3,hi=60*ai,di=60*hi,li=3506328*di;function ui(t,e){return(t%e+e)%e}function ci(t,e,i){return t<100&&t>=0?new Date(t+400,e,i)-li:new Date(t,e,i).valueOf()}function fi(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-li:Date.UTC(t,e,i)}function pi(t,e){V(0,[t,t.length],0,e)}function vi(t,e,i,n,o){var r;return null==t?qt(this,n,o).year:(e>(r=Zt(t,n,o))&&(e=r),gi.call(this,t,e,i,n,o))}function gi(t,e,i,n,o){var r=Gt(t,e,i,n,o),s=Vt(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}V(0,["gg",2],0,(function(){return this.weekYear()%100})),V(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),pi("gggg","weekYear"),pi("ggggg","weekYear"),pi("GGGG","isoWeekYear"),pi("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),j("weekYear",1),j("isoWeekYear",1),lt("G",rt),lt("g",rt),lt("GG",J,Z),lt("gg",J,Z),lt("GGGG",it,$),lt("gggg",it,$),lt("GGGGG",nt,K),lt("ggggg",nt,K),vt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=x(t)})),vt(["gg","GG"],(function(t,e,i,n){e[n]=o.parseTwoDigitYear(t)})),V("Q",0,"Qo","quarter"),F("quarter","Q"),j("quarter",7),lt("Q",q),pt("Q",(function(t,e){e[mt]=3*(x(t)-1)})),V("D",["DD",2],"Do","date"),F("date","D"),j("date",9),lt("D",J),lt("DD",J,Z),lt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),pt(["D","DD"],bt),pt("Do",(function(t,e){e[bt]=x(t.match(J)[0])}));var yi=Ct("Date",!0);V("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),j("dayOfYear",4),lt("DDD",et),lt("DDDD",X),pt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=x(t)})),V("m",["mm",2],0,"minute"),F("minute","m"),j("minute",14),lt("m",J),lt("mm",J,Z),pt(["m","mm"],wt);var mi=Ct("Minutes",!1);V("s",["ss",2],0,"second"),F("second","s"),j("second",15),lt("s",J),lt("ss",J,Z),pt(["s","ss"],kt);var bi,_i=Ct("Seconds",!1);for(V("S",0,0,(function(){return~~(this.millisecond()/100)})),V(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),V(0,["SSS",3],0,"millisecond"),V(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),V(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),V(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),V(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),V(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),V(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),F("millisecond","ms"),j("millisecond",16),lt("S",et,q),lt("SS",et,Z),lt("SSS",et,X),bi="SSSS";bi.length<=9;bi+="S")lt(bi,ot);function wi(t,e){e[xt]=x(1e3*("0."+t))}for(bi="S";bi.length<=9;bi+="S")pt(bi,wi);var ki=Ct("Milliseconds",!1);V("z",0,0,"zoneAbbr"),V("zz",0,0,"zoneName");var xi=_.prototype;function Si(t){return t}xi.add=ei,xi.calendar=function(t,e){var i=t||Fe(),n=Ue(i,this).startOf("day"),r=o.calendarFormat(this,n)||"sameElse",s=e&&(C(e[r])?e[r].call(this,i):e[r]);return this.format(s||this.localeData().calendar(r,this,Fe(i)))},xi.clone=function(){return new _(this)},xi.diff=function(t,e,i){var n,o,r;if(!this.isValid())return NaN;if(!(n=Ue(t,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),e=A(e)){case"year":r=ni(this,n)/12;break;case"month":r=ni(this,n);break;case"quarter":r=ni(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-o)/864e5;break;case"week":r=(this-n-o)/6048e5;break;default:r=this-n}return i?r:k(r)},xi.endOf=function(t){var e;if(void 0===(t=A(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?fi:ci;switch(t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=di-ui(e+(this._isUTC?0:this.utcOffset()*hi),di)-1;break;case"minute":e=this._d.valueOf(),e+=hi-ui(e,hi)-1;break;case"second":e=this._d.valueOf(),e+=ai-ui(e,ai)-1}return this._d.setTime(e),o.updateOffset(this,!0),this},xi.format=function(t){t||(t=this.isUtc()?o.defaultFormatUtc:o.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},xi.from=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Fe(t).isValid())?$e({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},xi.fromNow=function(t){return this.from(Fe(),t)},xi.to=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Fe(t).isValid())?$e({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},xi.toNow=function(t){return this.to(Fe(),t)},xi.get=function(t){return C(this[t=A(t)])?this[t]():this},xi.invalidAt=function(){return p(this).overflow},xi.isAfter=function(t,e){var i=w(t)?t:Fe(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=A(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())},xi.isBefore=function(t,e){var i=w(t)?t:Fe(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=A(e)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())},xi.isBetween=function(t,e,i,n){var o=w(t)?t:Fe(t),r=w(e)?e:Fe(e);return!!(this.isValid()&&o.isValid()&&r.isValid())&&("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(r,i):!this.isAfter(r,i))},xi.isSame=function(t,e){var i,n=w(t)?t:Fe(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=A(e)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))},xi.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},xi.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},xi.isValid=function(){return v(this)},xi.lang=ri,xi.locale=oi,xi.localeData=si,xi.max=Re,xi.min=Ae,xi.parsingFlags=function(){return c({},p(this))},xi.set=function(t,e){if("object"==typeof t)for(var i=function(t){var e=[];for(var i in t)e.push({unit:i,priority:Y[i]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=R(t)),n=0;n<i.length;n++)this[i[n].unit](t[i[n].unit]);else if(C(this[t=A(t)]))return this[t](e);return this},xi.startOf=function(t){var e;if(void 0===(t=A(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?fi:ci;switch(t){case"year":e=i(this.year(),0,1);break;case"quarter":e=i(this.year(),this.month()-this.month()%3,1);break;case"month":e=i(this.year(),this.month(),1);break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=i(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=ui(e+(this._isUTC?0:this.utcOffset()*hi),di);break;case"minute":e=this._d.valueOf(),e-=ui(e,hi);break;case"second":e=this._d.valueOf(),e-=ui(e,ai)}return this._d.setTime(e),o.updateOffset(this,!0),this},xi.subtract=ii,xi.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},xi.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},xi.toDate=function(){return new Date(this.valueOf())},xi.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,i=e?this.clone().utc():this;return i.year()<0||i.year()>9999?U(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(i,"Z")):U(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},xi.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+o)},xi.toJSON=function(){return this.isValid()?this.toISOString():null},xi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},xi.unix=function(){return Math.floor(this.valueOf()/1e3)},xi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},xi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},xi.year=Tt,xi.isLeapYear=function(){return Mt(this.year())},xi.weekYear=function(t){return vi.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},xi.isoWeekYear=function(t){return vi.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},xi.quarter=xi.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},xi.month=zt,xi.daysInMonth=function(){return Nt(this.year(),this.month())},xi.week=xi.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},xi.isoWeek=xi.isoWeeks=function(t){var e=qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},xi.weeksInYear=function(){var t=this.localeData()._week;return Zt(this.year(),t.dow,t.doy)},xi.isoWeeksInYear=function(){return Zt(this.year(),1,4)},xi.date=yi,xi.day=xi.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},xi.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},xi.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},xi.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},xi.hour=xi.hours=he,xi.minute=xi.minutes=mi,xi.second=xi.seconds=_i,xi.millisecond=xi.milliseconds=ki,xi.utcOffset=function(t,e,i){var n,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ve(at,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(n=Ge(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),r!==t&&(!e||this._changeInProgress?ti(this,$e(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,o.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ge(this)},xi.utc=function(t){return this.utcOffset(0,t)},xi.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ge(this),"m")),this},xi.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ve(st,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},xi.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Fe(t).utcOffset():0,(this.utcOffset()-t)%60==0)},xi.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},xi.isLocal=function(){return!!this.isValid()&&!this._isUTC},xi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},xi.isUtc=qe,xi.isUTC=qe,xi.zoneAbbr=function(){return this._isUTC?"UTC":""},xi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},xi.dates=D("dates accessor is deprecated. Use date instead.",yi),xi.months=D("months accessor is deprecated. Use month instead",zt),xi.years=D("years accessor is deprecated. Use year instead",Tt),xi.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),xi.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var t={};if(m(t,this),(t=Ie(t))._a){var e=t._isUTC?f(t._a):Fe(t._a);this._isDSTShifted=this.isValid()&&S(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Oi=I.prototype;function Di(t,e,i,n){var o=ge(),r=f().set(n,e);return o[i](r,t)}function Mi(t,e,i){if(h(t)&&(e=t,t=void 0),t=t||"",null!=e)return Di(t,e,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=Di(t,n,i,"month");return o}function Ei(t,e,i,n){"boolean"==typeof t?(h(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,h(e)&&(i=e,e=void 0),e=e||"");var o,r=ge(),s=t?r._week.dow:0;if(null!=i)return Di(e,(i+s)%7,n,"day");var a=[];for(o=0;o<7;o++)a[o]=Di(e,(o+s)%7,n,"day");return a}Oi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return C(n)?n.call(e,i):n},Oi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Oi.invalidDate=function(){return this._invalidDate},Oi.ordinal=function(t){return this._ordinal.replace("%d",t)},Oi.preparse=Si,Oi.postformat=Si,Oi.relativeTime=function(t,e,i,n){var o=this._relativeTime[i];return C(o)?o(t,e,i,n):o.replace(/%d/i,t)},Oi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return C(i)?i(e):i.replace(/%s/i,e)},Oi.set=function(t){var e,i;for(i in t)C(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Oi.months=function(t,e){return t?r(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Ft).test(e)?"format":"standalone"][t.month()]:r(this._months)?this._months:this._months.standalone},Oi.monthsShort=function(t,e){return t?r(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Ft.test(e)?"format":"standalone"][t.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Oi.monthsParse=function(t,e,i){var n,o,r;if(this._monthsParseExact)return Yt.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=f([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},Oi.monthsRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=Bt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Oi.monthsShortRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Lt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Oi.week=function(t){return qt(t,this._week.dow,this._week.doy).week},Oi.firstDayOfYear=function(){return this._week.doy},Oi.firstDayOfWeek=function(){return this._week.dow},Oi.weekdays=function(t,e){var i=r(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Xt(i,this._week.dow):t?i[t.day()]:i},Oi.weekdaysMin=function(t){return!0===t?Xt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Oi.weekdaysShort=function(t){return!0===t?Xt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Oi.weekdaysParse=function(t,e,i){var n,o,r;if(this._weekdaysParseExact)return Qt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=f([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},Oi.weekdaysRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Oi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Oi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ie),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Oi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Oi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},pe("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===x(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),o.lang=D("moment.lang is deprecated. Use moment.locale instead.",pe),o.langData=D("moment.langData is deprecated. Use moment.localeData instead.",ge);var Ti=Math.abs;function Ci(t,e,i,n){var o=$e(e,i);return t._milliseconds+=n*o._milliseconds,t._days+=n*o._days,t._months+=n*o._months,t._bubble()}function Pi(t){return t<0?Math.floor(t):Math.ceil(t)}function Ii(t){return 4800*t/146097}function Ni(t){return 146097*t/4800}function Fi(t){return function(){return this.as(t)}}var Ai=Fi("ms"),Ri=Fi("s"),Yi=Fi("m"),ji=Fi("h"),zi=Fi("d"),Li=Fi("w"),Bi=Fi("M"),Hi=Fi("Q"),Wi=Fi("y");function Vi(t){return function(){return this.isValid()?this._data[t]:NaN}}var Ui=Vi("milliseconds"),Gi=Vi("seconds"),qi=Vi("minutes"),Zi=Vi("hours"),Xi=Vi("days"),$i=Vi("months"),Ki=Vi("years"),Ji=Math.round,Qi={ss:44,s:45,m:45,h:22,d:26,M:11};function tn(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}var en=Math.abs;function nn(t){return(t>0)-(t<0)||+t}function on(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=en(this._milliseconds)/1e3,n=en(this._days),o=en(this._months);t=k(i/60),e=k(t/60),i%=60,t%=60;var r=k(o/12),s=o%=12,a=n,h=e,d=t,l=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",f=nn(this._months)!==nn(u)?"-":"",p=nn(this._days)!==nn(u)?"-":"",v=nn(this._milliseconds)!==nn(u)?"-":"";return c+"P"+(r?f+r+"Y":"")+(s?f+s+"M":"")+(a?p+a+"D":"")+(h||d||l?"T":"")+(h?v+h+"H":"")+(d?v+d+"M":"")+(l?v+l+"S":"")}var rn=ze.prototype;return rn.isValid=function(){return this._isValid},rn.abs=function(){var t=this._data;return this._milliseconds=Ti(this._milliseconds),this._days=Ti(this._days),this._months=Ti(this._months),t.milliseconds=Ti(t.milliseconds),t.seconds=Ti(t.seconds),t.minutes=Ti(t.minutes),t.hours=Ti(t.hours),t.months=Ti(t.months),t.years=Ti(t.years),this},rn.add=function(t,e){return Ci(this,t,e,1)},rn.subtract=function(t,e){return Ci(this,t,e,-1)},rn.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=A(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Ii(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Ni(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},rn.asMilliseconds=Ai,rn.asSeconds=Ri,rn.asMinutes=Yi,rn.asHours=ji,rn.asDays=zi,rn.asWeeks=Li,rn.asMonths=Bi,rn.asQuarters=Hi,rn.asYears=Wi,rn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*x(this._months/12):NaN},rn._bubble=function(){var t,e,i,n,o,r=this._milliseconds,s=this._days,a=this._months,h=this._data;return r>=0&&s>=0&&a>=0||r<=0&&s<=0&&a<=0||(r+=864e5*Pi(Ni(a)+s),s=0,a=0),h.milliseconds=r%1e3,t=k(r/1e3),h.seconds=t%60,e=k(t/60),h.minutes=e%60,i=k(e/60),h.hours=i%24,s+=k(i/24),o=k(Ii(s)),a+=o,s-=Pi(Ni(o)),n=k(a/12),a%=12,h.days=s,h.months=a,h.years=n,this},rn.clone=function(){return $e(this)},rn.get=function(t){return t=A(t),this.isValid()?this[t+"s"]():NaN},rn.milliseconds=Ui,rn.seconds=Gi,rn.minutes=qi,rn.hours=Zi,rn.days=Xi,rn.weeks=function(){return k(this.days()/7)},rn.months=$i,rn.years=Ki,rn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=function(t,e,i){var n=$e(t).abs(),o=Ji(n.as("s")),r=Ji(n.as("m")),s=Ji(n.as("h")),a=Ji(n.as("d")),h=Ji(n.as("M")),d=Ji(n.as("y")),l=o<=Qi.ss&&["s",o]||o<Qi.s&&["ss",o]||r<=1&&["m"]||r<Qi.m&&["mm",r]||s<=1&&["h"]||s<Qi.h&&["hh",s]||a<=1&&["d"]||a<Qi.d&&["dd",a]||h<=1&&["M"]||h<Qi.M&&["MM",h]||d<=1&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=i,tn.apply(null,l)}(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},rn.toISOString=on,rn.toString=on,rn.toJSON=on,rn.locale=oi,rn.localeData=si,rn.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",on),rn.lang=ri,V("X",0,0,"unix"),V("x",0,0,"valueOf"),lt("x",rt),lt("X",/[+-]?\d+(\.\d{1,3})?/),pt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),pt("x",(function(t,e,i){i._d=new Date(x(t))})),o.version="2.24.0",i=Fe,o.fn=xi,o.min=function(){return Ye("isBefore",[].slice.call(arguments,0))},o.max=function(){return Ye("isAfter",[].slice.call(arguments,0))},o.now=function(){return Date.now?Date.now():+new Date},o.utc=f,o.unix=function(t){return Fe(1e3*t)},o.months=function(t,e){return Mi(t,e,"months")},o.isDate=d,o.locale=pe,o.invalid=g,o.duration=$e,o.isMoment=w,o.weekdays=function(t,e,i){return Ei(t,e,i,"weekdays")},o.parseZone=function(){return Fe.apply(null,arguments).parseZone()},o.localeData=ge,o.isDuration=Le,o.monthsShort=function(t,e){return Mi(t,e,"monthsShort")},o.weekdaysMin=function(t,e,i){return Ei(t,e,i,"weekdaysMin")},o.defineLocale=ve,o.updateLocale=function(t,e){if(null!=e){var i,n,o=de;null!=(n=fe(t))&&(o=n._config),e=P(o,e),(i=new I(e)).parentLocale=le[t],le[t]=i,pe(t)}else null!=le[t]&&(null!=le[t].parentLocale?le[t]=le[t].parentLocale:null!=le[t]&&delete le[t]);return le[t]},o.locales=function(){return M(le)},o.weekdaysShort=function(t,e,i){return Ei(t,e,i,"weekdaysShort")},o.normalizeUnits=A,o.relativeTimeRounding=function(t){return void 0===t?Ji:"function"==typeof t&&(Ji=t,!0)},o.relativeTimeThreshold=function(t,e){return void 0!==Qi[t]&&(void 0===e?Qi[t]:(Qi[t]=e,"s"===t&&(Qi.ss=e-1),!0))},o.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},o.prototype=xi,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}()})),By="undefined"!=typeof window&&window.moment||Ly,Hy=Object.freeze({__proto__:null,default:By,__moduleExports:By}),Wy={Images:ec,dotparser:bd,gephiParser:Od,allOptions:My,convertDot:yd,convertGephi:Sd},Vy=Object.freeze({__proto__:null,network:Wy,DOMutil:zy,util:aa,data:nf,moment:Hy,Hammer:Ru,keycharm:Ed,DataSet:Qc,DataView:tf,Queue:Uc,Network:Cy});export default Vy;export{zy as DOMutil,Qc as DataSet,tf as DataView,Ru as Hammer,Cy as Network,Uc as Queue,nf as data,Ed as keycharm,Hy as moment,Wy as network,aa as util};
53//# sourceMappingURL=vis-network.esm.min.js.map