root = ElementTree.parse(_file).getroot()
return [node.get('name') for node in root.findall('entry')]
+ def get_package_build_result(self, project):
+ """ Get built result of the project """
+
+ url = core.makeurl(self.apiurl, ['build', project, '_result'])
+ _file = core.http_GET(url)
+
+ build_result = {}
+ root = ElementTree.parse(_file).getroot()
+ for project_status in root.findall('result'):
+ repo = project_status.attrib['repository']
+ if repo not in build_result:
+ build_result[repo] = {}
+ arch = project_status.attrib['arch']
+ if arch not in build_result[repo]:
+ build_result[repo][arch] = {}
+ for package_status in project_status.findall('status'):
+ package_name = package_status.attrib['package']
+ package_status = package_status.attrib['code']
+ build_result[repo][arch][package_name] = package_status
+
+ return build_result
+
def get_build_log(self, project, target, package, offset=0):
"""
get_build_log(project, target, package, offset=0) -> str
saved_info = self.get_info(prj, pkg)
projects = saved_info.get('projects') or []
+ packages = saved_info.get('packages') or []
images = saved_info.get('images') or []
submitter = saved_info.get('submitter') or []
saved_info.update(info)
if 'projects' in info:
saved_info['projects'] = list(set(projects + info['projects']))
+ if 'packages' in info:
+ saved_info['packages'] = list(set(packages + info['packages']))
if 'submitter' in info:
if not info['submitter'] in submitter:
saved_info['submitter'] = (submitter + ',' + info['submitter'])
--- /dev/null
+<!doctype html>
+<html>
+<head>
+ <title>%graph% for package %package%</title>
+
+ <script type="text/javascript" src="%vis_dir%/dist/vis.js"></script>
+ <link href="%vis_dir%/dist/vis.css" rel="stylesheet" type="text/css" />
+ <link href="%dep_graph_dir%/dep_graph.css" rel="stylesheet" type="text/css" />
+
+ <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
+ <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
+ <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
+
+
+ <style type="text/css">
+ #mynetwork {
+ width: 100%;
+ height: 800px;
+ border: 1px solid lightgray;
+ }
+ </style>
+
+</head>
+<body>
+
+<table>
+<tr>
+ <th colspan=3>%graph% for package %package%</th>
+</tr>
+<tr>
+ <th>OBS package name</th>
+ <td>
+<input type="text" name="node_name" id="node_name" OnKeyPress="Javascript: OnKeyPress_node_name(event);" />
+<button onclick="FocusNode()">Find</button>
+ </td>
+ <td align="center" id="partial_edge_link">
+ <a href="%package%.php">partial edge graph</a>
+ </td>
+</tr>
+<tr>
+ <th>PackageName</th>
+ <td id='pkg_name'>Click a package to see its name.</td>
+ <td align="center" id="full_edge_link">
+ <a href="%package%_full_edges.php">full edge graph</a>
+ </td>
+</tr>
+<tr>
+ <th>BuildLevel</th>
+ <td id='build_level'>Click a package to see its build level.</td>
+ <td align="center" id="partial_edge_link">
+ <a href="%package%_reverse.php">partial edge graph (reverse)</a>
+ </td>
+</tr>
+<tr>
+ <th>Max build level</th>
+ <td id='max_build_level'></td>
+ <td align="center" id="full_edge_link">
+ <a href="%package%_reverse_full_edges.php">full edge graph (reverse)</a>
+ </td>
+</tr>
+<tr>
+ <th>Total packages</th>
+ <td id='total_packages'></td>
+ <td align="center">
+ <a href="full.php">full dependency graph</a><br>
+ </td>
+</tr>
+<tr>
+ <th id="level_range">Level (0~0)</th>
+ <td align="center">
+ <div id="slider-range" style="width:80%"></div>
+ </td>
+ <td align="center">
+ <a href="full_full_edges.php">full dependency graph (full_edges)</a><br>
+ </td>
+</tr>
+</table>
+
+<div id="config"></div>
+<br>
+<button id="toggle_button" style="width:100%" onclick="toggle_network()">▼Show dependency graph▼</button>
+<br>
+<div id="mynetwork" style="display:none;"></div>
+<br>
+
+<table width="100%">
+<tr>
+ <th width="20%" id='build_triggers'>Packages build-triggers this package</th>
+ <td id='packages_build_triggers'></td>
+</tr>
+<tr>
+ <th width="20%" id='build_triggered'>Packages build-triggered by this package</th>
+ <td id='packages_build_triggered'></td>
+</tr>
+</table>
+<br>
+
+<table id='level_packages'>
+</table>
+
+<script type="text/javascript" src=%src.js%></script>
+<script type="text/javascript" src="%dep_graph_dir%/dep_graph%full_edges%.js"></script>
+<script type="text/javascript" src="%dep_graph_dir%/dep_graph_common.js"></script>
+<script type="text/javascript" src="%dep_graph_dir%/slider.js"></script>
+</body>
+</html>
+
+
--- /dev/null
+<!doctype html>
+<html>
+<head>
+ <title>%graph% for package %package%</title>
+
+ <script type="text/javascript" src="%vis_dir%/dist/vis.js"></script>
+ <link href="%vis_dir%/dist/vis.css" rel="stylesheet" type="text/css" />
+ <link href="%dep_graph_dir%/dep_graph.css" rel="stylesheet" type="text/css" />
+
+ <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
+ <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
+ <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
+
+
+ <style type="text/css">
+ #mynetwork {
+ width: 100%;
+ height: 800px;
+ border: 1px solid lightgray;
+ }
+ </style>
+
+</head>
+<body>
+
+<div id="config"></div>
+<div id="mynetwork"></div>
+
+<script type="text/javascript">
+<?php
+function CallRestAPI($method, $url, $user="", $pw="", $data = false)
+{
+ $curl = curl_init();
+
+ switch ($method)
+ {
+ case "POST":
+ curl_setopt($curl, CURLOPT_POST, 1);
+
+ if ($data)
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
+ break;
+ case "PUT":
+ curl_setopt($curl, CURLOPT_PUT, 1);
+ break;
+ default:
+ if ($data)
+ $url = sprintf("%s?%s", $url, http_build_query($data));
+ }
+
+ // Optional Authentication:
+ if ( $user != "" ) {
+ curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
+ curl_setopt($curl, CURLOPT_USERPWD, "$user:$pw");
+ }
+
+ curl_setopt($curl, CURLOPT_URL, $url);
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+
+ $result = curl_exec($curl);
+
+ curl_close($curl);
+
+ return $result;
+}
+
+function GetBuildStatusFromOBS($obs_api_url, $project, $repo, $arch, $username, $pw) {
+ $url = $obs_api_url . "/build/". $project . "/_result?repository=" . $repo . "&arch=" . $arch;
+ $response = CallRestAPI("GET", $url, $username, $pw);
+ $xml_data = simplexml_load_string($response);
+ $build_status = array();
+ foreach ($xml_data->result->status as $key => $value) {
+ if( $key == "status" ) {
+ $pkg = $value["package"];
+ $status=$value["code"];
+ $build_status["$pkg"] = "$status";
+ }
+ }
+
+ return $build_status;
+}
+
+function GetBuildStatusFromDB($mysql_ip, $mysql_username, $mysql_pw, $mysql_db, $mysql_build_target_id) {
+ $conn = new mysqli($mysql_ip, $mysql_username, $mysql_pw, $mysql_db);
+
+ if( $conn->connect_error ) {
+ die("connection failed: ". $conn->connect_error);
+ }
+
+ $sql = "SELECT info_package.package_name,build_package.build_status FROM build_package,info_package WHERE build_package.last_flag='Y' AND build_package.info_package_id=info_package.id AND build_package.build_target_id=" . $mysql_build_target_id;
+#echo $sql;
+ $result = $conn->query($sql);
+
+ $build_status = array();
+ if( $result->num_rows > 0 ) {
+ while($row = $result->fetch_assoc()) {
+#echo "package_name : ". $row["package_name"] . ", build_status:" . $row["build_status"] . "<br>";
+ $build_status[$row["package_name"]] = strtolower($row["build_status"]);
+ }
+ }
+ $conn->close();
+
+ return $build_status;
+}
+
+
+if ( "%get_build_status_from%" == "get_build_status_from_obs" ) {
+ $obs_api_url="%obs_api_url%";
+ $obs_username="%obs_username%";
+ $obs_pw="%obs_pw%";
+ $obs_project="%obs_project%";
+ $obs_repo="%obs_repo%";
+ $obs_arch="%obs_arch%";
+
+ $build_status = GetBuildStatusFromOBS($obs_api_url, $obs_project, $obs_repo, $obs_arch, $obs_username, $obs_pw);
+
+ print "var package_buildinfo = {";
+ foreach ($build_status as $key => $value) {
+ print "\"".$key."\": \"".$value."\",";
+ }
+ print "};";
+
+} elseif ( "%get_build_status_from%" == "get_build_status_from_mysql") {
+ // get build status from DB.
+ $mysql_ip = "%mysql_ip%";
+ $mysql_username = "%mysql_username%";
+ $mysql_pw = "%mysql_pw%";
+ $mysql_db = "%mysql_db%";
+ $mysql_build_target_id = "%mysql_build_target_id%";
+
+ $build_status = GetBuildStatusFromDB($mysql_ip, $mysql_username, $mysql_pw, $mysql_db, $mysql_build_target_id);
+
+ print "var package_buildinfo = {";
+ foreach ($build_status as $key => $value) {
+ print "\"".$key."\": \"".$value."\",";
+ }
+ print "};";
+
+}
+
+?>
+</script>
+
+
+<script type="text/javascript" src=%src.js%></script>
+<script type="text/javascript" src="buildinfo.js"></script>
+<script type="text/javascript" src="%dep_graph_dir%/dep_graph%full_edges%.js"></script>
+<script type="text/javascript" src="%dep_graph_dir%/dep_graph_common.js"></script>
+
+</body>
+</html>
--- /dev/null
+#!/usr/bin/python
+import sys
+import os
+import datetime, time
+import xml.etree.ElementTree as ElementTree
+import pprint
+import re
+import shutil
+
+from optparse import OptionParser
+
+sub_pkg_edges={}
+pkg_id={}
+main_sub_pkg={}
+pkg_print_index={}
+sub_main_pkg={}
+dep_edges=set()
+sorted_packages=[]
+main_pkg_level={}
+reduced_edges={}
+reduced_edges_reverse={}
+
+git_obs_mapping={}
+
+obs_api_url="http://10.113.76.103:81"
+obs_project="Tizen:Mobile"
+obs_repo="arm-wayland"
+obs_arch="armv7l"
+obs_username="Admin"
+obs_pw="opensuse"
+
+mysql_ip="10.113.76.58"
+mysql_username="terminiuser"
+mysql_pw="1qaz2wsx"
+mysql_db="terminidb"
+mysql_build_target_id="26"
+get_build_status_from="get_build_status_from_obs"
+#-------------------------------------------------------------------------------
+def MakeGitOBSMapping():
+ if len(git_obs_mapping) > 0:
+ return
+
+ git_obs_mapping_file="git-obs-mapping/profiles/tizen_mobile.xml"
+ if not os.path.isfile(git_obs_mapping_file):
+ print "If you want use --git-packages we need :",git_obs_mapping_file
+ exit(0)
+ tree = ElementTree.parse(git_obs_mapping_file)
+ root = tree.getroot()
+ for proj in root.iter('project'):
+ git_name=proj.get('name')
+ obs_name=proj.get('OBS_package')
+ if obs_name is not None:
+ git_obs_mapping[git_name]=obs_name
+
+#-------------------------------------------------------------------------------
+def TranslateGitOBSMapping(git_packages):
+ MakeGitOBSMapping()
+ obs_packages=[]
+ for p in git_packages:
+ if p not in git_obs_mapping:
+ print p,": No such git project."
+ exit(0)
+ obs_packages.append(git_obs_mapping[p]);
+ return obs_packages
+
+#-------------------------------------------------------------------------------
+def GetBuiltPackageList(filename):
+ package_list=[]
+ f = open(filename, 'r')
+ for line in f:
+ package_list.append(line.split("\n")[0])
+ f.close()
+
+ return package_list
+
+#-------------------------------------------------------------------------------
+def MergeSets(set_list):
+ list_len = len(set_list)
+ changed=1
+ while(changed):
+ changed=0
+ i = 0
+ while ( i < list_len ):
+ j=i+1
+ while ( j < list_len ):
+ if len(set_list[i] & set_list[j]) > 0:
+ changed=1
+ set_list[i] = set_list[i] | set_list[j]
+ set_list.remove(set_list[j])
+ list_len = len(set_list)
+ j=j+1
+ i=i+1
+
+ return set_list
+
+#-------------------------------------------------------------------------------
+def FindPath(src_pkg, dst_pkg, edges_local):
+ visited=set()
+ path=set()
+
+ def visit(pkg):
+ if pkg in visited:
+ return False
+
+ if pkg == dst_pkg:
+ return True
+
+ visited.add(pkg)
+ path.add(pkg)
+ if pkg in edges_local:
+ for d_pkg in edges_local[pkg]:
+ visit(d_pkg)
+ path.remove(pkg)
+
+ return False
+
+ return visit(src_pkg)
+
+
+#-------------------------------------------------------------------------------
+def MakeEdges(nodes, sorted_packages, dep_packages, cycle_edges, reduced_edges):
+ edges=set()
+
+ level=0
+ while( level < len(sorted_packages)-1):
+ for src_pkg in sorted_packages[level]:
+ next_level = level+1
+ for dst_pkg in sorted_packages[next_level]:
+ if src_pkg in dep_packages and dst_pkg in dep_packages[src_pkg]:
+ edges.add((src_pkg, dst_pkg, 'false'))
+ #insert reduced edge if not found.
+ if src_pkg in reduced_edges:
+ for e in reduced_edges[src_pkg]:
+ if e[0] == src_pkg and e not in edges:
+ edges.add(e)
+ level=level+1
+
+
+ for src_pkg,dst_pkgs in cycle_edges.items():
+ for dp in dst_pkgs:
+ if src_pkg in nodes and dp in nodes:
+ edges.add((src_pkg, dp, 'true'))
+
+ return edges
+
+#-------------------------------------------------------------------------------
+def MakeFullEdgePackageLevel(nodes, level0_packages, dep_packages, cycle_edges):
+ full_package_level={}
+ inserted_pkgs=set()
+ total_pkgs=len(nodes)
+ pkg_count=0
+ level_packages=[]
+
+ level=0
+ level_packages.append([])
+ for pkg in level0_packages:
+ full_package_level[pkg]=level
+ level_packages[level].append(pkg)
+ inserted_pkgs.add(pkg)
+ pkg_count=pkg_count+1
+
+ while( pkg_count < total_pkgs ):
+ #print "[", level, "] pkgs: ", pkg_count, ", ", total_pkgs
+ level = level + 1
+ last_level = level - 1
+ level_packages.append([])
+ for pkg in level_packages[last_level]:
+ if pkg in dep_packages:
+ for dst_pkg in dep_packages[pkg]:
+ if dst_pkg not in inserted_pkgs and dst_pkg in nodes:
+ full_package_level[dst_pkg]=level
+ level_packages[level].append(dst_pkg)
+ inserted_pkgs.add(dst_pkg)
+ pkg_count=pkg_count+1
+
+ if pkg in cycle_edges:
+ for dst_pkg in cycle_edges[pkg]:
+ if dst_pkg not in inserted_pkgs and dst_pkg in nodes:
+ full_package_level[dst_pkg]=level
+ level_packages[level].append(dst_pkg)
+ inserted_pkgs.add(dst_pkg)
+ pkg_count=pkg_count+1
+
+ return full_package_level
+
+#-------------------------------------------------------------------------------
+def MakeFullEdges(nodes, dep_packages):
+ edges=set()
+
+ for pkg in nodes:
+ if pkg in dep_packages:
+ for dst_pkg in dep_packages[pkg]:
+ if dst_pkg in nodes:
+ edges.add((pkg, dst_pkg, 'false'))
+
+ return edges
+
+#-------------------------------------------------------------------------------
+def CalcBuildLevel(pkg_begin, nodes, dep_packages, in_edge_count):
+ level=0
+ level_packages=[]
+ total_pkg_count=len(nodes)
+ pkg_count=0
+ pkgs_processed=set()
+ level2_pkg_count=0
+
+ # for level0 packages.
+ level_packages.append([])
+ for pkg in nodes:
+ if pkg not in in_edge_count or in_edge_count[pkg] == 0:
+ level_packages[level].append(pkg)
+ pkg_count = pkg_count + 1
+ pkgs_processed.add(pkg)
+
+ while(pkg_count < total_pkg_count):
+ level=level+1
+ last_level=level-1
+ level_packages.append([])
+ for pkg in level_packages[last_level]:
+ if pkg in dep_packages:
+ for dst_pkg in dep_packages[pkg]:
+ if dst_pkg not in pkgs_processed:
+ level_packages[level].append(dst_pkg)
+ pkgs_processed.add(dst_pkg)
+ pkg_count=pkg_count+1
+ if level > 1:
+ level2_pkg_count = level2_pkg_count + 1
+
+
+ print pkg_begin, ',', level, ',', level2_pkg_count, ',', total_pkg_count
+
+#-------------------------------------------------------------------------------
+def TopologySortPackages(nodes, dep_packages, in_edge_count, cycle_edges, reduced_edges):
+ level=0
+ pkg_count=0
+ total_pkg_count=len(nodes)
+ sorted_packages=[]
+ pkg_level={}
+ # loop until all packages are inserted to sorted_packages
+ while( pkg_count < total_pkg_count):
+ sorted_packages.append([])
+ # find packages that have zero in_edge_count
+ for pkg in nodes:
+ if pkg not in in_edge_count or in_edge_count[pkg] == 0:
+ #print "level("+str(level)+") pkg="+pkg
+ sorted_packages[level].append(pkg)
+ in_edge_count[pkg]=-1
+ pkg_level[pkg]=level
+ pkg_count=pkg_count+1
+
+ # if no packages in this level, but pkg_count < total_pkg_count,
+ # It is the case there is a cycle. Currently, we cannot solve this case.
+ if( len(sorted_packages[level]) == 0 and pkg_count < total_pkg_count ):
+ print 'there is a cycle!!! Cycles should be removed before calling TopologySortPackages!'
+ exit(0)
+
+ #decrease in_edge_count for target packages
+ for pkg in sorted_packages[level]:
+ if pkg in dep_packages:
+ for dep_pkg in dep_packages[pkg]:
+ in_edge_count[dep_pkg] = in_edge_count[dep_pkg] - 1
+ level = level+1
+
+ # compensate nodes.
+ # if a node is in cycle_edges, insert it into the nodes.
+ for src,dst_pkgs in cycle_edges.items():
+ if src not in nodes:
+ continue
+ for d in dst_pkgs:
+ if d not in nodes:
+ nodes.add(d)
+ pkg_level[d]=pkg_level[src]+1
+
+ edges = MakeEdges(nodes, sorted_packages, dep_packages, cycle_edges, reduced_edges)
+ full_edges = MakeFullEdges(nodes, dep_packages)
+ #full_edge_pkg_level = MakeFullEdgePackageLevel(nodes, sorted_packages[0], dep_packages, cycle_edges)
+ #return nodes, edges, pkg_level, full_edges, full_edge_pkg_level
+ return nodes, edges, pkg_level, full_edges
+
+#-------------------------------------------------------------------------------
+def IncreaseInEdgesCount(pkg_name):
+ if not pkg_name in in_edge_count:
+ in_edge_count[pkg_name] = 0
+ in_edge_count[pkg_name] = in_edge_count[pkg_name] + 1
+
+#-------------------------------------------------------------------------------
+def InsertPackage(pkg_name):
+ if not pkg_name in pkg_id:
+ pkg_id[pkg_name] = len(pkg_id)
+ pkg_print_index[pkg_name] = 0
+
+#-------------------------------------------------------------------------------
+def InsertNode(pkg_id, pkg_name, nodes):
+ nodes.add((pkg_id, pkg_name))
+
+#-------------------------------------------------------------------------------
+pkg_group_id={}
+def GetGroupId(pkg_name):
+ return pkg_group_id[pkg_name]
+
+#-------------------------------------------------------------------------------
+max_group_id=0
+def SetGroupId(pkg_name, group_id):
+ if not pkg_group_id.has_key(pkg_name):
+ pkg_group_id[pkg_name] = group_id
+ elif pkg_group_id[pkg_name] < group_id:
+ pkg_group_id[pkg_name] = group_id
+ elif pkg_group_id[pkg_name] == group_id:
+ pkg_group_id[pkg_name] = group_id+1
+
+ global max_group_id
+ if max_group_id < pkg_group_id[pkg_name]:
+ max_group_id = pkg_group_id[pkg_name]
+
+#-------------------------------------------------------------------------------
+def MakeIndexedPackageName(pkg_name):
+ #indexed_pkg_name = pkg_name
+ indexed_pkg_name = pkg_name + '(' + str(pkg_print_index[pkg_name]) + ')'
+ InsertPackage(indexed_pkg_name)
+ indexed_pkg_name_id = pkg_id[indexed_pkg_name]
+ return indexed_pkg_name, indexed_pkg_name_id
+
+#-------------------------------------------------------------------------------
+def FindMainPackageName(sub_pkg_name):
+ # If it is a main package, we cannot find it in sub_main_pkg.
+ # In this case, just return the package name
+ if sub_pkg_name in main_sub_pkg.keys():
+ return sub_pkg_name
+
+ if not sub_pkg_name in sub_main_pkg:
+ return None
+
+ return sub_main_pkg[sub_pkg_name]
+
+#-------------------------------------------------------------------------------
+def InsertSubPackage(pkg_name, sub_pkg_name):
+ if not pkg_name in main_sub_pkg:
+ main_sub_pkg[pkg_name]=[]
+ main_sub_pkg[pkg_name].append(sub_pkg_name)
+
+ if sub_pkg_name in sub_main_pkg:
+ print 'Subpackage ' + sub_pkg_name + ' is related to one or more main ' + 'packages(' + sub_main_pkg[sub_pkg_name] + ','+ pkg_name + ')!\n'
+ sub_main_pkg[sub_pkg_name] = pkg_name
+
+ pkg_print_index[sub_pkg_name] = 0
+
+#-------------------------------------------------------------------------------
+def InsertEdge(pkg_name, dep_pkg_name):
+ if not dep_pkg_name in sub_pkg_edges:
+ sub_pkg_edges[dep_pkg_name]=[]
+ InsertPackage(dep_pkg_name)
+ InsertPackage(pkg_name)
+ sub_pkg_edges[dep_pkg_name].append(pkg_name);
+ #pprint.PrettyPrinter(indent=4).pprint(sub_pkg_edges)
+
+#-------------------------------------------------------------------------------
+def RemoveCycle(main_pkg_edges, full_in_edge_count):
+ cycle_edges={}
+ visited=set()
+ path=set()
+
+ def visit(level, node):
+ if node in visited:
+ return
+ if node not in main_pkg_edges:
+ return
+
+ #for i in range(1,level):
+ #print " ",
+ #print "("+str(level)+")visiting "+node
+ visited.add(node)
+ path.add(node)
+ dst_pkgs=main_pkg_edges[node].copy()
+ for dst in dst_pkgs:
+ if dst in path:
+ #cycle!
+ print "removing cycle (" + node + "->"+dst+")"
+ if node not in cycle_edges:
+ cycle_edges[node]=set()
+ cycle_edges[node].add(dst)
+ main_pkg_edges[node].remove(dst)
+ full_in_edge_count[dst]=full_in_edge_count[dst]-1
+ else:
+ visit(level+1, dst)
+ path.remove(node)
+
+ for pkg in main_pkg_edges.keys():
+ visit(0, pkg)
+
+ return main_pkg_edges, cycle_edges, full_in_edge_count
+
+#-------------------------------------------------------------------------------
+def MakeSubGraphMultiPackages(pkgs_to_start, main_pkg_edges):
+ pkg_status={}
+ nodes=set()
+ dep_packages={}
+ in_edge_count={}
+
+ for pkg_to_start in pkgs_to_start:
+ pkg_name = FindMainPackageName(pkg_to_start)
+ if pkg_name is None:
+ continue
+ more_packages=1
+ while(more_packages):
+ more_packages=0
+ #print 'adding pkg '+pkg_name
+ if pkg_name not in nodes:
+ nodes.add(pkg_name)
+ if pkg_name in main_pkg_edges:
+ for dst_pkg_name in main_pkg_edges[pkg_name]:
+ if pkg_name not in dep_packages:
+ dep_packages[pkg_name]=[]
+ dep_packages[pkg_name].append(dst_pkg_name)
+ if dst_pkg_name not in in_edge_count:
+ in_edge_count[dst_pkg_name] = 0
+ in_edge_count[dst_pkg_name] = in_edge_count[dst_pkg_name] + 1
+ if dst_pkg_name not in pkg_status:
+ #print 'pkg_status['+dst_pkg_name+']=visited'
+ pkg_status[dst_pkg_name]='visited'
+
+ pkg_status[pkg_name] = 'printed'
+
+ for p in pkg_status.keys():
+ if pkg_status[p] == 'visited':
+ pkg_name = p
+ more_packages=1
+ break
+
+ #for n in nodes:
+ #if n in in_edge_count:
+ #print 'in_edges['+n+']='+str(in_edge_count[n])
+ #else:
+ #print 'in_edges['+n+']=0'
+#
+ return nodes, dep_packages, in_edge_count
+
+#-------------------------------------------------------------------------------
+def MakeSubGraph(pkg_to_start, main_pkg_edges):
+ pkg_status={}
+ nodes=set()
+ dep_packages={}
+ in_edge_count={}
+
+ pkg_name = FindMainPackageName(pkg_to_start)
+ more_packages=1
+ while(more_packages):
+ more_packages=0
+ #print 'adding pkg '+pkg_name
+ nodes.add(pkg_name)
+ if pkg_name in main_pkg_edges:
+ for dst_pkg_name in main_pkg_edges[pkg_name]:
+ if pkg_name not in dep_packages:
+ dep_packages[pkg_name]=[]
+ dep_packages[pkg_name].append(dst_pkg_name)
+ if dst_pkg_name not in in_edge_count:
+ in_edge_count[dst_pkg_name] = 0
+ in_edge_count[dst_pkg_name] = in_edge_count[dst_pkg_name] + 1
+ if dst_pkg_name not in pkg_status:
+ #print 'pkg_status['+dst_pkg_name+']=visited'
+ pkg_status[dst_pkg_name]='visited'
+
+ pkg_status[pkg_name] = 'printed'
+
+ for p in pkg_status.keys():
+ if pkg_status[p] == 'visited':
+ pkg_name = p
+ more_packages=1
+ break
+
+ return nodes, dep_packages, in_edge_count
+
+#-------------------------------------------------------------------------------
+def PrintVisFormat(filename, nodes, edges, pkg_level, reverse, built_packages=[]):
+
+ level_count={}
+ distance_y = 100
+ distance_x = 300
+
+ f = open(filename, 'w')
+
+ f.write("var nodes = [\n")
+ for pkg_name in nodes:
+ my_pkg_level = pkg_level[pkg_name]
+ if my_pkg_level not in level_count:
+ level_count[my_pkg_level] = -1
+ level_count[my_pkg_level] = level_count[my_pkg_level] + 1
+ pos_y = level_count[my_pkg_level] * distance_y;
+ pos_x = my_pkg_level * distance_x;
+ color_string="undefined"
+ if len(built_packages) > 0 and pkg_name not in built_packages:
+ color_string="'rgba(230,230,230,0.5)'"
+ option_color_str=",color:"+color_string+",set_color:"+color_string
+ f.write("{id: " + str(pkg_id[pkg_name]) + ", label: '" + pkg_name +
+ "', group:" + str(my_pkg_level) + ", level:" + str(my_pkg_level) +
+ ", x:"+str(pos_x) + ", y:" + str(pos_y) + option_color_str + "},\n")
+ f.write("];\n")
+
+ f.write("var edges = new vis.DataSet([\n")
+ for i in edges:
+ f.write("{from: " + str(pkg_id[i[0]]) + ", to: " + str(pkg_id[i[1]]) +
+ ", dashes:"+i[2]+", arrows:")
+ if reverse:
+ f.write("'from'")
+ else:
+ f.write("'to'")
+ f.write("},\n")
+ f.write("]);\n")
+
+#-------------------------------------------------------------------------------
+def PrintHTML(html_out, js_out, pkg_name, template_filename, reverse, full_edges,
+ vis_dir_str, dep_graph_dir_str):
+ template_f = open(template_filename, 'r')
+ HTML_f = open(html_out, 'w')
+
+ graph_str="Dependency graph"
+ if reverse:
+ graph_str="Reverse dependency graph"
+
+ full_edges_str=""
+ if full_edges:
+ full_edges_str="_full"
+
+ for line in template_f:
+ replaced_str=re.sub('%src.js%', '"'+js_out+'"', line)
+ replaced_str=re.sub('%package%', pkg_name, replaced_str)
+ replaced_str=re.sub('%graph%', graph_str, replaced_str)
+ replaced_str=re.sub('%full_edges%', full_edges_str, replaced_str)
+ replaced_str=re.sub('%vis_dir%', vis_dir_str, replaced_str)
+ replaced_str=re.sub('%dep_graph_dir%', dep_graph_dir_str, replaced_str)
+ replaced_str=re.sub('%obs_api_url%', obs_api_url, replaced_str)
+ replaced_str=re.sub('%obs_project%', obs_project, replaced_str)
+ replaced_str=re.sub('%obs_repo%', obs_repo, replaced_str)
+ replaced_str=re.sub('%obs_arch%', obs_arch, replaced_str)
+ replaced_str=re.sub('%obs_username%', obs_username, replaced_str)
+ replaced_str=re.sub('%obs_pw%', obs_pw, replaced_str)
+ replaced_str=re.sub('%mysql_ip%', mysql_ip, replaced_str)
+ replaced_str=re.sub('%mysql_username%', mysql_username, replaced_str)
+ replaced_str=re.sub('%mysql_pw%', mysql_pw, replaced_str)
+ replaced_str=re.sub('%mysql_db%', mysql_db, replaced_str)
+ replaced_str=re.sub('%mysql_build_target_id%', mysql_build_target_id, replaced_str)
+ replaced_str=re.sub('%get_build_status_from%', get_build_status_from, replaced_str)
+
+ HTML_f.write(replaced_str)
+
+ HTML_f.close();
+ template_f.close();
+
+#-------------------------------------------------------------------------------
+def GenerateOutput(dir_name, pkg_name, nodes, edges, pkg_level, full_edges, full_edge_pkg_level,
+ reverse, template_filename, vis_dir_str, dep_graph_dir_str, built_packages):
+
+ js_postfix=".vis_input.js"
+ php_postfix=".php"
+ if reverse:
+ js_postfix="_reverse"+js_postfix
+ php_postfix="_reverse"+php_postfix
+
+ pkg_js=pkg_name+js_postfix
+ js_out=dir_name+"/"+pkg_js
+ html_out=dir_name+"/"+pkg_name+php_postfix
+
+ #print "printing ", pkg_js, "..."
+ PrintVisFormat(js_out, nodes, edges, pkg_level, reverse, built_packages)
+ PrintHTML(html_out, pkg_js, pkg_name, template_filename, reverse, False, vis_dir_str, dep_graph_dir_str)
+
+ js_postfix=".full_edges.vis_input.js"
+ php_postfix="_full_edges.php"
+ if reverse:
+ js_postfix="_reverse"+js_postfix
+ php_postfix="_reverse"+php_postfix
+
+ pkg_js=pkg_name+js_postfix
+ js_out=dir_name+"/"+pkg_js
+ html_out=dir_name+"/"+pkg_name+php_postfix
+
+ #print "printing ", pkg_js, "..."
+ PrintVisFormat(js_out, nodes, full_edges, full_edge_pkg_level, reverse, built_packages)
+ PrintHTML(html_out, pkg_js, pkg_name, template_filename, reverse, True, vis_dir_str, dep_graph_dir_str)
+
+#-------------------------------------------------------------------------------
+def MakeOptionParser():
+ parser = OptionParser("Usage: %prog [OPTIONS] <dependency file (xml)>")
+ parser.add_option('-d', '--dir', action='store', type='string', dest='dest_dir',
+ help="Specify the destination directory.",
+ default="build_dep")
+ parser.add_option('-c', '--calc-build-level', action='store_true', dest='calc_build_level',
+ help="Calculate build level for each packages.",
+ default=False)
+ parser.add_option('-p', '--packages', action='store', type='string', dest='dep_multi_pkgs',
+ help="Print number of nodes for specified packages",
+ default="")
+ parser.add_option('-g', '--git-packages', action='store', type='string', dest='git_dep_multi_pkgs',
+ help="Print number of nodes for specified packages using gitpath",
+ default="")
+ parser.add_option('-v', '--vis-dir', action='store', type='string',
+ dest='vis_dir_str',
+ help="Specifies the location of vis source code",
+ default="../vis")
+ parser.add_option('-t', '--template-file', action='store', type='string',
+ dest='template_filename',
+ help="Specifies the template file name",
+ default="dep_graph.php.template")
+ parser.add_option('-e', '--dep-graph-dir', action='store', type='string',
+ dest='dep_graph_dir_str',
+ help="Specifies the location of dep_graph source code",
+ default="../dep_graph")
+ parser.add_option('-b', '--built-packages-file', action='store', type='string',
+ dest='build_packages_file',
+ help="Specifies a file containing a list of built packages",
+ default="")
+ parser.add_option('-n', '--print-num-nodes', action='store_true', dest='print_num_nodes',
+ help="Print the number of nodes of the graph and the number of directly connected nodes",
+ default=False)
+ return parser
+
+def set_obs_environment(_obs_api_url, _obs_username, _obs_pw, _obs_project, _obs_repo, _obs_arch):
+ global obs_api_url
+ global obs_username
+ global obs_pw
+ global obs_project
+ global obs_repo
+ global obs_arch
+ global get_build_status_from
+
+ obs_api_url = _obs_api_url
+ obs_username = _obs_username
+ obs_pw = _obs_pw
+ obs_project = _obs_project
+ obs_repo = _obs_repo
+ obs_arch = _obs_arch
+ get_build_status_from="get_build_status_from_obs"
+
+
+def set_mysql_environment(_mysql_ip, _mysql_username, _mysql_pw, _mysql_db, _mysql_build_target_id):
+ global mysql_ip
+ global mysql_username
+ global mysql_pw
+ global mysql_db
+ global mysql_build_target_id
+ global get_build_status_from
+
+ mysql_ip = _mysql_ip
+ mysql_username = _mysql_username
+ mysql_pw = _mysql_pw
+ mysql_db = _mysql_db
+ mysql_build_target_id = _mysql_build_target_id
+ get_build_status_from="get_build_status_from_mysql"
+
+def make_dep_graph(input_file, dest_dir_name,
+ vis_dir_str, dep_graph_dir_str, template_filename,
+ dep_multi_pkgs=[], built_packages=[],
+ print_num_nodes=False, calc_build_level=False):
+ global sub_pkg_edges
+ global pkg_id
+ global main_sub_pkg
+ global pkg_print_index
+ global sub_main_pkg
+ global dep_edges
+ global sorted_packages
+ global main_pkg_level
+ global reduced_edges
+ global reduced_edges_reverse
+ global git_obs_mapping
+
+ sub_pkg_edges={}
+ pkg_id={}
+ main_sub_pkg={}
+ pkg_print_index={}
+ sub_main_pkg={}
+ dep_edges=set()
+ sorted_packages=[]
+ main_pkg_level={}
+ reduced_edges={}
+ reduced_edges_reverse={}
+ git_obs_mapping={}
+
+ if(not os.path.isfile(input_file)):
+ print os.path.basename(sys.argv[0]) + ': ' + input_file + ': No such file.'
+ sys.exit()
+
+ tree = ElementTree.parse(input_file)
+ root = tree.getroot()
+ for package in root:
+ if package.tag != 'package':
+ continue
+ pkg_name = package.attrib['name']
+ InsertPackage(pkg_name)
+ dep_pkg_list = []
+
+ for child in package:
+ if(child.tag == 'pkgdep'):
+ dep_pkg_name = child.text
+ dep_pkg_list.append(dep_pkg_name)
+ if(child.tag == 'subpkg'):
+ sub_pkg_name = child.text
+ InsertSubPackage(pkg_name, sub_pkg_name)
+
+ # if there are no sub packages, insert itself.
+ if not pkg_name in main_sub_pkg:
+ main_sub_pkg[pkg_name]=[]
+ main_sub_pkg[pkg_name].append(pkg_name)
+
+ # make dependence (dep_pkg_list -> sub_pkg_name)
+ for dep_pkg_name in dep_pkg_list:
+ for sub_pkg_name in main_sub_pkg[pkg_name]:
+ InsertEdge(sub_pkg_name, dep_pkg_name)
+
+ main_pkg_edges={}
+ full_in_edge_count={}
+ main_pkg_reverse_edges={}
+ full_in_reverse_edge_count={}
+ #generate main_pkg_edges using sub_pkg_edges
+ for src,dst_pkgs in sub_pkg_edges.items():
+ src_main = FindMainPackageName(src)
+ if src_main is None:
+ continue
+ src_main_id = pkg_id[src_main]
+ for dst in dst_pkgs:
+ dst_main = FindMainPackageName(dst)
+ if dst_main is None:
+ continue
+ dst_main_id = pkg_id[dst_main]
+
+ #for main_pkg_edges
+ if not src_main in main_pkg_edges:
+ main_pkg_edges[src_main]=set()
+ if dst_main not in main_pkg_edges[src_main]:
+ main_pkg_edges[src_main].add(dst_main)
+ if dst_main not in full_in_edge_count:
+ full_in_edge_count[dst_main]=0
+ full_in_edge_count[dst_main]=full_in_edge_count[dst_main]+1
+
+ # for main_pkg_reverse_edges
+ if not dst_main in main_pkg_reverse_edges:
+ main_pkg_reverse_edges[dst_main]=set()
+ if src_main not in main_pkg_reverse_edges[dst_main]:
+ main_pkg_reverse_edges[dst_main].add(src_main)
+ if src_main not in full_in_reverse_edge_count:
+ full_in_reverse_edge_count[src_main]=0
+ full_in_reverse_edge_count[src_main]=full_in_reverse_edge_count[src_main]+1
+
+
+ #print 'Removing cycles...'
+ main_pkg_edges, cycle_edges, full_in_edge_count = RemoveCycle(main_pkg_edges, full_in_edge_count)
+ main_pkg_reverse_edges, cycle_reverse_edges, full_in_reverse_edge_count = RemoveCycle(main_pkg_reverse_edges, full_in_reverse_edge_count)
+
+ ## for dependency graph
+ #make build_dep
+ shutil.rmtree(dest_dir_name, ignore_errors=True)
+ os.makedirs(dest_dir_name)
+
+ if len(dep_multi_pkgs) > 0:
+ nodes, dep_packages, in_edge_count=MakeSubGraphMultiPackages(dep_multi_pkgs, main_pkg_edges)
+ print "num_nodes=",len(nodes)
+ nodes, edges, pkg_level, full_edges = TopologySortPackages(nodes, dep_packages, in_edge_count, cycle_edges, reduced_edges)
+ GenerateOutput(dest_dir_name, 'index', nodes, edges, pkg_level, full_edges, pkg_level, False, template_filename, vis_dir_str, dep_graph_dir_str, built_packages)
+ return
+
+ #make a dependency graph for each package.
+ for pkg in main_sub_pkg.keys():
+ #print 'processing package for dependence graph: ' + pkg
+ nodes, dep_packages, in_edge_count=MakeSubGraph(pkg, main_pkg_edges)
+ if calc_build_level:
+ CalcBuildLevel(pkg, nodes, dep_packages, in_edge_count)
+ nodes, edges, pkg_level, full_edges = TopologySortPackages(nodes, dep_packages, in_edge_count, cycle_edges, reduced_edges)
+ reduced_edges[pkg]=edges.copy()
+ if print_num_nodes:
+ num_direct_pkgs=1
+ node_names=""
+ if pkg in main_pkg_edges:
+ num_direct_pkgs=num_direct_pkgs+len(main_pkg_edges[pkg])
+ node_names=','.join(main_pkg_edges[pkg])
+ print pkg+"|"+str(len(nodes))+"|"+str(num_direct_pkgs)+"|"+node_names
+ GenerateOutput(dest_dir_name, pkg, nodes, edges, pkg_level, full_edges, pkg_level, False, template_filename, vis_dir_str, dep_graph_dir_str, built_packages)
+
+ #make a full dependency graph
+ #print 'printing full package dependency graph...'
+ nodes, edges, pkg_level, full_edges = TopologySortPackages(main_sub_pkg.keys(), main_pkg_edges, full_in_edge_count, cycle_edges, reduced_edges)
+ GenerateOutput(dest_dir_name, 'index', nodes, edges, pkg_level, full_edges, pkg_level, False, template_filename, vis_dir_str, dep_graph_dir_str, built_packages)
+
+ #--------------------------------------------------------------------------------
+ ## for reverse dependency graph
+
+ #make a reverse dependency graph for each package.
+ for pkg in main_sub_pkg.keys():
+ #print 'processing package for reverse dependence graph: ' + pkg
+ nodes, dep_packages, in_edge_count=MakeSubGraph(pkg, main_pkg_reverse_edges)
+ nodes, edges, pkg_level, full_edges = TopologySortPackages(nodes, dep_packages, in_edge_count, cycle_reverse_edges, reduced_edges_reverse)
+ reduced_edges_reverse[pkg]=edges.copy()
+ GenerateOutput(dest_dir_name, pkg, nodes, edges, pkg_level, full_edges, pkg_level, True, template_filename, vis_dir_str, dep_graph_dir_str, built_packages)
+
+ #make a full dependency graph
+ #print 'printing full package reverse dependency graph...'
+ nodes, edges, pkg_level, full_edges = TopologySortPackages(main_sub_pkg.keys(), main_pkg_reverse_edges, full_in_reverse_edge_count, cycle_reverse_edges, reduced_edges_reverse)
+ GenerateOutput(dest_dir_name, 'index', nodes, edges, pkg_level, full_edges, pkg_level, True, template_filename, vis_dir_str, dep_graph_dir_str, built_packages)
+
+
+#-------------------------------------------------------------------------------
+# !!main!!
+def main(argv):
+ parser = MakeOptionParser()
+
+ (options, args) = parser.parse_args(argv)
+ dest_dir_name=options.dest_dir
+ calc_build_level=options.calc_build_level
+ dep_multi_pkgs=[]
+ built_packages=[]
+ print_num_nodes=options.print_num_nodes
+ vis_dir_str=options.vis_dir_str
+ dep_graph_dir_str=options.dep_graph_dir_str
+ template_filename=options.template_filename
+
+ if len(options.dep_multi_pkgs) > 0 and len(options.git_dep_multi_pkgs) > 0:
+ print "You cannot use both options --packages and --git-packages!!"
+ exit(0);
+
+ if len(options.dep_multi_pkgs) > 0:
+ dep_multi_pkgs=options.dep_multi_pkgs.split(",")
+
+ if len(options.git_dep_multi_pkgs) > 0:
+ git_packages=options.git_dep_multi_pkgs.split(",")
+ dep_multi_pkgs=TranslateGitOBSMapping(git_packages)
+
+ if len(options.build_packages_file) > 0:
+ if len(dep_multi_pkgs) == 0:
+ print "option --built-packages should be combined with --packages! exiting...\n"
+ exit(0)
+ built_packages=GetBuiltPackageList(options.build_packages_file)
+
+ if( len(args) != 2 ):
+ parser.print_help()
+ sys.exit()
+
+ input_file=args[1]
+
+ make_dep_graph(input_file, dest_dir_name, vis_dir_str, dep_graph_dir_str,
+ template_filename, dep_multi_pkgs, built_packages, print_num_nodes, calc_build_level);
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
--- /dev/null
+table{
+ border: 1px solid black;
+ border-collapse:collapse;
+}
+
+tr:nth-child(even) {background-color: #f2f2f2}
+
+th {
+ background-color:#97C2FC;
+ color: #343434;
+ padding: 5px;
+ border: 1px solid black;
+}
+
+td {
+ border: 1px solid black;
+ padding: 5px;
+}
+
--- /dev/null
+<table>
+<tr>
+ <th>Node name</th>
+ <td>
+<input type="text" name="node_name" id="node_name" OnKeyPress="Javascript: OnKeyPress_node_name(event);" />
+<button onclick="FocusNode()">Find</button>
+ </td>
+</tr>
+<tr>
+ <th>Max build level</th>
+ <td id='max_build_level'></td>
+</tr>
+<tr>
+ <th>Total packages</th>
+ <td id='total_packages'></td>
+</tr>
+<tr>
+ <th>PackageName</th>
+ <td id='pkg_name'>Click a package to see its name.</td>
+</tr>
+<tr>
+ <th>BuildLevel</th>
+ <td id='build_level'>Click a package to see its build level.</td>
+</tr>
+<tr>
+ <td align="center" id="partial_edge_link">
+ </td>
+ <td align="center" id="full_edge_link">
+ </td>
+</tr>
+<tr>
+ <td align="center">
+ <a href="full.php">full dependency graph</a><br>
+ </td>
+ <td align="center">
+ <a href="full.php">full dependency graph (full_edges)</a><br>
+ </td>
+</tr>
+</table>
--- /dev/null
+
+function MakeALink(pkg_name) {
+ //return "<a href="+pkg_name+".php>"+pkg_name+"</a>";
+ return "<a href=# onclick=FocusNodeByName('"+pkg_name+"');>"+pkg_name+"</a>";
+}
+
+
+function MoveToThePackage(params) {
+ if(params.nodes.length <= 0 )
+ return;
+
+ new_url=allNodes[params.nodes[0]].label+".php";
+
+ window.location.href=new_url;
+}
--- /dev/null
+var network;
+var allNodes;
+var allEdges;
+var highlightActive = false;
+var foundNodes;
+
+var nodesDataset;
+var edgesDataset = edges;
+var show_network=0;
+var network_max_level=1;
+function toggle_network() {
+ show_network ^= 1;
+
+ var container = document.getElementById("mynetwork");
+ var toggle_btn = document.getElementById("toggle_button");
+ if( show_network ) {
+ container.style.display="";
+ toggle_btn.innerHTML="▲Hide dependency graph▲";
+ } else {
+ container.style.display="none";
+ toggle_btn.innerHTML="▼Show dependency graph▼";
+ }
+
+}
+
+function redrawAll() {
+ var container = document.getElementById('mynetwork');
+ var options = {
+ autoResize:true,
+ interaction: {
+ tooltipDelay: 100,
+ hideEdgesOnDrag: true
+ },
+ layout : {
+ randomSeed:7,
+ improvedLayout:false,
+ },
+ physics: {
+ enabled:false,
+ barnesHut: {
+ gravitationalConstant:-6000,
+ damping:0.4,
+ },
+ stabilization: {
+ enabled:true,
+ iterations:1,
+ updateInterval:100,
+ },
+ timestep:0.7,
+ },
+ configure: {
+ enabled:false,
+ filter: function(option, path) {
+ return path.indexOf('physics') !== -1;
+ },
+ container: document.getElementById('config'),
+ showButton:false,
+ },
+ };
+
+ // if package_buildinfo exists, set the color.
+ if( typeof package_buildinfo !== 'undefined' ) {
+ var yellow_color = { border: "#FFA500", background: "#FFFF00", highlight: { border: "#FFA500", background: "#FFFFA3" }, hover: { border: "#FFA500", background: "#FFFFA3" }}; // yellow
+ var green_color = { border: "#41A906", background: "#7BE141", highlight: { border: "#41A906", background: "#A1EC76" }, hover: { border: "#41A906", background: "#A1EC76" } }; // green
+ var grey_color = { border: "#646464", background: "#808080", highlight: { border: "#646464", background: "#808080"}, hover: { border: "#646464", background: "#808080"} }; // grey
+ var red_color = { border: "#FA0A10", background: "#FB7E81", highlight: { border: "#FA0A10", background: "#FFAFB1" }, hover: { border: "#FA0A10", background: "#FFAFB1" } }; // red
+ var blue_color = { border: "#2B7CE9", background: "#97C2FC", highlight: { border: "#2B7CE9", background: "#D2E5FF" }, hover: { border: "#2B7CE9", background: "#D2E5FF" } }; // blue
+ var purple_color = { border: "#7C29F0", background: "#AD85E4", highlight: { border: "#7C29F0", background: "#D3BDF0" }, hover: { border: "#7C29F0", background: "#D3BDF0" } }; // 5: purple
+ var color_switch = {
+ 'building': yellow_color,
+ 'failed': red_color,
+ 'scheduled': blue_color,
+ 'blocked': purple_color,
+ 'succeeded': green_color,
+ 'other': grey_color,
+ };
+ for( var i in nodes ) {
+ if( nodes[i].label in package_buildinfo ) {
+ var color = grey_color;
+ var build_status = package_buildinfo[nodes[i].label];
+ if( build_status in color_switch ) {
+ color = color_switch[build_status];
+ }
+ nodes[i].color = color;
+ nodes[i].set_color = color;
+ nodes[i].title = build_status;
+ } else {
+ var color = grey_color;
+ nodes[i].color = color;
+ nodes[i].set_color = color;
+ nodes[i].title = "unknown";
+ }
+ }
+ }
+ nodesDataset = new vis.DataSet(nodes);
+
+ var data = {nodes:nodesDataset, edges:edgesDataset}
+
+ network = new vis.Network(container, data, options);
+
+ // get a JSON object
+ allNodes = nodesDataset.get({returnType:"Object"});
+ allEdges = edgesDataset.get({returnType:"Object"});
+
+ if (document.getElementById('max_build_level') ) {
+ var pkg_count=0;
+ var level_packages=new Array();
+ for(var nodeId in allNodes) {
+ var myLevel = allNodes[nodeId].level;
+ if(!level_packages[myLevel]) level_packages[myLevel]=new Array();
+ level_packages[myLevel].push(allNodes[nodeId].label);
+ if( network_max_level < myLevel) {
+ network_max_level = myLevel;
+ }
+ pkg_count++;
+ }
+
+ document.getElementById('max_build_level').innerHTML=network_max_level;
+ document.getElementById('total_packages').innerHTML=pkg_count;
+ AddPackagesIntoTable(level_packages);
+ }
+
+ network.on("click",neighbourhoodHighlight);
+ network.on("doubleClick",MoveToThePackage);
+}
+
+function AddPackagesIntoTable(level_packages) {
+ var tbl = document.getElementById('level_packages');
+ tbl.setAttribute('border', '1');
+ var tbody = document.createElement('tbody');
+ for( var i = 0; i < level_packages.length; ++i ) {
+ var tr = document.createElement('tr');
+ var header_td = document.createElement('td');
+
+ var package_string="";
+ var last_string=null;
+ var count=0;
+ for( var j = 0; j < level_packages[i].length; ++j ) {
+ if(last_string != null) {
+ package_string+=last_string+", ";
+ }
+ last_string=MakeALink(level_packages[i][j]);
+ count=count+1;
+ }
+ package_string+=last_string;
+
+ header_td.appendChild(document.createTextNode('Level'+i+' Packages ('+count+')'));
+ tr.appendChild(header_td);
+
+ var pkgs_td = document.createElement('td');
+ pkgs_td.innerHTML=package_string;
+ tr.appendChild(pkgs_td);
+ tbody.appendChild(tr);
+ }
+ tbl.appendChild(tbody);
+}
+
+function focusNode(nodeId) {
+ var options = {
+ // position: {x:positionx,y:positiony}, // this is not relevant when focusing on nodes
+ scale: 2,
+ offset: {x:0,y:0},
+ animation: {
+ duration: 1000,
+ easingFunction: 'easeInOutQuad',
+ }
+ };
+ network.focus(nodeId, options);
+}
+
+function neighbourhoodHighlight(params) {
+ highlightNode(params.nodes);
+}
+
+function highlightNode(nodes)
+{
+ // if something is selected:
+ if (nodes.length > 0) {
+ highlightActive = true;
+ var i,j;
+ var selectedNode = nodes[0];
+ var degrees = 2;
+
+ // set the value to the package name
+ if(document.getElementById('pkg_name') && nodes[0]) {
+ if( allNodes[selectedNode].label === undefined ) {
+ document.getElementById('pkg_name').innerHTML=MakeALink(allNodes[selectedNode].hiddenLabel);
+ } else {
+ document.getElementById('pkg_name').innerHTML=MakeALink(allNodes[selectedNode].label);
+ }
+ document.getElementById('build_level').innerHTML=allNodes[selectedNode].group;
+ }
+
+ // mark all nodes as hard to read.
+ for (var nodeId in allNodes) {
+ allNodes[nodeId].color = 'rgba(200,200,200,0.2)';
+ if (allNodes[nodeId].hiddenLabel === undefined) {
+ allNodes[nodeId].hiddenLabel = allNodes[nodeId].label;
+ allNodes[nodeId].label = undefined;
+ }
+ }
+ var connectedNodes = network.getConnectedNodes(selectedNode);
+ var allConnectedNodes = [];
+
+ // get the second degree nodes
+ for (i = 1; i < degrees; i++) {
+ for (j = 0; j < connectedNodes.length; j++) {
+ allConnectedNodes = allConnectedNodes.concat(network.getConnectedNodes(connectedNodes[j]));
+ }
+ }
+
+ // all second degree nodes get a different color and their label back
+ // for (i = 0; i < allConnectedNodes.length; i++) {
+ // allNodes[allConnectedNodes[i]].color = 'rgba(150,150,150,0.75)';
+ // if (allNodes[allConnectedNodes[i]].hiddenLabel !== undefined) {
+ // allNodes[allConnectedNodes[i]].label = allNodes[allConnectedNodes[i]].hiddenLabel;
+ // allNodes[allConnectedNodes[i]].hiddenLabel = undefined;
+ // }
+ // }
+
+ var packages_build_triggers="";
+ var packages_build_triggered="";
+ var packages_build_triggers_count=0;
+ var packages_build_triggered_count=0;
+ // all first degree nodes get their own color and their label back
+ for (i = 0; i < connectedNodes.length; i++) {
+ if( allNodes[connectedNodes[i]].set_color === undefined ) {
+ allNodes[connectedNodes[i]].color = {background:undefined, border:'rgba(200,200,200,0.2)'};
+ } else {
+ allNodes[connectedNodes[i]].color = allNodes[connectedNodes[i]].set_color;
+ }
+
+ if (allNodes[connectedNodes[i]].hiddenLabel !== undefined) {
+ allNodes[connectedNodes[i]].label = allNodes[connectedNodes[i]].hiddenLabel;
+ allNodes[connectedNodes[i]].hiddenLabel = undefined;
+
+ if( allNodes[selectedNode].level <= allNodes[connectedNodes[i]].level ) {
+ packages_build_triggered = packages_build_triggered+allNodes[connectedNodes[i]].label+",";
+ packages_build_triggered_count++;
+ } else {
+ packages_build_triggers = packages_build_triggers+allNodes[connectedNodes[i]].label+",";
+ packages_build_triggers_count++;
+ }
+ }
+ }
+
+ // the main node gets its own color and its label back.
+ if( allNodes[selectedNode].set_color === undefined )
+ allNodes[selectedNode].color = undefined;
+ else
+ allNodes[selectedNode].color = allNodes[selectedNode].set_color;
+ if (allNodes[selectedNode].hiddenLabel !== undefined) {
+ allNodes[selectedNode].label = allNodes[selectedNode].hiddenLabel;
+ allNodes[selectedNode].hiddenLabel = undefined;
+ }
+
+ if( document.getElementById("build_triggers") ) {
+ // set table contents.
+ document.getElementById("build_triggers").innerHTML="Packages build-triggers "+
+ allNodes[selectedNode].label+"("+packages_build_triggers_count+")";
+ document.getElementById("packages_build_triggers").innerHTML=packages_build_triggers;
+ document.getElementById("build_triggered").innerHTML="Packages build-triggered by "+
+ allNodes[selectedNode].label+"("+packages_build_triggered_count+")";
+ document.getElementById("packages_build_triggered").innerHTML=packages_build_triggered;
+ }
+
+ }
+ else if (highlightActive === true) {
+ // reset all nodes
+ for (var nodeId in allNodes) {
+ if( allNodes[nodeId].set_color === undefined )
+ allNodes[nodeId].color = undefined;
+ else
+ allNodes[nodeId].color = allNodes[nodeId].set_color;
+ if (allNodes[nodeId].hiddenLabel !== undefined) {
+ allNodes[nodeId].label = allNodes[nodeId].hiddenLabel;
+ allNodes[nodeId].hiddenLabel = undefined;
+ }
+ }
+ highlightActive = false;
+ }
+
+ // transform the object into an array
+ var updateArray = [];
+ for (nodeId in allNodes) {
+ if (allNodes.hasOwnProperty(nodeId)) {
+ updateArray.push(allNodes[nodeId]);
+ }
+ }
+ nodesDataset.update(updateArray);
+}
+
+function FindNodesByName(node_name) {
+ var filtered_nodes = nodesDataset.getIds({
+ filter: function(item) {
+ return item.label == node_name || item.hiddenLabel == node_name;
+ }
+ });
+ return filtered_nodes;
+}
+
+function FocusNode() {
+ var node_name = document.getElementById('node_name').value;
+ FocusNodeByName(node_name);
+}
+
+function FocusNodeByName(name) {
+ foundNodes=FindNodesByName(name);
+ if( foundNodes.length == 0 ) {
+ alert( node_name + ": No such node name.");
+ return false;
+ }
+
+ highlightNode(foundNodes);
+
+ if( foundNodes.length == 1) {
+ focusNode(foundNodes[0]);
+ }
+}
+
+function OnKeyPress_node_name(e) {
+ if( e.keyCode==13 ) {
+ FocusNode();
+ return false;
+ }
+ return true;
+}
+
+function ShowNodes(min_level, max_level) {
+
+ // show all edges
+ for(var edgeId in allEdges) {
+ allEdges[edgeId].hidden = false;
+ }
+
+ for (var nodeId in allNodes) {
+ if( min_level <= allNodes[nodeId].level && allNodes[nodeId].level <= max_level ) {
+ allNodes[nodeId].hidden = false;
+ } else {
+ allNodes[nodeId].hidden = true;
+
+ // hide all edges connected to hidden nodes.
+ var edges = network.getConnectedEdges(nodeId);
+ for(var i=0; i < edges.length; ++i) {
+ allEdges[edges[i]].hidden=true;
+ }
+ }
+ }
+
+ // transform the object into an array
+ var updateNodes = [];
+ var updateEdges = [];
+ for (nodeId in allNodes) {
+ if (allNodes.hasOwnProperty(nodeId)) {
+ updateNodes.push(allNodes[nodeId]);
+ }
+ }
+ for (edgeId in allEdges) {
+ if( allEdges.hasOwnProperty(edgeId)) {
+ updateEdges.push(allEdges[edgeId]);
+ }
+ }
+ nodesDataset.update(updateNodes);
+ edgesDataset.update(updateEdges);
+}
+
+redrawAll();
+
--- /dev/null
+<table>
+<tr>
+ <th>Node name</th>
+ <td>
+<input type="text" name="node_name" id="node_name" OnKeyPress="Javascript: OnKeyPress_node_name(event);" />
+<button onclick="FocusNode()">Find</button>
+ </td>
+</tr>
+<tr>
+ <th>Max build level</th>
+ <td id='max_build_level'></td>
+</tr>
+<tr>
+ <th>Total packages</th>
+ <td id='total_packages'></td>
+</tr>
+<tr>
+ <th>PackageName</th>
+ <td id='pkg_name'>Click a package to see its name.</td>
+</tr>
+<tr>
+ <th>BuildLevel</th>
+ <td id='build_level'>Click a package to see its build level.</td>
+</tr>
+<tr>
+ <td align="center" id="partial_edge_link">
+ </td>
+ <td align="center" id="full_edge_link">
+ </td>
+</tr>
+<tr>
+ <td align="center">
+ <a href="full.php">full dependency graph</a><br>
+ </td>
+ <td align="center">
+ <a href="full.php">full dependency graph (full_edges)</a><br>
+ </td>
+</tr>
+</table>
--- /dev/null
+
+function MakeALink(pkg_name) {
+ //return "<a href="+pkg_name+"_full_edges.php>"+pkg_name+"</a>";
+ return "<a href=# onclick=FocusNodeByName('"+pkg_name+"');>"+pkg_name+"</a>";
+}
+
+function MoveToThePackage(params) {
+ if(params.nodes.length <= 0 )
+ return;
+
+ new_url=allNodes[params.nodes[0]].label+"_full_edges.php";
+
+ window.location.href=new_url;
+}
--- /dev/null
+ $( function() {
+ $( "#slider-range" ).slider({
+ range: true,
+ min: 0,
+ max: network_max_level,
+ values: [ 0, network_max_level ],
+ slide: function( event, ui ) {
+ $( "#level_range" ).html( "Level (" + ui.values[ 0 ] + " - " + ui.values[ 1 ] + ")" );
+ ShowNodes(ui.values[0], ui.values[1]);
+ }
+ });
+ $( "#level_range" ).html( "Level (" + $( "#slider-range" ).slider( "values", 0 ) +
+ " - " + $( "#slider-range" ).slider( "values", 1 ) + ")" );
+ } );
+
from xml.dom import minidom
-from common.buildtrigger import trigger_info
+from common.buildtrigger import trigger_info, trigger_next
from common.buildservice import BuildService
from common.utils import sync
os.makedirs(os.path.join(sync_out_dir,'builddata','depends'))
reverse = 1
repo_status = build.get_repo_state(project)
+
for target_arch,status in repo_status.items():
repo = target_arch.split("/")[0]
arch = target_arch.split("/")[1]
file_name = os.path.join(sync_out_dir,'builddata','depends',"%s_%s_%s_revpkgdepends.xml"%(project,repo,arch))
#print file_name
with open(file_name, 'w') as xml_file:
- xml_file.write(xml)
+ xml_file.write(xml)
# Make file at packages revision of OBS
packages_rev = dict()
# sync to donwload server
sync(sync_out_dir, sync_dest)
+ data={}
+ data['obs_project'] = project
+ data['action'] = "build_dep_graph"
+ data['repo_path'] = content['repo_path']
+ trigger_next("make_dep_graph", data)
+
if __name__ == '__main__':
sys.exit(main())
--- /dev/null
+#!/usr/bin/env python
+#
+# Copyright (C) 2016 Samsung
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+import re
+import os
+import sys
+import shutil
+import subprocess
+
+from common.buildtrigger import trigger_info
+from common.dep_parse import make_dep_graph, set_obs_environment, set_mysql_environment
+from common.utils import sync
+from common.buildservice import BuildService
+from common.prerelease import get_prerelease_project_name, prerelease_enabled, get_info_from_prerelease_name
+from common.snapshot import Snapshot, SnapshotError
+from common.backenddb import BackendDB
+
+class LocalError(Exception):
+ """Local error exception."""
+ pass
+
+def create_build_progress_dep_graph(build, obs_project, backenddb, content):
+ print "creating build_progress_dep_graph..."
+
+ sync_out_dir = os.path.join(os.getenv('WORKSPACE'),
+ 'outdir')
+
+ repo_base=os.getenv("PATH_REPO_BASE")
+ live_repo_base = os.getenv('PATH_LIVE_REPO_BASE')
+
+
+ try:
+ snapshot = Snapshot(backenddb, repo_base, obs_project=obs_project)
+ except SnapshotError, err:
+ raise LocalError("Error getting snapshot info: %s" % str(err))
+
+ targets = snapshot.targets
+ live_repo_path = os.path.join(live_repo_base,
+ obs_project.replace(':', ':/'))
+ build_id_arr=snapshot.build_id.split('.');
+ build_id_arr[-1] = str(int(build_id_arr[-1])+1);
+ new_build_id = '.'.join(build_id_arr)
+ sync_dest = os.path.join(os.getenv('IMG_SYNC_DEST_BASE'),
+ snapshot.dir, new_build_id);
+
+ print "sync_dest = %s" % sync_dest
+ #if sync_dest is already exists, skip this process.
+ if sync_dest.startswith('rsync:'):
+ cmd = "rsync %s" % (sync_dest)
+ try:
+ ret = subprocess.call(cmd, shell=True)
+ if ret == 0:
+ print "directory already exist. exiting."
+ return
+ except OSError as err:
+ raise RuntimeException("Execution of %s failed: %s" %
+ (cmd, str(err)))
+ elif sync_dest.startswith('ssh:'):
+ sync_dest = sync_dest.replace("ssh://", "")
+ splices = split(':', sync_dest)
+ cmd = "ssh %s ls %s" % (splices[0], splices[1])
+ try:
+ ret = subprocess.call(cmd, shell=True)
+ if ret == 0:
+ print "directory already exist. exiting."
+ return
+ except OSError as err:
+ raise RuntimeException("Execution of %s failed: %s" %
+ (cmd, str(err)))
+ else:
+ if( os.path.exists(sync_dest) ):
+ print "directory %s is already exist! skip make_dep_graph." % (sync_dest)
+ return
+ os.makedirs(sync_dest)
+
+ # first sync to make just directory.
+ sync(sync_out_dir, sync_dest)
+
+ graph_root_dir = os.path.join(sync_out_dir, "builddata",
+ "depends", "build_progress_dep_graph")
+
+ print "graph_root_dir = %s" % graph_root_dir
+
+ vis_dir = "../../vis"
+ dep_graph_dir = "../../dep_graph"
+ template_filename="jenkins-scripts/common/dep_graph.php.template_simple"
+
+ # copy vis and dep_graph dirs.
+ jenkins_script_dir = os.path.join(os.getenv("HOME"), "jenkins-scripts");
+ shutil.copytree(os.path.join(jenkins_script_dir,"vis"), os.path.join(graph_root_dir, "vis"));
+ shutil.copytree(os.path.join(jenkins_script_dir,"dep_graph"), os.path.join(graph_root_dir, "dep_graph"));
+
+ repo_status = build.get_repo_state(obs_project)
+ for target_arch,status in repo_status.items():
+ repo = target_arch.split("/")[0]
+ arch = target_arch.split("/")[1]
+
+ xml = build.get_dependson(obs_project, repo, arch, None, None)
+ graph_dest_dir = os.path.join(graph_root_dir, repo, arch)
+ if not os.path.exists(graph_dest_dir):
+ os.makedirs(graph_dest_dir)
+ filename = os.path.join(graph_root_dir, repo, arch, "builddepinfo.xml")
+ with open(filename, 'w') as xml_file:
+ xml_file.write(xml)
+
+ set_obs_environment(os.getenv("OBS_API_URL"),
+ os.getenv("OBS_API_USERNAME"),
+ os.getenv("OBS_API_PASSWD"),
+ obs_project,
+ repo,
+ arch)
+
+ make_dep_graph(filename, graph_dest_dir,
+ vis_dir, dep_graph_dir, template_filename)
+
+ # sync to donwload server
+ sync(sync_out_dir, sync_dest)
+
+def create_build_progress_dep_graph_prerelease(build, obs_project, obs_linked_project, backenddb):
+ print "creating build_progress_dep_graph_prerelease..."
+
+ sync_out_dir = os.path.join(os.getenv('WORKSPACE'),
+ 'outdir')
+
+ info=build.get_info(obs_project)
+ packages_to_be_built = info['packages']
+
+ repo_base=os.getenv("PATH_REPO_BASE")
+ base_url = os.getenv("URL_PUBLIC_REPO_BASE")
+
+ # Make build id from latest snapshot + project suffix
+ target_project, tstamp = get_info_from_prerelease_name(obs_project)
+
+ try:
+ snapshot = Snapshot(backenddb, repo_base, obs_project=target_project)
+ except SnapshotError, err:
+ raise LocalError("Error getting snapshot info: %s" % str(err))
+
+ try:
+ prerelease = snapshot.get_prerelease(base_url, tstamp)
+ except SnapshotError, err:
+ raise LocalError("Error getting prerelease info: %s" % str(err))
+
+ sync_dest = os.path.join(os.getenv('IMG_SYNC_DEST_BASE'),
+ prerelease.path, prerelease.build_id);
+ graph_root_dir = os.path.join(sync_out_dir, "builddata",
+ "depends", "build_progress_dep_graph")
+ print "graph_root_dir = %s" % graph_root_dir
+ print "packages_to_be_built = %s" % packages_to_be_built
+
+ #vis_dir="../../../../../../../../../../../vis";
+ #dep_graph_dir="../../../../../../../../../../../dep_graph";
+ vis_dir = "../../vis"
+ dep_graph_dir = "../../dep_graph"
+ template_filename="jenkins-scripts/common/dep_graph.php.template_simple"
+
+ # copy vis and dep_graph dirs.
+ jenkins_script_dir = os.path.join(os.getenv("HOME"), "jenkins-scripts");
+ shutil.copytree(os.path.join(jenkins_script_dir,"vis"), os.path.join(graph_root_dir, "vis"));
+ shutil.copytree(os.path.join(jenkins_script_dir,"dep_graph"), os.path.join(graph_root_dir, "dep_graph"));
+
+ repo_status = build.get_repo_state(obs_linked_project)
+ for target_arch,status in repo_status.items():
+ repo = target_arch.split("/")[0]
+ arch = target_arch.split("/")[1]
+
+ xml = build.get_dependson(obs_linked_project, repo, arch, None, None)
+ graph_dest_dir = os.path.join(graph_root_dir, repo, arch)
+ if not os.path.exists(graph_dest_dir):
+ os.makedirs(graph_dest_dir)
+ filename = os.path.join(graph_root_dir, repo, arch, "builddepinfo.xml")
+ with open(filename, 'w') as xml_file:
+ xml_file.write(xml)
+
+ set_obs_environment(os.getenv("OBS_API_URL"),
+ os.getenv("OBS_API_USERNAME"),
+ os.getenv("OBS_API_PASSWD"),
+ obs_project,
+ repo,
+ arch)
+
+ make_dep_graph(filename, graph_dest_dir,
+ vis_dir, dep_graph_dir, template_filename,
+ packages_to_be_built)
+
+ # sync to donwload server
+ sync(sync_out_dir, sync_dest)
+
+def create_build_dep_graph(build, obs_project, backenddb, content):
+
+ sync_out_dir = os.path.join(os.getenv('WORKSPACE'),
+ 'outdir')
+
+ sync_dest = os.path.join(os.getenv('IMG_SYNC_DEST_BASE'),
+ content['repo_path'])
+
+ os.makedirs(os.path.join(sync_out_dir,'builddata','depends'))
+ template_filename="jenkins-scripts/common/dep_graph.php.template"
+ graph_root_dir=os.path.join(sync_out_dir,'builddata','depends','dep_graph')
+ os.makedirs(graph_root_dir)
+ packages_to_be_built = []
+
+ if re.match("^home:prerelease:", obs_project):
+ info = build.get_info(obs_project)
+ packages_to_be_built = info['packages']
+ package_build_result = build.get_package_build_result(obs_project)
+ #print package_build_result
+
+ # copy vis and dep_graph dirs.
+ jenkins_script_dir = os.path.join(os.getenv("HOME"), "jenkins-scripts");
+ shutil.copytree(os.path.join(jenkins_script_dir,"vis"), os.path.join(graph_root_dir, "vis"));
+ shutil.copytree(os.path.join(jenkins_script_dir,"dep_graph"), os.path.join(graph_root_dir, "dep_graph"));
+
+ vis_dir="../../vis";
+ dep_graph_dir="../../dep_graph";
+
+ repo_status = build.get_repo_state(obs_project)
+ for target_arch,status in repo_status.items():
+ repo = target_arch.split("/")[0]
+ arch = target_arch.split("/")[1]
+
+ xml = build.get_dependson(obs_project, repo, arch, None, None)
+ graph_dest_dir = os.path.join(graph_root_dir, repo, arch)
+ if not os.path.exists(graph_dest_dir):
+ os.makedirs(graph_dest_dir)
+ filename = os.path.join(graph_root_dir, repo, arch, "builddepinfo.xml")
+ with open(filename, 'w') as xml_file:
+ xml_file.write(xml)
+
+ if re.match("^home:prerelease:", obs_project):
+ built_packages = []
+ if repo not in package_build_result:
+ continue
+ if arch not in package_build_result[repo]:
+ continue
+ for package_name in package_build_result[repo][arch]:
+ if package_build_result[repo][arch][package_name] == 'succeeded':
+ built_packages.append(package_name)
+
+ print "packages_to_be_built: ", packages_to_be_built
+ print "built_packages: ", built_packages
+ make_dep_graph(filename, graph_dest_dir,
+ vis_dir, dep_graph_dir, template_filename,
+ packages_to_be_built, built_packages)
+ else:
+ make_dep_graph(filename, graph_dest_dir,
+ vis_dir, dep_graph_dir, template_filename)
+
+ # sync to donwload server
+ sync(sync_out_dir, sync_dest)
+
+def main():
+ """Script entry point.
+ """
+
+ obs_api = os.getenv("OBS_API_URL")
+ obs_user = os.getenv("OBS_API_USERNAME")
+ obs_passwd = os.getenv("OBS_API_PASSWD")
+
+ # Init backend database
+ redis_host = os.getenv("REDIS_HOST")
+ redis_port = int(os.getenv("REDIS_PORT"))
+ backenddb = BackendDB(redis_host, redis_port)
+
+ build = BuildService(obs_api, obs_user, obs_passwd)
+
+ content = trigger_info(os.getenv("TRIGGER_INFO"))
+
+ # action - prerelease_build_progress, prerelease, or postrelease
+ action = content.get('action')
+
+ obs_project = content.get("obs_project")
+ obs_linked_project = content.get("obs_linked_project")
+
+ if action == "prerelease_build_progress":
+ create_build_progress_dep_graph_prerelease(build, obs_project, obs_linked_project, backenddb)
+ elif action == "postrelease_build_progress":
+ create_build_progress_dep_graph(build, obs_project, backenddb, content)
+ elif action == "build_dep_graph":
+ create_build_dep_graph(build, obs_project, backenddb, content)
+ else:
+ raise LocalError("Not supported action: %s" % action);
+
+if __name__ == '__main__':
+ try:
+ sys.exit(main())
+ except LocalError, err:
+ print err
+ sys.exit(1)
delete_from_obs(data['OBS_REQ_PRJ_SRC'], data['OBS_REQ_PKG_SRC'])
+ # Disable triggerring make_dep_graph.
+ # Code remained to enable it in the future
+ #trigger_data = {}
+ #trigger_data['obs_project'] = data['OBS_REQ_PRJ'];
+ #trigger_data['action'] = "postrelease_build_progress";
+ #trigger_next('make_dep_graph', trigger_data)
+
def request_rejected(data, gerrit):
"""When request rejected, give msg to gerrit and delete remote package"""
from common.upload_service import upload_obs_service, UploadError
from common.gerrit import is_ref_deleted
from common.buildservice import BuildService
+from common.buildtrigger import trigger_info, trigger_next
from common.backenddb import BackendDB
from common.prerelease import get_prerelease_project_name, prerelease_enabled
from common.iris_rest_client import IrisRestClient
from common.send_mail import prepare_mail
from common.gerrit import Gerrit, get_gerrit_event, GerritError, is_ref_deleted
-
from gbp.rpm import SpecFile
from gbp.git.repository import GitRepositoryError
from gbp.errors import GbpError
# Create review project if it doesn't exist
print "Creating temporary review OBS project %s" % obs_project
info = {'projects': [git_project],
+ 'packages': [package],
'obs_target_prj': obs_target_prj,
'git_tag': git_tag,
'git_commit': git_revision,
if not retry_count:
print 'retrying failed'
return 1
+
+ # Disable triggerring make_dep_graph.
+ # Code remained to enable it in the future
+ #data={}
+ #data['obs_project'] = project
+ #data['obs_linked_project'] = obs_target_prj
+ #data['action'] = "prerelease_build_progress"
+ #trigger_next('make_dep_graph', data)
+
elif build_type == 'snapshot':
if not is_ref_deleted(gerrit_oldrev, gerrit_newrev):
if build.exists(obs_target_prj):
%install
install -d %{buildroot}%{destdir}
-cp -r job_*.py dir-purge-tool.sh logs-collector.sh common obs_requests templates scripts %{buildroot}%{destdir}/
+cp -r job_*.py dir-purge-tool.sh logs-collector.sh common obs_requests templates scripts vis dep_graph %{buildroot}%{destdir}/
%post common
if [ ! -d /var/lib/jenkins/userContent ]; then
%{destdir}/scripts/check_section.sh
%{destdir}/scripts/get_git_desc_info.sh
%{destdir}/job_ref_snapshot_info_update.py
+%{destdir}/job_make_dep_graph.py
+%{destdir}/common/dep_graph.php.template
+%{destdir}/common/dep_graph.php.template_simple
+%{destdir}/common/dep_parse.py
+%dir %{destdir}/dep_graph
+%{destdir}/dep_graph/dep_graph.css
+%{destdir}/dep_graph/dep_graph.include.html
+%{destdir}/dep_graph/dep_graph.js
+%{destdir}/dep_graph/dep_graph_common.js
+%{destdir}/dep_graph/dep_graph_full.include.html
+%{destdir}/dep_graph/dep_graph_full.js
+%{destdir}/dep_graph/slider.js
+%dir %{destdir}/vis
+%{destdir}/vis/CONTRIBUTING.md
+%{destdir}/vis/HISTORY.md
+%{destdir}/vis/LICENSE-APACHE-2.0
+%{destdir}/vis/LICENSE-MIT
+%{destdir}/vis/NOTICE
+%{destdir}/vis/README.md
+%dir %{destdir}/vis/dist
+%{destdir}/vis/dist/vis-graph3d.min.js
+%{destdir}/vis/dist/vis-network.min.js
+%{destdir}/vis/dist/vis-timeline-graph2d.min.js
+%{destdir}/vis/dist/vis.css
+%{destdir}/vis/dist/vis.js
+%{destdir}/vis/dist/vis.map
+%{destdir}/vis/dist/vis.min.css
+%{destdir}/vis/dist/vis.min.js
+%dir %{destdir}/vis/dist/img
+%dir %{destdir}/vis/dist/img/network
+%{destdir}/vis/dist/img/network/acceptDeleteIcon.png
+%{destdir}/vis/dist/img/network/addNodeIcon.png
+%{destdir}/vis/dist/img/network/backIcon.png
+%{destdir}/vis/dist/img/network/connectIcon.png
+%{destdir}/vis/dist/img/network/cross.png
+%{destdir}/vis/dist/img/network/cross2.png
+%{destdir}/vis/dist/img/network/deleteIcon.png
+%{destdir}/vis/dist/img/network/downArrow.png
+%{destdir}/vis/dist/img/network/editIcon.png
+%{destdir}/vis/dist/img/network/leftArrow.png
+%{destdir}/vis/dist/img/network/minus.png
+%{destdir}/vis/dist/img/network/plus.png
+%{destdir}/vis/dist/img/network/rightArrow.png
+%{destdir}/vis/dist/img/network/upArrow.png
+%{destdir}/vis/dist/img/network/zoomExtends.png
+%dir %{destdir}/vis/dist/img/timeline
+%{destdir}/vis/dist/img/timeline/delete.png
+
%files tzs
%defattr(-,jenkins,jenkins)
--- /dev/null
+## Contributing
+
+Contributions to the vis.js library are very welcome! We can't do this alone.
+You can contribute in different ways: spread the word, report bugs, come up with
+ideas and suggestions, and contribute to the code.
+
+There are a few preferences regarding code contributions:
+
+- vis.js follows the node.js code style as described
+ [here](http://nodeguide.com/style.html).
+- When implementing new features, please update the documentation accordingly.
+- Send pull requests to the `develop` branch, not the `master` branch.
+- Only commit changes done in the source files under `lib`, not to the builds
+ which are located in the folder `dist`.
+
+Thanks!
--- /dev/null
+# vis.js history
+http://visjs.org
+
+
+## 2016-04-18, version 4.16.1
+
+### Timeline
+
+- Fixed #1786: Timeline having zero height on Internet Explorer, regression
+ introduced after fixing #1697.
+
+
+## 2016-04-07, version 4.16.0
+
+### Timeline
+
+- Implemented rtl support. Thanks @yotamberk.
+- Fixed #1697: Timeline not drawn when used within the Angular.js directive.
+- Fixed #1774: Wrong initial scale when Timeline contains a single item.
+
+### General
+
+- Created bundles for individual visualizations: `vis-graph3d.min.js`,
+ `vis-network.min.js`, and `vis-timeline-graph2d.min.js`.
+
+
+## 2016-03-08, version 4.15.1
+
+## General
+
+- Updated all dependencies.
+
+### Graph2d
+
+- Fixed #1455: allow vertical panning of the web page on touch devices.
+- Fixed #1692: Error when y-axis values are equal.
+
+### Timeline
+
+- Fixed #1455: allow vertical panning of the web page on touch devices.
+- Fixed #1695: Item line and dot not correctly reckoning with the line width
+ when using left or right align.
+- Fixed #1697: Timeline not drawn when used within the Angular.js directive.
+
+
+## 2016-02-23, version 4.15.0
+
+### Timeline
+
+- Implemented `currentTimeTick` event (see #1683).
+- Fixed #1630: method `getItemRange` missing in docs.
+
+### Graph2d
+
+- Fixed #1630: method `getDataRange` was wrongly called `getItemRange` in docs.
+- Fixed #1655: use parseFloat instead of Number.parseFloat, as the latter is
+ not supported in IE. Thanks @ttjoseph.
+
+### Graph3d
+
+- Changed the built-in tooltip to show the provided `xLabel`, `yLabel`, and
+ `zLabel` instead of `'x'`, `'y'`, and `'z'`. Thanks @jacklightbody.
+
+### Network
+
+- Implemented interpolation option for interpolation of images, default true.
+- Implemented parentCentralization option for hierarchical layout.
+- Fixed #1635: edges are now referring to the correct points.
+- Fixed #1644, #1631: overlapping nodes in hierarchical layout should no longer occur.
+- Fixed #1575: fixed selection events
+- Fixed #1677: updating groups through manipulation now works as it should.
+- Fixed #1672: Implemented stepped scaling for nice interpolation of images.
+
+
+## 2016-02-04, version 4.14.0
+
+### Timeline
+
+- Fixed a regression: Timeline/Graph2d constructor throwing an exception when
+ no options are provided via the constructor.
+
+### Graph2d
+
+- Fixed a regression: Timeline/Graph2d constructor throwing an exception when
+ no options are provided via the constructor.
+
+### Graph3d
+
+- Fixed #1615: implemented new option `dotSizeRatio`.
+
+
+## 2016-02-01, version 4.13.0
+
+### Network
+
+- Added options to customize the hierarchical layout without the use of physics.
+- Altered edges for arrows and added the arrowStrikethrough option.
+- Improved the hierarchical layout algorithm by adding a condensing method to remove whitespace.
+- Fixed #1556: Network throwing an error when clicking the "Edit" button
+ on the manipulation toolbar.
+- Fixed #1334 (again): Network now ignores scroll when interaction:zoomView is false.
+- Fixed #1588: destroy now unsubscribed from the dataset.
+- Fixed #1584: Navigation buttons broken.
+- Fixed #1596: correct clean up of manipulation dom elements.
+- Fixed #1594: bug in hierarchical layout.
+- Fixed #1597: Allow zero borders and addressed scaling artifacts.
+- Fixed #1608: Fixed wrong variable reference
+
+### Timeline
+
+- Moved initial autoscale/fit method to an handler of the "changed" event.
+- Fixed #1580: Invisible timeline/graph should not be drawn, as most inputs are invalid
+- Fixed #1521: Prevent items from staying stuck to the left side of the viewport.
+- Fixed #1592: Emit a "changed" event after each redraw.
+- Fixed #1541: Timeline and Graph2d did not load synchronously anymore.
+
+### Graph2d
+
+- Major redesign of data axis/scales, with large focus on creating a sane slave axis setup
+- Cleanup of linegraph's event handling.
+- Fixed #1585: Allow bar groups to exclude from stacking
+- Fixed #1580: Invisible timeline/graph should not be drawn, as most inputs are invalid
+- Fixed #1177: Fix custom range of slaved right axis.
+- Fixed #1592: Emit a "changed" event after each redraw.
+- Fixed #1017: Fixed minWidth behavior for bars.
+- Fixes #1557: Fix default axis formatting function.
+- Fixed #1541: Timeline and Graph2d did not load synchronously anymore.
+- Fixed a performance regression
+
+
+## 2016-01-08, version 4.12.0
+
+### Timeline
+
+- Fixed #1527: error when creating/updating a Timeline without data.
+- Fixed #1127: `doubleClick` event not being fired.
+- Fixed #1554: wrong cursor on readonly range items.
+
+### Network
+
+- Fixed #1531, #1335: border distances for arrow positioning
+- Fixed findNode method. It now does not return internal objects anymore.
+- Fixed #1529, clustering and declustering now respects the original settings of the edges for physics and hidden.
+- Fixed #1406, control nodes are now drawn immediately without a second redraw.
+- Fixed #1404, made the array returned by findNode match the docs.
+- Added #1138, enable the user to define the color of the shadows for nodes and edges.
+- Fixed #1528, #1278, avoided ID's being cast to string for methods that return ID's as well as storePositions casting to string.
+- Fixed upscaling when the window size increases.
+- Accepted pull request #1544, thanks @felixhayashi!
+- Fixed documented bug in #1544.
+
+
+## 2015-12-18, version 4.11.0
+
+### Network
+
+- Expose `setSelection` method. Thanks @zefrog.
+
+### Timeline
+
+- Fixed #1441: Height of subgroups not immediately updated after updating
+ data in a DataSet or DataView.
+- Fixed #1491: Problem using ctrl+drag in combination with using a `DataView`,
+ and an issue with ctrl+drag when using `snap: null`.
+- Fixed #1486: Item range sometimes wrongly calculated on IE in case of old dates.
+- Fixed #1523: end of data range wrongly determined.
+
+### Graph2d
+
+- Large refactoring of Graph2d code base:
+ - Implemented a new option for `shaded.orientation` to always shade towards zero.
+ - Implemented a new option for `shaded.orientation` to follow another group (fill in between)
+ - Implemented line-graph stacking
+ - Fixed support for using a `DataView` in Graph2d.
+ - Implemented a new zindex option for controlling svg rendering order.
+ - Performance updates and fixes
+
+### DataSet
+- Fixed #1487: DataSet cannot remove an item with id `0` correctly.
+
+### DataView
+- Added the map() function from DataSet.
+
+
+## 2015-11-27, version 4.10.0
+
+### General
+
+- Fixed #1353: Custom bundling with browserify requiring manual installation
+ of `babelify`.
+
+### Network
+
+- Implemented new method `setSelection({nodes:[...], edges: [...]})`.
+ Thanks @zefrog.
+- Fixed #1343: Connected edges are now deselected too when deselecting a node.
+- Fixed #1398: Support nodes start with the correct positions.
+- Fixed #1324: Labels now scale again.
+- Fixed #1362: Layout of hierarchicaly systems no longer overlaps NODES.
+- Fixed #1414: Fixed color references for nodes and edges.
+- Fixed #1408: Unclustering without release function respects fixed positions now.
+- Fixed #1358: Fixed example for clustering on zoom.
+- Fixed #1416: Fixed error in improvedLayout.
+- Improvements on hierarchical layout.
+
+### Timeline
+
+- Implemented option `itemsAlwaysDraggable`, See #1395. Thanks @liuqingc.
+- Implemented option `multiselectPerGroup`. Thanks @hansmaulwurf23.
+- Implemented property `oldData` on change events of the DataSet, and
+ deprecated the `data` property which wrongly contained new data instead of
+ old data. Thanks @hansmaulwurf23.
+- Implemented option `maxMinorChars` to customize the width of the grid.
+- Expose `vis.timeline.Core` for customization purposes.
+- Fixed #1449, #1393: text of minor grids sometimes not being drawn.
+
+### Graph2d
+
+- Fixed #1385: Draw lines on top of bars.
+- Fixed #1461 and #1345: Reset order of SVG elements in legend icons.
+
+### DataSet/DataView
+
+- Performance improvements (see #1381). Thanks @phimimms.
+
+
+## 2015-10-01, version 4.9.0
+
+### Network
+
+- Fixed bug where an edge that was not connected would crash the layout algorithms.
+- Fixed bug where a box shape could not be drawn outside of the viewable area.
+- Fixed bug where dragging a node that is not a control node during edit edge mode would throw an error.
+- Made auto scaling on container size change pick the lowest between delta height and delta width.
+- Added images with borders option (useBorderWithImage)
+- Updated the manipulation css to fix offset if there is no separator.
+
+### Timeline
+
+- Fixed #1326: wrongly positioned dot of PointItems.
+- Fixed #1249: option `hiddenDates` not accepting a single hidden date.
+- Fixed a bug when pinching and using hidden dates. Thanks @lauzierj.
+
+
+## 2015-09-14, version 4.8.2
+
+### Network
+
+- Fixed Phantom Edges during clustering.
+- Fixed scaling not doing anything to edges.
+- Fixed setting font to null so the network won't crash anymore.
+- Fixed stabilized event not firing if layout algorithm does very well.
+- Fixed arrows with some shapes when they are selected. #1292
+- Fixed deletion of options by settings them to null.
+
+
+## 2015-09-07, version 4.8.1
+
+### Network
+
+- Added German (de) locale. Thanks @Tooa.
+- Fixed critical camera zoom bug #1273.
+- Fixed unselectAll method. #1256
+- Fixed bug that broke the network if drawn in a hidden div #1254
+
+### Timeline
+
+- Fixed #1215: inconsistent types of properties `start` and `end` in callback
+ functions `onMove`, `onMoving`, `onAdd`.
+
+
+## 2015-08-28, version 4.8.0
+
+### Timeline
+
+- Implemented reordering groups by dragging them vertically. Thanks @hansmaulwurf23.
+
+### Network
+
+- Added Spanish (es) locale. Thanks @gomezgoiri.
+- Added support for labels in edges and titles for both nodes and edges during gephi import.
+- Added KamadaKawai layout engine for improved initial layout.
+- Added Adaptive timestep to the physics solvers for increased performance during stabilization.
+- Added improvedLayout as experimental option for greatly improved stabilization times.
+- Added adaptiveTimestep as experimental option for greatly improved stabilization times.
+- Added support for Gephi directed edges, edge labels and titles.
+- Improved the positioning and CSS of the configurator and the color picker.
+- Greatly improved performance in clustering.
+- Made the network keep its 'view' during a change of the size of the container.
+- Fixed #1152, updating images now works.
+- Fixed cleaning up of nodes.
+- Fixed dynamic updating of label properties.
+- Fixed bugs in clustering algorithm.
+- Fixed find node return types.
+- Fixed bug where stabilization iterations were counted double. If it looks like the stabilization is slower, its because it is doing twice the amount of steps it did before.
+- Fixed getPositions return values.
+
+## Graph2d
+
+- Implemented configuration option `excludeFromLegend`. Thanks @Bernd0.
+
+
+## 2015-07-27, version 4.7.0
+
+### Timeline
+
+- Fixed #192: Items keep their group offset while dragging items located in
+ multiple groups. Thanks @Fice.
+- Fixed #1118: since v4.6.0, grid of time axis was wrongly positioned on some
+ scales.
+
+### Network
+
+- Added moveNode method.
+- Added cubic Bezier curves.
+
+
+## 2015-07-22, version 4.6.0
+
+### Timeline
+
+- Implemented #24: support for custom timezones, see configuration option `moment`.
+
+### Graph2d
+
+- Implemented #24: support for custom timezones, see configuration option `moment`.
+
+### Network
+
+- Fixed #1111, check if edges exist was not correct on update.
+- Fixed #1112, network now works in firefox on unix again.
+- Added #931, borderRadius in shapeProperties for the box shape.
+- Added #936, useImageSize for images and circularImages
+
+## 2015-07-20, version 4.5.1
+
+### Network
+
+- Fixed another clustering bug, phantom edges should be gone now.
+- Fixed disabling hierarchical layout.
+- Fixed delete button when using multiple selected items in manipulation system.
+
+
+## 2015-07-17, version 4.5.0
+
+### General
+
+- Docs have been greatly improved thanks to @felixhayashi! Thanks a lot!
+
+### Network
+
+- Added shapeProperties, thanks @zukomgwili!
+- Added configChange event.
+- Properly fixed the _lockedRedraw method.
+- Fixed node resizing on dragging.
+- Fixed missing edges during clustering.
+- Fixed missing refresh of node data when changing hierarchical layout on the fly.
+- Fixed hover and blur events for edges.
+
+### Graph3d
+
+- Fixed not changing `backgroundColor` when not provided in options. Thanks @ozydingo.
+
+### Timeline
+
+- Implemented support for group templates (#996). Thanks @hansmaulwurf23.
+- Implemented option `zoomKey` for both Timeline and Graph2d (see #1082).
+ Thanks @hansmaulwurf23.
+- Fixed #1076: Fixed possible overlap of minor labels text on the TimeAxis.
+- Fixed #1001: First element of group style being cut.
+- Fixed #1071: HTML contents of a group not cleared when the contents is updated.
+- Fixed #1033: Moved item data not updated in DataSet when using an asynchronous
+ `onMove` handler.
+- Fixed #239: Do not zoom/move the window when the mouse is on the left panel
+ with group labels.
+
+
+## 2015-07-03, version 4.4.0
+
+### General
+
+- Documentation now has breadcrums. Thanks @felixhayashi!
+
+### Graph3d
+
+- Fixed #970: Implemented options `dataColor`, `axisColor`, and `gridColor`.
+
+### Network
+
+- Fixed Hammerjs direction issue.
+- Fixed recursion error when node is fixed but has no position.
+- Fixed accidental redrawing during stabilization.
+- Fixed delete callbacks with null argument not showing toolbar afterwards.
+- Added zoom events from keyboard and navigation buttons.
+- No longer start stabilization with an empty node set.
+- Fixed #974 connecting static smooth and straight edges.
+- Improved handling of empty image field.
+- Fixed #987 proper cleaning of support nodes.
+- Fixed static smooth edges not fully working from every angle.
+- Fixed updating bounding box of nodes without drawing.
+- Fixed #1036, bug in lockedRedraw. Thanks @vges!
+- Added getDataset to all manipulation functions. Thanks @ericvandever!
+- Fixed #1039, icon now returns correct distance to border
+- Added blurEdge and hoverEdge events.
+- Added labelHighlightBold option to edges and nodes.
+- Added getOptionsFromConfigurator method.
+- Fixed extra edges in clustering.
+- Fixed cleaning up of clustering edges on declustering.
+- Made fit() method only look at visible nodes to get the range.
+
+### Graph2d
+
+- Made graph2d more robust against string values in the y position.
+- Fixed bug where 0 axis was always in the automatically fitted range.
+- Added drawPoints.onRender. Thanks @mschallar!
+
+### Timeline
+
+- Fixed cleaning up of items in subgroups, thanks @ChenMachluf!
+- Improved error notification with groups, thanks @skinkie!
+
+
+## 2015-06-16, version 4.3.0
+
+### General
+
+- Fixed #950: option `locales` broken in `Timeline`, `Graph2d`, and `Network`.
+- Fixed #964: `Timeline`, `Graph2d`, and `Network` not working on IE9.
+
+### Graph2d
+
+- Fixed #942, #966: bug when data is empty.
+
+### Timeline
+
+- Implemented `editable` option for individual items. Thanks @danbertolini.
+
+### Network
+
+- Fixed dragStart event to give the correct node information.
+
+## 2015-06-05, version 4.2.0
+
+### General
+
+- Fixed #893, #911: the `clickToUse` option of Network, Graph2d, and Network
+ was blocking click events in the web page.
+
+### Timeline
+
+- Added axis orientation option `'none'`.
+- Added a property `event` to the properties emitted with the `select` event (see #923).
+- Improved function `fit()` to take into account the actual width of items.
+- Fixed #897: Timeline option `{snap: null}` did give a validation error.
+- Fixed #925: Event `timechanged` did not fire when mouse has been moved outside
+ the timeline.
+
+### Graph2D
+
+- Fixed #892, addressed any case in validator.
+- Fixed #898, lines are not taken into account for stacking.
+
+### Network
+
+- Improved robustness against people molesting the Function.prototype.bind()
+- Fixed few functions including storePositions().
+- Added beginnings of unit testing for network.
+- Fixed #904, correctly parsing global font options now.
+- Fixed dataView support for storePositions.
+- Second click on node is no longer unselect.
+- Added releaseFunction to openCluster.
+- Fixed bug where the network could flicker when the pixelRatio is not integer.
+- Added enabled property to physics.
+- Fixed #927, dragStart event didn't contain node that was being dragged
+
+## 2015-05-28, version 4.1.0
+
+### Network
+
+- Fixed #866, manipulation can now be set to false without crashing.
+- Fixed #860, edit node mode now works as it should.
+- Fixed #859, images now resize again when they are loaded.
+- Fixed dynamic edges not correctly handling non-existent nodes.
+- Accepted pull from @killerDJO for fixing selected and hover colors for edges.
+- Fixed bug with right mouse button, scroll center and popup positions using the wrong coordinates.
+- Fixed click to use.
+- Fixed getConnectedEdges method.
+- Fixed clustering bug.
+- Added getNodesInCluster method.
+- Renamed editNodeMode to editNode, editNodeMode now give a deprecation log message.
+- Added multiselect to the docs.
+- Removed deprecated dynamic entree, allow any smooth curve style for hierarchical layout.
+- Fixed bug with the moveTo and getViewPosition methods.
+- Fixed #861, brokenImage only working for one node if nodes have the same image.
+- Fixed hoverNode and blurNode events and added them to the docs.
+- Fixed #884, selectNode event.
+- Fixed dynamic setting hidden and physics.
+- Fixed edit node mode's fallback.
+
+### Graph2d & Timeline
+
+- Fixed #858, #872, fixed usage of deprecated `unsubscribe` from DataSet.
+- Fixed #869: Add className with id to custom time bars
+- Fixed #877: Added support for metaKey to select multiple items.
+
+
+## 2015-05-22, version 4.0.0
+
+### General
+
+- Changed the build scripts to include a transpilation of ES6 to ES5
+ (using http://babel.org), so we can use ES6 features in the vis.js code.
+ When creating a custom bundle using browserify, one now needs to add a
+ transform step using `babelify`, this is described in README.md.
+
+### Timeline
+
+- Integrated an option configurator and validator.
+- Implemented option `multiselect`, which is false by default.
+- Added method `setData({groups: groups, items: items})`.
+- Fixed range items not being displayed smaller than 10 pixels (twice the
+ padding). In order to have overflowing text, one should now apply css style
+ `.vis.timeline .item.range { overflow: visible; }` instead of
+ `.vis.timeline .item.range .content { overflow: visible; }`.
+ See example 18_range_overflow.html.
+- Fixed invalid css names for time axis grid, renamed hours class names from
+ `4-8h` to `h4-h8`.
+- Deprecated option `showCustomTime`. Use method `addCustomTime()` instead.
+- Deprecated event `finishedRedraw` as it's redundant.
+- Renamed option `animate` to `animation`, and changed it to be either a boolean
+ or an object `{duration: number, easingFunction: string}`.
+- Fixed #831: items losing selection when their type changed.
+
+### Graph2d
+
+- New option structure.
+- Cleaned up docs.
+- Fixed #628: stacking order.
+- Fixed #624: sorting order.
+- Fixed #616: stacking with negative bars.
+- Fixed #728: alignment issues.
+- Fixed #716: Height of graph `2px` too large when configuring a fixed height.
+
+### Network
+
+The network has been completely rewritten. The new modular setup using ES6 classes makes
+it future proof for maintainability, extendability and clarity. A summary of new features:
+- New examples, categorized by topic.
+- New docs.
+- New option structure, adhering to the modular setup on the backend.
+- New events for user interaction.
+- New render events for drawing custom elements on the canvas.
+- New physics events for making a loading bar during stabilization.
+- A lot of new methods that make extending easier.
+- Manipulation system now works without the UI neccesarily.
+- Nodes and edges can cast shadows.
+- Configurator system to dynamically change almost all options.
+- Validator has been created for the network's options, warning you about typo's and suggesting alternatives.
+- Diamond shape for nodes.
+- Unified the label code so edges and nodes have the same label settings.
+- InheritColors for edges can be set to both, making a gradient fade between two node colors.
+- Redesigned the clustering system giving full control over it.
+- Random seed can be saved so the network will be the same every time you start it.
+- New physics solver based on ForceAtlas2 as implemented in gephi.]
+- New avoidOverlap option for physics.
+- Many, many bugfixes.
+
+
+### DataSet
+
+- Dropped support for Google visualization DataTable.
+- Dropped support for appending data returned by `DataSet.get()` to an existing
+ Array or DataTable.
+
+
+## 2015-04-07, version 3.12.0
+
+### Network
+
+- Fixed support for DataSet with custom id fields (option `fieldId`).
+
+### Timeline
+
+- Orientation can now be configured separately for axis and items.
+- The event handlers `onMove` and `onMoving` are now invoked with all item
+ properties as argument, and can be used to update all properties (like
+ content, className, etc) and add new properties as well.
+- Fixed #654: removed unnecessary minimum height for groups, takes the
+ height of the group label as minimum height now.
+- Fixed #708: detecting wrong group when page is scrolled.
+- Fixed #733: background items being selected on shift+click.
+
+
+## 2015-03-05, version 3.11.0
+
+### Network
+
+- (added gradient coloring for lines, but set for release in 4.0 due to required refactoring of options)
+- Fixed bug where a network that has frozen physics would resume redrawing after setData, setOptions etc.
+- Added option to bypass default groups. If more groups are specified in the nodes than there are in the groups, loop over supplied groups instead of default.
+- Added two new static smooth curves modes: curveCW and curve CCW.
+- Added request redraw for certain internal processes to reduce number of draw calls (performance improvements!).
+- Added pull request for usage of Icons. Thanks @Dude9177!
+- Allow hierarchical view to be set in setOptions.
+- Fixed manipulation bar for mobile.
+- Fixed #670: Bug when updating data in a DataSet, when Network is connected to the DataSet via a DataView.
+- Fixed #688: Added a css class to be able to distinguish buttons "Edit node"
+ and "Edit edge".
+
+### Timeline
+
+- Implemented orientation option `'both'`, displaying a time axis both on top
+ and bottom (#665).
+- Implemented creating new range items by dragging in an empty space with the
+ ctrl key down.
+- Implemented configuration option `order: function` to define a custom ordering
+ for the items (see #538, #234).
+- Implemented events `click`, `doubleClick`, and `contextMenu`.
+- Implemented method `getEventProperties(event)`.
+- Fixed not property initializing with a DataView for groups.
+- Merged add custom timebar functionality, thanks @aytech!
+- Fixed #664: end of item not restored when canceling a move event.
+- Fixed #609: reduce the left/right dragarea when an item range is very small,
+ so you can still move it as a whole.
+- Fixed #676: misalignment of background items when using subgroups and the
+ group label's height is larger than the contents.
+
+### Graph2d
+
+- Implemented events `click`, `doubleClick`, and `contextMenu`.
+- Implemented method `getEventProperties(event)`.
+
+### DataSet/DataView
+
+- Implemented support for mapping field names. Thanks @spatialillusions.
+- Fixed #670: DataView not passing a data property on update events (see #670)
+
+
+
+## 2015-02-11, version 3.10.0
+
+### Network
+
+- Added option bindToWindow (default true) to choose whether the keyboard binds are global or to the network div.
+- Improved images handling so broken images are shown on all references of images that are broken.
+- Added getConnectedNodes method.
+- Added fontSizeMin, fontSizeMax, fontSizeMaxVisible, scaleFontWithValue, fontDrawThreshold to Nodes.
+- Added fade in of labels (on nodes) near the fontDrawThreshold.
+- Added nodes option to zoomExtent to zoom in on specific set of nodes.
+- Added stabilizationIterationsDone event which fires at the end of the internal stabilization run. Does not imply that the network is stabilized.
+- Added freezeSimulation method.
+- Added clusterByZoom option.
+- Added class name 'network-tooltip' to the tooltip, allowing custom styling.
+- Fixed bug when redrawing was not right on zoomed-out browsers.
+- Added opacity option to edges. Opacity is only used for the unselected state.
+- Fixed bug where selections from removed data elements persisted.
+
+### Timeline
+
+- `Timeline.redraw()` now also recalculates the size of items.
+- Implemented option `snap: function` to customize snapping to nice dates
+ when dragging items.
+- Implemented option `timeAxis: {scale: string, step: number}` to set a
+ fixed scale.
+- Fixed width of range items not always being maintained when moving due to
+ snapping to nice dates.
+- Fixed not being able to drag items to an other group on mobile devices.
+- Fixed `setWindow` not working when applying an interval larger than the
+ configured `zoomMax`.
+
+### DataSet/DataView
+
+- Added property `length` holding the total number of items to the `DataSet`
+ and `DataView`.
+- Added a method `refresh()` to the `DataView`, to update filter results.
+- Fixed a bug in the `DataSet` returning an empty object instead of `null` when
+ no item was found when using both a filter and specifying fields.
+
+
+## 2015-01-16, version 3.9.1
+
+### General
+
+- Fixed wrong distribution file deployed on the website and the downloadable
+ zip file.
+
+### Network
+
+- Fixed bug where opening a cluster with smoothCurves off caused one child to go crazy.
+- Fixed bug where zoomExtent does not work as expected.
+- Fixed nodes color data being overridden when having a group and a dataset update query.
+- Decoupled animation from physics simulation.
+- Fixed scroll being blocked if zoomable is false.
+
+
+## 2015-01-16, version 3.9.0
+
+### Network
+
+- Reverted change in image class, fixed bug #552
+- Improved (not neccesarily fixed) the fontFill offset between different browsers. #365
+- Fixed dashed lines on firefox on Unix systems
+- Altered the Manipulation Mixin to be succesfully destroyed from memory when calling destroy();
+- Improved drawing of arrowheads on smooth curves. #349
+- Caught case where click originated on external DOM element and drag progressed to vis.
+- Added label stroke support to Nodes, Edges & Groups as per-object or global settings. Thank you @klmdb!
+- Reverted patch that made nodes return to 'default' setting if no group was assigned to fix issue #561. The correct way to 'remove' a group from a node is to assign it a different one.
+- Made the node/edge selected by the popup system the same as selected by the click-to-select system. Thank you @pavlos256!
+- Improved edit edge control nodes positions, altered style a little.
+- Fixed issue #564 by resetting state to initial when no callback is performed in the return function.
+- Added condition to Repulsion similar to BarnesHut to ensure nodes do not overlap.
+- Added labelAlignment option to edges. Thanks @T-rav!
+- Close active sessions in dataManipulation when calling setData().
+- Fixed alignment issue with edgelabels
+
+### Timeline
+
+- Added byUser flag to options of the rangechange and rangechanged event.
+
+
+## 2015-01-09, version 3.8.0
+
+### General
+
+- Updated to moment.js v2.9.0
+
+### Network
+
+- Fixed flipping of hierarchical network on update when using RL and DU.
+- Added zoomExtentOnStabilize option to network.
+- Improved destroy function, added them to the examples.
+- Nodes now have bounding boxes that are used for zoomExtent.
+- Made physics more stable (albeit a little slower).
+- Added a check so only one 'activator' overlay is created on clickToUse.
+- Made global color options for edges overrule the inheritColors.
+- Improved cleaning up of the physics configuration on destroy and in options.
+- Made nodes who lost their group revert back to default color.
+- Changed group behaviour, groups now extend the options, not replace. This allows partial defines of color.
+- Fixed bug where box shaped nodes did not use hover color.
+- Fixed Locales docs.
+- When hovering over a node that does not have a title, the title of one of the connected edges that HAS a title is no longer shown.
+- Fixed error in repulsion physics model.
+- Improved physics handling for smoother network simulation.
+- Fixed infinite loop when an image can not be found and no brokenImage is provided.
+- Added getBoundingBox method.
+- Community fix for SVG images in IE11, thanks @dponch!
+- Fixed repeating stabilized event when the network is already stabilized.
+- Added circularImages, thanks for the contribution @brendon1982!
+- Stopped infinite loop when brokenImage is also not available.
+- Changed util color functions so they don't need eval. Thanks @naskooskov!
+
+### Graph2d
+
+- Fixed round-off errors of zero on the y-axis.
+- added show major/minor lines options to dataAxis.
+- Fixed adapting to width and height changes.
+- Added a check so only one 'activator' overlay is created on clickToUse.
+- DataAxis width option now draws correctly.
+
+### Timeline
+
+- Implemented support for styling of the vertical grid.
+- Support for custom date formatting of the labels on the time axis.
+- added show major/minor lines options to timeline.
+- Added a check so only one 'activator' overlay is created on clickToUse.
+
+### Graph3d
+
+- Fixed mouse coordinates for tooltips.
+
+
+## 2014-12-09, version 3.7.2
+
+### Timeline
+
+- Fixed zooming issue on mobile devices.
+
+### Graph2D
+
+- Fixed infinite loop when clearing DataSet
+
+### Network
+
+- Sidestepped double touch event from hammer (ugly.. but functional) causing
+ strange behaviour in manipulation mode
+- Better cleanup after reconnecting edges in manipulation mode
+- Fixed recursion error with smooth edges that are connected to non-existent nodes
+- Added destroy method.
+
+## 2014-11-28, version 3.7.1
+
+### Timeline
+
+- Implemented selection of a range of items using Shift+Click.
+- Fixed content in range items may overflow range after zoom.
+- Fixed onAdd/onUpdate callbacks when using a DataView (thanks @motzel).
+- Fixed configuring either `start` or `end`.
+- Fixed Timeline and Graph2d getting stuck in an infinite loop in some
+ circumstances.
+- Fixed background items being selectable and editable when a height is set.
+
+### Graph2D
+
+- Added `alignZeros` option to dataAxis with default value true.
+- Fixed bug with points drawn on bargraphs
+- Fixed docs
+- Fixed height increase on scrolling if only `graphHeight` is defined.
+
+### Network
+
+- dragEnd event now does not give the selected nodes if only the viewport has been dragged #453
+- merged high DPI fix by @crubier, thanks!
+
+
+## 2014-11-14, version 3.7.0
+
+### Graph2D
+
+- Added points style for scatterplots and pointclouds.
+- Modularized the Graph2D draw styles.
+- Added a finishedRedraw event.
+
+### Network
+
+- Added pointer properties to the click and the doubleClick events containing the XY coordinates in DOM and canvas space.
+- Removed IDs from navigation so multiple networks can be shown on the same page. (#438)
+
+
+### Timeline
+
+- Added a finishedRedraw event.
+- Fixed the disappearing item bug.
+- Fixed keycharm issue.
+
+## 2014-11-07, version 3.6.4
+
+### General
+
+- Removed mousetrap due to Apache license, created keycharm and implemented it with vis.
+
+### Timeline
+
+- Fixed height of background items when having a fixed or max height defined.
+- Fixed only one item being dragged when multiple items are selected.
+- Optimised a serious slowdown on performance since hidden dates.
+
+### Network
+
+- Fixed onRelease with navigation option.
+- Fixed arrow heads not being colored.
+
+### Graph2D
+
+- Fixed cleaning up of groups.
+- Throw error message when items are added before groups.
+- Made graphHeight automatic if height is defined AND if graphHeight is smaller than the center panel when height is defined as well.
+- Added new verticalDrag event for internal use, allowing the vertical scrolling of the grid lines on drag.
+- Fixed moving legend when postioned on the bottom and vertical dragging.
+- Optimised a serious slowdown on performance since hidden dates.
+
+- Accepted a large pull request from @cdjackson adding the following features (thank you!):
+- Titles on the DataAxis to explain what units you are using.
+- A style field for groups and datapoints so you can dynamically change styles.
+- A precision option to manually set the amount of decimals.
+- Two new examples showing the new features.
+
+
+## 2014-10-28, version 3.6.3
+
+### Timeline
+
+- Fixed background items not always be cleared when removing them.
+- Fixed visible items not always be displayed.
+- Performance improvements when doing a lot of changes at once in a DataSet.
+
+### Network
+
+- Fixed dashed and arrow lines not using inheritColor.
+
+### DataSet
+
+- Support for queueing of changes, and flushing them at once.
+- Implemented `DataSet.setOptions`. Only applicable for the `queue` options.
+
+
+## 2014-10-24, version 3.6.2
+
+- Vis.js is now dual licensed under both Apache 2.0 and MIT.
+
+
+## 2014-10-22, version 3.6.1
+
+### Timeline
+
+- Fixed uneven stepsized with hidden dates.
+- Fixed multiple bugs with regards to hidden dates.
+- Fixed subgroups and added subgroup sorting. Subgroup labels will be in future releases.
+
+
+## 2014-10-21, version 3.6.0
+
+### Network
+
+- Title of nodes and edges can now be an HTML element too.
+- Renamed storePosition to storePositions. Added deprication message and old name still works.
+- Worked around hammer.js bug with multiple release listeners.
+- Improved cleaning up after manipulation toolbar.
+- Added getPositions() method to get the position of all nodes or some of them if specific Ids are supplied.
+- Added getCenterCoordinates() method to get the x and y position in canvas space of the center of the view.
+- Fixed node label becoming undefined.
+- Fixed cluster fontsize scaling.
+- Fixed cluster sector scaling.
+- Added oldHeight and oldWidth to resize event.
+
+### Timeline
+
+- Implemented field `style` for both items and groups, to set a custom style for
+ individual items.
+- Fixed height of BackgroundItems not being 100% when timeline has a fixed height.
+- Fixed width of BackgroundItems not being reduced to 0 when zooming out.
+- Fixed onclick events in items not working.
+- Added hiddenDates to hide specific times and/or days in the timeline.
+
+### DataSet
+
+- Event listeners of `update` now receive an extra property `data`,
+ containing the changed fields of the changed items.
+
+### Graph2d
+
+- Fixed height of legend when there are many items showing.
+
+### Graph3d
+
+- Implemented options `xValueLabel`, `yValueLabel` and `zValueLabel` for custom labels along
+ the x, y, z axis. Thanks @fabriziofortino.
+
+
+## 2014-09-16, version 3.5.0
+
+### Network
+
+- Fixed nodes not always being unfixed when using allowedToMove.
+- Added dragStart and dragEnd events.
+- Added edge selection on edge labels.
+
+### Graph2d
+
+- Fixed dataAxis not showing large numbers correctly.
+
+
+## 2014-09-12, version 3.4.2
+
+### Network
+
+- Changed timings for zoomExtent animation.
+- Fixed possible cause of freezing graph when animating.
+- Added locked to focusOnNode and releaseNode().
+- Fixed minor bug in positioning of fontFill of nodes with certain shapes.
+- Added startStabilization event.
+
+
+## 2014-09-11, version 3.4.1
+
+### Network
+
+- Fix for introduced bug on zoomExtent navigation button.
+- Added animation to zoomExtent navigation button.
+- Improved cleaning of Hammer.js bindings.
+
+### Timeline
+
+- Fixed a bug in IE freezing when margin.item and margin.axis where both 0.
+
+
+## 2014-09-10, version 3.4.0
+
+### Graph2d
+
+- Fixed moment.js url in localization example.
+
+### Network
+
+- Fixed some positioning issues with the close button of the manipulation menu.
+- Added fontFill to Nodes as it is in Edges.
+- Implemented support for broken image fallback. Thanks @sfairgrieve.
+- Added multiline labels to edges as they are implemented in nodes. Updated
+ multiline example to show this.
+- Added animation and camera controls by the method .moveTo()
+- Added new event that fires when the animation is finished.
+- Added new example showing the new features of animation.
+- Added getScale() method.
+
+### Timeline
+
+- Implemented support for templates.
+- Implemented a new item type: `'background'`. This can be used to mark periods
+ with a background color and label.
+- Implemented support for attaching HTML attributes to items. Thanks @dturkenk.
+- Fixed moment.js url in localization example.
+- Fixed `className` of groups not being updated when changed.
+- Fixed the `id` field of a new item not correctly generated.
+- Fixed newly added item ignored when returning an other object instance.
+- Fixed option `autoResize` not working on IE in case of changing visibility
+ of the Timeline container element.
+- Fixed an overflow issue with the dots of BoxItems when using groups.
+- Fixed a horizontal 1-pixel offset in the items (border width wasn't taken into
+ account).
+- Renamed internal items from `ItemBox`, `ItemRange`, and `ItemPoint` to
+ respectively `BoxItem`, `RangeItem`, and `PointItem`.
+- Fixed an error thrown when calling `destroy()`.
+
+
+## 2014-08-29, version 3.3.0
+
+### Timeline
+
+- Added localization support.
+- Implemented option `clickToUse`.
+- Implemented function `focus(id)` to center a specific item (or multiple items)
+ on screen.
+- Implemented an option `focus` for `setSelection(ids, options)`, to immediately
+ focus selected nodes.
+- Implemented function `moveTo(time, options)`.
+- Implemented animated range change for functions `fit`, `focus`, `setSelection`,
+ and `setWindow`.
+- Implemented functions `setCurrentTime(date)` and `getCurrentTime()`.
+- Implemented a new callback function `onMoving(item, callback)`.
+- Implemented support for option `align` for range items.
+- Fixed the `change` event sometimes being fired twice on IE10.
+- Fixed canceling moving an item to another group did not move the item
+ back to the original group.
+- Fixed the `change` event sometimes being fired twice on IE10.
+- Fixed canceling moving an item to another group did not move the item
+ back to the original group.
+
+### Network
+
+- A fix in reading group properties for a node.
+- Fixed physics solving stopping when a support node was not moving.
+- Implemented localization support.
+- Implemented option `clickToUse`.
+- Improved the `stabilized` event, it's now firing after every stabilization
+ with iteration count as parameter.
+- Fixed page scroll event not being blocked when moving around in Network
+ using arrow keys.
+- Fixed an initial rendering before the graph has been stabilized.
+- Fixed bug where loading hierarchical data after initialization crashed network.
+- Added different layout method to the hierarchical system based on the direction of the edges.
+
+### Graph2d
+
+- Implemented option `handleOverlap` to support overlap, sideBySide and stack.
+- Implemented two examples showing the `handleOverlap` functionality.
+- Implemented `customRange` for the Y axis and an example showing how it works.
+- Implemented localization support.
+- Implemented option `clickToUse`.
+- Implemented functions `setCurrentTime(date)` and `getCurrentTime()`.
+- Implemented function `moveTo(time, options)`.
+- Fixed bugs.
+- Added groups.visibility functionality and an example showing how it works.
+
+
+## 2014-08-14, version 3.2.0
+
+### General
+
+- Refactored Timeline and Graph2d to use the same core.
+
+### Graph2d
+
+- Added `visible` property to the groups.
+- Added `getLegend()` method.
+- Added `isGroupVisible()` method.
+- Fixed empty group bug.
+- Added `fit()` and `getItemRange()` methods.
+
+### Timeline
+
+- Fixed items in groups sometimes being displayed but not positioned correctly.
+- Fixed a group "null" being displayed in IE when not using groups.
+
+### Network
+
+- Fixed mass = 0 for nodes.
+- Revamped the options system. You can globally set options (network.setOptions) to update settings of nodes and edges that have not been specifically defined by the individual nodes and edges.
+- Disabled inheritColor when color information is set on an edge.
+- Tweaked examples.
+- Removed the global length property for edges. The edgelength is part of the physics system. Therefore, you have to change the springLength of the physics system to change the edge length. Individual edge lengths can still be defined.
+- Removed global edge length definition form examples.
+- Removed onclick and onrelease for navigation and switched to Hammer.js (fixing touchscreen interaction with navigation).
+- Fixed error on adding an edge without having created the nodes it should be connected to (in the case of dynamic smooth curves).
+
+
+## 2014-07-22, version 3.1.0
+
+### General
+
+- Refactored the code to commonjs modules, which are browserifyable. This allows
+ to create custom builds.
+
+### Timeline
+
+- Implemented function `getVisibleItems()`, which returns the items visible
+ in the current window.
+- Added options `margin.item.horizontal` and `margin.item.vertical`, which
+ allows to specify different margins horizontally/vertically.
+- Removed check for number of arguments in callbacks `onAdd`, `onUpdate`,
+ `onRemove`, and `onMove`.
+- Fixed items in groups sometimes being displayed but not positioned correctly.
+- Fixed range where the `end` of the first is equal to the `start` of the second
+ sometimes being stacked instead of put besides each other when `item.margin=0`
+ due to round-off errors.
+
+### Network (formerly named Graph)
+
+- Expanded smoothCurves options for improved support for large clusters.
+- Added multiple types of smoothCurve drawing for greatly improved performance.
+- Option for inherited edge colors from connected nodes.
+- Option to disable the drawing of nodes or edges on drag.
+- Fixed support nodes not being cleaned up if edges are removed.
+- Improved edge selection detection for long smooth curves.
+- Fixed dot radius bug.
+- Updated max velocity of nodes to three times it's original value.
+- Made "stabilized" event fire every time the network stabilizes.
+- Fixed drift in dragging nodes while zooming.
+- Fixed recursively constructing of hierarchical layouts.
+- Added borderWidth option for nodes.
+- Implemented new Hierarchical view solver.
+- Fixed an issue with selecting nodes when the web page is scrolled down.
+- Added Gephi JSON parser
+- Added Neighbour Highlight example
+- Added Import From Gephi example
+- Enabled color parsing for nodes when supplied with rgb(xxx,xxx,xxx) value.
+
+### DataSet
+
+- Added .get() returnType option to return as JSON object, Array or Google
+ DataTable.
+
+
+
+## 2014-07-07, version 3.0.0
+
+### Timeline
+
+- Implemented support for displaying a `title` for both items and groups.
+- Fixed auto detected item type being preferred over the global item `type`.
+- Throws an error when constructing without new keyword.
+- Removed the 'rangeoverflow' item type. Instead, one can use a regular range
+ and change css styling of the item contents to:
+
+ .vis.timeline .item.range .content {
+ overflow: visible;
+ }
+- Fixed the height of background and foreground panels of groups.
+- Fixed ranges in the Timeline sometimes overlapping when dragging the Timeline.
+- Fixed `DataView` not working in Timeline.
+
+### Network (formerly named Graph)
+
+- Renamed `Graph` to `Network` to prevent confusion with the visualizations
+ `Graph2d` and `Graph3d`.
+ - Renamed option `dragGraph` to `dragNetwork`.
+- Now throws an error when constructing without new keyword.
+- Added pull request from Vukk, user can now define the edge width multiplier
+ when selected.
+- Fixed `graph.storePositions()`.
+- Extended Selection API with `selectNodes` and `selectEdges`, deprecating
+ `setSelection`.
+- Fixed multiline labels.
+- Changed hierarchical physics solver and updated docs.
+
+### Graph2d
+
+- Added first iteration of the Graph2d.
+
+### Graph3d
+
+- Now throws an error when constructing without new keyword.
+
+
+## 2014-06-19, version 2.0.0
+
+### Timeline
+
+- Implemented function `destroy` to neatly cleanup a Timeline.
+- Implemented support for dragging the timeline contents vertically.
+- Implemented options `zoomable` and `moveable`.
+- Changed default value of option `showCurrentTime` to true.
+- Internal refactoring and simplification of the code.
+- Fixed property `className` of groups not being applied to related contents and
+ background elements, and not being updated once applied.
+
+### Graph
+
+- Reduced the timestep a little for smoother animations.
+- Fixed dataManipulation.initiallyVisible functionality (thanks theGrue).
+- Forced typecast of fontSize to Number.
+- Added editing of edges using the data manipulation toolkit.
+
+### DataSet
+
+- Renamed option `convert` to `type`.
+
+
+## 2014-06-06, version 1.1.0
+
+### Timeline
+
+- Select event now triggers repeatedly when selecting an already selected item.
+- Renamed `Timeline.repaint()` to `Timeline.redraw()` to be consistent with
+ the other visualisations of vis.js.
+- Fixed `Timeline.clear()` not resetting a configured `options.start` and
+ `options.end`.
+
+### Graph
+
+- Fixed error with zero nodes with hierarchical layout.
+- Added focusOnNode function.
+- Added hover option.
+- Added dragNodes option. Renamed movebale to dragGraph option.
+- Added hover events (hoverNode, blurNode).
+
+### Graph3D
+
+- Ported Graph3D from Chap Links Library.
+
+
+## 2014-05-28, version 1.0.2
+
+### Timeline
+
+- Implemented option `minHeight`, similar to option `maxHeight`.
+- Implemented a method `clear([what])`, to clear items, groups, and configuration
+ of a Timeline instance.
+- Added function `repaint()` to force a repaint of the Timeline.
+- Some tweaks in snapping dragged items to nice dates.
+- Made the instance of moment.js packaged with vis.js accessibly via `vis.moment`.
+- A newly created item is initialized with `end` property when option `type`
+ is `"range"` or `"rangeoverflow"`.
+- Fixed a bug in replacing the DataSet of groups via `Timeline.setGroups(groups)`.
+- Fixed a bug when rendering the Timeline inside a hidden container.
+- Fixed axis scale being determined wrongly for a second Timeline in a single page.
+
+### Graph
+
+- Added zoomable and moveable options.
+- Changes setOptions to avoid resetting view.
+- Interchanged canvasToDOM and DOMtoCanvas to correspond with the docs.
+
+
+## 2014-05-09, version 1.0.1
+
+### Timeline
+
+- Fixed width of items with type `rangeoverflow`.
+- Fixed a bug wrongly rendering invisible items after updating them.
+
+### Graph
+
+- Added coordinate conversion from DOM to Canvas.
+- Fixed bug where the graph stopped animation after settling in playing with physics.
+- Fixed bug where hierarchical physics properties were not handled.
+- Added events for change of view and zooming.
+
+
+## 2014-05-02, version 1.0.0
+
+### Timeline
+
+- Large refactoring of the Timeline, simplifying the code.
+- Great performance improvements.
+- Improved layout of box-items inside groups.
+- Items can now be dragged from one group to another.
+- Implemented option `stack` to enable/disable stacking of items.
+- Implemented function `fit`, which sets the Timeline window such that it fits
+ all items.
+- Option `editable` can now be used to enable/disable individual manipulation
+ actions (`add`, `updateTime`, `updateGroup`, `remove`).
+- Function `setWindow` now accepts an object with properties `start` and `end`.
+- Fixed option `autoResize` forcing a repaint of the Timeline with every check
+ rather than when the Timeline is actually resized.
+- Fixed `select` event fired repeatedly when clicking an empty place on the
+ Timeline, deselecting selected items).
+- Fixed initial visible window in case items exceed `zoomMax`. Thanks @Remper.
+- Fixed an offset in newly created items when using groups.
+- Fixed height of a group not reckoning with the height of the group label.
+- Option `order` is now deprecated. This was needed for performance improvements.
+- More examples added.
+- Minor bug fixes.
+
+### Graph
+
+- Added recalculate hierarchical layout to update node event.
+- Added arrowScaleFactor to scale the arrows on the edges.
+
+### DataSet
+
+- A DataSet can now be constructed with initial data, like
+ `new DataSet(data, options)`.
+
+
+## 2014-04-18, version 0.7.4
+
+### Graph
+
+- Fixed IE9 bug.
+- Style fixes.
+- Minor bug fixes.
+
+
+## 2014-04-16, version 0.7.3
+
+### Graph
+
+- Fixed color bug.
+- Added pull requests from kannonboy and vierja: tooltip styling, label fill
+ color.
+
+
+## 2014-04-09, version 0.7.2
+
+### Graph
+
+- Fixed edge select bug.
+- Fixed zoom bug on empty initialization.
+
+
+## 2014-03-27, version 0.7.1
+
+### Graph
+
+- Fixed edge color bug.
+- Fixed select event bug.
+- Clarified docs, stressing importance of css inclusion for correct display of
+ navigation an manipulation icons.
+- Improved and expanded playing with physics (configurePhysics option).
+- Added highlights to navigation icons if the corresponding key is pressed.
+- Added freezeForStabilization option to improve stabilization with cached
+ positions.
+
+
+## 2014-03-07, version 0.7.0
+
+### Graph
+
+- Changed navigation CSS. Icons are now always correctly positioned.
+- Added stabilizationIterations option to graph.
+- Added storePosition() method to save the XY positions of nodes in the DataSet.
+- Separated allowedToMove into allowedToMoveX and allowedToMoveY. This is
+ required for initializing nodes from hierarchical layouts after
+ storePosition().
+- Added color options for the edges.
+
+
+## 2014-03-06, version 0.6.1
+
+### Graph
+
+- Bugfix graphviz examples.
+- Bugfix labels position for smooth curves.
+- Tweaked graphviz example physics.
+- Updated physics documentation to stress importance of configurePhysics.
+
+### Timeline
+
+- Fixed a bug with options `margin.axis` and `margin.item` being ignored when
+ setting them to zero.
+- Some clarifications in the documentation.
+
+
+## 2014-03-05, version 0.6.0
+
+### Graph
+
+- Added Physics Configuration option. This makes tweaking the physics system to
+ suit your needs easier.
+- Click and doubleClick events.
+- Initial zoom bugfix.
+- Directions for Hierarchical layout.
+- Refactoring and bugfixes.
+
+
+## 2014-02-20, version 0.5.1
+
+- Fixed broken bower module.
+
+
+## 2014-02-20, version 0.5.0
+
+### Timeline
+
+- Editable Items: drag items, add new items, update items, and remove items.
+- Implemented options `selectable`, `editable`.
+- Added events `timechange` and `timechanged` when dragging the custom time bar.
+- Multiple items can be selected using ctrl+click or shift+click.
+- Implemented functions `setWindow(start, end)` and `getWindow()`.
+- Fixed scroll to zoom not working on IE in standards mode.
+
+### Graph
+
+- Editable nodes and edges: create, update, and remove them.
+- Support for smooth, curved edges (on by default).
+- Performance improvements.
+- Fixed scroll to zoom not working on IE in standards mode.
+- Added hierarchical layout option.
+- Overhauled physics system, now using Barnes-Hut simulation by default. Great
+ performance gains.
+- Modified clustering system to give better results.
+- Adaptive performance system to increase visual performance (60fps target).
+
+### DataSet
+
+- Renamed functions `subscribe` and `unsubscribe` to `on` and `off` respectively.
+
+
+## 2014-01-31, version 0.4.0
+
+### Timeline
+
+- Implemented functions `on` and `off` to create event listeners for events
+ `rangechange`, `rangechanged`, and `select`.
+- Implemented function `select` to get and set the selected items.
+- Items can be selected by clicking them, muti-select by holding them.
+- Fixed non working `start` and `end` options.
+
+### Graph
+
+- Fixed longstanding bug in the force calculation, increasing simulation
+ stability and fluidity.
+- Reworked the calculation of the Graph, increasing performance for larger
+ datasets (up to 10x!).
+- Support for automatic clustering in Graph to handle large (>50000) datasets
+ without losing performance.
+- Added automatic initial zooming to Graph, to more easily view large amounts
+ of data.
+- Added local declustering to Graph, freezing the simulation of nodes outside
+ of the cluster.
+- Added support for key-bindings by including mouseTrap in Graph.
+- Added navigation controls.
+- Added keyboard navigation.
+- Implemented functions `on` and `off` to create event listeners for event
+ `select`.
+
+
+## 2014-01-14, version 0.3.0
+
+- Moved the generated library to folder `./dist`
+- Css stylesheet must be loaded explicitly now.
+- Implemented options `showCurrentTime` and `showCustomTime`. Thanks @fi0dor.
+- Implemented touch support for Timeline.
+- Fixed broken Timeline options `min` and `max`.
+- Fixed not being able to load vis.js in node.js.
+
+
+## 2013-09-20, version 0.2.0
+
+- Implemented full touch support for Graph.
+- Fixed initial empty range in the Timeline in case of a single item.
+- Fixed field `className` not working for items.
+
+
+## 2013-06-20, version 0.1.0
+
+- Added support for DataSet to Graph. Graph now uses an id based set of nodes
+ and edges instead of a row based array internally. Methods getSelection and
+ setSelection of Graph now accept a list with ids instead of rows.
+- Graph is now robust against edges pointing to non-existing nodes, which
+ can occur easily while dynamically adding/removing nodes and edges.
+- Implemented basic support for groups in the Timeline.
+- Added documentation on DataSet and DataView.
+- Fixed selection of nodes in a Graph when the containing web page is scrolled.
+- Improved date conversion.
+- Renamed DataSet option `fieldTypes` to `convert`.
+- Renamed function `vis.util.cast` to `vis.util.convert`.
+
+
+## 2013-06-07, version 0.0.9
+
+- First working version of the Graph imported from the old library.
+- Documentation added for both Timeline and Graph.
+
+
+## 2013-05-03, version 0.0.8
+
+- Performance improvements: only visible items are rendered.
+- Minor bug fixes and improvements.
+
+
+## 2013-04-25, version 0.0.7
+
+- Sanitized the published packages on npm and bower.
+
+
+## 2013-04-25, version 0.0.6
+
+- Css is now packaged in the javascript file, and automatically loaded.
+- The library uses node style dependency management for modules now, used
+ with Browserify.
+
+
+## 2013-04-16, version 0.0.5
+
+- First working version of the Timeline.
+- Website created.
--- /dev/null
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2014-2016 Almende B.V.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
--- /dev/null
+Vis.js
+Copyright 2010-2016 Almende B.V.
+
+Vis.js is dual licensed under both
+
+ * The Apache 2.0 License
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ and
+
+ * The MIT License
+ http://opensource.org/licenses/MIT
+
+Vis.js may be distributed under either license.
+
+
+Vis.js uses and redistributes the following third-party libraries:
+
+- component-emitter
+ https://github.com/component/emitter
+ The MIT License
+
+- hammer.js
+ http://hammerjs.github.io/
+ The MIT License
+
+- moment.js
+ http://momentjs.com/
+ The MIT License
+
+- keycharm
+ https://github.com/AlexDM0/keycharm
+ The MIT License
--- /dev/null
+vis.js
+==================
+
+<a href="https://github.com/almende/vis/issues/1781" target="_blank">
+ <img align="right" src="https://raw.githubusercontent.com/almende/vis/master/misc/we_need_help.png">
+</a>
+
+Vis.js is a dynamic, browser based visualization library.
+The library is designed to be easy to use, handle large amounts
+of dynamic data, and enable manipulation of the data.
+The library consists of the following components:
+
+- DataSet and DataView. A flexible key/value based data set. Add, update, and
+ remove items. Subscribe on changes in the data set. A DataSet can filter and
+ order items, and convert fields of items.
+- DataView. A filtered and/or formatted view on a DataSet.
+- Graph2d. Plot data on a timeline with lines or barcharts.
+- Graph3d. Display data in a three dimensional graph.
+- Network. Display a network (force directed graph) with nodes and edges.
+- Timeline. Display different types of data on a timeline.
+
+The vis.js library is developed by [Almende B.V](http://almende.com).
+
+
+## Install
+
+Install via npm:
+
+ $ npm install vis
+
+Install via bower:
+
+ $ bower install vis
+
+Link via cdnjs: http://cdnjs.com
+
+Or download the library from the github project:
+[https://github.com/almende/vis.git](https://github.com/almende/vis.git).
+
+
+## Load
+
+
+To use a component, include the javascript and css files of vis in your web page:
+
+```html
+<!DOCTYPE HTML>
+<html>
+<head>
+ <script src="components/vis/dist/vis.js"></script>
+ <link href="components/vis/dist/vis.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+ <script type="text/javascript">
+ // ... load a visualization
+ </script>
+</body>
+</html>
+```
+
+or load vis.js using require.js. Note that vis.css must be loaded too.
+
+```js
+require.config({
+ paths: {
+ vis: 'path/to/vis/dist',
+ }
+});
+require(['vis'], function (math) {
+ // ... load a visualization
+});
+```
+
+
+A timeline can be instantiated as:
+
+```js
+var timeline = new vis.Timeline(container, data, options);
+```
+
+Where `container` is an HTML element, `data` is an Array with data or a DataSet,
+and `options` is an optional object with configuration options for the
+component.
+
+
+## Example
+
+A basic example on loading a Timeline is shown below. More examples can be
+found in the [examples directory](https://github.com/almende/vis/tree/master/examples)
+of the project.
+
+```html
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Timeline basic demo</title>
+ <script src="vis/dist/vis.js"></script>
+ <link href="vis/dist/vis.css" rel="stylesheet" type="text/css" />
+
+ <style type="text/css">
+ body, html {
+ font-family: sans-serif;
+ }
+ </style>
+</head>
+<body>
+<div id="visualization"></div>
+
+<script type="text/javascript">
+ var container = document.getElementById('visualization');
+ var data = [
+ {id: 1, content: 'item 1', start: '2013-04-20'},
+ {id: 2, content: 'item 2', start: '2013-04-14'},
+ {id: 3, content: 'item 3', start: '2013-04-18'},
+ {id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'},
+ {id: 5, content: 'item 5', start: '2013-04-25'},
+ {id: 6, content: 'item 6', start: '2013-04-27'}
+ ];
+ var options = {};
+ var timeline = new vis.Timeline(container, data, options);
+</script>
+</body>
+</html>
+```
+
+
+## Build
+
+To build the library from source, clone the project from github
+
+ $ git clone git://github.com/almende/vis.git
+
+The source code uses the module style of node (require and module.exports) to
+organize dependencies. To install all dependencies and build the library,
+run `npm install` in the root of the project.
+
+ $ cd vis
+ $ npm install
+
+Then, the project can be build running:
+
+ $ npm run build
+
+To automatically rebuild on changes in the source files, once can use
+
+ $ npm run watch
+
+This will both build and minify the library on changes. Minifying is relatively
+slow, so when only the non-minified library is needed, one can use the
+`watch-dev` script instead:
+
+ $ npm run watch-dev
+
+
+## Custom builds
+
+The folder `dist` contains bundled versions of vis.js for direct use in the browser. These bundles contain the all visualizations and includes external dependencies such as hammer.js and moment.js.
+
+The source code of vis.js consists of commonjs modules, which makes it possible to create custom bundles using tools like [Browserify](http://browserify.org/) or [Webpack](http://webpack.github.io/). This can be bundling just one visualization like the Timeline, or bundling vis.js as part of your own browserified web application.
+
+*Note that hammer.js version 2 is required as of v4.*
+
+
+#### Prerequisites
+
+Before you can do a build:
+
+- Install node.js and npm on your system: https://nodejs.org/
+- Install the following modules using npm: `browserify`, `babelify`, and `uglify-js`:
+
+ ```
+ $ [sudo] npm install -g browserify babelify uglify-js
+ ```
+
+- Download or clone the vis.js project:
+
+ ```
+ $ git clone https://github.com/almende/vis.git
+ ```
+
+- Install the dependencies of vis.js by running `npm install` in the root of the project:
+
+ ```
+ $ cd vis
+ $ npm install
+ ```
+
+#### Example 1: Bundle a single visualization
+
+For example, to create a bundle with just the Timeline and DataSet, create an index file named **custom.js** in the root of the project, containing:
+
+```js
+exports.DataSet = require('./lib/DataSet');
+exports.Timeline = require('./lib/timeline/Timeline');
+```
+
+Then create a custom bundle using browserify, like:
+
+ $ browserify custom.js -t babelify -o vis-custom.js -s vis
+
+This will generate a custom bundle *vis-custom.js*, which exposes the namespace `vis` containing only `DataSet` and `Timeline`. The generated bundle can be minified using uglifyjs:
+
+ $ uglifyjs vis-custom.js -o vis-custom.min.js
+
+The custom bundle can now be loaded like:
+
+```html
+<!DOCTYPE HTML>
+<html>
+<head>
+ <script src="vis-custom.min.js"></script>
+ <link href="dist/vis.min.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+ ...
+</body>
+</html>
+```
+
+#### Example 2: Exclude external libraries
+
+The default bundle `vis.js` is standalone and includes external dependencies such as hammer.js and moment.js. When these libraries are already loaded by the application, vis.js does not need to include these dependencies itself too. To build a custom bundle of vis.js excluding moment.js and hammer.js, run browserify in the root of the project:
+
+ $ browserify index.js -t babelify -o vis-custom.js -s vis -x moment -x hammerjs
+
+This will generate a custom bundle *vis-custom.js*, which exposes the namespace `vis`, and has moment and hammerjs excluded. The generated bundle can be minified with uglifyjs:
+
+ $ uglifyjs vis-custom.js -o vis-custom.min.js
+
+The custom bundle can now be loaded as:
+
+```html
+<!DOCTYPE HTML>
+<html>
+<head>
+ <!-- load external dependencies -->
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.min.js"></script>
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/hammer.js/1.1.3/hammer.min.js"></script>
+
+ <!-- load vis.js -->
+ <script src="vis-custom.min.js"></script>
+ <link href="dist/vis.min.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+ ...
+</body>
+</html>
+```
+
+#### Example 3: Bundle vis.js as part of your (commonjs) application
+
+When writing a web application with commonjs modules, vis.js can be packaged automatically into the application. Create a file **app.js** containing:
+
+```js
+var moment = require('moment');
+var DataSet = require('vis/lib/DataSet');
+var Timeline = require('vis/lib/timeline/Timeline');
+
+var container = document.getElementById('visualization');
+var data = new DataSet([
+ {id: 1, content: 'item 1', start: moment('2013-04-20')},
+ {id: 2, content: 'item 2', start: moment('2013-04-14')},
+ {id: 3, content: 'item 3', start: moment('2013-04-18')},
+ {id: 4, content: 'item 4', start: moment('2013-04-16'), end: moment('2013-04-19')},
+ {id: 5, content: 'item 5', start: moment('2013-04-25')},
+ {id: 6, content: 'item 6', start: moment('2013-04-27')}
+]);
+var options = {};
+var timeline = new Timeline(container, data, options);
+```
+
+Install the application dependencies via npm:
+
+ $ npm install vis moment
+
+The application can be bundled and minified:
+
+ $ browserify app.js -o app-bundle.js -t babelify
+ $ uglifyjs app-bundle.js -o app-bundle.min.js
+
+And loaded into a webpage:
+
+```html
+<!DOCTYPE HTML>
+<html>
+<head>
+ <link href="node_modules/vis/dist/vis.min.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+ <div id="visualization"></div>
+
+ <script src="app-bundle.min.js"></script>
+</body>
+</html>
+```
+
+
+## Test
+
+To test the library, install the project dependencies once:
+
+ $ npm install
+
+Then run the tests:
+
+ $ npm test
+
+
+## License
+
+Copyright (C) 2010-2015 Almende B.V.
+
+Vis.js is dual licensed under both
+
+ * The Apache 2.0 License
+ http://www.apache.org/licenses/LICENSE-2.0
+
+and
+
+ * The MIT License
+ http://opensource.org/licenses/MIT
+
+Vis.js may be distributed under either license.
--- /dev/null
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.16.1
+ * @date 2016-04-18
+ *
+ * @license
+ * Copyright (C) 2011-2016 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(7),e.DataSet=i(8),e.DataView=i(10),e.Queue=i(9),e.Graph3d=i(11),e.graph3d={Camera:i(15),Filter:i(16),Point2d:i(14),Point3d:i(13),Slider:i(17),StepNumber:i(18)},e.moment=i(2),e.Hammer=i(19),e.keycharm=i(22)},function(t,e,i){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=i(2),s=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,n){if(e==t)return.5;var r=1/(e-t);return Math.max(0,(n-t)*r)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=o.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return s.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==n(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var r=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var s in t)void 0!==i[s]&&("object"!==n(i[s])?void 0!==i[s]&&null!==i[s]||void 0===t[s]||r!==!0?t[s]=i[s]:delete t[s]:"object"===n(t[s])&&e.fillIfDefined(t[s],i[s],r))},e.protoExtend=function(t,e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var r in n)t[r]=n[r]}return t},e.extend=function(t,e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},e.selectiveExtend=function(t,e,i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var n=2;n<arguments.length;n++)for(var r=arguments[n],s=0;s<t.length;s++){var o=t[s];r.hasOwnProperty(o)&&(e[o]=r[o])}return e},e.selectiveDeepExtend=function(t,i,n){var r=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var o=arguments[s],a=0;a<t.length;a++){var h=t[a];if(o.hasOwnProperty(h))if(n[h]&&n[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?e.deepExtend(i[h],n[h],!1,r):null===n[h]&&void 0!==i[h]&&r===!0?delete i[h]:i[h]=n[h];else{if(Array.isArray(n[h]))throw new TypeError("Arrays are not supported by deepExtend");null===n[h]&&void 0!==i[h]&&r===!0?delete i[h]:i[h]=n[h]}}return i},e.selectiveNotDeepExtend=function(t,i,n){var r=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var s in n)if(n.hasOwnProperty(s)&&-1==t.indexOf(s))if(n[s]&&n[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],n[s]):null===n[s]&&void 0!==i[s]&&r===!0?delete i[s]:i[s]=n[s];else if(Array.isArray(n[s])){i[s]=[];for(var o=0;o<n[s].length;o++)i[s].push(n[s][o])}else null===n[s]&&void 0!==i[s]&&r===!0?delete i[s]:i[s]=n[s];return i},e.deepExtend=function(t,i,n,r){for(var s in i)if(i.hasOwnProperty(s)||n===!0)if(i[s]&&i[s].constructor===Object)void 0===t[s]&&(t[s]={}),t[s].constructor===Object?e.deepExtend(t[s],i[s],n):null===i[s]&&void 0!==t[s]&&r===!0?delete t[s]:t[s]=i[s];else if(Array.isArray(i[s])){t[s]=[];for(var o=0;o<i[s].length;o++)t[s].push(i[s][o])}else null===i[s]&&void 0!==t[s]&&r===!0?delete t[s]:t[s]=i[s];return t},e.equalArray=function(t,e){if(t.length!=e.length)return!1;for(var i=0,n=t.length;n>i;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var n;if(void 0!==t){if(null===t)return null;if(!i)return t;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(r.isMoment(t))return new Date(t.valueOf());if(e.isString(t))return n=o.exec(t),n?new Date(Number(n[1])):r(t).toDate();throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"Moment":if(e.isNumber(t))return r(t);if(t instanceof Date)return r(t.valueOf());if(r.isMoment(t))return r(t);if(e.isString(t))return n=o.exec(t),r(n?Number(n[1]):t);throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"ISODate":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(r.isMoment(t))return t.toDate().toISOString();if(e.isString(t))return n=o.exec(t),n?new Date(Number(n[1])).toISOString():new Date(t).toISOString();throw new Error("Cannot convert object of type "+e.getType(t)+" to type ISODate");case"ASPDate":if(e.isNumber(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(e.isString(t)){n=o.exec(t);var s;return s=n?new Date(Number(n[1])).valueOf():new Date(t).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+e.getType(t)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var o=/^\/?Date\((\-?\d+)/i;e.getType=function(t){var e="undefined"==typeof t?"undefined":n(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},e.copyAndExtendArray=function(t,e){for(var i=[],n=0;n<t.length;n++)i.push(t[n]);return i.push(e),i},e.copyArray=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e},e.getAbsoluteLeft=function(t){return t.getBoundingClientRect().left},e.getAbsoluteRight=function(t){return t.getBoundingClientRect().right},e.getAbsoluteTop=function(t){return t.getBoundingClientRect().top},e.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},e.removeClassName=function(t,e){var i=t.className.split(" "),n=i.indexOf(e);-1!=n&&(i.splice(n,1),t.className=i.join(" "))},e.forEach=function(t,e){var i,n;if(Array.isArray(t))for(i=0,n=t.length;n>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},e.toArray=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},e.throttle=function(t,e){var i=null,n=!1;return function r(){i?n=!0:(n=!1,t(),i=setTimeout(function(){i=null,n&&r()},e))}},e.addEventListener=function(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)},e.removeEventListener=function(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)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,n){return e+e+i+i+n+n});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(-1!=t.indexOf("rgba"))return t;if(-1!=t.indexOf("rgb")){var n=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+n[0]+","+n[1]+","+n[2]+","+i+")"}var n=e.hexToRGB(t);return null==n?t:"rgba("+n.r+","+n.g+","+n.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(n[0],n[1],n[2])}if(e.isValidHex(t)===!0){var r=e.hexToHSV(t),s={h:r.h,s:.8*r.s,v:Math.min(1,1.02*r.v)},o={h:r.h,s:Math.min(1,1.25*r.s),v:.8*r.v},a=e.HSVToHex(o.h,o.s,o.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,Math.min(e,i)),r=Math.max(t,Math.max(e,i));if(n==r)return{h:0,s:0,v:n};var s=t==n?e-i:i==n?t-e:i-t,o=t==n?3:i==n?1:5,a=60*(o-s/(r-n))/360,h=(r-n)/r,l=r;return{h:a,s:h,v:l}};var a={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),n=i[0].trim(),r=i[1].trim();e[n]=r}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var n=a.split(t.style.cssText),r=a.split(i),s=e.extend(n,r);t.style.cssText=a.join(s)},e.removeCssText=function(t,e){var i=a.split(t.style.cssText),n=a.split(e);for(var r in n)n.hasOwnProperty(r)&&delete i[r];t.style.cssText=a.join(i)},e.HSVToRGB=function(t,e,i){var n,r,s,o=Math.floor(6*t),a=6*t-o,h=i*(1-e),l=i*(1-a*e),u=i*(1-(1-a)*e);switch(o%6){case 0:n=i,r=u,s=h;break;case 1:n=l,r=i,s=h;break;case 2:n=h,r=i,s=u;break;case 3:n=h,r=l,s=i;break;case 4:n=u,r=h,s=i;break;case 5:n=i,r=h,s=l}return{r:Math.floor(255*n),g:Math.floor(255*r),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,n){var r=e.HSVToRGB(t,i,n);return e.RGBToHex(r.r,r.g,r.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":n(i))){for(var r=Object.create(i),s=0;s<t.length;s++)i.hasOwnProperty(t[s])&&"object"==n(i[t[s]])&&(r[t[s]]=e.bridgeObject(i[t[s]]));return r}return null},e.bridgeObject=function(t){if("object"==("undefined"==typeof t?"undefined":n(t))){var i=Object.create(t);for(var r in t)t.hasOwnProperty(r)&&"object"==n(t[r])&&(i[r]=e.bridgeObject(t[r]));return i}return null},e.insertSort=function(t,e){for(var i=0;i<t.length;i++){for(var n=t[i],r=i;r>0&&e(n,t[r-1])<0;r--)t[r]=t[r-1];t[r]=n}return t},e.mergeOptions=function(t,e,i){var n=(arguments.length<=3||void 0===arguments[3]?!1:arguments[3],arguments.length<=4||void 0===arguments[4]?{}:arguments[4]);if(null===e[i])t[i]=Object.create(n[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var r in e[i])e[i].hasOwnProperty(r)&&(t[i][r]=e[i][r])}},e.binarySearchCustom=function(t,e,i,n){for(var r=1e4,s=0,o=0,a=t.length-1;a>=o&&r>s;){var h=Math.floor((o+a)/2),l=t[h],u=void 0===n?l[i]:l[i][n],d=e(u);if(0==d)return h;-1==d?o=h+1:a=h-1,s++}return-1},e.binarySearchValue=function(t,e,i,n,r){for(var s,o,a,h,l=1e4,u=0,d=0,c=t.length-1,r=void 0!=r?r:function(t,e){return t==e?0:e>t?-1:1};c>=d&&l>u;){if(h=Math.floor(.5*(c+d)),s=t[Math.max(0,h-1)][i],o=t[h][i],a=t[Math.min(t.length-1,h+1)][i],0==r(o,e))return h;if(r(s,e)<0&&r(o,e)>0)return"before"==n?Math.max(0,h-1):h;if(r(o,e)<0&&r(a,e)>0)return"before"==n?h:Math.min(t.length-1,h+1);r(o,e)<0?d=h+1:c=h-1,u++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return.5>t?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return.5>t?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.5>t?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.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t}}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return an.apply(null,arguments)}function i(t){an=t}function n(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function a(t,e){for(var i in e)o(e,i)&&(t[i]=e[i]);return o(e,"toString")&&(t.toString=e.toString),o(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,i,n){return It(t,e,i,n,!0).utc()}function l(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function u(t){return null==t._pf&&(t._pf=l()),t._pf}function d(t){if(null==t._isValid){var e=u(t),i=hn.call(e.parsedDateParts,function(t){return null!=t});t._isValid=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function c(t){var e=h(NaN);return null!=t?a(u(e),t):u(e).userInvalidated=!0,e}function f(t){return void 0===t}function p(t,e){var i,n,r;if(f(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),f(e._i)||(t._i=e._i),f(e._f)||(t._f=e._f),f(e._l)||(t._l=e._l),f(e._strict)||(t._strict=e._strict),f(e._tzm)||(t._tzm=e._tzm),f(e._isUTC)||(t._isUTC=e._isUTC),f(e._offset)||(t._offset=e._offset),f(e._pf)||(t._pf=u(e)),f(e._locale)||(t._locale=e._locale),ln.length>0)for(i in ln)n=ln[i],r=e[n],f(r)||(t[n]=r);return t}function m(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),un===!1&&(un=!0,e.updateOffset(this),un=!1)}function v(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function y(t){return 0>t?Math.ceil(t):Math.floor(t)}function g(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=y(e)),i}function _(t,e,i){var n,r=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),o=0;for(n=0;r>n;n++)(i&&t[n]!==e[n]||!i&&g(t[n])!==g(e[n]))&&o++;return o+s}function x(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,i){var n=!0;return a(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),n&&(x(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),i.apply(this,arguments)},i)}function b(t,i){null!=e.deprecationHandler&&e.deprecationHandler(t,i),dn[t]||(x(i),dn[t]=!0)}function M(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function T(t){var e,i;for(i in t)e=t[i],M(e)?this[i]=e:this["_"+i]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function D(t,e){var i,n=a({},t);for(i in e)o(e,i)&&(S(t[i])&&S(e[i])?(n[i]={},a(n[i],t[i]),a(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);return n}function k(t){null!=t&&this.set(t)}function C(t){return t?t.toLowerCase().replace("_","-"):t}function O(t){for(var e,i,n,r,s=0;s<t.length;){for(r=C(t[s]).split("-"),e=r.length,i=C(t[s+1]),i=i?i.split("-"):null;e>0;){if(n=P(r.slice(0,e).join("-")))return n;if(i&&i.length>=e&&_(r,i,!0)>=e-1)break;e--}s++}return null}function P(e){var i=null;if(!mn[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=fn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),E(i)}catch(n){}return mn[e]}function E(t,e){var i;return t&&(i=f(e)?A(t):L(t,e),i&&(fn=i)),fn._abbr}function L(t,e){return null!==e?(e.abbr=t,null!=mn[t]?(b("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=D(mn[t]._config,e)):null!=e.parentLocale&&(null!=mn[e.parentLocale]?e=D(mn[e.parentLocale]._config,e):b("parentLocaleUndefined","specified parentLocale is not defined yet")),mn[t]=new k(e),E(t),mn[t]):(delete mn[t],null)}function Y(t,e){if(null!=e){var i;null!=mn[t]&&(e=D(mn[t]._config,e)),i=new k(e),i.parentLocale=mn[t],mn[t]=i,E(t)}else null!=mn[t]&&(null!=mn[t].parentLocale?mn[t]=mn[t].parentLocale:null!=mn[t]&&delete mn[t]);return mn[t]}function A(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return fn;if(!n(t)){if(e=P(t))return e;t=[t]}return O(t)}function R(){return cn(mn)}function I(t,e){var i=t.toLowerCase();vn[i]=vn[i+"s"]=vn[e]=t}function z(t){return"string"==typeof t?vn[t]||vn[t.toLowerCase()]:void 0}function W(t){var e,i,n={};for(i in t)o(t,i)&&(e=z(i),e&&(n[e]=t[i]));return n}function N(t,i){return function(n){return null!=n?(V(this,t,n),e.updateOffset(this,i),this):F(this,t)}}function F(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function V(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function B(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=z(t),M(this[t]))return this[t](e);return this}function U(t,e,i){var n=""+Math.abs(t),r=e-n.length,s=t>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}function H(t,e,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),t&&(xn[t]=r),e&&(xn[e[0]]=function(){return U(r.apply(this,arguments),e[1],e[2])}),i&&(xn[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function j(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function G(t){var e,i,n=t.match(yn);for(e=0,i=n.length;i>e;e++)xn[n[e]]?n[e]=xn[n[e]]:n[e]=j(n[e]);return function(e){var r,s="";for(r=0;i>r;r++)s+=n[r]instanceof Function?n[r].call(e,t):n[r];return s}}function X(t,e){return t.isValid()?(e=Z(e,t.localeData()),_n[e]=_n[e]||G(e),_n[e](t)):t.localeData().invalidDate()}function Z(t,e){function i(t){return e.longDateFormat(t)||t}var n=5;for(gn.lastIndex=0;n>=0&&gn.test(t);)t=t.replace(gn,i),gn.lastIndex=0,n-=1;return t}function q(t,e,i){Wn[t]=M(e)?e:function(t,n){return t&&i?i:e}}function Q(t,e){return o(Wn,t)?Wn[t](e._strict,e._locale):new RegExp($(t))}function $(t){return J(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,n,r){return e||i||n||r}))}function J(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function K(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(n=function(t,i){i[e]=g(t)}),i=0;i<t.length;i++)Nn[t[i]]=n}function tt(t,e){K(t,function(t,i,n,r){n._w=n._w||{},e(t,n._w,n,r)})}function et(t,e,i){null!=e&&o(Nn,t)&&Nn[t](e,i._a,i,t)}function it(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function nt(t,e){return n(this._months)?this._months[t.month()]:this._months[qn.test(e)?"format":"standalone"][t.month()]}function rt(t,e){return n(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[qn.test(e)?"format":"standalone"][t.month()]}function st(t,e,i){var n,r,s,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;12>n;++n)s=h([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===e?(r=pn.call(this._shortMonthsParse,o),-1!==r?r:null):(r=pn.call(this._longMonthsParse,o),-1!==r?r:null):"MMM"===e?(r=pn.call(this._shortMonthsParse,o),-1!==r?r:(r=pn.call(this._longMonthsParse,o),-1!==r?r:null)):(r=pn.call(this._longMonthsParse,o),-1!==r?r:(r=pn.call(this._shortMonthsParse,o),-1!==r?r:null))}function ot(t,e,i){var n,r,s;if(this._monthsParseExact)return st.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(r=h([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(s.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}}function at(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=g(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return i=Math.min(t.date(),it(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function ht(t){return null!=t?(at(this,t),e.updateOffset(this,!0),this):F(this,"Month")}function lt(){return it(this.year(),this.month())}function ut(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ct.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function dt(t){return this._monthsParseExact?(o(this,"_monthsRegex")||ct.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ct(){function t(t,e){return e.length-t.length}var e,i,n=[],r=[],s=[];for(e=0;12>e;e++)i=h([2e3,e]),n.push(this.monthsShort(i,"")),r.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(n.sort(t),r.sort(t),s.sort(t),e=0;12>e;e++)n[e]=J(n[e]),r[e]=J(r[e]),s[e]=J(s[e]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function ft(t){var e,i=t._a;return i&&-2===u(t).overflow&&(e=i[Vn]<0||i[Vn]>11?Vn:i[Bn]<1||i[Bn]>it(i[Fn],i[Vn])?Bn:i[Un]<0||i[Un]>24||24===i[Un]&&(0!==i[Hn]||0!==i[jn]||0!==i[Gn])?Un:i[Hn]<0||i[Hn]>59?Hn:i[jn]<0||i[jn]>59?jn:i[Gn]<0||i[Gn]>999?Gn:-1,u(t)._overflowDayOfYear&&(Fn>e||e>Bn)&&(e=Bn),u(t)._overflowWeeks&&-1===e&&(e=Xn),u(t)._overflowWeekday&&-1===e&&(e=Zn),u(t).overflow=e),t}function pt(t){var e,i,n,r,s,o,a=t._i,h=tr.exec(a)||er.exec(a);if(h){for(u(t).iso=!0,e=0,i=nr.length;i>e;e++)if(nr[e][1].exec(h[1])){r=nr[e][0],n=nr[e][2]!==!1;break}if(null==r)return void(t._isValid=!1);if(h[3]){for(e=0,i=rr.length;i>e;e++)if(rr[e][1].exec(h[3])){s=(h[2]||" ")+rr[e][0];break}if(null==s)return void(t._isValid=!1)}if(!n&&null!=s)return void(t._isValid=!1);if(h[4]){if(!ir.exec(h[4]))return void(t._isValid=!1);o="Z"}t._f=r+(s||"")+(o||""),Ot(t)}else t._isValid=!1}function mt(t){var i=sr.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(pt(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function vt(t,e,i,n,r,s,o){var a=new Date(t,e,i,n,r,s,o);return 100>t&&t>=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function yt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function gt(t){return _t(t)?366:365}function _t(t){return t%4===0&&t%100!==0||t%400===0}function xt(){return _t(this.year())}function wt(t,e,i){var n=7+e-i,r=(7+yt(t,0,n).getUTCDay()-e)%7;return-r+n-1}function bt(t,e,i,n,r){var s,o,a=(7+i-n)%7,h=wt(t,n,r),l=1+7*(e-1)+a+h;return 0>=l?(s=t-1,o=gt(s)+l):l>gt(t)?(s=t+1,o=l-gt(t)):(s=t,o=l),{year:s,dayOfYear:o}}function Mt(t,e,i){var n,r,s=wt(t.year(),e,i),o=Math.floor((t.dayOfYear()-s-1)/7)+1;return 1>o?(r=t.year()-1,n=o+St(r,e,i)):o>St(t.year(),e,i)?(n=o-St(t.year(),e,i),r=t.year()+1):(r=t.year(),n=o),{week:n,year:r}}function St(t,e,i){var n=wt(t,e,i),r=wt(t+1,e,i);return(gt(t)-n+r)/7}function Tt(t,e,i){return null!=t?t:null!=e?e:i}function Dt(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function kt(t){var e,i,n,r,s=[];if(!t._d){for(n=Dt(t),t._w&&null==t._a[Bn]&&null==t._a[Vn]&&Ct(t),t._dayOfYear&&(r=Tt(t._a[Fn],n[Fn]),t._dayOfYear>gt(r)&&(u(t)._overflowDayOfYear=!0),i=yt(r,0,t._dayOfYear),t._a[Vn]=i.getUTCMonth(),t._a[Bn]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=s[e]=n[e];for(;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Un]&&0===t._a[Hn]&&0===t._a[jn]&&0===t._a[Gn]&&(t._nextDay=!0,t._a[Un]=0),t._d=(t._useUTC?yt:vt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Un]=24)}}function Ct(t){var e,i,n,r,s,o,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(s=1,o=4,i=Tt(e.GG,t._a[Fn],Mt(zt(),1,4).year),n=Tt(e.W,1),r=Tt(e.E,1),(1>r||r>7)&&(h=!0)):(s=t._locale._week.dow,o=t._locale._week.doy,i=Tt(e.gg,t._a[Fn],Mt(zt(),s,o).year),n=Tt(e.w,1),null!=e.d?(r=e.d,(0>r||r>6)&&(h=!0)):null!=e.e?(r=e.e+s,(e.e<0||e.e>6)&&(h=!0)):r=s),1>n||n>St(i,s,o)?u(t)._overflowWeeks=!0:null!=h?u(t)._overflowWeekday=!0:(a=bt(i,n,r,s,o),t._a[Fn]=a.year,t._dayOfYear=a.dayOfYear)}function Ot(t){if(t._f===e.ISO_8601)return void pt(t);t._a=[],u(t).empty=!0;var i,n,r,s,o,a=""+t._i,h=a.length,l=0;for(r=Z(t._f,t._locale).match(yn)||[],i=0;i<r.length;i++)s=r[i],n=(a.match(Q(s,t))||[])[0],n&&(o=a.substr(0,a.indexOf(n)),o.length>0&&u(t).unusedInput.push(o),a=a.slice(a.indexOf(n)+n.length),l+=n.length),xn[s]?(n?u(t).empty=!1:u(t).unusedTokens.push(s),et(s,n,t)):t._strict&&!n&&u(t).unusedTokens.push(s);u(t).charsLeftOver=h-l,a.length>0&&u(t).unusedInput.push(a),u(t).bigHour===!0&&t._a[Un]<=12&&t._a[Un]>0&&(u(t).bigHour=void 0),u(t).parsedDateParts=t._a.slice(0),u(t).meridiem=t._meridiem,t._a[Un]=Pt(t._locale,t._a[Un],t._meridiem),kt(t),ft(t)}function Pt(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(n=t.isPM(i),n&&12>e&&(e+=12),n||12!==e||(e=0),e):e}function Et(t){var e,i,n,r,s;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;r<t._f.length;r++)s=0,e=p({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],Ot(e),d(e)&&(s+=u(e).charsLeftOver,s+=10*u(e).unusedTokens.length,u(e).score=s,(null==n||n>s)&&(n=s,i=e));a(t,i||e)}function Lt(t){if(!t._d){var e=W(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),kt(t)}}function Yt(t){var e=new m(ft(At(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function At(t){var e=t._i,i=t._f;return t._locale=t._locale||A(t._l),null===e||void 0===i&&""===e?c({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),v(e)?new m(ft(e)):(n(i)?Et(t):i?Ot(t):r(e)?t._d=e:Rt(t),d(t)||(t._d=null),t))}function Rt(t){var i=t._i;void 0===i?t._d=new Date(e.now()):r(i)?t._d=new Date(i.valueOf()):"string"==typeof i?mt(t):n(i)?(t._a=s(i.slice(0),function(t){return parseInt(t,10)}),kt(t)):"object"==typeof i?Lt(t):"number"==typeof i?t._d=new Date(i):e.createFromInputFallback(t)}function It(t,e,i,n,r){var s={};return"boolean"==typeof i&&(n=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=i,s._i=t,s._f=e,s._strict=n,Yt(s)}function zt(t,e,i,n){return It(t,e,i,n,!1)}function Wt(t,e){var i,r;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return zt();for(i=e[0],r=1;r<e.length;++r)e[r].isValid()&&!e[r][t](i)||(i=e[r]);return i}function Nt(){var t=[].slice.call(arguments,0);return Wt("isBefore",t)}function Ft(){var t=[].slice.call(arguments,0);return Wt("isAfter",t)}function Vt(t){var e=W(t),i=e.year||0,n=e.quarter||0,r=e.month||0,s=e.week||0,o=e.day||0,a=e.hour||0,h=e.minute||0,l=e.second||0,u=e.millisecond||0;this._milliseconds=+u+1e3*l+6e4*h+1e3*a*60*60,this._days=+o+7*s,this._months=+r+3*n+12*i,this._data={},this._locale=A(),this._bubble()}function Bt(t){return t instanceof Vt}function Ut(t,e){H(t,0,0,function(){var t=this.utcOffset(),i="+";return 0>t&&(t=-t,i="-"),i+U(~~(t/60),2)+e+U(~~t%60,2)})}function Ht(t,e){var i=(e||"").match(t)||[],n=i[i.length-1]||[],r=(n+"").match(ur)||["-",0,0],s=+(60*r[1])+g(r[2]);return"+"===r[0]?s:-s}function jt(t,i){var n,s;return i._isUTC?(n=i.clone(),s=(v(t)||r(t)?t.valueOf():zt(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),e.updateOffset(n,!1),n):zt(t).local()}function Gt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Xt(t,i){var n,r=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Ht(Rn,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&i&&(n=Gt(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),r!==t&&(!i||this._changeInProgress?ue(this,re(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Gt(this):null!=t?this:NaN}function Zt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function qt(t){return this.utcOffset(0,t)}function Qt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Gt(this),"m")),this}function $t(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ht(An,this._i)),this}function Jt(t){return this.isValid()?(t=t?zt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Kt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!f(this._isDSTShifted))return this._isDSTShifted;var t={};if(p(t,this),t=At(t),t._a){var e=t._isUTC?h(t._a):zt(t._a);this._isDSTShifted=this.isValid()&&_(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ie(){return this.isValid()?this._isUTC:!1}function ne(){return this.isValid()?this._isUTC&&0===this._offset:!1}function re(t,e){var i,n,r,s=t,a=null;return Bt(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=dr.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:g(a[Bn])*i,h:g(a[Un])*i,m:g(a[Hn])*i,s:g(a[jn])*i,ms:g(a[Gn])*i}):(a=cr.exec(t))?(i="-"===a[1]?-1:1,s={y:se(a[2],i),M:se(a[3],i),w:se(a[4],i),d:se(a[5],i),h:se(a[6],i),m:se(a[7],i),s:se(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(r=ae(zt(s.from),zt(s.to)),s={},s.ms=r.milliseconds,s.M=r.months),n=new Vt(s),Bt(t)&&o(t,"_locale")&&(n._locale=t._locale),n}function se(t,e){var i=t&&parseFloat(t.replace(",","."));
+return(isNaN(i)?0:i)*e}function oe(t,e){var i={milliseconds:0,months:0};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 ae(t,e){var i;return t.isValid()&&e.isValid()?(e=jt(e,t),t.isBefore(e)?i=oe(t,e):(i=oe(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function he(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function le(t,e){return function(i,n){var r,s;return null===n||isNaN(+n)||(b(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),s=i,i=n,n=s),i="string"==typeof i?+i:i,r=re(i,n),ue(this,r,t),this}}function ue(t,i,n,r){var s=i._milliseconds,o=he(i._days),a=he(i._months);t.isValid()&&(r=null==r?!0:r,s&&t._d.setTime(t._d.valueOf()+s*n),o&&V(t,"Date",F(t,"Date")+o*n),a&&at(t,F(t,"Month")+a*n),r&&e.updateOffset(t,o||a))}function de(t,e){var i=t||zt(),n=jt(i,this).startOf("day"),r=this.diff(n,"days",!0),s=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse",o=e&&(M(e[s])?e[s]():e[s]);return this.format(o||this.localeData().calendar(s,this,zt(i)))}function ce(){return new m(this)}function fe(t,e){var i=v(t)?t:zt(t);return this.isValid()&&i.isValid()?(e=z(f(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf()):!1}function pe(t,e){var i=v(t)?t:zt(t);return this.isValid()&&i.isValid()?(e=z(f(e)?"millisecond":e),"millisecond"===e?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf()):!1}function me(t,e,i,n){return n=n||"()",("("===n[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===n[1]?this.isBefore(e,i):!this.isAfter(e,i))}function ve(t,e){var i,n=v(t)?t:zt(t);return this.isValid()&&n.isValid()?(e=z(e||"millisecond"),"millisecond"===e?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf())):!1}function ye(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ge(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function _e(t,e,i){var n,r,s,o;return this.isValid()?(n=jt(t,this),n.isValid()?(r=6e4*(n.utcOffset()-this.utcOffset()),e=z(e),"year"===e||"month"===e||"quarter"===e?(o=xe(this,n),"quarter"===e?o/=3:"year"===e&&(o/=12)):(s=this-n,o="second"===e?s/1e3:"minute"===e?s/6e4:"hour"===e?s/36e5:"day"===e?(s-r)/864e5:"week"===e?(s-r)/6048e5:s),i?o:y(o)):NaN):NaN}function xe(t,e){var i,n,r=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(r,"months");return 0>e-s?(i=t.clone().add(r-1,"months"),n=(e-s)/(s-i)):(i=t.clone().add(r+1,"months"),n=(e-s)/(i-s)),-(r+n)||0}function we(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function be(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?M(Date.prototype.toISOString)?this.toDate().toISOString():X(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):X(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function Me(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var i=X(this,t);return this.localeData().postformat(i)}function Se(t,e){return this.isValid()&&(v(t)&&t.isValid()||zt(t).isValid())?re({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Te(t){return this.from(zt(),t)}function De(t,e){return this.isValid()&&(v(t)&&t.isValid()||zt(t).isValid())?re({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ke(t){return this.to(zt(),t)}function Ce(t){var e;return void 0===t?this._locale._abbr:(e=A(t),null!=e&&(this._locale=e),this)}function Oe(){return this._locale}function Pe(t){switch(t=z(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function Ee(t){return t=z(t),void 0===t||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))}function Le(){return this._d.valueOf()-6e4*(this._offset||0)}function Ye(){return Math.floor(this.valueOf()/1e3)}function Ae(){return this._offset?new Date(this.valueOf()):this._d}function Re(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Ie(){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()}}function ze(){return this.isValid()?this.toISOString():null}function We(){return d(this)}function Ne(){return a({},u(this))}function Fe(){return u(this).overflow}function Ve(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Be(t,e){H(0,[t,t.length],0,e)}function Ue(t){return Xe.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function He(t){return Xe.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function je(){return St(this.year(),1,4)}function Ge(){var t=this.localeData()._week;return St(this.year(),t.dow,t.doy)}function Xe(t,e,i,n,r){var s;return null==t?Mt(this,n,r).year:(s=St(t,n,r),e>s&&(e=s),Ze.call(this,t,e,i,n,r))}function Ze(t,e,i,n,r){var s=bt(t,e,i,n,r),o=yt(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function qe(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Qe(t){return Mt(t,this._week.dow,this._week.doy).week}function $e(){return this._week.dow}function Je(){return this._week.doy}function Ke(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function ti(t){var e=Mt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function ei(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function ii(t,e){return n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function ni(t){return this._weekdaysShort[t.day()]}function ri(t){return this._weekdaysMin[t.day()]}function si(t,e,i){var n,r,s,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;7>n;++n)s=h([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(r=pn.call(this._weekdaysParse,o),-1!==r?r:null):"ddd"===e?(r=pn.call(this._shortWeekdaysParse,o),-1!==r?r:null):(r=pn.call(this._minWeekdaysParse,o),-1!==r?r:null):"dddd"===e?(r=pn.call(this._weekdaysParse,o),-1!==r?r:(r=pn.call(this._shortWeekdaysParse,o),-1!==r?r:(r=pn.call(this._minWeekdaysParse,o),-1!==r?r:null))):"ddd"===e?(r=pn.call(this._shortWeekdaysParse,o),-1!==r?r:(r=pn.call(this._weekdaysParse,o),-1!==r?r:(r=pn.call(this._minWeekdaysParse,o),-1!==r?r:null))):(r=pn.call(this._minWeekdaysParse,o),-1!==r?r:(r=pn.call(this._weekdaysParse,o),-1!==r?r:(r=pn.call(this._shortWeekdaysParse,o),-1!==r?r:null)))}function oi(t,e,i){var n,r,s;if(this._weekdaysParseExact)return si.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(r=h([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(s.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}}function ai(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=ei(t,this.localeData()),this.add(t-e,"d")):e}function hi(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")}function li(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function ui(t){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||fi.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex}function di(t){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||fi.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ci(t){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||fi.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function fi(){function t(t,e){return e.length-t.length}var e,i,n,r,s,o=[],a=[],l=[],u=[];for(e=0;7>e;e++)i=h([2e3,1]).day(e),n=this.weekdaysMin(i,""),r=this.weekdaysShort(i,""),s=this.weekdays(i,""),o.push(n),a.push(r),l.push(s),u.push(n),u.push(r),u.push(s);for(o.sort(t),a.sort(t),l.sort(t),u.sort(t),e=0;7>e;e++)a[e]=J(a[e]),l[e]=J(l[e]),u[e]=J(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function pi(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function mi(){return this.hours()%12||12}function vi(){return this.hours()||24}function yi(t,e){H(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function gi(t,e){return e._meridiemParse}function _i(t){return"p"===(t+"").toLowerCase().charAt(0)}function xi(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function wi(t,e){e[Gn]=g(1e3*("0."+t))}function bi(){return this._isUTC?"UTC":""}function Mi(){return this._isUTC?"Coordinated Universal Time":""}function Si(t){return zt(1e3*t)}function Ti(){return zt.apply(null,arguments).parseZone()}function Di(t,e,i){var n=this._calendar[t];return M(n)?n.call(e,i):n}function ki(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])}function Ci(){return this._invalidDate}function Oi(t){return this._ordinal.replace("%d",t)}function Pi(t){return t}function Ei(t,e,i,n){var r=this._relativeTime[i];return M(r)?r(t,e,i,n):r.replace(/%d/i,t)}function Li(t,e){var i=this._relativeTime[t>0?"future":"past"];return M(i)?i(e):i.replace(/%s/i,e)}function Yi(t,e,i,n){var r=A(),s=h().set(n,e);return r[i](s,t)}function Ai(t,e,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Yi(t,e,i,"month");var n,r=[];for(n=0;12>n;n++)r[n]=Yi(t,n,i,"month");return r}function Ri(t,e,i,n){"boolean"==typeof t?("number"==typeof e&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,"number"==typeof e&&(i=e,e=void 0),e=e||"");var r=A(),s=t?r._week.dow:0;if(null!=i)return Yi(e,(i+s)%7,n,"day");var o,a=[];for(o=0;7>o;o++)a[o]=Yi(e,(o+s)%7,n,"day");return a}function Ii(t,e){return Ai(t,e,"months")}function zi(t,e){return Ai(t,e,"monthsShort")}function Wi(t,e,i){return Ri(t,e,i,"weekdays")}function Ni(t,e,i){return Ri(t,e,i,"weekdaysShort")}function Fi(t,e,i){return Ri(t,e,i,"weekdaysMin")}function Vi(){var t=this._data;return this._milliseconds=Nr(this._milliseconds),this._days=Nr(this._days),this._months=Nr(this._months),t.milliseconds=Nr(t.milliseconds),t.seconds=Nr(t.seconds),t.minutes=Nr(t.minutes),t.hours=Nr(t.hours),t.months=Nr(t.months),t.years=Nr(t.years),this}function Bi(t,e,i,n){var r=re(e,i);return t._milliseconds+=n*r._milliseconds,t._days+=n*r._days,t._months+=n*r._months,t._bubble()}function Ui(t,e){return Bi(this,t,e,1)}function Hi(t,e){return Bi(this,t,e,-1)}function ji(t){return 0>t?Math.floor(t):Math.ceil(t)}function Gi(){var t,e,i,n,r,s=this._milliseconds,o=this._days,a=this._months,h=this._data;return s>=0&&o>=0&&a>=0||0>=s&&0>=o&&0>=a||(s+=864e5*ji(Zi(a)+o),o=0,a=0),h.milliseconds=s%1e3,t=y(s/1e3),h.seconds=t%60,e=y(t/60),h.minutes=e%60,i=y(e/60),h.hours=i%24,o+=y(i/24),r=y(Xi(o)),a+=r,o-=ji(Zi(r)),n=y(a/12),a%=12,h.days=o,h.months=a,h.years=n,this}function Xi(t){return 4800*t/146097}function Zi(t){return 146097*t/4800}function qi(t){var e,i,n=this._milliseconds;if(t=z(t),"month"===t||"year"===t)return e=this._days+n/864e5,i=this._months+Xi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(Zi(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)}}function Qi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*g(this._months/12)}function $i(t){return function(){return this.as(t)}}function Ji(t){return t=z(t),this[t+"s"]()}function Ki(t){return function(){return this._data[t]}}function tn(){return y(this.days()/7)}function en(t,e,i,n,r){return r.relativeTime(e||1,!!i,t,n)}function nn(t,e,i){var n=re(t).abs(),r=es(n.as("s")),s=es(n.as("m")),o=es(n.as("h")),a=es(n.as("d")),h=es(n.as("M")),l=es(n.as("y")),u=r<is.s&&["s",r]||1>=s&&["m"]||s<is.m&&["mm",s]||1>=o&&["h"]||o<is.h&&["hh",o]||1>=a&&["d"]||a<is.d&&["dd",a]||1>=h&&["M"]||h<is.M&&["MM",h]||1>=l&&["y"]||["yy",l];return u[2]=e,u[3]=+t>0,u[4]=i,en.apply(null,u)}function rn(t,e){return void 0===is[t]?!1:void 0===e?is[t]:(is[t]=e,!0)}function sn(t){var e=this.localeData(),i=nn(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function on(){var t,e,i,n=ns(this._milliseconds)/1e3,r=ns(this._days),s=ns(this._months);t=y(n/60),e=y(t/60),n%=60,t%=60,i=y(s/12),s%=12;var o=i,a=s,h=r,l=e,u=t,d=n,c=this.asSeconds();return c?(0>c?"-":"")+"P"+(o?o+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(l||u||d?"T":"")+(l?l+"H":"")+(u?u+"M":"")+(d?d+"S":""):"P0D"}var an,hn;hn=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;i>n;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};var ln=e.momentProperties=[],un=!1,dn={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var cn;cn=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)o(t,e)&&i.push(e);return i};var fn,pn,mn={},vn={},yn=/(\[[^\[]*\])|(\\)?([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,gn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,_n={},xn={},wn=/\d/,bn=/\d\d/,Mn=/\d{3}/,Sn=/\d{4}/,Tn=/[+-]?\d{6}/,Dn=/\d\d?/,kn=/\d\d\d\d?/,Cn=/\d\d\d\d\d\d?/,On=/\d{1,3}/,Pn=/\d{1,4}/,En=/[+-]?\d{1,6}/,Ln=/\d+/,Yn=/[+-]?\d+/,An=/Z|[+-]\d\d:?\d\d/gi,Rn=/Z|[+-]\d\d(?::?\d\d)?/gi,In=/[+-]?\d+(\.\d{1,3})?/,zn=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Wn={},Nn={},Fn=0,Vn=1,Bn=2,Un=3,Hn=4,jn=5,Gn=6,Xn=7,Zn=8;pn=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},H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),H("MMMM",0,0,function(t){return this.localeData().months(this,t)}),I("month","M"),q("M",Dn),q("MM",Dn,bn),q("MMM",function(t,e){return e.monthsShortRegex(t)}),q("MMMM",function(t,e){return e.monthsRegex(t)}),K(["M","MM"],function(t,e){e[Vn]=g(t)-1}),K(["MMM","MMMM"],function(t,e,i,n){var r=i._locale.monthsParse(t,n,i._strict);null!=r?e[Vn]=r:u(i).invalidMonth=t});var qn=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Qn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),$n="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jn=zn,Kn=zn,tr=/^\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)?)?/,er=/^\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)?)?/,ir=/Z|[+-]\d\d(?::?\d\d)?/,nr=[["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}/]],rr=[["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/]],sr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),H("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),I("year","y"),q("Y",Yn),q("YY",Dn,bn),q("YYYY",Pn,Sn),q("YYYYY",En,Tn),q("YYYYYY",En,Tn),K(["YYYYY","YYYYYY"],Fn),K("YYYY",function(t,i){i[Fn]=2===t.length?e.parseTwoDigitYear(t):g(t)}),K("YY",function(t,i){i[Fn]=e.parseTwoDigitYear(t)}),K("Y",function(t,e){e[Fn]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return g(t)+(g(t)>68?1900:2e3)};var or=N("FullYear",!0);e.ISO_8601=function(){};var ar=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=zt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:c()}),hr=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=zt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:c()}),lr=function(){return Date.now?Date.now():+new Date};Ut("Z",":"),Ut("ZZ",""),q("Z",Rn),q("ZZ",Rn),K(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Ht(Rn,t)});var ur=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var dr=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,cr=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;re.fn=Vt.prototype;var fr=le(1,"add"),pr=le(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var mr=w("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)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Be("gggg","weekYear"),Be("ggggg","weekYear"),Be("GGGG","isoWeekYear"),Be("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),q("G",Yn),q("g",Yn),q("GG",Dn,bn),q("gg",Dn,bn),q("GGGG",Pn,Sn),q("gggg",Pn,Sn),q("GGGGG",En,Tn),q("ggggg",En,Tn),tt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,n){e[n.substr(0,2)]=g(t)}),tt(["gg","GG"],function(t,i,n,r){i[r]=e.parseTwoDigitYear(t)}),H("Q",0,"Qo","quarter"),I("quarter","Q"),q("Q",wn),K("Q",function(t,e){e[Vn]=3*(g(t)-1)}),H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),q("w",Dn),q("ww",Dn,bn),q("W",Dn),q("WW",Dn,bn),tt(["w","ww","W","WW"],function(t,e,i,n){e[n.substr(0,1)]=g(t)});var vr={dow:0,doy:6};H("D",["DD",2],"Do","date"),I("date","D"),q("D",Dn),q("DD",Dn,bn),q("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),K(["D","DD"],Bn),K("Do",function(t,e){e[Bn]=g(t.match(Dn)[0],10)});var yr=N("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),H("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),H("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),q("d",Dn),q("e",Dn),q("E",Dn),q("dd",function(t,e){return e.weekdaysMinRegex(t)}),q("ddd",function(t,e){return e.weekdaysShortRegex(t)}),q("dddd",function(t,e){return e.weekdaysRegex(t)}),tt(["dd","ddd","dddd"],function(t,e,i,n){var r=i._locale.weekdaysParse(t,n,i._strict);null!=r?e.d=r:u(i).invalidWeekday=t}),tt(["d","e","E"],function(t,e,i,n){e[n]=g(t)});var gr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_r="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xr="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wr=zn,br=zn,Mr=zn;H("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),q("DDD",On),q("DDDD",Mn),K(["DDD","DDDD"],function(t,e,i){i._dayOfYear=g(t)}),H("H",["HH",2],0,"hour"),H("h",["hh",2],0,mi),H("k",["kk",2],0,vi),H("hmm",0,0,function(){return""+mi.apply(this)+U(this.minutes(),2)}),H("hmmss",0,0,function(){return""+mi.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),yi("a",!0),yi("A",!1),I("hour","h"),q("a",gi),q("A",gi),q("H",Dn),q("h",Dn),q("HH",Dn,bn),q("hh",Dn,bn),q("hmm",kn),q("hmmss",Cn),q("Hmm",kn),q("Hmmss",Cn),K(["H","HH"],Un),K(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),K(["h","hh"],function(t,e,i){e[Un]=g(t),u(i).bigHour=!0}),K("hmm",function(t,e,i){var n=t.length-2;e[Un]=g(t.substr(0,n)),e[Hn]=g(t.substr(n)),u(i).bigHour=!0}),K("hmmss",function(t,e,i){var n=t.length-4,r=t.length-2;e[Un]=g(t.substr(0,n)),e[Hn]=g(t.substr(n,2)),e[jn]=g(t.substr(r)),u(i).bigHour=!0}),K("Hmm",function(t,e,i){var n=t.length-2;e[Un]=g(t.substr(0,n)),e[Hn]=g(t.substr(n))}),K("Hmmss",function(t,e,i){var n=t.length-4,r=t.length-2;e[Un]=g(t.substr(0,n)),e[Hn]=g(t.substr(n,2)),e[jn]=g(t.substr(r))});var Sr=/[ap]\.?m?\.?/i,Tr=N("Hours",!0);H("m",["mm",2],0,"minute"),I("minute","m"),q("m",Dn),q("mm",Dn,bn),K(["m","mm"],Hn);var Dr=N("Minutes",!1);H("s",["ss",2],0,"second"),I("second","s"),q("s",Dn),q("ss",Dn,bn),K(["s","ss"],jn);var kr=N("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),q("S",On,wn),q("SS",On,bn),q("SSS",On,Mn);var Cr;for(Cr="SSSS";Cr.length<=9;Cr+="S")q(Cr,Ln);for(Cr="S";Cr.length<=9;Cr+="S")K(Cr,wi);var Or=N("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Pr=m.prototype;Pr.add=fr,Pr.calendar=de,Pr.clone=ce,Pr.diff=_e,Pr.endOf=Ee,Pr.format=Me,Pr.from=Se,Pr.fromNow=Te,Pr.to=De,Pr.toNow=ke,Pr.get=B,Pr.invalidAt=Fe,Pr.isAfter=fe,Pr.isBefore=pe,Pr.isBetween=me,Pr.isSame=ve,Pr.isSameOrAfter=ye,Pr.isSameOrBefore=ge,Pr.isValid=We,Pr.lang=mr,Pr.locale=Ce,Pr.localeData=Oe,Pr.max=hr,Pr.min=ar,Pr.parsingFlags=Ne,Pr.set=B,Pr.startOf=Pe,Pr.subtract=pr,Pr.toArray=Re,Pr.toObject=Ie,Pr.toDate=Ae,Pr.toISOString=be,Pr.toJSON=ze,Pr.toString=we,Pr.unix=Ye,Pr.valueOf=Le,Pr.creationData=Ve,Pr.year=or,Pr.isLeapYear=xt,Pr.weekYear=Ue,Pr.isoWeekYear=He,Pr.quarter=Pr.quarters=qe,Pr.month=ht,Pr.daysInMonth=lt,Pr.week=Pr.weeks=Ke,Pr.isoWeek=Pr.isoWeeks=ti,Pr.weeksInYear=Ge,Pr.isoWeeksInYear=je,Pr.date=yr,Pr.day=Pr.days=ai,Pr.weekday=hi,Pr.isoWeekday=li,Pr.dayOfYear=pi,Pr.hour=Pr.hours=Tr,Pr.minute=Pr.minutes=Dr,Pr.second=Pr.seconds=kr,Pr.millisecond=Pr.milliseconds=Or,Pr.utcOffset=Xt,Pr.utc=qt,Pr.local=Qt,Pr.parseZone=$t,Pr.hasAlignedHourOffset=Jt,Pr.isDST=Kt,Pr.isDSTShifted=te,Pr.isLocal=ee,Pr.isUtcOffset=ie,Pr.isUtc=ne,Pr.isUTC=ne,Pr.zoneAbbr=bi,Pr.zoneName=Mi,Pr.dates=w("dates accessor is deprecated. Use date instead.",yr),Pr.months=w("months accessor is deprecated. Use month instead",ht),Pr.years=w("years accessor is deprecated. Use year instead",or),Pr.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Zt);var Er=Pr,Lr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Yr={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"},Ar="Invalid date",Rr="%d",Ir=/\d{1,2}/,zr={future:"in %s",past:"%s ago",s:"a few 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"},Wr=k.prototype;Wr._calendar=Lr,Wr.calendar=Di,Wr._longDateFormat=Yr,Wr.longDateFormat=ki,Wr._invalidDate=Ar,Wr.invalidDate=Ci,Wr._ordinal=Rr,Wr.ordinal=Oi,Wr._ordinalParse=Ir,Wr.preparse=Pi,Wr.postformat=Pi,Wr._relativeTime=zr,Wr.relativeTime=Ei,Wr.pastFuture=Li,Wr.set=T,Wr.months=nt,Wr._months=Qn,Wr.monthsShort=rt,Wr._monthsShort=$n,Wr.monthsParse=ot,Wr._monthsRegex=Kn,Wr.monthsRegex=dt,Wr._monthsShortRegex=Jn,Wr.monthsShortRegex=ut,Wr.week=Qe,Wr._week=vr,Wr.firstDayOfYear=Je,Wr.firstDayOfWeek=$e,Wr.weekdays=ii,Wr._weekdays=gr,Wr.weekdaysMin=ri,Wr._weekdaysMin=xr,Wr.weekdaysShort=ni,Wr._weekdaysShort=_r,Wr.weekdaysParse=oi,Wr._weekdaysRegex=wr,Wr.weekdaysRegex=ui,Wr._weekdaysShortRegex=br,Wr.weekdaysShortRegex=di,Wr._weekdaysMinRegex=Mr,Wr.weekdaysMinRegex=ci,Wr.isPM=_i,Wr._meridiemParse=Sr,Wr.meridiem=xi,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===g(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",E),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",A);var Nr=Math.abs,Fr=$i("ms"),Vr=$i("s"),Br=$i("m"),Ur=$i("h"),Hr=$i("d"),jr=$i("w"),Gr=$i("M"),Xr=$i("y"),Zr=Ki("milliseconds"),qr=Ki("seconds"),Qr=Ki("minutes"),$r=Ki("hours"),Jr=Ki("days"),Kr=Ki("months"),ts=Ki("years"),es=Math.round,is={s:45,m:45,h:22,d:26,M:11},ns=Math.abs,rs=Vt.prototype;rs.abs=Vi,rs.add=Ui,rs.subtract=Hi,rs.as=qi,rs.asMilliseconds=Fr,rs.asSeconds=Vr,rs.asMinutes=Br,rs.asHours=Ur,rs.asDays=Hr,rs.asWeeks=jr,rs.asMonths=Gr,rs.asYears=Xr,rs.valueOf=Qi,rs._bubble=Gi,rs.get=Ji,rs.milliseconds=Zr,rs.seconds=qr,rs.minutes=Qr,rs.hours=$r,rs.days=Jr,rs.weeks=tn,rs.months=Kr,rs.years=ts,rs.humanize=sn,rs.toISOString=on,rs.toString=on,rs.toJSON=on,rs.locale=Ce,rs.localeData=Oe,rs.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",on),rs.lang=mr,H("X",0,0,"unix"),H("x",0,0,"valueOf"),q("x",Yn),q("X",In),K("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),K("x",function(t,e,i){i._d=new Date(g(t))}),e.version="2.13.0",i(zt),e.fn=Er,e.min=Nt,e.max=Ft,e.now=lr,e.utc=h,e.unix=Si,e.months=Ii,e.isDate=r,e.locale=E,e.invalid=c,e.duration=re,e.isMoment=v,e.weekdays=Wi,e.parseZone=Ti,e.localeData=A,e.isDuration=Bt,e.monthsShort=zi,e.weekdaysMin=Fi,e.defineLocale=L,e.updateLocale=Y,e.locales=R,e.weekdaysShort=Ni,e.normalizeUnits=z,e.relativeTimeThreshold=rn,e.prototype=Er;var ss=e;return ss})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var n=e&&i||0,r=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>r&&(e[n+r++]=d[t])});16>r;)e[n+r++]=0;return e}function n(t,e){var i=e||0,n=u;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++]]}function r(t,e,i){var r=e&&i||0,s=e||[];t=t||{};var o=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:y+1,l=a-v+(h-y)/1e4;if(0>l&&void 0===t.clockseq&&(o=o+1&16383),(0>l||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,y=h,m=o,a+=122192928e5;var u=(1e4*(268435455&a)+h)%4294967296;s[r++]=u>>>24&255,s[r++]=u>>>16&255,s[r++]=u>>>8&255,s[r++]=255&u;var d=a/4294967296*1e4&268435455;s[r++]=d>>>8&255,s[r++]=255&d,s[r++]=d>>>24&15|16,s[r++]=d>>>16&255,s[r++]=o>>>8|128,s[r++]=255&o;for(var c=t.node||p,f=0;6>f;f++)s[r+f]=c[f];return e?e:n(s)}function s(t,e,i){var r=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||o)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;16>a;a++)e[r+a]=s[a];return e||n(s)}var o,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);o=function(){return crypto.getRandomValues(h),h}}if(!o){var l=new Array(16);o=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),l[e]=t>>>((3&e)<<3)&255;return l}}for(var u=[],d={},c=0;256>c;c++)u[c]=(c+256).toString(16).substr(1),d[u[c]]=c;var f=o(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],m=16383&(f[6]<<8|f[7]),v=0,y=0,g=s;g.v1=r,g.v4=s,g.parse=i,g.unparse=n,t.exports=g}).call(e,function(){return this}())},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 r;return e.hasOwnProperty(t)?e[t].redundant.length>0?(r=e[t].redundant[0],e[t].redundant.shift()):(r=document.createElement(t),void 0!==n?i.insertBefore(r,n):i.appendChild(r)):(r=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(r,n):i.appendChild(r)),e[t].used.push(r),r},e.drawPoint=function(t,i,n,r,s,o){var a;if("circle"==n.style?(a=e.getSVGElement("circle",r,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*n.size)):(a=e.getSVGElement("rect",r,s),a.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"),o){var h=e.getSVGElement("text",r,s);o.xOffset&&(t+=o.xOffset),o.yOffset&&(i+=o.yOffset),
+o.content&&(h.textContent=o.content),o.className&&h.setAttributeNS(null,"class",o.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,n,r,s,o,a,h){if(0!=r){0>r&&(r*=-1,i-=r);var l=e.getSVGElement("rect",o,a);l.setAttributeNS(null,"x",t-.5*n),l.setAttributeNS(null,"y",i),l.setAttributeNS(null,"width",n),l.setAttributeNS(null,"height",r),l.setAttributeNS(null,"class",s),h&&l.setAttributeNS(null,"style",h)}}},function(t,e,i){function n(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),n=0,r=i.length;r>n;n++){var s=i[n],o=this._options.type[s];"Date"==o||"ISODate"==o||"ASPDate"==o?this._type[s]="Date":this._type[s]=o}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t),this.setOptions(e)}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),o=i(9);n.prototype.setOptions=function(t){t&&void 0!==t.queue&&(t.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=o.extend(this,{replace:["add","update","remove"]})),"object"===r(t.queue)&&this._queue.setOptions(t.queue)))},n.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},n.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},n.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},n.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},n.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var n=[];t in this._subscribers&&(n=n.concat(this._subscribers[t])),"*"in this._subscribers&&(n=n.concat(this._subscribers["*"]));for(var r=0,s=n.length;s>r;r++){var o=n[r];o.callback&&o.callback(t,e,i||null)}},n.prototype.add=function(t,e){var i,n=[],r=this;if(Array.isArray(t))for(var s=0,o=t.length;o>s;s++)i=r._addItem(t[s]),n.push(i);else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=r._addItem(t),n.push(i)}return n.length&&this._trigger("add",{items:n},e),n},n.prototype.update=function(t,e){var i=[],n=[],r=[],o=[],a=this,h=a._fieldId,l=function(t){var e=t[h];if(a._data[e]){var l=s.extend({},a._data[e]);e=a._updateItem(t),n.push(e),o.push(t),r.push(l)}else e=a._addItem(t),i.push(e)};if(Array.isArray(t))for(var u=0,d=t.length;d>u;u++)t[u]instanceof Object?l(t[u]):console.warn("Ignoring input item, which is not an object at index "+u);else{if(!(t instanceof Object))throw new Error("Unknown dataType");l(t)}if(i.length&&this._trigger("add",{items:i},e),n.length){var c={items:n,oldData:r,data:o};this._trigger("update",c,e)}return i.concat(n)},n.prototype.get=function(t){var e,i,n,r=this,o=s.getType(arguments[0]);"String"==o||"Number"==o?(e=arguments[0],n=arguments[1]):"Array"==o?(i=arguments[0],n=arguments[1]):n=arguments[0];var a;if(n&&n.returnType){var h=["Array","Object"];a=-1==h.indexOf(n.returnType)?"Array":n.returnType}else a="Array";var l,u,d,c,f,p=n&&n.type||this._options.type,m=n&&n.filter,v=[];if(void 0!=e)l=r._getItem(e,p),l&&m&&!m(l)&&(l=null);else if(void 0!=i)for(c=0,f=i.length;f>c;c++)l=r._getItem(i[c],p),m&&!m(l)||v.push(l);else for(u=Object.keys(this._data),c=0,f=u.length;f>c;c++)d=u[c],l=r._getItem(d,p),m&&!m(l)||v.push(l);if(n&&n.order&&void 0==e&&this._sort(v,n.order),n&&n.fields){var y=n.fields;if(void 0!=e)l=this._filterFields(l,y);else for(c=0,f=v.length;f>c;c++)v[c]=this._filterFields(v[c],y)}if("Object"==a){var g,_={};for(c=0,f=v.length;f>c;c++)g=v[c],_[g.id]=g;return _}return void 0!=e?l:v},n.prototype.getIds=function(t){var e,i,n,r,s,o=this._data,a=t&&t.filter,h=t&&t.order,l=t&&t.type||this._options.type,u=Object.keys(o),d=[];if(a)if(h){for(s=[],e=0,i=u.length;i>e;e++)n=u[e],r=this._getItem(n,l),a(r)&&s.push(r);for(this._sort(s,h),e=0,i=s.length;i>e;e++)d.push(s[e][this._fieldId])}else for(e=0,i=u.length;i>e;e++)n=u[e],r=this._getItem(n,l),a(r)&&d.push(r[this._fieldId]);else if(h){for(s=[],e=0,i=u.length;i>e;e++)n=u[e],s.push(o[n]);for(this._sort(s,h),e=0,i=s.length;i>e;e++)d.push(s[e][this._fieldId])}else for(e=0,i=u.length;i>e;e++)n=u[e],r=o[n],d.push(r[this._fieldId]);return d},n.prototype.getDataSet=function(){return this},n.prototype.forEach=function(t,e){var i,n,r,s,o=e&&e.filter,a=e&&e.type||this._options.type,h=this._data,l=Object.keys(h);if(e&&e.order){var u=this.get(e);for(i=0,n=u.length;n>i;i++)r=u[i],s=r[this._fieldId],t(r,s)}else for(i=0,n=l.length;n>i;i++)s=l[i],r=this._getItem(s,a),o&&!o(r)||t(r,s)},n.prototype.map=function(t,e){var i,n,r,s,o=e&&e.filter,a=e&&e.type||this._options.type,h=[],l=this._data,u=Object.keys(l);for(i=0,n=u.length;n>i;i++)r=u[i],s=this._getItem(r,a),o&&!o(s)||h.push(t(s,r));return e&&e.order&&this._sort(h,e.order),h},n.prototype._filterFields=function(t,e){if(!t)return t;var i,n,r={},s=Object.keys(t),o=s.length;if(Array.isArray(e))for(i=0;o>i;i++)n=s[i],-1!=e.indexOf(n)&&(r[n]=t[n]);else for(i=0;o>i;i++)n=s[i],e.hasOwnProperty(n)&&(r[e[n]]=t[n]);return r},n.prototype._sort=function(t,e){if(s.isString(e)){var i=e;t.sort(function(t,e){var n=t[i],r=e[i];return n>r?1:r>n?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}},n.prototype.remove=function(t,e){var i,n,r,s=[];if(Array.isArray(t))for(i=0,n=t.length;n>i;i++)r=this._remove(t[i]),null!=r&&s.push(r);else r=this._remove(t),null!=r&&s.push(r);return s.length&&this._trigger("remove",{items:s},e),s},n.prototype._remove=function(t){if(s.isNumber(t)||s.isString(t)){if(this._data[t])return delete this._data[t],this.length--,t}else if(t instanceof Object){var e=t[this._fieldId];if(void 0!==e&&this._data[e])return delete this._data[e],this.length--,e}return null},n.prototype.clear=function(t){var e=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:e},t),e},n.prototype.max=function(t){var e,i,n=this._data,r=Object.keys(n),s=null,o=null;for(e=0,i=r.length;i>e;e++){var a=r[e],h=n[a],l=h[t];null!=l&&(!s||l>o)&&(s=h,o=l)}return s},n.prototype.min=function(t){var e,i,n=this._data,r=Object.keys(n),s=null,o=null;for(e=0,i=r.length;i>e;e++){var a=r[e],h=n[a],l=h[t];null!=l&&(!s||o>l)&&(s=h,o=l)}return s},n.prototype.distinct=function(t){var e,i,n,r=this._data,o=Object.keys(r),a=[],h=this._options.type&&this._options.type[t]||null,l=0;for(e=0,n=o.length;n>e;e++){var u=o[e],d=r[u],c=d[t],f=!1;for(i=0;l>i;i++)if(a[i]==c){f=!0;break}f||void 0===c||(a[l]=c,l++)}if(h)for(e=0,n=a.length;n>e;e++)a[e]=s.convert(a[e],h);return a},n.prototype._addItem=function(t){var e=t[this._fieldId];if(void 0!=e){if(this._data[e])throw new Error("Cannot add item: item with id "+e+" already exists")}else e=s.randomUUID(),t[this._fieldId]=e;var i,n,r={},o=Object.keys(t);for(i=0,n=o.length;n>i;i++){var a=o[i],h=this._type[a];r[a]=s.convert(t[a],h)}return this._data[e]=r,this.length++,e},n.prototype._getItem=function(t,e){var i,n,r,o,a=this._data[t];if(!a)return null;var h={},l=Object.keys(a);if(e)for(r=0,o=l.length;o>r;r++)i=l[r],n=a[i],h[i]=s.convert(n,e[i]);else for(r=0,o=l.length;o>r;r++)i=l[r],n=a[i],h[i]=n;return h},n.prototype._updateItem=function(t){var e=t[this._fieldId];if(void 0==e)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this._data[e];if(!i)throw new Error("Cannot update item: no item with id "+e+" found");for(var n=Object.keys(t),r=0,o=n.length;o>r;r++){var a=n[r],h=this._type[a];i[a]=s.convert(t[a],h)}return e},t.exports=n},function(t,e){function i(t){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(t)}i.prototype.setOptions=function(t){t&&"undefined"!=typeof t.delay&&(this.delay=t.delay),t&&"undefined"!=typeof t.max&&(this.max=t.max),this._flushIfNeeded()},i.extend=function(t,e){var n=new i(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){n.flush()};var r=[{name:"flush",original:void 0}];if(e&&e.replace)for(var s=0;s<e.replace.length;s++){var o=e.replace[s];r.push({name:o,original:t[o]}),n.replace(t,o)}return n._extended={object:t,methods:r},n},i.prototype.destroy=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}},i.prototype.replace=function(t,e){var i=this,n=t[e];if(!n)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.queue({args:t,fn:n,context:this})}},i.prototype.queue=function(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()},i.prototype._flushIfNeeded=function(){if(this._queue.length>this.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function n(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var r=i(1),s=i(8);n.prototype.setData=function(t){var e,i,n,r;if(this._data&&(this._data.off&&this._data.off("*",this.listener),e=Object.keys(this._ids),this._ids={},this.length=0,this._trigger("remove",{items:e})),this._data=t,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",e=this._data.getIds({filter:this._options&&this._options.filter}),n=0,r=e.length;r>n;n++)i=e[n],this._ids[i]=!0;this.length=e.length,this._trigger("add",{items:e}),this._data.on&&this._data.on("*",this.listener)}},n.prototype.refresh=function(){var t,e,i,n=this._data.getIds({filter:this._options&&this._options.filter}),r=Object.keys(this._ids),s={},o=[],a=[];for(e=0,i=n.length;i>e;e++)t=n[e],s[t]=!0,this._ids[t]||(o.push(t),this._ids[t]=!0);for(e=0,i=r.length;i>e;e++)t=r[e],s[t]||(a.push(t),delete this._ids[t]);this.length+=o.length-a.length,o.length&&this._trigger("add",{items:o}),a.length&&this._trigger("remove",{items:a})},n.prototype.get=function(t){var e,i,n,s=this,o=r.getType(arguments[0]);"String"==o||"Number"==o||"Array"==o?(e=arguments[0],i=arguments[1],n=arguments[2]):(i=arguments[0],n=arguments[1]);var a=r.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(t){return s._options.filter(t)&&i.filter(t)});var h=[];return void 0!=e&&h.push(e),h.push(a),h.push(n),this._data&&this._data.get.apply(this._data,h)},n.prototype.getIds=function(t){var e;if(this._data){var i,n=this._options.filter;i=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,e=this._data.getIds({filter:i,order:t&&t.order})}else e=[];return e},n.prototype.map=function(t,e){var i=[];if(this._data){var n,r=this._options.filter;n=e&&e.filter?r?function(t){return r(t)&&e.filter(t)}:e.filter:r,i=this._data.map(t,{filter:n,order:e&&e.order})}else i=[];return i},n.prototype.getDataSet=function(){for(var t=this;t instanceof n;)t=t._data;return t||null},n.prototype._onEvent=function(t,e,i){var n,r,s,o,a=e&&e.items,h=this._data,l=[],u=[],d=[],c=[];if(a&&h){switch(t){case"add":for(n=0,r=a.length;r>n;n++)s=a[n],o=this.get(s),o&&(this._ids[s]=!0,u.push(s));break;case"update":for(n=0,r=a.length;r>n;n++)s=a[n],o=this.get(s),o?this._ids[s]?(d.push(s),l.push(e.data[n])):(this._ids[s]=!0,u.push(s)):this._ids[s]&&(delete this._ids[s],c.push(s));break;case"remove":for(n=0,r=a.length;r>n;n++)s=a[n],this._ids[s]&&(delete this._ids[s],c.push(s))}this.length+=u.length-c.length,u.length&&this._trigger("add",{items:u},i),d.length&&this._trigger("update",{items:d,data:l},i),c.length&&this._trigger("remove",{items:c},i)}},n.prototype.on=s.prototype.on,n.prototype.off=s.prototype.off,n.prototype._trigger=s.prototype._trigger,n.prototype.subscribe=n.prototype.on,n.prototype.unsubscribe=n.prototype.off,t.exports=n},function(t,e,i){function n(t,e,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.width="400px",this.height="400px",this.margin=10,this.defaultXCenter="55%",this.defaultYCenter="50%",this.xLabel="x",this.yLabel="y",this.zLabel="z";var r=function(t){return t};this.xValueLabel=r,this.yValueLabel=r,this.zValueLabel=r,this.filterLabel="time",this.legendLabel="value",this.style=n.STYLE.DOT,this.showPerspective=!0,this.showGrid=!0,this.keepAspectRatio=!0,this.showShadow=!1,this.showGrayBottom=!1,this.showTooltip=!1,this.verticalRatio=.5,this.animationInterval=1e3,this.animationPreload=!1,this.camera=new f,this.camera.setArmRotation(1,.5),this.camera.setArmLength(1.7),this.eye=new d(0,0,-1),this.dataTable=null,this.dataPoints=null,this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.colFilter=void 0,this.xMin=0,this.xStep=void 0,this.xMax=1,this.yMin=0,this.yStep=void 0,this.yMax=1,this.zMin=0,this.zStep=void 0,this.zMax=1,this.valueMin=0,this.valueMax=1,this.xBarWidth=1,this.yBarWidth=1,this.axisColor="#4D4D4D",this.gridColor="#D3D3D3",this.dataColor={fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},this.dotSizeRatio=.02,this.create(),this.setOptions(i),e&&this.setData(e)}function r(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function s(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=i(12),h=i(8),l=i(10),u=i(1),d=i(13),c=i(14),f=i(15),p=i(16),m=i(17),v=i(18);a(n.prototype),n.prototype._setScale=function(){this.scale=new d(1/(this.xMax-this.xMin),1/(this.yMax-this.yMin),1/(this.zMax-this.zMin)),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,this.scale.value=1/(this.valueMax-this.valueMin);var t=(this.xMax+this.xMin)/2*this.scale.x,e=(this.yMax+this.yMin)/2*this.scale.y,i=(this.zMax+this.zMin)/2*this.scale.z;this.camera.setArmLocation(t,e,i)},n.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},n.prototype._convertPointToTranslation=function(t){var e=t.x*this.scale.x,i=t.y*this.scale.y,n=t.z*this.scale.z,r=this.camera.getCameraLocation().x,s=this.camera.getCameraLocation().y,o=this.camera.getCameraLocation().z,a=Math.sin(this.camera.getCameraRotation().x),h=Math.cos(this.camera.getCameraRotation().x),l=Math.sin(this.camera.getCameraRotation().y),u=Math.cos(this.camera.getCameraRotation().y),c=Math.sin(this.camera.getCameraRotation().z),f=Math.cos(this.camera.getCameraRotation().z),p=u*(c*(i-s)+f*(e-r))-l*(n-o),m=a*(u*(n-o)+l*(c*(i-s)+f*(e-r)))+h*(f*(i-s)-c*(e-r)),v=h*(u*(n-o)+l*(c*(i-s)+f*(e-r)))-a*(f*(i-s)-c*(e-r));return new d(p,m,v)},n.prototype._convertTranslationToScreen=function(t){var e,i,n=this.eye.x,r=this.eye.y,s=this.eye.z,o=t.x,a=t.y,h=t.z;return this.showPerspective?(e=(o-n)*(s/h),i=(a-r)*(s/h)):(e=o*-(s/this.camera.getArmLength()),i=a*-(s/this.camera.getArmLength())),new c(this.xcenter+e*this.frame.canvas.clientWidth,this.ycenter-i*this.frame.canvas.clientWidth)},n.prototype._setBackgroundColor=function(t){var e="white",i="gray",n=1;if("string"==typeof t)e=t,i="none",n=0;else if("object"===("undefined"==typeof t?"undefined":o(t)))void 0!==t.fill&&(e=t.fill),void 0!==t.stroke&&(i=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth);else if(void 0!==t)throw"Unsupported type of backgroundColor";this.frame.style.backgroundColor=e,this.frame.style.borderColor=i,this.frame.style.borderWidth=n+"px",this.frame.style.borderStyle="solid"},n.STYLE={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},n.prototype._getStyleNumber=function(t){switch(t){case"dot":return n.STYLE.DOT;case"dot-line":return n.STYLE.DOTLINE;case"dot-color":return n.STYLE.DOTCOLOR;case"dot-size":return n.STYLE.DOTSIZE;case"line":return n.STYLE.LINE;case"grid":return n.STYLE.GRID;case"surface":return n.STYLE.SURFACE;case"bar":return n.STYLE.BAR;case"bar-color":return n.STYLE.BARCOLOR;case"bar-size":return n.STYLE.BARSIZE}return-1},n.prototype._determineColumnIndexes=function(t,e){if(this.style===n.STYLE.DOT||this.style===n.STYLE.DOTLINE||this.style===n.STYLE.LINE||this.style===n.STYLE.GRID||this.style===n.STYLE.SURFACE||this.style===n.STYLE.BAR)this.colX=0,this.colY=1,this.colZ=2,this.colValue=void 0,t.getNumberOfColumns()>3&&(this.colFilter=3);else{if(this.style!==n.STYLE.DOTCOLOR&&this.style!==n.STYLE.DOTSIZE&&this.style!==n.STYLE.BARCOLOR&&this.style!==n.STYLE.BARSIZE)throw'Unknown style "'+this.style+'"';this.colX=0,this.colY=1,this.colZ=2,this.colValue=3,t.getNumberOfColumns()>4&&(this.colFilter=4)}},n.prototype.getNumberOfRows=function(t){return t.length},n.prototype.getNumberOfColumns=function(t){var e=0;for(var i in t[0])t[0].hasOwnProperty(i)&&e++;return e},n.prototype.getDistinctValues=function(t,e){for(var i=[],n=0;n<t.length;n++)-1==i.indexOf(t[n][e])&&i.push(t[n][e]);return i},n.prototype.getColumnRange=function(t,e){for(var i={min:t[0][e],max:t[0][e]},n=0;n<t.length;n++)i.min>t[n][e]&&(i.min=t[n][e]),i.max<t[n][e]&&(i.max=t[n][e]);return i},n.prototype._dataInitialize=function(t,e){var i=this;if(this.dataSet&&this.dataSet.off("*",this._onChange),void 0!==t){Array.isArray(t)&&(t=new h(t));var r;if(!(t instanceof h||t instanceof l))throw new Error("Array, DataSet, or DataView expected");if(r=t.get(),0!=r.length){this.dataSet=t,this.dataTable=r,this._onChange=function(){i.setData(i.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z",this.colValue="style",this.colFilter="filter",r[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new p(t,this.colFilter,this),this.dataFilter.setOnLoadCallback(function(){i.redraw()}));var s=this.style==n.STYLE.BAR||this.style==n.STYLE.BARCOLOR||this.style==n.STYLE.BARSIZE;if(s){if(void 0!==this.defaultXBarWidth)this.xBarWidth=this.defaultXBarWidth;else{var o=this.getDistinctValues(r,this.colX);this.xBarWidth=o[1]-o[0]||1}if(void 0!==this.defaultYBarWidth)this.yBarWidth=this.defaultYBarWidth;else{var a=this.getDistinctValues(r,this.colY);this.yBarWidth=a[1]-a[0]||1}}var u=this.getColumnRange(r,this.colX);s&&(u.min-=this.xBarWidth/2,u.max+=this.xBarWidth/2),this.xMin=void 0!==this.defaultXMin?this.defaultXMin:u.min,this.xMax=void 0!==this.defaultXMax?this.defaultXMax:u.max,this.xMax<=this.xMin&&(this.xMax=this.xMin+1),this.xStep=void 0!==this.defaultXStep?this.defaultXStep:(this.xMax-this.xMin)/5;var d=this.getColumnRange(r,this.colY);s&&(d.min-=this.yBarWidth/2,d.max+=this.yBarWidth/2),this.yMin=void 0!==this.defaultYMin?this.defaultYMin:d.min,this.yMax=void 0!==this.defaultYMax?this.defaultYMax:d.max,this.yMax<=this.yMin&&(this.yMax=this.yMin+1),this.yStep=void 0!==this.defaultYStep?this.defaultYStep:(this.yMax-this.yMin)/5;var c=this.getColumnRange(r,this.colZ);if(this.zMin=void 0!==this.defaultZMin?this.defaultZMin:c.min,this.zMax=void 0!==this.defaultZMax?this.defaultZMax:c.max,this.zMax<=this.zMin&&(this.zMax=this.zMin+1),this.zStep=void 0!==this.defaultZStep?this.defaultZStep:(this.zMax-this.zMin)/5,void 0!==this.colValue){var f=this.getColumnRange(r,this.colValue);this.valueMin=void 0!==this.defaultValueMin?this.defaultValueMin:f.min,this.valueMax=void 0!==this.defaultValueMax?this.defaultValueMax:f.max,this.valueMax<=this.valueMin&&(this.valueMax=this.valueMin+1)}this._setScale()}}},n.prototype._getDataPoints=function(t){var e,i,r,s,o,a,h=[];if(this.style===n.STYLE.GRID||this.style===n.STYLE.SURFACE){var l=[],u=[];for(r=0;r<this.getNumberOfRows(t);r++)e=t[r][this.colX]||0,i=t[r][this.colY]||0,-1===l.indexOf(e)&&l.push(e),-1===u.indexOf(i)&&u.push(i);var c=function(t,e){return t-e};l.sort(c),u.sort(c);var f=[];for(r=0;r<t.length;r++){e=t[r][this.colX]||0,i=t[r][this.colY]||0,s=t[r][this.colZ]||0;var p=l.indexOf(e),m=u.indexOf(i);void 0===f[p]&&(f[p]=[]);var v=new d;v.x=e,v.y=i,v.z=s,o={},o.point=v,o.trans=void 0,o.screen=void 0,o.bottom=new d(e,i,this.zMin),f[p][m]=o,h.push(o)}for(e=0;e<f.length;e++)for(i=0;i<f[e].length;i++)f[e][i]&&(f[e][i].pointRight=e<f.length-1?f[e+1][i]:void 0,f[e][i].pointTop=i<f[e].length-1?f[e][i+1]:void 0,f[e][i].pointCross=e<f.length-1&&i<f[e].length-1?f[e+1][i+1]:void 0)}else for(r=0;r<t.length;r++)a=new d,a.x=t[r][this.colX]||0,a.y=t[r][this.colY]||0,a.z=t[r][this.colZ]||0,void 0!==this.colValue&&(a.value=t[r][this.colValue]||0),o={},o.point=a,o.bottom=new d(a.x,a.y,this.zMin),o.trans=void 0,o.screen=void 0,h.push(o);return h},n.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);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.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this,i=function(t){e._onMouseDown(t)},n=function(t){e._onTouchStart(t)},r=function(t){e._onWheel(t)},s=function(t){e._onTooltip(t)};u.addEventListener(this.frame.canvas,"keydown",onkeydown),u.addEventListener(this.frame.canvas,"mousedown",i),u.addEventListener(this.frame.canvas,"touchstart",n),u.addEventListener(this.frame.canvas,"mousewheel",r),u.addEventListener(this.frame.canvas,"mousemove",s),this.containerElement.appendChild(this.frame)},n.prototype.setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},n.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},n.prototype.animationStart=function(){if(!this.frame.filter||!this.frame.filter.slider)throw"No animation available";this.frame.filter.slider.play()},n.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},n.prototype._resizeCenter=function(){"%"===this.defaultXCenter.charAt(this.defaultXCenter.length-1)?this.xcenter=parseFloat(this.defaultXCenter)/100*this.frame.canvas.clientWidth:this.xcenter=parseFloat(this.defaultXCenter),"%"===this.defaultYCenter.charAt(this.defaultYCenter.length-1)?this.ycenter=parseFloat(this.defaultYCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.ycenter=parseFloat(this.defaultYCenter)},n.prototype.setCameraPosition=function(t){void 0!==t&&(void 0!==t.horizontal&&void 0!==t.vertical&&this.camera.setArmRotation(t.horizontal,t.vertical),void 0!==t.distance&&this.camera.setArmLength(t.distance),this.redraw())},n.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},n.prototype._readData=function(t){this._dataInitialize(t,this.style),this.dataFilter?this.dataPoints=this.dataFilter._getDataPoints():this.dataPoints=this._getDataPoints(this.dataTable),this._redrawFilter()},n.prototype.setData=function(t){this._readData(t),this.redraw(),this.animationAutoStart&&this.dataFilter&&this.animationStart()},n.prototype.setOptions=function(t){var e=void 0;if(this.animationStop(),void 0!==t){if(void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.xCenter&&(this.defaultXCenter=t.xCenter),void 0!==t.yCenter&&(this.defaultYCenter=t.yCenter),void 0!==t.filterLabel&&(this.filterLabel=t.filterLabel),void 0!==t.legendLabel&&(this.legendLabel=t.legendLabel),void 0!==t.xLabel&&(this.xLabel=t.xLabel),void 0!==t.yLabel&&(this.yLabel=t.yLabel),void 0!==t.zLabel&&(this.zLabel=t.zLabel),void 0!==t.xValueLabel&&(this.xValueLabel=t.xValueLabel),void 0!==t.yValueLabel&&(this.yValueLabel=t.yValueLabel),void 0!==t.zValueLabel&&(this.zValueLabel=t.zValueLabel),void 0!==t.dotSizeRatio&&(this.dotSizeRatio=t.dotSizeRatio),void 0!==t.style){var i=this._getStyleNumber(t.style);-1!==i&&(this.style=i)}void 0!==t.showGrid&&(this.showGrid=t.showGrid),void 0!==t.showPerspective&&(this.showPerspective=t.showPerspective),void 0!==t.showShadow&&(this.showShadow=t.showShadow),void 0!==t.tooltip&&(this.showTooltip=t.tooltip),void 0!==t.showAnimationControls&&(this.showAnimationControls=t.showAnimationControls),void 0!==t.keepAspectRatio&&(this.keepAspectRatio=t.keepAspectRatio),void 0!==t.verticalRatio&&(this.verticalRatio=t.verticalRatio),void 0!==t.animationInterval&&(this.animationInterval=t.animationInterval),void 0!==t.animationPreload&&(this.animationPreload=t.animationPreload),void 0!==t.animationAutoStart&&(this.animationAutoStart=t.animationAutoStart),void 0!==t.xBarWidth&&(this.defaultXBarWidth=t.xBarWidth),void 0!==t.yBarWidth&&(this.defaultYBarWidth=t.yBarWidth),void 0!==t.xMin&&(this.defaultXMin=t.xMin),void 0!==t.xStep&&(this.defaultXStep=t.xStep),void 0!==t.xMax&&(this.defaultXMax=t.xMax),void 0!==t.yMin&&(this.defaultYMin=t.yMin),void 0!==t.yStep&&(this.defaultYStep=t.yStep),void 0!==t.yMax&&(this.defaultYMax=t.yMax),void 0!==t.zMin&&(this.defaultZMin=t.zMin),void 0!==t.zStep&&(this.defaultZStep=t.zStep),void 0!==t.zMax&&(this.defaultZMax=t.zMax),void 0!==t.valueMin&&(this.defaultValueMin=t.valueMin),void 0!==t.valueMax&&(this.defaultValueMax=t.valueMax),void 0!==t.backgroundColor&&this._setBackgroundColor(t.backgroundColor),void 0!==t.cameraPosition&&(e=t.cameraPosition),void 0!==e&&(this.camera.setArmRotation(e.horizontal,e.vertical),this.camera.setArmLength(e.distance)),void 0!==t.axisColor&&(this.axisColor=t.axisColor),void 0!==t.gridColor&&(this.gridColor=t.gridColor),t.dataColor&&("string"==typeof t.dataColor?(this.dataColor.fill=t.dataColor,this.dataColor.stroke=t.dataColor):(t.dataColor.fill&&(this.dataColor.fill=t.dataColor.fill),t.dataColor.stroke&&(this.dataColor.stroke=t.dataColor.stroke),void 0!==t.dataColor.strokeWidth&&(this.dataColor.strokeWidth=t.dataColor.strokeWidth)))}this.setSize(this.width,this.height),this.dataTable&&this.setData(this.dataTable),this.animationAutoStart&&this.dataFilter&&this.animationStart()},n.prototype.redraw=function(){if(void 0===this.dataPoints)throw"Error: graph data not initialized";this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this.style===n.STYLE.GRID||this.style===n.STYLE.SURFACE?this._redrawDataGrid():this.style===n.STYLE.LINE?this._redrawDataLine():this.style===n.STYLE.BAR||this.style===n.STYLE.BARCOLOR||this.style===n.STYLE.BARSIZE?this._redrawDataBar():this._redrawDataDot(),this._redrawInfo(),this._redrawLegend()},n.prototype._redrawClear=function(){var t=this.frame.canvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height)},n.prototype._redrawLegend=function(){var t;if(this.style===n.STYLE.DOTCOLOR||this.style===n.STYLE.DOTSIZE){var e,i,r=this.frame.clientWidth*this.dotSizeRatio;this.style===n.STYLE.DOTSIZE?(e=r/2,i=r/2+2*r):(e=20,i=20);var s=Math.max(.25*this.frame.clientHeight,100),o=this.margin,a=this.frame.clientWidth-this.margin,h=a-i,l=o+s}var u=this.frame.canvas,d=u.getContext("2d");if(d.lineWidth=1,d.font="14px arial",this.style===n.STYLE.DOTCOLOR){var c=0,f=s;for(t=c;f>t;t++){var p=(t-c)/(f-c),m=240*p,y=this._hsv2rgb(m,1,1);d.strokeStyle=y,d.beginPath(),d.moveTo(h,o+t),d.lineTo(a,o+t),d.stroke()}d.strokeStyle=this.axisColor,d.strokeRect(h,o,i,s)}if(this.style===n.STYLE.DOTSIZE&&(d.strokeStyle=this.axisColor,d.fillStyle=this.dataColor.fill,d.beginPath(),d.moveTo(h,o),d.lineTo(a,o),d.lineTo(a-i+e,l),d.lineTo(h,l),d.closePath(),d.fill(),d.stroke()),this.style===n.STYLE.DOTCOLOR||this.style===n.STYLE.DOTSIZE){var g=5,_=new v(this.valueMin,this.valueMax,(this.valueMax-this.valueMin)/5,!0);for(_.start(),_.getCurrent()<this.valueMin&&_.next();!_.end();)t=l-(_.getCurrent()-this.valueMin)/(this.valueMax-this.valueMin)*s,d.beginPath(),d.moveTo(h-g,t),d.lineTo(h,t),d.stroke(),d.textAlign="right",d.textBaseline="middle",d.fillStyle=this.axisColor,d.fillText(_.getCurrent(),h-2*g,t),_.next();d.textAlign="right",d.textBaseline="top";var x=this.legendLabel;d.fillText(x,a,l+this.margin)}},n.prototype._redrawFilter=function(){if(this.frame.filter.innerHTML="",this.dataFilter){var t={visible:this.showAnimationControls},e=new m(this.frame.filter,t);this.frame.filter.slider=e,this.frame.filter.style.padding="10px",e.setValues(this.dataFilter.values),e.setPlayInterval(this.animationInterval);var i=this,n=function(){var t=e.getIndex();i.dataFilter.selectValue(t),i.dataPoints=i.dataFilter._getDataPoints(),i.redraw()};e.setOnChangeCallback(n)}else this.frame.filter.slider=void 0},n.prototype._redrawSlider=function(){void 0!==this.frame.filter.slider&&this.frame.filter.slider.redraw()},n.prototype._redrawInfo=function(){if(this.dataFilter){var t=this.frame.canvas,e=t.getContext("2d");e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var i=this.margin,n=this.margin;e.fillText(this.dataFilter.getLabel()+": "+this.dataFilter.getSelectedValue(),i,n)}},n.prototype._redrawAxis=function(){var t,e,i,n,r,s,o,a,h,l,u,c,f,p=this.frame.canvas,m=p.getContext("2d");m.font=24/this.camera.getArmLength()+"px arial";var y=.025/this.scale.x,g=.025/this.scale.y,_=5/this.camera.getArmLength(),x=this.camera.getArmRotation().horizontal;for(m.lineWidth=1,n=void 0===this.defaultXStep,i=new v(this.xMin,this.xMax,this.xStep,n),i.start(),i.getCurrent()<this.xMin&&i.next();!i.end();){var w=i.getCurrent();this.showGrid?(t=this._convert3Dto2D(new d(w,this.yMin,this.zMin)),e=this._convert3Dto2D(new d(w,this.yMax,this.zMin)),m.strokeStyle=this.gridColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()):(t=this._convert3Dto2D(new d(w,this.yMin,this.zMin)),e=this._convert3Dto2D(new d(w,this.yMin+y,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new d(w,this.yMax,this.zMin)),e=this._convert3Dto2D(new d(w,this.yMax-y,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()),o=Math.cos(x)>0?this.yMin:this.yMax,r=this._convert3Dto2D(new d(w,o,this.zMin)),Math.cos(2*x)>0?(m.textAlign="center",m.textBaseline="top",r.y+=_):Math.sin(2*x)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.xValueLabel(i.getCurrent())+" ",r.x,r.y),i.next()}for(m.lineWidth=1,n=void 0===this.defaultYStep,i=new v(this.yMin,this.yMax,this.yStep,n),i.start(),i.getCurrent()<this.yMin&&i.next();!i.end();)this.showGrid?(t=this._convert3Dto2D(new d(this.xMin,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new d(this.xMax,i.getCurrent(),this.zMin)),m.strokeStyle=this.gridColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()):(t=this._convert3Dto2D(new d(this.xMin,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new d(this.xMin+g,i.getCurrent(),this.zMin)),m.strokeStyle=this.axisColor,
+m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new d(this.xMax,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new d(this.xMax-g,i.getCurrent(),this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()),s=Math.sin(x)>0?this.xMin:this.xMax,r=this._convert3Dto2D(new d(s,i.getCurrent(),this.zMin)),Math.cos(2*x)<0?(m.textAlign="center",m.textBaseline="top",r.y+=_):Math.sin(2*x)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.yValueLabel(i.getCurrent())+" ",r.x,r.y),i.next();for(m.lineWidth=1,n=void 0===this.defaultZStep,i=new v(this.zMin,this.zMax,this.zStep,n),i.start(),i.getCurrent()<this.zMin&&i.next(),s=Math.cos(x)>0?this.xMin:this.xMax,o=Math.sin(x)<0?this.yMin:this.yMax;!i.end();)t=this._convert3Dto2D(new d(s,o,i.getCurrent())),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(t.x-_,t.y),m.stroke(),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(this.zValueLabel(i.getCurrent())+" ",t.x-5,t.y),i.next();m.lineWidth=1,t=this._convert3Dto2D(new d(s,o,this.zMin)),e=this._convert3Dto2D(new d(s,o,this.zMax)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),m.lineWidth=1,c=this._convert3Dto2D(new d(this.xMin,this.yMin,this.zMin)),f=this._convert3Dto2D(new d(this.xMax,this.yMin,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(c.x,c.y),m.lineTo(f.x,f.y),m.stroke(),c=this._convert3Dto2D(new d(this.xMin,this.yMax,this.zMin)),f=this._convert3Dto2D(new d(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(c.x,c.y),m.lineTo(f.x,f.y),m.stroke(),m.lineWidth=1,t=this._convert3Dto2D(new d(this.xMin,this.yMin,this.zMin)),e=this._convert3Dto2D(new d(this.xMin,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new d(this.xMax,this.yMin,this.zMin)),e=this._convert3Dto2D(new d(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke();var b=this.xLabel;b.length>0&&(u=.1/this.scale.y,s=(this.xMin+this.xMax)/2,o=Math.cos(x)>0?this.yMin-u:this.yMax+u,r=this._convert3Dto2D(new d(s,o,this.zMin)),Math.cos(2*x)>0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*x)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(b,r.x,r.y));var M=this.yLabel;M.length>0&&(l=.1/this.scale.x,s=Math.sin(x)>0?this.xMin-l:this.xMax+l,o=(this.yMin+this.yMax)/2,r=this._convert3Dto2D(new d(s,o,this.zMin)),Math.cos(2*x)<0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*x)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(M,r.x,r.y));var S=this.zLabel;S.length>0&&(h=30,s=Math.cos(x)>0?this.xMin:this.xMax,o=Math.sin(x)<0?this.yMin:this.yMax,a=(this.zMin+this.zMax)/2,r=this._convert3Dto2D(new d(s,o,a)),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(S,r.x-h,r.y))},n.prototype._hsv2rgb=function(t,e,i){var n,r,s,o,a,h;switch(o=i*e,a=Math.floor(t/60),h=o*(1-Math.abs(t/60%2-1)),a){case 0:n=o,r=h,s=0;break;case 1:n=h,r=o,s=0;break;case 2:n=0,r=o,s=h;break;case 3:n=0,r=h,s=o;break;case 4:n=h,r=0,s=o;break;case 5:n=o,r=0,s=h;break;default:n=0,r=0,s=0}return"RGB("+parseInt(255*n)+","+parseInt(255*r)+","+parseInt(255*s)+")"},n.prototype._redrawDataGrid=function(){var t,e,i,r,s,o,a,h,l,u,c,f,p=this.frame.canvas,m=p.getContext("2d");if(m.lineJoin="round",m.lineCap="round",!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(s=0;s<this.dataPoints.length;s++){var v=this._convertPointToTranslation(this.dataPoints[s].point),y=this._convertTranslationToScreen(v);this.dataPoints[s].trans=v,this.dataPoints[s].screen=y;var g=this._convertPointToTranslation(this.dataPoints[s].bottom);this.dataPoints[s].dist=this.showPerspective?g.length():-g.z}var _=function(t,e){return e.dist-t.dist};if(this.dataPoints.sort(_),this.style===n.STYLE.SURFACE){for(s=0;s<this.dataPoints.length;s++)if(t=this.dataPoints[s],e=this.dataPoints[s].pointRight,i=this.dataPoints[s].pointTop,r=this.dataPoints[s].pointCross,void 0!==t&&void 0!==e&&void 0!==i&&void 0!==r){if(this.showGrayBottom||this.showShadow){var x=d.subtract(r.trans,t.trans),w=d.subtract(i.trans,e.trans),b=d.crossProduct(x,w),M=b.length();o=b.z>0}else o=!0;o?(f=(t.point.z+e.point.z+i.point.z+r.point.z)/4,l=240*(1-(f-this.zMin)*this.scale.z/this.verticalRatio),u=1,this.showShadow?(c=Math.min(1+b.x/M/2,1),a=this._hsv2rgb(l,u,c),h=a):(c=1,a=this._hsv2rgb(l,u,c),h=this.axisColor)):(a="gray",h=this.axisColor),m.lineWidth=this._getStrokeWidth(t),m.fillStyle=a,m.strokeStyle=h,m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(e.screen.x,e.screen.y),m.lineTo(r.screen.x,r.screen.y),m.lineTo(i.screen.x,i.screen.y),m.closePath(),m.fill(),m.stroke()}}else for(s=0;s<this.dataPoints.length;s++)t=this.dataPoints[s],e=this.dataPoints[s].pointRight,i=this.dataPoints[s].pointTop,void 0!==t&&void 0!==e&&(f=(t.point.z+e.point.z)/2,l=240*(1-(f-this.zMin)*this.scale.z/this.verticalRatio),m.lineWidth=2*this._getStrokeWidth(t),m.strokeStyle=this._hsv2rgb(l,1,1),m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(e.screen.x,e.screen.y),m.stroke()),void 0!==t&&void 0!==i&&(f=(t.point.z+i.point.z)/2,l=240*(1-(f-this.zMin)*this.scale.z/this.verticalRatio),m.lineWidth=2*this._getStrokeWidth(t),m.strokeStyle=this._hsv2rgb(l,1,1),m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(i.screen.x,i.screen.y),m.stroke())}},n.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},n.prototype._redrawDataDot=function(){var t,e=this.frame.canvas,i=e.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t<this.dataPoints.length;t++){var r=this._convertPointToTranslation(this.dataPoints[t].point),s=this._convertTranslationToScreen(r);this.dataPoints[t].trans=r,this.dataPoints[t].screen=s;var o=this._convertPointToTranslation(this.dataPoints[t].bottom);this.dataPoints[t].dist=this.showPerspective?o.length():-o.z}var a=function(t,e){return e.dist-t.dist};this.dataPoints.sort(a);var h=this.frame.clientWidth*this.dotSizeRatio;for(t=0;t<this.dataPoints.length;t++){var l=this.dataPoints[t];if(this.style===n.STYLE.DOTLINE){var u=this._convert3Dto2D(l.bottom);i.lineWidth=1,i.strokeStyle=this.gridColor,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(l.screen.x,l.screen.y),i.stroke()}var d;d=this.style===n.STYLE.DOTSIZE?h/2+2*h*(l.point.value-this.valueMin)/(this.valueMax-this.valueMin):h;var c;c=this.showPerspective?d/-l.trans.z:d*-(this.eye.z/this.camera.getArmLength()),0>c&&(c=0);var f,p,m;this.style===n.STYLE.DOTCOLOR?(f=240*(1-(l.point.value-this.valueMin)*this.scale.value),p=this._hsv2rgb(f,1,1),m=this._hsv2rgb(f,1,.8)):this.style===n.STYLE.DOTSIZE?(p=this.dataColor.fill,m=this.dataColor.stroke):(f=240*(1-(l.point.z-this.zMin)*this.scale.z/this.verticalRatio),p=this._hsv2rgb(f,1,1),m=this._hsv2rgb(f,1,.8)),i.lineWidth=this._getStrokeWidth(l),i.strokeStyle=m,i.fillStyle=p,i.beginPath(),i.arc(l.screen.x,l.screen.y,c,0,2*Math.PI,!0),i.fill(),i.stroke()}}},n.prototype._redrawDataBar=function(){var t,e,i,r,s=this.frame.canvas,o=s.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t<this.dataPoints.length;t++){var a=this._convertPointToTranslation(this.dataPoints[t].point),h=this._convertTranslationToScreen(a);this.dataPoints[t].trans=a,this.dataPoints[t].screen=h;var l=this._convertPointToTranslation(this.dataPoints[t].bottom);this.dataPoints[t].dist=this.showPerspective?l.length():-l.z}var u=function(t,e){return e.dist-t.dist};this.dataPoints.sort(u),o.lineJoin="round",o.lineCap="round";var c=this.xBarWidth/2,f=this.yBarWidth/2;for(t=0;t<this.dataPoints.length;t++){var p,m,v,y=this.dataPoints[t];this.style===n.STYLE.BARCOLOR?(p=240*(1-(y.point.value-this.valueMin)*this.scale.value),m=this._hsv2rgb(p,1,1),v=this._hsv2rgb(p,1,.8)):this.style===n.STYLE.BARSIZE?(m=this.dataColor.fill,v=this.dataColor.stroke):(p=240*(1-(y.point.z-this.zMin)*this.scale.z/this.verticalRatio),m=this._hsv2rgb(p,1,1),v=this._hsv2rgb(p,1,.8)),this.style===n.STYLE.BARSIZE&&(c=this.xBarWidth/2*((y.point.value-this.valueMin)/(this.valueMax-this.valueMin)*.8+.2),f=this.yBarWidth/2*((y.point.value-this.valueMin)/(this.valueMax-this.valueMin)*.8+.2));var g=this,_=y.point,x=[{point:new d(_.x-c,_.y-f,_.z)},{point:new d(_.x+c,_.y-f,_.z)},{point:new d(_.x+c,_.y+f,_.z)},{point:new d(_.x-c,_.y+f,_.z)}],w=[{point:new d(_.x-c,_.y-f,this.zMin)},{point:new d(_.x+c,_.y-f,this.zMin)},{point:new d(_.x+c,_.y+f,this.zMin)},{point:new d(_.x-c,_.y+f,this.zMin)}];x.forEach(function(t){t.screen=g._convert3Dto2D(t.point)}),w.forEach(function(t){t.screen=g._convert3Dto2D(t.point)});var b=[{corners:x,center:d.avg(w[0].point,w[2].point)},{corners:[x[0],x[1],w[1],w[0]],center:d.avg(w[1].point,w[0].point)},{corners:[x[1],x[2],w[2],w[1]],center:d.avg(w[2].point,w[1].point)},{corners:[x[2],x[3],w[3],w[2]],center:d.avg(w[3].point,w[2].point)},{corners:[x[3],x[0],w[0],w[3]],center:d.avg(w[0].point,w[3].point)}];for(y.surfaces=b,e=0;e<b.length;e++){i=b[e];var M=this._convertPointToTranslation(i.center);i.dist=this.showPerspective?M.length():-M.z}for(b.sort(function(t,e){var i=e.dist-t.dist;return i?i:t.corners===x?1:e.corners===x?-1:0}),o.lineWidth=this._getStrokeWidth(y),o.strokeStyle=v,o.fillStyle=m,e=2;e<b.length;e++)i=b[e],r=i.corners,o.beginPath(),o.moveTo(r[3].screen.x,r[3].screen.y),o.lineTo(r[0].screen.x,r[0].screen.y),o.lineTo(r[1].screen.x,r[1].screen.y),o.lineTo(r[2].screen.x,r[2].screen.y),o.lineTo(r[3].screen.x,r[3].screen.y),o.fill(),o.stroke()}}},n.prototype._redrawDataLine=function(){var t,e,i=this.frame.canvas,n=i.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(e=0;e<this.dataPoints.length;e++){var r=this._convertPointToTranslation(this.dataPoints[e].point),s=this._convertTranslationToScreen(r);this.dataPoints[e].trans=r,this.dataPoints[e].screen=s}if(this.dataPoints.length>0){for(t=this.dataPoints[0],n.lineWidth=this._getStrokeWidth(t),n.lineJoin="round",n.lineCap="round",n.strokeStyle=this.dataColor.stroke,n.beginPath(),n.moveTo(t.screen.x,t.screen.y),e=1;e<this.dataPoints.length;e++)t=this.dataPoints[e],n.lineTo(t.screen.x,t.screen.y);n.stroke()}}},n.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this.startMouseX=r(t),this.startMouseY=s(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},u.addEventListener(document,"mousemove",e.onmousemove),u.addEventListener(document,"mouseup",e.onmouseup),u.preventDefault(t)}},n.prototype._onMouseMove=function(t){t=t||window.event;var e=parseFloat(r(t))-this.startMouseX,i=parseFloat(s(t))-this.startMouseY,n=this.startArmRotation.horizontal+e/200,o=this.startArmRotation.vertical+i/200,a=4,h=Math.sin(a/360*2*Math.PI);Math.abs(Math.sin(n))<h&&(n=Math.round(n/Math.PI)*Math.PI-.001),Math.abs(Math.cos(n))<h&&(n=(Math.round(n/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(o))<h&&(o=Math.round(o/Math.PI)*Math.PI),Math.abs(Math.cos(o))<h&&(o=(Math.round(o/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(n,o),this.redraw();var l=this.getCameraPosition();this.emit("cameraPositionChange",l),u.preventDefault(t)},n.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,u.removeEventListener(document,"mousemove",this.onmousemove),u.removeEventListener(document,"mouseup",this.onmouseup),u.preventDefault(t)},n.prototype._onTooltip=function(t){var e=300,i=this.frame.getBoundingClientRect(),n=r(t)-i.left,o=s(t)-i.top;if(this.showTooltip){if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)return void this._hideTooltip();if(this.tooltip&&this.tooltip.dataPoint){var a=this._dataPointFromXY(n,o);a!==this.tooltip.dataPoint&&(a?this._showTooltip(a):this._hideTooltip())}else{var h=this;this.tooltipTimeout=setTimeout(function(){h.tooltipTimeout=null;var t=h._dataPointFromXY(n,o);t&&h._showTooltip(t)},e)}}},n.prototype._onTouchStart=function(t){this.touchDown=!0;var e=this;this.ontouchmove=function(t){e._onTouchMove(t)},this.ontouchend=function(t){e._onTouchEnd(t)},u.addEventListener(document,"touchmove",e.ontouchmove),u.addEventListener(document,"touchend",e.ontouchend),this._onMouseDown(t)},n.prototype._onTouchMove=function(t){this._onMouseMove(t)},n.prototype._onTouchEnd=function(t){this.touchDown=!1,u.removeEventListener(document,"touchmove",this.ontouchmove),u.removeEventListener(document,"touchend",this.ontouchend),this._onMouseUp(t)},n.prototype._onWheel=function(t){t||(t=window.event);var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var i=this.camera.getArmLength(),n=i*(1-e/10);this.camera.setArmLength(n),this.redraw(),this._hideTooltip()}var r=this.getCameraPosition();this.emit("cameraPositionChange",r),u.preventDefault(t)},n.prototype._insideTriangle=function(t,e){function i(t){return t>0?1:0>t?-1:0}var n=e[0],r=e[1],s=e[2],o=i((r.x-n.x)*(t.y-n.y)-(r.y-n.y)*(t.x-n.x)),a=i((s.x-r.x)*(t.y-r.y)-(s.y-r.y)*(t.x-r.x)),h=i((n.x-s.x)*(t.y-s.y)-(n.y-s.y)*(t.x-s.x));return!(0!=o&&0!=a&&o!=a||0!=a&&0!=h&&a!=h||0!=o&&0!=h&&o!=h)},n.prototype._dataPointFromXY=function(t,e){var i,r=100,s=null,o=null,a=null,h=new c(t,e);if(this.style===n.STYLE.BAR||this.style===n.STYLE.BARCOLOR||this.style===n.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){s=this.dataPoints[i];var l=s.surfaces;if(l)for(var u=l.length-1;u>=0;u--){var d=l[u],f=d.corners,p=[f[0].screen,f[1].screen,f[2].screen],m=[f[2].screen,f[3].screen,f[0].screen];if(this._insideTriangle(h,p)||this._insideTriangle(h,m))return s}}else for(i=0;i<this.dataPoints.length;i++){s=this.dataPoints[i];var v=s.screen;if(v){var y=Math.abs(t-v.x),g=Math.abs(e-v.y),_=Math.sqrt(y*y+g*g);(null===a||a>_)&&r>_&&(a=_,o=s)}}return o},n.prototype._showTooltip=function(t){var e,i,n;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,n=this.tooltip.dom.dot):(e=document.createElement("div"),e.style.position="absolute",e.style.padding="10px",e.style.border="1px solid #4d4d4d",e.style.color="#1a1a1a",e.style.background="rgba(255,255,255,0.7)",e.style.borderRadius="2px",e.style.boxShadow="5px 5px 10px rgba(128,128,128,0.5)",i=document.createElement("div"),i.style.position="absolute",i.style.height="40px",i.style.width="0",i.style.borderLeft="1px solid #4d4d4d",n=document.createElement("div"),n.style.position="absolute",n.style.height="0",n.style.width="0",n.style.border="5px solid #4d4d4d",n.style.borderRadius="5px",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:n}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(n);var r=e.offsetWidth,s=e.offsetHeight,o=i.offsetHeight,a=n.offsetWidth,h=n.offsetHeight,l=t.screen.x-r/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-r),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-o+"px",e.style.left=l+"px",e.style.top=t.screen.y-o-s+"px",n.style.left=t.screen.x-a/2+"px",n.style.top=t.screen.y-h/2+"px"},n.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},t.exports=n},function(t,e){function i(t){return t?n(t):void 0}function n(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){n.off(t,i),e.apply(this,arguments)}var n=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var n,r=0;r<i.length;r++)if(n=i[r],n===e||n.fn===e){i.splice(r,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),i=this._callbacks[t];if(i){i=i.slice(0);for(var n=0,r=i.length;r>n;++n)i[n].apply(this,e)}return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){function i(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}i.subtract=function(t,e){var n=new i;return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},i.add=function(t,e){var n=new i;return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},i.avg=function(t,e){return new i((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},i.crossProduct=function(t,e){var n=new i;return n.x=t.y*e.z-t.z*e.y,n.y=t.z*e.x-t.x*e.z,n.z=t.x*e.y-t.y*e.x,n},i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.exports=i},function(t,e){function i(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0}t.exports=i},function(t,e,i){function n(){this.armLocation=new r,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraLocation=new r,this.cameraRotation=new r(.5*Math.PI,0,0),this.calculateCameraOrientation()}var r=i(13);n.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},n.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},n.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},n.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},n.prototype.getArmLength=function(){return this.armLength},n.prototype.getCameraLocation=function(){return this.cameraLocation},n.prototype.getCameraRotation=function(){return this.cameraRotation},n.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},t.exports=n},function(t,e,i){function n(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:e>t?-1:0}),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var r=i(10);n.prototype.isLoaded=function(){return this.loaded},n.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},n.prototype.getLabel=function(){return this.graph.filterLabel},n.prototype.getColumn=function(){return this.column},n.prototype.getSelectedValue=function(){return void 0!==this.index?this.values[this.index]:void 0},n.prototype.getValues=function(){return this.values},n.prototype.getValue=function(t){if(t>=this.values.length)throw"Error: index out of range";return this.values[t]},n.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var n=new r(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(n),this.dataPoints[t]=e}return e},n.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},n.prototype.selectValue=function(t){if(t>=this.values.length)throw"Error: index out of range";this.index=t,this.value=this.values[t]},n.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<this.values.length){this._getDataPoints(t);void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var i=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+i+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var n=this;setTimeout(function(){n.loadInBackground(t+1)},10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()},t.exports=n},function(t,e,i){function n(t,e){if(void 0===t)throw"Error: No container element defined";if(this.container=t,this.visible=e&&void 0!=e.visible?e.visible:!0,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}var r=i(1);n.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},n.prototype.next=function(){var t=this.getIndex();t<this.values.length-1&&(t++,this.setIndex(t))},n.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<this.values.length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var i=new Date,n=i-t,r=Math.max(this.playInterval-n,0),s=this;this.playTimeout=setTimeout(function(){s.playNext()},r)},n.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},n.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},n.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},n.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},n.prototype.setPlayInterval=function(t){this.playInterval=t},n.prototype.getPlayInterval=function(t){return this.playInterval},n.prototype.setPlayLoop=function(t){this.playLoop=t},n.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},n.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},n.prototype.setValues=function(t){this.values=t,this.values.length>0?this.setIndex(0):this.index=void 0},n.prototype.setIndex=function(t){if(!(t<this.values.length))throw"Error: index out of range";this.index=t,this.redraw(),this.onChange()},n.prototype.getIndex=function(){return this.index},n.prototype.get=function(){return this.values[this.index]},n.prototype._onMouseDown=function(t){var e=t.which?1===t.which:1===t.button;if(e){this.startClientX=t.clientX,this.startSlideX=parseFloat(this.frame.slide.style.left),this.frame.style.cursor="move";var i=this;this.onmousemove=function(t){i._onMouseMove(t)},this.onmouseup=function(t){i._onMouseUp(t)},r.addEventListener(document,"mousemove",this.onmousemove),r.addEventListener(document,"mouseup",this.onmouseup),r.preventDefault(t)}},n.prototype.leftToIndex=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t-3,n=Math.round(i/e*(this.values.length-1));return 0>n&&(n=0),n>this.values.length-1&&(n=this.values.length-1),n},n.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,n=i+3;return n},n.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,n=this.leftToIndex(i);this.setIndex(n),r.preventDefault()},n.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",r.removeEventListener(document,"mousemove",this.onmousemove),r.removeEventListener(document,"mouseup",this.onmouseup),r.preventDefault()},t.exports=n},function(t,e){function i(t,e,i,n){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,n)}i.prototype.setRange=function(t,e,i,n){this._start=t?t:0,this._end=e?e:0,this.setStep(i,n)},i.prototype.setStep=function(t,e){void 0===t||0>=t||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=i.calculatePrettyStep(t):this._step=t)},i.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),n=2*Math.pow(10,Math.round(e(t/2))),r=5*Math.pow(10,Math.round(e(t/5))),s=i;return Math.abs(n-t)<=Math.abs(s-t)&&(s=n),Math.abs(r-t)<=Math.abs(s-t)&&(s=r),0>=s&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(){this._current=this._start-this._start%this._step},i.prototype.next=function(){this._current+=this._step},i.prototype.end=function(){return this._current>this._end},t.exports=i},function(t,e,i){if("undefined"!=typeof window){var n=i(20),r=window.Hammer||i(21);t.exports=n(r,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var n,r,s;!function(i){r=[],n=i,s="function"==typeof n?n.apply(e,r):n,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,n){function r(t){return t.match(/[^ ]+/g)}function s(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var i=!1;e.stopPropagation=function(){i=!0};var n=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof n&&(e.srcEvent.stopPropagation=function(){n(),e.stopPropagation()}),e.firstTarget=t;for(var r=t;r&&!i;){var s=r.hammer;if(s)for(var o,a=0;a<s.length;a++)if(o=s[a]._handlers[e.type])for(var h=0;h<o.length&&!i;h++)o[h](e);r=r.parentNode}}var o=n||{preventDefault:!1};if(i.Manager){var a=i,h=function(t,i){var n=Object.create(o);return i&&a.assign(n,i),e(new a(t,n),n)};return a.assign(h,a),h.Manager=function(t,i){var n=Object.create(o);return i&&a.assign(n,i),e(new a.Manager(t,n),n)},h}var l=Object.create(i),u=i.element;return u.hammer||(u.hammer=[]),u.hammer.push(l),i.on("hammer.input",function(e){o.preventDefault!==!0&&o.preventDefault!==e.pointerType||e.preventDefault(),e.isFirst&&(t=e.target)}),l._handlers={},l.on=function(t,e){return r(t).forEach(function(t){var n=l._handlers[t];n||(l._handlers[t]=n=[],i.on(t,s)),n.push(e)}),l},l.off=function(t,e){return r(t).forEach(function(t){var n=l._handlers[t];n&&(n=e?n.filter(function(t){return t!==e}):[],n.length>0?l._handlers[t]=n:(i.off(t,s),delete l._handlers[t]))}),l},l.emit=function(e,n){t=n.target,i.emit(e,n)},l.destroy=function(){var t=i.element.hammer,e=t.indexOf(l);-1!==e&&t.splice(e,1),t.length||delete i.element.hammer,l._handlers={},i.destroy()},l}})},function(t,e,i){var n;/*! Hammer.JS - v2.0.6 - 2015-12-23
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2015 Jorik Tangelder;
+ * Licensed under the license */
+!function(r,s,o,a){function h(t,e,i){return setTimeout(f(t,i),e)}function l(t,e,i){return Array.isArray(t)?(u(t,i[e],i),!0):!1}function u(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)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 d(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",s=r.console&&(r.console.warn||r.console.log);return s&&s.call(r.console,n,i),t.apply(this,arguments)}}function c(t,e,i){var n,r=e.prototype;n=t.prototype=Object.create(r),n.constructor=t,n._super=r,i&&dt(n,i)}function f(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==pt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){u(x(e),function(e){t.addEventListener(e,i,!1)})}function y(t,e,i){u(x(e),function(e){t.removeEventListener(e,i,!1)})}function g(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function _(t,e){return t.indexOf(e)>-1}function x(t){return t.trim().split(/\s+/g)}function w(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}function b(t){return Array.prototype.slice.call(t,0)}function M(t,e,i){for(var n=[],r=[],s=0;s<t.length;){var o=e?t[s][e]:t[s];w(r,o)<0&&n.push(t[s]),r[s]=o,s++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function S(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),s=0;s<ct.length;){if(i=ct[s],n=i?i+r:e,n in t)return n;s++}return a}function T(){return xt++}function D(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||r}function k(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){p(t.options.enable,[t])&&i.handler(e)},this.init()}function C(t){var e,i=t.options.inputClass;return new(e=i?i:Mt?B:St?j:bt?X:V)(t,O)}function O(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,s=e&Pt&&n-r===0,o=e&(Lt|Yt)&&n-r===0;i.isFirst=!!s,i.isFinal=!!o,s&&(t.session={}),i.eventType=e,P(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function P(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=Y(e)),r>1&&!i.firstMultiple?i.firstMultiple=Y(e):1===r&&(i.firstMultiple=!1);var s=i.firstInput,o=i.firstMultiple,a=o?o.center:s.center,h=e.center=A(n);e.timeStamp=yt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=W(a,h),e.distance=z(a,h),E(i,e),e.offsetDirection=I(e.deltaX,e.deltaY);var l=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=vt(l.x)>vt(l.y)?l.x:l.y,e.scale=o?F(o.pointers,n):1,e.rotation=o?N(o.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,L(i,e);var u=t.element;g(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function E(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};e.eventType!==Pt&&s.eventType!==Lt||(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}function L(t,e){var i,n,r,s,o=t.lastInterval||e,h=e.timeStamp-o.timeStamp;if(e.eventType!=Yt&&(h>Ot||o.velocity===a)){var l=e.deltaX-o.deltaX,u=e.deltaY-o.deltaY,d=R(h,l,u);n=d.x,r=d.y,i=vt(d.x)>vt(d.y)?d.x:d.y,s=I(l,u),t.lastInterval=e}else i=o.velocity,n=o.velocityX,r=o.velocityY,s=o.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=s}function Y(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:mt(t.pointers[i].clientX),clientY:mt(t.pointers[i].clientY)},i++;return{timeStamp:yt(),pointers:e,center:A(e),deltaX:t.deltaX,deltaY:t.deltaY}}function A(t){var e=t.length;if(1===e)return{x:mt(t[0].clientX),y:mt(t[0].clientY)};for(var i=0,n=0,r=0;e>r;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:mt(i/e),y:mt(n/e)}}function R(t,e,i){return{x:e/t||0,y:i/t||0}}function I(t,e){return t===e?At:vt(t)>=vt(e)?0>t?Rt:It:0>e?zt:Wt}function z(t,e,i){i||(i=Bt);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function W(t,e,i){i||(i=Bt);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}function N(t,e){return W(e[1],e[0],Ut)+W(t[1],t[0],Ut)}function F(t,e){return z(e[0],e[1],Ut)/z(t[0],t[1],Ut)}function V(){this.evEl=jt,this.evWin=Gt,this.allow=!0,this.pressed=!1,k.apply(this,arguments)}function B(){this.evEl=qt,this.evWin=Qt,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function U(){this.evTarget=Jt,this.evWin=Kt,this.started=!1,k.apply(this,arguments)}function H(t,e){var i=b(t.touches),n=b(t.changedTouches);return e&(Lt|Yt)&&(i=M(i.concat(n),"identifier",!0)),[i,n]}function j(){this.evTarget=ee,this.targetIds={},k.apply(this,arguments)}function G(t,e){var i=b(t.touches),n=this.targetIds;if(e&(Pt|Et)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,o=b(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return g(t.target,h)}),e===Pt)for(r=0;r<s.length;)n[s[r].identifier]=!0,r++;for(r=0;r<o.length;)n[o[r].identifier]&&a.push(o[r]),e&(Lt|Yt)&&delete n[o[r].identifier],r++;return a.length?[M(s.concat(a),"identifier",!0),a]:void 0}function X(){k.apply(this,arguments);var t=f(this.handler,this);this.touch=new j(this.manager,t),this.mouse=new V(this.manager,t)}function Z(t,e){this.manager=t,this.set(e)}function q(t){if(_(t,ae))return ae;var e=_(t,he),i=_(t,le);return e&&i?ae:e||i?e?he:le:_(t,oe)?oe:se}function Q(t){this.options=dt({},this.defaults,t||{}),this.id=T(),this.manager=null,this.options.enable=m(this.options.enable,!0),this.state=ue,this.simultaneous={},this.requireFail=[]}function $(t){return t&me?"cancel":t&fe?"end":t&ce?"move":t&de?"start":""}function J(t){return t==Wt?"down":t==zt?"up":t==Rt?"left":t==It?"right":""}function K(t,e){var i=e.manager;return i?i.get(t):t}function tt(){Q.apply(this,arguments)}function et(){tt.apply(this,arguments),this.pX=null,this.pY=null}function it(){tt.apply(this,arguments)}function nt(){Q.apply(this,arguments),this._timer=null,this._input=null}function rt(){tt.apply(this,arguments)}function st(){tt.apply(this,arguments)}function ot(){Q.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function at(t,e){return e=e||{},e.recognizers=m(e.recognizers,at.defaults.preset),new ht(t,e)}function ht(t,e){this.options=dt({},at.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=C(this),this.touchAction=new Z(this,this.options.touchAction),lt(this,!0),u(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function lt(t,e){var i=t.element;i.style&&u(t.options.cssProps,function(t,n){i.style[S(i.style,n)]=e?t:""})}function ut(t,e){var i=s.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}var dt,ct=["","webkit","Moz","MS","ms","o"],ft=s.createElement("div"),pt="function",mt=Math.round,vt=Math.abs,yt=Date.now;dt="function"!=typeof Object.assign?function(t){if(t===a||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(n!==a&&null!==n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}:Object.assign;var gt=d(function(t,e,i){for(var n=Object.keys(e),r=0;r<n.length;)(!i||i&&t[n[r]]===a)&&(t[n[r]]=e[n[r]]),r++;return t},"extend","Use `assign`."),_t=d(function(t,e){return gt(t,e,!0)},"merge","Use `assign`."),xt=1,wt=/mobile|tablet|ip(ad|hone|od)|android/i,bt="ontouchstart"in r,Mt=S(r,"PointerEvent")!==a,St=bt&&wt.test(navigator.userAgent),Tt="touch",Dt="pen",kt="mouse",Ct="kinect",Ot=25,Pt=1,Et=2,Lt=4,Yt=8,At=1,Rt=2,It=4,zt=8,Wt=16,Nt=Rt|It,Ft=zt|Wt,Vt=Nt|Ft,Bt=["x","y"],Ut=["clientX","clientY"];k.prototype={handler:function(){},init:function(){this.evEl&&v(this.element,this.evEl,this.domHandler),this.evTarget&&v(this.target,this.evTarget,this.domHandler),this.evWin&&v(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(D(this.element),this.evWin,this.domHandler)}};var Ht={mousedown:Pt,mousemove:Et,mouseup:Lt},jt="mousedown",Gt="mousemove mouseup";c(V,k,{handler:function(t){var e=Ht[t.type];e&Pt&&0===t.button&&(this.pressed=!0),e&Et&&1!==t.which&&(e=Lt),this.pressed&&this.allow&&(e&Lt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:kt,srcEvent:t}))}});var Xt={pointerdown:Pt,pointermove:Et,pointerup:Lt,pointercancel:Yt,pointerout:Yt},Zt={2:Tt,3:Dt,4:kt,5:Ct},qt="pointerdown",Qt="pointermove pointerup pointercancel";r.MSPointerEvent&&!r.PointerEvent&&(qt="MSPointerDown",Qt="MSPointerMove MSPointerUp MSPointerCancel"),c(B,k,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=Xt[n],s=Zt[t.pointerType]||t.pointerType,o=s==Tt,a=w(e,t.pointerId,"pointerId");r&Pt&&(0===t.button||o)?0>a&&(e.push(t),a=e.length-1):r&(Lt|Yt)&&(i=!0),0>a||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var $t={touchstart:Pt,touchmove:Et,touchend:Lt,touchcancel:Yt},Jt="touchstart",Kt="touchstart touchmove touchend touchcancel";c(U,k,{handler:function(t){var e=$t[t.type];if(e===Pt&&(this.started=!0),this.started){var i=H.call(this,t,e);e&(Lt|Yt)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Tt,srcEvent:t})}}});var te={touchstart:Pt,touchmove:Et,touchend:Lt,touchcancel:Yt},ee="touchstart touchmove touchend touchcancel";c(j,k,{handler:function(t){var e=te[t.type],i=G.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Tt,srcEvent:t})}}),c(X,k,{handler:function(t,e,i){var n=i.pointerType==Tt,r=i.pointerType==kt;if(n)this.mouse.allow=!1;else if(r&&!this.mouse.allow)return;e&(Lt|Yt)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ie=S(ft.style,"touchAction"),ne=ie!==a,re="compute",se="auto",oe="manipulation",ae="none",he="pan-x",le="pan-y";Z.prototype={set:function(t){t==re&&(t=this.compute()),ne&&this.manager.element.style&&(this.manager.element.style[ie]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return u(this.manager.recognizers,function(e){p(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),q(t.join(" "))},preventDefaults:function(t){if(!ne){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var n=this.actions,r=_(n,ae),s=_(n,le),o=_(n,he);if(r){var a=1===t.pointers.length,h=t.distance<2,l=t.deltaTime<250;if(a&&h&&l)return}if(!o||!s)return r||s&&i&Nt||o&&i&Ft?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ue=1,de=2,ce=4,fe=8,pe=fe,me=16,ve=32;Q.prototype={defaults:{},set:function(t){return dt(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(l(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=K(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return l(t,"dropRecognizeWith",this)?this:(t=K(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(l(t,"requireFailure",this))return this;var e=this.requireFail;return t=K(t,this),-1===w(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(l(t,"dropRequireFailure",this))return this;t=K(t,this);var e=w(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,n=this.state;fe>n&&e(i.options.event+$(n)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),n>=fe&&e(i.options.event+$(n))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=ve)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(ve|ue)))return!1;t++}return!0},recognize:function(t){var e=dt({},t);return p(this.options.enable,[this,e])?(this.state&(pe|me|ve)&&(this.state=ue),this.state=this.process(e),void(this.state&(de|ce|fe|me)&&this.tryEmit(e))):(this.reset(),void(this.state=ve))},process:function(t){},getTouchAction:function(){},reset:function(){}},c(tt,Q,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=e&(de|ce),r=this.attrTest(t);return n&&(i&Yt||!r)?e|me:n||r?i&Lt?e|fe:e&de?e|ce:de:ve}}),c(et,tt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Vt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Nt&&e.push(le),t&Ft&&e.push(he),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,s=t.deltaX,o=t.deltaY;return r&e.direction||(e.direction&Nt?(r=0===s?At:0>s?Rt:It,i=s!=this.pX,n=Math.abs(t.deltaX)):(r=0===o?At:0>o?zt:Wt,i=o!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return tt.prototype.attrTest.call(this,t)&&(this.state&de||!(this.state&de)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=J(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(it,tt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&de)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(nt,Q,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[se]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(Lt|Yt)&&!r)this.reset();else if(t.eventType&Pt)this.reset(),this._timer=h(function(){this.state=pe,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return pe;return ve},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===pe&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=yt(),this.manager.emit(this.options.event,this._input)))}}),c(rt,tt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&de)}}),c(st,tt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Nt|Ft,pointers:1},getTouchAction:function(){return et.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Nt|Ft)?e=t.overallVelocity:i&Nt?e=t.overallVelocityX:i&Ft&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&vt(e)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=J(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(ot,Q,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&Pt&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=Lt)return this.failTimeout();var s=this.pTime?t.timeStamp-this.pTime<e.interval:!0,o=!this.pCenter||z(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,o&&s?this.count+=1:this.count=1,this._input=t;var a=this.count%e.taps;if(0===a)return this.hasRequireFailures()?(this._timer=h(function(){this.state=pe,this.tryEmit()},e.interval,this),de):pe}return ve},failTimeout:function(){return this._timer=h(function(){this.state=ve},this.options.interval,this),ve},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==pe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),at.VERSION="2.0.6",at.defaults={domEvents:!1,touchAction:re,enable:!0,inputTarget:null,inputClass:null,preset:[[rt,{enable:!1}],[it,{enable:!1},["rotate"]],[st,{direction:Nt}],[et,{direction:Nt},["swipe"]],[ot],[ot,{event:"doubletap",taps:2},["tap"]],[nt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ye=1,ge=2;ht.prototype={set:function(t){return dt(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ge:ye},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,n=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&pe)&&(r=e.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],e.stopped===ge||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&i.state&(de|ce|fe)&&(r=e.curRecognizer=i),s++}},get:function(t){if(t instanceof Q)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(l(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},remove:function(t){if(l(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=w(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){var i=this.handlers;return u(x(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},off:function(t,e){var i=this.handlers;return u(x(t),function(t){e?i[t]&&i[t].splice(w(i[t],e),1):delete i[t]}),this},emit:function(t,e){this.options.domEvents&&ut(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++}},destroy:function(){this.element&<(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},dt(at,{INPUT_START:Pt,INPUT_MOVE:Et,INPUT_END:Lt,INPUT_CANCEL:Yt,STATE_POSSIBLE:ue,STATE_BEGAN:de,STATE_CHANGED:ce,STATE_ENDED:fe,STATE_RECOGNIZED:pe,STATE_CANCELLED:me,STATE_FAILED:ve,DIRECTION_NONE:At,DIRECTION_LEFT:Rt,DIRECTION_RIGHT:It,DIRECTION_UP:zt,DIRECTION_DOWN:Wt,DIRECTION_HORIZONTAL:Nt,DIRECTION_VERTICAL:Ft,DIRECTION_ALL:Vt,Manager:ht,Input:k,TouchAction:Z,TouchInput:j,MouseInput:V,PointerEventInput:B,TouchMouseInput:X,SingleTouchInput:U,Recognizer:Q,AttrRecognizer:tt,Tap:ot,Pan:et,Swipe:st,Pinch:it,Rotate:rt,Press:nt,on:v,off:y,each:u,merge:_t,extend:gt,assign:dt,inherit:c,bindFn:f,prefixed:S});var _e="undefined"!=typeof r?r:"undefined"!=typeof self?self:{};_e.Hammer=at,n=function(){return at}.call(e,i,e,t),!(n!==a&&(t.exports=n))}(window,document,"Hammer")},function(t,e,i){var n,r,s;!function(i,o){r=[],n=o,s="function"==typeof n?n.apply(e,r):n,!(void 0!==s&&(t.exports=s))}(this,function(){function t(t){var e,i=t&&t.preventDefault||!1,n=t&&t.container||window,r={},s={keydown:{},keyup:{}},o={};for(e=97;122>=e;e++)o[String.fromCharCode(e)]={code:65+(e-97),shift:!1};for(e=65;90>=e;e++)o[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;9>=e;e++)o[""+e]={code:48+e,shift:!1};for(e=1;12>=e;e++)o["F"+e]={code:111+e,shift:!1};for(e=0;9>=e;e++)o["num"+e]={code:96+e,shift:!1};o["num*"]={code:106,shift:!1},o["num+"]={code:107,shift:!1},o["num-"]={code:109,shift:!1},o["num/"]={code:111,shift:!1},o["num."]={code:110,shift:!1},o.left={code:37,shift:!1},o.up={code:38,shift:!1},o.right={code:39,shift:!1},o.down={code:40,shift:!1},o.space={code:32,shift:!1},o.enter={code:13,shift:!1},o.shift={code:16,shift:void 0},o.esc={code:27,shift:!1},o.backspace={code:8,shift:!1},o.tab={code:9,shift:!1},o.ctrl={code:17,shift:!1},o.alt={code:18,shift:!1},o["delete"]={code:46,shift:!1},o.pageup={code:33,shift:!1},o.pagedown={code:34,shift:!1},o["="]={code:187,shift:!1},o["-"]={code:189,shift:!1},o["]"]={code:221,shift:!1},o["["]={code:219,shift:!1};var a=function(t){l(t,"keydown")},h=function(t){l(t,"keyup")},l=function(t,e){if(void 0!==s[e][t.keyCode]){for(var n=s[e][t.keyCode],r=0;r<n.length;r++)void 0===n[r].shift?n[r].fn(t):1==n[r].shift&&1==t.shiftKey?n[r].fn(t):0==n[r].shift&&0==t.shiftKey&&n[r].fn(t);1==i&&t.preventDefault()}};return r.bind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===o[t])throw new Error("unsupported key: "+t);void 0===s[i][o[t].code]&&(s[i][o[t].code]=[]),s[i][o[t].code].push({fn:e,shift:o[t].shift})},r.bindAll=function(t,e){void 0===e&&(e="keydown");for(var i in o)o.hasOwnProperty(i)&&r.bind(i,t,e)},r.getKey=function(t){for(var e in o)if(o.hasOwnProperty(e)){if(1==t.shiftKey&&1==o[e].shift&&t.keyCode==o[e].code)return e;if(0==t.shiftKey&&0==o[e].shift&&t.keyCode==o[e].code)return e;if(t.keyCode==o[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},r.unbind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===o[t])throw new Error("unsupported key: "+t);if(void 0!==e){var n=[],r=s[i][o[t].code];if(void 0!==r)for(var a=0;a<r.length;a++)r[a].fn==e&&r[a].shift==o[t].shift||n.push(s[i][o[t].code][a]);s[i][o[t].code]=n}else s[i][o[t].code]=[]},r.reset=function(){s={keydown:{},keyup:{}}},r.destroy=function(){s={keydown:{},keyup:{}},n.removeEventListener("keydown",a,!0),n.removeEventListener("keyup",h,!0)},n.addEventListener("keydown",a,!0),n.addEventListener("keyup",h,!0),r}return t})}])});
\ No newline at end of file
--- /dev/null
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.16.1
+ * @date 2016-04-18
+ *
+ * @license
+ * Copyright (C) 2011-2016 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vis=t():e.vis=t()}(this,function(){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){t.util=i(1),t.DOMutil=i(7),t.DataSet=i(8),t.DataView=i(10),t.Queue=i(9),t.Network=i(11),t.network={Images:i(12),dotparser:i(77),gephiParser:i(78),allOptions:i(72)},t.network.convertDot=function(e){return t.network.dotparser.DOTToGraph(e)},t.network.convertGephi=function(e,i){return t.network.gephiParser.parseGephi(e,i)},t.moment=i(2),t.Hammer=i(58),t.keycharm=i(65)},function(e,t,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=i(2),s=i(6);t.isNumber=function(e){return e instanceof Number||"number"==typeof e},t.recursiveDOMDelete=function(e){if(e)for(;e.hasChildNodes()===!0;)t.recursiveDOMDelete(e.firstChild),e.removeChild(e.firstChild)},t.giveRange=function(e,t,i,o){if(t==e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)},t.isString=function(e){return e instanceof String||"string"==typeof e},t.isDate=function(e){if(e instanceof Date)return!0;if(t.isString(e)){var i=r.exec(e);if(i)return!0;if(!isNaN(Date.parse(e)))return!0}return!1},t.randomUUID=function(){return s.v4()},t.assignAllKeys=function(e,t){for(var i in e)e.hasOwnProperty(i)&&"object"!==o(e[i])&&(e[i]=t)},t.fillIfDefined=function(e,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var s in e)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===e[s]||n!==!0?e[s]=i[s]:delete e[s]:"object"===o(e[s])&&t.fillIfDefined(e[s],i[s],n))},t.protoExtend=function(e,t){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)e[n]=o[n]}return e},t.extend=function(e,t){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n])}return e},t.selectiveExtend=function(e,t,i){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var o=2;o<arguments.length;o++)for(var n=arguments[o],s=0;s<e.length;s++){var r=e[s];n.hasOwnProperty(r)&&(t[r]=n[r])}return t},t.selectiveDeepExtend=function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var r=arguments[s],a=0;a<e.length;a++){var h=e[a];if(r.hasOwnProperty(h))if(o[h]&&o[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?t.deepExtend(i[h],o[h],!1,n):null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h];else{if(Array.isArray(o[h]))throw new TypeError("Arrays are not supported by deepExtend");null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h]}}return i},t.selectiveNotDeepExtend=function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&-1==e.indexOf(s))if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?t.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r<o[s].length;r++)i[s].push(o[s][r])}else null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];return i},t.deepExtend=function(e,i,o,n){for(var s in i)if(i.hasOwnProperty(s)||o===!0)if(i[s]&&i[s].constructor===Object)void 0===e[s]&&(e[s]={}),e[s].constructor===Object?t.deepExtend(e[s],i[s],o):null===i[s]&&void 0!==e[s]&&n===!0?delete e[s]:e[s]=i[s];else if(Array.isArray(i[s])){e[s]=[];for(var r=0;r<i[s].length;r++)e[s].push(i[s][r])}else null===i[s]&&void 0!==e[s]&&n===!0?delete e[s]:e[s]=i[s];return e},t.equalArray=function(e,t){if(e.length!=t.length)return!1;for(var i=0,o=e.length;o>i;i++)if(e[i]!=t[i])return!1;return!0},t.convert=function(e,i){var o;if(void 0!==e){if(null===e)return null;if(!i)return e;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(e);case"number":case"Number":return Number(e.valueOf());case"string":case"String":return String(e);case"Date":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(n.isMoment(e))return new Date(e.valueOf());if(t.isString(e))return o=r.exec(e),o?new Date(Number(o[1])):n(e).toDate();throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"Moment":if(t.isNumber(e))return n(e);if(e instanceof Date)return n(e.valueOf());if(n.isMoment(e))return n(e);if(t.isString(e))return o=r.exec(e),n(o?Number(o[1]):e);throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"ISODate":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(n.isMoment(e))return e.toDate().toISOString();if(t.isString(e))return o=r.exec(e),o?new Date(Number(o[1])).toISOString():new Date(e).toISOString();throw new Error("Cannot convert object of type "+t.getType(e)+" to type ISODate");case"ASPDate":if(t.isNumber(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(t.isString(e)){o=r.exec(e);var s;return s=o?new Date(Number(o[1])).valueOf():new Date(e).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+t.getType(e)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var r=/^\/?Date\((\-?\d+)/i;t.getType=function(e){var t="undefined"==typeof e?"undefined":o(e);return"object"==t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"==t?"Number":"boolean"==t?"Boolean":"string"==t?"String":void 0===t?"undefined":t},t.copyAndExtendArray=function(e,t){for(var i=[],o=0;o<e.length;o++)i.push(e[o]);return i.push(t),i},t.copyArray=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},t.getAbsoluteLeft=function(e){return e.getBoundingClientRect().left},t.getAbsoluteRight=function(e){return e.getBoundingClientRect().right},t.getAbsoluteTop=function(e){return e.getBoundingClientRect().top},t.addClassName=function(e,t){var i=e.className.split(" ");-1==i.indexOf(t)&&(i.push(t),e.className=i.join(" "))},t.removeClassName=function(e,t){var i=e.className.split(" "),o=i.indexOf(t);-1!=o&&(i.splice(o,1),e.className=i.join(" "))},t.forEach=function(e,t){var i,o;if(Array.isArray(e))for(i=0,o=e.length;o>i;i++)t(e[i],i,e);else for(i in e)e.hasOwnProperty(i)&&t(e[i],i,e)},t.toArray=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(e[i]);return t},t.updateProperty=function(e,t,i){return e[t]!==i?(e[t]=i,!0):!1},t.throttle=function(e,t){var i=null,o=!1;return function n(){i?o=!0:(o=!1,e(),i=setTimeout(function(){i=null,o&&n()},t))}},t.addEventListener=function(e,t,i,o){e.addEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.addEventListener(t,i,o)):e.attachEvent("on"+t,i)},t.removeEventListener=function(e,t,i,o){e.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.removeEventListener(t,i,o)):e.detachEvent("on"+t,i)},t.preventDefault=function(e){e||(e=window.event),e.preventDefault?e.preventDefault():e.returnValue=!1},t.getTarget=function(e){e||(e=window.event);var t;return e.target?t=e.target:e.srcElement&&(t=e.srcElement),void 0!=t.nodeType&&3==t.nodeType&&(t=t.parentNode),t},t.hasParent=function(e,t){for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1},t.option={},t.option.asBoolean=function(e,t){return"function"==typeof e&&(e=e()),null!=e?0!=e:t||null},t.option.asNumber=function(e,t){return"function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null},t.option.asString=function(e,t){return"function"==typeof e&&(e=e()),null!=e?String(e):t||null},t.option.asSize=function(e,i){return"function"==typeof e&&(e=e()),t.isString(e)?e:t.isNumber(e)?e+"px":i||null},t.option.asElement=function(e,t){return"function"==typeof e&&(e=e()),e||t||null},t.hexToRGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,i,o){return t+t+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},t.overrideOpacity=function(e,i){if(-1!=e.indexOf("rgba"))return e;if(-1!=e.indexOf("rgb")){var o=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=t.hexToRGB(e);return null==o?e:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},t.RGBToHex=function(e,t,i){return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},t.parseColor=function(e){var i;if(t.isString(e)===!0){if(t.isValidRGB(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",").map(function(e){return parseInt(e)});e=t.RGBToHex(o[0],o[1],o[2])}if(t.isValidHex(e)===!0){var n=t.hexToHSV(e),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=t.HSVToHex(r.h,r.s,r.v),h=t.HSVToHex(s.h,s.s,s.v);i={background:e,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else i={},i.background=e.background||void 0,i.border=e.border||void 0,t.isString(e.highlight)?i.highlight={border:e.highlight,background:e.highlight}:(i.highlight={},i.highlight.background=e.highlight&&e.highlight.background||void 0,i.highlight.border=e.highlight&&e.highlight.border||void 0),t.isString(e.hover)?i.hover={border:e.hover,background:e.hover}:(i.hover={},i.hover.background=e.hover&&e.hover.background||void 0,i.hover.border=e.hover&&e.hover.border||void 0);return i},t.RGBToHSV=function(e,t,i){e/=255,t/=255,i/=255;var o=Math.min(e,Math.min(t,i)),n=Math.max(e,Math.max(t,i));if(o==n)return{h:0,s:0,v:o};var s=e==o?t-i:i==o?e-t:i-e,r=e==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var i=e.split(":"),o=i[0].trim(),n=i[1].trim();t[o]=n}}),t},join:function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join("; ")}};t.addCssText=function(e,i){var o=a.split(e.style.cssText),n=a.split(i),s=t.extend(o,n);e.style.cssText=a.join(s)},t.removeCssText=function(e,t){var i=a.split(e.style.cssText),o=a.split(t);for(var n in o)o.hasOwnProperty(n)&&delete i[n];e.style.cssText=a.join(i)},t.HSVToRGB=function(e,t,i){var o,n,s,r=Math.floor(6*e),a=6*e-r,h=i*(1-t),d=i*(1-a*t),l=i*(1-(1-a)*t);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},t.HSVToHex=function(e,i,o){var n=t.HSVToRGB(e,i,o);return t.RGBToHex(n.r,n.g,n.b)},t.hexToHSV=function(e){var i=t.hexToRGB(e);return t.RGBToHSV(i.r,i.g,i.b)},t.isValidHex=function(e){var t=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return t},t.isValidRGB=function(e){e=e.replace(" ","");var t=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e);return t},t.isValidRGBA=function(e){e=e.replace(" ","");var t=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(e);return t},t.selectiveBridgeObject=function(e,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s<e.length;s++)i.hasOwnProperty(e[s])&&"object"==o(i[e[s]])&&(n[e[s]]=t.bridgeObject(i[e[s]]));return n}return null},t.bridgeObject=function(e){if("object"==("undefined"==typeof e?"undefined":o(e))){var i=Object.create(e);for(var n in e)e.hasOwnProperty(n)&&"object"==o(e[n])&&(i[n]=t.bridgeObject(e[n]));return i}return null},t.insertSort=function(e,t){for(var i=0;i<e.length;i++){for(var o=e[i],n=i;n>0&&t(o,e[n-1])<0;n--)e[n]=e[n-1];e[n]=o}return e},t.mergeOptions=function(e,t,i){var o=(arguments.length<=3||void 0===arguments[3]?!1:arguments[3],arguments.length<=4||void 0===arguments[4]?{}:arguments[4]);if(null===t[i])e[i]=Object.create(o[i]);else if(void 0!==t[i])if("boolean"==typeof t[i])e[i].enabled=t[i];else{void 0===t[i].enabled&&(e[i].enabled=!0);for(var n in t[i])t[i].hasOwnProperty(n)&&(e[i][n]=t[i][n])}},t.binarySearchCustom=function(e,t,i,o){for(var n=1e4,s=0,r=0,a=e.length-1;a>=r&&n>s;){var h=Math.floor((r+a)/2),d=e[h],l=void 0===o?d[i]:d[i][o],c=t(l);if(0==c)return h;-1==c?r=h+1:a=h-1,s++}return-1},t.binarySearchValue=function(e,t,i,o,n){for(var s,r,a,h,d=1e4,l=0,c=0,u=e.length-1,n=void 0!=n?n:function(e,t){return e==t?0:t>e?-1:1};u>=c&&d>l;){if(h=Math.floor(.5*(u+c)),s=e[Math.max(0,h-1)][i],r=e[h][i],a=e[Math.min(e.length-1,h+1)][i],0==n(r,t))return h;if(n(s,t)<0&&n(r,t)>0)return"before"==o?Math.max(0,h-1):h;if(n(r,t)<0&&n(a,t)>0)return"before"==o?h:Math.min(e.length-1,h+1);n(r,t)<0?c=h+1:u=h-1,l++}return-1},t.easingFunctions={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return.5>e?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return.5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return.5>e?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return.5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e}}},function(e,t,i){e.exports="undefined"!=typeof window&&window.moment||i(3)},function(e,t,i){(function(e){!function(t,i){e.exports=i()}(this,function(){function t(){return ro.apply(null,arguments)}function i(e){ro=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var i,o=[];for(i=0;i<e.length;++i)o.push(t(e[i],i));return o}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){for(var i in t)r(t,i)&&(e[i]=t[i]);return r(t,"toString")&&(e.toString=t.toString),r(t,"valueOf")&&(e.valueOf=t.valueOf),e}function h(e,t,i,o){return Ne(e,t,i,o,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(e){return null==e._pf&&(e._pf=d()),e._pf}function c(e){if(null==e._isValid){var t=l(e),i=ao.call(t.parsedDateParts,function(e){return null!=e});e._isValid=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i),e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function u(e){var t=h(NaN);return null!=e?a(l(t),e):l(t).userInvalidated=!0,t}function f(e){return void 0===e}function p(e,t){var i,o,n;if(f(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),f(t._i)||(e._i=t._i),f(t._f)||(e._f=t._f),f(t._l)||(e._l=t._l),f(t._strict)||(e._strict=t._strict),f(t._tzm)||(e._tzm=t._tzm),f(t._isUTC)||(e._isUTC=t._isUTC),f(t._offset)||(e._offset=t._offset),f(t._pf)||(e._pf=l(t)),f(t._locale)||(e._locale=t._locale),ho.length>0)for(i in ho)o=ho[i],n=t[o],f(n)||(e[o]=n);return e}function v(e){p(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),lo===!1&&(lo=!0,t.updateOffset(this),lo=!1)}function y(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function g(e){return 0>e?Math.ceil(e):Math.floor(e)}function b(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=g(t)),i}function m(e,t,i){var o,n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(o=0;n>o;o++)(i&&e[o]!==t[o]||!i&&b(e[o])!==b(t[o]))&&r++;return r+s}function _(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,i){var o=!0;return a(function(){return null!=t.deprecationHandler&&t.deprecationHandler(null,e),o&&(_(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),o=!1),i.apply(this,arguments)},i)}function k(e,i){null!=t.deprecationHandler&&t.deprecationHandler(e,i),co[e]||(_(i),co[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){var t,i;for(i in e)t=e[i],x(t)?this[i]=t:this["_"+i]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function M(e,t){var i,o=a({},e);for(i in t)r(t,i)&&(O(e[i])&&O(t[i])?(o[i]={},a(o[i],e[i]),a(o[i],t[i])):null!=t[i]?o[i]=t[i]:delete o[i]);return o}function D(e){null!=e&&this.set(e)}function S(e){return e?e.toLowerCase().replace("_","-"):e}function C(e){for(var t,i,o,n,s=0;s<e.length;){for(n=S(e[s]).split("-"),t=n.length,i=S(e[s+1]),i=i?i.split("-"):null;t>0;){if(o=T(n.slice(0,t).join("-")))return o;if(i&&i.length>=t&&m(n,i,!0)>=t-1)break;t--}s++}return null}function T(t){var i=null;if(!vo[t]&&"undefined"!=typeof e&&e&&e.exports)try{i=fo._abbr,!function(){var e=new Error('Cannot find module "./locale"');throw e.code="MODULE_NOT_FOUND",e}(),P(i)}catch(o){}return vo[t]}function P(e,t){var i;return e&&(i=f(t)?I(e):B(e,t),i&&(fo=i)),fo._abbr}function B(e,t){return null!==t?(t.abbr=e,null!=vo[e]?(k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),t=M(vo[e]._config,t)):null!=t.parentLocale&&(null!=vo[t.parentLocale]?t=M(vo[t.parentLocale]._config,t):k("parentLocaleUndefined","specified parentLocale is not defined yet")),vo[e]=new D(t),P(e),vo[e]):(delete vo[e],null)}function F(e,t){if(null!=t){var i;null!=vo[e]&&(t=M(vo[e]._config,t)),i=new D(t),i.parentLocale=vo[e],vo[e]=i,P(e)}else null!=vo[e]&&(null!=vo[e].parentLocale?vo[e]=vo[e].parentLocale:null!=vo[e]&&delete vo[e]);return vo[e]}function I(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return fo;if(!o(e)){if(t=T(e))return t;e=[e]}return C(e)}function j(){return uo(vo)}function N(e,t){var i=e.toLowerCase();yo[i]=yo[i+"s"]=yo[t]=e}function z(e){return"string"==typeof e?yo[e]||yo[e.toLowerCase()]:void 0}function R(e){var t,i,o={};for(i in e)r(e,i)&&(t=z(i),t&&(o[t]=e[i]));return o}function A(e,i){return function(o){return null!=o?(H(this,e,o),t.updateOffset(this,i),this):L(this,e)}}function L(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function H(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function W(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(e=z(e),x(this[e]))return this[e](t);return this}function Y(e,t,i){var o=""+Math.abs(e),n=t-o.length,s=e>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function U(e,t,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),e&&(_o[e]=n),t&&(_o[t[0]]=function(){return Y(n.apply(this,arguments),t[1],t[2])}),i&&(_o[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function q(e){var t,i,o=e.match(go);for(t=0,i=o.length;i>t;t++)_o[o[t]]?o[t]=_o[o[t]]:o[t]=V(o[t]);return function(t){var n,s="";for(n=0;i>n;n++)s+=o[n]instanceof Function?o[n].call(t,e):o[n];return s}}function G(e,t){return e.isValid()?(t=X(t,e.localeData()),mo[t]=mo[t]||q(t),mo[t](e)):e.localeData().invalidDate()}function X(e,t){function i(e){return t.longDateFormat(e)||e}var o=5;for(bo.lastIndex=0;o>=0&&bo.test(e);)e=e.replace(bo,i),bo.lastIndex=0,o-=1;return e}function K(e,t,i){Ro[e]=x(t)?t:function(e,o){return e&&i?i:t}}function Z(e,t){return r(Ro,e)?Ro[e](t._strict,t._locale):new RegExp(Q(e))}function Q(e){return J(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,o,n){return t||i||o||n}))}function J(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(e,t){var i,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,i){i[t]=b(e)}),i=0;i<e.length;i++)Ao[e[i]]=o}function ee(e,t){$(e,function(e,i,o,n){o._w=o._w||{},t(e,o._w,o,n)})}function te(e,t,i){null!=t&&r(Ao,e)&&Ao[e](t,i._a,i,e)}function ie(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function oe(e,t){return o(this._months)?this._months[e.month()]:this._months[Ko.test(t)?"format":"standalone"][e.month()]}function ne(e,t){return o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ko.test(t)?"format":"standalone"][e.month()]}function se(e,t,i){var o,n,s,r=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;12>o;++o)s=h([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?(n=po.call(this._shortMonthsParse,r),-1!==n?n:null):(n=po.call(this._longMonthsParse,r),-1!==n?n:null):"MMM"===t?(n=po.call(this._shortMonthsParse,r),-1!==n?n:(n=po.call(this._longMonthsParse,r),-1!==n?n:null)):(n=po.call(this._longMonthsParse,r),-1!==n?n:(n=po.call(this._shortMonthsParse,r),-1!==n?n:null))}function re(e,t,i){var o,n,s;if(this._monthsParseExact)return se.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;12>o;o++){if(n=h([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(i&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!i&&this._monthsParse[o].test(e))return o}}function ae(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=b(t);else if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return i=Math.min(e.date(),ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function he(e){return null!=e?(ae(this,e),t.updateOffset(this,!0),this):L(this,"Month")}function de(){return ie(this.year(),this.month())}function le(e){return this._monthsParseExact?(r(this,"_monthsRegex")||ue.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function ce(e){return this._monthsParseExact?(r(this,"_monthsRegex")||ue.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ue(){function e(e,t){return t.length-e.length}var t,i,o=[],n=[],s=[];for(t=0;12>t;t++)i=h([2e3,t]),o.push(this.monthsShort(i,"")),n.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(o.sort(e),n.sort(e),s.sort(e),t=0;12>t;t++)o[t]=J(o[t]),n[t]=J(n[t]),s[t]=J(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function fe(e){var t,i=e._a;return i&&-2===l(e).overflow&&(t=i[Ho]<0||i[Ho]>11?Ho:i[Wo]<1||i[Wo]>ie(i[Lo],i[Ho])?Wo:i[Yo]<0||i[Yo]>24||24===i[Yo]&&(0!==i[Uo]||0!==i[Vo]||0!==i[qo])?Yo:i[Uo]<0||i[Uo]>59?Uo:i[Vo]<0||i[Vo]>59?Vo:i[qo]<0||i[qo]>999?qo:-1,l(e)._overflowDayOfYear&&(Lo>t||t>Wo)&&(t=Wo),l(e)._overflowWeeks&&-1===t&&(t=Go),l(e)._overflowWeekday&&-1===t&&(t=Xo),l(e).overflow=t),e}function pe(e){var t,i,o,n,s,r,a=e._i,h=en.exec(a)||tn.exec(a);if(h){for(l(e).iso=!0,t=0,i=nn.length;i>t;t++)if(nn[t][1].exec(h[1])){n=nn[t][0],o=nn[t][2]!==!1;break}if(null==n)return void(e._isValid=!1);if(h[3]){for(t=0,i=sn.length;i>t;t++)if(sn[t][1].exec(h[3])){s=(h[2]||" ")+sn[t][0];break}if(null==s)return void(e._isValid=!1)}if(!o&&null!=s)return void(e._isValid=!1);if(h[4]){if(!on.exec(h[4]))return void(e._isValid=!1);r="Z"}e._f=n+(s||"")+(r||""),Ce(e)}else e._isValid=!1}function ve(e){var i=rn.exec(e._i);return null!==i?void(e._d=new Date(+i[1])):(pe(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function ye(e,t,i,o,n,s,r){var a=new Date(e,t,i,o,n,s,r);return 100>e&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function ge(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function be(e){return me(e)?366:365}function me(e){return e%4===0&&e%100!==0||e%400===0}function _e(){return me(this.year())}function we(e,t,i){var o=7+t-i,n=(7+ge(e,0,o).getUTCDay()-t)%7;return-n+o-1}function ke(e,t,i,o,n){var s,r,a=(7+i-o)%7,h=we(e,o,n),d=1+7*(t-1)+a+h;return 0>=d?(s=e-1,r=be(s)+d):d>be(e)?(s=e+1,r=d-be(e)):(s=e,r=d),{year:s,dayOfYear:r}}function xe(e,t,i){var o,n,s=we(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return 1>r?(n=e.year()-1,o=r+Oe(n,t,i)):r>Oe(e.year(),t,i)?(o=r-Oe(e.year(),t,i),n=e.year()+1):(n=e.year(),o=r),{week:o,year:n}}function Oe(e,t,i){var o=we(e,t,i),n=we(e+1,t,i);return(be(e)-o+n)/7}function Ee(e,t,i){return null!=e?e:null!=t?t:i}function Me(e){var i=new Date(t.now());return e._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function De(e){var t,i,o,n,s=[];if(!e._d){for(o=Me(e),e._w&&null==e._a[Wo]&&null==e._a[Ho]&&Se(e),e._dayOfYear&&(n=Ee(e._a[Lo],o[Lo]),e._dayOfYear>be(n)&&(l(e)._overflowDayOfYear=!0),i=ge(n,0,e._dayOfYear),e._a[Ho]=i.getUTCMonth(),e._a[Wo]=i.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=s[t]=o[t];for(;7>t;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Yo]&&0===e._a[Uo]&&0===e._a[Vo]&&0===e._a[qo]&&(e._nextDay=!0,e._a[Yo]=0),e._d=(e._useUTC?ge:ye).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Yo]=24)}}function Se(e){var t,i,o,n,s,r,a,h;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(s=1,r=4,i=Ee(t.GG,e._a[Lo],xe(ze(),1,4).year),o=Ee(t.W,1),n=Ee(t.E,1),(1>n||n>7)&&(h=!0)):(s=e._locale._week.dow,r=e._locale._week.doy,i=Ee(t.gg,e._a[Lo],xe(ze(),s,r).year),o=Ee(t.w,1),null!=t.d?(n=t.d,(0>n||n>6)&&(h=!0)):null!=t.e?(n=t.e+s,(t.e<0||t.e>6)&&(h=!0)):n=s),1>o||o>Oe(i,s,r)?l(e)._overflowWeeks=!0:null!=h?l(e)._overflowWeekday=!0:(a=ke(i,o,n,s,r),e._a[Lo]=a.year,e._dayOfYear=a.dayOfYear)}function Ce(e){if(e._f===t.ISO_8601)return void pe(e);e._a=[],l(e).empty=!0;var i,o,n,s,r,a=""+e._i,h=a.length,d=0;for(n=X(e._f,e._locale).match(go)||[],i=0;i<n.length;i++)s=n[i],o=(a.match(Z(s,e))||[])[0],o&&(r=a.substr(0,a.indexOf(o)),r.length>0&&l(e).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),_o[s]?(o?l(e).empty=!1:l(e).unusedTokens.push(s),te(s,o,e)):e._strict&&!o&&l(e).unusedTokens.push(s);l(e).charsLeftOver=h-d,a.length>0&&l(e).unusedInput.push(a),l(e).bigHour===!0&&e._a[Yo]<=12&&e._a[Yo]>0&&(l(e).bigHour=void 0),l(e).parsedDateParts=e._a.slice(0),l(e).meridiem=e._meridiem,e._a[Yo]=Te(e._locale,e._a[Yo],e._meridiem),De(e),fe(e)}function Te(e,t,i){var o;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(o=e.isPM(i),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Pe(e){var t,i,o,n,s;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;n<e._f.length;n++)s=0,t=p({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[n],Ce(t),c(t)&&(s+=l(t).charsLeftOver,s+=10*l(t).unusedTokens.length,l(t).score=s,(null==o||o>s)&&(o=s,i=t));a(e,i||t)}function Be(e){if(!e._d){var t=R(e._i);e._a=s([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),De(e)}}function Fe(e){var t=new v(fe(Ie(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ie(e){var t=e._i,i=e._f;return e._locale=e._locale||I(e._l),null===t||void 0===i&&""===t?u({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),y(t)?new v(fe(t)):(o(i)?Pe(e):i?Ce(e):n(t)?e._d=t:je(e),c(e)||(e._d=null),e))}function je(e){var i=e._i;void 0===i?e._d=new Date(t.now()):n(i)?e._d=new Date(i.valueOf()):"string"==typeof i?ve(e):o(i)?(e._a=s(i.slice(0),function(e){return parseInt(e,10)}),De(e)):"object"==typeof i?Be(e):"number"==typeof i?e._d=new Date(i):t.createFromInputFallback(e)}function Ne(e,t,i,o,n){var s={};return"boolean"==typeof i&&(o=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=i,s._i=e,s._f=t,s._strict=o,Fe(s)}function ze(e,t,i,o){return Ne(e,t,i,o,!1)}function Re(e,t){var i,n;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return ze();for(i=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](i)||(i=t[n]);return i}function Ae(){var e=[].slice.call(arguments,0);return Re("isBefore",e)}function Le(){var e=[].slice.call(arguments,0);return Re("isAfter",e)}function He(e){var t=R(e),i=t.year||0,o=t.quarter||0,n=t.month||0,s=t.week||0,r=t.day||0,a=t.hour||0,h=t.minute||0,d=t.second||0,l=t.millisecond||0;this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+n+3*o+12*i,this._data={},this._locale=I(),this._bubble()}function We(e){return e instanceof He}function Ye(e,t){U(e,0,0,function(){var e=this.utcOffset(),i="+";return 0>e&&(e=-e,i="-"),i+Y(~~(e/60),2)+t+Y(~~e%60,2)})}function Ue(e,t){var i=(t||"").match(e)||[],o=i[i.length-1]||[],n=(o+"").match(cn)||["-",0,0],s=+(60*n[1])+b(n[2]);return"+"===n[0]?s:-s}function Ve(e,i){var o,s;return i._isUTC?(o=i.clone(),s=(y(e)||n(e)?e.valueOf():ze(e).valueOf())-o.valueOf(),o._d.setTime(o._d.valueOf()+s),t.updateOffset(o,!1),o):ze(e).local()}function qe(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ge(e,i){var o,n=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Ue(jo,e):Math.abs(e)<16&&(e=60*e),!this._isUTC&&i&&(o=qe(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),n!==e&&(!i||this._changeInProgress?lt(this,nt(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?n:qe(this):null!=e?this:NaN}function Xe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ke(e){return this.utcOffset(0,e)}function Ze(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(qe(this),"m")),this}function Qe(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ue(Io,this._i)),this}function Je(e){return this.isValid()?(e=e?ze(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function $e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function et(){if(!f(this._isDSTShifted))return this._isDSTShifted;var e={};if(p(e,this),e=Ie(e),e._a){var t=e._isUTC?h(e._a):ze(e._a);this._isDSTShifted=this.isValid()&&m(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function tt(){return this.isValid()?!this._isUTC:!1}function it(){return this.isValid()?this._isUTC:!1}function ot(){return this.isValid()?this._isUTC&&0===this._offset:!1}function nt(e,t){var i,o,n,s=e,a=null;return We(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(a=un.exec(e))?(i="-"===a[1]?-1:1,s={y:0,d:b(a[Wo])*i,h:b(a[Yo])*i,m:b(a[Uo])*i,s:b(a[Vo])*i,ms:b(a[qo])*i}):(a=fn.exec(e))?(i="-"===a[1]?-1:1,s={y:st(a[2],i),M:st(a[3],i),w:st(a[4],i),d:st(a[5],i),h:st(a[6],i),m:st(a[7],i),s:st(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=at(ze(s.from),ze(s.to)),s={},
+s.ms=n.milliseconds,s.M=n.months),o=new He(s),We(e)&&r(e,"_locale")&&(o._locale=e._locale),o}function st(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function rt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function at(e,t){var i;return e.isValid()&&t.isValid()?(t=Ve(t,e),e.isBefore(t)?i=rt(e,t):(i=rt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ht(e){return 0>e?-1*Math.round(-1*e):Math.round(e)}function dt(e,t){return function(i,o){var n,s;return null===o||isNaN(+o)||(k(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=nt(i,o),lt(this,n,e),this}}function lt(e,i,o,n){var s=i._milliseconds,r=ht(i._days),a=ht(i._months);e.isValid()&&(n=null==n?!0:n,s&&e._d.setTime(e._d.valueOf()+s*o),r&&H(e,"Date",L(e,"Date")+r*o),a&&ae(e,L(e,"Month")+a*o),n&&t.updateOffset(e,r||a))}function ct(e,t){var i=e||ze(),o=Ve(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse",r=t&&(x(t[s])?t[s]():t[s]);return this.format(r||this.localeData().calendar(s,this,ze(i)))}function ut(){return new v(this)}function ft(e,t){var i=y(e)?e:ze(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()):!1}function pt(e,t){var i=y(e)?e:ze(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()):!1}function vt(e,t,i,o){return o=o||"()",("("===o[0]?this.isAfter(e,i):!this.isBefore(e,i))&&(")"===o[1]?this.isBefore(t,i):!this.isAfter(t,i))}function yt(e,t){var i,o=y(e)?e:ze(e);return this.isValid()&&o.isValid()?(t=z(t||"millisecond"),"millisecond"===t?this.valueOf()===o.valueOf():(i=o.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())):!1}function gt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function bt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function mt(e,t,i){var o,n,s,r;return this.isValid()?(o=Ve(e,this),o.isValid()?(n=6e4*(o.utcOffset()-this.utcOffset()),t=z(t),"year"===t||"month"===t||"quarter"===t?(r=_t(this,o),"quarter"===t?r/=3:"year"===t&&(r/=12)):(s=this-o,r="second"===t?s/1e3:"minute"===t?s/6e4:"hour"===t?s/36e5:"day"===t?(s-n)/864e5:"week"===t?(s-n)/6048e5:s),i?r:g(r)):NaN):NaN}function _t(e,t){var i,o,n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return 0>t-s?(i=e.clone().add(n-1,"months"),o=(t-s)/(s-i)):(i=e.clone().add(n+1,"months"),o=(t-s)/(i-s)),-(n+o)||0}function wt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function kt(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?x(Date.prototype.toISOString)?this.toDate().toISOString():G(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):G(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function xt(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=G(this,e);return this.localeData().postformat(i)}function Ot(e,t){return this.isValid()&&(y(e)&&e.isValid()||ze(e).isValid())?nt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Et(e){return this.from(ze(),e)}function Mt(e,t){return this.isValid()&&(y(e)&&e.isValid()||ze(e).isValid())?nt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Dt(e){return this.to(ze(),e)}function St(e){var t;return void 0===e?this._locale._abbr:(t=I(e),null!=t&&(this._locale=t),this)}function Ct(){return this._locale}function Tt(e){switch(e=z(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Pt(e){return e=z(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function Bt(){return this._d.valueOf()-6e4*(this._offset||0)}function Ft(){return Math.floor(this.valueOf()/1e3)}function It(){return this._offset?new Date(this.valueOf()):this._d}function jt(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Nt(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function zt(){return this.isValid()?this.toISOString():null}function Rt(){return c(this)}function At(){return a({},l(this))}function Lt(){return l(this).overflow}function Ht(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Wt(e,t){U(0,[e,e.length],0,t)}function Yt(e){return Gt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ut(e){return Gt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Vt(){return Oe(this.year(),1,4)}function qt(){var e=this.localeData()._week;return Oe(this.year(),e.dow,e.doy)}function Gt(e,t,i,o,n){var s;return null==e?xe(this,o,n).year:(s=Oe(e,o,n),t>s&&(t=s),Xt.call(this,e,t,i,o,n))}function Xt(e,t,i,o,n){var s=ke(e,t,i,o,n),r=ge(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Kt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Zt(e){return xe(e,this._week.dow,this._week.doy).week}function Qt(){return this._week.dow}function Jt(){return this._week.doy}function $t(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function ei(e){var t=xe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ti(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function ii(e,t){return o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function oi(e){return this._weekdaysShort[e.day()]}function ni(e){return this._weekdaysMin[e.day()]}function si(e,t,i){var o,n,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;7>o;++o)s=h([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?(n=po.call(this._weekdaysParse,r),-1!==n?n:null):"ddd"===t?(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:null):(n=po.call(this._minWeekdaysParse,r),-1!==n?n:null):"dddd"===t?(n=po.call(this._weekdaysParse,r),-1!==n?n:(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:(n=po.call(this._minWeekdaysParse,r),-1!==n?n:null))):"ddd"===t?(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:(n=po.call(this._weekdaysParse,r),-1!==n?n:(n=po.call(this._minWeekdaysParse,r),-1!==n?n:null))):(n=po.call(this._minWeekdaysParse,r),-1!==n?n:(n=po.call(this._weekdaysParse,r),-1!==n?n:(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:null)))}function ri(e,t,i){var o,n,s;if(this._weekdaysParseExact)return si.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(n=h([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(i&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(i&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!i&&this._weekdaysParse[o].test(e))return o}}function ai(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=ti(e,this.localeData()),this.add(e-t,"d")):t}function hi(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function di(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function li(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||fi.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex}function ci(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||fi.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ui(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||fi.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function fi(){function e(e,t){return t.length-e.length}var t,i,o,n,s,r=[],a=[],d=[],l=[];for(t=0;7>t;t++)i=h([2e3,1]).day(t),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),d.push(s),l.push(o),l.push(n),l.push(s);for(r.sort(e),a.sort(e),d.sort(e),l.sort(e),t=0;7>t;t++)a[t]=J(a[t]),d[t]=J(d[t]),l[t]=J(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function pi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function vi(){return this.hours()%12||12}function yi(){return this.hours()||24}function gi(e,t){U(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function bi(e,t){return t._meridiemParse}function mi(e){return"p"===(e+"").toLowerCase().charAt(0)}function _i(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function wi(e,t){t[qo]=b(1e3*("0."+e))}function ki(){return this._isUTC?"UTC":""}function xi(){return this._isUTC?"Coordinated Universal Time":""}function Oi(e){return ze(1e3*e)}function Ei(){return ze.apply(null,arguments).parseZone()}function Mi(e,t,i){var o=this._calendar[e];return x(o)?o.call(t,i):o}function Di(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function Si(){return this._invalidDate}function Ci(e){return this._ordinal.replace("%d",e)}function Ti(e){return e}function Pi(e,t,i,o){var n=this._relativeTime[i];return x(n)?n(e,t,i,o):n.replace(/%d/i,e)}function Bi(e,t){var i=this._relativeTime[e>0?"future":"past"];return x(i)?i(t):i.replace(/%s/i,t)}function Fi(e,t,i,o){var n=I(),s=h().set(o,t);return n[i](s,e)}function Ii(e,t,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Fi(e,t,i,"month");var o,n=[];for(o=0;12>o;o++)n[o]=Fi(e,o,i,"month");return n}function ji(e,t,i,o){"boolean"==typeof e?("number"==typeof t&&(i=t,t=void 0),t=t||""):(t=e,i=t,e=!1,"number"==typeof t&&(i=t,t=void 0),t=t||"");var n=I(),s=e?n._week.dow:0;if(null!=i)return Fi(t,(i+s)%7,o,"day");var r,a=[];for(r=0;7>r;r++)a[r]=Fi(t,(r+s)%7,o,"day");return a}function Ni(e,t){return Ii(e,t,"months")}function zi(e,t){return Ii(e,t,"monthsShort")}function Ri(e,t,i){return ji(e,t,i,"weekdays")}function Ai(e,t,i){return ji(e,t,i,"weekdaysShort")}function Li(e,t,i){return ji(e,t,i,"weekdaysMin")}function Hi(){var e=this._data;return this._milliseconds=Ln(this._milliseconds),this._days=Ln(this._days),this._months=Ln(this._months),e.milliseconds=Ln(e.milliseconds),e.seconds=Ln(e.seconds),e.minutes=Ln(e.minutes),e.hours=Ln(e.hours),e.months=Ln(e.months),e.years=Ln(e.years),this}function Wi(e,t,i,o){var n=nt(t,i);return e._milliseconds+=o*n._milliseconds,e._days+=o*n._days,e._months+=o*n._months,e._bubble()}function Yi(e,t){return Wi(this,e,t,1)}function Ui(e,t){return Wi(this,e,t,-1)}function Vi(e){return 0>e?Math.floor(e):Math.ceil(e)}function qi(){var e,t,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||0>=s&&0>=r&&0>=a||(s+=864e5*Vi(Xi(a)+r),r=0,a=0),h.milliseconds=s%1e3,e=g(s/1e3),h.seconds=e%60,t=g(e/60),h.minutes=t%60,i=g(t/60),h.hours=i%24,r+=g(i/24),n=g(Gi(r)),a+=n,r-=Vi(Xi(n)),o=g(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function Gi(e){return 4800*e/146097}function Xi(e){return 146097*e/4800}function Ki(e){var t,i,o=this._milliseconds;if(e=z(e),"month"===e||"year"===e)return t=this._days+o/864e5,i=this._months+Gi(t),"month"===e?i:i/12;switch(t=this._days+Math.round(Xi(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Zi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12)}function Qi(e){return function(){return this.as(e)}}function Ji(e){return e=z(e),this[e+"s"]()}function $i(e){return function(){return this._data[e]}}function eo(){return g(this.days()/7)}function to(e,t,i,o,n){return n.relativeTime(t||1,!!i,e,o)}function io(e,t,i){var o=nt(e).abs(),n=is(o.as("s")),s=is(o.as("m")),r=is(o.as("h")),a=is(o.as("d")),h=is(o.as("M")),d=is(o.as("y")),l=n<os.s&&["s",n]||1>=s&&["m"]||s<os.m&&["mm",s]||1>=r&&["h"]||r<os.h&&["hh",r]||1>=a&&["d"]||a<os.d&&["dd",a]||1>=h&&["M"]||h<os.M&&["MM",h]||1>=d&&["y"]||["yy",d];return l[2]=t,l[3]=+e>0,l[4]=i,to.apply(null,l)}function oo(e,t){return void 0===os[e]?!1:void 0===t?os[e]:(os[e]=t,!0)}function no(e){var t=this.localeData(),i=io(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function so(){var e,t,i,o=ns(this._milliseconds)/1e3,n=ns(this._days),s=ns(this._months);e=g(o/60),t=g(e/60),o%=60,e%=60,i=g(s/12),s%=12;var r=i,a=s,h=n,d=t,l=e,c=o,u=this.asSeconds();return u?(0>u?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||c?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var ro,ao;ao=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,o=0;i>o;o++)if(o in t&&e.call(this,t[o],o,t))return!0;return!1};var ho=t.momentProperties=[],lo=!1,co={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var uo;uo=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)r(e,t)&&i.push(t);return i};var fo,po,vo={},yo={},go=/(\[[^\[]*\])|(\\)?([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,bo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,mo={},_o={},wo=/\d/,ko=/\d\d/,xo=/\d{3}/,Oo=/\d{4}/,Eo=/[+-]?\d{6}/,Mo=/\d\d?/,Do=/\d\d\d\d?/,So=/\d\d\d\d\d\d?/,Co=/\d{1,3}/,To=/\d{1,4}/,Po=/[+-]?\d{1,6}/,Bo=/\d+/,Fo=/[+-]?\d+/,Io=/Z|[+-]\d\d:?\d\d/gi,jo=/Z|[+-]\d\d(?::?\d\d)?/gi,No=/[+-]?\d+(\.\d{1,3})?/,zo=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ro={},Ao={},Lo=0,Ho=1,Wo=2,Yo=3,Uo=4,Vo=5,qo=6,Go=7,Xo=8;po=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),U("MMMM",0,0,function(e){return this.localeData().months(this,e)}),N("month","M"),K("M",Mo),K("MM",Mo,ko),K("MMM",function(e,t){return t.monthsShortRegex(e)}),K("MMMM",function(e,t){return t.monthsRegex(e)}),$(["M","MM"],function(e,t){t[Ho]=b(e)-1}),$(["MMM","MMMM"],function(e,t,i,o){var n=i._locale.monthsParse(e,o,i._strict);null!=n?t[Ho]=n:l(i).invalidMonth=e});var Ko=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Zo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Qo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jo=zo,$o=zo,en=/^\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)?)?/,tn=/^\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)?)?/,on=/Z|[+-]\d\d(?::?\d\d)?/,nn=[["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}/]],sn=[["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/]],rn=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),U("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),N("year","y"),K("Y",Fo),K("YY",Mo,ko),K("YYYY",To,Oo),K("YYYYY",Po,Eo),K("YYYYYY",Po,Eo),$(["YYYYY","YYYYYY"],Lo),$("YYYY",function(e,i){i[Lo]=2===e.length?t.parseTwoDigitYear(e):b(e)}),$("YY",function(e,i){i[Lo]=t.parseTwoDigitYear(e)}),$("Y",function(e,t){t[Lo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return b(e)+(b(e)>68?1900:2e3)};var an=A("FullYear",!0);t.ISO_8601=function(){};var hn=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=ze.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:u()}),dn=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=ze.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:u()}),ln=function(){return Date.now?Date.now():+new Date};Ye("Z",":"),Ye("ZZ",""),K("Z",jo),K("ZZ",jo),$(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Ue(jo,e)});var cn=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var un=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,fn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;nt.fn=He.prototype;var pn=dt(1,"add"),vn=dt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var yn=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Wt("gggg","weekYear"),Wt("ggggg","weekYear"),Wt("GGGG","isoWeekYear"),Wt("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),K("G",Fo),K("g",Fo),K("GG",Mo,ko),K("gg",Mo,ko),K("GGGG",To,Oo),K("gggg",To,Oo),K("GGGGG",Po,Eo),K("ggggg",Po,Eo),ee(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,o){t[o.substr(0,2)]=b(e)}),ee(["gg","GG"],function(e,i,o,n){i[n]=t.parseTwoDigitYear(e)}),U("Q",0,"Qo","quarter"),N("quarter","Q"),K("Q",wo),$("Q",function(e,t){t[Ho]=3*(b(e)-1)}),U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),K("w",Mo),K("ww",Mo,ko),K("W",Mo),K("WW",Mo,ko),ee(["w","ww","W","WW"],function(e,t,i,o){t[o.substr(0,1)]=b(e)});var gn={dow:0,doy:6};U("D",["DD",2],"Do","date"),N("date","D"),K("D",Mo),K("DD",Mo,ko),K("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),$(["D","DD"],Wo),$("Do",function(e,t){t[Wo]=b(e.match(Mo)[0],10)});var bn=A("Date",!0);U("d",0,"do","day"),U("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),U("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),U("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),K("d",Mo),K("e",Mo),K("E",Mo),K("dd",function(e,t){return t.weekdaysMinRegex(e)}),K("ddd",function(e,t){return t.weekdaysShortRegex(e)}),K("dddd",function(e,t){return t.weekdaysRegex(e)}),ee(["dd","ddd","dddd"],function(e,t,i,o){var n=i._locale.weekdaysParse(e,o,i._strict);null!=n?t.d=n:l(i).invalidWeekday=e}),ee(["d","e","E"],function(e,t,i,o){t[o]=b(e)});var mn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_n="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),kn=zo,xn=zo,On=zo;U("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),K("DDD",Co),K("DDDD",xo),$(["DDD","DDDD"],function(e,t,i){i._dayOfYear=b(e)}),U("H",["HH",2],0,"hour"),U("h",["hh",2],0,vi),U("k",["kk",2],0,yi),U("hmm",0,0,function(){return""+vi.apply(this)+Y(this.minutes(),2)}),U("hmmss",0,0,function(){return""+vi.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),gi("a",!0),gi("A",!1),N("hour","h"),K("a",bi),K("A",bi),K("H",Mo),K("h",Mo),K("HH",Mo,ko),K("hh",Mo,ko),K("hmm",Do),K("hmmss",So),K("Hmm",Do),K("Hmmss",So),$(["H","HH"],Yo),$(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),$(["h","hh"],function(e,t,i){t[Yo]=b(e),l(i).bigHour=!0}),$("hmm",function(e,t,i){var o=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o)),l(i).bigHour=!0}),$("hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o,2)),t[Vo]=b(e.substr(n)),l(i).bigHour=!0}),$("Hmm",function(e,t,i){var o=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o))}),$("Hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o,2)),t[Vo]=b(e.substr(n))});var En=/[ap]\.?m?\.?/i,Mn=A("Hours",!0);U("m",["mm",2],0,"minute"),N("minute","m"),K("m",Mo),K("mm",Mo,ko),$(["m","mm"],Uo);var Dn=A("Minutes",!1);U("s",["ss",2],0,"second"),N("second","s"),K("s",Mo),K("ss",Mo,ko),$(["s","ss"],Vo);var Sn=A("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),K("S",Co,wo),K("SS",Co,ko),K("SSS",Co,xo);var Cn;for(Cn="SSSS";Cn.length<=9;Cn+="S")K(Cn,Bo);for(Cn="S";Cn.length<=9;Cn+="S")$(Cn,wi);var Tn=A("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Pn=v.prototype;Pn.add=pn,Pn.calendar=ct,Pn.clone=ut,Pn.diff=mt,Pn.endOf=Pt,Pn.format=xt,Pn.from=Ot,Pn.fromNow=Et,Pn.to=Mt,Pn.toNow=Dt,Pn.get=W,Pn.invalidAt=Lt,Pn.isAfter=ft,Pn.isBefore=pt,Pn.isBetween=vt,Pn.isSame=yt,Pn.isSameOrAfter=gt,Pn.isSameOrBefore=bt,Pn.isValid=Rt,Pn.lang=yn,Pn.locale=St,Pn.localeData=Ct,Pn.max=dn,Pn.min=hn,Pn.parsingFlags=At,Pn.set=W,Pn.startOf=Tt,Pn.subtract=vn,Pn.toArray=jt,Pn.toObject=Nt,Pn.toDate=It,Pn.toISOString=kt,Pn.toJSON=zt,Pn.toString=wt,Pn.unix=Ft,Pn.valueOf=Bt,Pn.creationData=Ht,Pn.year=an,Pn.isLeapYear=_e,Pn.weekYear=Yt,Pn.isoWeekYear=Ut,Pn.quarter=Pn.quarters=Kt,Pn.month=he,Pn.daysInMonth=de,Pn.week=Pn.weeks=$t,Pn.isoWeek=Pn.isoWeeks=ei,Pn.weeksInYear=qt,Pn.isoWeeksInYear=Vt,Pn.date=bn,Pn.day=Pn.days=ai,Pn.weekday=hi,Pn.isoWeekday=di,Pn.dayOfYear=pi,Pn.hour=Pn.hours=Mn,Pn.minute=Pn.minutes=Dn,Pn.second=Pn.seconds=Sn,Pn.millisecond=Pn.milliseconds=Tn,Pn.utcOffset=Ge,Pn.utc=Ke,Pn.local=Ze,Pn.parseZone=Qe,Pn.hasAlignedHourOffset=Je,Pn.isDST=$e,Pn.isDSTShifted=et,Pn.isLocal=tt,Pn.isUtcOffset=it,Pn.isUtc=ot,Pn.isUTC=ot,Pn.zoneAbbr=ki,Pn.zoneName=xi,Pn.dates=w("dates accessor is deprecated. Use date instead.",bn),Pn.months=w("months accessor is deprecated. Use month instead",he),Pn.years=w("years accessor is deprecated. Use year instead",an),Pn.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Xe);var Bn=Pn,Fn={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},In={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"},jn="Invalid date",Nn="%d",zn=/\d{1,2}/,Rn={future:"in %s",past:"%s ago",s:"a few 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"},An=D.prototype;An._calendar=Fn,An.calendar=Mi,An._longDateFormat=In,An.longDateFormat=Di,An._invalidDate=jn,An.invalidDate=Si,An._ordinal=Nn,An.ordinal=Ci,An._ordinalParse=zn,An.preparse=Ti,An.postformat=Ti,An._relativeTime=Rn,An.relativeTime=Pi,An.pastFuture=Bi,An.set=E,An.months=oe,An._months=Zo,An.monthsShort=ne,An._monthsShort=Qo,An.monthsParse=re,An._monthsRegex=$o,An.monthsRegex=ce,An._monthsShortRegex=Jo,An.monthsShortRegex=le,An.week=Zt,An._week=gn,An.firstDayOfYear=Jt,An.firstDayOfWeek=Qt,An.weekdays=ii,An._weekdays=mn,An.weekdaysMin=ni,An._weekdaysMin=wn,An.weekdaysShort=oi,An._weekdaysShort=_n,An.weekdaysParse=ri,An._weekdaysRegex=kn,An.weekdaysRegex=li,An._weekdaysShortRegex=xn,An.weekdaysShortRegex=ci,An._weekdaysMinRegex=On,An.weekdaysMinRegex=ui,An.isPM=mi,An._meridiemParse=En,An.meridiem=_i,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===b(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i}}),t.lang=w("moment.lang is deprecated. Use moment.locale instead.",P),t.langData=w("moment.langData is deprecated. Use moment.localeData instead.",I);var Ln=Math.abs,Hn=Qi("ms"),Wn=Qi("s"),Yn=Qi("m"),Un=Qi("h"),Vn=Qi("d"),qn=Qi("w"),Gn=Qi("M"),Xn=Qi("y"),Kn=$i("milliseconds"),Zn=$i("seconds"),Qn=$i("minutes"),Jn=$i("hours"),$n=$i("days"),es=$i("months"),ts=$i("years"),is=Math.round,os={s:45,m:45,h:22,d:26,M:11},ns=Math.abs,ss=He.prototype;ss.abs=Hi,ss.add=Yi,ss.subtract=Ui,ss.as=Ki,ss.asMilliseconds=Hn,ss.asSeconds=Wn,ss.asMinutes=Yn,ss.asHours=Un,ss.asDays=Vn,ss.asWeeks=qn,ss.asMonths=Gn,ss.asYears=Xn,ss.valueOf=Zi,ss._bubble=qi,ss.get=Ji,ss.milliseconds=Kn,ss.seconds=Zn,ss.minutes=Qn,ss.hours=Jn,ss.days=$n,ss.weeks=eo,ss.months=es,ss.years=ts,ss.humanize=no,ss.toISOString=so,ss.toString=so,ss.toJSON=so,ss.locale=St,ss.localeData=Ct,ss.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",so),ss.lang=yn,U("X",0,0,"unix"),U("x",0,0,"valueOf"),K("x",Fo),K("X",No),$("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),$("x",function(e,t,i){i._d=new Date(b(e))}),t.version="2.13.0",i(ze),t.fn=Bn,t.min=Ae,t.max=Le,t.now=ln,t.utc=h,t.unix=Oi,t.months=Ni,t.isDate=n,t.locale=P,t.invalid=u,t.duration=nt,t.isMoment=y,t.weekdays=Ri,t.parseZone=Ei,t.localeData=I,t.isDuration=We,t.monthsShort=zi,t.weekdaysMin=Li,t.defineLocale=B,t.updateLocale=F,t.locales=j,t.weekdaysShort=Ai,t.normalizeUnits=z,t.relativeTimeThreshold=oo,t.prototype=Bn;var rs=t;return rs})}).call(t,i(4)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){function i(e){throw new Error("Cannot find module '"+e+"'.")}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id=5},function(e,t){(function(t){function i(e,t,i){var o=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[o+n++]=c[e])});16>n;)t[o+n++]=0;return t}function o(e,t){var i=t||0,o=l;return o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]}function n(e,t,i){var n=t&&i||0,s=t||[];e=e||{};var r=void 0!==e.clockseq?e.clockseq:v,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:g+1,d=a-y+(h-g)/1e4;if(0>d&&void 0===e.clockseq&&(r=r+1&16383),(0>d||a>y)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");y=a,g=h,v=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var c=a/4294967296*1e4&268435455;s[n++]=c>>>8&255,s[n++]=255&c,s[n++]=c>>>24&15|16,s[n++]=c>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var u=e.node||p,f=0;6>f;f++)s[n+f]=u[f];return t?t:o(s)}function s(e,t,i){var n=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;16>a;a++)t[n+a]=s[a];return t||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof t?t:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var e,t=0;16>t;t++)0===(3&t)&&(e=4294967296*Math.random()),d[t]=e>>>((3&t)<<3)&255;return d}}for(var l=[],c={},u=0;256>u;u++)l[u]=(u+256).toString(16).substr(1),c[l[u]]=u;var f=r(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],v=16383&(f[6]<<8|f[7]),y=0,g=0,b=s;b.v1=n,b.v4=s,b.parse=i,b.unparse=o,e.exports=b}).call(t,function(){return this}())},function(e,t){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var i=0;i<e[t].redundant.length;i++)e[t].redundant[i].parentNode.removeChild(e[t].redundant[i]);e[t].redundant=[]}},t.resetElements=function(e){t.prepareElements(e),t.cleanupElements(e),t.prepareElements(e)},t.getSVGElement=function(e,t,i){var o;return t.hasOwnProperty(e)?t[e].redundant.length>0?(o=t[e].redundant[0],t[e].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",e),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},i.appendChild(o)),t[e].used.push(o),o},t.getDOMElement=function(e,t,i,o){var n;return t.hasOwnProperty(e)?t[e].redundant.length>0?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElement(e),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(e),t[e]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),t[e].used.push(n),n},t.drawPoint=function(e,i,o,n,s,r){var a;if("circle"==o.style?(a=t.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=t.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",e-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),
+a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=t.getSVGElement("text",n,s);r.xOffset&&(e+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i)}return a},t.drawBar=function(e,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=t.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",e-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(e,t,i){function o(e,t){if(e&&!Array.isArray(e)&&(t=e,e=null),this._options=t||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;n>o;o++){var s=i[o],r=this._options.type[s];"Date"==r||"ISODate"==r||"ASPDate"==r?this._type[s]="Date":this._type[s]=r}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},e&&this.add(e),this.setOptions(t)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(1),r=i(9);o.prototype.setOptions=function(e){e&&void 0!==e.queue&&(e.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=r.extend(this,{replace:["add","update","remove"]})),"object"===n(e.queue)&&this._queue.setOptions(e.queue)))},o.prototype.on=function(e,t){var i=this._subscribers[e];i||(i=[],this._subscribers[e]=i),i.push({callback:t})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(e,t){var i=this._subscribers[e];i&&(this._subscribers[e]=i.filter(function(e){return e.callback!=t}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(e,t,i){if("*"==e)throw new Error("Cannot trigger event *");var o=[];e in this._subscribers&&(o=o.concat(this._subscribers[e])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0,s=o.length;s>n;n++){var r=o[n];r.callback&&r.callback(e,t,i||null)}},o.prototype.add=function(e,t){var i,o=[],n=this;if(Array.isArray(e))for(var s=0,r=e.length;r>s;s++)i=n._addItem(e[s]),o.push(i);else{if(!(e instanceof Object))throw new Error("Unknown dataType");i=n._addItem(e),o.push(i)}return o.length&&this._trigger("add",{items:o},t),o},o.prototype.update=function(e,t){var i=[],o=[],n=[],r=[],a=this,h=a._fieldId,d=function(e){var t=e[h];if(a._data[t]){var d=s.extend({},a._data[t]);t=a._updateItem(e),o.push(t),r.push(e),n.push(d)}else t=a._addItem(e),i.push(t)};if(Array.isArray(e))for(var l=0,c=e.length;c>l;l++)e[l]instanceof Object?d(e[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!(e instanceof Object))throw new Error("Unknown dataType");d(e)}if(i.length&&this._trigger("add",{items:i},t),o.length){var u={items:o,oldData:n,data:r};this._trigger("update",u,t)}return i.concat(o)},o.prototype.get=function(e){var t,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,c,u,f,p=o&&o.type||this._options.type,v=o&&o.filter,y=[];if(void 0!=t)d=n._getItem(t,p),d&&v&&!v(d)&&(d=null);else if(void 0!=i)for(u=0,f=i.length;f>u;u++)d=n._getItem(i[u],p),v&&!v(d)||y.push(d);else for(l=Object.keys(this._data),u=0,f=l.length;f>u;u++)c=l[u],d=n._getItem(c,p),v&&!v(d)||y.push(d);if(o&&o.order&&void 0==t&&this._sort(y,o.order),o&&o.fields){var g=o.fields;if(void 0!=t)d=this._filterFields(d,g);else for(u=0,f=y.length;f>u;u++)y[u]=this._filterFields(y[u],g)}if("Object"==a){var b,m={};for(u=0,f=y.length;f>u;u++)b=y[u],m[b.id]=b;return m}return void 0!=t?d:y},o.prototype.getIds=function(e){var t,i,o,n,s,r=this._data,a=e&&e.filter,h=e&&e.order,d=e&&e.type||this._options.type,l=Object.keys(r),c=[];if(a)if(h){for(s=[],t=0,i=l.length;i>t;t++)o=l[t],n=this._getItem(o,d),a(n)&&s.push(n);for(this._sort(s,h),t=0,i=s.length;i>t;t++)c.push(s[t][this._fieldId])}else for(t=0,i=l.length;i>t;t++)o=l[t],n=this._getItem(o,d),a(n)&&c.push(n[this._fieldId]);else if(h){for(s=[],t=0,i=l.length;i>t;t++)o=l[t],s.push(r[o]);for(this._sort(s,h),t=0,i=s.length;i>t;t++)c.push(s[t][this._fieldId])}else for(t=0,i=l.length;i>t;t++)o=l[t],n=r[o],c.push(n[this._fieldId]);return c},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=this._data,d=Object.keys(h);if(t&&t.order){var l=this.get(t);for(i=0,o=l.length;o>i;i++)n=l[i],s=n[this._fieldId],e(n,s)}else for(i=0,o=d.length;o>i;i++)s=d[i],n=this._getItem(s,a),r&&!r(n)||e(n,s)},o.prototype.map=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=[],d=this._data,l=Object.keys(d);for(i=0,o=l.length;o>i;i++)n=l[i],s=this._getItem(n,a),r&&!r(s)||h.push(e(s,n));return t&&t.order&&this._sort(h,t.order),h},o.prototype._filterFields=function(e,t){if(!e)return e;var i,o,n={},s=Object.keys(e),r=s.length;if(Array.isArray(t))for(i=0;r>i;i++)o=s[i],-1!=t.indexOf(o)&&(n[o]=e[o]);else for(i=0;r>i;i++)o=s[i],t.hasOwnProperty(o)&&(n[t[o]]=e[o]);return n},o.prototype._sort=function(e,t){if(s.isString(t)){var i=t;e.sort(function(e,t){var o=e[i],n=t[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof t)throw new TypeError("Order must be a function or a string");e.sort(t)}},o.prototype.remove=function(e,t){var i,o,n,s=[];if(Array.isArray(e))for(i=0,o=e.length;o>i;i++)n=this._remove(e[i]),null!=n&&s.push(n);else n=this._remove(e),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},t),s},o.prototype._remove=function(e){if(s.isNumber(e)||s.isString(e)){if(this._data[e])return delete this._data[e],this.length--,e}else if(e instanceof Object){var t=e[this._fieldId];if(void 0!==t&&this._data[t])return delete this._data[t],this.length--,t}return null},o.prototype.clear=function(e){var t=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:t},e),t},o.prototype.max=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||d>r)&&(s=h,r=d)}return s},o.prototype.min=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||r>d)&&(s=h,r=d)}return s},o.prototype.distinct=function(e){var t,i,o,n=this._data,r=Object.keys(n),a=[],h=this._options.type&&this._options.type[e]||null,d=0;for(t=0,o=r.length;o>t;t++){var l=r[t],c=n[l],u=c[e],f=!1;for(i=0;d>i;i++)if(a[i]==u){f=!0;break}f||void 0===u||(a[d]=u,d++)}if(h)for(t=0,o=a.length;o>t;t++)a[t]=s.convert(a[t],h);return a},o.prototype._addItem=function(e){var t=e[this._fieldId];if(void 0!=t){if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists")}else t=s.randomUUID(),e[this._fieldId]=t;var i,o,n={},r=Object.keys(e);for(i=0,o=r.length;o>i;i++){var a=r[i],h=this._type[a];n[a]=s.convert(e[a],h)}return this._data[t]=n,this.length++,t},o.prototype._getItem=function(e,t){var i,o,n,r,a=this._data[e];if(!a)return null;var h={},d=Object.keys(a);if(t)for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=s.convert(o,t[i]);else for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=o;return h},o.prototype._updateItem=function(e){var t=e[this._fieldId];if(void 0==t)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(e)+")");var i=this._data[t];if(!i)throw new Error("Cannot update item: no item with id "+t+" found");for(var o=Object.keys(e),n=0,r=o.length;r>n;n++){var a=o[n],h=this._type[a];i[a]=s.convert(e[a],h)}return t},e.exports=o},function(e,t){function i(e){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(e)}i.prototype.setOptions=function(e){e&&"undefined"!=typeof e.delay&&(this.delay=e.delay),e&&"undefined"!=typeof e.max&&(this.max=e.max),this._flushIfNeeded()},i.extend=function(e,t){var o=new i(t);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){o.flush()};var n=[{name:"flush",original:void 0}];if(t&&t.replace)for(var s=0;s<t.replace.length;s++){var r=t.replace[s];n.push({name:r,original:e[r]}),o.replace(e,r)}return o._extended={object:e,methods:n},o},i.prototype.destroy=function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,i=0;i<t.length;i++){var o=t[i];o.original?e[o.name]=o.original:delete e[o.name]}this._extended=null}},i.prototype.replace=function(e,t){var i=this,o=e[t];if(!o)throw new Error("Method "+t+" undefined");e[t]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.queue({args:e,fn:o,context:this})}},i.prototype.queue=function(e){"function"==typeof e?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()},i.prototype._flushIfNeeded=function(){if(this._queue.length>this.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var e=this;this._timeout=setTimeout(function(){e.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var e=this._queue.shift();e.fn.apply(e.context||e.fn,e.args||[])}},e.exports=i},function(e,t,i){function o(e,t){this._data=null,this._ids={},this.length=0,this._options=t||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(e)}var n=i(1),s=i(8);o.prototype.setData=function(e){var t,i,o,n;if(this._data&&(this._data.off&&this._data.off("*",this.listener),t=Object.keys(this._ids),this._ids={},this.length=0,this._trigger("remove",{items:t})),this._data=e,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",t=this._data.getIds({filter:this._options&&this._options.filter}),o=0,n=t.length;n>o;o++)i=t[o],this._ids[i]=!0;this.length=t.length,this._trigger("add",{items:t}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){var e,t,i,o=this._data.getIds({filter:this._options&&this._options.filter}),n=Object.keys(this._ids),s={},r=[],a=[];for(t=0,i=o.length;i>t;t++)e=o[t],s[e]=!0,this._ids[e]||(r.push(e),this._ids[e]=!0);for(t=0,i=n.length;i>t;t++)e=n[t],s[e]||(a.push(e),delete this._ids[e]);this.length+=r.length-a.length,r.length&&this._trigger("add",{items:r}),a.length&&this._trigger("remove",{items:a})},o.prototype.get=function(e){var t,i,o,s=this,r=n.getType(arguments[0]);"String"==r||"Number"==r||"Array"==r?(t=arguments[0],i=arguments[1],o=arguments[2]):(i=arguments[0],o=arguments[1]);var a=n.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(e){return s._options.filter(e)&&i.filter(e)});var h=[];return void 0!=t&&h.push(t),h.push(a),h.push(o),this._data&&this._data.get.apply(this._data,h)},o.prototype.getIds=function(e){var t;if(this._data){var i,o=this._options.filter;i=e&&e.filter?o?function(t){return o(t)&&e.filter(t)}:e.filter:o,t=this._data.getIds({filter:i,order:e&&e.order})}else t=[];return t},o.prototype.map=function(e,t){var i=[];if(this._data){var o,n=this._options.filter;o=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,i=this._data.map(e,{filter:o,order:t&&t.order})}else i=[];return i},o.prototype.getDataSet=function(){for(var e=this;e instanceof o;)e=e._data;return e||null},o.prototype._onEvent=function(e,t,i){var o,n,s,r,a=t&&t.items,h=this._data,d=[],l=[],c=[],u=[];if(a&&h){switch(e){case"add":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r&&(this._ids[s]=!0,l.push(s));break;case"update":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r?this._ids[s]?(c.push(s),d.push(t.data[o])):(this._ids[s]=!0,l.push(s)):this._ids[s]&&(delete this._ids[s],u.push(s));break;case"remove":for(o=0,n=a.length;n>o;o++)s=a[o],this._ids[s]&&(delete this._ids[s],u.push(s))}this.length+=l.length-u.length,l.length&&this._trigger("add",{items:l},i),c.length&&this._trigger("update",{items:c,data:d},i),u.length&&this._trigger("remove",{items:u},i)}},o.prototype.on=s.prototype.on,o.prototype.off=s.prototype.off,o.prototype._trigger=s.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,e.exports=o},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t,i){var o=this;if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:Y,clickToUse:!1},A.extend(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this),once:this.once.bind(this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}}},this.bindEventListeners(),this.images=new r["default"](function(){return o.body.emitter.emit("_requestRedraw")}),this.groups=new h["default"],this.canvas=new _["default"](this.body),this.selectionHandler=new M["default"](this.body,this.canvas),this.interactionHandler=new O["default"](this.body,this.canvas,this.selectionHandler),this.view=new k["default"](this.body,this.canvas),this.renderer=new b["default"](this.body,this.canvas),this.physics=new p["default"](this.body),this.layoutEngine=new S["default"](this.body),this.clustering=new y["default"](this.body),this.manipulation=new T["default"](this.body,this.canvas,this.selectionHandler),this.nodesHandler=new l["default"](this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new u["default"](this.body,this.images,this.groups),this.body.modules.kamadaKawai=new z["default"](this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(t)}var s=i(12),r=o(s),a=i(13),h=o(a),d=i(14),l=o(d),c=i(35),u=o(c),f=i(44),p=o(f),v=i(53),y=o(v),g=i(56),b=o(g),m=i(57),_=o(m),w=i(62),k=o(w),x=i(63),O=o(x),E=i(67),M=o(E),D=i(68),S=o(D),C=i(69),T=o(C),P=i(70),B=o(P),F=i(34),I=o(F),j=i(72),N=i(73),z=o(N);i(75);var R=i(76),A=i(1),L=(i(8),i(10),i(77)),H=i(78),W=i(79),Y=i(80);R(n.prototype),n.prototype.setOptions=function(e){var t=this;if(void 0!==e){var i=I["default"].validate(e,j.allOptions);i===!0&&console.log("%cErrors have been found in the supplied options object.",F.printStyle);var o=["locale","locales","clickToUse"];if(A.selectiveDeepExtend(o,this.options,e),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),void 0!==e.groups&&this.body.emitter.emit("refreshNodes"),"configure"in e&&(this.configurator||(this.configurator=new B["default"](this,this.body.container,j.configureOptions,this.canvas.pixelRatio)),this.configurator.setOptions(e.configure)),this.configurator&&this.configurator.options.enabled===!0){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};A.deepExtend(n.nodes,this.nodesHandler.options),A.deepExtend(n.edges,this.edgesHandler.options),A.deepExtend(n.layout,this.layoutEngine.options),A.deepExtend(n.interaction,this.selectionHandler.options),A.deepExtend(n.interaction,this.renderer.options),A.deepExtend(n.interaction,this.interactionHandler.options),A.deepExtend(n.manipulation,this.manipulation.options),A.deepExtend(n.physics,this.physics.options),A.deepExtend(n.global,this.canvas.options),A.deepExtend(n.global,this.options),this.configurator.setModuleOptions(n)}void 0!==e.clickToUse?e.clickToUse===!0?void 0===this.activator&&(this.activator=new W(this.canvas.frame),this.activator.on("change",function(){t.body.emitter.emit("activate")})):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},n.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var i in e)e.hasOwnProperty(i)&&e[i].options.hidden===!1&&this.body.nodeIndices.push(e[i].id);for(var o in t)t.hasOwnProperty(o)&&t[o].options.hidden===!1&&this.body.edgeIndices.push(t[o].id)},n.prototype.bindEventListeners=function(){var e=this;this.body.emitter.on("_dataChanged",function(){e._updateVisibleIndices(),e.body.emitter.emit("_requestRedraw"),e.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){e._updateValueRange(e.body.nodes),e._updateValueRange(e.body.edges),e.body.emitter.emit("startSimulation"),e.body.emitter.emit("_requestRedraw")})},n.prototype.setData=function(e){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(e&&e.options),e&&e.dot){console.log("The dot property has been depricated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var t=L.DOTToGraph(e.dot);return void this.setData(t)}if(e&&e.gephi){console.log("The gephi property has been depricated. 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=H.parseGephi(e.gephi);return void this.setData(i)}this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},n.prototype.destroy=function(){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;for(var e in this.body.nodes)delete this.body.nodes[e];for(var t in this.body.edges)delete this.body.edges[t];A.recursiveDOMDelete(this.body.container)},n.prototype._updateValueRange=function(e){var t,i=void 0,o=void 0,n=0;for(t in e)if(e.hasOwnProperty(t)){var s=e[t].getValue();void 0!==s&&(i=void 0===i?s:Math.min(s,i),o=void 0===o?s:Math.max(s,o),n+=s)}if(void 0!==i&&void 0!==o)for(t in e)e.hasOwnProperty(t)&&e[t].setValueRange(i,o,n)},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},n.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},n.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},n.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},n.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},n.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},n.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},n.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},n.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},n.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},n.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},n.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},n.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},n.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},n.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},n.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},n.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},n.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},n.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},n.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},n.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},n.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},n.prototype.getConnectedNodes=function(e){return void 0!==this.body.nodes[e]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},n.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},n.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},n.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},n.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},n.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},n.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},n.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},n.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},n.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},n.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},n.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},n.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},n.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},n.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},n.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},n.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},n.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},n.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},n.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},n.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},n.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e},e.exports=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t){i(this,e),this.images={},this.imageBroken={},this.callback=t}return o(e,[{key:"_addImageToCache",value:function(e,t){0===t.width&&(document.body.appendChild(t),t.width=t.offsetWidth,t.height=t.offsetHeight,document.body.removeChild(t)),this.images[e]=t}},{key:"_tryloadBrokenUrl",value:function(e,t,i){var o=this;void 0!==e&&void 0!==t&&void 0!==i&&(i.onerror=function(){console.error("Could not load brokenImage:",t),o._addImageToCache(e,new Image)},i.src=t)}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t,i){var o=this,n=this.images[e];if(n)return n;var s=new Image;return s.onload=function(){o._addImageToCache(e,s),o._redrawWithImage(s)},s.onerror=function(){console.error("Could not load image:",e),o._tryloadBrokenUrl(e,t,s)},s.src=e,s}}]),e}();t["default"]=n},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=function(){function e(){o(this,e),this.clear(),this.defaultIndex=0,this.groupsArray=[],this.groupIndex=0,this.defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},s.extend(this.options,this.defaultOptions)}return n(e,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(void 0!==e)for(var i in e)if(e.hasOwnProperty(i)&&-1===t.indexOf(i)){var o=e[i];this.add(i,o)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(e){var t=this.groups[e];if(void 0===t)if(this.options.useDefaultGroups===!1&&this.groupsArray.length>0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,t={},t.color=this.groups[this.groupsArray[i]],this.groups[e]=t}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,t={},t.color=this.defaultGroups[o],this.groups[e]=t}return t}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}();t["default"]=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(15),a=o(r),h=i(16),d=o(h),l=i(1),c=i(8),u=i(10),f=function(){function e(t,i,o,s){var r=this;n(this,e),this.body=t,this.images=i,this.groups=o,this.layoutEngine=s,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(e,t){r.add(t.items)},update:function(e,t){r.update(t.items,t.data)},remove:function(e,t){r.remove(t.items)}},this.options={},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"},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,label:void 0,labelHighlightBold:!0,level:void 0,mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,i,o){if(t===e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)}},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},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("refreshNodes",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){l.forEach(e.nodesListeners,function(t,i){e.body.data.nodes&&e.body.data.nodes.off(i,t)}),delete e.body.functions.createNode,delete e.nodesListeners.add,delete e.nodesListeners.update,delete e.nodesListeners.remove,delete e.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(a["default"].parseOptions(this.options,e),void 0!==e.shape)for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&this.body.nodes[t].updateShape();if(void 0!==e.font){d["default"].parseOptions(this.options.font,e);for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i]._reset())}if(void 0!==e.size)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&this.body.nodes[o]._reset();void 0===e.hidden&&void 0===e.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.nodes;if(e instanceof c||e instanceof u)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new c,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new c}o&&l.forEach(this.nodesListeners,function(e,t){o.off(t,e)}),this.body.nodes={},this.body.data.nodes&&!function(){var e=t;l.forEach(t.nodesListeners,function(t,i){e.body.data.nodes.on(i,t)});var i=t.body.data.nodes.getIds();t.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=[],n=0;n<e.length;n++){i=e[n];var s=this.body.data.nodes.get(i),r=this.create(s);o.push(r),this.body.nodes[i]=r}this.layoutEngine.positionInitially(o),t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t){for(var i=this.body.nodes,o=!1,n=0;n<e.length;n++){var s=e[n],r=i[s],a=t[n];void 0!==r?o=r.setOptions(a):(o=!0,r=this.create(a),i[s]=r)}o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,i=0;i<e.length;i++){var o=e[i];delete t[o]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?a["default"]:arguments[1];return new t(e,this.body,this.images,this.groups,this.options)}},{key:"refresh",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],t=this.body.nodes;for(var i in t){var o=void 0;t.hasOwnProperty(i)&&(o=t[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(e===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(e){var t={};if(void 0!==e){if(Array.isArray(e)===!0){for(var i=0;i<e.length;i++)if(void 0!==this.body.nodes[e[i]]){var o=this.body.nodes[e[i]];t[e[i]]={x:Math.round(o.x),y:Math.round(o.y)}}}else if(void 0!==this.body.nodes[e]){var n=this.body.nodes[e];t[e]={x:Math.round(n.x),y:Math.round(n.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var r=this.body.nodes[this.body.nodeIndices[s]];t[this.body.nodeIndices[s]]={x:Math.round(r.x),y:Math.round(r.y)}}return t}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet();for(var i in t._data)if(t._data.hasOwnProperty(i)){var o=this.body.nodes[i];t._data[i].x==Math.round(o.x)&&t._data[i].y==Math.round(o.y)||e.push({id:o.id,x:Math.round(o.x),y:Math.round(o.y)})}t.update(e)}},{key:"getBoundingBox",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].shape.boundingBox:void 0}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var i=this.body.nodes[e],o={},n=0;n<i.edges.length;n++){var s=i.edges[n];s.toId==i.id?void 0===o[s.fromId]&&(t.push(s.fromId),o[s.fromId]=!0):s.fromId==i.id&&void 0===o[s.toId]&&(t.push(s.toId),o[s.toId]=!0)}return t}},{key:"getConnectedEdges",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var i=this.body.nodes[e],o=0;o<i.edges.length;o++)t.push(i.edges[o].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}},{key:"moveNode",value:function(e,t,i){var o=this;void 0!==this.body.nodes[e]?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(i),setTimeout(function(){o.body.emitter.emit("startSimulation")},0)):console.log("Node id supplied to moveNode does not exist. Provided: ",e)}}]),e}();t["default"]=f},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(16),a=o(r),h=i(17),d=o(h),l=i(19),c=o(l),u=i(21),f=o(u),p=i(22),v=o(p),y=i(23),g=o(y),b=i(25),m=o(b),_=i(26),w=o(_),k=i(27),x=o(k),O=i(28),E=o(O),M=i(29),D=o(M),S=i(30),C=o(S),T=i(31),P=o(T),B=i(32),F=o(B),I=i(33),j=o(I),N=i(34),z=(o(N),i(1)),R=function(){function e(t,i,o,s,r){n(this,e),this.options=z.bridgeObject(r),this.globalOptions=r,this.body=i,this.edges=[],this.id=void 0,this.imagelist=o,this.grouplist=s,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 a["default"](this.body,this.options,!1),this.setOptions(t)}return s(e,[{key:"attachEdge",value:function(e){-1===this.edges.indexOf(e)&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t=this.edges.indexOf(e);-1!=t&&this.edges.splice(t,1)}},{key:"setOptions",value:function(t){var i=this.options.shape;if(t){if(void 0!==t.id&&(this.id=t.id),void 0===this.id)throw"Node must have an id";if(void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=parseFloat(t.value)),"number"==typeof t.group||"string"==typeof t.group&&""!=t.group){var o=this.grouplist.get(t.group);z.deepExtend(this.options,o),this.options.color=z.parseColor(this.options.color)}if(e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==this.options.image){if(!this.imagelist)throw"No imagelist provided";this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id)}return this.updateLabelModule(),this.updateShape(i),void 0!==t.hidden||void 0!==t.physics}}},{key:"updateLabelModule",value:function(){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj);else switch(this.options.shape){case"box":this.shape=new d["default"](this.options,this.body,this.labelModule);break;case"circle":this.shape=new c["default"](this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new f["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"database":this.shape=new v["default"](this.options,this.body,this.labelModule);break;case"diamond":this.shape=new g["default"](this.options,this.body,this.labelModule);break;case"dot":this.shape=new m["default"](this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new w["default"](this.options,this.body,this.labelModule);break;case"icon":this.shape=new x["default"](this.options,this.body,this.labelModule);break;case"image":this.shape=new E["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"square":this.shape=new D["default"](this.options,this.body,this.labelModule);break;case"star":this.shape=new C["default"](this.options,this.body,this.labelModule);break;case"text":this.shape=new P["default"](this.options,this.body,this.labelModule);break;case"triangle":this.shape=new F["default"](this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new j["default"](this.options,this.body,this.labelModule);break;default:this.shape=new w["default"](this.options,this.body,this.labelModule)}this._reset()}},{key:"select",value:function(){this.selected=!0,this._reset()}},{key:"unselect",value:function(){this.selected=!1,this._reset()}},{key:"_reset",value:function(){this.shape.width=void 0,this.shape.height=void 0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.size=this.options.scaling.min+o*n}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){this.shape.draw(e,this.x,this.y,this.selected,this.hover)}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){this.shape.resize(e,this.selected)}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["color","font","fixed","shadow"];if(z.selectiveNotDeepExtend(n,e,t,i),z.mergeOptions(e,t,"shadow",i,o),void 0!==t.color&&null!==t.color){var s=z.parseColor(t.color);z.fillIfDefined(e.color,s)}else i===!0&&null===t.color&&(e.color=z.bridgeObject(o.color));void 0!==t.fixed&&null!==t.fixed&&("boolean"==typeof t.fixed?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(void 0!==t.fixed.x&&"boolean"==typeof t.fixed.x&&(e.fixed.x=t.fixed.x),void 0!==t.fixed.y&&"boolean"==typeof t.fixed.y&&(e.fixed.y=t.fixed.y))),void 0!==t.font&&null!==t.font?a["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=z.bridgeObject(o.font)),void 0!==t.scaling&&z.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)}}]),e}();t["default"]=R},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(1),h=function(){function e(t,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];o(this,e),this.body=t,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 r(e,[{key:"setOptions",value:function(t){var i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];this.nodeOptions=t,this.fontOptions=a.deepExtend({},t.font,!0),void 0!==t.label&&(this.labelDirty=!0),void 0!==t.font&&(e.parseOptions(this.fontOptions,t,i),"string"==typeof t.font?this.baseSize=this.fontOptions.size:"object"===s(t.font)&&void 0!==t.font.size&&(this.baseSize=t.font.size))}},{key:"draw",value:function(e,t,i,o){var n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];if(void 0!==this.nodeOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.nodeOptions.label&&s<this.nodeOptions.scaling.label.drawThreshold-1||(this.calculateLabelSize(e,o,t,i,n),this._drawBackground(e),this._drawText(e,o,t,i,n))}}},{key:"_drawBackground",value:function(e){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){e.fillStyle=this.fontOptions.background;var t=2;if(this.isEdgeLabel)switch(this.fontOptions.align){case"middle":e.fillRect(.5*-this.size.width,.5*-this.size.height,this.size.width,this.size.height);break;case"top":e.fillRect(.5*-this.size.width,-(this.size.height+t),this.size.width,this.size.height);break;case"bottom":e.fillRect(.5*-this.size.width,t,this.size.width,this.size.height);break;default:e.fillRect(this.size.left,this.size.top-.5*t,this.size.width,this.size.height)}else e.fillRect(this.size.left,this.size.top-.5*t,this.size.width,this.size.height)}}},{key:"_drawText",value:function(e,t,i,o){var s=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4],r=this.fontOptions.size,a=r*this.body.view.scale;a>=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),c=l[0],u=l[1],f=this._setAlignment(e,i,h,s),p=n(f,2);i=p[0],h=p[1],e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,e.fillStyle=c,this.isEdgeLabel||"left"!==this.fontOptions.align?e.textAlign="center":(e.textAlign=this.fontOptions.align,i-=.5*this.size.width),this.fontOptions.strokeWidth>0&&(e.lineWidth=this.fontOptions.strokeWidth,e.strokeStyle=u,e.lineJoin="round");for(var v=0;v<this.lineCount;v++)this.fontOptions.strokeWidth>0&&e.strokeText(this.lines[v],i,h),e.fillText(this.lines[v],i,h),h+=r}},{key:"_setAlignment",value:function(e,t,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){t=0,i=0;var n=2;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",i+=2*n):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}},{key:"_getColor",value:function(e){var t=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(e<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-e)));t=a.overrideOpacity(t,o),i=a.overrideOpacity(i,o)}return[t,i]}},{key:"getTextSize",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i={width:this._processLabel(e,t),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2],o=arguments.length<=3||void 0===arguments[3]?0:arguments[3],n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];this.labelDirty===!0&&(this.size.width=this._processLabel(e,t)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(e,t){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=e.measureText(o[0]).width;for(var s=1;n>s;s++){var r=e.measureText(o[s]).width;i=r>i?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if("string"==typeof t.font){var o=t.font.split(" ");e.size=o[0].replace("px",""),e.face=o[1],e.color=o[2]}else"object"===s(t.font)&&a.fillIfDefined(e,t.font,i);e.size=Number(e.size)}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t);this.width=o.width+2*i,this.height=o.height+2*i,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-this.width/2,this.top=i-this.height/2;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth;e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.lineWidth=o?r:s,e.lineWidth/=this.body.view.scale,e.lineWidth=Math.min(this.width,e.lineWidth),e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background;var a=this.options.shapeProperties.borderRadius;e.roundRect(this.left,this.top,this.width,this.height,a),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),s>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height;var n=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-n,this.boundingBox.top=this.top-n,this.boundingBox.bottom=this.top+this.height+n,this.boundingBox.right=this.left+this.width+n}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}}]),t}(d["default"]);t["default"]=l},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=o,this.labelModule=n,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"_distanceToBorder",value:function(e,t){var i=this.options.borderWidth;return this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}},{key:"enableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor=this.options.shadow.color,e.shadowBlur=this.options.shadow.size,e.shadowOffsetX=this.options.shadow.x,e.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e){if(this.options.shapeProperties.borderDashes!==!1)if(void 0!==e.setLineDash){var t=this.options.shapeProperties.borderDashes;t===!0&&(t=[5,15]),e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1}},{key:"disableBorderDashes",value:function(e){this.options.shapeProperties.borderDashes!==!1&&(void 0!==e.setLineDash?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1))}}]),e}();t["default"]=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(20),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t),n=Math.max(o.width,o.height)+2*i;this.options.size=n/2,this.width=n,this.height=n,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,o,n,this.options.size),this.boundingBox.top=i-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=i+this.options.size,this.updateBoundingBox(t,i),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),.5*this.width}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){n(this,t);var r=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return r.labelOffset=0,r.imageLoaded=!1,r}return r(t,e),a(t,[{key:"setOptions",value:function(e,t){this.options=e,t&&(this.imageObj=t)}},{key:"_resizeImage",value:function(){var e=!1;if(this.imageObj.width&&this.imageObj.height?this.imageLoaded===!1&&(this.imageLoaded=!0,e=!0):this.imageLoaded=!1,!this.width||!this.height||e===!0){var t,i,o;this.imageObj.width&&this.imageObj.height&&(t=0,i=0),this.options.shapeProperties.useImageSize===!1?this.imageObj.width>this.imageObj.height?(o=this.imageObj.width/this.imageObj.height,t=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,t=2*this.options.size,i=2*this.options.size*o):(t=this.imageObj.width,i=this.imageObj.height),this.width=t,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(e,t,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,h),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.circle(t,i,s),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),h>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore()}},{key:"_drawImageAtPosition",value:function(e){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e);var t=this.imageObj.width/this.width/this.body.view.scale;if(t>2&&this.options.shapeProperties.interpolation===!0){var i=this.imageObj.width,o=this.imageObj.height,n=document.createElement("canvas");n.width=i,n.height=i;var s=n.getContext("2d");t*=.5,i*=.5,o*=.5,s.drawImage(this.imageObj,0,0,i,o);for(var r=0,a=1;t>2&&4>a;)s.drawImage(n,r,0,i,o,r+i,0,i/2,o/2),r+=i,t*=.5,i*=.5,o*=.5,a+=1;e.drawImage(n,r,0,i,o,this.left,this.top,this.width,this.height)}else e.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(e)}}},{key:"_drawImageLabel",value:function(e,t,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(e);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,n,o,"hanging")}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(20),d=o(h),l=function(e){function t(e,i,o,r){n(this,t);var a=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return a.imageObj=r,a._swapToImageResizeWhenImageLoaded=!0,a}return r(t,e),a(t,[{key:"resize",value:function(){if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){if(!this.width){var e=2*this.options.size;this.width=e,this.height=e,this._swapToImageResizeWhenImageLoaded=!0,this.radius=.5*this.width}}else this._swapToImageResizeWhenImageLoaded&&(this.width=void 0,this.height=void 0,this._swapToImageResizeWhenImageLoaded=!1),this._resizeImage()}},{key:"draw",value:function(e,t,i,o,n){this.resize(),this.left=t-this.width/2,this.top=i-this.height/2;var s=Math.min(.5*this.height,.5*this.width);this._drawRawCircle(e,t,i,o,n,s),e.save(),e.clip(),this._drawImageAtPosition(e),e.restore(),this._drawImageLabel(e,t,i,o),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,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(e,t){return this.resize(e),.5*this.width}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t),n=o.width+2*i;this.width=n,this.height=n,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-this.width/2,this.top=i-this.height/2;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.database(t-this.width/2,i-.5*this.height,this.width,this.height),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,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:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"diamond",4,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_resizeShape",value:function(){if(void 0===this.width){var e=2*this.options.size;this.width=e,this.height=e,this.radius=.5*this.width}}},{key:"_drawShape",value:function(e,t,i,o,n,s,r){this._resizeShape(),this.left=o-this.width/2,this.top=n-this.height/2;var a=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,d=(s?h:a)/this.body.view.scale;if(e.lineWidth=Math.min(this.width,d),e.strokeStyle=s?this.options.color.highlight.border:r?this.options.color.hover.border:this.options.color.border,e.fillStyle=s?this.options.color.highlight.background:r?this.options.color.hover.background:this.options.color.background,e[t](o,n,this.options.size),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),d>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(e,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&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+3))}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"circle",2,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),this.options.size}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=this.labelModule.getTextSize(e,t);this.width=1.5*i.width,this.height=2*i.height,this.width<this.height&&(this.width=this.height),this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-.5*this.width,this.top=i-.5*this.height;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.ellipse(this.left,this.top,this.width,this.height),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,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:"distanceToBorder",value:function(e,t){this.resize(e);var i=.5*this.width,o=.5*this.height,n=Math.sin(t)*i,s=Math.cos(t)*o;return i*o/Math.sqrt(n*n+s*s)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){if(void 0===this.width){var t=5,i={width:Number(this.options.icon.size),height:Number(this.options.icon.size)};this.width=i.width+2*t,this.height=i.height+2*t,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){if(this.resize(e),this.options.icon.size=this.options.icon.size||50,this.left=t-.5*this.width,this.top=i-.5*this.height,this._icon(e,t,i,o),void 0!==this.options.label){var s=5;this.labelModule.draw(e,t,i+.5*this.height+s,o)}this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){var i=5;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+i)}}},{key:"_icon",value:function(e,t,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(e.font=(o?"bold ":"")+n+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e),e.fillText(this.options.icon.code,t,i),this.disableShadow(e)):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(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(20),d=o(h),l=function(e){function t(e,i,o,r){n(this,t);var a=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return a.imageObj=r,a}return r(t,e),a(t,[{key:"resize",value:function(){this._resizeImage()}},{key:"draw",value:function(e,t,i,o,n){if(this.resize(),this.left=t-this.width/2,this.top=i-this.height/2,this.options.shapeProperties.useBorderWithImage===!0){var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.beginPath(),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),e.fill(),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),e.closePath()}this._drawImageAtPosition(e),this._drawImageLabel(e,t,i,o||n),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,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(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"square",2,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"star",4,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t);this.width=o.width+2*i,this.height=o.height+2*i,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o||n),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e),this.labelModule.draw(e,t,i,o||n),this.disableShadow(e),this.updateBoundingBox(t,i,e,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"triangle",3,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"triangleDown",3,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(1),a=!1,h=void 0,d="background: #FFeeee; color: #dd0000",l=function(){function e(){o(this,e)}return s(e,null,[{key:"validate",value:function(t,i,o){a=!1,h=i;var n=i;return void 0!==o&&(n=i[o]),e.parse(t,n,[]),a}},{key:"parse",value:function(t,i,o){for(var n in t)t.hasOwnProperty(n)&&e.check(n,t,i,o)}},{key:"check",value:function(t,i,o,n){void 0===o[t]&&void 0===o.__any__?e.getSuggestion(t,o,n):void 0===o[t]&&void 0!==o.__any__?"object"===e.getType(i[t])&&void 0!==o.__any__.__type__?e.checkFields(t,i,o,"__any__",o.__any__.__type__,n):e.checkFields(t,i,o,"__any__",o.__any__,n):void 0!==o[t].__type__?e.checkFields(t,i,o,t,o[t].__type__,n):e.checkFields(t,i,o,t,o[t],n)}},{key:"checkFields",value:function(t,i,o,n,s,h){var l=e.getType(i[t]),c=s[l];void 0!==c?"array"===e.getType(c)&&-1===c.indexOf(i[t])?(console.log('%cInvalid option detected in "'+t+'". Allowed values are:'+e.print(c)+' not "'+i[t]+'". '+e.printLocation(h,t),d),a=!0):"object"===l&&"__any__"!==n&&(h=r.copyAndExtendArray(h,t),e.parse(i[t],o[n],h)):void 0===s.any&&(console.log('%cInvalid type received for "'+t+'". Expected: '+e.print(Object.keys(s))+". Received ["+l+'] "'+i[t]+'"'+e.printLocation(h,t),d),a=!0)}},{key:"getType",value:function(e){var t="undefined"==typeof e?"undefined":n(e);return"object"===t?null===e?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":Array.isArray(e)?"array":e instanceof Date?"date":void 0!==e.nodeType?"dom":e._isAMomentObject===!0?"moment":"object":"number"===t?"number":"boolean"===t?"boolean":"string"===t?"string":void 0===t?"undefined":t}},{key:"getSuggestion",value:function(t,i,o){var n=e.findInOptions(t,i,o,!1),s=e.findInOptions(t,h,[],!0),r=8,l=4;void 0!==n.indexMatch?console.log('%cUnknown option detected: "'+t+'" in '+e.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n',d):s.distance<=l&&n.distance>s.distance?console.log('%cUnknown option detected: "'+t+'" in '+e.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+t+'". Did you mean "'+n.closestMatch+'"?'+e.printLocation(n.path,t),d):console.log('%cUnknown option detected: "'+t+'". Did you mean one of these: '+e.print(Object.keys(i))+e.printLocation(o,t),d),a=!0}},{key:"findInOptions",value:function(t,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3],s=1e9,a="",h=[],d=t.toLowerCase(),l=void 0;for(var c in i){var u=void 0;if(void 0!==i[c].__type__&&n===!0){var f=e.findInOptions(t,i[c],r.copyAndExtendArray(o,c));s>f.distance&&(a=f.closestMatch,h=f.path,s=f.distance,l=f.indexMatch)}else-1!==c.toLowerCase().indexOf(d)&&(l=c),u=e.levenshteinDistance(t,c),s>u&&(a=c,h=r.copyArray(o),s=u)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(e,t){for(var i=arguments.length<=2||void 0===arguments[2]?"Problem value found at: \n":arguments[2],o="\n\n"+i+"options = {\n",n=0;n<e.length;n++){for(var s=0;n+1>s;s++)o+=" ";o+=e[n]+": {\n"}for(var r=0;r<e.length+1;r++)o+=" ";o+=t+"\n";for(var a=0;a<e.length+1;a++){for(var h=0;h<e.length-a;h++)o+=" ";o+="}\n"}return o+"\n\n"}},{key:"print",value:function(e){return JSON.stringify(e).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var i,o=[];for(i=0;i<=t.length;i++)o[i]=[i];var n;for(n=0;n<=e.length;n++)o[0][n]=n;for(i=1;i<=t.length;i++)for(n=1;n<=e.length;n++)t.charAt(i-1)==e.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[t.length][e.length]}}]),e}();t["default"]=l,t.printStyle=d},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(36),a=o(r),h=i(16),d=o(h),l=i(1),c=i(8),u=i(10),f=function(){function e(t,i,o){var s=this;n(this,e),this.body=t,this.images=i,this.groups=o,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(e,t){s.add(t.items)},update:function(e,t){s.update(t.items)},remove:function(e,t){s.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1},middle:{enabled:!1,scaleFactor:1},from:{enabled:!1,scaleFactor:1}},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"},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,i,o){if(t===e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_forceDisableDynamicCurves",function(t){"dynamic"===t&&(t="continuous");var i=!1;for(var o in e.body.edges)if(e.body.edges.hasOwnProperty(o)){var n=e.body.edges[o],s=e.body.data.edges._data[o];if(void 0!==s){var r=s.smooth;void 0!==r&&r.enabled===!0&&"dynamic"===r.type&&(void 0===t?n.setOptions({smooth:!1}):n.setOptions({smooth:{type:t}}),i=!0)}}i===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges(),e.markAllEdgesAsDirty()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){l.forEach(e.edgesListeners,function(t,i){e.body.data.edges&&e.body.data.edges.off(i,t)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){a["default"].parseOptions(this.options,e),void 0!==e.color&&this.markAllEdgesAsDirty();var t=!1;if(void 0!==e.smooth)for(var i in this.body.edges)this.body.edges.hasOwnProperty(i)&&(t=this.body.edges[i].updateEdgeType()||t);if(void 0!==e.font){d["default"].parseOptions(this.options.font,e);for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&this.body.edges[o].updateLabelModule()}void 0===e.hidden&&void 0===e.physics&&t!==!0||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.edges;if(e instanceof c||e instanceof u)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new c,this.body.data.edges.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.edges=new c}if(o&&l.forEach(this.edgesListeners,function(e,t){o.off(t,e)}),this.body.edges={},this.body.data.edges){l.forEach(this.edgesListeners,function(e,i){t.body.data.edges.on(i,e)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;n<e.length;n++){var s=e[n],r=i[s];r&&r.disconnect();var a=o.get(s,{showInternalIds:!0});i[s]=this.create(a)}t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var t=this.body.edges,i=this.body.data.edges,o=!1,n=0;n<e.length;n++){var s=e[n],r=i.get(s),a=t[s];void 0!==a?(a.disconnect(),o=a.setOptions(r)||o,a.connect()):(this.body.edges[s]=this.create(r),o=!0)}o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.edges,i=0;i<e.length;i++){var o=e[i],n=t[o];void 0!==n&&(n.cleanup(),n.disconnect(),delete t[o])}this.body.emitter.emit("_dataChanged")}},{key:"refresh",value:function(){var e=this.body.edges;for(var t in e){var i=void 0;e.hasOwnProperty(t)&&(i=e[t]);var o=this.body.data.edges._data[t];void 0!==i&&void 0!==o&&i.setOptions(o)}}},{key:"create",value:function(e){return new a["default"](e,this.body,this.options)}},{key:"markAllEdgesAsDirty",value:function(){for(var e in this.body.edges)this.body.edges[e].edgeType.colorDirty=!0}},{key:"reconnectEdges",value:function(){var e,t=this.body.nodes,i=this.body.edges;for(e in t)t.hasOwnProperty(e)&&(t[e].edges=[]);for(e in i)if(i.hasOwnProperty(e)){var o=i[e];o.from=null,o.to=null,o.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.edges[e]){var i=this.body.edges[e];i.fromId&&t.push(i.fromId),i.toId&&t.push(i.toId)}return t}}]),e}();t["default"]=f},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(16),h=o(a),d=i(37),l=o(d),c=i(41),u=o(c),f=i(42),p=o(f),v=i(43),y=o(v),g=i(1),b=function(){function e(t,i,o){if(n(this,e),void 0===i)throw"No body provided";this.options=g.bridgeObject(o),this.globalOptions=o,this.body=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.colorDirty=!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 h["default"](this.body,this.options,!0),this.setOptions(t)}return r(e,[{key:"setOptions",value:function(t){if(t){this.colorDirty=!0,e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),
+void 0!==t.value&&(t.value=parseFloat(t.value)),this.updateLabelModule();var i=this.updateEdgeType();return this._setInteractionWidths(),this.connect(),void 0===t.hidden&&void 0===t.physics||(i=!0),i}}},{key:"updateLabelModule",value:function(){this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=!1,t=!0,i=this.options.smooth;return void 0!==this.edgeType&&(this.edgeType instanceof u["default"]&&i.enabled===!0&&"dynamic"===i.type&&(t=!1),this.edgeType instanceof l["default"]&&i.enabled===!0&&"cubicBezier"===i.type&&(t=!1),this.edgeType instanceof p["default"]&&i.enabled===!0&&"dynamic"!==i.type&&"cubicBezier"!==i.type&&(t=!1),this.edgeType instanceof y["default"]&&i.enabled===!1&&(t=!1),t===!0&&(e=this.cleanup())),t===!0?this.options.smooth.enabled===!0?"dynamic"===this.options.smooth.type?(e=!0,this.edgeType=new u["default"](this.options,this.body,this.labelModule)):"cubicBezier"===this.options.smooth.type?this.edgeType=new l["default"](this.options,this.body,this.labelModule):this.edgeType=new p["default"](this.options,this.body,this.labelModule):this.edgeType=new y["default"](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,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.width=this.options.scaling.min+o*n}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(e){var t=this.edgeType.getViaNode(),i={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,this.options.arrows.from.enabled===!0&&(i.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.fromPoint=i.from.core)),this.options.arrows.to.enabled===!0&&(i.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.toPoint=i.to.core)),this.options.arrows.middle.enabled===!0&&(i.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover)),this.edgeType.drawLine(e,this.selected,this.hover,t),this.drawArrows(e,i),this.drawLabel(e,t)}},{key:"drawArrows",value:function(e,t){this.options.arrows.from.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.from),this.options.arrows.middle.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.middle),this.options.arrows.to.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.to)}},{key:"drawLabel",value:function(e,t){if(void 0!==this.options.label){var i=this.from,o=this.to,n=this.from.selected||this.to.selected||this.selected;if(i.id!=o.id){this.labelModule.pointToSelf=!1;var s=this.edgeType.getPoint(.5,t);e.save(),"horizontal"!==this.options.font.align&&(this.labelModule.calculateLabelSize(e,n,s.x,s.y),e.translate(s.x,this.labelModule.size.yLine),this._rotateForLabelAlignment(e)),this.labelModule.draw(e,s.x,s.y,n),e.restore()}else{this.labelModule.pointToSelf=!0;var r,a,h=this.options.selfReferenceSize;i.shape.width>i.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(e,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=e.left,a=e.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return t>h}return!1}},{key:"_rotateForLabelAlignment",value:function(e){var t=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(t,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),e.rotate(o)}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(g.selectiveDeepExtend(n,e,t,i),g.mergeOptions(e,t,"smooth",i,o),g.mergeOptions(e,t,"shadow",i,o),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:i===!0&&null===t.dashes&&(e.dashes=Object.create(o.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),g.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)):i===!0&&null===t.scaling&&(e.scaling=Object.create(o.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var r=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=r.indexOf("to"),e.arrows.middle.enabled=-1!=r.indexOf("middle"),e.arrows.from.enabled=-1!=r.indexOf("from")}else{if("object"!==s(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));g.mergeOptions(e.arrows,t.arrows,"to",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"middle",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"from",i,o.arrows)}else i===!0&&null===t.arrows&&(e.arrows=Object.create(o.arrows));if(void 0!==t.color&&null!==t.color)if(e.color=g.deepExtend({},e.color,!0),g.isString(t.color))e.color.color=t.color,e.color.highlight=t.color,e.color.hover=t.color,e.color.inherit=!1;else{var a=!1;void 0!==t.color.color&&(e.color.color=t.color.color,a=!0),void 0!==t.color.highlight&&(e.color.highlight=t.color.highlight,a=!0),void 0!==t.color.hover&&(e.color.hover=t.color.hover,a=!0),void 0!==t.color.inherit&&(e.color.inherit=t.color.inherit),void 0!==t.color.opacity&&(e.color.opacity=Math.min(1,Math.max(0,t.color.opacity))),void 0===t.color.inherit&&a===!0&&(e.color.inherit=!1)}else i===!0&&null===t.color&&(e.color=g.bridgeObject(o.color));void 0!==t.font&&null!==t.font?h["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=g.bridgeObject(o.font))}}]),e}();t["default"]=b},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),d=i(38),l=o(d),c=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),h(t,[{key:"_line",value:function(e,t){var i=t[0],o=t[1];e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===t||void 0===i.x?e.lineTo(this.toPoint.x,this.toPoint.y):e.bezierCurveTo(i.x,i.y,o.x,o.y,this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"_getViaCoordinates",value:function(){var e=this.from.x-this.to.x,t=this.from.y-this.to.y,i=void 0,o=void 0,n=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*e,n=this.to.x+r*e):(o=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6],h=a(r,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(e,t,i,o,n,s,d,l)}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=a(t,2),o=i[0],n=i[1],s=e,r=[];r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3);var h=r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,d=r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y;return{x:h,y:d}}}]),t}(l["default"]);t["default"]=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(39),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_getDistanceToBezierEdge",value:function(e,t,i,o,n,s,r,a){var h=1e9,d=void 0,l=void 0,c=void 0,u=void 0,f=void 0,p=e,v=t,y=[0,0,0,0];for(l=1;10>l;l++)c=.1*l,y[0]=Math.pow(1-c,3),y[1]=3*c*Math.pow(1-c,2),y[2]=3*Math.pow(c,2)*(1-c),y[3]=Math.pow(c,3),u=y[0]*e+y[1]*r.x+y[2]*a.x+y[3]*i,f=y[0]*t+y[1]*r.y+y[2]*a.y+y[3]*o,l>0&&(d=this._getDistanceToLine(p,v,u,f,n,s),h=h>d?d:h),p=u,v=f;return h}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(40),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_findBorderPositionBezier",value:function(e,t){var i,o,n,s,r,a=arguments.length<=2||void 0===arguments[2]?this._getViaCoordinates():arguments[2],h=10,d=0,l=0,c=1,u=.2,f=this.to,p=!1;for(e.id===this.from.id&&(f=this.from,p=!0);c>=l&&h>d;){var v=.5*(l+c);if(i=this.getPoint(v,a),o=Math.atan2(f.y-i.y,f.x-i.x),n=f.distanceToBorder(t,o),s=Math.sqrt(Math.pow(i.x-f.x,2)+Math.pow(i.y-f.y,2)),r=n-s,Math.abs(r)<u)break;0>r?p===!1?l=v:c=v:p===!1?c=v:l=v,d++}return i.t=v,i}},{key:"_getDistanceToBezierEdge",value:function(e,t,i,o,n,s,r){var a=1e9,h=void 0,d=void 0,l=void 0,c=void 0,u=void 0,f=e,p=t;for(d=1;10>d;d++)l=.1*d,c=Math.pow(1-l,2)*e+2*l*(1-l)*r.x+Math.pow(l,2)*i,u=Math.pow(1-l,2)*t+2*l*(1-l)*r.y+Math.pow(l,2)*o,d>0&&(h=this._getDistanceToLine(f,p,c,u,n,s),a=a>h?h:a),f=c,p=u;return a}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(1),a=function(){function e(t,i,n){o(this,e),this.body=i,this.labelModule=n,this.options={},this.setOptions(t),this.colorDirty=!0,this.color={},this.selectionWidth=2,this.hoverWidth=1.5,this.fromPoint=this.from,this.toPoint=this.to}return s(e,[{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,t,i,o){e.strokeStyle=this.getColor(e,t,i),e.lineWidth=this.getLineWidth(t,i),this.options.dashes!==!1?this._drawDashedLine(e,o):this._drawLine(e,o)}},{key:"_drawLine",value:function(e,t,i,o){if(this.from!=this.to)this._line(e,t,i,o);else{var s=this._getCircleData(e),r=n(s,3),a=r[0],h=r[1],d=r[2];this._circle(e,a,h,d)}}},{key:"_drawDashedLine",value:function(e,t,i,o){e.lineCap="round";var s=[5,5];if(Array.isArray(this.options.dashes)===!0&&(s=this.options.dashes),void 0!==e.setLineDash){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t);else{var r=this._getCircleData(e),a=n(r,3),h=a[0],d=a[1],l=a[2];this._circle(e,h,d,l)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)e.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,s);else{var c=this._getCircleData(e),u=n(c,3),f=u[0],p=u[1],v=u[2];this._circle(e,f,p,v)}this.enableShadow(e),e.stroke(),this.disableShadow(e)}}},{key:"findBorderPosition",value:function(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}},{key:"findBorderPositions",value:function(e){var t={},i={};if(this.from!=this.to)t=this._findBorderPosition(this.from,e),i=this._findBorderPosition(this.to,e);else{var o=this._getCircleData(e),s=n(o,3),r=s[0],a=s[1];s[2];t=this._findBorderPositionCircle(this.from,e,{x:r,y:a,low:.25,high:.6,direction:-1}),i=this._findBorderPositionCircle(this.from,e,{x:r,y:a,low:.6,high:.8,direction:1})}return{from:t,to:i}}},{key:"_getCircleData",value:function(e){var t=void 0,i=void 0,o=this.from,n=this.options.selfReferenceSize;return void 0!==e&&void 0===o.shape.width&&o.shape.resize(e),o.shape.width>o.shape.height?(t=o.x+.5*o.shape.width,i=o.y-n):(t=o.x+n,i=o.y-.5*o.shape.height),[t,i,n]}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,c=void 0,u=void 0,f=void 0,p=void 0,v=void 0,y=.05,g=.5*(s+r);r>=s&&h>d&&(g=.5*(s+r),c=this._pointOnCircle(o,n,l,g),u=Math.atan2(e.y-c.y,e.x-c.x),f=e.distanceToBorder(t,u),p=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),v=f-p,!(Math.abs(v)<y));)v>0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return c.t=g,c}},{key:"getLineWidth",value:function(e,t){return e===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(e,t,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,t===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(e,t,i,o){this.enableShadow(e),e.beginPath(),e.arc(t,i,o,0,2*Math.PI,!1),e.stroke(),this.disableShadow(e)}},{key:"getDistanceToEdge",value:function(e,t,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(e,t,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),c=l[0],u=l[1],f=l[2],p=c-s,v=u-r;h=Math.abs(Math.sqrt(p*p+v*v)-f)}return this.labelModule.size.left<s&&this.labelModule.size.left+this.labelModule.size.width>s&&this.labelModule.size.top<r&&this.labelModule.size.top+this.labelModule.size.height>r?0:h}},{key:"_getDistanceToLine",value:function(e,t,i,o,n,s){var r=i-e,a=o-t,h=r*r+a*a,d=((n-e)*r+(s-t)*a)/h;d>1?d=1:0>d&&(d=0);var l=e+d*r,c=t+d*a,u=l-n,f=c-s;return Math.sqrt(u*u+f*f)}},{key:"getArrowData",value:function(e,t,i,o,s){var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,c=void 0,u=this.getLineWidth(o,s);if("from"===t?(h=this.from,d=this.to,l=.1,c=this.options.arrows.from.scaleFactor):"to"===t?(h=this.to,d=this.from,l=-.1,c=this.options.arrows.to.scaleFactor):(h=this.to,d=this.from,c=this.options.arrows.middle.scaleFactor),h!=d)if("middle"!==t)if(this.options.smooth.enabled===!0){a=this.findBorderPosition(h,e,{via:i});var f=this.getPoint(Math.max(0,Math.min(1,a.t+l)),i);r=Math.atan2(a.y-f.y,a.x-f.x)}else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.findBorderPosition(h,e);else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.getPoint(.5,i);else{var p=this._getCircleData(e),v=n(p,3),y=v[0],g=v[1],b=v[2];"from"===t?(a=this.findBorderPosition(this.from,e,{x:y,y:g,low:.25,high:.6,direction:-1}),r=-2*a.t*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===t?(a=this.findBorderPosition(this.from,e,{x:y,y:g,low:.6,high:1,direction:1}),r=-2*a.t*Math.PI+1.5*Math.PI-1.1*Math.PI):(a=this._pointOnCircle(y,g,b,.175),r=3.9269908169872414)}var m=15*c+3*u,_=a.x-.9*m*Math.cos(r),w=a.y-.9*m*Math.sin(r),k={x:_,y:w};return{point:a,core:k,angle:r,length:m}}},{key:"drawArrowHead",value:function(e,t,i,o){e.strokeStyle=this.getColor(e,t,i),e.fillStyle=e.strokeStyle,e.lineWidth=this.getLineWidth(t,i),e.arrow(o.point.x,o.point.y,o.angle,o.length),this.enableShadow(e),e.fill(),this.disableShadow(e)}},{key:"enableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor=this.options.shadow.color,e.shadowBlur=this.options.shadow.size,e.shadowOffsetX=this.options.shadow.x,e.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}]),e}();t["default"]=a},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(39),d=o(h),l=function(e){function t(e,i,o){n(this,t);var r=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return r._boundFunction=function(){r.positionBezierNode()},r.body.emitter.on("_repositionBezierNodes",r._boundFunction),r}return r(t,e),a(t,[{key:"setOptions",value:function(e){var t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(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||this.options.physics===!1?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):!1}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var e="edgeId:"+this.id,t=this.body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this.body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===t.x?e.lineTo(this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.via:arguments[1],i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){return this._getDistanceToBezierEdge(e,t,i,o,n,s,this.via)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(39),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===t.x?e.lineTo(this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var e=void 0,t=void 0,i=this.options.smooth.roundness,o=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===o||"diagonalCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y+i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s)),"discrete"===o&&(e=i*s>n?this.from.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y+i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n)),"discrete"===o&&(t=i*n>s?this.from.y:t));else if("straightCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(e=this.from.x,t=this.from.y<this.to.y?this.to.y-(1-i)*s:this.to.y+(1-i)*s):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(e=this.from.x<this.to.x?this.to.x-(1-i)*n:this.to.x+(1-i)*n,t=this.from.y);else if("horizontal"===o)e=this.from.x<this.to.x?this.to.x-(1-i)*n:this.to.x+(1-i)*n,t=this.from.y;else if("vertical"===o)e=this.from.x,t=this.from.y<this.to.y?this.to.y-(1-i)*s:this.to.y+(1-i)*s;else if("curvedCW"===o){n=this.to.x-this.from.x,s=this.from.y-this.to.y;var r=Math.sqrt(n*n+s*s),a=Math.PI,h=Math.atan2(s,n),d=(h+(.5*i+.5)*a)%(2*a);e=this.from.x+(.5*i+.5)*r*Math.sin(d),t=this.from.y+(.5*i+.5)*r*Math.cos(d)}else if("curvedCCW"===o){n=this.to.x-this.from.x,s=this.from.y-this.to.y;var l=Math.sqrt(n*n+s*s),c=Math.PI,u=Math.atan2(s,n),f=(u+(.5*-i+.5)*c)%(2*c);e=this.from.x+(.5*i+.5)*l*Math.sin(f),t=this.from.y+(.5*i+.5)*l*Math.cos(f)}else Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s,e=this.to.x<e?this.to.x:e):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s,e=this.to.x>e?this.to.x:e):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y+i*s,e=this.to.x<e?this.to.x:e):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s,e=this.to.x>e?this.to.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y+i*n,t=this.to.y<t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n,t=this.to.y<t?this.to.y:t)));return{x:e,y:t}}},{key:"_findBorderPosition",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this._findBorderPositionBezier(e,t,i.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6];return this._getDistanceToBezierEdge(e,t,i,o,n,s,r)}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(40),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_line",value:function(e){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}},{key:"_findBorderPosition",value:function(e,t){var i=this.to,o=this.from;e.id===this.from.id&&(i=this.from,
+o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),h=e.distanceToBorder(t,n),d=(a-h)/a,l={};return l.x=(1-d)*o.x+d*i.x,l.y=(1-d)*o.y+d*i.y,l}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){return this._getDistanceToLine(e,t,i,o,n,s)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(45),a=o(r),h=i(46),d=o(h),l=i(47),c=o(l),u=i(48),f=o(u),p=i(49),v=o(p),y=i(50),g=o(y),b=i(51),m=o(b),_=i(52),w=o(_),k=i(1),x=function(){function e(t){n(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},k.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){void 0!==e&&(e===!1?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):(this.physicsEnabled=!0,k.selectiveNotDeepExtend(["stabilization"],this.options,e),k.mergeOptions(this.options,e,"stabilization"),void 0===e.enabled&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var e;"forceAtlas2Based"===this.options.solver?(e=this.options.forceAtlas2Based,this.nodesSolver=new m["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new w["default"](this.body,this.physicsBody,e)):"repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new d["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new c["default"](this.body,this.physicsBody,e),this.edgesSolver=new v["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new a["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?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(){this.physicsEnabled===!0&&this.options.enabled===!0?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];this.stabilized=!0,e===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick();var t=Date.now()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.stabilizationIterations:arguments[0];(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))):(this.calculateForces(),this.moveNodes()),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.calculateForces(),this.moveNodes();this.stabilized===!0&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var i in e)e.hasOwnProperty(i)&&e[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(var o in t)t.hasOwnProperty(o)&&t[o].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[o].id);for(var n=0;n<this.physicsBody.physicsNodeIndices.length;n++){var s=this.physicsBody.physicsNodeIndices[n];this.physicsBody.forces[s]={x:0,y:0},void 0===this.physicsBody.velocities[s]&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var r in this.physicsBody.velocities)void 0===e[r]&&delete this.physicsBody.velocities[r]}},{key:"revert",value:function(){var e=Object.keys(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var o=0;o<e.length;o++){var n=e[o];void 0!==t[n]?t[n].options.physics===!0&&(this.referenceState[n]={positions:{x:t[n].x,y:t[n].y}},i[n].x=this.previousStates[n].vx,i[n].y=this.previousStates[n].vy,t[n].x=this.previousStates[n].x,t[n].y=this.previousStates[n].y):delete this.previousStates[n]}}},{key:"_evaluateStepQuality",value:function(){var e=void 0,t=void 0,i=void 0,o=this.body.nodes,n=this.referenceState,s=.3;for(var r in this.referenceState)if(this.referenceState.hasOwnProperty(r)&&void 0!==o[r]&&(e=o[r].x-n[r].positions.x,t=o[r].y-n[r].positions.y,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),i>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;s<e.length;s++){var r=e[s],a=this._performStep(r,t);i=Math.max(i,a),o+=a}this.adaptiveTimestepEnabled=o/e.length<n,this.stabilized=i<this.options.minVelocity}},{key:"_performStep",value:function(e,t){var i=this.body.nodes[e],o=this.timestep,n=this.physicsBody.forces,s=this.physicsBody.velocities;if(this.previousStates[e]={x:i.x,y:i.y,vx:s[e].x,vy:s[e].y},i.options.fixed.x===!1){var r=this.modelOptions.damping*s[e].x,a=(n[e].x-r)/i.options.mass;s[e].x+=a*o,s[e].x=Math.abs(s[e].x)>t?s[e].x>0?t:-t:s[e].x,i.x+=s[e].x*o}else n[e].x=0,s[e].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[e].y,d=(n[e].y-h)/i.options.mass;s[e].y+=d*o,s[e].y=Math.abs(s[e].y)>t?s[e].y>0?t:-t:s[e].y,i.y+=s[e].y*o}else n[e].y=0,s[e].y=0;var l=Math.sqrt(Math.pow(s[e].x,2)+Math.pow(s[e].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&e[t].x&&e[t].y&&(this.freezeCache[t]={x:e[t].options.fixed.x,y:e[t].options.fixed.y},e[t].options.fixed.x=!0,e[t].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.options.stabilization.iterations:arguments[0];return"number"!=typeof t&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),t=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return e._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var e=0;this.stabilized===!1&&e<this.options.stabilization.updateInterval&&this.stabilizationIterations<this.targetIterations;)this.physicsTick(),e++;this.stabilized===!1&&this.stabilizationIterations<this.targetIterations?(this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations}),setTimeout(this._stabilizationBatch.bind(this),0)):this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var i=this.body.nodes[this.physicsBody.physicsNodeIndices[t]],o=this.physicsBody.forces[this.physicsBody.physicsNodeIndices[t]],n=20,s=.03,r=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),a=Math.min(Math.max(5,r),15),h=3*a,d=k.HSVToHex((180-180*Math.min(1,Math.max(0,s*r)))/360,1,1);e.lineWidth=a,e.strokeStyle=d,e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(i.x+n*o.x,i.y+n*o.y),e.stroke();var l=Math.atan2(o.y,o.x);e.fillStyle=d,e.arrow(i.x+n*o.x+Math.cos(l)*h,i.y+n*o.y+Math.sin(l)*h,l,h),e.fill()}}}]),e}();t["default"]=x},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return o(e,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var e=void 0,t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(t,i);this.barnesHutTree=n;for(var s=0;o>s;s++)e=t[i[s]],e.options.mass>0&&(this._getForceContribution(n.root.children.NW,e),this._getForceContribution(n.root.children.NE,e),this._getForceContribution(n.root.children.SW,e),this._getForceContribution(n.root.children.SE,e))}}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,n=Math.sqrt(i*i+o*o),n*e.calcSize>this.thetaInversed?this._calculateForces(n,i,o,t,e):4===e.childrenCount?(this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)):e.children.data.id!=t.id&&this._calculateForces(n,i,o,t,e)}}},{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(e,3),r=t*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(e,t){for(var i=void 0,o=t.length,n=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,h=1;o>h;h++){var d=e[t[h]].x,l=e[t[h]].y;e[t[h]].options.mass>0&&(n>d&&(n=d),d>r&&(r=d),s>l&&(s=l),l>a&&(a=l))}var c=Math.abs(r-n)-Math.abs(a-s);c>0?(s-=.5*c,a+=.5*c):(n+=.5*c,r-=.5*c);var u=1e-5,f=Math.max(u,Math.abs(r-n)),p=.5*f,v=.5*(n+r),y=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:y-p,maxY:y+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var b=0;o>b;b++)i=e[t[b]],i.options.mass>0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(e,t){var i=e.mass+t.options.mass,o=1/i;e.centerOfMass.x=e.centerOfMass.x*e.mass+t.x*t.options.mass,e.centerOfMass.x*=o,e.centerOfMass.y=e.centerOfMass.y*e.mass+t.y*t.options.mass,e.centerOfMass.y*=o,e.mass=i;var n=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<n?n:e.maxWidth}},{key:"_placeInTree",value:function(e,t,i){1==i&&void 0!==i||this._updateBranchMass(e,t),e.children.NW.range.maxX>t.x?e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NW"):this._placeInRegion(e,t,"SW"):e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NE"):this._placeInRegion(e,t,"SE")}},{key:"_placeInRegion",value:function(e,t,i){switch(e.children[i].childrenCount){case 0:e.children[i].children.data=t,e.children[i].childrenCount=1,this._updateBranchMass(e.children[i],t);break;case 1:e.children[i].children.data.x===t.x&&e.children[i].children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(e.children[i]),this._placeInTree(e.children[i],t));break;case 4:this._placeInTree(e.children[i],t)}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY,s=e.range.minY+r;break;case"NE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY,s=e.range.minY+r;break;case"SW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY+r,s=e.range.maxY;break;case"SE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY+r,s=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){void 0===i&&(i="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,o,n,s,r,a,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,c=this.options.nodeDistance,u=-2/3/c,f=4/3,p=0;p<d.length-1;p++){r=h[d[p]];for(var v=p+1;v<d.length;v++)a=h[d[v]],e=a.x-r.x,t=a.y-r.y,i=Math.sqrt(e*e+t*t),0===i&&(i=.1*Math.random(),e=i),2*c>i&&(s=.5*c>i?1:u*i+f,s/=i,o=e*s,n=t*s,l[r.id].x-=o,l[r.id].y-=n,l[a.id].x+=o,l[a.id].y+=n)}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){var e,t,i,o,n,s,r,a,h,d,l=this.body.nodes,c=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,f=this.options.nodeDistance;for(h=0;h<c.length-1;h++)for(r=l[c[h]],d=h+1;d<c.length;d++)if(a=l[c[d]],r.level===a.level){e=a.x-r.x,t=a.y-r.y,i=Math.sqrt(e*e+t*t);var p=.05;s=f>i?-Math.pow(p*i,2)+Math.pow(p*f,2):0,0===i?i=.01:s/=i,o=e*s,n=t*s,u[r.id].x-=o,u[r.id].y-=n,u[a.id].x+=o,u[a.id].y+=n}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=void 0,t=void 0,i=this.physicsBody.physicsEdgeIndices,o=this.body.edges,n=void 0,s=void 0,r=void 0,a=0;a<i.length;a++)t=o[i[a]],t.connected===!0&&t.toId!==t.fromId&&void 0!==this.body.nodes[t.toId]&&void 0!==this.body.nodes[t.fromId]&&(void 0!==t.edgeType.via?(e=void 0===t.options.length?this.options.springLength:t.options.length,n=t.to,s=t.edgeType.via,r=t.from,this._calculateSpringForce(n,s,.5*e),this._calculateSpringForce(s,r,.5*e)):(e=void 0===t.options.length?1.5*this.options.springLength:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}},{key:"_calculateSpringForce",value:function(e,t,i){var o=e.x-t.x,n=e.y-t.y,s=Math.max(Math.sqrt(o*o+n*n),.01),r=this.options.springConstant*(i-s)/s,a=o*r,h=n*r;void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x+=a,this.physicsBody.forces[e.id].y+=h),void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x-=a,this.physicsBody.forces[t.id].y-=h)}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,o,n,s,r,a,h=this.body.edges,d=.5,l=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,f=0;f<c.length;f++){var p=c[f];u[p].springFx=0,u[p].springFy=0}for(var v=0;v<l.length;v++)t=h[l[v]],t.connected===!0&&(e=void 0===t.options.length?this.options.springLength:t.options.length,i=t.from.x-t.to.x,o=t.from.y-t.to.y,a=Math.sqrt(i*i+o*o),a=0===a?.01:a,r=this.options.springConstant*(e-a)/a,n=i*r,s=o*r,t.to.level!=t.from.level?(void 0!==u[t.toId]&&(u[t.toId].springFx-=n,u[t.toId].springFy-=s),void 0!==u[t.fromId]&&(u[t.fromId].springFx+=n,u[t.fromId].springFy+=s)):(void 0!==u[t.toId]&&(u[t.toId].x-=d*n,u[t.toId].y-=d*s),void 0!==u[t.fromId]&&(u[t.fromId].x+=d*n,u[t.fromId].y+=d*s)));for(var y,g,r=1,b=0;b<c.length;b++){var m=c[b];y=Math.min(r,Math.max(-r,u[m].springFx)),g=Math.min(r,Math.max(-r,u[m].springFy)),u[m].x+=y,u[m].y+=g}for(var _=0,w=0,k=0;k<c.length;k++){var x=c[k];_+=u[x].x,w+=u[x].y}for(var O=_/c.length,E=w/c.length,M=0;M<c.length;M++){var D=c[M];u[D].x-=O,u[D].y-=E}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=void 0,t=void 0,i=void 0,o=void 0,n=this.body.nodes,s=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=0;a<s.length;a++){var h=s[a];o=n[h],e=-o.x,t=-o.y,i=Math.sqrt(e*e+t*t),this._calculateForces(i,e,t,r,o)}}},{key:"_calculateForces",value:function(e,t,i,o,n){var s=0===e?0:this.options.centralGravity/e;o[n.id].x=t*s,o[n.id].y=i*s}}]),e}();t["default"]=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(45),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(e=.1*Math.random(),t=e),this.overlapAvoidanceFactor<1&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=o.edges.length+1,r=this.options.gravitationalConstant*n.mass*o.options.mass*s/Math.pow(e,2),a=t*r,h=i*r;this.physicsBody.forces[o.id].x+=a,this.physicsBody.forces[o.id].y+=h}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(50),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_calculateForces",value:function(e,t,i,o,n){if(e>0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=t*r,o[n.id].y=i*r}}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(54),h=o(a),d=i(55),l=o(d),c=i(1),u=function(){function e(t){var i=this;n(this,e),this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},c.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return r(e,[{key:"setOptions",value:function(e){}},{key:"clusterByHubsize",value:function(e,t){void 0===e?e=this._getHubSize():"object"===("undefined"==typeof e?"undefined":s(e))&&(t=this._checkOptions(e),e=this._getHubSize());for(var i=[],o=0;o<this.body.nodeIndices.length;o++){var n=this.body.nodes[this.body.nodeIndices[o]];n.edges.length>=e&&i.push(n.id)}for(var r=0;r<i.length;r++)this.clusterByConnection(i[r],t,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if(void 0===e.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);for(var i={},o={},n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodeIndices[n],r=this.body.nodes[s],a=h["default"].cloneOptions(r);if(e.joinCondition(a)===!0){i[s]=this.body.nodes[s];for(var d=0;d<r.edges.length;d++){var l=r.edges[d];void 0===this.clusteredEdges[l.id]&&(o[l.id]=l)}}}this._cluster(i,o,e,t)}},{key:"clusterByEdgeCount",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];t=this._checkOptions(t);for(var o=[],n={},s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,c=0;c<this.body.nodeIndices.length;c++){var u={},f={};if(d=this.body.nodeIndices[c],void 0===n[d]){l=0,a=this.body.nodes[d],r=[];for(var p=0;p<a.edges.length;p++)s=a.edges[p],void 0===this.clusteredEdges[s.id]&&(s.toId!==s.fromId&&l++,r.push(s));if(l===e){for(var v=!0,y=0;y<r.length;y++){s=r[y];var g=this._getConnectedId(s,d);if(void 0===t.joinCondition)f[s.id]=s,u[d]=this.body.nodes[d],u[g]=this.body.nodes[g],n[d]=!0;else{var b=h["default"].cloneOptions(this.body.nodes[d]);if(t.joinCondition(b)!==!0){v=!1;break}f[s.id]=s,u[d]=this.body.nodes[d],n[d]=!0}}Object.keys(u).length>0&&Object.keys(f).length>0&&v===!0&&o.push({nodes:u,edges:f})}}}for(var m=0;m<o.length;m++)this._cluster(o[m].nodes,o[m].edges,t,!1);i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===e)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[e])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];t=this._checkOptions(t,o),void 0===t.clusterNodeProperties.x&&(t.clusterNodeProperties.x=o.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=o.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},s={},r=o.id,a=h["default"].cloneOptions(o);n[r]=o;for(var d=0;d<o.edges.length;d++){var l=o.edges[d];if(void 0===this.clusteredEdges[l.id]){var c=this._getConnectedId(l,r);if(void 0===this.clusteredNodes[c])if(c!==r)if(void 0===t.joinCondition)s[l.id]=l,n[c]=this.body.nodes[c];else{var u=h["default"].cloneOptions(this.body.nodes[c]);t.joinCondition(a,u)===!0&&(s[l.id]=l,n[c]=this.body.nodes[c])}else s[l.id]=l}}this._cluster(n,s,t,i)}},{key:"_createClusterEdges",value:function(e,t,i,o){for(var n=void 0,s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,u=Object.keys(e),f=[],p=0;p<u.length;p++){s=u[p],r=e[s];for(var v=0;v<r.edges.length;v++)n=r.edges[v],void 0===this.clusteredEdges[n.id]&&(n.toId==n.fromId?t[n.id]=n:n.toId==s?(a=i.id,d=n.fromId,l=d):(a=n.toId,d=i.id,l=a),void 0===e[l]&&f.push({edge:n,fromId:d,toId:a}))}for(var y=0;y<f.length;y++){var g=f[y].edge,b=h["default"].cloneOptions(g,"edge");c.deepExtend(b,o),b.from=f[y].fromId,b.to=f[y].toId,b.id="clusterEdge:"+c.randomUUID();var m=this.body.functions.createEdge(b);
+m.clusteringEdgeReplacingId=g.id,this.body.edges[m.id]=m,m.connect(),this._backupEdgeOptions(g),g.setOptions({physics:!1,hidden:!0})}}},{key:"_checkOptions",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];if(!(Object.keys(e).length<2)){for(var n in e)if(e.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var s=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var r=[];for(var a in e)if(e.hasOwnProperty(a)){var d=h["default"].cloneOptions(e[a]);r.push(d)}var u=[];for(var f in t)if(t.hasOwnProperty(f)&&"clusterEdge:"!==f.substr(0,12)){var p=h["default"].cloneOptions(t[f],"edge");u.push(p)}if(s=i.processProperties(s,r,u),!s)throw new Error("The processProperties function does not return properties!")}void 0===s.id&&(s.id="cluster:"+c.randomUUID());var v=s.id;void 0===s.label&&(s.label="cluster");var y=void 0;void 0===s.x&&(y=this._getClusterPosition(e),s.x=y.x),void 0===s.y&&(void 0===y&&(y=this._getClusterPosition(e)),s.y=y.y),s.id=v;var g=this.body.functions.createNode(s,l["default"]);g.isCluster=!0,g.containedNodes=e,g.containedEdges=t,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[s.id]=g,this._createClusterEdges(e,t,s,i.clusterEdgeProperties);for(var b in t)if(t.hasOwnProperty(b)&&void 0!==this.body.edges[b]){var m=this.body.edges[b];this._backupEdgeOptions(m),m.setOptions({physics:!1,hidden:!0})}for(var _ in e)e.hasOwnProperty(_)&&(this.clusteredNodes[_]={clusterId:s.id,node:this.body.nodes[_]},this.body.nodes[_].setOptions({hidden:!0,physics:!1}));s.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics,hidden:e.options.hidden})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics,hidden:t.hidden}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var t=Object.keys(e),i=e[t[0]].x,o=e[t[0]].x,n=e[t[0]].y,s=e[t[0]].y,r=void 0,a=1;a<t.length;a++)r=e[t[a]],i=r.x<i?r.x:i,o=r.x>o?r.x:o,n=r.y<n?r.y:n,s=r.y>s?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[e])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[e].containedNodes)return void console.log("The node:"+e+" is not a cluster.");var o=this.body.nodes[e],n=o.containedNodes,s=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=t.releaseFunction(a,r);for(var f in n)if(n.hasOwnProperty(f)){var p=this.body.nodes[f];void 0!==u[f]&&(p.x=void 0===u[f].x?o.x:u[f].x,p.y=void 0===u[f].y?o.y:u[f].y)}}else for(var v in n)if(n.hasOwnProperty(v)){var y=this.body.nodes[v];y=n[v],y.options.fixed.x===!1&&(y.x=o.x),y.options.fixed.y===!1&&(y.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var b=this.body.nodes[g];b.vx=o.vx,b.vy=o.vy,b.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var m=[],_=0;_<o.edges.length;_++)m.push(o.edges[_]);for(var w=0;w<m.length;w++){var k=m[w],x=this._getConnectedId(k,e);if(void 0!==this.clusteredNodes[x]){var O=this.body.nodes[this.clusteredNodes[x].clusterId],E=this.body.edges[k.clusteringEdgeReplacingId];if(void 0!==E){O.containedEdges[E.id]=E,delete s[E.id];var M=E.fromId,D=E.toId;E.toId==x?D=this.clusteredNodes[x].clusterId:M=this.clusteredNodes[x].clusterId;var S=h["default"].cloneOptions(E,"edge");c.deepExtend(S,O.clusterEdgeProperties);var C="clusterEdge:"+c.randomUUID();c.deepExtend(S,{from:M,to:D,hidden:!1,physics:!0,id:C});var T=this.body.functions.createEdge(S);T.clusteringEdgeReplacingId=E.id,this.body.edges[C]=T,this.body.edges[C].connect()}}else{var P=this.body.edges[k.clusteringEdgeReplacingId];void 0!==P&&this._restoreEdge(P)}k.cleanup(),k.disconnect(),delete this.body.edges[k.id]}for(var B in s)s.hasOwnProperty(B)&&this._restoreEdge(s[B]);delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var t=[];if(this.isCluster(e)===!0){var i=this.body.nodes[e].containedNodes;for(var o in i)i.hasOwnProperty(o)&&t.push(this.body.nodes[o].id)}return t}},{key:"findNode",value:function(e){for(var t=[],i=100,o=0;void 0!==this.clusteredNodes[e]&&i>o;)t.push(this.body.nodes[e].id),e=this.clusteredNodes[e].clusterId,o++;return t.push(this.body.nodes[e].id),t.reverse(),t}},{key:"_getConnectedId",value:function(e,t){return e.toId!=t?e.toId:e.fromId!=t?e.fromId:e.fromId}},{key:"_getHubSize",value:function(){for(var e=0,t=0,i=0,o=0,n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodes[this.body.nodeIndices[n]];s.edges.length>o&&(o=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i,t/=i;var r=t-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return h>o&&(h=o),h}}]),e}();t["default"]=u},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=function(){function e(){o(this,e)}return n(e,null,[{key:"getRange",value:function(e){var t,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.shape.boundingBox.left&&(s=t.shape.boundingBox.left),r<t.shape.boundingBox.right&&(r=t.shape.boundingBox.right),o>t.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n<t.shape.boundingBox.bottom&&(n=t.shape.boundingBox.bottom);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"getRangeCore",value:function(e){var t,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.x&&(s=t.x),r<t.x&&(r=t.x),o>t.y&&(o=t.y),n<t.y&&(n=t.y);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var i={};return void 0===t||"node"===t?(s.deepExtend(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):s.deepExtend(i,e.options,!0),i}}]),e}();t["default"]=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(15),h=o(a),d=function(e){function t(e,i,o,r,a){n(this,t);var h=s(this,Object.getPrototypeOf(t).call(this,e,i,o,r,a));return h.isCluster=!0,h.containedNodes={},h.containedEdges={},h}return r(t,e),t}(h["default"]);t["default"]=d},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}();"undefined"!=typeof window&&(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame);var s=i(1),r=function(){function e(t,i){o(this,e),this.body=t,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.pixelRatio=void 0,this.allowRedraw=!0,this.dragging=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideNodesOnDrag:!1},s.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return n(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){return e.dragging=!1}),this.body.emitter.on("_resizeNodes",function(){return e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(t,this.options,e)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){e._redraw(!1)},0):window.requestAnimationFrame(function(){e._redraw(!1)}))}},{key:"_redraw",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),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 i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(t),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var e=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,i=void 0;for(var o in t)t.hasOwnProperty(o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l<o.length;l++)n=i[o[l]],n.isSelected()?s.push(o[l]):t===!0?n.draw(e):n.isBoundingBoxOverlappingWith(d)===!0?n.draw(e):n.updateBoundingBox(e,n.selected);for(var c=0;c<s.length;c++)n=i[s[c]],n.draw(e)}},{key:"_drawEdges",value:function(e){for(var t=this.body.edges,i=this.body.edgeIndices,o=void 0,n=0;n<i.length;n++)o=t[i[n]],o.connected===!0&&o.draw(e)}},{key:"_determineBrowserMethod",value:function(){if("undefined"!=typeof window){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1!=e.indexOf("msie 9.0")?this.requiresTimeout=!0:-1!=e.indexOf("safari")&&e.indexOf("chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}}]),e}();t["default"]=r},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(58),r=i(61),a=i(1),h=function(){function e(t){o(this,e),this.body=t,this.pixelRatio=1,this.resizeTimer=void 0,this.resizeFunction=this._onResize.bind(this),this.cameraState={},this.initialized=!1,this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},a.extend(this.options,this.defaultOptions),this.bindEventListeners()}return n(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.once("resize",function(t){0!==t.width&&(e.body.view.translation.x=.5*t.width),0!==t.height&&(e.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(void 0!==e){var i=["width","height","autoResize"];a.selectiveDeepExtend(i,this.options,e)}this.options.autoResize===!0&&(this._cleanUp(),this.resizeTimer=setInterval(function(){var e=t.setSize();e===!0&&t.body.emitter.emit("_requestRedraw")},1e3),this.resizeFunction=this._onResize.bind(this),a.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),a.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.pixelRatio:arguments[0];this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=e&&1!=t?i=.5*this.cameraState.scale*(e+t):1!=e?i=this.cameraState.scale*e:1!=t&&(i=this.cameraState.scale*t),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(-1!==e.indexOf("%")||-1!==e.indexOf("px"))return e;if(-1===e.indexOf("%"))return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var e=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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 e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_ALL}),r.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new s(this.frame),r.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.options.width:arguments[0],t=arguments.length<=1||void 0===arguments[1]?this.options.height:arguments[1];e=this._prepareValue(e),t=this._prepareValue(t);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t?(this._getCameraState(r),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,i=!0):(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._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(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(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}();t["default"]=h},function(e,t,i){if("undefined"!=typeof window){var o=i(59),n=window.Hammer||i(60);e.exports=o(n,{preventDefault:"mouse"})}else e.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(e,t,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(function(){var e=null;return function t(i,o){function n(e){return e.match(/[^ ]+/g)}function s(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var i=!1;t.stopPropagation=function(){i=!0};var o=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof o&&(t.srcEvent.stopPropagation=function(){o(),t.stopPropagation()}),t.firstTarget=e;for(var n=e;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a<s.length;a++)if(r=s[a]._handlers[t.type])for(var h=0;h<r.length&&!i;h++)r[h](t);n=n.parentNode}}var r=o||{preventDefault:!1};if(i.Manager){var a=i,h=function(e,i){var o=Object.create(r);return i&&a.assign(o,i),t(new a(e,o),o)};return a.assign(h,a),h.Manager=function(e,i){var o=Object.create(r);return i&&a.assign(o,i),t(new a.Manager(e,o),o)},h}var d=Object.create(i),l=i.element;return l.hammer||(l.hammer=[]),l.hammer.push(d),i.on("hammer.input",function(t){r.preventDefault!==!0&&r.preventDefault!==t.pointerType||t.preventDefault(),t.isFirst&&(e=t.target)}),d._handlers={},d.on=function(e,t){return n(e).forEach(function(e){var o=d._handlers[e];o||(d._handlers[e]=o=[],i.on(e,s)),o.push(t)}),d},d.off=function(e,t){return n(e).forEach(function(e){var o=d._handlers[e];o&&(o=t?o.filter(function(e){return e!==t}):[],o.length>0?d._handlers[e]=o:(i.off(e,s),delete d._handlers[e]))}),d},d.emit=function(t,o){e=o.target,i.emit(t,o)},d.destroy=function(){var e=i.element.hammer,t=e.indexOf(d);-1!==t&&e.splice(t,1),e.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(e,t,i){var o;/*! Hammer.JS - v2.0.6 - 2015-12-23
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2015 Jorik Tangelder;
+ * Licensed under the license */
+!function(n,s,r,a){function h(e,t,i){return setTimeout(f(e,i),t)}function d(e,t,i){return Array.isArray(e)?(l(e,i[t],i),!0):!1}function l(e,t,i){var o;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(o=0;o<e.length;)t.call(i,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(i,e[o],o,e)}function c(e,t,i){var o="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),e.apply(this,arguments)}}function u(e,t,i){var o,n=t.prototype;o=e.prototype=Object.create(n),o.constructor=e,o._super=n,i&&ce(o,i)}function f(e,t){return function(){return e.apply(t,arguments)}}function p(e,t){return typeof e==pe?e.apply(t?t[0]||a:a,t):e}function v(e,t){return e===a?t:e}function y(e,t,i){l(_(t),function(t){e.addEventListener(t,i,!1)})}function g(e,t,i){l(_(t),function(t){e.removeEventListener(t,i,!1)})}function b(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function w(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var o=0;o<e.length;){if(i&&e[o][i]==t||!i&&e[o]===t)return o;o++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function x(e,t,i){for(var o=[],n=[],s=0;s<e.length;){var r=t?e[s][t]:e[s];w(n,r)<0&&o.push(e[s]),n[s]=r,s++}return i&&(o=t?o.sort(function(e,i){return e[t]>i[t]}):o.sort()),o}function O(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;s<ue.length;){if(i=ue[s],o=i?i+n:t,o in e)return o;s++}return a}function E(){return _e++}function M(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||n}function D(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){p(e.options.enable,[e])&&i.handler(t)},this.init()}function S(e){var t,i=e.options.inputClass;return new(t=i?i:xe?W:Oe?V:ke?G:H)(e,C)}function C(e,t,i){var o=i.pointers.length,n=i.changedPointers.length,s=t&Te&&o-n===0,r=t&(Be|Fe)&&o-n===0;i.isFirst=!!s,i.isFinal=!!r,s&&(e.session={}),i.eventType=t,T(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function T(e,t){var i=e.session,o=t.pointers,n=o.length;i.firstInput||(i.firstInput=F(t)),n>1&&!i.firstMultiple?i.firstMultiple=F(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=I(o);t.timeStamp=ge(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=R(a,h),t.distance=z(a,h),P(i,t),t.offsetDirection=N(t.deltaX,t.deltaY);var d=j(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=ye(d.x)>ye(d.y)?d.x:d.y,t.scale=r?L(r.pointers,o):1,t.rotation=r?A(r.pointers,o):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,B(i,t);var l=e.element;b(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function P(e,t){var i=t.center,o=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};t.eventType!==Te&&s.eventType!==Be||(n=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-o.x),t.deltaY=n.y+(i.y-o.y)}function B(e,t){var i,o,n,s,r=e.lastInterval||t,h=t.timeStamp-r.timeStamp;if(t.eventType!=Fe&&(h>Ce||r.velocity===a)){var d=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,c=j(h,d,l);o=c.x,n=c.y,i=ye(c.x)>ye(c.y)?c.x:c.y,s=N(d,l),e.lastInterval=t}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=o,t.velocityY=n,t.direction=s}function F(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:ve(e.pointers[i].clientX),clientY:ve(e.pointers[i].clientY)},i++;return{timeStamp:ge(),pointers:t,center:I(t),deltaX:e.deltaX,deltaY:e.deltaY}}function I(e){var t=e.length;if(1===t)return{x:ve(e[0].clientX),y:ve(e[0].clientY)};for(var i=0,o=0,n=0;t>n;)i+=e[n].clientX,o+=e[n].clientY,n++;return{x:ve(i/t),y:ve(o/t)}}function j(e,t,i){return{x:t/e||0,y:i/e||0}}function N(e,t){return e===t?Ie:ye(e)>=ye(t)?0>e?je:Ne:0>t?ze:Re}function z(e,t,i){i||(i=We);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(o*o+n*n)}function R(e,t,i){i||(i=We);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,o)/Math.PI}function A(e,t){return R(t[1],t[0],Ye)+R(e[1],e[0],Ye)}function L(e,t){return z(t[0],t[1],Ye)/z(e[0],e[1],Ye)}function H(){this.evEl=Ve,this.evWin=qe,this.allow=!0,this.pressed=!1,D.apply(this,arguments)}function W(){this.evEl=Ke,this.evWin=Ze,D.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=Je,this.evWin=$e,this.started=!1,D.apply(this,arguments)}function U(e,t){var i=k(e.touches),o=k(e.changedTouches);return t&(Be|Fe)&&(i=x(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=tt,this.targetIds={},D.apply(this,arguments)}function q(e,t){var i=k(e.touches),o=this.targetIds;if(t&(Te|Pe)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=k(e.changedTouches),a=[],h=this.target;if(s=i.filter(function(e){return b(e.target,h)}),t===Te)for(n=0;n<s.length;)o[s[n].identifier]=!0,n++;for(n=0;n<r.length;)o[r[n].identifier]&&a.push(r[n]),t&(Be|Fe)&&delete o[r[n].identifier],n++;return a.length?[x(s.concat(a),"identifier",!0),a]:void 0}function G(){D.apply(this,arguments);var e=f(this.handler,this);this.touch=new V(this.manager,e),this.mouse=new H(this.manager,e)}function X(e,t){this.manager=e,this.set(t)}function K(e){if(m(e,at))return at;var t=m(e,ht),i=m(e,dt);return t&&i?at:t||i?t?ht:dt:m(e,rt)?rt:st}function Z(e){this.options=ce({},this.defaults,e||{}),this.id=E(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=lt,this.simultaneous={},this.requireFail=[]}function Q(e){return e&vt?"cancel":e&ft?"end":e&ut?"move":e&ct?"start":""}function J(e){return e==Re?"down":e==ze?"up":e==je?"left":e==Ne?"right":""}function $(e,t){var i=t.manager;return i?i.get(e):e}function ee(){Z.apply(this,arguments)}function te(){ee.apply(this,arguments),this.pX=null,this.pY=null}function ie(){ee.apply(this,arguments)}function oe(){Z.apply(this,arguments),this._timer=null,this._input=null}function ne(){ee.apply(this,arguments)}function se(){ee.apply(this,arguments)}function re(){Z.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ae(e,t){return t=t||{},t.recognizers=v(t.recognizers,ae.defaults.preset),new he(e,t)}function he(e,t){this.options=ce({},ae.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.element=e,this.input=S(this),this.touchAction=new X(this,this.options.touchAction),de(this,!0),l(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function de(e,t){var i=e.element;i.style&&l(e.options.cssProps,function(e,o){i.style[O(i.style,o)]=t?e:""})}function le(e,t){var i=s.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}var ce,ue=["","webkit","Moz","MS","ms","o"],fe=s.createElement("div"),pe="function",ve=Math.round,ye=Math.abs,ge=Date.now;ce="function"!=typeof Object.assign?function(e){if(e===a||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var o=arguments[i];if(o!==a&&null!==o)for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t}:Object.assign;var be=c(function(e,t,i){for(var o=Object.keys(t),n=0;n<o.length;)(!i||i&&e[o[n]]===a)&&(e[o[n]]=t[o[n]]),n++;return e},"extend","Use `assign`."),me=c(function(e,t){return be(e,t,!0)},"merge","Use `assign`."),_e=1,we=/mobile|tablet|ip(ad|hone|od)|android/i,ke="ontouchstart"in n,xe=O(n,"PointerEvent")!==a,Oe=ke&&we.test(navigator.userAgent),Ee="touch",Me="pen",De="mouse",Se="kinect",Ce=25,Te=1,Pe=2,Be=4,Fe=8,Ie=1,je=2,Ne=4,ze=8,Re=16,Ae=je|Ne,Le=ze|Re,He=Ae|Le,We=["x","y"],Ye=["clientX","clientY"];D.prototype={handler:function(){},init:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(M(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(M(this.element),this.evWin,this.domHandler)}};var Ue={mousedown:Te,mousemove:Pe,mouseup:Be},Ve="mousedown",qe="mousemove mouseup";u(H,D,{handler:function(e){var t=Ue[e.type];t&Te&&0===e.button&&(this.pressed=!0),t&Pe&&1!==e.which&&(t=Be),this.pressed&&this.allow&&(t&Be&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:De,srcEvent:e}))}});var Ge={pointerdown:Te,pointermove:Pe,pointerup:Be,pointercancel:Fe,pointerout:Fe},Xe={2:Ee,3:Me,4:De,5:Se},Ke="pointerdown",Ze="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Ke="MSPointerDown",Ze="MSPointerMove MSPointerUp MSPointerCancel"),u(W,D,{handler:function(e){var t=this.store,i=!1,o=e.type.toLowerCase().replace("ms",""),n=Ge[o],s=Xe[e.pointerType]||e.pointerType,r=s==Ee,a=w(t,e.pointerId,"pointerId");n&Te&&(0===e.button||r)?0>a&&(t.push(e),a=t.length-1):n&(Be|Fe)&&(i=!0),0>a||(t[a]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))}});var Qe={touchstart:Te,touchmove:Pe,touchend:Be,touchcancel:Fe},Je="touchstart",$e="touchstart touchmove touchend touchcancel";u(Y,D,{handler:function(e){var t=Qe[e.type];if(t===Te&&(this.started=!0),this.started){var i=U.call(this,e,t);t&(Be|Fe)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Ee,srcEvent:e})}}});var et={touchstart:Te,touchmove:Pe,touchend:Be,touchcancel:Fe},tt="touchstart touchmove touchend touchcancel";u(V,D,{handler:function(e){var t=et[e.type],i=q.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Ee,srcEvent:e})}}),u(G,D,{handler:function(e,t,i){var o=i.pointerType==Ee,n=i.pointerType==De;if(o)this.mouse.allow=!1;else if(n&&!this.mouse.allow)return;t&(Be|Fe)&&(this.mouse.allow=!0),this.callback(e,t,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var it=O(fe.style,"touchAction"),ot=it!==a,nt="compute",st="auto",rt="manipulation",at="none",ht="pan-x",dt="pan-y";X.prototype={set:function(e){e==nt&&(e=this.compute()),ot&&this.manager.element.style&&(this.manager.element.style[it]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return l(this.manager.recognizers,function(t){p(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),K(e.join(" "))},preventDefaults:function(e){if(!ot){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var o=this.actions,n=m(o,at),s=m(o,dt),r=m(o,ht);if(n){var a=1===e.pointers.length,h=e.distance<2,d=e.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return n||s&&i&Ae||r&&i&Le?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var lt=1,ct=2,ut=4,ft=8,pt=ft,vt=16,yt=32;Z.prototype={defaults:{},set:function(e){return ce(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=$(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)?this:(e=$(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return e=$(e,this),-1===w(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=$(e,this);var t=w(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){i.manager.emit(t,e)}var i=this,o=this.state;ft>o&&t(i.options.event+Q(o)),t(i.options.event),e.additionalEvent&&t(e.additionalEvent),o>=ft&&t(i.options.event+Q(o))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=yt)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(yt|lt)))return!1;e++}return!0},recognize:function(e){var t=ce({},e);return p(this.options.enable,[this,t])?(this.state&(pt|vt|yt)&&(this.state=lt),this.state=this.process(t),void(this.state&(ct|ut|ft|vt)&&this.tryEmit(t))):(this.reset(),void(this.state=yt))},process:function(e){},getTouchAction:function(){},reset:function(){}},u(ee,Z,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,o=t&(ct|ut),n=this.attrTest(e);return o&&(i&Fe||!n)?t|vt:o||n?i&Be?t|ft:t&ct?t|ut:ct:yt}}),u(te,ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:He},getTouchAction:function(){var e=this.options.direction,t=[];return e&Ae&&t.push(dt),e&Le&&t.push(ht),t},directionTest:function(e){var t=this.options,i=!0,o=e.distance,n=e.direction,s=e.deltaX,r=e.deltaY;return n&t.direction||(t.direction&Ae?(n=0===s?Ie:0>s?je:Ne,i=s!=this.pX,o=Math.abs(e.deltaX)):(n=0===r?Ie:0>r?ze:Re,i=r!=this.pY,o=Math.abs(e.deltaY))),e.direction=n,i&&o>t.threshold&&n&t.direction},attrTest:function(e){return ee.prototype.attrTest.call(this,e)&&(this.state&ct||!(this.state&ct)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=J(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),u(ie,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ct)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),u(oe,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[st]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance<t.threshold,n=e.deltaTime>t.time;if(this._input=e,!o||!i||e.eventType&(Be|Fe)&&!n)this.reset();else if(e.eventType&Te)this.reset(),this._timer=h(function(){this.state=pt,this.tryEmit()},t.time,this);else if(e.eventType&Be)return pt;return yt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===pt&&(e&&e.eventType&Be?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ge(),this.manager.emit(this.options.event,this._input)))}}),u(ne,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ct)}}),u(se,ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ae|Le,pointers:1},getTouchAction:function(){return te.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(Ae|Le)?t=e.overallVelocity:i&Ae?t=e.overallVelocityX:i&Le&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&ye(t)>this.options.velocity&&e.eventType&Be},emit:function(e){var t=J(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),u(re,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rt]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance<t.threshold,n=e.deltaTime<t.time;if(this.reset(),e.eventType&Te&&0===this.count)return this.failTimeout();if(o&&n&&i){if(e.eventType!=Be)return this.failTimeout();var s=this.pTime?e.timeStamp-this.pTime<t.interval:!0,r=!this.pCenter||z(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,r&&s?this.count+=1:this.count=1,this._input=e;var a=this.count%t.taps;if(0===a)return this.hasRequireFailures()?(this._timer=h(function(){this.state=pt,this.tryEmit()},t.interval,this),ct):pt}return yt},failTimeout:function(){return this._timer=h(function(){this.state=yt},this.options.interval,this),yt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==pt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ae.VERSION="2.0.6",ae.defaults={domEvents:!1,touchAction:nt,enable:!0,inputTarget:null,inputClass:null,preset:[[ne,{enable:!1}],[ie,{enable:!1},["rotate"]],[se,{direction:Ae}],[te,{direction:Ae},["swipe"]],[re],[re,{event:"doubletap",taps:2},["tap"]],[oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var gt=1,bt=2;he.prototype={set:function(e){return ce(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?bt:gt},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var i,o=this.recognizers,n=t.curRecognizer;(!n||n&&n.state&pt)&&(n=t.curRecognizer=null);for(var s=0;s<o.length;)i=o[s],t.stopped===bt||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(e),!n&&i.state&(ct|ut|ft)&&(n=t.curRecognizer=i),s++}},get:function(e){if(e instanceof Z)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=w(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){var i=this.handlers;return l(_(e),function(e){i[e]=i[e]||[],i[e].push(t)}),this},off:function(e,t){var i=this.handlers;return l(_(e),function(e){t?i[e]&&i[e].splice(w(i[e],t),1):delete i[e]}),this},emit:function(e,t){this.options.domEvents&&le(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var o=0;o<i.length;)i[o](t),o++}},destroy:function(){this.element&&de(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ce(ae,{INPUT_START:Te,INPUT_MOVE:Pe,INPUT_END:Be,INPUT_CANCEL:Fe,STATE_POSSIBLE:lt,STATE_BEGAN:ct,STATE_CHANGED:ut,STATE_ENDED:ft,STATE_RECOGNIZED:pt,STATE_CANCELLED:vt,STATE_FAILED:yt,DIRECTION_NONE:Ie,DIRECTION_LEFT:je,DIRECTION_RIGHT:Ne,DIRECTION_UP:ze,DIRECTION_DOWN:Re,DIRECTION_HORIZONTAL:Ae,DIRECTION_VERTICAL:Le,DIRECTION_ALL:He,Manager:he,Input:D,TouchAction:X,TouchInput:V,MouseInput:H,PointerEventInput:W,TouchMouseInput:G,SingleTouchInput:Y,Recognizer:Z,AttrRecognizer:ee,Tap:re,Pan:te,Swipe:se,Pinch:ie,Rotate:ne,Press:oe,on:y,off:g,each:l,merge:me,extend:be,assign:ce,inherit:u,bindFn:f,prefixed:O});var mt="undefined"!=typeof n?n:"undefined"!=typeof self?self:{};mt.Hammer=ae,o=function(){return ae}.call(t,i,t,e),!(o!==a&&(e.exports=o))}(window,document,"Hammer")},function(e,t,i){i(58);t.onTouch=function(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on("hammer.input",t.inputHandler)},t.onRelease=function(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on("hammer.input",t.inputHandler)},t.offTouch=function(e,t){e.off("hammer.input",t.inputHandler)},t.offRelease=t.offTouch,t.disablePreventDefaultVertically=function(e){var t="pan-y";return e.getTouchAction=function(){return[t]},e}},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(54),a=o(r),h=i(1),d=function(){function e(t,i){var o=this;n(this,e),this.body=t,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(){o.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return s(e,[{key:"setOptions",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=e}},{key:"fit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{nodes:[]}:arguments[0],t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=void 0;if(void 0!==e.nodes&&0!==e.nodes.length||(e.nodes=this.body.nodeIndices),t===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(e,!1);i=a["default"].getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a["default"].getRange(this.body.nodes,e.nodes);var l=1.1*Math.abs(i.maxX-i.minX),c=1.1*Math.abs(i.maxY-i.minY),u=this.canvas.frame.canvas.clientWidth/l,f=this.canvas.frame.canvas.clientHeight/c;o=f>=u?u:f}o>1?o=1:0===o&&(o=1);var p=a["default"].findCenter(i),v={position:p,scale:o,animation:e.animation};this.moveTo(v)}},{key:"focus",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(void 0!==this.body.nodes[e]){var i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){return void 0===e?void(e={}):(void 0===e.offset&&(e.offset={x:0,y:0}),void 0===e.offset.x&&(e.offset.x=0),void 0===e.offset.y&&(e.offset.y=0),void 0===e.scale&&(e.scale=this.body.view.scale),void 0===e.position&&(e.position=this.getViewPosition()),void 0===e.animation&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),void this.animateView(e))}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},0===e.animation.duration?void 0!=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*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=h.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}();t["default"]=d},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(64),a=o(r),h=i(66),d=o(h),l=i(1),c=function(){function e(t,i,o){n(this,e),this.body=t,this.canvas=i,this.selectionHandler=o,this.navigationHandler=new a["default"](t,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},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];l.selectiveNotDeepExtend(t,this.options,e),l.mergeOptions(this.options,e,"keyboard"),e.tooltip&&(l.extend(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=l.parseColor(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-l.getAbsoluteLeft(this.canvas.frame.canvas),y:e.y-l.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),c=l.nodesChanged,u=l.edgesChanged,f=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",t,e),r=!0,f=!0):c===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),this.selectionHandler._generateClickEvent("selectNode",t,e),f=!0,r=!0):0>h-n&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),r=!0),a-o>0&&f===!1?(this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):a>0&&u===!0?(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):0>a-o&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineIfDifferent",value:function(e,t){for(var i=!1,o=!1,n=0;n<e.nodes.length;n++)-1===t.nodes.indexOf(e.nodes[n])&&(i=!0);for(var s=0;s<t.nodes.length;s++)-1===e.nodes.indexOf(e.nodes[s])&&(i=!0);for(var r=0;r<e.edges.length;r++)-1===t.edges.indexOf(e.edges[r])&&(o=!0);for(var a=0;a<t.edges.length;a++)-1===e.edges.indexOf(e.edges[a])&&(o=!0);return{nodesChanged:i,edgesChanged:o}}},{key:"onDragStart",value:function(e){void 0===this.drag.pointer&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=l.extend({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==t&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(t)),this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer);var i=this.selectionHandler.selectionObj.nodes;for(var o in i)if(i.hasOwnProperty(o)){var n=i[o],s={id:n.id,node:n,x:n.x,y:n.y,xFixed:n.options.fixed.x,
+yFixed:n.options.fixed.y};n.options.fixed.x=!0,n.options.fixed.y=!0,this.drag.selection.push(s)}}else this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(e){var t=this;if(this.drag.pinched!==!0){this.body.emitter.emit("unlockNode");var i=this.getPointer(e.center),o=this.drag.selection;if(o&&o.length&&this.options.dragNodes===!0)!function(){t.selectionHandler._generateClickEvent("dragging",e,i);var n=i.x-t.drag.pointer.x,s=i.y-t.drag.pointer.y;o.forEach(function(e){var i=e.node;e.xFixed===!1&&(i.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+n)),e.yFixed===!1&&(i.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+s))}),t.body.emitter.emit("startSimulation")}();else if(this.options.dragView===!0){if(this.selectionHandler._generateClickEvent("dragging",e,i,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var n=i.x-this.drag.pointer.x,s=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+s},this.body.emitter.emit("_redraw")}}}},{key:"onDragEnd",value:function(e){this.drag.dragging=!1;var t=this.drag.selection;t&&t.length?(t.forEach(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var i=this.pinch.scale*e.scale;this.zoom(i,t)}},{key:"zoom",value:function(e,t){if(this.options.zoomView===!0){var i=this.body.view.scale;1e-5>e&&(e=1e-5),e>10&&(e=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=e/i,r=(1-s)*t.x+n.x*s,a=(1-s)*t.y+n.y*s;if(this.body.view.scale=e,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),e>i?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}}},{key:"onMouseWheel",value:function(e){if(this.options.zoomView===!0){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!==t){var i=this.body.view.scale,o=t/10;0>t&&(o/=1-o),i*=1+o;var n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(i,n)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,i=this.getPointer({x:e.clientX,y:e.clientY}),o=!1;if(void 0!==this.popup&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(o=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),o===!1&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=setTimeout(function(){return t._checkShowPopup(i)},this.options.tooltipDelay))),this.options.hover===!0){var n=this.selectionHandler.getNodeAt(i);void 0===n&&(n=this.selectionHandler.getEdgeAt(i)),this.selectionHandler.hoverObject(n)}}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},n=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,h=this.body.nodes,l=void 0,c=[],u=0;u<a.length;u++)l=h[a[u]],l.isOverlappingWith(o)===!0&&void 0!==l.getTitle()&&c.push(a[u]);c.length>0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var f=this.body.edgeIndices,p=this.body.edges,v=void 0,y=[],g=0;g<f.length;g++)v=p[f[g]],v.isOverlappingWith(o)===!0&&v.connected===!0&&void 0!==v.getTitle()&&y.push(f[g]);y.length>0&&(this.popupObj=p[y[y.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d["default"](this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){var o=this.selectionHandler.getNodeAt(e);i=o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}();t["default"]=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=(i(1),i(58)),r=i(61),a=i(65),h=function(){function e(t,i){var n=this;o(this,e),this.body=t,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 n(e,[{key:"setOptions",value:function(e){void 0!==e&&(this.options=e,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],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 o=0;o<t.length;o++){this.navigationDOM[t[o]]=document.createElement("div"),this.navigationDOM[t[o]].className="vis-button vis-"+t[o],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[o]]);var n=new s(this.navigationDOM[t[o]]);"_fit"===i[o]?r.onTouch(n,this._fit.bind(this)):r.onTouch(n,this.bindToRedraw.bind(this,i[o])),this.navigationHammers.push(n)}var a=new s(this.canvas.frame);r.onRelease(a,function(){e._stopMovement()}),this.navigationHammers.push(a),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){void 0===this.boundFunctions[e]&&(this.boundFunctions[e]=this[e].bind(this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering"))}},{key:"unbindFromRedraw",value:function(e){void 0!==this.boundFunctions[e]&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)this.boundFunctions.hasOwnProperty(e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){this.body.view.scale*=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{key:"_zoomOut",value:function(){this.body.view.scale/=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}();t["default"]=h},function(e,t,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(this,function(){function e(e){var t,i=e&&e.preventDefault||!1,o=e&&e.container||window,n={},s={keydown:{},keyup:{}},r={};for(t=97;122>=t;t++)r[String.fromCharCode(t)]={code:65+(t-97),shift:!1};for(t=65;90>=t;t++)r[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;9>=t;t++)r[""+t]={code:48+t,shift:!1};for(t=1;12>=t;t++)r["F"+t]={code:111+t,shift:!1};for(t=0;9>=t;t++)r["num"+t]={code:96+t,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(e){d(e,"keydown")},h=function(e){d(e,"keyup")},d=function(e,t){if(void 0!==s[t][e.keyCode]){for(var o=s[t][e.keyCode],n=0;n<o.length;n++)void 0===o[n].shift?o[n].fn(e):1==o[n].shift&&1==e.shiftKey?o[n].fn(e):0==o[n].shift&&0==e.shiftKey&&o[n].fn(e);1==i&&e.preventDefault()}};return n.bind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===r[e])throw new Error("unsupported key: "+e);void 0===s[i][r[e].code]&&(s[i][r[e].code]=[]),s[i][r[e].code].push({fn:t,shift:r[e].shift})},n.bindAll=function(e,t){void 0===t&&(t="keydown");for(var i in r)r.hasOwnProperty(i)&&n.bind(i,e,t)},n.getKey=function(e){for(var t in r)if(r.hasOwnProperty(t)){if(1==e.shiftKey&&1==r[t].shift&&e.keyCode==r[t].code)return t;if(0==e.shiftKey&&0==r[t].shift&&e.keyCode==r[t].code)return t;if(e.keyCode==r[t].code&&"shift"==t)return t}return"unknown key, currently not supported"},n.unbind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===r[e])throw new Error("unsupported key: "+e);if(void 0!==t){var o=[],n=s[i][r[e].code];if(void 0!==n)for(var a=0;a<n.length;a++)n[a].fn==t&&n[a].shift==r[e].shift||o.push(s[i][r[e].code][a]);s[i][r[e].code]=o}else s[i][r[e].code]=[]},n.reset=function(){s={keydown:{},keyup:{}}},n.destroy=function(){s={keydown:{},keyup:{}},o.removeEventListener("keydown",a,!0),o.removeEventListener("keyup",h,!0)},o.addEventListener("keydown",a,!0),o.addEventListener("keyup",h,!0),n}return e})},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t){i(this,e),this.container=t,this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-network-tooltip",this.container.appendChild(this.frame)}return o(e,[{key:"setPosition",value:function(e,t){this.x=parseInt(e),this.y=parseInt(t)}},{key:"setText",value:function(e){e instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(e)):this.frame.innerHTML=e}},{key:"show",value:function(e){if(void 0===e&&(e=!0),e===!0){var t=this.frame.clientHeight,i=this.frame.clientWidth,o=this.frame.parentNode.clientHeight,n=this.frame.parentNode.clientWidth,s=this.y-t;s+t+this.padding>o&&(s=o-t-this.padding),s<this.padding&&(s=this.padding);var r=this.x;r+i+this.padding>n&&(r=n-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.visibility="hidden"}}]),e}();t["default"]=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(15),a=o(r),h=i(36),d=o(h),l=i(1),c=function(){function e(t,i){var o=this;n(this,e),this.body=t,this.canvas=i,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},l.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){o.updateSelection()})}return s(e,[{key:"setOptions",value:function(e){if(void 0!==e){var t=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];l.selectiveDeepExtend(t,this.options,e)}}},{key:"selectOnPoint",value:function(e){var t=!1;if(this.options.selectable===!0){var i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),void 0!==i&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}},{key:"selectAdditionalOnPoint",value:function(e){var t=!1;if(this.options.selectable===!0){var i=this.getNodeAt(e)||this.getEdgeAt(e);void 0!==i&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}},{key:"_generateClickEvent",value:function(e,t,i,o){var n=arguments.length<=4||void 0===arguments[4]?!1:arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=t,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.options.selectConnectedEdges:arguments[1];return void 0!==e?(e instanceof a["default"]&&t===!0&&this._selectConnectedEdges(e),e.select(),this._addToSelection(e),!0):!1}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],i=this.body.nodes,o=0;o<this.body.nodeIndices.length;o++){var n=this.body.nodeIndices[o];i[n].isOverlappingWith(e)&&t.push(n)}return t}},{key:"_pointerToPositionObject",value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:"getNodeAt",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],i=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(i);return o.length>0?t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var i=this.body.edges,o=0;o<this.body.edgeIndices.length;o++){var n=this.body.edgeIndices[o];i[n].isOverlappingWith(e)&&t.push(n)}}},{key:"_getAllEdgesOverlappingWith",value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:"getEdgeAt",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],i=this._pointerToPositionObject(e),o=this._getAllEdgesOverlappingWith(i);return o.length>0?t===!0?this.body.edges[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_addToSelection",value:function(e){e instanceof a["default"]?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof a["default"]?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof a["default"]?(delete this.selectionObj.nodes[e.id],this._unselectConnectedEdges(e)):delete this.selectionObj.edges[e.id]}},{key:"unselectAll",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&this.selectionObj.edges[t].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedNode",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return this.selectionObj.nodes[e]}},{key:"_getSelectedEdge",value:function(){for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return this.selectionObj.edges[e]}},{key:"_getSelectedEdgeCount",value:function(){var e=0;for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedObjectCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(e+=1);return e}},{key:"_selectionIsEmpty",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return!1;for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].clusterSize>1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.select(),this._addToSelection(i)}}},{key:"_hoverConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.hover=!0,this._addToHover(i)}}},{key:"_unselectConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.unselect(),this._removeFromSelection(i)}}},{key:"blurObject",value:function(e){e.hover===!0&&(e.hover=!1,e instanceof a["default"]?this.body.emitter.emit("blurNode",{node:e.id}):this.body.emitter.emit("blurEdge",{edge:e.id}))}},{key:"hoverObject",value:function(e){var t=!1;for(var i in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(i)&&(void 0===e||e instanceof a["default"]&&e.id!=i||e instanceof d["default"])&&(this.blurObject(this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],t=!0);for(var o in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(o)&&(t===!0?(this.hoverObj.edges[o].hover=!1,delete this.hoverObj.edges[o]):void 0===e&&(this.blurObject(this.hoverObj.edges[o]),delete this.hoverObj.edges[o],t=!0));void 0!==e&&(e.hover===!1&&(e.hover=!0,this._addToHover(e),t=!0,e instanceof a["default"]?this.body.emitter.emit("hoverNode",{node:e.id}):this.body.emitter.emit("hoverEdge",{edge:e.id})),e instanceof a["default"]&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(e)),t===!0&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){var e=this.getSelectedNodes(),t=this.getSelectedEdges();return{nodes:e,edges:t}}},{key:"getSelectedNodes",value:function(){var e=[];if(this.options.selectable===!0)for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&e.push(this.selectionObj.nodes[t].id);return e}},{key:"getSelectedEdges",value:function(){var e=[];if(this.options.selectable===!0)for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&e.push(this.selectionObj.edges[t].id);return e}},{key:"setSelection",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=void 0,o=void 0;if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),e.nodes)for(i=0;i<e.nodes.length;i++){o=e.nodes[i];var n=this.body.nodes[o];if(!n)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(n,t.highlightEdges)}if(e.edges)for(i=0;i<e.edges.length;i++){o=e.edges[i];var s=this.body.edges[o];if(!s)throw new RangeError('Edge with id "'+o+'" not found');this.selectObject(s)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(this.body.nodes.hasOwnProperty(e)||delete this.selectionObj.nodes[e]);for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(this.body.edges.hasOwnProperty(t)||delete this.selectionObj.edges[t])}}]),e}();t["default"]=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(54),d=o(h),l=i(1),c=function(){function e(t){n(this,e),this.body=t,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,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return a(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()})}},{key:"setOptions",value:function(e,t){if(void 0!==e){var i=this.options.hierarchical.enabled;if(l.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,e),l.mergeOptions(this.options,e,"hierarchical"),void 0!==e.randomSeed&&(this.initialRandomSeed=e.randomSeed),this.options.hierarchical.enabled===!0)return i===!0&&this.body.emitter.emit("refresh",!0),"RL"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.options.hierarchical.levelSeparation>0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(i===!0)return this.body.emitter.emit("refresh"),l.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){void 0===e.physics||e.physics===!0?(e.physics={enabled:void 0===this.optionsBackup.physics.enabled?!0:this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled?!0:this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===r(e.physics)?(this.optionsBackup.physics.enabled=void 0===e.physics.enabled?!0:e.physics.enabled,this.optionsBackup.physics.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var t="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(t="vertical"),void 0===e.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1}):void 0===e.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1):"boolean"==typeof e.edges.smooth?(this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t}):(void 0!==e.edges.smooth.type&&"dynamic"!==e.edges.smooth.type&&(t=e.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===e.edges.smooth.enabled?!0:e.edges.smooth.enabled,type:void 0===e.edges.smooth.type?"dynamic":e.edges.smooth.type,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0===e.edges.smooth.forceDirection?!1:e.edges.smooth.forceDirection},e.edges.smooth={enabled:void 0===e.edges.smooth.enabled?!0:e.edges.smooth.enabled,type:t,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0===e.edges.smooth.forceDirection?!1:e.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var t=0;t<e.length;t++){var i=e[t],o=1*e.length+10,n=2*Math.PI*this.seededRandom();void 0===i.x&&(i.x=o*Math.cos(n)),void 0===i.y&&(i.y=o*Math.sin(n))}}}},{key:"layoutNetwork",value:function(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){for(var e=0,t=0;t<this.body.nodeIndices.length;t++){var i=this.body.nodes[this.body.nodeIndices[t]];i.predefinedPosition===!0&&(e+=1)}if(e<.5*this.body.nodeIndices.length){var o=10,n=0,s=100;if(this.body.nodeIndices.length>s){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)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*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l<this.body.nodeIndices.length;l++)this.body.nodes[this.body.nodeIndices[l]].x+=(.5-this.seededRandom())*d,this.body.nodes[this.body.nodeIndices[l]].y+=(.5-this.seededRandom())*d;this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=d["default"].getRangeCore(this.body.nodes,this.body.nodeIndices),t=d["default"].findCenter(e),i=0;i<this.body.nodeIndices.length;i++)this.body.nodes[this.body.nodeIndices[i]].x-=t.x,this.body.nodes[this.body.nodeIndices[i]].y-=t.y}},{key:"_declusterAll",value:function(){for(var e=!0;e===!0;){e=!1;for(var t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){var e=void 0,t=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(e=this.body.nodes[t],void 0===e.options.x&&void 0===e.options.y&&(o=!1),void 0!==e.options.level?(i=!0,this.hierarchicalLevels[t]=e.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");
+n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},o=function(){for(var t=a(),i=0;i<t.length-1;i++){var o=t[i].max-t[i+1].min;n(i+1,o+e.options.hierarchical.treeSpacing)}},n=function(t,i){for(var o in e.hierarchicalTrees)if(e.hierarchicalTrees.hasOwnProperty(o)&&e.hierarchicalTrees[o]===t){var n=e.body.nodes[o],s=e._getPositionForHierarchy(n);e._setPositionForHierarchy(n,s+i,void 0,!0)}},r=function(t){var i=1e9,o=-1e9;for(var n in e.hierarchicalTrees)if(e.hierarchicalTrees.hasOwnProperty(n)&&e.hierarchicalTrees[n]===t){var s=e._getPositionForHierarchy(e.body.nodes[n]);i=Math.min(s,i),o=Math.max(s,o)}return{min:i,max:o}},a=function(){for(var t=[],i=0;i<=e.treeIndex;i++)t.push(r(i));return t},h=function _(t,i){if(i[t.id]=!0,e.hierarchicalChildrenReference[t.id]){var o=e.hierarchicalChildrenReference[t.id];if(o.length>0)for(var n=0;n<o.length;n++)_(e.body.nodes[o[n]],i)}},d=function(t){var i=arguments.length<=1||void 0===arguments[1]?1e9:arguments[1],o=1e9,n=1e9,r=1e9,a=-1e9;for(var h in t)if(t.hasOwnProperty(h)){var d=e.body.nodes[h],l=e.hierarchicalLevels[d.id],c=e._getPositionForHierarchy(d),u=e._getSpaceAroundNode(d,t),f=s(u,2),p=f[0],v=f[1];o=Math.min(p,o),n=Math.min(v,n),i>=l&&(r=Math.min(c,r),a=Math.max(c,a))}return[r,a,o,n]},l=function w(t){var i=e.hierarchicalLevels[t];if(e.hierarchicalChildrenReference[t]){var o=e.hierarchicalChildrenReference[t];if(o.length>0)for(var n=0;n<o.length;n++)i=Math.max(i,w(o[n]))}return i},c=function(e,t){var i=l(e.id),o=l(t.id);return Math.min(i,o)},u=function(t,i){var o=e.hierarchicalParentReference[t.id],n=e.hierarchicalParentReference[i.id];if(void 0===o||void 0===n)return!1;for(var s=0;s<o.length;s++)for(var r=0;r<n.length;r++)if(o[s]==n[r])return!0;return!1},f=function(t,i,o){for(var n=0;n<i.length;n++){var s=i[n],r=e.distributionOrdering[s];if(r.length>1)for(var a=0;a<r.length-1;a++)u(r[a],r[a+1])===!0&&e.hierarchicalTrees[r[a].id]===e.hierarchicalTrees[r[a+1].id]&&t(r[a],r[a+1],o)}},p=function(i,o){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],r=e._getPositionForHierarchy(i),a=e._getPositionForHierarchy(o),l=Math.abs(a-r);if(l>e.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var f={};f[o.id]=!0,h(i,u),h(o,f);var p=c(i,o),v=d(u,p),y=s(v,4),g=(y[0],y[1]),b=(y[2],y[3],d(f,p)),m=s(b,4),_=m[0],w=(m[1],m[2]),k=(m[3],Math.abs(g-_));if(k>e.options.hierarchical.nodeSpacing){var x=g-_+e.options.hierarchical.nodeSpacing;x<-w+e.options.hierarchical.nodeSpacing&&(x=-w+e.options.hierarchical.nodeSpacing),0>x&&(e._shiftBlock(o.id,x),t=!0,n===!0&&e._centerParent(o))}}},v=function(o,n){for(var r=n.id,a=n.edges,l=e.hierarchicalLevels[n.id],c=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,u={},f=[],p=0;p<a.length;p++){var v=a[p];if(v.toId!=v.fromId){var y=v.toId==r?v.from:v.to;u[a[p].id]=y,e.hierarchicalLevels[y.id]<l&&f.push(v)}}var g=function(t,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=e._getPositionForHierarchy(u[i[n].id])-t;o+=s/Math.sqrt(s*s+c)}return o},b=function(t,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=e._getPositionForHierarchy(u[i[n].id])-t;o-=c*Math.pow(s*s+c,-1.5)}return o},m=function(t,i){for(var o=e._getPositionForHierarchy(n),s={},r=0;t>r;r++){var a=g(o,i),h=b(o,i),d=40,l=Math.max(-d,Math.min(d,Math.round(a/h)));if(o-=l,void 0!==s[o])break;s[o]=r}return o},_=function(o){var r=e._getPositionForHierarchy(n);if(void 0===i[n.id]){var a={};a[n.id]=!0,h(n,a),i[n.id]=a}var l=d(i[n.id]),c=s(l,4),u=(c[0],c[1],c[2]),f=c[3],p=o-r,v=0;p>0?v=Math.min(p,f-e.options.hierarchical.nodeSpacing):0>p&&(v=-Math.min(-p,u-e.options.hierarchical.nodeSpacing)),0!=v&&(e._shiftBlock(n.id,v),t=!0)},w=function(i){var o=e._getPositionForHierarchy(n),r=e._getSpaceAroundNode(n),a=s(r,2),h=a[0],d=a[1],l=i-o,c=o;l>0?c=Math.min(o+(d-e.options.hierarchical.nodeSpacing),i):0>l&&(c=Math.max(o-(h-e.options.hierarchical.nodeSpacing),i)),c!==o&&(e._setPositionForHierarchy(n,c,void 0,!0),t=!0)},k=m(o,f);_(k),k=m(o,a),w(k)},y=function(i){var o=Object.keys(e.distributionOrdering);o=o.reverse();for(var n=0;i>n;n++){t=!1;for(var s=0;s<o.length;s++)for(var r=o[s],a=e.distributionOrdering[r],h=0;h<a.length;h++)v(1e3,a[h]);if(t!==!0)break}},g=function(i){var o=Object.keys(e.distributionOrdering);o=o.reverse();for(var n=0;i>n&&(t=!1,f(p,o,!0),t===!0);n++);},b=function(){for(var t in e.body.nodes)e.body.nodes.hasOwnProperty(t)&&e._centerParent(e.body.nodes[t])},m=function(){var t=Object.keys(e.distributionOrdering);t=t.reverse();for(var i=0;i<t.length;i++)for(var o=t[i],n=e.distributionOrdering[o],s=0;s<n.length;s++)e._centerParent(n[s])};this.options.hierarchical.blockShifting===!0&&(g(5),b()),this.options.hierarchical.edgeMinimization===!0&&y(20),this.options.hierarchical.parentCentralization===!0&&m(),o()}},{key:"_getSpaceAroundNode",value:function(e,t){var i=!0;void 0===t&&(i=!1);var o=this.hierarchicalLevels[e.id];if(void 0!==o){var n=this.distributionIndex[e.id],s=this._getPositionForHierarchy(e),r=1e9,a=1e9;if(0!==n){var h=this.distributionOrdering[o][n-1];if(i===!0&&void 0===t[h.id]||i===!1){var d=this._getPositionForHierarchy(h);r=s-d}}if(n!=this.distributionOrdering[o].length-1){var l=this.distributionOrdering[o][n+1];if(i===!0&&void 0===t[l.id]||i===!1){var c=this._getPositionForHierarchy(l);a=Math.min(a,c-s)}}return[r,a]}return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchicalParentReference[e.id])for(var t=this.hierarchicalParentReference[e.id],i=0;i<t.length;i++){var o=t[i],n=this.body.nodes[o];if(this.hierarchicalChildrenReference[o]){var r=1e9,a=-1e9,h=this.hierarchicalChildrenReference[o];if(h.length>0)for(var d=0;d<h.length;d++){var l=this.body.nodes[h[d]];r=Math.min(r,this._getPositionForHierarchy(l)),a=Math.max(a,this._getPositionForHierarchy(l))}var c=this._getPositionForHierarchy(n),u=this._getSpaceAroundNode(n),f=s(u,2),p=f[0],v=f[1],y=.5*(r+a),g=c-y;(0>g&&Math.abs(g)<v-this.options.hierarchical.nodeSpacing||g>0&&Math.abs(g)<p-this.options.hierarchical.nodeSpacing)&&this._setPositionForHierarchy(n,y,void 0,!0)}}}},{key:"_placeNodesByHierarchy",value:function(e){this.positionedNodes={};for(var t in e)if(e.hasOwnProperty(t)){var i=Object.keys(e[t]);i=this._indexArrayToNodes(i),this._sortNodeArray(i);for(var o=0,n=0;n<i.length;n++){var s=i[n];if(void 0===this.positionedNodes[s.id]){var r=this.options.hierarchical.nodeSpacing*o;o>0&&(r=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(s,r,t),this._validataPositionAndContinue(s,t,r),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){if(void 0!==this.hierarchicalChildrenReference[e]){for(var i=[],o=0;o<this.hierarchicalChildrenReference[e].length;o++)i.push(this.body.nodes[this.hierarchicalChildrenReference[e][o]]);this._sortNodeArray(i);for(var n=0;n<i.length;n++){var s=i[n],r=this.hierarchicalLevels[s.id];if(!(r>t&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[e]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l<i.length;l++){var c=i[l].id;h=Math.min(h,this._getPositionForHierarchy(this.body.nodes[c])),d=Math.max(d,this._getPositionForHierarchy(this.body.nodes[c]))}this._setPositionForHierarchy(this.body.nodes[e],.5*(h+d),t)}}},{key:"_validataPositionAndContinue",value:function(e,t,i){if(void 0!==this.lastNodeOnLevel[t]){var o=this._getPositionForHierarchy(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-o<this.options.hierarchical.nodeSpacing){var n=o+this.options.hierarchical.nodeSpacing-i,s=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(s.withChild,n)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}},{key:"_indexArrayToNodes",value:function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.body.nodes[e[i]]);return t}},{key:"_getDistribution",value:function(){var e={},t=void 0,i=void 0;for(t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){i=this.body.nodes[t];var o=void 0===this.hierarchicalLevels[t]?0:this.hierarchicalLevels[t];"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?(i.y=this.options.hierarchical.levelSeparation*o,i.options.fixed.y=!0):(i.x=this.options.hierarchical.levelSeparation*o,i.options.fixed.x=!0),void 0===e[o]&&(e[o]={}),e[o][t]=i}return e}},{key:"_getHubSize",value:function(){var e=0;for(var t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){var i=this.body.nodes[t];void 0===this.hierarchicalLevels[t]&&(e=i.edges.length<e?e:i.edges.length)}return e}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,t=1,i=function(t,i){void 0===e.hierarchicalLevels[i.id]&&(void 0===e.hierarchicalLevels[t.id]&&(e.hierarchicalLevels[t.id]=0),e.hierarchicalLevels[i.id]=e.hierarchicalLevels[t.id]+1)};t>0&&(t=this._getHubSize(),0!==t);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===t&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=1e5,i=function(e,t,i){},o=function(o,n,s){var r=e.hierarchicalLevels[o.id];void 0===r&&(e.hierarchicalLevels[o.id]=t);var a=i(d["default"].cloneOptions(o,"node"),d["default"].cloneOptions(n,"node"),d["default"].cloneOptions(s,"edge"));e.hierarchicalLevels[n.id]=e.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var e=this,t=1e4,i=function(i,o,n){var s=e.hierarchicalLevels[i.id];void 0===s&&(e.hierarchicalLevels[i.id]=t),n.toId==o.id?e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]+1:e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var e=1e9;for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&void 0!==this.hierarchicalLevels[t]&&(e=Math.min(this.hierarchicalLevels[t],e));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=e)}},{key:"_generateMap",value:function(){var e=this,t=function(t,i){if(e.hierarchicalLevels[i.id]>e.hierarchicalLevels[t.id]){var o=t.id,n=i.id;void 0===e.hierarchicalChildrenReference[o]&&(e.hierarchicalChildrenReference[o]=[]),e.hierarchicalChildrenReference[o].push(n),void 0===e.hierarchicalParentReference[n]&&(e.hierarchicalParentReference[n]=[]),e.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(t)}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?function(){}:arguments[0],i=arguments[1],o={},n=0,s=function d(i,n){if(void 0===o[i.id]){void 0===e.hierarchicalTrees[i.id]&&(e.hierarchicalTrees[i.id]=n,e.treeIndex=Math.max(n,e.treeIndex)),o[i.id]=!0;for(var s=void 0,r=0;r<i.edges.length;r++)i.edges[r].connected===!0&&(s=i.edges[r].toId===i.id?i.edges[r].from:i.edges[r].to,i.id!==s.id&&(t(i,s,i.edges[r]),d(s,n)))}};if(void 0===i)for(var r=0;r<this.body.nodeIndices.length;r++){var a=this.body.nodes[this.body.nodeIndices[r]];void 0===o[a.id]&&(s(a,n),n+=1)}else{var h=this.body.nodes[i];if(void 0===h)return void console.error("Node not found:",i);s(h)}}},{key:"_shiftBlock",value:function(e,t){if("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.body.nodes[e].x+=t:this.body.nodes[e].y+=t,void 0!==this.hierarchicalChildrenReference[e])for(var i=0;i<this.hierarchicalChildrenReference[e].length;i++)this._shiftBlock(this.hierarchicalChildrenReference[e][i],t)}},{key:"_findCommonParent",value:function(e,t){var i=this,o={},n=function r(e,t){if(void 0!==i.hierarchicalParentReference[t])for(var o=0;o<i.hierarchicalParentReference[t].length;o++){var n=i.hierarchicalParentReference[t][o];e[n]=!0,r(e,n)}},s=function a(e,t){if(void 0!==i.hierarchicalParentReference[t])for(var o=0;o<i.hierarchicalParentReference[t].length;o++){var n=i.hierarchicalParentReference[t][o];if(void 0!==e[n])return{foundParent:n,withChild:t};var s=a(e,n);if(null!==s.foundParent)return s}return{foundParent:null,withChild:t}};return n(o,e),s(o,t)}},{key:"_setPositionForHierarchy",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][e.id]&&(this.distributionOrdering[i].push(e),this.distributionIndex[e.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][e.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.x=t:e.y=t}},{key:"_getPositionForHierarchy",value:function(e){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.x:e.y}},{key:"_sortNodeArray",value:function(e){e.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.sort(function(e,t){return e.x-t.x}):e.sort(function(e,t){return e.y-t.y}))}}]),e}();t["default"]=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=i(58),a=i(61),h=function(){function e(t,i,n){var r=this;o(this,e),this.body=t,this.canvas=i,this.selectionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},s.extend(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 n(e,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,t,i){void 0!==t&&(void 0!==t.locale?this.options.locale=t.locale:this.options.locale=i.locale,void 0!==t.locales?this.options.locales=t.locales:this.options.locales=i.locales),void 0!==e&&("boolean"==typeof e?this.options.enabled=e:(this.options.enabled=!0,s.deepExtend(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(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(),this.guiEnabled===!0&&(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={},this.guiEnabled===!0){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var e=this.selectionHandler._getSelectedNodeCount(),t=this.selectionHandler._getSelectedEdgeCount(),i=e+t,o=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===e&&"function"==typeof this.options.editNode?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===t&&0===e&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==i&&(e>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===e&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(t.isCluster!==!0){var i=s.deepExtend({},t.options,!1);if(i.x=t.x,i.y=t.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(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var e=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){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))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var t=e.body.edges[e.edgeBeingEditedId],i=e._getNewTargetNode(t.from.x,t.from.y),o=e._getNewTargetNode(t.to.x,t.to.y);e.temporaryIds.nodes.push(i.id),e.temporaryIds.nodes.push(o.id),e.body.nodes[i.id]=i,e.body.nodeIndices.push(i.id),e.body.nodes[o.id]=o,e.body.nodeIndices.push(o.id),e._temporaryBindUI("onTouch",e._controlNodeTouch.bind(e)),e._temporaryBindUI("onTap",function(){}),e._temporaryBindUI("onHold",function(){}),e._temporaryBindUI("onDragStart",e._controlNodeDragStart.bind(e)),e._temporaryBindUI("onDrag",e._controlNodeDrag.bind(e)),e._temporaryBindUI("onDragEnd",e._controlNodeDragEnd.bind(e)),e._temporaryBindUI("onMouseMove",function(){}),e._temporaryBindEvent("beforeDrawing",function(e){var n=t.edgeType.findBorderPositions(e);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),e.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(t.length>0){for(var n=0;n<t.length;n++)if(this.body.nodes[t[n]].isCluster===!0)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(o=this.options.deleteNode)}else i.length>0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:t,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?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",this.editMode===!0?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(e,t){var i=s.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e<this.manipulationHammers.length;e++)this.manipulationHammers[e].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),s.recursiveDOMDelete(this.manipulationDiv),s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t=this._createButton("addNode","vis-button vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(e){var t=this._createButton("addEdge","vis-button vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(e){var t=this._createButton("editNode","vis-button vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(e){var t=this._createButton("editEdge","vis-button vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(e){if(this.options.rtl)var t="vis-button vis-delete-rtl";else var t="vis-button vis-delete";var i=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(e){var t=this._createButton("back","vis-button vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?"vis-label":arguments[3];return this.manipulationDOM[e+"Div"]=document.createElement("div"),this.manipulationDOM[e+"Div"].className=t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=o,this.manipulationDOM[e+"Label"].innerHTML=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",e))}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(void 0===this.body.eventListeners[e])throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+JSON.stringify(Object.keys(this.body.eventListeners)));this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,i=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,i)}this.temporaryEventFunctions=[]}},{key:"_bindHammerToDiv",value:function(e,t){var i=new r(e,{});a.onTouch(i,t),this.manipulationHammers.push(i)}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var t=this.body.edgeIndices.indexOf(this.temporaryIds.edges[e]);-1!==t&&this.body.edgeIndices.splice(t,1)}for(var i=0;i<this.temporaryIds.nodes.length;i++){delete this.body.nodes[this.temporaryIds.nodes[i]];var o=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);-1!==o&&this.body.nodeIndices.splice(o,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=s.extend({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(e){var t=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(t),o=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],s=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var r=o.isOverlappingWith(i),a=n.isOverlappingWith(i);r===!0?(this.selectedControlNode=o,s.edgeType.from=o):a===!0&&(this.selectedControlNode=n,s.edgeType.to=n),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var t=this.body.functions.getPointer(e.center),i=this.canvas.DOMtoCanvas(t);if(void 0!==this.selectedControlNode)this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y;else{var o=t.x-this.lastTouch.x,n=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)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(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=s.extend({},this.body.view.translation);var t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(t.x),i.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var o=t.x-this.lastTouch.x,n=t.y-this.lastTouch.y;
+this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(n[r])){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(e){var t=this,i={id:s.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&(t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,o={from:e,to:t};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(o,function(e){null!==e&&void 0!==e&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,o={id:this.edgeBeingEditedId,from:e,to:t};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(e){null===e||void 0===e||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(71),h=o(a),d=i(1),l=function(){function e(t,i,o){var s=arguments.length<=3||void 0===arguments[3]?1:arguments[3];n(this,e),this.parent=t,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},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h["default"](s),this.wrapper=void 0}return r(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;"string"==typeof e?this.options.filter=e:e instanceof Array?this.options.filter=e.join():"object"===("undefined"==typeof e?"undefined":s(e))?(void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!==e.showButton&&(this.options.showButton=e.showButton),void 0!==e.enabled&&(t=e.enabled)):"boolean"==typeof e?(this.options.filter=!0,t=e):"function"==typeof e&&(this.options.filter=e,t=!0),this.options.filter===!1&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var e=this;this._clean(),this.changedOptions=[];var t=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof t?(o=t(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):t!==!0&&-1===t.indexOf(n)||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},e.optionsContainer=document.createElement("div"),e.optionsContainer.className="vis-configuration vis-config-option-container",e.domElements.push(e.optionsContainer),e.domElements.push(t)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var t=this.moduleOptions,i=0;i<e.length;i++){if(void 0===t[e[i]]){t=void 0;break}t=t[e[i]]}return t}},{key:"_makeItem",value:function(e){var t=arguments,i=this;if(this.allowCreation===!0){var o,n,r,a=function(){var s=document.createElement("div");for(s.className="vis-configuration vis-config-item vis-config-s"+e.length,o=t.length,n=Array(o>1?o-1:0),r=1;o>r;r++)n[r-1]=t[r];return n.forEach(function(e){s.appendChild(e)}),i.domElements.push(s),{v:i.domElements.length}}();if("object"===("undefined"==typeof a?"undefined":s(a)))return a.v}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerHTML=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0?o.innerHTML="<i><b>"+e+":</b></i>":o.innerHTML=e+":",o}},{key:"_makeDropdown",value:function(e,t,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==t&&-1!==e.indexOf(t)&&(n=e.indexOf(t));for(var s=0;s<e.length;s++){var r=document.createElement("option");r.value=e[s],s===n&&(r.selected="selected"),r.innerHTML=e[s],o.appendChild(r)}var a=this;o.onchange=function(){a._update(this.value,i)};var h=this._makeLabel(i[i.length-1],i);this._makeItem(i,h,o)}},{key:"_makeRange",value:function(e,t,i){var o=e[0],n=e[1],s=e[2],r=e[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=s}catch(h){}a.step=r;var d="",l=0;if(void 0!==t){var c=1.2;0>t&&n>t*c?(a.min=Math.ceil(t*c),l=a.min,d="range increased"):n>t/c&&(a.min=Math.ceil(t/c),l=a.min,d="range increased"),t*c>s&&1!==s&&(a.max=Math.ceil(t*c),l=a.max,d="range increased"),a.value=t}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var f=this;a.onchange=function(){u.value=this.value,f._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var p=this._makeLabel(i[i.length-1],i),v=this._makeItem(i,p,a,u);""!==d&&this.popupHistory[v]!==l&&(this.popupHistory[v]=l,this._setupPopup(d,v))}},{key:"_setupPopup",value:function(e,t){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var o=document.createElement("div");o.id="vis-configuration-popup",o.className="vis-configuration-popup",o.innerHTML=e,o.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:o,index:t}}}},{key:"_removePopup",value:function(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(void 0!==this.popupDiv.html){var t=this.domElements[this.popupDiv.index],i=t.getBoundingClientRect();this.popupDiv.html.style.left=i.left+"px",this.popupDiv.html.style.top=i.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=setTimeout(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,t,i){var o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=e,void 0!==t&&(o.checked=t,t!==e&&("object"===("undefined"==typeof e?"undefined":s(e))?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));var n=this;o.onchange=function(){n._update(this.checked,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}},{key:"_makeTextInput",value:function(e,t,i){var o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=t,t!==e&&this.changedOptions.push({path:i,value:t});var n=this;o.onchange=function(){n._update(this.value,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}},{key:"_makeColorField",value:function(e,t,i){var o=this,n=e[1],s=document.createElement("div");t=void 0===t?n:t,"none"!==t?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=t):s.className="vis-configuration vis-config-colorBlock none",t=void 0===t?n:t,s.onclick=function(){o._showColorPicker(t,s,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,s)}},{key:"_showColorPicker",value:function(e,t,i){var o=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(e){var n="rgba("+e.r+","+e.g+","+e.b+","+e.a+")";t.style.backgroundColor=n,o._update(n,i)}),this.colorPicker.setCloseCallback(function(){t.onclick=function(){o._showColorPicker(e,t,i)}})}},{key:"_handleObject",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in e)if(e.hasOwnProperty(r)){o=!0;var a=e[r],h=d.copyAndExtendArray(t,r);if("function"==typeof n&&(o=n(r,t),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var c=!0;if(-1!==t.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(c=!1),c===!0)if(void 0!==a.enabled){var u=d.copyAndExtendArray(h,"enabled"),f=this._getValue(u);if(f===!0){var p=this._makeLabel(r,h,!0);this._makeItem(h,p),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,f,h)}else{var v=this._makeLabel(r,h,!0);this._makeItem(h,v),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(e,t,i){"string"==typeof e[0]&&"color"===e[0]?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):"string"==typeof e[0]?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):"number"==typeof e[0]&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}},{key:"_update",value:function(e,t){var i=this._constructOptions(e,t);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(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=i;e="true"===e?!0:e,e="false"===e?!1:e;for(var n=0;n<t.length;n++)"global"!==t[n]&&(void 0===o[t[n]]&&(o[t[n]]={}),n!==t.length-1?o=o[t[n]]:o[t[n]]=e);return i}},{key:"_printOptions",value:function(){var e=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+JSON.stringify(e,null,2)+"</pre>"}},{key:"getOptions",value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),e}();t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(58),r=i(61),a=i(1),h=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?1:arguments[0];o(this,e),this.pixelRatio=t,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 n(e,[{key:"insertTo",value:function(e){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=e}},{key:"setCloseCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=e}},{key:"_isColorString",value:function(e){var t={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"};return"string"==typeof e?t[e]:void 0}},{key:"setColor",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if("none"!==e){var i=void 0,o=this._isColorString(e);if(void 0!==o&&(e=o),a.isString(e)===!0){if(a.isValidRGB(e)===!0){var n=e.substr(4).substr(0,e.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(e)===!0){var r=a.hexToRGB(e);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(e instanceof Object&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b){var h=void 0!==e.a?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:h}}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(e));this._setColor(i,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];t===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==e.closeCallback&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];t===!0&&(this.initialColor=a.extend({},e)),this.color=e;var i=a.RGBToHSV(e.r,e.g,e.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=a.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var i=a.HSVToRGB(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.color:arguments[0],t=a.RGBToHSV(e.r,e.g,e.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 o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var e=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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.colorPickerCanvas.appendChild(t)}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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.onTouch(this.hammer,function(t){e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*t,y:.5*i},this.r=.49*t;var h=2*Math.PI/360,d=1/360,l=1/this.r,c=void 0;for(s=0;360>s;s++)for(r=0;r<this.r;r++)o=this.centerCoordinates.x+r*Math.sin(h*s),n=this.centerCoordinates.y+r*Math.cos(h*s),c=a.HSVToRGB(s*d,r*l,1),e.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",e.fillRect(o-.5,n-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,i)}this.generated=!0}},{key:"_moveSelector",value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),i=e.center.x-t.left,o=e.center.y-t.top,n=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,h=o-n,d=Math.atan2(r,h),l=.98*Math.min(Math.sqrt(r*r+h*h),s),c=Math.cos(d)*l+n,u=Math.sin(d)*l+s;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";var f=d/(2*Math.PI);f=0>f?f+1:f;var p=l/this.r,v=a.RGBToHSV(this.color.r,this.color.g,this.color.b);v.h=f,v.s=p;var y=a.HSVToRGB(v.h,v.s,v.v);y.a=this.color.a,this.color=y,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),e}();t["default"]=h},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{"boolean":o},filter:{"boolean":o,string:i,array:s,"function":"function"},container:{dom:a},showButton:{"boolean":o},__type__:{object:r,"boolean":o,string:i,array:s,"function":"function"}},edges:{arrows:{to:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},middle:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},from:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{"boolean":o},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],"boolean":o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{"boolean":o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},__type__:{object:r,string:i}},hidden:{"boolean":o},hoverWidth:{"function":"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},length:{number:n,undefined:"undefined"},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},selectionWidth:{"function":"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},smooth:{enabled:{"boolean":o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],"boolean":o},__type__:{object:r,"boolean":o}},title:{string:i,undefined:"undefined"},width:{number:n},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{"boolean":o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{"boolean":o},dragView:{"boolean":o},hideEdgesOnDrag:{"boolean":o},hideNodesOnDrag:{"boolean":o},hover:{"boolean":o},keyboard:{enabled:{"boolean":o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{"boolean":o},__type__:{object:r,"boolean":o}},multiselect:{"boolean":o},navigationButtons:{"boolean":o},selectable:{"boolean":o},selectConnectedEdges:{"boolean":o},hoverConnectedEdges:{"boolean":o},tooltipDelay:{number:n},zoomView:{"boolean":o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{"boolean":o},hierarchical:{enabled:{"boolean":o},levelSeparation:{number:n},nodeSpacing:{number:n},treeSpacing:{number:n},blockShifting:{"boolean":o},edgeMinimization:{"boolean":o},parentCentralization:{"boolean":o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,"boolean":o}},__type__:{object:r}},manipulation:{enabled:{"boolean":o},initiallyActive:{"boolean":o},addNode:{"boolean":o,"function":"function"},addEdge:{"boolean":o,"function":"function"},editNode:{"function":"function"},editEdge:{"boolean":o,"function":"function"},deleteNode:{"boolean":o,"function":"function"},deleteEdge:{"boolean":o,"function":"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,"boolean":o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{"boolean":o},y:{"boolean":o},__type__:{object:r,"boolean":o}},font:{align:{string:i},color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},__type__:{object:r,
+string:i}},group:{string:i,number:n,undefined:"undefined"},hidden:{"boolean":o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{"boolean":o,array:s},borderRadius:{number:n},interpolation:{"boolean":o},useImageSize:{"boolean":o},useBorderWithImage:{"boolean":o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{"boolean":o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{"boolean":o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{"boolean":o},fit:{"boolean":o},__type__:{object:r,"boolean":o}},timestep:{number:n},adaptiveTimestep:{"boolean":o},__type__:{object:r,"boolean":o}},autoResize:{"boolean":o},clickToUse:{"boolean":o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={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"],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]},middle:{enabled:!1,scaleFactor:[1,0,3,.05]},from:{enabled:!1,scaleFactor:[1,0,3,.05]}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,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},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]},global:{locale:["en","nl"]}};t.allOptions=d,t.configureOptions=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(74),h=o(a),d=function(){function e(t,i,o){n(this,e),this.body=t,this.springLength=i,this.springConstant=o,this.distanceSolver=new h["default"]}return r(e,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,l=1e9,c=0,u=0,f=0,p=0,v=0;l>n&&h>a;){a+=1;var y=this._getHighestEnergyNode(i),g=s(y,4);for(c=g[0],l=g[1],u=g[2],f=g[3],p=l,v=0;p>r&&d>v;){v+=1,this._moveNode(c,u,f);var b=this._getEnergy(c),m=s(b,3);p=m[0],u=m[1],f=m[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,o=0,n=t[0],r=0,a=0,h=0;h<t.length;h++){var d=t[h];if(i[d].predefinedPosition===!1||i[d].isCluster===!0&&e===!0||i[d].options.fixed.x===!0||i[d].options.fixed.y===!0){var l=this._getEnergy(d),c=s(l,3),u=c[0],f=c[1],p=c[2];u>o&&(o=u,n=d,r=f,a=p)}}return[n,o,r,a]}},{key:"_getEnergy",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,o=i[e].x,n=i[e].y,s=0,r=0,a=0;a<t.length;a++){var h=t[a];if(h!==e){var d=i[h].x,l=i[h].y,c=1/Math.sqrt(Math.pow(o-d,2)+Math.pow(n-l,2));s+=this.K_matrix[e][h]*(o-d-this.L_matrix[e][h]*(o-d)*c),r+=this.K_matrix[e][h]*(n-l-this.L_matrix[e][h]*(n-l)*c)}}var u=Math.sqrt(Math.pow(s,2)+Math.pow(r,2));return[u,s,r]}},{key:"_moveNode",value:function(e,t,i){for(var o=this.body.nodeIndices,n=this.body.nodes,s=0,r=0,a=0,h=n[e].x,d=n[e].y,l=0;l<o.length;l++){var c=o[l];if(c!==e){var u=n[c].x,f=n[c].y,p=1/Math.pow(Math.pow(h-u,2)+Math.pow(d-f,2),1.5);s+=this.K_matrix[e][c]*(1-this.L_matrix[e][c]*Math.pow(d-f,2)*p),r+=this.K_matrix[e][c]*(this.L_matrix[e][c]*(h-u)*(d-f)*p),a+=this.K_matrix[e][c]*(1-this.L_matrix[e][c]*Math.pow(h-u,2)*p)}}var v=s,y=r,g=t,b=a,m=i,_=(g/v+m/y)/(y/v-b/y),w=-(y*_+g)/v;n[e].x+=w,n[e].y+=_}},{key:"_createL_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(var o=0;o<t.length;o++){this.L_matrix[t[o]]={};for(var n=0;n<t.length;n++)this.L_matrix[t[o]][t[n]]=i*e[t[o]][t[n]]}}},{key:"_createK_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(var o=0;o<t.length;o++){this.K_matrix[t[o]]={};for(var n=0;n<t.length;n++)this.K_matrix[t[o]][t[n]]=i*Math.pow(e[t[o]][t[n]],-2)}}}]),e}();t["default"]=d},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(){i(this,e)}return o(e,[{key:"getDistances",value:function(e,t,i){for(var o={},n=e.edges,s=0;s<t.length;s++){o[t[s]]={},o[t[s]]={};for(var r=0;r<t.length;r++)o[t[s]][t[r]]=s==r?0:1e9,o[t[s]][t[r]]=s==r?0:1e9}for(var a=0;a<i.length;a++){var h=n[i[a]];h.connected===!0&&void 0!==o[h.fromId]&&void 0!==o[h.toId]&&(o[h.fromId][h.toId]=1,o[h.toId][h.fromId]=1)}for(var d=t.length,l=0;d>l;l++)for(var c=0;d-1>c;c++)for(var u=c+1;d>u;u++)o[t[c]][t[u]]=Math.min(o[t[c]][t[u]],o[t[c]][t[l]]+o[t[l]][t[u]]),o[t[u]][t[c]]=o[t[c]][t[u]];return o}}]),e}();t["default"]=n},function(e,t){"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,i){this.beginPath(),this.arc(e,t,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,i){this.beginPath(),this.rect(e-i,t-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,i){this.beginPath(),i*=1.15,t+=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t-(r-s)),this.lineTo(e+n,t+s),this.lineTo(e-n,t+s),this.lineTo(e,t-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,i){this.beginPath(),i*=1.15,t-=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t+(r-s)),this.lineTo(e+n,t-s),this.lineTo(e-n,t-s),this.lineTo(e,t+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,i){this.beginPath(),i*=.82,t+=.1*i;for(var o=0;10>o;o++){var n=o%2===0?1.3*i:.5*i;this.lineTo(e+n*Math.sin(2*o*Math.PI/10),t-n*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,i){this.beginPath(),this.lineTo(e,t+i),this.lineTo(e+i,t),this.lineTo(e,t-i),this.lineTo(e-i,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,i,o,n){var s=Math.PI/180;0>i-2*n&&(n=i/2),0>o-2*n&&(n=o/2),this.beginPath(),this.moveTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,270*s,360*s,!1),this.lineTo(e+i,t+o-n),this.arc(e+i-n,t+o-n,n,0,90*s,!1),this.lineTo(e+n,t+o),this.arc(e+n,t+o-n,n,90*s,180*s,!1),this.lineTo(e,t+n),this.arc(e+n,t+n,n,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse=function(e,t,i,o){var n=.5522848,s=i/2*n,r=o/2*n,a=e+i,h=t+o,d=e+i/2,l=t+o/2;this.beginPath(),this.moveTo(e,l),this.bezierCurveTo(e,l-r,d-s,t,d,t),this.bezierCurveTo(d+s,t,a,l-r,a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,e,l+r,e,l),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,i,o){var n=1/3,s=i,r=o*n,a=.5522848,h=s/2*a,d=r/2*a,l=e+s,c=t+r,u=e+s/2,f=t+r/2,p=t+(o-r/2),v=t+o;this.beginPath(),this.moveTo(l,f),this.bezierCurveTo(l,f+d,u+h,c,u,c),this.bezierCurveTo(u-h,c,e,f+d,e,f),this.bezierCurveTo(e,f-d,u-h,t,u,t),this.bezierCurveTo(u+h,t,l,f-d,l,f),this.lineTo(l,p),this.bezierCurveTo(l,p+d,u+h,v,u,v),this.bezierCurveTo(u-h,v,e,p+d,e,p),this.lineTo(e,f)},CanvasRenderingContext2D.prototype.arrow=function(e,t,i,o){var n=e-o*Math.cos(i),s=t-o*Math.sin(i),r=e-.9*o*Math.cos(i),a=t-.9*o*Math.sin(i),h=n+o/3*Math.cos(i+.5*Math.PI),d=s+o/3*Math.sin(i+.5*Math.PI),l=n+o/3*Math.cos(i-.5*Math.PI),c=s+o/3*Math.sin(i-.5*Math.PI);this.beginPath(),this.moveTo(e,t),this.lineTo(h,d),this.lineTo(r,a),this.lineTo(l,c),this.closePath()},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,i,o,n){this.beginPath(),this.moveTo(e,t);for(var s=n.length,r=i-e,a=o-t,h=a/r,d=Math.sqrt(r*r+a*a),l=0,c=!0,u=0,f=n[0];d>=.1;)f=n[l++%s],f>d&&(f=d),u=Math.sqrt(f*f/(1+h*h)),u=0>r?-u:u,e+=u,t+=h*u,c===!0?this.lineTo(e,t):this.moveTo(e,t),d-=f,c=!c})},function(e,t){function i(e){return e?o(e):void 0}function o(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}e.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){o.off(e,i),t.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var o,n=0;n<i.length;n++)if(o=i[n],o===t||o.fn===t){i.splice(n,1);break}return this},i.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i){i=i.slice(0);for(var o=0,n=i.length;n>o;++o)i[o].apply(this,t)}return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){function i(e){return P=e,f()}function o(){B=0,F=P.charAt(0)}function n(){B++,F=P.charAt(B)}function s(){return P.charAt(B+1)}function r(e){return N.test(e)}function a(e,t){if(e||(e={}),t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function h(e,t,i){for(var o=t.split("."),n=e;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function d(e,t){for(var i,o,n=null,s=[e],r=e;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;o>i;i++)if(t.id===r.nodes[i].id){n=r.nodes[i];break}for(n||(n={id:t.id},e.node&&(n.attr=a(n.attr,e.node))),i=s.length-1;i>=0;i--){var h=s[i];h.nodes||(h.nodes=[]),-1===h.nodes.indexOf(n)&&h.nodes.push(n)}t.attr&&(n.attr=a(n.attr,t.attr))}function l(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=a({},e.edge);t.attr=a(i,t.attr)}}function c(e,t,i,o,n){var s={from:t,to:i,type:o};return e.edge&&(s.attr=a({},e.edge)),s.attr=a(s.attr||{},n),s}function u(){for(j=C.NULL,I="";" "===F||" "===F||"\n"===F||"\r"===F;)n();do{var e=!1;if("#"===F){for(var t=B-1;" "===P.charAt(t)||" "===P.charAt(t);)t--;if("\n"===P.charAt(t)||""===P.charAt(t)){for(;""!=F&&"\n"!=F;)n();e=!0}}if("/"===F&&"/"===s()){for(;""!=F&&"\n"!=F;)n();e=!0}if("/"===F&&"*"===s()){for(;""!=F;){if("*"===F&&"/"===s()){n(),n();break}n()}e=!0}for(;" "===F||" "===F||"\n"===F||"\r"===F;)n()}while(e);if(""===F)return void(j=C.DELIMITER);var i=F+s();if(T[i])return j=C.DELIMITER,I=i,n(),void n();if(T[F])return j=C.DELIMITER,I=F,void n();if(r(F)||"-"===F){for(I+=F,n();r(F);)I+=F,n();return"false"===I?I=!1:"true"===I?I=!0:isNaN(Number(I))||(I=Number(I)),void(j=C.IDENTIFIER)}if('"'===F){for(n();""!=F&&('"'!=F||'"'===F&&'"'===s());)I+=F,'"'===F&&n(),n();if('"'!=F)throw w('End of string " expected');return n(),void(j=C.IDENTIFIER)}for(j=C.UNKNOWN;""!=F;)I+=F,n();throw new SyntaxError('Syntax error in part "'+k(I,30)+'"')}function f(){var e={};if(o(),u(),"strict"===I&&(e.strict=!0,u()),"graph"!==I&&"digraph"!==I||(e.type=I,u()),j===C.IDENTIFIER&&(e.id=I,u()),"{"!=I)throw w("Angle bracket { expected");if(u(),p(e),"}"!=I)throw w("Angle bracket } expected");if(u(),""!==I)throw w("End of file expected");return u(),delete e.node,delete e.edge,delete e.graph,e}function p(e){for(;""!==I&&"}"!=I;)v(e),";"===I&&u()}function v(e){var t=y(e);if(t)return void m(e,t);var i=g(e);if(!i){if(j!=C.IDENTIFIER)throw w("Identifier expected");var o=I;if(u(),"="===I){if(u(),j!=C.IDENTIFIER)throw w("Identifier expected");e[o]=I,u()}else b(e,o)}}function y(e){var t=null;if("subgraph"===I&&(t={},t.type="subgraph",u(),j===C.IDENTIFIER&&(t.id=I,u())),"{"===I){if(u(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,p(t),"}"!=I)throw w("Angle bracket } expected");u(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function g(e){return"node"===I?(u(),e.node=_(),"node"):"edge"===I?(u(),e.edge=_(),"edge"):"graph"===I?(u(),e.graph=_(),"graph"):null}function b(e,t){var i={id:t},o=_();o&&(i.attr=o),d(e,i),m(e,t)}function m(e,t){for(;"->"===I||"--"===I;){var i,o=I;u();var n=y(e);if(n)i=n;else{if(j!=C.IDENTIFIER)throw w("Identifier or subgraph expected");i=I,d(e,{id:i}),u()}var s=_(),r=c(e,t,i,o,s);l(e,r),t=i}}function _(){for(var e=null;"["===I;){for(u(),e={};""!==I&&"]"!=I;){if(j!=C.IDENTIFIER)throw w("Attribute name expected");var t=I;if(u(),"="!=I)throw w("Equal sign = expected");if(u(),j!=C.IDENTIFIER)throw w("Attribute value expected");var i=I;h(e,t,i),u(),","==I&&u()}if("]"!=I)throw w("Bracket ] expected");u()}return e}function w(e){return new SyntaxError(e+', got "'+k(I,30)+'" (char '+B+")")}function k(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function x(e,t,i){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}):Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}function O(e,t,i){for(var o=t.split("."),n=o.pop(),s=e,r=0;r<o.length;r++){var a=o[r];a in s||(s[a]={}),s=s[a]}return s[n]=i,e}function E(e,t){var i={};for(var o in e)if(e.hasOwnProperty(o)){var n=t[o];Array.isArray(n)?n.forEach(function(t){O(i,t,e[o])}):"string"==typeof n?O(i,n,e[o]):O(i,o,e[o])}return i}function M(e){var t=i(e),o={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:String(e.label||e.id)};a(t,E(e.attr,D)),t.image&&(t.shape="image"),o.nodes.push(t)}),t.edges){var n=function(e){var t={from:e.from,to:e.to};return a(t,E(e.attr,S)),t.arrows="->"===e.type?"to":void 0,t};t.edges.forEach(function(e){var t,i;t=e.from instanceof Object?e.from.nodes:{id:e.from},i=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges&&e.from.edges.forEach(function(e){var t=n(e);o.edges.push(t)}),x(t,i,function(t,i){var s=c(o,t.id,i.id,e.type,e.attr),r=n(s);o.edges.push(r)}),e.to instanceof Object&&e.to.edges&&e.to.edges.forEach(function(e){var t=n(e);o.edges.push(t)})})}return t.attr&&(o.options=t.attr),o}var D={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},S=Object.create(D);S.color="color.color";var C={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},T={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},P="",B=0,F="",I="",j=C.NULL,N=/[a-zA-Z_0-9.:#]/;t.parseDOT=i,t.DOTToGraph=M},function(e,t){function i(e,t){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==t&&(void 0!==t.fixed&&(n.nodes.fixed=t.fixed),void 0!==t.parseColor&&(n.nodes.parseColor=t.parseColor),void 0!==t.inheritColor&&(n.edges.inheritColor=t.inheritColor));for(var s=e.edges,r=e.nodes,a=0;a<s.length;a++){var h={},d=s[a];h.id=d.id,h.from=d.source,h.to=d.target,h.attributes=d.attributes,h.label=d.label,h.title=void 0!==d.attributes?d.attributes.title:void 0,"Directed"===d.type&&(h.arrows="to"),d.color&&n.inheritColor===!1&&(h.color=d.color),i.push(h)}for(var a=0;a<r.length;a++){var l={},c=r[a];l.id=c.id,l.attributes=c.attributes,l.title=c.title,l.x=c.x,l.y=c.y,l.label=c.label,l.title=void 0!==c.attributes?c.attributes.title:void 0,n.nodes.parseColor===!0?l.color=c.color:l.color=void 0!==c.color?{background:c.color,border:c.color,highlight:{background:c.color,border:c.color},hover:{background:c.color,border:c.color}}:void 0,l.size=c.size,l.fixed=n.nodes.fixed&&void 0!==c.x&&void 0!==c.y,o.push(l)}return{nodes:o,edges:i}}t.parseGephi=i},function(e,t,i){function o(e){this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var t=this,i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];i.forEach(function(e){t.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){n(i.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function n(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var s=i(65),r=i(76),a=i(58),h=i(1);r(o.prototype),o.current=null,o.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},o.prototype.activate=function(){o.current&&o.current.deactivate(),o.current=this,this.active=!0,this.dom.overlay.style.display="none",h.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},o.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",h.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},o.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()},e.exports=o},function(e,t){t.en={edit:"Edit",del:"Delete selected",back:"Back",addNode:"Add Node",addEdge:"Add Edge",editNode:"Edit Node",editEdge:"Edit Edge",addDescription:"Click in an empty space to place a new node.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",createEdgeError:"Cannot link edges to a cluster.",deleteClusterError:"Clusters cannot be deleted.",editClusterError:"Clusters cannot be edited."},t.en_EN=t.en,t.en_US=t.en,t.de={edit:"Editieren",del:"Lö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."},t.de_DE=t.de,t.es={edit:"Editar",del:"Eliminar selección",back:"Átras",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."},t.es_ES=t.es,t.nl={edit:"Wijzigen",del:"Selectie verwijderen",back:"Terug",addNode:"Node toevoegen",addEdge:"Link toevoegen",editNode:"Node wijzigen",editEdge:"Link wijzigen",addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",createEdgeError:"Kan geen link maken naar een cluster.",deleteClusterError:"Clusters kunnen niet worden verwijderd.",editClusterError:"Clusters kunnen niet worden aangepast."},t.nl_NL=t.nl,t.nl_BE=t.nl}])});
\ No newline at end of file
--- /dev/null
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.16.1
+ * @date 2016-04-18
+ *
+ * @license
+ * Copyright (C) 2011-2016 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(7),e.DataSet=i(8),e.DataView=i(10),e.Queue=i(9),e.Timeline=i(11),e.Graph2d=i(41),e.timeline={Core:i(23),DateUtil:i(22),Range:i(20),stack:i(27),TimeStep:i(25),components:{items:{Item:i(29),BackgroundItem:i(33),BoxItem:i(31),PointItem:i(32),RangeItem:i(28)},BackgroundGroup:i(30),Component:i(21),CurrentTime:i(39),CustomTime:i(37),DataAxis:i(43),DataScale:i(44),GraphGroup:i(45),Group:i(26),ItemSet:i(24),Legend:i(49),LineGraph:i(42),TimeAxis:i(34)}},e.moment=i(2),e.Hammer=i(14),e.keycharm=i(36)},function(t,e,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},n=i(2),s=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=r.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return s.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==o(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var s in t)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===t[s]||n!==!0?t[s]=i[s]:delete t[s]:"object"===o(t[s])&&e.fillIfDefined(t[s],i[s],n))},e.protoExtend=function(t,e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)t[n]=o[n]}return t},e.extend=function(t,e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t},e.selectiveExtend=function(t,e,i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var o=2;o<arguments.length;o++)for(var n=arguments[o],s=0;s<t.length;s++){var r=t[s];n.hasOwnProperty(r)&&(e[r]=n[r])}return e},e.selectiveDeepExtend=function(t,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var r=arguments[s],a=0;a<t.length;a++){var h=t[a];if(r.hasOwnProperty(h))if(o[h]&&o[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?e.deepExtend(i[h],o[h],!1,n):null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h];else{if(Array.isArray(o[h]))throw new TypeError("Arrays are not supported by deepExtend");null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h]}}return i},e.selectiveNotDeepExtend=function(t,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&-1==t.indexOf(s))if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r<o[s].length;r++)i[s].push(o[s][r])}else null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];return i},e.deepExtend=function(t,i,o,n){for(var s in i)if(i.hasOwnProperty(s)||o===!0)if(i[s]&&i[s].constructor===Object)void 0===t[s]&&(t[s]={}),t[s].constructor===Object?e.deepExtend(t[s],i[s],o):null===i[s]&&void 0!==t[s]&&n===!0?delete t[s]:t[s]=i[s];else if(Array.isArray(i[s])){t[s]=[];for(var r=0;r<i[s].length;r++)t[s].push(i[s][r])}else null===i[s]&&void 0!==t[s]&&n===!0?delete t[s]:t[s]=i[s];return t},e.equalArray=function(t,e){if(t.length!=e.length)return!1;for(var i=0,o=t.length;o>i;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var o;if(void 0!==t){if(null===t)return null;if(!i)return t;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(n.isMoment(t))return new Date(t.valueOf());if(e.isString(t))return o=r.exec(t),o?new Date(Number(o[1])):n(t).toDate();throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"Moment":if(e.isNumber(t))return n(t);if(t instanceof Date)return n(t.valueOf());if(n.isMoment(t))return n(t);if(e.isString(t))return o=r.exec(t),n(o?Number(o[1]):t);throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"ISODate":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(n.isMoment(t))return t.toDate().toISOString();if(e.isString(t))return o=r.exec(t),o?new Date(Number(o[1])).toISOString():new Date(t).toISOString();throw new Error("Cannot convert object of type "+e.getType(t)+" to type ISODate");case"ASPDate":if(e.isNumber(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(e.isString(t)){o=r.exec(t);var s;return s=o?new Date(Number(o[1])).valueOf():new Date(t).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+e.getType(t)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var r=/^\/?Date\((\-?\d+)/i;e.getType=function(t){var e="undefined"==typeof t?"undefined":o(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},e.copyAndExtendArray=function(t,e){for(var i=[],o=0;o<t.length;o++)i.push(t[o]);return i.push(e),i},e.copyArray=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e},e.getAbsoluteLeft=function(t){return t.getBoundingClientRect().left},e.getAbsoluteRight=function(t){return t.getBoundingClientRect().right},e.getAbsoluteTop=function(t){return t.getBoundingClientRect().top},e.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},e.removeClassName=function(t,e){var i=t.className.split(" "),o=i.indexOf(e);-1!=o&&(i.splice(o,1),t.className=i.join(" "))},e.forEach=function(t,e){var i,o;if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},e.toArray=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},e.throttle=function(t,e){var i=null,o=!1;return function n(){i?o=!0:(o=!1,t(),i=setTimeout(function(){i=null,o&&n()},e))}},e.addEventListener=function(t,e,i,o){t.addEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(-1!=t.indexOf("rgba"))return t;if(-1!=t.indexOf("rgb")){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=a.split(t.style.cssText),n=a.split(i),s=e.extend(o,n);t.style.cssText=a.join(s)},e.removeCssText=function(t,e){var i=a.split(t.style.cssText),o=a.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=a.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s<t.length;s++)i.hasOwnProperty(t[s])&&"object"==o(i[t[s]])&&(n[t[s]]=e.bridgeObject(i[t[s]]));return n}return null},e.bridgeObject=function(t){if("object"==("undefined"==typeof t?"undefined":o(t))){var i=Object.create(t);for(var n in t)t.hasOwnProperty(n)&&"object"==o(t[n])&&(i[n]=e.bridgeObject(t[n]));return i}return null},e.insertSort=function(t,e){for(var i=0;i<t.length;i++){for(var o=t[i],n=i;n>0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length<=3||void 0===arguments[3]?!1:arguments[3],arguments.length<=4||void 0===arguments[4]?{}:arguments[4]);if(null===e[i])t[i]=Object.create(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;a>=r&&n>s;){var h=Math.floor((r+a)/2),d=t[h],l=void 0===o?d[i]:d[i][o],u=e(l);if(0==u)return h;-1==u?r=h+1:a=h-1,s++}return-1},e.binarySearchValue=function(t,e,i,o,n){for(var s,r,a,h,d=1e4,l=0,u=0,c=t.length-1,n=void 0!=n?n:function(t,e){return t==e?0:e>t?-1:1};c>=u&&d>l;){if(h=Math.floor(.5*(c+u)),s=t[Math.max(0,h-1)][i],r=t[h][i],a=t[Math.min(t.length-1,h+1)][i],0==n(r,e))return h;if(n(s,e)<0&&n(r,e)>0)return"before"==o?Math.max(0,h-1):h;if(n(r,e)<0&&n(a,e)>0)return"before"==o?h:Math.min(t.length-1,h+1);n(r,e)<0?u=h+1:c=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return.5>t?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return.5>t?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.5>t?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.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t}}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return ro.apply(null,arguments)}function i(t){ro=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var i,o=[];for(i=0;i<t.length;++i)o.push(e(t[i],i));return o}function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function a(t,e){for(var i in e)r(e,i)&&(t[i]=e[i]);return r(e,"toString")&&(t.toString=e.toString),r(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,i,o){return Lt(t,e,i,o,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(t){return null==t._pf&&(t._pf=d()),t._pf}function u(t){if(null==t._isValid){var e=l(t),i=ao.call(e.parsedDateParts,function(t){return null!=t});t._isValid=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function c(t){var e=h(NaN);return null!=t?a(l(e),t):l(e).userInvalidated=!0,e}function p(t){return void 0===t}function m(t,e){var i,o,n;if(p(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),p(e._i)||(t._i=e._i),p(e._f)||(t._f=e._f),p(e._l)||(t._l=e._l),p(e._strict)||(t._strict=e._strict),p(e._tzm)||(t._tzm=e._tzm),p(e._isUTC)||(t._isUTC=e._isUTC),p(e._offset)||(t._offset=e._offset),p(e._pf)||(t._pf=l(e)),p(e._locale)||(t._locale=e._locale),ho.length>0)for(i in ho)o=ho[i],n=e[o],p(n)||(t[o]=n);return t}function f(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),lo===!1&&(lo=!0,e.updateOffset(this),lo=!1)}function g(t){return t instanceof f||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function y(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=v(e)),i}function b(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;n>o;o++)(i&&t[o]!==e[o]||!i&&y(t[o])!==y(e[o]))&&r++;return r+s}function _(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function w(t,i){var o=!0;return a(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),o&&(_(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),o=!1),i.apply(this,arguments)},i)}function x(t,i){null!=e.deprecationHandler&&e.deprecationHandler(t,i),uo[t]||(_(i),uo[t]=!0)}function D(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function k(t){return"[object Object]"===Object.prototype.toString.call(t)}function S(t){var e,i;for(i in t)e=t[i],D(e)?this[i]=e:this["_"+i]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(t,e){var i,o=a({},t);for(i in e)r(e,i)&&(k(t[i])&&k(e[i])?(o[i]={},a(o[i],t[i]),a(o[i],e[i])):null!=e[i]?o[i]=e[i]:delete o[i]);return o}function O(t){null!=t&&this.set(t)}function T(t){return t?t.toLowerCase().replace("_","-"):t}function M(t){for(var e,i,o,n,s=0;s<t.length;){for(n=T(t[s]).split("-"),e=n.length,i=T(t[s+1]),i=i?i.split("-"):null;e>0;){if(o=E(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&b(n,i,!0)>=e-1)break;e--}s++}return null}function E(e){var i=null;if(!fo[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=po._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),P(i)}catch(o){}return fo[e]}function P(t,e){var i;return t&&(i=p(e)?I(t):A(t,e),i&&(po=i)),po._abbr}function A(t,e){return null!==e?(e.abbr=t,null!=fo[t]?(x("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=C(fo[t]._config,e)):null!=e.parentLocale&&(null!=fo[e.parentLocale]?e=C(fo[e.parentLocale]._config,e):x("parentLocaleUndefined","specified parentLocale is not defined yet")),fo[t]=new O(e),P(t),fo[t]):(delete fo[t],null)}function N(t,e){if(null!=e){var i;null!=fo[t]&&(e=C(fo[t]._config,e)),i=new O(e),i.parentLocale=fo[t],fo[t]=i,P(t)}else null!=fo[t]&&(null!=fo[t].parentLocale?fo[t]=fo[t].parentLocale:null!=fo[t]&&delete fo[t]);return fo[t]}function I(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return po;if(!o(t)){if(e=E(t))return e;t=[t]}return M(t)}function R(){return co(fo)}function L(t,e){var i=t.toLowerCase();go[i]=go[i+"s"]=go[e]=t}function F(t){return"string"==typeof t?go[t]||go[t.toLowerCase()]:void 0}function H(t){var e,i,o={};for(i in t)r(t,i)&&(e=F(i),e&&(o[e]=t[i]));return o}function Y(t,i){return function(o){return null!=o?(G(this,t,o),e.updateOffset(this,i),this):j(this,t)}}function j(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function G(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function z(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=F(t),D(this[t]))return this[t](e);return this}function W(t,e,i){var o=""+Math.abs(t),n=e-o.length,s=t>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function V(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(_o[t]=n),e&&(_o[e[0]]=function(){return W(n.apply(this,arguments),e[1],e[2])}),i&&(_o[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function B(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function U(t){var e,i,o=t.match(vo);for(e=0,i=o.length;i>e;e++)_o[o[e]]?o[e]=_o[o[e]]:o[e]=B(o[e]);return function(e){var n,s="";for(n=0;i>n;n++)s+=o[n]instanceof Function?o[n].call(e,t):o[n];return s}}function q(t,e){return t.isValid()?(e=X(e,t.localeData()),bo[e]=bo[e]||U(e),bo[e](t)):t.localeData().invalidDate()}function X(t,e){function i(t){return e.longDateFormat(t)||t}var o=5;for(yo.lastIndex=0;o>=0&&yo.test(t);)t=t.replace(yo,i),yo.lastIndex=0,o-=1;return t}function Z(t,e,i){Ho[t]=D(e)?e:function(t,o){return t&&i?i:e}}function K(t,e){return r(Ho,t)?Ho[t](e._strict,e._locale):new RegExp(J(t))}function J(t){return Q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function Q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(o=function(t,i){i[e]=y(t)}),i=0;i<t.length;i++)Yo[t[i]]=o}function tt(t,e){$(t,function(t,i,o,n){o._w=o._w||{},e(t,o._w,o,n)})}function et(t,e,i){null!=e&&r(Yo,t)&&Yo[t](e,i._a,i,t)}function it(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function ot(t,e){return o(this._months)?this._months[t.month()]:this._months[Zo.test(e)?"format":"standalone"][t.month()]}function nt(t,e){return o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Zo.test(e)?"format":"standalone"][t.month()]}function st(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;12>o;++o)s=h([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===e?(n=mo.call(this._shortMonthsParse,r),-1!==n?n:null):(n=mo.call(this._longMonthsParse,r),-1!==n?n:null):"MMM"===e?(n=mo.call(this._shortMonthsParse,r),-1!==n?n:(n=mo.call(this._longMonthsParse,r),-1!==n?n:null)):(n=mo.call(this._longMonthsParse,r),-1!==n?n:(n=mo.call(this._shortMonthsParse,r),-1!==n?n:null))}function rt(t,e,i){var o,n,s;if(this._monthsParseExact)return st.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;12>o;o++){if(n=h([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[o].test(t))return o;if(i&&"MMM"===e&&this._shortMonthsParse[o].test(t))return o;if(!i&&this._monthsParse[o].test(t))return o}}function at(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=y(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return i=Math.min(t.date(),it(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function ht(t){return null!=t?(at(this,t),e.updateOffset(this,!0),this):j(this,"Month")}function dt(){return it(this.year(),this.month())}function lt(t){return this._monthsParseExact?(r(this,"_monthsRegex")||ct.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ut(t){return this._monthsParseExact?(r(this,"_monthsRegex")||ct.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ct(){function t(t,e){return e.length-t.length}var e,i,o=[],n=[],s=[];for(e=0;12>e;e++)i=h([2e3,e]),o.push(this.monthsShort(i,"")),n.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(o.sort(t),n.sort(t),s.sort(t),e=0;12>e;e++)o[e]=Q(o[e]),n[e]=Q(n[e]),s[e]=Q(s[e]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function pt(t){var e,i=t._a;return i&&-2===l(t).overflow&&(e=i[Go]<0||i[Go]>11?Go:i[zo]<1||i[zo]>it(i[jo],i[Go])?zo:i[Wo]<0||i[Wo]>24||24===i[Wo]&&(0!==i[Vo]||0!==i[Bo]||0!==i[Uo])?Wo:i[Vo]<0||i[Vo]>59?Vo:i[Bo]<0||i[Bo]>59?Bo:i[Uo]<0||i[Uo]>999?Uo:-1,l(t)._overflowDayOfYear&&(jo>e||e>zo)&&(e=zo),l(t)._overflowWeeks&&-1===e&&(e=qo),l(t)._overflowWeekday&&-1===e&&(e=Xo),l(t).overflow=e),t}function mt(t){var e,i,o,n,s,r,a=t._i,h=tn.exec(a)||en.exec(a);if(h){for(l(t).iso=!0,e=0,i=nn.length;i>e;e++)if(nn[e][1].exec(h[1])){n=nn[e][0],o=nn[e][2]!==!1;break}if(null==n)return void(t._isValid=!1);if(h[3]){for(e=0,i=sn.length;i>e;e++)if(sn[e][1].exec(h[3])){s=(h[2]||" ")+sn[e][0];break}if(null==s)return void(t._isValid=!1)}if(!o&&null!=s)return void(t._isValid=!1);if(h[4]){if(!on.exec(h[4]))return void(t._isValid=!1);r="Z"}t._f=n+(s||"")+(r||""),Mt(t)}else t._isValid=!1}function ft(t){var i=rn.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(mt(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function gt(t,e,i,o,n,s,r){var a=new Date(t,e,i,o,n,s,r);return 100>t&&t>=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function vt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function yt(t){return bt(t)?366:365}function bt(t){return t%4===0&&t%100!==0||t%400===0}function _t(){return bt(this.year())}function wt(t,e,i){var o=7+e-i,n=(7+vt(t,0,o).getUTCDay()-e)%7;return-n+o-1}function xt(t,e,i,o,n){var s,r,a=(7+i-o)%7,h=wt(t,o,n),d=1+7*(e-1)+a+h;return 0>=d?(s=t-1,r=yt(s)+d):d>yt(t)?(s=t+1,r=d-yt(t)):(s=t,r=d),{year:s,dayOfYear:r}}function Dt(t,e,i){var o,n,s=wt(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return 1>r?(n=t.year()-1,o=r+kt(n,e,i)):r>kt(t.year(),e,i)?(o=r-kt(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function kt(t,e,i){var o=wt(t,e,i),n=wt(t+1,e,i);return(yt(t)-o+n)/7}function St(t,e,i){return null!=t?t:null!=e?e:i}function Ct(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function Ot(t){var e,i,o,n,s=[];if(!t._d){for(o=Ct(t),t._w&&null==t._a[zo]&&null==t._a[Go]&&Tt(t),t._dayOfYear&&(n=St(t._a[jo],o[jo]),t._dayOfYear>yt(n)&&(l(t)._overflowDayOfYear=!0),i=vt(n,0,t._dayOfYear),t._a[Go]=i.getUTCMonth(),t._a[zo]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Wo]&&0===t._a[Vo]&&0===t._a[Bo]&&0===t._a[Uo]&&(t._nextDay=!0,t._a[Wo]=0),t._d=(t._useUTC?vt:gt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Wo]=24)}}function Tt(t){var e,i,o,n,s,r,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(s=1,r=4,i=St(e.GG,t._a[jo],Dt(Ft(),1,4).year),o=St(e.W,1),n=St(e.E,1),(1>n||n>7)&&(h=!0)):(s=t._locale._week.dow,r=t._locale._week.doy,i=St(e.gg,t._a[jo],Dt(Ft(),s,r).year),o=St(e.w,1),null!=e.d?(n=e.d,(0>n||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s),1>o||o>kt(i,s,r)?l(t)._overflowWeeks=!0:null!=h?l(t)._overflowWeekday=!0:(a=xt(i,o,n,s,r),t._a[jo]=a.year,t._dayOfYear=a.dayOfYear)}function Mt(t){if(t._f===e.ISO_8601)return void mt(t);t._a=[],l(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=X(t._f,t._locale).match(vo)||[],i=0;i<n.length;i++)s=n[i],o=(a.match(K(s,t))||[])[0],o&&(r=a.substr(0,a.indexOf(o)),r.length>0&&l(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),_o[s]?(o?l(t).empty=!1:l(t).unusedTokens.push(s),et(s,o,t)):t._strict&&!o&&l(t).unusedTokens.push(s);l(t).charsLeftOver=h-d,a.length>0&&l(t).unusedInput.push(a),l(t).bigHour===!0&&t._a[Wo]<=12&&t._a[Wo]>0&&(l(t).bigHour=void 0),l(t).parsedDateParts=t._a.slice(0),l(t).meridiem=t._meridiem,t._a[Wo]=Et(t._locale,t._a[Wo],t._meridiem),Ot(t),pt(t)}function Et(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&12>e&&(e+=12),o||12!==e||(e=0),e):e}function Pt(t){var e,i,o,n,s;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;n<t._f.length;n++)s=0,e=m({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[n],Mt(e),u(e)&&(s+=l(e).charsLeftOver,s+=10*l(e).unusedTokens.length,l(e).score=s,(null==o||o>s)&&(o=s,i=e));a(t,i||e)}function At(t){if(!t._d){var e=H(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Ot(t)}}function Nt(t){var e=new f(pt(It(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function It(t){var e=t._i,i=t._f;return t._locale=t._locale||I(t._l),null===e||void 0===i&&""===e?c({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),g(e)?new f(pt(e)):(o(i)?Pt(t):i?Mt(t):n(e)?t._d=e:Rt(t),u(t)||(t._d=null),t))}function Rt(t){var i=t._i;void 0===i?t._d=new Date(e.now()):n(i)?t._d=new Date(i.valueOf()):"string"==typeof i?ft(t):o(i)?(t._a=s(i.slice(0),function(t){return parseInt(t,10)}),Ot(t)):"object"==typeof i?At(t):"number"==typeof i?t._d=new Date(i):e.createFromInputFallback(t)}function Lt(t,e,i,o,n){var s={};return"boolean"==typeof i&&(o=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=i,s._i=t,s._f=e,s._strict=o,Nt(s)}function Ft(t,e,i,o){return Lt(t,e,i,o,!1)}function Ht(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Ft();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}function Yt(){var t=[].slice.call(arguments,0);return Ht("isBefore",t)}function jt(){var t=[].slice.call(arguments,0);return Ht("isAfter",t)}function Gt(t){var e=H(t),i=e.year||0,o=e.quarter||0,n=e.month||0,s=e.week||0,r=e.day||0,a=e.hour||0,h=e.minute||0,d=e.second||0,l=e.millisecond||0;this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+n+3*o+12*i,this._data={},this._locale=I(),this._bubble()}function zt(t){return t instanceof Gt}function Wt(t,e){V(t,0,0,function(){var t=this.utcOffset(),i="+";return 0>t&&(t=-t,i="-"),i+W(~~(t/60),2)+e+W(~~t%60,2)})}function Vt(t,e){var i=(e||"").match(t)||[],o=i[i.length-1]||[],n=(o+"").match(un)||["-",0,0],s=+(60*n[1])+y(n[2]);return"+"===n[0]?s:-s}function Bt(t,i){var o,s;return i._isUTC?(o=i.clone(),s=(g(t)||n(t)?t.valueOf():Ft(t).valueOf())-o.valueOf(),o._d.setTime(o._d.valueOf()+s),e.updateOffset(o,!1),o):Ft(t).local()}function Ut(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function qt(t,i){var o,n=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Vt(Ro,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&i&&(o=Ut(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),n!==t&&(!i||this._changeInProgress?le(this,ne(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?n:Ut(this):null!=t?this:NaN}function Xt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Zt(t){return this.utcOffset(0,t)}function Kt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ut(this),"m")),this}function Jt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Vt(Io,this._i)),this}function Qt(t){return this.isValid()?(t=t?Ft(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function $t(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!p(this._isDSTShifted))return this._isDSTShifted;var t={};if(m(t,this),t=It(t),t._a){var e=t._isUTC?h(t._a):Ft(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ie(){return this.isValid()?this._isUTC:!1}function oe(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ne(t,e){var i,o,n,s=t,a=null;return zt(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=cn.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:y(a[zo])*i,h:y(a[Wo])*i,m:y(a[Vo])*i,s:y(a[Bo])*i,ms:y(a[Uo])*i}):(a=pn.exec(t))?(i="-"===a[1]?-1:1,s={y:se(a[2],i),M:se(a[3],i),w:se(a[4],i),
+d:se(a[5],i),h:se(a[6],i),m:se(a[7],i),s:se(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=ae(Ft(s.from),Ft(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new Gt(s),zt(t)&&r(t,"_locale")&&(o._locale=t._locale),o}function se(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function re(t,e){var i={milliseconds:0,months:0};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 ae(t,e){var i;return t.isValid()&&e.isValid()?(e=Bt(e,t),t.isBefore(e)?i=re(t,e):(i=re(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function he(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function de(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(x(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=ne(i,o),le(this,n,t),this}}function le(t,i,o,n){var s=i._milliseconds,r=he(i._days),a=he(i._months);t.isValid()&&(n=null==n?!0:n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&G(t,"Date",j(t,"Date")+r*o),a&&at(t,j(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function ue(t,e){var i=t||Ft(),o=Bt(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse",r=e&&(D(e[s])?e[s]():e[s]);return this.format(r||this.localeData().calendar(s,this,Ft(i)))}function ce(){return new f(this)}function pe(t,e){var i=g(t)?t:Ft(t);return this.isValid()&&i.isValid()?(e=F(p(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf()):!1}function me(t,e){var i=g(t)?t:Ft(t);return this.isValid()&&i.isValid()?(e=F(p(e)?"millisecond":e),"millisecond"===e?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf()):!1}function fe(t,e,i,o){return o=o||"()",("("===o[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===o[1]?this.isBefore(e,i):!this.isAfter(e,i))}function ge(t,e){var i,o=g(t)?t:Ft(t);return this.isValid()&&o.isValid()?(e=F(e||"millisecond"),"millisecond"===e?this.valueOf()===o.valueOf():(i=o.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf())):!1}function ve(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ye(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function be(t,e,i){var o,n,s,r;return this.isValid()?(o=Bt(t,this),o.isValid()?(n=6e4*(o.utcOffset()-this.utcOffset()),e=F(e),"year"===e||"month"===e||"quarter"===e?(r=_e(this,o),"quarter"===e?r/=3:"year"===e&&(r/=12)):(s=this-o,r="second"===e?s/1e3:"minute"===e?s/6e4:"hour"===e?s/36e5:"day"===e?(s-n)/864e5:"week"===e?(s-n)/6048e5:s),i?r:v(r)):NaN):NaN}function _e(t,e){var i,o,n=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(n,"months");return 0>e-s?(i=t.clone().add(n-1,"months"),o=(e-s)/(s-i)):(i=t.clone().add(n+1,"months"),o=(e-s)/(i-s)),-(n+o)||0}function we(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function xe(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?D(Date.prototype.toISOString)?this.toDate().toISOString():q(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):q(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function De(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var i=q(this,t);return this.localeData().postformat(i)}function ke(t,e){return this.isValid()&&(g(t)&&t.isValid()||Ft(t).isValid())?ne({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Se(t){return this.from(Ft(),t)}function Ce(t,e){return this.isValid()&&(g(t)&&t.isValid()||Ft(t).isValid())?ne({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Oe(t){return this.to(Ft(),t)}function Te(t){var e;return void 0===t?this._locale._abbr:(e=I(t),null!=e&&(this._locale=e),this)}function Me(){return this._locale}function Ee(t){switch(t=F(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function Pe(t){return t=F(t),void 0===t||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))}function Ae(){return this._d.valueOf()-6e4*(this._offset||0)}function Ne(){return Math.floor(this.valueOf()/1e3)}function Ie(){return this._offset?new Date(this.valueOf()):this._d}function Re(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Le(){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()}}function Fe(){return this.isValid()?this.toISOString():null}function He(){return u(this)}function Ye(){return a({},l(this))}function je(){return l(this).overflow}function Ge(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function ze(t,e){V(0,[t,t.length],0,e)}function We(t){return qe.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ve(t){return qe.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Be(){return kt(this.year(),1,4)}function Ue(){var t=this.localeData()._week;return kt(this.year(),t.dow,t.doy)}function qe(t,e,i,o,n){var s;return null==t?Dt(this,o,n).year:(s=kt(t,o,n),e>s&&(e=s),Xe.call(this,t,e,i,o,n))}function Xe(t,e,i,o,n){var s=xt(t,e,i,o,n),r=vt(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Ze(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ke(t){return Dt(t,this._week.dow,this._week.doy).week}function Je(){return this._week.dow}function Qe(){return this._week.doy}function $e(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function ti(t){var e=Dt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function ei(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function ii(t,e){return o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function oi(t){return this._weekdaysShort[t.day()]}function ni(t){return this._weekdaysMin[t.day()]}function si(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;7>o;++o)s=h([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=mo.call(this._weekdaysParse,r),-1!==n?n:null):"ddd"===e?(n=mo.call(this._shortWeekdaysParse,r),-1!==n?n:null):(n=mo.call(this._minWeekdaysParse,r),-1!==n?n:null):"dddd"===e?(n=mo.call(this._weekdaysParse,r),-1!==n?n:(n=mo.call(this._shortWeekdaysParse,r),-1!==n?n:(n=mo.call(this._minWeekdaysParse,r),-1!==n?n:null))):"ddd"===e?(n=mo.call(this._shortWeekdaysParse,r),-1!==n?n:(n=mo.call(this._weekdaysParse,r),-1!==n?n:(n=mo.call(this._minWeekdaysParse,r),-1!==n?n:null))):(n=mo.call(this._minWeekdaysParse,r),-1!==n?n:(n=mo.call(this._weekdaysParse,r),-1!==n?n:(n=mo.call(this._shortWeekdaysParse,r),-1!==n?n:null)))}function ri(t,e,i){var o,n,s;if(this._weekdaysParseExact)return si.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(n=h([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function ai(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=ei(t,this.localeData()),this.add(t-e,"d")):e}function hi(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")}function di(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function li(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex}function ui(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ci(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function pi(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],d=[],l=[];for(e=0;7>e;e++)i=h([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),d.push(s),l.push(o),l.push(n),l.push(s);for(r.sort(t),a.sort(t),d.sort(t),l.sort(t),e=0;7>e;e++)a[e]=Q(a[e]),d[e]=Q(d[e]),l[e]=Q(l[e]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function mi(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function fi(){return this.hours()%12||12}function gi(){return this.hours()||24}function vi(t,e){V(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function yi(t,e){return e._meridiemParse}function bi(t){return"p"===(t+"").toLowerCase().charAt(0)}function _i(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function wi(t,e){e[Uo]=y(1e3*("0."+t))}function xi(){return this._isUTC?"UTC":""}function Di(){return this._isUTC?"Coordinated Universal Time":""}function ki(t){return Ft(1e3*t)}function Si(){return Ft.apply(null,arguments).parseZone()}function Ci(t,e,i){var o=this._calendar[t];return D(o)?o.call(e,i):o}function Oi(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])}function Ti(){return this._invalidDate}function Mi(t){return this._ordinal.replace("%d",t)}function Ei(t){return t}function Pi(t,e,i,o){var n=this._relativeTime[i];return D(n)?n(t,e,i,o):n.replace(/%d/i,t)}function Ai(t,e){var i=this._relativeTime[t>0?"future":"past"];return D(i)?i(e):i.replace(/%s/i,e)}function Ni(t,e,i,o){var n=I(),s=h().set(o,e);return n[i](s,t)}function Ii(t,e,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Ni(t,e,i,"month");var o,n=[];for(o=0;12>o;o++)n[o]=Ni(t,o,i,"month");return n}function Ri(t,e,i,o){"boolean"==typeof t?("number"==typeof e&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,"number"==typeof e&&(i=e,e=void 0),e=e||"");var n=I(),s=t?n._week.dow:0;if(null!=i)return Ni(e,(i+s)%7,o,"day");var r,a=[];for(r=0;7>r;r++)a[r]=Ni(e,(r+s)%7,o,"day");return a}function Li(t,e){return Ii(t,e,"months")}function Fi(t,e){return Ii(t,e,"monthsShort")}function Hi(t,e,i){return Ri(t,e,i,"weekdays")}function Yi(t,e,i){return Ri(t,e,i,"weekdaysShort")}function ji(t,e,i){return Ri(t,e,i,"weekdaysMin")}function Gi(){var t=this._data;return this._milliseconds=jn(this._milliseconds),this._days=jn(this._days),this._months=jn(this._months),t.milliseconds=jn(t.milliseconds),t.seconds=jn(t.seconds),t.minutes=jn(t.minutes),t.hours=jn(t.hours),t.months=jn(t.months),t.years=jn(t.years),this}function zi(t,e,i,o){var n=ne(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Wi(t,e){return zi(this,t,e,1)}function Vi(t,e){return zi(this,t,e,-1)}function Bi(t){return 0>t?Math.floor(t):Math.ceil(t)}function Ui(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||0>=s&&0>=r&&0>=a||(s+=864e5*Bi(Xi(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=v(s/1e3),h.seconds=t%60,e=v(t/60),h.minutes=e%60,i=v(e/60),h.hours=i%24,r+=v(i/24),n=v(qi(r)),a+=n,r-=Bi(Xi(n)),o=v(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function qi(t){return 4800*t/146097}function Xi(t){return 146097*t/4800}function Zi(t){var e,i,o=this._milliseconds;if(t=F(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+qi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(Xi(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function Ki(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function Ji(t){return function(){return this.as(t)}}function Qi(t){return t=F(t),this[t+"s"]()}function $i(t){return function(){return this._data[t]}}function to(){return v(this.days()/7)}function eo(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function io(t,e,i){var o=ne(t).abs(),n=is(o.as("s")),s=is(o.as("m")),r=is(o.as("h")),a=is(o.as("d")),h=is(o.as("M")),d=is(o.as("y")),l=n<os.s&&["s",n]||1>=s&&["m"]||s<os.m&&["mm",s]||1>=r&&["h"]||r<os.h&&["hh",r]||1>=a&&["d"]||a<os.d&&["dd",a]||1>=h&&["M"]||h<os.M&&["MM",h]||1>=d&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=i,eo.apply(null,l)}function oo(t,e){return void 0===os[t]?!1:void 0===e?os[t]:(os[t]=e,!0)}function no(t){var e=this.localeData(),i=io(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function so(){var t,e,i,o=ns(this._milliseconds)/1e3,n=ns(this._days),s=ns(this._months);t=v(o/60),e=v(t/60),o%=60,t%=60,i=v(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,u=o,c=this.asSeconds();return c?(0>c?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||u?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var ro,ao;ao=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;i>o;o++)if(o in e&&t.call(this,e[o],o,e))return!0;return!1};var ho=e.momentProperties=[],lo=!1,uo={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var co;co=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)r(t,e)&&i.push(e);return i};var po,mo,fo={},go={},vo=/(\[[^\[]*\])|(\\)?([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,yo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bo={},_o={},wo=/\d/,xo=/\d\d/,Do=/\d{3}/,ko=/\d{4}/,So=/[+-]?\d{6}/,Co=/\d\d?/,Oo=/\d\d\d\d?/,To=/\d\d\d\d\d\d?/,Mo=/\d{1,3}/,Eo=/\d{1,4}/,Po=/[+-]?\d{1,6}/,Ao=/\d+/,No=/[+-]?\d+/,Io=/Z|[+-]\d\d:?\d\d/gi,Ro=/Z|[+-]\d\d(?::?\d\d)?/gi,Lo=/[+-]?\d+(\.\d{1,3})?/,Fo=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ho={},Yo={},jo=0,Go=1,zo=2,Wo=3,Vo=4,Bo=5,Uo=6,qo=7,Xo=8;mo=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)}),L("month","M"),Z("M",Co),Z("MM",Co,xo),Z("MMM",function(t,e){return e.monthsShortRegex(t)}),Z("MMMM",function(t,e){return e.monthsRegex(t)}),$(["M","MM"],function(t,e){e[Go]=y(t)-1}),$(["MMM","MMMM"],function(t,e,i,o){var n=i._locale.monthsParse(t,o,i._strict);null!=n?e[Go]=n:l(i).invalidMonth=t});var Zo=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ko="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Jo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Qo=Fo,$o=Fo,tn=/^\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)?)?/,en=/^\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)?)?/,on=/Z|[+-]\d\d(?::?\d\d)?/,nn=[["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}/]],sn=[["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/]],rn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),V("Y",0,0,function(){var t=this.year();return 9999>=t?""+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"),L("year","y"),Z("Y",No),Z("YY",Co,xo),Z("YYYY",Eo,ko),Z("YYYYY",Po,So),Z("YYYYYY",Po,So),$(["YYYYY","YYYYYY"],jo),$("YYYY",function(t,i){i[jo]=2===t.length?e.parseTwoDigitYear(t):y(t)}),$("YY",function(t,i){i[jo]=e.parseTwoDigitYear(t)}),$("Y",function(t,e){e[jo]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return y(t)+(y(t)>68?1900:2e3)};var an=Y("FullYear",!0);e.ISO_8601=function(){};var hn=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:c()}),dn=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:c()}),ln=function(){return Date.now?Date.now():+new Date};Wt("Z",":"),Wt("ZZ",""),Z("Z",Ro),Z("ZZ",Ro),$(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Vt(Ro,t)});var un=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var cn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,pn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;ne.fn=Gt.prototype;var mn=de(1,"add"),fn=de(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var gn=w("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)});V(0,["gg",2],0,function(){return this.weekYear()%100}),V(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ze("gggg","weekYear"),ze("ggggg","weekYear"),ze("GGGG","isoWeekYear"),ze("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Z("G",No),Z("g",No),Z("GG",Co,xo),Z("gg",Co,xo),Z("GGGG",Eo,ko),Z("gggg",Eo,ko),Z("GGGGG",Po,So),Z("ggggg",Po,So),tt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=y(t)}),tt(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),V("Q",0,"Qo","quarter"),L("quarter","Q"),Z("Q",wo),$("Q",function(t,e){e[Go]=3*(y(t)-1)}),V("w",["ww",2],"wo","week"),V("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Z("w",Co),Z("ww",Co,xo),Z("W",Co),Z("WW",Co,xo),tt(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=y(t)});var vn={dow:0,doy:6};V("D",["DD",2],"Do","date"),L("date","D"),Z("D",Co),Z("DD",Co,xo),Z("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),$(["D","DD"],zo),$("Do",function(t,e){e[zo]=y(t.match(Co)[0],10)});var yn=Y("Date",!0);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"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Z("d",Co),Z("e",Co),Z("E",Co),Z("dd",function(t,e){return e.weekdaysMinRegex(t)}),Z("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Z("dddd",function(t,e){return e.weekdaysRegex(t)}),tt(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:l(i).invalidWeekday=t}),tt(["d","e","E"],function(t,e,i,o){e[o]=y(t)});var bn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_n="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xn=Fo,Dn=Fo,kn=Fo;V("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Z("DDD",Mo),Z("DDDD",Do),$(["DDD","DDDD"],function(t,e,i){i._dayOfYear=y(t)}),V("H",["HH",2],0,"hour"),V("h",["hh",2],0,fi),V("k",["kk",2],0,gi),V("hmm",0,0,function(){return""+fi.apply(this)+W(this.minutes(),2)}),V("hmmss",0,0,function(){return""+fi.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)}),V("Hmm",0,0,function(){return""+this.hours()+W(this.minutes(),2)}),V("Hmmss",0,0,function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)}),vi("a",!0),vi("A",!1),L("hour","h"),Z("a",yi),Z("A",yi),Z("H",Co),Z("h",Co),Z("HH",Co,xo),Z("hh",Co,xo),Z("hmm",Oo),Z("hmmss",To),Z("Hmm",Oo),Z("Hmmss",To),$(["H","HH"],Wo),$(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),$(["h","hh"],function(t,e,i){e[Wo]=y(t),l(i).bigHour=!0}),$("hmm",function(t,e,i){var o=t.length-2;e[Wo]=y(t.substr(0,o)),e[Vo]=y(t.substr(o)),l(i).bigHour=!0}),$("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[Wo]=y(t.substr(0,o)),e[Vo]=y(t.substr(o,2)),e[Bo]=y(t.substr(n)),l(i).bigHour=!0}),$("Hmm",function(t,e,i){var o=t.length-2;e[Wo]=y(t.substr(0,o)),e[Vo]=y(t.substr(o))}),$("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[Wo]=y(t.substr(0,o)),e[Vo]=y(t.substr(o,2)),e[Bo]=y(t.substr(n))});var Sn=/[ap]\.?m?\.?/i,Cn=Y("Hours",!0);V("m",["mm",2],0,"minute"),L("minute","m"),Z("m",Co),Z("mm",Co,xo),$(["m","mm"],Vo);var On=Y("Minutes",!1);V("s",["ss",2],0,"second"),L("second","s"),Z("s",Co),Z("ss",Co,xo),$(["s","ss"],Bo);var Tn=Y("Seconds",!1);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()}),L("millisecond","ms"),Z("S",Mo,wo),Z("SS",Mo,xo),Z("SSS",Mo,Do);var Mn;for(Mn="SSSS";Mn.length<=9;Mn+="S")Z(Mn,Ao);for(Mn="S";Mn.length<=9;Mn+="S")$(Mn,wi);var En=Y("Milliseconds",!1);V("z",0,0,"zoneAbbr"),V("zz",0,0,"zoneName");var Pn=f.prototype;Pn.add=mn,Pn.calendar=ue,Pn.clone=ce,Pn.diff=be,Pn.endOf=Pe,Pn.format=De,Pn.from=ke,Pn.fromNow=Se,Pn.to=Ce,Pn.toNow=Oe,Pn.get=z,Pn.invalidAt=je,Pn.isAfter=pe,Pn.isBefore=me,Pn.isBetween=fe,Pn.isSame=ge,Pn.isSameOrAfter=ve,Pn.isSameOrBefore=ye,Pn.isValid=He,Pn.lang=gn,Pn.locale=Te,Pn.localeData=Me,Pn.max=dn,Pn.min=hn,Pn.parsingFlags=Ye,Pn.set=z,Pn.startOf=Ee,Pn.subtract=fn,Pn.toArray=Re,Pn.toObject=Le,Pn.toDate=Ie,Pn.toISOString=xe,Pn.toJSON=Fe,Pn.toString=we,Pn.unix=Ne,Pn.valueOf=Ae,Pn.creationData=Ge,Pn.year=an,Pn.isLeapYear=_t,Pn.weekYear=We,Pn.isoWeekYear=Ve,Pn.quarter=Pn.quarters=Ze,Pn.month=ht,Pn.daysInMonth=dt,Pn.week=Pn.weeks=$e,Pn.isoWeek=Pn.isoWeeks=ti,Pn.weeksInYear=Ue,Pn.isoWeeksInYear=Be,Pn.date=yn,Pn.day=Pn.days=ai,Pn.weekday=hi,Pn.isoWeekday=di,Pn.dayOfYear=mi,Pn.hour=Pn.hours=Cn,Pn.minute=Pn.minutes=On,Pn.second=Pn.seconds=Tn,Pn.millisecond=Pn.milliseconds=En,Pn.utcOffset=qt,Pn.utc=Zt,Pn.local=Kt,Pn.parseZone=Jt,Pn.hasAlignedHourOffset=Qt,Pn.isDST=$t,Pn.isDSTShifted=te,Pn.isLocal=ee,Pn.isUtcOffset=ie,Pn.isUtc=oe,Pn.isUTC=oe,Pn.zoneAbbr=xi,Pn.zoneName=Di,Pn.dates=w("dates accessor is deprecated. Use date instead.",yn),Pn.months=w("months accessor is deprecated. Use month instead",ht),Pn.years=w("years accessor is deprecated. Use year instead",an),Pn.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Xt);var An=Pn,Nn={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},In={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"},Rn="Invalid date",Ln="%d",Fn=/\d{1,2}/,Hn={future:"in %s",past:"%s ago",s:"a few 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"},Yn=O.prototype;Yn._calendar=Nn,Yn.calendar=Ci,Yn._longDateFormat=In,Yn.longDateFormat=Oi,Yn._invalidDate=Rn,Yn.invalidDate=Ti,Yn._ordinal=Ln,Yn.ordinal=Mi,Yn._ordinalParse=Fn,Yn.preparse=Ei,Yn.postformat=Ei,Yn._relativeTime=Hn,Yn.relativeTime=Pi,Yn.pastFuture=Ai,Yn.set=S,Yn.months=ot,Yn._months=Ko,Yn.monthsShort=nt,Yn._monthsShort=Jo,Yn.monthsParse=rt,Yn._monthsRegex=$o,Yn.monthsRegex=ut,Yn._monthsShortRegex=Qo,Yn.monthsShortRegex=lt,Yn.week=Ke,Yn._week=vn,Yn.firstDayOfYear=Qe,Yn.firstDayOfWeek=Je,Yn.weekdays=ii,Yn._weekdays=bn,Yn.weekdaysMin=ni,Yn._weekdaysMin=wn,Yn.weekdaysShort=oi,Yn._weekdaysShort=_n,Yn.weekdaysParse=ri,Yn._weekdaysRegex=xn,Yn.weekdaysRegex=li,Yn._weekdaysShortRegex=Dn,Yn.weekdaysShortRegex=ui,Yn._weekdaysMinRegex=kn,Yn.weekdaysMinRegex=ci,Yn.isPM=bi,Yn._meridiemParse=Sn,Yn.meridiem=_i,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===y(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",P),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",I);var jn=Math.abs,Gn=Ji("ms"),zn=Ji("s"),Wn=Ji("m"),Vn=Ji("h"),Bn=Ji("d"),Un=Ji("w"),qn=Ji("M"),Xn=Ji("y"),Zn=$i("milliseconds"),Kn=$i("seconds"),Jn=$i("minutes"),Qn=$i("hours"),$n=$i("days"),ts=$i("months"),es=$i("years"),is=Math.round,os={s:45,m:45,h:22,d:26,M:11},ns=Math.abs,ss=Gt.prototype;ss.abs=Gi,ss.add=Wi,ss.subtract=Vi,ss.as=Zi,ss.asMilliseconds=Gn,ss.asSeconds=zn,ss.asMinutes=Wn,ss.asHours=Vn,ss.asDays=Bn,ss.asWeeks=Un,ss.asMonths=qn,ss.asYears=Xn,ss.valueOf=Ki,ss._bubble=Ui,ss.get=Qi,ss.milliseconds=Zn,ss.seconds=Kn,ss.minutes=Jn,ss.hours=Qn,ss.days=$n,ss.weeks=to,ss.months=ts,ss.years=es,ss.humanize=no,ss.toISOString=so,ss.toString=so,ss.toJSON=so,ss.locale=Te,ss.localeData=Me,ss.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",so),ss.lang=gn,V("X",0,0,"unix"),V("x",0,0,"valueOf"),Z("x",No),Z("X",Lo),$("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),$("x",function(t,e,i){i._d=new Date(y(t))}),e.version="2.13.0",i(Ft),e.fn=An,e.min=Yt,e.max=jt,e.now=ln,e.utc=h,e.unix=ki,e.months=Li,e.isDate=n,e.locale=P,e.invalid=c,e.duration=ne,e.isMoment=g,e.weekdays=Hi,e.parseZone=Si,e.localeData=I,e.isDuration=zt,e.monthsShort=Fi,e.weekdaysMin=ji,e.defineLocale=A,e.updateLocale=N,e.locales=R,e.weekdaysShort=Yi,e.normalizeUnits=F,e.relativeTimeThreshold=oo,e.prototype=An;var rs=e;return rs})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>n&&(e[o+n++]=u[t])});16>n;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:f,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:v+1,d=a-g+(h-v)/1e4;if(0>d&&void 0===t.clockseq&&(r=r+1&16383),(0>d||a>g)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");g=a,v=h,f=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=255&u,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var c=t.node||m,p=0;6>p;p++)s[n+p]=c[p];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;16>a;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],u={},c=0;256>c;c++)l[c]=(c+256).toString(16).substr(1),u[l[c]]=c;var p=r(),m=[1|p[0],p[1],p[2],p[3],p[4],p[5]],f=16383&(p[6]<<8|p[7]),g=0,v=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},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 o;return e.hasOwnProperty(t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),
+a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;n>o;o++){var s=i[o],r=this._options.type[s];"Date"==r||"ISODate"==r||"ASPDate"==r?this._type[s]="Date":this._type[s]=r}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=i(9);o.prototype.setOptions=function(t){t&&void 0!==t.queue&&(t.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=r.extend(this,{replace:["add","update","remove"]})),"object"===n(t.queue)&&this._queue.setOptions(t.queue)))},o.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var o=[];t in this._subscribers&&(o=o.concat(this._subscribers[t])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0,s=o.length;s>n;n++){var r=o[n];r.callback&&r.callback(t,e,i||null)}},o.prototype.add=function(t,e){var i,o=[],n=this;if(Array.isArray(t))for(var s=0,r=t.length;r>s;s++)i=n._addItem(t[s]),o.push(i);else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=n._addItem(t),o.push(i)}return o.length&&this._trigger("add",{items:o},e),o},o.prototype.update=function(t,e){var i=[],o=[],n=[],r=[],a=this,h=a._fieldId,d=function(t){var e=t[h];if(a._data[e]){var d=s.extend({},a._data[e]);e=a._updateItem(t),o.push(e),r.push(t),n.push(d)}else e=a._addItem(t),i.push(e)};if(Array.isArray(t))for(var l=0,u=t.length;u>l;l++)t[l]instanceof Object?d(t[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!(t instanceof Object))throw new Error("Unknown dataType");d(t)}if(i.length&&this._trigger("add",{items:i},e),o.length){var c={items:o,oldData:n,data:r};this._trigger("update",c,e)}return i.concat(o)},o.prototype.get=function(t){var e,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(e=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,u,c,p,m=o&&o.type||this._options.type,f=o&&o.filter,g=[];if(void 0!=e)d=n._getItem(e,m),d&&f&&!f(d)&&(d=null);else if(void 0!=i)for(c=0,p=i.length;p>c;c++)d=n._getItem(i[c],m),f&&!f(d)||g.push(d);else for(l=Object.keys(this._data),c=0,p=l.length;p>c;c++)u=l[c],d=n._getItem(u,m),f&&!f(d)||g.push(d);if(o&&o.order&&void 0==e&&this._sort(g,o.order),o&&o.fields){var v=o.fields;if(void 0!=e)d=this._filterFields(d,v);else for(c=0,p=g.length;p>c;c++)g[c]=this._filterFields(g[c],v)}if("Object"==a){var y,b={};for(c=0,p=g.length;p>c;c++)y=g[c],b[y.id]=y;return b}return void 0!=e?d:g},o.prototype.getIds=function(t){var e,i,o,n,s,r=this._data,a=t&&t.filter,h=t&&t.order,d=t&&t.type||this._options.type,l=Object.keys(r),u=[];if(a)if(h){for(s=[],e=0,i=l.length;i>e;e++)o=l[e],n=this._getItem(o,d),a(n)&&s.push(n);for(this._sort(s,h),e=0,i=s.length;i>e;e++)u.push(s[e][this._fieldId])}else for(e=0,i=l.length;i>e;e++)o=l[e],n=this._getItem(o,d),a(n)&&u.push(n[this._fieldId]);else if(h){for(s=[],e=0,i=l.length;i>e;e++)o=l[e],s.push(r[o]);for(this._sort(s,h),e=0,i=s.length;i>e;e++)u.push(s[e][this._fieldId])}else for(e=0,i=l.length;i>e;e++)o=l[e],n=r[o],u.push(n[this._fieldId]);return u},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(t,e){var i,o,n,s,r=e&&e.filter,a=e&&e.type||this._options.type,h=this._data,d=Object.keys(h);if(e&&e.order){var l=this.get(e);for(i=0,o=l.length;o>i;i++)n=l[i],s=n[this._fieldId],t(n,s)}else for(i=0,o=d.length;o>i;i++)s=d[i],n=this._getItem(s,a),r&&!r(n)||t(n,s)},o.prototype.map=function(t,e){var i,o,n,s,r=e&&e.filter,a=e&&e.type||this._options.type,h=[],d=this._data,l=Object.keys(d);for(i=0,o=l.length;o>i;i++)n=l[i],s=this._getItem(n,a),r&&!r(s)||h.push(t(s,n));return e&&e.order&&this._sort(h,e.order),h},o.prototype._filterFields=function(t,e){if(!t)return t;var i,o,n={},s=Object.keys(t),r=s.length;if(Array.isArray(e))for(i=0;r>i;i++)o=s[i],-1!=e.indexOf(o)&&(n[o]=t[o]);else for(i=0;r>i;i++)o=s[i],e.hasOwnProperty(o)&&(n[e[o]]=t[o]);return n},o.prototype._sort=function(t,e){if(s.isString(e)){var i=e;t.sort(function(t,e){var o=t[i],n=e[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}},o.prototype.remove=function(t,e){var i,o,n,s=[];if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)n=this._remove(t[i]),null!=n&&s.push(n);else n=this._remove(t),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},e),s},o.prototype._remove=function(t){if(s.isNumber(t)||s.isString(t)){if(this._data[t])return delete this._data[t],this.length--,t}else if(t instanceof Object){var e=t[this._fieldId];if(void 0!==e&&this._data[e])return delete this._data[e],this.length--,e}return null},o.prototype.clear=function(t){var e=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:e},t),e},o.prototype.max=function(t){var e,i,o=this._data,n=Object.keys(o),s=null,r=null;for(e=0,i=n.length;i>e;e++){var a=n[e],h=o[a],d=h[t];null!=d&&(!s||d>r)&&(s=h,r=d)}return s},o.prototype.min=function(t){var e,i,o=this._data,n=Object.keys(o),s=null,r=null;for(e=0,i=n.length;i>e;e++){var a=n[e],h=o[a],d=h[t];null!=d&&(!s||r>d)&&(s=h,r=d)}return s},o.prototype.distinct=function(t){var e,i,o,n=this._data,r=Object.keys(n),a=[],h=this._options.type&&this._options.type[t]||null,d=0;for(e=0,o=r.length;o>e;e++){var l=r[e],u=n[l],c=u[t],p=!1;for(i=0;d>i;i++)if(a[i]==c){p=!0;break}p||void 0===c||(a[d]=c,d++)}if(h)for(e=0,o=a.length;o>e;e++)a[e]=s.convert(a[e],h);return a},o.prototype._addItem=function(t){var e=t[this._fieldId];if(void 0!=e){if(this._data[e])throw new Error("Cannot add item: item with id "+e+" already exists")}else e=s.randomUUID(),t[this._fieldId]=e;var i,o,n={},r=Object.keys(t);for(i=0,o=r.length;o>i;i++){var a=r[i],h=this._type[a];n[a]=s.convert(t[a],h)}return this._data[e]=n,this.length++,e},o.prototype._getItem=function(t,e){var i,o,n,r,a=this._data[t];if(!a)return null;var h={},d=Object.keys(a);if(e)for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=s.convert(o,e[i]);else for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=o;return h},o.prototype._updateItem=function(t){var e=t[this._fieldId];if(void 0==e)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this._data[e];if(!i)throw new Error("Cannot update item: no item with id "+e+" found");for(var o=Object.keys(t),n=0,r=o.length;r>n;n++){var a=o[n],h=this._type[a];i[a]=s.convert(t[a],h)}return e},t.exports=o},function(t,e){function i(t){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(t)}i.prototype.setOptions=function(t){t&&"undefined"!=typeof t.delay&&(this.delay=t.delay),t&&"undefined"!=typeof t.max&&(this.max=t.max),this._flushIfNeeded()},i.extend=function(t,e){var o=new i(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){o.flush()};var n=[{name:"flush",original:void 0}];if(e&&e.replace)for(var s=0;s<e.replace.length;s++){var r=e.replace[s];n.push({name:r,original:t[r]}),o.replace(t,r)}return o._extended={object:t,methods:n},o},i.prototype.destroy=function(){if(this.flush(),this._extended){for(var t=this._extended.object,e=this._extended.methods,i=0;i<e.length;i++){var o=e[i];o.original?t[o.name]=o.original:delete t[o.name]}this._extended=null}},i.prototype.replace=function(t,e){var i=this,o=t[e];if(!o)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.queue({args:t,fn:o,context:this})}},i.prototype.queue=function(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()},i.prototype._flushIfNeeded=function(){if(this._queue.length>this.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var n=i(1),s=i(8);o.prototype.setData=function(t){var e,i,o,n;if(this._data&&(this._data.off&&this._data.off("*",this.listener),e=Object.keys(this._ids),this._ids={},this.length=0,this._trigger("remove",{items:e})),this._data=t,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",e=this._data.getIds({filter:this._options&&this._options.filter}),o=0,n=e.length;n>o;o++)i=e[o],this._ids[i]=!0;this.length=e.length,this._trigger("add",{items:e}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){var t,e,i,o=this._data.getIds({filter:this._options&&this._options.filter}),n=Object.keys(this._ids),s={},r=[],a=[];for(e=0,i=o.length;i>e;e++)t=o[e],s[t]=!0,this._ids[t]||(r.push(t),this._ids[t]=!0);for(e=0,i=n.length;i>e;e++)t=n[e],s[t]||(a.push(t),delete this._ids[t]);this.length+=r.length-a.length,r.length&&this._trigger("add",{items:r}),a.length&&this._trigger("remove",{items:a})},o.prototype.get=function(t){var e,i,o,s=this,r=n.getType(arguments[0]);"String"==r||"Number"==r||"Array"==r?(e=arguments[0],i=arguments[1],o=arguments[2]):(i=arguments[0],o=arguments[1]);var a=n.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(t){return s._options.filter(t)&&i.filter(t)});var h=[];return void 0!=e&&h.push(e),h.push(a),h.push(o),this._data&&this._data.get.apply(this._data,h)},o.prototype.getIds=function(t){var e;if(this._data){var i,o=this._options.filter;i=t&&t.filter?o?function(e){return o(e)&&t.filter(e)}:t.filter:o,e=this._data.getIds({filter:i,order:t&&t.order})}else e=[];return e},o.prototype.map=function(t,e){var i=[];if(this._data){var o,n=this._options.filter;o=e&&e.filter?n?function(t){return n(t)&&e.filter(t)}:e.filter:n,i=this._data.map(t,{filter:o,order:e&&e.order})}else i=[];return i},o.prototype.getDataSet=function(){for(var t=this;t instanceof o;)t=t._data;return t||null},o.prototype._onEvent=function(t,e,i){var o,n,s,r,a=e&&e.items,h=this._data,d=[],l=[],u=[],c=[];if(a&&h){switch(t){case"add":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r&&(this._ids[s]=!0,l.push(s));break;case"update":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r?this._ids[s]?(u.push(s),d.push(e.data[o])):(this._ids[s]=!0,l.push(s)):this._ids[s]&&(delete this._ids[s],c.push(s));break;case"remove":for(o=0,n=a.length;n>o;o++)s=a[o],this._ids[s]&&(delete this._ids[s],c.push(s))}this.length+=l.length-c.length,l.length&&this._trigger("add",{items:l},i),u.length&&this._trigger("update",{items:u,data:d},i),c.length&&this._trigger("remove",{items:c},i)}},o.prototype.on=s.prototype.on,o.prototype.off=s.prototype.off,o.prototype._trigger=s.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e,i,o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!(Array.isArray(i)||i instanceof u||i instanceof c)&&i instanceof Object){var s=o;o=i,i=s}var r=this;this.defaultOptions={start:null,end:null,autoResize:!0,throttleRedraw:0,orientation:{axis:"bottom",item:"bottom"},rtl:!1,moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{getScale:function(){return r.timeAxis.step.scale},getStep:function(){return r.timeAxis.step.step},toScreen:r._toScreen.bind(r),toGlobalScreen:r._toGlobalScreen.bind(r),toTime:r._toTime.bind(r),toGlobalTime:r._toGlobalTime.bind(r)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new f(this.body),this.timeAxis2=null,this.components.push(this.timeAxis),this.currentTime=new g(this.body),this.components.push(this.currentTime),this.itemSet=new y(this.body,this.options),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){r.emit("click",r.getEventProperties(t))}),this.on("doubletap",function(t){r.emit("doubleClick",r.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){r.emit("contextmenu",r.getEventProperties(t))},this.fitDone=!1,this.on("changed",function(){if(null!=this.itemsData&&!r.fitDone)if(r.fitDone=!0,void 0!=r.options.start||void 0!=r.options.end){if(void 0==r.options.start||void 0==r.options.end)var t=r.getItemRange();var e=void 0!=r.options.start?r.options.start:t.min,i=void 0!=r.options.end?r.options.end:t.max;r.setWindow(e,i,{animation:!1})}else r.fit({animation:!1})}),o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(12),r=o(s),a=i(18),h=o(a),d=(i(19),i(14),i(2)),l=i(1),u=i(8),c=i(10),p=i(20),m=i(23),f=i(34),g=i(39),v=i(37),y=i(24),b=i(18).printStyle,_=i(40).allOptions,w=i(40).configureOptions;n.prototype=new m,n.prototype._createConfigurator=function(){return new r["default"](this,this.dom.container,w)},n.prototype.redraw=function(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()},n.prototype.setOptions=function(t){var e=h["default"].validate(t,_);if(e===!0&&console.log("%cErrors have been found in the supplied options object.",b),m.prototype.setOptions.call(this,t),"type"in t&&t.type!==this.options.type){this.options.type=t.type;var i=this.itemsData;if(i){var o=this.getSelection();this.setItems(null),this.setItems(i),this.setSelection(o)}}},n.prototype.setItems=function(t){var e;e=t?t instanceof u||t instanceof c?t:new u(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.itemSet&&this.itemSet.setItems(e)},n.prototype.setGroups=function(t){var e;e=t?t instanceof u||t instanceof c?t:new u(t):null,this.groupsData=e,this.itemSet.setGroups(e)},n.prototype.setData=function(t){t&&t.groups&&this.setGroups(t.groups),t&&t.items&&this.setItems(t.items)},n.prototype.setSelection=function(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)},n.prototype.getSelection=function(){return this.itemSet&&this.itemSet.getSelection()||[]},n.prototype.focus=function(t,e){if(this.itemsData&&void 0!=t){var i=Array.isArray(t)?t:[t],o=this.itemsData.getDataSet().get(i,{type:{start:"Date",end:"Date"}}),n=null,s=null;if(o.forEach(function(t){var e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===n||n>e)&&(n=e),(null===s||i>s)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=e&&void 0!==e.animation?e.animation:!0;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(t){var e,i=t&&void 0!==t.animation?t.animation:!0,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(e=this.getDataRange(),this.moveTo(e.min.valueOf(),{animation:i})):(e=this.getItemRange(),this.range.setRange(e.min,e.max,i))},n.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=null!==e.min?e.min.valueOf():null,o=null!==e.max?e.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,u;!function(){var e=function(t){return l.convert(t.data.start,"Date").valueOf()},c=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return l.convert(e,"Date").valueOf()};r=o-i,0>=r&&(r=10),a=r/t.props.center.width,l.forEach(t.itemSet.items,function(t){t.show(),t.repositionX();var r=e(t),h=c(t);if(this.options.rtl)var d=r-(t.getWidthRight()+10)*a,l=h+(t.getWidthLeft()+10)*a;else var d=r-(t.getWidthLeft()+10)*a,l=h+(t.getWidthRight()+10)*a;i>d&&(i=d,n=t),l>o&&(o=l,s=t)}.bind(t)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,u=t.props.center.width-h-d,u>0&&(t.options.rtl?(i=e(n)-d*r/u,o=c(s)+h*r/u):(i=e(n)-h*r/u,o=c(s)+d*r/u)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||t>o)&&(t=o),(null===e||n>e)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(t),r=this.itemSet.groupFromTarget(t),a=v.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),u=this.body.util.getStep(),c=this._toTime(o),p=h?h(c,d,u):c,m=l.getTarget(t),f=null;return null!=s?f="item":null!=a?f="custom-time":l.hasParent(m,this.timeAxis.dom.foreground)?f="axis":this.timeAxis2&&l.hasParent(m,this.timeAxis2.dom.foreground)?f="axis":l.hasParent(m,this.itemSet.dom.labelSet)?f="group-label":l.hasParent(m,this.currentTime.bar)?f="current-time":l.hasParent(m,this.dom.center)&&(f="background"),{event:t,item:s?s.id:null,group:r?r.groupId:null,what:f,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:c,snappedTime:p}},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(13),h=o(a),d=i(1),l=function(){function t(e,i,o){var s=arguments.length<=3||void 0===arguments[3]?1:arguments[3];n(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},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h["default"](s),this.wrapper=void 0}return r(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":s(t))?(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)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&-1===e.indexOf(n)||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){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"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),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){var e=arguments,i=this;if(this.allowCreation===!0){var o,n,r,a=function(){var s=document.createElement("div");for(s.className="vis-configuration vis-config-item vis-config-s"+t.length,o=e.length,n=Array(o>1?o-1:0),r=1;o>r;r++)n[r-1]=e[r];return n.forEach(function(t){s.appendChild(t)}),i.domElements.push(s),{v:i.domElements.length}}();if("object"===("undefined"==typeof a?"undefined":s(a)))return a.v}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]?!1:arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML="<i><b>"+t+":</b></i>":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&-1!==t.indexOf(e)&&(n=t.indexOf(e));for(var s=0;s<t.length;s++){var r=document.createElement("option");r.value=t[s],s===n&&(r.selected="selected"),r.innerHTML=t[s],o.appendChild(r)}var a=this;o.onchange=function(){a._update(this.value,i)};var h=this._makeLabel(i[i.length-1],i);this._makeItem(i,h,o)}},{key:"_makeRange",value:function(t,e,i){var o=t[0],n=t[1],s=t[2],r=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=s}catch(h){}a.step=r;var d="",l=0;if(void 0!==e){var u=1.2;0>e&&n>e*u?(a.min=Math.ceil(e*u),l=a.min,d="range increased"):n>e/u&&(a.min=Math.ceil(e/u),l=a.min,d="range increased"),e*u>s&&1!==s&&(a.max=Math.ceil(e*u),l=a.max,d="range increased"),a.value=e}else a.value=o;var c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;var p=this;a.onchange=function(){c.value=this.value,p._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};var m=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,m,a,c);""!==d&&this.popupHistory[f]!==l&&(this.popupHistory[f]=l,this._setupPopup(d,f))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var o=document.createElement("div");o.id="vis-configuration-popup",o.className="vis-configuration-popup",o.innerHTML=t,o.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:o,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],i=e.getBoundingClientRect();this.popupDiv.html.style.left=i.left+"px",this.popupDiv.html.style.top=i.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 o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=t,void 0!==e&&(o.checked=e,e!==t&&("object"===("undefined"==typeof t?"undefined":s(t))?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));var n=this;o.onchange=function(){n._update(this.checked,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}},{key:"_makeTextInput",value:function(t,e,i){var o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=e,e!==t&&this.changedOptions.push({path:i,value:e});var n=this;o.onchange=function(){n._update(this.value,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}},{key:"_makeColorField",value:function(t,e,i){var o=this,n=t[1],s=document.createElement("div");e=void 0===e?n:e,"none"!==e?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=e):s.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,s.onclick=function(){o._showColorPicker(e,s,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,s)}},{key:"_showColorPicker",value:function(t,e,i){var o=this;e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback(function(t){var n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,o._update(n,i)}),this.colorPicker.setCloseCallback(function(){e.onclick=function(){o._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]?!1:arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],h=d.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var u=!0;if(-1!==e.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(u=!1),u===!0)if(void 0!==a.enabled){var c=d.copyAndExtendArray(h,"enabled"),p=this._getValue(c);if(p===!0){var m=this._makeLabel(r,h,!0);this._makeItem(h,m),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,p,h)}else{var f=this._makeLabel(r,h,!0);this._makeItem(h,f),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{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],o=i;t="true"===t?!0:t,t="false"===t?!1:t;for(var n=0;n<e.length;n++)"global"!==e[n]&&(void 0===o[e[n]]&&(o[e[n]]={}),n!==e.length-1?o=o[e[n]]:o[e[n]]=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}();e["default"]=l},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(14),r=i(17),a=i(1),h=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];o(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 n(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){var e={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"};return"string"==typeof t?e[t]:void 0}},{key:"setColor",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),a.isString(t)===!0){if(a.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(t)===!0){var s=t.substr(5).substr(0,t.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(t)===!0){var r=a.hexToRGB(t);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var h=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:h}}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]?!0:arguments[0];e===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&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]?!0:arguments[1];e===!0&&(this.initialColor=a.extend({},t)),this.color=t;var i=a.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.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=a.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=a.HSVToRGB(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]?this.color:arguments[0],e=a.RGBToHSV(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 o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var t=this;this.drag={},this.pinch={},this.hammer=new s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.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(this.generated===!1){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=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var h=2*Math.PI/360,d=1/360,l=1/this.r,u=void 0;for(s=0;360>s;s++)for(r=0;r<this.r;r++)o=this.centerCoordinates.x+r*Math.sin(h*s),n=this.centerCoordinates.y+r*Math.cos(h*s),u=a.HSVToRGB(s*d,r*l,1),t.fillStyle="rgb("+u.r+","+u.g+","+u.b+")",t.fillRect(o-.5,n-.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,e,i)}this.generated=!0}},{key:"_moveSelector",value:function(t){var e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,o=t.center.y-e.top,n=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,h=o-n,d=Math.atan2(r,h),l=.98*Math.min(Math.sqrt(r*r+h*h),s),u=Math.cos(d)*l+n,c=Math.sin(d)*l+s;this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=c-.5*this.colorPickerSelector.clientWidth+"px";var p=d/(2*Math.PI);p=0>p?p+1:p;var m=l/this.r,f=a.RGBToHSV(this.color.r,this.color.g,this.color.b);f.h=p,f.s=m;var g=a.HSVToRGB(f.h,f.s,f.v);g.a=this.color.a,this.color=g,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}();e["default"]=h},function(t,e,i){if("undefined"!=typeof window){var o=i(15),n=window.Hammer||i(16);t.exports=o(n,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,o){function n(t){return t.match(/[^ ]+/g)}function s(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var i=!1;e.stopPropagation=function(){i=!0};var o=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof o&&(e.srcEvent.stopPropagation=function(){o(),e.stopPropagation()}),e.firstTarget=t;for(var n=t;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a<s.length;a++)if(r=s[a]._handlers[e.type])for(var h=0;h<r.length&&!i;h++)r[h](e);n=n.parentNode}}var r=o||{preventDefault:!1};if(i.Manager){var a=i,h=function(t,i){var o=Object.create(r);return i&&a.assign(o,i),e(new a(t,o),o)};return a.assign(h,a),h.Manager=function(t,i){var o=Object.create(r);return i&&a.assign(o,i),e(new a.Manager(t,o),o)},h}var d=Object.create(i),l=i.element;return l.hammer||(l.hammer=[]),l.hammer.push(d),i.on("hammer.input",function(e){r.preventDefault!==!0&&r.preventDefault!==e.pointerType||e.preventDefault(),e.isFirst&&(t=e.target)}),d._handlers={},d.on=function(t,e){return n(t).forEach(function(t){var o=d._handlers[t];o||(d._handlers[t]=o=[],i.on(t,s)),o.push(e)}),d},d.off=function(t,e){return n(t).forEach(function(t){var o=d._handlers[t];o&&(o=e?o.filter(function(t){return t!==e}):[],o.length>0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){var t=i.element.hammer,e=t.indexOf(d);-1!==e&&t.splice(e,1),t.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;/*! Hammer.JS - v2.0.6 - 2015-12-23
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2015 Jorik Tangelder;
+ * Licensed under the license */
+!function(n,s,r,a){function h(t,e,i){return setTimeout(p(t,i),e)}function d(t,e,i){return Array.isArray(t)?(l(t,i[e],i),!0):!1}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o<t.length;)e.call(i,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(i,t[o],o,t)}function u(t,e,i){var o="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",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function c(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&ut(o,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function m(t,e){return typeof t==mt?t.apply(e?e[0]||a:a,e):t}function f(t,e){return t===a?e:t}function g(t,e,i){l(_(e),function(e){t.addEventListener(e,i,!1)})}function v(t,e,i){l(_(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;o<t.length;){if(i&&t[o][i]==e||!i&&t[o]===e)return o;o++}return-1}function x(t){return Array.prototype.slice.call(t,0)}function D(t,e,i){for(var o=[],n=[],s=0;s<t.length;){var r=e?t[s][e]:t[s];w(n,r)<0&&o.push(t[s]),n[s]=r,s++}return i&&(o=e?o.sort(function(t,i){return t[e]>i[e]}):o.sort()),o}function k(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s<ct.length;){if(i=ct[s],o=i?i+n:e,o in t)return o;s++}return a}function S(){return _t++}function C(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||n}function O(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){m(t.options.enable,[t])&&i.handler(e)},this.init()}function T(t){var e,i=t.options.inputClass;return new(e=i?i:Dt?z:kt?B:xt?q:G)(t,M)}function M(t,e,i){var o=i.pointers.length,n=i.changedPointers.length,s=e&Et&&o-n===0,r=e&(At|Nt)&&o-n===0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,E(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function E(t,e){var i=t.session,o=e.pointers,n=o.length;i.firstInput||(i.firstInput=N(e)),n>1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=I(o);e.timeStamp=vt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=H(a,h),e.distance=F(a,h),P(i,e),e.offsetDirection=L(e.deltaX,e.deltaY);var d=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=gt(d.x)>gt(d.y)?d.x:d.y,e.scale=r?j(r.pointers,o):1,e.rotation=r?Y(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,A(i,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==Et&&s.eventType!==At||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function A(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Nt&&(h>Mt||r.velocity===a)){var d=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,u=R(h,d,l);o=u.x,n=u.y,i=gt(u.x)>gt(u.y)?u.x:u.y,s=L(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:ft(t.pointers[i].clientX),clientY:ft(t.pointers[i].clientY)},i++;return{timeStamp:vt(),pointers:e,center:I(e),deltaX:t.deltaX,deltaY:t.deltaY}}function I(t){var e=t.length;if(1===e)return{x:ft(t[0].clientX),y:ft(t[0].clientY)};for(var i=0,o=0,n=0;e>n;)i+=t[n].clientX,o+=t[n].clientY,n++;return{x:ft(i/e),y:ft(o/e)}}function R(t,e,i){return{x:e/t||0,y:i/t||0}}function L(t,e){return t===e?It:gt(t)>=gt(e)?0>t?Rt:Lt:0>e?Ft:Ht}function F(t,e,i){i||(i=zt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function H(t,e,i){i||(i=zt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function Y(t,e){return H(e[1],e[0],Wt)+H(t[1],t[0],Wt)}function j(t,e){return F(e[0],e[1],Wt)/F(t[0],t[1],Wt)}function G(){this.evEl=Bt,this.evWin=Ut,this.allow=!0,this.pressed=!1,O.apply(this,arguments)}function z(){this.evEl=Zt,this.evWin=Kt,O.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function W(){this.evTarget=Qt,this.evWin=$t,this.started=!1,O.apply(this,arguments)}function V(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(At|Nt)&&(i=D(i.concat(o),"identifier",!0)),[i,o]}function B(){this.evTarget=ee,this.targetIds={},O.apply(this,arguments)}function U(t,e){var i=x(t.touches),o=this.targetIds;if(e&(Et|Pt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return y(t.target,h)}),e===Et)for(n=0;n<s.length;)o[s[n].identifier]=!0,n++;for(n=0;n<r.length;)o[r[n].identifier]&&a.push(r[n]),e&(At|Nt)&&delete o[r[n].identifier],n++;return a.length?[D(s.concat(a),"identifier",!0),a]:void 0}function q(){O.apply(this,arguments);var t=p(this.handler,this);this.touch=new B(this.manager,t),this.mouse=new G(this.manager,t)}function X(t,e){this.manager=t,this.set(e)}function Z(t){if(b(t,ae))return ae;var e=b(t,he),i=b(t,de);return e&&i?ae:e||i?e?he:de:b(t,re)?re:se}function K(t){this.options=ut({},this.defaults,t||{}),this.id=S(),this.manager=null,this.options.enable=f(this.options.enable,!0),this.state=le,this.simultaneous={},this.requireFail=[]}function J(t){return t&fe?"cancel":t&pe?"end":t&ce?"move":t&ue?"start":""}function Q(t){return t==Ht?"down":t==Ft?"up":t==Rt?"left":t==Lt?"right":""}function $(t,e){var i=e.manager;return i?i.get(t):t}function tt(){K.apply(this,arguments)}function et(){tt.apply(this,arguments),this.pX=null,this.pY=null}function it(){tt.apply(this,arguments)}function ot(){K.apply(this,arguments),this._timer=null,this._input=null}function nt(){tt.apply(this,arguments)}function st(){tt.apply(this,arguments)}function rt(){K.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function at(t,e){return e=e||{},e.recognizers=f(e.recognizers,at.defaults.preset),new ht(t,e)}function ht(t,e){this.options=ut({},at.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=T(this),this.touchAction=new X(this,this.options.touchAction),dt(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function dt(t,e){var i=t.element;i.style&&l(t.options.cssProps,function(t,o){i.style[k(i.style,o)]=e?t:""})}function lt(t,e){var i=s.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}var ut,ct=["","webkit","Moz","MS","ms","o"],pt=s.createElement("div"),mt="function",ft=Math.round,gt=Math.abs,vt=Date.now;ut="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var o=arguments[i];if(o!==a&&null!==o)for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n])}return e}:Object.assign;var yt=u(function(t,e,i){for(var o=Object.keys(e),n=0;n<o.length;)(!i||i&&t[o[n]]===a)&&(t[o[n]]=e[o[n]]),n++;return t},"extend","Use `assign`."),bt=u(function(t,e){return yt(t,e,!0)},"merge","Use `assign`."),_t=1,wt=/mobile|tablet|ip(ad|hone|od)|android/i,xt="ontouchstart"in n,Dt=k(n,"PointerEvent")!==a,kt=xt&&wt.test(navigator.userAgent),St="touch",Ct="pen",Ot="mouse",Tt="kinect",Mt=25,Et=1,Pt=2,At=4,Nt=8,It=1,Rt=2,Lt=4,Ft=8,Ht=16,Yt=Rt|Lt,jt=Ft|Ht,Gt=Yt|jt,zt=["x","y"],Wt=["clientX","clientY"];O.prototype={handler:function(){},init:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(C(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&v(this.element,this.evEl,this.domHandler),this.evTarget&&v(this.target,this.evTarget,this.domHandler),this.evWin&&v(C(this.element),this.evWin,this.domHandler)}};var Vt={mousedown:Et,mousemove:Pt,mouseup:At},Bt="mousedown",Ut="mousemove mouseup";c(G,O,{handler:function(t){var e=Vt[t.type];e&Et&&0===t.button&&(this.pressed=!0),e&Pt&&1!==t.which&&(e=At),this.pressed&&this.allow&&(e&At&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Ot,srcEvent:t}))}});var qt={pointerdown:Et,pointermove:Pt,pointerup:At,pointercancel:Nt,pointerout:Nt},Xt={2:St,3:Ct,4:Ot,5:Tt},Zt="pointerdown",Kt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Zt="MSPointerDown",Kt="MSPointerMove MSPointerUp MSPointerCancel"),c(z,O,{handler:function(t){var e=this.store,i=!1,o=t.type.toLowerCase().replace("ms",""),n=qt[o],s=Xt[t.pointerType]||t.pointerType,r=s==St,a=w(e,t.pointerId,"pointerId");n&Et&&(0===t.button||r)?0>a&&(e.push(t),a=e.length-1):n&(At|Nt)&&(i=!0),0>a||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var Jt={touchstart:Et,touchmove:Pt,touchend:At,touchcancel:Nt},Qt="touchstart",$t="touchstart touchmove touchend touchcancel";c(W,O,{handler:function(t){var e=Jt[t.type];if(e===Et&&(this.started=!0),this.started){var i=V.call(this,t,e);e&(At|Nt)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:St,srcEvent:t})}}});var te={touchstart:Et,touchmove:Pt,touchend:At,touchcancel:Nt},ee="touchstart touchmove touchend touchcancel";c(B,O,{handler:function(t){var e=te[t.type],i=U.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:St,srcEvent:t})}}),c(q,O,{handler:function(t,e,i){var o=i.pointerType==St,n=i.pointerType==Ot;if(o)this.mouse.allow=!1;else if(n&&!this.mouse.allow)return;e&(At|Nt)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ie=k(pt.style,"touchAction"),oe=ie!==a,ne="compute",se="auto",re="manipulation",ae="none",he="pan-x",de="pan-y";X.prototype={set:function(t){t==ne&&(t=this.compute()),oe&&this.manager.element.style&&(this.manager.element.style[ie]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){m(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Z(t.join(" "))},preventDefaults:function(t){if(!oe){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var o=this.actions,n=b(o,ae),s=b(o,de),r=b(o,he);if(n){var a=1===t.pointers.length,h=t.distance<2,d=t.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return n||s&&i&Yt||r&&i&jt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var le=1,ue=2,ce=4,pe=8,me=pe,fe=16,ge=32;K.prototype={defaults:{},set:function(t){return ut(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(d(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=$(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return d(t,"dropRecognizeWith",this)?this:(t=$(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(d(t,"requireFailure",this))return this;var e=this.requireFail;return t=$(t,this),-1===w(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(d(t,"dropRequireFailure",this))return this;t=$(t,this);var e=w(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;pe>o&&e(i.options.event+J(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=pe&&e(i.options.event+J(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=ge)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(ge|le)))return!1;t++}return!0},recognize:function(t){var e=ut({},t);return m(this.options.enable,[this,e])?(this.state&(me|fe|ge)&&(this.state=le),this.state=this.process(e),void(this.state&(ue|ce|pe|fe)&&this.tryEmit(e))):(this.reset(),void(this.state=ge))},process:function(t){},getTouchAction:function(){},reset:function(){}},c(tt,K,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,o=e&(ue|ce),n=this.attrTest(t);return o&&(i&Nt||!n)?e|fe:o||n?i&At?e|pe:e&ue?e|ce:ue:ge}}),c(et,tt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Gt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Yt&&e.push(de),t&jt&&e.push(he),e},directionTest:function(t){var e=this.options,i=!0,o=t.distance,n=t.direction,s=t.deltaX,r=t.deltaY;return n&e.direction||(e.direction&Yt?(n=0===s?It:0>s?Rt:Lt,i=s!=this.pX,o=Math.abs(t.deltaX)):(n=0===r?It:0>r?Ft:Ht,i=r!=this.pY,o=Math.abs(t.deltaY))),t.direction=n,i&&o>e.threshold&&n&e.direction},attrTest:function(t){return tt.prototype.attrTest.call(this,t)&&(this.state&ue||!(this.state&ue)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Q(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(it,tt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ue)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(ot,K,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[se]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance<e.threshold,n=t.deltaTime>e.time;if(this._input=t,!o||!i||t.eventType&(At|Nt)&&!n)this.reset();else if(t.eventType&Et)this.reset(),this._timer=h(function(){this.state=me,this.tryEmit()},e.time,this);else if(t.eventType&At)return me;return ge},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===me&&(t&&t.eventType&At?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=vt(),this.manager.emit(this.options.event,this._input)))}}),c(nt,tt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ue)}}),c(st,tt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yt|jt,pointers:1},getTouchAction:function(){return et.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Yt|jt)?e=t.overallVelocity:i&Yt?e=t.overallVelocityX:i&jt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&>(e)>this.options.velocity&&t.eventType&At},emit:function(t){var e=Q(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(rt,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[re]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance<e.threshold,n=t.deltaTime<e.time;if(this.reset(),t.eventType&Et&&0===this.count)return this.failTimeout();if(o&&n&&i){if(t.eventType!=At)return this.failTimeout();var s=this.pTime?t.timeStamp-this.pTime<e.interval:!0,r=!this.pCenter||F(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,r&&s?this.count+=1:this.count=1,this._input=t;var a=this.count%e.taps;if(0===a)return this.hasRequireFailures()?(this._timer=h(function(){this.state=me,this.tryEmit()},e.interval,this),ue):me}return ge},failTimeout:function(){return this._timer=h(function(){this.state=ge},this.options.interval,this),ge},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==me&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),at.VERSION="2.0.6",at.defaults={domEvents:!1,touchAction:ne,enable:!0,inputTarget:null,inputClass:null,preset:[[nt,{enable:!1}],[it,{enable:!1},["rotate"]],[st,{direction:Yt}],[et,{direction:Yt},["swipe"]],[rt],[rt,{event:"doubletap",taps:2},["tap"]],[ot]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ve=1,ye=2;ht.prototype={set:function(t){return ut(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ye:ve},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,o=this.recognizers,n=e.curRecognizer;(!n||n&&n.state&me)&&(n=e.curRecognizer=null);for(var s=0;s<o.length;)i=o[s],e.stopped===ye||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(t),!n&&i.state&(ue|ce|pe)&&(n=e.curRecognizer=i),s++}},get:function(t){if(t instanceof K)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(d(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},remove:function(t){if(d(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=w(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){var i=this.handlers;return l(_(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},off:function(t,e){var i=this.handlers;return l(_(t),function(t){e?i[t]&&i[t].splice(w(i[t],e),1):delete i[t]}),this},emit:function(t,e){this.options.domEvents&<(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 o=0;o<i.length;)i[o](e),o++}},destroy:function(){this.element&&dt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ut(at,{INPUT_START:Et,INPUT_MOVE:Pt,INPUT_END:At,INPUT_CANCEL:Nt,STATE_POSSIBLE:le,STATE_BEGAN:ue,STATE_CHANGED:ce,STATE_ENDED:pe,STATE_RECOGNIZED:me,STATE_CANCELLED:fe,STATE_FAILED:ge,DIRECTION_NONE:It,DIRECTION_LEFT:Rt,DIRECTION_RIGHT:Lt,DIRECTION_UP:Ft,DIRECTION_DOWN:Ht,DIRECTION_HORIZONTAL:Yt,DIRECTION_VERTICAL:jt,DIRECTION_ALL:Gt,Manager:ht,Input:O,TouchAction:X,TouchInput:B,MouseInput:G,PointerEventInput:z,TouchMouseInput:q,SingleTouchInput:W,Recognizer:K,AttrRecognizer:tt,Tap:rt,Pan:et,Swipe:st,Pinch:it,Rotate:nt,Press:ot,on:g,off:v,each:l,merge:bt,extend:yt,assign:ut,inherit:c,bindFn:p,prefixed:k});var be="undefined"!=typeof n?n:"undefined"!=typeof self?self:{};be.Hammer=at,o=function(){return at}.call(e,i,e,t),!(o!==a&&(t.exports=o))}(window,document,"Hammer")},function(t,e,i){i(14);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){var e="pan-y";return t.getTouchAction=function(){return[e]},t}},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(1),a=!1,h=void 0,d="background: #FFeeee; color: #dd0000",l=function(){function t(){o(this,t)}return s(t,null,[{key:"validate",value:function(e,i,o){a=!1,h=i;var n=i;return void 0!==o&&(n=i[o]),t.parse(e,n,[]),a}},{key:"parse",value:function(e,i,o){for(var n in e)e.hasOwnProperty(n)&&t.check(n,e,i,o)}},{key:"check",value:function(e,i,o,n){void 0===o[e]&&void 0===o.__any__?t.getSuggestion(e,o,n):void 0===o[e]&&void 0!==o.__any__?"object"===t.getType(i[e])&&void 0!==o.__any__.__type__?t.checkFields(e,i,o,"__any__",o.__any__.__type__,n):t.checkFields(e,i,o,"__any__",o.__any__,n):void 0!==o[e].__type__?t.checkFields(e,i,o,e,o[e].__type__,n):t.checkFields(e,i,o,e,o[e],n)}},{key:"checkFields",value:function(e,i,o,n,s,h){var l=t.getType(i[e]),u=s[l];void 0!==u?"array"===t.getType(u)&&-1===u.indexOf(i[e])?(console.log('%cInvalid option detected in "'+e+'". Allowed values are:'+t.print(u)+' not "'+i[e]+'". '+t.printLocation(h,e),d),a=!0):"object"===l&&"__any__"!==n&&(h=r.copyAndExtendArray(h,e),t.parse(i[e],o[n],h)):void 0===s.any&&(console.log('%cInvalid type received for "'+e+'". Expected: '+t.print(Object.keys(s))+". Received ["+l+'] "'+i[e]+'"'+t.printLocation(h,e),d),a=!0)}},{key:"getType",value:function(t){var e="undefined"==typeof t?"undefined":n(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":t._isAMomentObject===!0?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}},{key:"getSuggestion",value:function(e,i,o){var n=t.findInOptions(e,i,o,!1),s=t.findInOptions(e,h,[],!0),r=8,l=4;void 0!==n.indexMatch?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n',d):s.distance<=l&&n.distance>s.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),d):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print(Object.keys(i))+t.printLocation(o,e),d),a=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3],s=1e9,a="",h=[],d=e.toLowerCase(),l=void 0;for(var u in i){var c=void 0;if(void 0!==i[u].__type__&&n===!0){var p=t.findInOptions(e,i[u],r.copyAndExtendArray(o,u));s>p.distance&&(a=p.closestMatch,h=p.path,s=p.distance,l=p.indexMatch)}else-1!==u.toLowerCase().indexOf(d)&&(l=u),c=t.levenshteinDistance(e,u),s>c&&(a=u,h=r.copyArray(o),s=c)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length<=2||void 0===arguments[2]?"Problem value found at: \n":arguments[2],o="\n\n"+i+"options = {\n",n=0;n<t.length;n++){for(var s=0;n+1>s;s++)o+=" ";o+=t[n]+": {\n"}for(var r=0;r<t.length+1;r++)o+=" ";o+=e+"\n";for(var a=0;a<t.length+1;a++){for(var h=0;h<t.length-a;h++)o+=" ";o+="}\n"}return o+"\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,o=[];for(i=0;i<=e.length;i++)o[i]=[i];var n;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}();e["default"]=l,e.printStyle=d},function(t,e){function i(t){return t?o(t):void 0}function o(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,n=0;n<i.length;n++)if(o=i[n],o===e||o.fn===e){i.splice(n,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),i=this._callbacks[t];if(i){i=i.slice(0);for(var o=0,n=i.length;n>o;++o)i[o].apply(this,e)}return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,i){function o(t,e){var i=a().hours(0).minutes(0).seconds(0).milliseconds(0);this.start=i.clone().add(-3,"days").valueOf(),this.end=i.clone().add(4,"days").valueOf(),this.body=t,this.deltaDifference=0,this.scaleOffset=0,this.startToFront=!1,this.endToFront=!0,this.defaultOptions={rtl:!1,start:null,end:null,moment:a,direction:"horizontal",moveable:!0,zoomable:!0,min:null,max:null,zoomMin:10,zoomMax:31536e10},this.options=r.extend({},this.defaultOptions),this.props={touch:{}},this.animationTimer=null,this.body.emitter.on("panstart",this._onDragStart.bind(this)),this.body.emitter.on("panmove",this._onDrag.bind(this)),this.body.emitter.on("panend",this._onDragEnd.bind(this)),this.body.emitter.on("mousewheel",this._onMouseWheel.bind(this)),this.body.emitter.on("touch",this._onTouch.bind(this)),this.body.emitter.on("pinch",this._onPinch.bind(this)),this.setOptions(e)}function n(t){if("horizontal"!=t&&"vertical"!=t)throw new TypeError('Unknown direction "'+t+'". Choose "horizontal" or "vertical".')}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=i(1),a=(i(17),i(2)),h=i(21),d=i(22);o.prototype=new h,o.prototype.setOptions=function(t){if(t){var e=["direction","min","max","zoomMin","zoomMax","moveable","zoomable","moment","activate","hiddenDates","zoomKey","rtl"];r.selectiveExtend(e,this.options,t),("start"in t||"end"in t)&&this.setRange(t.start,t.end)}},o.prototype.setRange=function(t,e,i,o){o!==!0&&(o=!1);var n=void 0!=t?r.convert(t,"Date").valueOf():null,a=void 0!=e?r.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),i){var h=this,l=this.start,u=this.end,c="object"===("undefined"==typeof i?"undefined":s(i))&&"duration"in i?i.duration:500,p="object"===("undefined"==typeof i?"undefined":s(i))&&"easingFunction"in i?i.easingFunction:"easeInOutQuad",m=r.easingFunctions[p];if(!m)throw new Error("Unknown easing function "+JSON.stringify(p)+". Choose from: "+Object.keys(r.easingFunctions).join(", "));var f=(new Date).valueOf(),g=!1,v=function _(){if(!h.props.touch.dragging){var t=(new Date).valueOf(),e=t-f,i=m(e/c),s=e>c,r=s||null===n?n:l+(n-l)*i,p=s||null===a?a:u+(a-u)*i;y=h._applyRange(r,p),d.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),g=g||y,y&&h.body.emitter.emit("rangechange",{start:new Date(h.start),end:new Date(h.end),byUser:o}),s?g&&h.body.emitter.emit("rangechanged",{start:new Date(h.start),end:new Date(h.end),byUser:o}):h.animationTimer=setTimeout(_,20)}};return v()}var y=this._applyRange(n,a);if(d.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),y){var b={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",b),this.body.emitter.emit("rangechanged",b)}},o.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},o.prototype._applyRange=function(t,e){var i,o=null!=t?r.convert(t,"Date").valueOf():this.start,n=null!=e?r.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(o>n&&(n=o),null!==a&&a>o&&(i=a-o,o+=i,n+=i,null!=s&&n>s&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=a&&a>o&&(o=a)),null!==this.options.zoomMin){var h=parseFloat(this.options.zoomMin);0>h&&(h=0),h>n-o&&(this.end-this.start===h&&o>this.start&&n<this.end?(o=this.start,n=this.end):(i=h-(n-o),o-=i/2,n+=i/2))}if(null!==this.options.zoomMax){var d=parseFloat(this.options.zoomMax);0>d&&(d=0),n-o>d&&(this.end-this.start===d&&o<this.start&&n>this.end?(o=this.start,n=this.end):(i=n-o-d,o+=i/2,n-=i/2))}var l=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(t,e){return o.conversion(this.start,this.end,t,e)},o.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(t){if(this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;n(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,s=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=s;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,l=this.props.touch.end+a,u=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),c=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(u!=h||c!=l)return this.deltaDifference+=i,this.props.touch.start=u,this.props.touch.end=c,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,l);var p=new Date(this.start),m=new Date(this.end);this.body.emitter.emit("rangechange",{start:p,end:m,byUser:!0})}},o.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(t){if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&(!this.options.zoomKey||t[this.options.zoomKey])){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var i;i=0>e?1-e/5:1/(1+e/5);var o=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center),n=this._pointerToDate(o);this.zoom(i,n,e)}t.preventDefault()}},o.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,
+this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center));var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=0>=1-e,this.endToFront=0>=e-1;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-t.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-r.getAbsoluteLeft(this.body.dom.centerContainer);else var i=r.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(n(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},o.prototype.getPointer=function(t,e){return this.options.rtl?{x:r.getAbsoluteRight(e)-t.x,y:t.y-r.getAbsoluteTop(e)}:{x:t.x-r.getAbsoluteLeft(e),y:t.y-r.getAbsoluteTop(e)}},o.prototype.zoom=function(t,e,i){null==e&&(e=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),s=o-n,r=e-n+(this.start-(e-n))*t,a=e+s+(this.end-(e+s))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);h==r&&l==a||(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},o.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n)},t.exports=o},function(t,e){function i(t,e){this.options=null,this.props=null}i.prototype.setOptions=function(t){t&&util.extend(this.options,t)},i.prototype.redraw=function(){return!1},i.prototype.destroy=function(){},i.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=i},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n<o.length;n++)if(void 0===o[n].repeat){var s={};s.start=t(o[n].start).toDate().valueOf(),s.end=t(o[n].end).toDate().valueOf(),i.hiddenDates.push(s)}i.hiddenDates.sort(function(t,e){return t.start-e.start})}},e.updateHiddenDates=function(t,i,o){if(o&&!Array.isArray(o))return e.updateHiddenDates(t,i,[o]);if(o&&void 0!==i.domProps.centerContainer.width){e.convertHiddenOptions(t,i,o);for(var n=t(i.range.start),s=t(i.range.end),r=i.range.end-i.range.start,a=r/i.domProps.centerContainer.width,h=0;h<o.length;h++)if(void 0!==o[h].repeat){var d=t(o[h].start),l=t(o[h].end);if("Invalid Date"==d._d)throw new Error("Supplied start date is not valid: "+o[h].start);if("Invalid Date"==l._d)throw new Error("Supplied end date is not valid: "+o[h].end);var u=l-d;if(u>=4*a){var c=0,p=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(c=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-c,"days"),p.add(1,"weeks");break;case"weekly":var m=l.diff(d,"days"),f=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(f),l.day(f),l.add(m,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(c=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(c,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(c=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(c,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;p>d;)switch(i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()}),o[h].repeat){case"daily":d.add(1,"days"),l.add(1,"days");break;case"weekly":d.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":d.add(1,"months"),l.add(1,"months");break;case"yearly":d.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()})}}e.removeDuplicates(i);var g=e.isHidden(i.range.start,i.hiddenDates),v=e.isHidden(i.range.end,i.hiddenDates),y=i.range.start,b=i.range.end;1==g.hidden&&(y=1==i.range.startToFront?g.startDate-1:g.endDate+1),1==v.hidden&&(b=1==i.range.endToFront?v.startDate-1:v.endDate+1),1!=g.hidden&&1!=v.hidden||i.range._applyRange(y,b)}},e.removeDuplicates=function(t){for(var e=t.hiddenDates,i=[],o=0;o<e.length;o++)for(var n=0;n<e.length;n++)o!=n&&1!=e[n].remove&&1!=e[o].remove&&(e[n].start>=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o<e.length;o++)e[o].remove!==!0&&i.push(e[o]);t.hiddenDates=i,t.hiddenDates.sort(function(t,e){return t.start-e.start})},e.printDates=function(t){for(var e=0;e<t.length;e++)console.log(e,new Date(t[e].start),new Date(t[e].end),t[e].start,t[e].end,t[e].remove)},e.stepOverHiddenDates=function(t,e,i){for(var o=!1,n=e.current.valueOf(),s=0;s<e.hiddenDates.length;s++){var r=e.hiddenDates[s].start,a=e.hiddenDates[s].end;if(n>=r&&a>n){o=!0;break}}if(1==o&&n<e._end.valueOf()&&n!=i){var h=t(i),d=t(a);h.year()!=d.year()?e.switchedYear=!0:h.month()!=d.month()?e.switchedMonth=!0:h.dayOfYear()!=d.dayOfYear()&&(e.switchedDay=!0),e.current=d}},e.toScreen=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return(i.valueOf()-n.offset)*n.scale}var s=e.isHidden(i,t.body.hiddenDates);1==s.hidden&&(i=s.startDate);var r=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end);i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,t.range,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale},e.toTime=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return new Date(i/n.scale+n.offset)}var s=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end),r=t.range.end-t.range.start-s,a=r*i/o,h=e.getAccumulatedHiddenDuration(t.body.hiddenDates,t.range,a),d=new Date(h+a+t.range.start);return d},e.getHiddenDurationBetween=function(t,e,i){for(var o=0,n=0;n<t.length;n++){var s=t[n].start,r=t[n].end;s>=e&&i>r&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s<e.length;s++){var r=e[s].start,a=e[s].end;r>=i.start&&a<i.end&&o>=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r<t.length;r++){var a=t[r].start,h=t[r].end;if(a>=e.start&&h<e.end){if(n+=a-s,s=h,n>=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?0>o?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i<e.length;i++){var o=e[i].start,n=e[i].end;if(t>=o&&n>t)return{hidden:!0,startDate:o,endDate:n}}return{hidden:!1,startDate:o,endDate:n}}},function(t,e,i){function o(){}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(19),r=i(14),a=i(17),h=i(1),d=(i(8),i(10),i(20),i(24),i(34)),l=i(35),u=i(22),c=i(37);s(o.prototype),o.prototype._create=function(t){function e(t){i.isActive()&&i.emit("mousewheel",t)}this.dom={},this.dom.container=t,this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.on("rangechange",function(){this.initialDrawDone===!0&&this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("pan",this._onDrag.bind(this));var i=this;this.on("_change",function(t){t&&1==t.queue?i._redrawTimer||(i._redrawTimer=setTimeout(function(){i._redrawTimer=null,i._redraw()},0)):i._redraw()}),this.hammer=new r(this.dom.root);var o=this.hammer.get("pinch").set({enable:!0});a.disablePreventDefaultVertically(o),this.hammer.get("pan").set({threshold:5,direction:r.DIRECTION_HORIZONTAL}),this.listeners={};var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];if(n.forEach(function(t){var e=function(e){i.isActive()&&i.emit(t,e)};i.hammer.on(t,e),i.listeners[t]=e}),a.onTouch(this.hammer,function(t){i.emit("touch",t)}.bind(this)),a.onRelease(this.hammer,function(t){i.emit("release",t)}.bind(this)),this.dom.root.addEventListener("mousewheel",e),this.dom.root.addEventListener("DOMMouseScroll",e),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root)},o.prototype.setOptions=function(t){if(t){var e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","rtl","throttleRedraw"];if(h.selectiveExtend(e,this.options,t),this.options.rtl){var i=this.dom.leftContainer;this.dom.leftContainer=this.dom.rightContainer,this.dom.rightContainer=i,this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"}if(this.options.orientation={item:void 0,axis:void 0},"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"===n(t.orientation)&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){var o=this.timeAxis2=new d(this.body);o.setOptions=function(t){var e=t?h.extend({},t):{};e.orientation="top",d.prototype.setOptions.call(o,e)},this.components.push(o)}}else if(this.timeAxis2){var s=this.components.indexOf(this.timeAxis2);-1!==s&&this.components.splice(s,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&u.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new l(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),"showCustomTime"in t)throw new Error("Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])");this._initAutoResize()}if(this.components.forEach(function(e){return e.setOptions(t)}),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);var r=h.deepExtend({},this.options);this.components.forEach(function(t){h.deepExtend(r,t.options)}),this.configurator.setModuleOptions({global:r})}this._origRedraw?this._redraw():(this._origRedraw=this._redraw.bind(this),this._redraw=h.throttle(this._origRedraw,this.options.throttleRedraw))},o.prototype.isActive=function(){return!this.activator||this.activator.active},o.prototype.destroy=function(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(var t in this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];this.listeners=null,this.hammer=null,this.components.forEach(function(t){return t.destroy()}),this.body=null},o.prototype.setCustomTime=function(t,e){var i=this.customTimes.filter(function(t){return e===t.options.id});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));i.length>0&&i[0].setCustomTime(t)},o.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));return e[0].getCustomTime()},o.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));return i.length>0?i[0].setCustomTitle(t):void 0},o.prototype.getEventProperties=function(t){return{event:t}},o.prototype.addCustomTime=function(t,e){var i=void 0!==t?h.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+JSON.stringify(e)+" already exists");var n=new c(this.body,h.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},o.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=t&&void 0!==t.animation?t.animation:!0;this.range.setRange(o,n,s)}},o.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},o.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0!==n.animation?n.animation:!0,this.range.setRange(n.start,n.end,o)}else o=i&&void 0!==i.animation?i.animation:!0,this.range.setRange(t,e,o)},o.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=h.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=e&&void 0!==e.animation?e.animation:!0;this.range.setRange(n,s,r)},o.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){this.redrawCount++;var t=!1,e=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){u.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(h.addClassName(o.root,"vis-top"),h.removeClassName(o.root,"vis-bottom")):(h.removeClassName(o.root,"vis-top"),h.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=h.option.asSize(e.maxHeight,""),o.root.style.minHeight=h.option.asSize(e.minHeight,""),o.root.style.width=h.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var n=o.root.offsetHeight-o.root.clientHeight,s=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(s=n),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var a=Math.max(i.left.height,i.center.height,i.right.height),d=i.top.height+a+i.bottom.height+n+i.border.top+i.border.bottom;o.root.style.height=h.option.asSize(e.height,d+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-n;var l=i.root.height-i.top.height-i.bottom.height-n;i.centerContainer.height=l,i.leftContainer.height=l,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-s,i.left.width=o.leftContainer.clientWidth||-i.border.left,i.leftContainer.width=i.left.width,i.right.width=o.rightContainer.clientWidth||-i.border.right,i.rightContainer.width=i.right.width;var c=i.root.width-i.left.width-i.right.width-s;i.center.width=c,i.centerContainer.width=c,i.top.width=c,i.bottom.width=c,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px",this._updateScrollTop();var p=this.props.scrollTop;"top"!=e.orientation.item&&(p+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=p+"px",o.left.style.left="0",o.left.style.top=p+"px",o.right.style.left="0",o.right.style.top=p+"px";var m=0==this.props.scrollTop?"hidden":"",f=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=m,o.shadowBottom.style.visibility=f,o.shadowTopLeft.style.visibility=m,o.shadowBottomLeft.style.visibility=f,o.shadowTopRight.style.visibility=m,o.shadowBottomRight.style.visibility=f;var g=this.props.center.height>this.props.centerContainer.height;this.hammer.get("pan").set({direction:g?r.DIRECTION_ALL:r.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var v=5;if(t){if(this.redrawCount<v)return void this.body.emitter.emit("_change");console.log("WARNING: infinite loop in redraw?")}else this.redrawCount=0;this.initialDrawDone=!0,this.body.emitter.emit("changed")}},o.prototype.repaint=function(){throw new Error("Function repaint is deprecated. Use redraw instead.")},o.prototype.setCurrentTime=function(t){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");this.currentTime.setCurrentTime(t)},o.prototype.getCurrentTime=function(){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");return this.currentTime.getCurrentTime()},o.prototype._toTime=function(t){return u.toTime(this,t,this.props.center.width)},o.prototype._toGlobalTime=function(t){return u.toTime(this,t,this.props.root.width)},o.prototype._toScreen=function(t){return u.toScreen(this,t,this.props.center.width)},o.prototype._toGlobalScreen=function(t){return u.toScreen(this,t,this.props.root.width)},o.prototype._initAutoResize=function(){1==this.options.autoResize?this._startAutoResize():this._stopAutoResize()},o.prototype._startAutoResize=function(){var t=this;this._stopAutoResize(),this._onResize=function(){return 1!=t.options.autoResize?void t._stopAutoResize():void(t.dom.root&&(t.dom.root.offsetWidth==t.props.lastWidth&&t.dom.root.offsetHeight==t.props.lastHeight||(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight,t.body.emitter.emit("_change"))))},h.addEventListener(window,"resize",this._onResize),t.dom.root&&(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight),this.watchTimer=setInterval(this._onResize,1e3)},o.prototype._stopAutoResize=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0),this._onResize&&(h.removeEventListener(window,"resize",this._onResize),this._onResize=null)},o.prototype._onTouch=function(t){this.touch.allowDragging=!0,this.touch.initialScrollTop=this.props.scrollTop},o.prototype._onPinch=function(t){this.touch.allowDragging=!1},o.prototype._onDrag=function(t){if(this.touch.allowDragging){var e=t.deltaY,i=this._getScrollTop(),o=this._setScrollTop(this.touch.initialScrollTop+e);o!=i&&this.emit("verticalDrag")}},o.prototype._setScrollTop=function(t){return this.props.scrollTop=t,this._updateScrollTop(),this.props.scrollTop},o.prototype._updateScrollTop=function(){var t=Math.min(this.props.centerContainer.height-this.props.center.height,0);return t!=this.props.scrollTopMin&&("top"!=this.options.orientation.item&&(this.props.scrollTop+=t-this.props.scrollTopMin),this.props.scrollTopMin=t),this.props.scrollTop>0&&(this.props.scrollTop=0),this.props.scrollTop<t&&(this.props.scrollTop=t),this.props.scrollTop},o.prototype._getScrollTop=function(){return this.props.scrollTop},o.prototype._createConfigurator=function(){throw new Error("Cannot invoke abstract method _createConfigurator")},t.exports=o},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={rtl:!1,type:null,orientation:{item:"bottom"},align:"auto",stack:!0,groupOrderSwap:function(t,e,i){var o=e.order;e.order=t.order,t.order=o},groupOrder:"order",selectable:!0,multiselect:!1,itemsAlwaysDraggable:!1,editable:{updateTime:!1,updateGroup:!1,add:!1,remove:!1},groupEditable:{order:!1,add:!1,remove:!1},snap:d.snap,onAdd:function(t,e){e(t)},onUpdate:function(t,e){e(t)},onMove:function(t,e){e(t)},onRemove:function(t,e){e(t)},onMoving:function(t,e){e(t)},onAddGroup:function(t,e){e(t)},onMoveGroup:function(t,e){e(t)},onRemoveGroup:function(t,e){e(t)},margin:{item:{horizontal:10,vertical:10},axis:20}},this.options=r.extend({},this.defaultOptions),this.itemOptions={type:{start:"Date",end:"Date"}},this.conversion={toScreen:t.util.toScreen,toTime:t.util.toTime},this.dom={},this.props={},this.hammer=null;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.groups={},this.groupIds=[],this.selection=[],this.stackDirty=!0,this.touchParams={},this.groupTouchParams={},this._create(),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(14),r=i(1),a=i(8),h=i(10),d=i(25),l=i(21),u=i(26),c=i(30),p=i(31),m=i(32),f=i(28),g=i(33),v="__ungrouped__",y="__background__";o.prototype=new l,o.types={background:g,box:p,range:f,point:m},o.prototype._create=function(){var t=document.createElement("div");t.className="vis-itemset",t["timeline-itemset"]=this,this.dom.frame=t;var e=document.createElement("div");e.className="vis-background",t.appendChild(e),this.dom.background=e;var i=document.createElement("div");i.className="vis-foreground",t.appendChild(i),this.dom.foreground=i;var o=document.createElement("div");o.className="vis-axis",this.dom.axis=o;var n=document.createElement("div");n.className="vis-labelset",this.dom.labelSet=n,this._updateUngrouped();var r=new c(y,null,this);r.show(),this.groups[y]=r,this.hammer=new s(this.body.dom.centerContainer),this.hammer.on("hammer.input",function(t){t.isFirst&&this._onTouch(t)}.bind(this)),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_HORIZONTAL}),this.hammer.on("tap",this._onSelectItem.bind(this)),this.hammer.on("press",this._onMultiSelectItem.bind(this)),this.hammer.on("doubletap",this._onAddItem.bind(this)),this.groupHammer=new s(this.body.dom.leftContainer),this.groupHammer.on("panstart",this._onGroupDragStart.bind(this)),this.groupHammer.on("panmove",this._onGroupDrag.bind(this)),this.groupHammer.on("panend",this._onGroupDragEnd.bind(this)),this.groupHammer.get("pan").set({threshold:5,direction:s.DIRECTION_HORIZONTAL}),this.show()},o.prototype.setOptions=function(t){if(t){var e=["type","rtl","align","order","stack","selectable","multiselect","itemsAlwaysDraggable","multiselectPerGroup","groupOrder","dataAttributes","template","groupTemplate","hide","snap","groupOrderSwap"];r.selectiveExtend(e,this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.item="top"===t.orientation?"top":"bottom":"object"===n(t.orientation)&&"item"in t.orientation&&(this.options.orientation.item=t.orientation.item)),"margin"in t&&("number"==typeof t.margin?(this.options.margin.axis=t.margin,this.options.margin.item.horizontal=t.margin,this.options.margin.item.vertical=t.margin):"object"===n(t.margin)&&(r.selectiveExtend(["axis"],this.options.margin,t.margin),"item"in t.margin&&("number"==typeof t.margin.item?(this.options.margin.item.horizontal=t.margin.item,this.options.margin.item.vertical=t.margin.item):"object"===n(t.margin.item)&&r.selectiveExtend(["horizontal","vertical"],this.options.margin.item,t.margin.item)))),"editable"in t&&("boolean"==typeof t.editable?(this.options.editable.updateTime=t.editable,this.options.editable.updateGroup=t.editable,this.options.editable.add=t.editable,this.options.editable.remove=t.editable):"object"===n(t.editable)&&r.selectiveExtend(["updateTime","updateGroup","add","remove"],this.options.editable,t.editable)),"groupEditable"in t&&("boolean"==typeof t.groupEditable?(this.options.groupEditable.order=t.groupEditable,this.options.groupEditable.add=t.groupEditable,this.options.groupEditable.remove=t.groupEditable):"object"===n(t.groupEditable)&&r.selectiveExtend(["order","add","remove"],this.options.groupEditable,t.groupEditable));var i=function(e){var i=t[e];if(i){if(!(i instanceof Function))throw new Error("option "+e+" must be a function "+e+"(item, callback)");this.options[e]=i}}.bind(this);["onAdd","onUpdate","onRemove","onMove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup"].forEach(i),this.markDirty()}},o.prototype.markDirty=function(t){this.groupIds=[],this.stackDirty=!0,t&&t.refreshItems&&r.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()})},o.prototype.destroy=function(){this.hide(),this.setItems(null),this.setGroups(null),this.hammer=null,this.body=null,this.conversion=null},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.axis.parentNode&&this.dom.axis.parentNode.removeChild(this.dom.axis),this.dom.labelSet.parentNode&&this.dom.labelSet.parentNode.removeChild(this.dom.labelSet)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame),this.dom.axis.parentNode||this.body.dom.backgroundVertical.appendChild(this.dom.axis),this.dom.labelSet.parentNode||this.body.dom.left.appendChild(this.dom.labelSet)},o.prototype.setSelection=function(t){var e,i,o,n;for(void 0==t&&(t=[]),Array.isArray(t)||(t=[t]),e=0,i=this.selection.length;i>e;e++)o=this.selection[e],n=this.items[o],n&&n.unselect();for(this.selection=[],e=0,i=t.length;i>e;e++)o=t[e],n=this.items[o],n&&(this.selection.push(o),n.select())},o.prototype.getSelection=function(){return this.selection.concat([])},o.prototype.getVisibleItems=function(){var t=this.body.range.getRange();if(this.options.rtl)var e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end);else var i=this.body.util.toScreen(t.start),e=this.body.util.toScreen(t.end);var o=[];for(var n in this.groups)if(this.groups.hasOwnProperty(n))for(var s=this.groups[n],r=s.visibleItems,a=0;a<r.length;a++){var h=r[a];this.options.rtl?h.right<i&&h.right+h.width>e&&o.push(h.id):h.left<e&&h.left+h.width>i&&o.push(h.id)}return o},o.prototype._deselect=function(t){
+for(var e=this.selection,i=0,o=e.length;o>i;i++)if(e[i]==t){e.splice(i,1);break}},o.prototype.redraw=function(){var t=this.options.margin,e=this.body.range,i=r.option.asSize,o=this.options,n=o.orientation.item,s=!1,a=this.dom.frame;this.props.top=this.body.domProps.top.height+this.body.domProps.border.top,this.options.rtl?this.props.right=this.body.domProps.right.width+this.body.domProps.border.right:this.props.left=this.body.domProps.left.width+this.body.domProps.border.left,a.className="vis-itemset",s=this._orderGroups()||s;var h=e.end-e.start,d=h!=this.lastVisibleInterval||this.props.width!=this.props.lastWidth;d&&(this.stackDirty=!0),this.lastVisibleInterval=h,this.props.lastWidth=this.props.width;var l=this.stackDirty,u=this._firstGroup(),c={item:t.item,axis:t.axis},p={item:t.item,axis:t.item.vertical/2},m=0,f=t.axis+t.item.vertical;return this.groups[y].redraw(e,p,l),r.forEach(this.groups,function(t){var i=t==u?c:p,o=t.redraw(e,i,l);s=o||s,m+=t.height}),m=Math.max(m,f),this.stackDirty=!1,a.style.height=i(m),this.props.width=a.offsetWidth,this.props.height=m,this.dom.axis.style.top=i("top"==n?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.options.rtl?this.dom.axis.style.right="0":this.dom.axis.style.left="0",s=this._isResized()||s},o.prototype._firstGroup=function(){var t="top"==this.options.orientation.item?0:this.groupIds.length-1,e=this.groupIds[t],i=this.groups[e]||this.groups[v];return i||null},o.prototype._updateUngrouped=function(){var t,e,i=this.groups[v];this.groups[y];if(this.groupsData){if(i){i.hide(),delete this.groups[v];for(e in this.items)if(this.items.hasOwnProperty(e)){t=this.items[e],t.parent&&t.parent.remove(t);var o=this._getGroupId(t.data),n=this.groups[o];n&&n.add(t)||t.hide()}}}else if(!i){var s=null,r=null;i=new u(s,r,this),this.groups[v]=i;for(e in this.items)this.items.hasOwnProperty(e)&&(t=this.items[e],i.add(t));i.show()}},o.prototype.getLabelSet=function(){return this.dom.labelSet},o.prototype.setItems=function(t){var e,i=this,o=this.itemsData;if(t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=t}else this.itemsData=null;if(o&&(r.forEach(this.itemListeners,function(t,e){o.off(e,t)}),e=o.getIds(),this._onRemove(e)),this.itemsData){var n=this.id;r.forEach(this.itemListeners,function(t,e){i.itemsData.on(e,t,n)}),e=this.itemsData.getIds(),this._onAdd(e),this._updateUngrouped()}this.body.emitter.emit("_change",{queue:!0})},o.prototype.getItems=function(){return this.itemsData},o.prototype.setGroups=function(t){var e,i=this;if(this.groupsData&&(r.forEach(this.groupListeners,function(t,e){i.groupsData.off(e,t)}),e=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(e)),t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var o=this.id;r.forEach(this.groupListeners,function(t,e){i.groupsData.on(e,t,o)}),e=this.groupsData.getIds(),this._onAddGroups(e)}this._updateUngrouped(),this._order(),this.body.emitter.emit("_change",{queue:!0})},o.prototype.getGroups=function(){return this.groupsData},o.prototype.removeItem=function(t){var e=this.itemsData.get(t),i=this.itemsData.getDataSet();e&&this.options.onRemove(e,function(e){e&&i.remove(t)})},o.prototype._getType=function(t){return t.type||this.options.type||(t.end?"range":"box")},o.prototype._getGroupId=function(t){var e=this._getType(t);return"background"==e&&void 0==t.group?y:this.groupsData?t.group:v},o.prototype._onUpdate=function(t){var e=this;t.forEach(function(t){var i,n=e.itemsData.get(t,e.itemOptions),s=e.items[t],r=e._getType(n),a=o.types[r];if(s&&(a&&s instanceof a?e._updateItem(s,n):(i=s.selected,e._removeItem(s),s=null)),!s){if(!a)throw"rangeoverflow"==r?new TypeError('Item type "rangeoverflow" is deprecated. Use css styling instead: .vis-item.vis-range .vis-item-content {overflow: visible;}'):new TypeError('Unknown item type "'+r+'"');s=new a(n,e.conversion,e.options),s.id=t,e._addItem(s),i&&(this.selection.push(t),s.select())}}.bind(this)),this._order(),this.stackDirty=!0,this.body.emitter.emit("_change",{queue:!0})},o.prototype._onAdd=o.prototype._onUpdate,o.prototype._onRemove=function(t){var e=0,i=this;t.forEach(function(t){var o=i.items[t];o&&(e++,i._removeItem(o))}),e&&(this._order(),this.stackDirty=!0,this.body.emitter.emit("_change",{queue:!0}))},o.prototype._order=function(){r.forEach(this.groups,function(t){t.order()})},o.prototype._onUpdateGroups=function(t){this._onAddGroups(t)},o.prototype._onAddGroups=function(t){var e=this;t.forEach(function(t){var i=e.groupsData.get(t),o=e.groups[t];if(o)o.setData(i);else{if(t==v||t==y)throw new Error("Illegal group id. "+t+" is a reserved id.");var n=Object.create(e.options);r.extend(n,{height:null}),o=new u(t,i,e),e.groups[t]=o;for(var s in e.items)if(e.items.hasOwnProperty(s)){var a=e.items[s];a.data.group==t&&o.add(a)}o.order(),o.show()}}),this.body.emitter.emit("_change",{queue:!0})},o.prototype._onRemoveGroups=function(t){var e=this.groups;t.forEach(function(t){var i=e[t];i&&(i.hide(),delete e[t])}),this.markDirty(),this.body.emitter.emit("_change",{queue:!0})},o.prototype._orderGroups=function(){if(this.groupsData){var t=this.groupsData.getIds({order:this.options.groupOrder}),e=!r.equalArray(t,this.groupIds);if(e){var i=this.groups;t.forEach(function(t){i[t].hide()}),t.forEach(function(t){i[t].show()}),this.groupIds=t}return e}return!1},o.prototype._addItem=function(t){this.items[t.id]=t;var e=this._getGroupId(t.data),i=this.groups[e];i&&i.add(t)},o.prototype._updateItem=function(t,e){var i=t.data.group,o=t.data.subgroup;if(t.setData(e),i!=t.data.group||o!=t.data.subgroup){var n=this.groups[i];n&&n.remove(t);var s=this._getGroupId(t.data),r=this.groups[s];r&&r.add(t)}},o.prototype._removeItem=function(t){t.hide(),delete this.items[t.id];var e=this.selection.indexOf(t.id);-1!=e&&this.selection.splice(e,1),t.parent&&t.parent.remove(t)},o.prototype._constructByEndArray=function(t){for(var e=[],i=0;i<t.length;i++)t[i]instanceof f&&e.push(t[i]);return e},o.prototype._onTouch=function(t){this.touchParams.item=this.itemFromTarget(t),this.touchParams.dragLeftItem=t.target.dragLeftItem||!1,this.touchParams.dragRightItem=t.target.dragRightItem||!1,this.touchParams.itemProps=null},o.prototype._getGroupIndex=function(t){for(var e=0;e<this.groupIds.length;e++)if(t==this.groupIds[e])return e},o.prototype._onDragStart=function(t){var e,i=this.touchParams.item||null,o=this;if(i&&(i.selected||this.options.itemsAlwaysDraggable)){if(!this.options.editable.updateTime&&!this.options.editable.updateGroup&&!i.editable)return;if(i.editable===!1)return;var n=this.touchParams.dragLeftItem,s=this.touchParams.dragRightItem;if(n)e={item:n,initialX:t.center.x,dragLeft:!0,data:this._cloneItemData(i.data)},this.touchParams.itemProps=[e];else if(s)e={item:s,initialX:t.center.x,dragRight:!0,data:this._cloneItemData(i.data)},this.touchParams.itemProps=[e];else{this.touchParams.selectedItem=i;var r=this._getGroupIndex(i.data.group),a=this.options.itemsAlwaysDraggable&&!i.selected?[i.id]:this.getSelection();this.touchParams.itemProps=a.map(function(e){var i=o.items[e],n=o._getGroupIndex(i.data.group);return{item:i,initialX:t.center.x,groupOffset:r-n,data:this._cloneItemData(i.data)}}.bind(this))}t.stopPropagation()}else this.options.editable.add&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey)&&this._onDragStartAddItem(t)},o.prototype._onDragStartAddItem=function(t){var e=this.options.snap||null;if(this.options.rtl)var i=r.getAbsoluteRight(this.dom.frame),o=i-t.center.x+10;else var i=r.getAbsoluteLeft(this.dom.frame),o=t.center.x-i-10;var n=this.body.util.toTime(o),s=this.body.util.getScale(),a=this.body.util.getStep(),h=e?e(n,s,a):n,d=h,l={type:"range",start:h,end:d,content:"new item"},u=r.randomUUID();l[this.itemsData._fieldId]=u;var c=this.groupFromTarget(t);c&&(l.group=c.groupId);var p=new f(l,this.conversion,this.options);p.id=u,p.data=this._cloneItemData(l),this._addItem(p);var m={item:p,initialX:t.center.x,data:p.data};this.options.rtl?m.dragLeft=!0:m.dragRight=!0,this.touchParams.itemProps=[m],t.stopPropagation()},o.prototype._onDrag=function(t){if(this.touchParams.itemProps){t.stopPropagation();var e=this,i=this.options.snap||null;if(this.options.rtl)var o=this.body.dom.root.offsetLeft+this.body.domProps.right.width;else var o=this.body.dom.root.offsetLeft+this.body.domProps.left.width;var n=this.body.util.getScale(),s=this.body.util.getStep(),a=this.touchParams.selectedItem,h=e.options.editable.updateGroup,d=null;if(h&&a&&void 0!=a.data.group){var l=e.groupFromTarget(t);l&&(d=this._getGroupIndex(l.groupId))}this.touchParams.itemProps.forEach(function(a){var h=e.body.util.toTime(t.center.x-o),l=e.body.util.toTime(a.initialX-o);if(this.options.rtl)var u=-(h-l);else var u=h-l;var c=this._cloneItemData(a.item.data);if(a.item.editable!==!1){var p=e.options.editable.updateTime||a.item.editable===!0;if(p)if(a.dragLeft){if(this.options.rtl){if(void 0!=c.end){var m=r.convert(a.data.end,"Date"),f=new Date(m.valueOf()+u);c.end=i?i(f,n,s):f}}else if(void 0!=c.start){var g=r.convert(a.data.start,"Date"),v=new Date(g.valueOf()+u);c.start=i?i(v,n,s):v}}else if(a.dragRight){if(this.options.rtl){if(void 0!=c.start){var g=r.convert(a.data.start,"Date"),v=new Date(g.valueOf()+u);c.start=i?i(v,n,s):v}}else if(void 0!=c.end){var m=r.convert(a.data.end,"Date"),f=new Date(m.valueOf()+u);c.end=i?i(f,n,s):f}}else if(void 0!=c.start){var g=r.convert(a.data.start,"Date").valueOf(),v=new Date(g+u);if(void 0!=c.end){var m=r.convert(a.data.end,"Date"),y=m.valueOf()-g.valueOf();c.start=i?i(v,n,s):v,c.end=new Date(c.start.valueOf()+y)}else c.start=i?i(v,n,s):v}var b=e.options.editable.updateGroup||a.item.editable===!0;if(b&&!a.dragLeft&&!a.dragRight&&null!=d&&void 0!=c.group){var _=d-a.groupOffset;_=Math.max(0,_),_=Math.min(e.groupIds.length-1,_),c.group=e.groupIds[_]}c=this._cloneItemData(c),e.options.onMoving(c,function(t){t&&a.item.setData(this._cloneItemData(t,"Date"))}.bind(this))}}.bind(this)),this.stackDirty=!0,this.body.emitter.emit("_change")}},o.prototype._moveToGroup=function(t,e){var i=this.groups[e];if(i&&i.groupId!=t.data.group){var o=t.parent;o.remove(t),o.order(),i.add(t),i.order(),t.data.group=i.groupId}},o.prototype._onDragEnd=function(t){if(this.touchParams.itemProps){t.stopPropagation();var e=this,i=this.itemsData.getDataSet(),o=this.touchParams.itemProps;this.touchParams.itemProps=null,o.forEach(function(t){var o=t.item.id,n=null!=e.itemsData.get(o,e.itemOptions);if(n){var s=this._cloneItemData(t.item.data);e.options.onMove(s,function(n){n?(n[i._fieldId]=o,i.update(n)):(t.item.setData(t.data),e.stackDirty=!0,e.body.emitter.emit("_change"))})}else e.options.onAdd(t.item.data,function(i){e._removeItem(t.item),i&&e.itemsData.getDataSet().add(i),e.stackDirty=!0,e.body.emitter.emit("_change")})}.bind(this))}},o.prototype._onGroupDragStart=function(t){this.options.groupEditable.order&&(this.groupTouchParams.group=this.groupFromTarget(t),this.groupTouchParams.group&&(t.stopPropagation(),this.groupTouchParams.originalOrder=this.groupsData.getIds({order:this.options.groupOrder})))},o.prototype._onGroupDrag=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this.groupFromTarget(t);if(e&&e.height!=this.groupTouchParams.group.height){var i=e.top<this.groupTouchParams.group.top,o=t.center?t.center.y:t.clientY,n=r.getAbsoluteTop(e.dom.foreground),s=this.groupTouchParams.group.height;if(i){if(o>n+s)return}else{var a=e.height;if(n+a-s>o)return}}if(e&&e!=this.groupTouchParams.group){var h=this.groupsData,d=h.get(e.groupId),l=h.get(this.groupTouchParams.group.groupId);l&&d&&(this.options.groupOrderSwap(l,d,this.groupsData),this.groupsData.update(l),this.groupsData.update(d));var u=this.groupsData.getIds({order:this.options.groupOrder});if(!r.equalArray(u,this.groupTouchParams.originalOrder))for(var h=this.groupsData,c=this.groupTouchParams.originalOrder,p=this.groupTouchParams.group.groupId,m=Math.min(c.length,u.length),f=0,g=0,v=0;m>f;){for(;m>f+g&&m>f+v&&u[f+g]==c[f+v];)f++;if(f+g>=m)break;if(u[f+g]!=p)if(c[f+v]!=p){var y=u.indexOf(c[f+v]),b=h.get(u[f+g]),_=h.get(c[f+v]);this.options.groupOrderSwap(b,_,h),h.update(b),h.update(_);var w=u[f+g];u[f+g]=c[f+v],u[y]=w,f++}else v=1;else g=1}}}},o.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=r.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!r.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,a=Math.min(s.length,n.length),h=0;a>h;){for(;a>h&&n[h]==s[h];)h++;if(h>=a)break;var d=n.indexOf(s[h]),l=o.get(n[h]),u=o.get(s[h]);e.options.groupOrderSwap(l,u,o),groupsData.update(l),groupsData.update(u);var c=n[h];n[h]=s[h],n[d]=c,h++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},o.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}},o.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(o){var n=e.itemsData.get(o.id);this.options.onUpdate(n,function(t){t&&e.itemsData.getDataSet().update(t)})}else{if(this.options.rtl)var s=r.getAbsoluteRight(this.dom.frame),a=s-t.center.x;else var s=r.getAbsoluteLeft(this.dom.frame),a=t.center.x-s;var h=this.body.util.toTime(a),d=this.body.util.getScale(),l=this.body.util.getStep(),u={start:i?i(h,d,l):h,content:"new item"};if("range"===this.options.type){var c=this.body.util.toTime(a+this.props.width/5);u.end=i?i(c,d,l):c}u[this.itemsData._fieldId]=r.randomUUID();var p=this.groupFromTarget(t);p&&(u.group=p.groupId),u=this._cloneItemData(u),this.options.onAdd(u,function(t){t&&e.itemsData.getDataSet().add(t)})}}},o.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],n=t.srcEvent&&t.srcEvent.shiftKey||!1;if(n&&this.options.multiselect){var s=this.itemsData.get(e.id).group,r=void 0;this.options.multiselectPerGroup&&i.length>0&&(r=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&void 0!=r&&r!=s||i.push(e.id);var a=o._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,u=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&u<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof g||i.push(d.id)}}}else{var c=i.indexOf(e.id);-1==c?i.push(e.id):i.splice(c,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}},o._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.start<i)&&(i=t.start),void 0!=t.end?(null==e||t.end>e)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},o.prototype.itemFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},o.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;i<this.groupIds.length;i++){var o=this.groupIds[i],n=this.groups[o],s=n.dom.foreground,a=r.getAbsoluteTop(s);if(e>a&&e<a+s.offsetHeight)return n;if("top"===this.options.orientation.item){if(i===this.groupIds.length-1&&e>a)return n}else if(0===i&&e<a+s.offset)return n}return null},o.itemSetFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-itemset"))return e["timeline-itemset"];e=e.parentNode}return null},o.prototype._cloneItemData=function(t,e){var i=r.extend({},t);return e||(e=this.itemsData.getDataSet()._options.type),void 0!=i.start&&(i.start=r.convert(i.start,e&&e.start||"Date")),void 0!=i.end&&(i.end=r.convert(i.end,e&&e.end||"Date")),i},t.exports=o},function(t,e,i){function o(t,e,i,s){this.moment=n,this.current=this.moment(),this._start=this.moment(),this._end=this.moment(),this.autoScale=!0,this.scale="day",this.step=1,this.setRange(t,e,i),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,Array.isArray(s)?this.hiddenDates=s:void 0!=s?this.hiddenDates=[s]:this.hiddenDates=[],this.format=o.FORMAT}var n=i(2),s=i(22),r=i(1);o.FORMAT={minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},o.prototype.setMoment=function(t){this.moment=t,this.current=this.moment(this.current),this._start=this.moment(this._start),this._end=this.moment(this._end)},o.prototype.setFormat=function(t){var e=r.deepExtend({},o.FORMAT);this.format=r.deepExtend(e,t)},o.prototype.setRange=function(t,e,i){if(!(t instanceof Date&&e instanceof Date))throw"No legal start or end date in method setRange";this._start=void 0!=t?this.moment(t.valueOf()):new Date,this._end=void 0!=e?this.moment(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i)},o.prototype.start=function(){this.current=this._start.clone(),this.roundToMinor()},o.prototype.roundToMinor=function(){switch(this.scale){case"year":this.current.year(this.step*Math.floor(this.current.year()/this.step)),this.current.month(0);case"month":this.current.date(1);case"day":case"weekday":this.current.hours(0);case"hour":this.current.minutes(0);case"minute":this.current.seconds(0);case"second":this.current.milliseconds(0)}if(1!=this.step)switch(this.scale){case"millisecond":this.current.subtract(this.current.milliseconds()%this.step,"milliseconds");break;case"second":this.current.subtract(this.current.seconds()%this.step,"seconds");break;case"minute":this.current.subtract(this.current.minutes()%this.step,"minutes");break;case"hour":this.current.subtract(this.current.hours()%this.step,"hours");break;case"weekday":case"day":this.current.subtract((this.current.date()-1)%this.step,"day");break;case"month":this.current.subtract(this.current.month()%this.step,"month");break;case"year":this.current.subtract(this.current.year()%this.step,"year")}},o.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},o.prototype.next=function(){var t=this.current.valueOf();if(this.current.month()<6)switch(this.scale){case"millisecond":this.current.add(this.step,"millisecond");break;case"second":this.current.add(this.step,"second");break;case"minute":this.current.add(this.step,"minute");break;case"hour":this.current.add(this.step,"hour"),this.current.subtract(this.current.hours()%this.step,"hour");break;case"weekday":case"day":this.current.add(this.step,"day");break;case"month":this.current.add(this.step,"month");break;case"year":this.current.add(this.step,"year")}else switch(this.scale){case"millisecond":this.current.add(this.step,"millisecond");break;case"second":this.current.add(this.step,"second");break;case"minute":this.current.add(this.step,"minute");break;case"hour":this.current.add(this.step,"hour");break;case"weekday":case"day":this.current.add(this.step,"day");break;case"month":this.current.add(this.step,"month");break;case"year":this.current.add(this.step,"year")}if(1!=this.step)switch(this.scale){case"millisecond":this.current.milliseconds()<this.step&&this.current.milliseconds(0);break;case"second":this.current.seconds()<this.step&&this.current.seconds(0);break;case"minute":this.current.minutes()<this.step&&this.current.minutes(0);break;case"hour":this.current.hours()<this.step&&this.current.hours(0);break;case"weekday":case"day":this.current.date()<this.step+1&&this.current.date(1);break;case"month":this.current.month()<this.step&&this.current.month(0);break;case"year":}this.current.valueOf()==t&&(this.current=this._end.clone()),s.stepOverHiddenDates(this.moment,this,t)},o.prototype.getCurrent=function(){return this.current},o.prototype.setScale=function(t){t&&"string"==typeof t.scale&&(this.scale=t.scale,this.step=t.step>0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.switchedYear=!1,this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.switchedMonth=!1,this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.switchedDay=!1,this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){void 0==t&&(t=this.current);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){void 0==t&&(t=this.current);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return t(a.milliseconds()).trim();case"second":return t(a.seconds()).trim();case"minute":return t(a.minutes()).trim();case"hour":var d=a.hours();return 4==this.step&&(d=d+"-h"+(d+4)),"vis-h"+d+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":var l=a.date(),u=a.format("MMMM").toLowerCase();return"vis-day"+l+" vis-"+u+o(a)+t(l-1);case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var c=a.year();return"vis-year"+c+n(a)+t(c);default:return""}},t.exports=o},function(t,e,i){function o(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var n=i(1),s=i(27);i(28);o.prototype._create=function(){var t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.innerHTML="?",this.dom.background.appendChild(this.dom.marker)},o.prototype.setData=function(t){var e;if(e=this.itemSet.options&&this.itemSet.options.groupTemplate?this.itemSet.options.groupTemplate(t):t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?n.removeClassName(this.dom.inner,"vis-hidden"):n.addClassName(this.dom.inner,"vis-hidden");var i=t&&t.className||null;i!=this.className&&(this.className&&(n.removeClassName(this.dom.label,this.className),n.removeClassName(this.dom.foreground,this.className),n.removeClassName(this.dom.background,this.className),n.removeClassName(this.dom.axis,this.className)),n.addClassName(this.dom.label,i),n.addClassName(this.dom.foreground,i),n.addClassName(this.dom.background,i),n.addClassName(this.dom.axis,i),this.className=i),this.style&&(n.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(n.addCssText(this.dom.label,t.style),this.style=t.style)},o.prototype.getLabelWidth=function(){return this.props.label.width},o.prototype.redraw=function(t,e,i){var o=!1,r=this.dom.marker.clientHeight;if(r!=this.lastMarkerHeight&&(this.lastMarkerHeight=r,n.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(),"function"==typeof this.itemSet.options.order){if(i){var a=this,h=!1;n.forEach(this.items,function(t){t.displayed||(t.redraw(),a.visibleItems.push(t)),t.repositionX(h)});var d=this.orderedItems.byStart.slice().sort(function(t,e){return a.itemSet.options.order(t.data,e.data)});s.stack(d,e,!0)}this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?s.stack(this.visibleItems,e,i):s.nostack(this.visibleItems,e,this.subgroups);var l=this._calculateHeight(e),u=this.dom.foreground;this.top=u.offsetTop,this.right=u.offsetLeft,this.width=u.offsetWidth,o=n.updateProperty(this,"height",l)||o,o=n.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=n.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=l+"px",this.dom.foreground.style.height=l+"px",this.dom.label.style.height=l+"px";for(var c=0,p=this.visibleItems.length;p>c;c++){var m=this.visibleItems[c];m.repositionY(e)}return o},o.prototype._calculateSubGroupHeights=function(){if(Object.keys(this.subgroups).length>0){var t=this;this.resetSubgroups(),n.forEach(this.visibleItems,function(e){void 0!==e.data.subgroup&&(t.subgroups[e.data.subgroup].height=Math.max(t.subgroups[e.data.subgroup].height,e.height),t.subgroups[e.data.subgroup].visible=!0)})}},o.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,s=i[0].top+i[0].height;if(n.forEach(i,function(t){o=Math.min(o,t.top),s=Math.max(s,t.top+t.height)}),o>t.axis){var r=o-t.axis;s-=r,n.forEach(i,function(t){t.top-=r})}e=s+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),-1==this.visibleItems.indexOf(t)){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;i<t.length;i++)this.subgroups[t[i].subgroup].index=i}},o.prototype.resetSubgroups=function(){for(var t in this.subgroups)this.subgroups.hasOwnProperty(t)&&(this.subgroups[t].visible=!1)},o.prototype.remove=function(t){delete this.items[t.id],t.setParent(null);var e=this.visibleItems.indexOf(t);if(-1!=e&&this.visibleItems.splice(e,1),
+void 0!==t.data.subgroup){var i=this.subgroups[t.data.subgroup];if(i){var o=i.items.indexOf(t);i.items.splice(o,1),i.items.length||(delete this.subgroups[t.data.subgroup],this.subgroupIndex--),this.orderSubgroups()}}},o.prototype.removeFromDataSet=function(t){this.itemSet.removeItem(t.id)},o.prototype.order=function(){for(var t=n.toArray(this.items),e=[],i=[],o=0;o<t.length;o++)void 0!==t[o].data.end&&i.push(t[o]),e.push(t[o]);this.orderedItems={byStart:e,byEnd:i},s.orderByStart(this.orderedItems.byStart),s.orderByEnd(this.orderedItems.byEnd)},o.prototype._updateVisibleItems=function(t,e,i){var o,s,r=[],a={},h=(i.end-i.start)/4,d=i.start-h,l=i.end+h,u=function(t){return d>t?-1:l>=t?0:1};if(e.length>0)for(s=0;s<e.length;s++)this._checkIfVisibleWithReference(e[s],r,a,i);var c=n.binarySearchCustom(t.byStart,u,"data","start");if(this._traceVisible(c,t.byStart,r,a,function(t){return t.data.start<d||t.data.start>l}),1==this.checkRangedItems)for(this.checkRangedItems=!1,s=0;s<t.byEnd.length;s++)this._checkIfVisibleWithReference(t.byEnd[s],r,a,i);else{var p=n.binarySearchCustom(t.byEnd,u,"data","end");this._traceVisible(p,t.byEnd,r,a,function(t){return t.data.end<d||t.data.end>l})}for(s=0;s<r.length;s++)o=r[s],o.displayed||o.show(),o.repositionX();return r},o.prototype._traceVisible=function(t,e,i,o,n){var s,r;if(-1!=t){for(r=t;r>=0&&(s=e[r],!n(s));r--)void 0===o[s.id]&&(o[s.id]=!0,i.push(s));for(r=t+1;r<e.length&&(s=e[r],!n(s));r++)void 0===o[s.id]&&(o[s.id]=!0,i.push(s))}},o.prototype._checkIfVisible=function(t,e,i){t.isVisible(i)?(t.displayed||t.show(),t.repositionX(),e.push(t)):t.displayed&&t.hide()},o.prototype._checkIfVisibleWithReference=function(t,e,i,o){t.isVisible(o)?void 0===i[t.id]&&(i[t.id]=!0,e.push(t)):t.displayed&&t.hide()},t.exports=o},function(t,e){var i=.001;e.orderByStart=function(t){t.sort(function(t,e){return t.data.start-e.data.start})},e.orderByEnd=function(t){t.sort(function(t,e){var i="end"in t.data?t.data.end:t.data.start,o="end"in e.data?e.data.end:e.data.start;return i-o})},e.stack=function(t,i,o){var n,s;if(o)for(n=0,s=t.length;s>n;n++)t[n].top=null;for(n=0,s=t.length;s>n;n++){var r=t[n];if(r.stack&&null===r.top){r.top=i.axis;do{for(var a=null,h=0,d=t.length;d>h;h++){var l=t[h];if(null!==l.top&&l!==r&&l.stack&&e.collision(r,l,i.item,l.options.rtl)){a=l;break}}null!=a&&(r.top=a.top+a.height+i.item.vertical)}while(a)}}},e.nostack=function(t,e,i){var o,n,s;for(o=0,n=t.length;n>o;o++)if(void 0!==t[o].data.subgroup){s=e.axis;for(var r in i)i.hasOwnProperty(r)&&1==i[r].visible&&i[r].index<i[t[o].data.subgroup].index&&(s+=i[r].height+e.item.vertical);t[o].top=s}else t[o].top=e.axis},e.collision=function(t,e,o,n){return n?t.right-o.horizontal+i<e.right+e.width&&t.right+t.width+o.horizontal-i>e.right&&t.top-o.vertical+i<e.top+e.height&&t.top+t.height+o.vertical-i>e.top:t.left-o.horizontal+i<e.left+e.width&&t.left+t.width+o.horizontal-i>e.left&&t.top-o.vertical+i<e.top+e.height&&t.top+t.height+o.vertical-i>e.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(14),i(29));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.start<t.end&&this.data.end>t.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintDeleteButton(t.box),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==t&&t!==!0||(-o>n&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:0>n?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":this.dom.content.style.left=e+"px"}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&"boolean"==typeof this.data.editable&&(this.editable=t.editable)}var n=i(14),s=i(1);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&"boolean"==typeof t.editable&&(this.editable=t.editable),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},o.prototype.isVisible=function(t){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.remove||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new n(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._updateContents=function(t){var e;if(this.options.template){var i=this.parent.itemSet.itemsData.get(this.id);e=this.options.template(i)}else e=this.data.content;var o=this._contentToString(this.content)!==this._contentToString(e);if(o){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}},o.prototype._updateTitle=function(t){null!=this.data.title?t.title=this.data.title||"":t.removeAttribute("vis-title")},o.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(var i=0;i<e.length;i++){var o=e[i],n=this.data[o];null!=n?t.setAttribute("data-"+o,n):t.removeAttribute("data-"+o)}}},o.prototype._updateStyle=function(t){this.style&&(s.removeCssText(t,this.style),this.style=null),this.data.style&&(s.addCssText(t,this.data.style),this.style=this.data.style)},o.prototype._contentToString=function(t){return"string"==typeof t?t:t&&"outerHTML"in t?t.outerHTML:t},o.prototype.getWidthLeft=function(){return 0},o.prototype.getWidthRight=function(){return 0},t.exports=o},function(t,e,i){function o(t,e,i){n.call(this,t,e,i),this.width=0,this.height=0,this.top=0,this.left=0}var n=(i(1),i(26));o.prototype=Object.create(n.prototype),o.prototype.redraw=function(t,e,i){var o=!1;this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.width=this.dom.background.offsetWidth,this.dom.background.style.height="0";for(var n=0,s=this.visibleItems.length;s>n;n++){var r=this.visibleItems[n];r.repositionY(e)}return o},o.prototype.show=function(){this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background)},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={dot:{width:0,height:0},line:{width:0,height:0}},this.options=i,t&&void 0==t.start)throw new Error('Property "start" missing in item '+t);n.call(this,t,e,i)}var n=i(29);i(1);o.prototype=new n(null,null,null),o.prototype.isVisible=function(t){var e=(t.end-t.start)/4;return this.data.start>t.start-e&&this.data.start<t.end+e},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="vis-item-content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="vis-line",t.dot=document.createElement("DIV"),t.dot.className="vis-dot",t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(!t.line.parentNode){var i=this.parent.dom.background;if(!i)throw new Error("Cannot redraw item: parent has no background container element");i.appendChild(t.line)}if(!t.dot.parentNode){var o=this.parent.dom.axis;if(!i)throw new Error("Cannot redraw item: parent has no axis container element");o.appendChild(t.dot)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var n=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,s=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(n?" vis-editable":" vis-readonly");t.box.className="vis-item vis-box"+s,t.line.className="vis-item vis-line"+s,t.dot.className="vis-item vis-dot"+s,this.props.dot.height=t.dot.offsetHeight,this.props.dot.width=t.dot.offsetWidth,this.props.line.width=t.line.offsetWidth,this.width=t.box.offsetWidth,this.height=t.box.offsetHeight,this.dirty=!1}this._repaintDeleteButton(t.box)},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom;t.box.parentNode&&t.box.parentNode.removeChild(t.box),t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot),this.displayed=!1}},o.prototype.repositionX=function(){var t=this.conversion.toScreen(this.data.start),e=this.options.align;"right"==e?this.options.rtl?(this.right=t-this.width,this.dom.box.style.right=this.right+"px",this.dom.line.style.right=t-this.props.line.width+"px",this.dom.dot.style.right=t-this.props.line.width/2-this.props.dot.width/2+"px"):(this.left=t-this.width,this.dom.box.style.left=this.left+"px",this.dom.line.style.left=t-this.props.line.width+"px",this.dom.dot.style.left=t-this.props.line.width/2-this.props.dot.width/2+"px"):"left"==e?this.options.rtl?(this.right=t,this.dom.box.style.right=this.right+"px",this.dom.line.style.right=t+"px",this.dom.dot.style.right=t+this.props.line.width/2-this.props.dot.width/2+"px"):(this.left=t,this.dom.box.style.left=this.left+"px",this.dom.line.style.left=t+"px",this.dom.dot.style.left=t+this.props.line.width/2-this.props.dot.width/2+"px"):this.options.rtl?(this.right=t-this.width/2,this.dom.box.style.right=this.right+"px",this.dom.line.style.right=t-this.props.line.width+"px",this.dom.dot.style.right=t-this.props.dot.width/2+"px"):(this.left=t-this.width/2,this.dom.box.style.left=this.left+"px",this.dom.line.style.left=t-this.props.line.width/2+"px",this.dom.dot.style.left=t-this.props.dot.width/2+"px")},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box,i=this.dom.line,o=this.dom.dot;if("top"==t)e.style.top=(this.top||0)+"px",i.style.top="0",i.style.height=this.parent.top+this.top+1+"px",i.style.bottom="";else{var n=this.parent.itemSet.props.height,s=n-this.parent.top-this.parent.height+this.top;e.style.top=(this.parent.height-this.top-this.height||0)+"px",i.style.top=n-s+"px",i.style.bottom="0"}o.style.top=-this.props.dot.height/2+"px"},o.prototype.getWidthLeft=function(){return this.width/2},o.prototype.getWidthRight=function(){return this.width/2},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0,marginRight:0}},this.options=i,t&&void 0==t.start)throw new Error('Property "start" missing in item '+t);n.call(this,t,e,i)}var n=i(29);o.prototype=new n(null,null,null),o.prototype.isVisible=function(t){var e=(t.end-t.start)/4;return this.data.start>t.start-e&&this.data.start<t.end+e},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="vis-item-content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.point.appendChild(t.dot),t.point["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.point.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.point)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.point),this._updateDataAttributes(this.dom.point),this._updateStyle(this.dom.point);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.point.className="vis-item vis-point"+o,t.dot.className="vis-item vis-dot"+o,this.props.dot.width=t.dot.offsetWidth,this.props.dot.height=t.dot.offsetHeight,this.props.content.height=t.content.offsetHeight,this.options.rtl?t.content.style.marginRight=2*this.props.dot.width+"px":t.content.style.marginLeft=2*this.props.dot.width+"px",this.width=t.point.offsetWidth,this.height=t.point.offsetHeight,t.dot.style.top=(this.height-this.props.dot.height)/2+"px",this.options.rtl?t.dot.style.right=this.props.dot.width/2+"px":t.dot.style.left=this.props.dot.width/2+"px",this.dirty=!1}this._repaintDeleteButton(t.point)},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){this.displayed&&(this.dom.point.parentNode&&this.dom.point.parentNode.removeChild(this.dom.point),this.displayed=!1)},o.prototype.repositionX=function(){var t=this.conversion.toScreen(this.data.start);this.options.rtl?(this.right=t-this.props.dot.width,this.dom.point.style.right=this.right+"px"):(this.left=t-this.props.dot.width,this.dom.point.style.left=this.left+"px")},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.point;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype.getWidthLeft=function(){return this.props.dot.width},o.prototype.getWidthRight=function(){return this.props.dot.width},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(14),i(29)),s=i(30),r=i(28);o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-background",o.prototype.stack=!1,o.prototype.isVisible=function(t){return this.data.start<t.end&&this.data.end>t.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e="top"===this.options.orientation.item;this.dom.content.style.top=e?"":"0",this.dom.content.style.bottom=e?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,r=n[o].index;if(1==e){i=this.parent.subgroups[o].height+t.item.vertical,i+=0==r?t.axis-.5*t.item.vertical:0;var a=this.parent.top;for(var h in n)n.hasOwnProperty(h)&&1==n[h].visible&&n[h].index<r&&(a+=n[h].height+t.item.vertical);a+=0!=r?t.axis-.5*t.item.vertical:0,this.dom.box.style.top=a+"px",this.dom.box.style.bottom=""}else{var a=this.parent.top,d=0;for(var h in n)if(n.hasOwnProperty(h)&&1==n[h].visible){var l=n[h].height+t.item.vertical;d+=l,n[h].index>r&&(a+=l)}i=this.parent.subgroups[o].height+t.item.vertical,this.dom.box.style.top=this.parent.height-d+a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof s?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=e?"0":"",this.dom.box.style.bottom=e?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},t.exports=o},function(t,e,i){function o(t,e){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:a.FORMAT,moment:d,timeAxis:null},this.options=s.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=i(21),a=i(25),h=i(22),d=i(2);o.prototype=new r,o.prototype.setOptions=function(t){t&&(s.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),s.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"===n(t.orientation)&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof d.locale?d.locale(t.locale):d.lang(t.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=s.convert(this.body.range.start,"Number"),i=s.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-h.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var r=new a(new Date(e),new Date(i),n,this.body.hiddenDates);r.setMoment(this.options.moment),this.options.format&&r.setFormat(this.options.format),this.options.timeAxis&&r.setScale(this.options.timeAxis),this.step=r;var d=this.dom;d.redundant.lines=d.lines,d.redundant.majorTexts=d.majorTexts,d.redundant.minorTexts=d.minorTexts,d.lines=[],d.majorTexts=[],d.minorTexts=[];var u,c,p,m,f,g,v,y,b,_,w=0,x=void 0,D=0,k=1e3;for(r.start(),c=r.getCurrent(),m=this.body.util.toScreen(c);r.hasNext()&&k>D;){D++,f=r.isMajor(),_=r.getClassName(),b=r.getLabelMinor(),u=c,p=m,r.next(),c=r.getCurrent(),g=r.isMajor(),m=this.body.util.toScreen(c),v=w,w=m-p;var S=w>=.4*v;if(this.options.showMinorLabels&&S){var C=this._repaintMinorText(p,b,t,_);C.style.width=w+"px"}f&&this.options.showMajorLabels?(p>0&&(void 0==x&&(x=p),C=this._repaintMajorText(p,r.getLabelMajor(),t,_)),y=this._repaintMajorLine(p,w,t,_)):S?y=this._repaintMinorLine(p,w,t,_):y&&(y.style.width=parseInt(y.style.width)+w+"px")}if(D!==k||l||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+k+" lines."),l=!0),this.options.showMajorLabels){var O=this.body.util.toTime(0),T=r.getLabelMajor(O),M=T.length*(this.props.majorCharWidth||10)+10;(void 0==x||x>M)&&this._repaintMajorText(0,T,t,_)}s.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},o.prototype._repaintMinorText=function(t,e,i,o){var n=this.dom.redundant.minorTexts.shift();if(!n){var s=document.createTextNode("");n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.minorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.top="top"==i?this.props.majorLabelHeight+"px":"0",this.options.rtl?(n.style.left="",n.style.right=t+"px"):n.style.left=t+"px",n.className="vis-text vis-minor "+o,n},o.prototype._repaintMajorText=function(t,e,i,o){var n=this.dom.redundant.majorTexts.shift();if(!n){var s=document.createTextNode(e);n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.majorTexts.push(n),n.childNodes[0].nodeValue=e,n.className="vis-text vis-major "+o,n.style.top="top"==i?"0":this.props.minorLabelHeight+"px",this.options.rtl?(n.style.left="",n.style.right=t+"px"):n.style.left=t+"px",n},o.prototype._repaintMinorLine=function(t,e,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top=s.majorLabelHeight+"px":n.style.top=this.body.domProps.top.height+"px",n.style.height=s.minorLineHeight+"px",this.options.rtl?(n.style.left="",n.style.right=t-s.minorLineWidth/2+"px",n.className="vis-grid vis-vertical-rtl vis-minor "+o):(n.style.left=t-s.minorLineWidth/2+"px",n.className="vis-grid vis-vertical vis-minor "+o),n.style.width=e+"px",n},o.prototype._repaintMajorLine=function(t,e,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top="0":n.style.top=this.body.domProps.top.height+"px",this.options.rtl?(n.style.left="",n.style.right=t-s.majorLineWidth/2+"px",n.className="vis-grid vis-vertical-rtl vis-major "+o):(n.style.left=t-s.majorLineWidth/2+"px",n.className="vis-grid vis-vertical vis-major "+o),n.style.height=s.majorLineHeight+"px",n.style.width=e+"px",n},o.prototype._calculateCharSize=function(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth};var l=!1;t.exports=o},function(t,e,i){function o(t){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=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var e=this,i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];i.forEach(function(t){e.hammer.on(t,function(t){t.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){n(i.target,t)||e.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function n(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}var s=i(36),r=i(19),a=i(14),h=i(1);r(o.prototype),o.current=null,o.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},o.prototype.activate=function(){o.current&&o.current.deactivate(),o.current=this,this.active=!0,this.dom.overlay.style.display="none",h.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},o.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",h.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},o.prototype._onTapOverlay=function(t){this.activate(),t.stopPropagation()},t.exports=o},function(t,e,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(this,function(){function t(t){var e,i=t&&t.preventDefault||!1,o=t&&t.container||window,n={},s={keydown:{},keyup:{}},r={};for(e=97;122>=e;e++)r[String.fromCharCode(e)]={code:65+(e-97),shift:!1};for(e=65;90>=e;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;9>=e;e++)r[""+e]={code:48+e,shift:!1};for(e=1;12>=e;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;9>=e;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){d(t,"keydown")},h=function(t){d(t,"keyup")},d=function(t,e){if(void 0!==s[e][t.keyCode]){for(var o=s[e][t.keyCode],n=0;n<o.length;n++)void 0===o[n].shift?o[n].fn(t):1==o[n].shift&&1==t.shiftKey?o[n].fn(t):0==o[n].shift&&0==t.shiftKey&&o[n].fn(t);1==i&&t.preventDefault()}};return n.bind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===r[t])throw new Error("unsupported key: "+t);void 0===s[i][r[t].code]&&(s[i][r[t].code]=[]),s[i][r[t].code].push({fn:e,shift:r[t].shift})},n.bindAll=function(t,e){void 0===e&&(e="keydown");for(var i in r)r.hasOwnProperty(i)&&n.bind(i,t,e)},n.getKey=function(t){for(var e in r)if(r.hasOwnProperty(e)){if(1==t.shiftKey&&1==r[e].shift&&t.keyCode==r[e].code)return e;
+if(0==t.shiftKey&&0==r[e].shift&&t.keyCode==r[e].code)return e;if(t.keyCode==r[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},n.unbind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===r[t])throw new Error("unsupported key: "+t);if(void 0!==e){var o=[],n=s[i][r[t].code];if(void 0!==n)for(var a=0;a<n.length;a++)n[a].fn==e&&n[a].shift==r[t].shift||o.push(s[i][r[t].code][a]);s[i][r[t].code]=o}else s[i][r[t].code]=[]},n.reset=function(){s={keydown:{},keyup:{}}},n.destroy=function(){s={keydown:{},keyup:{}},o.removeEventListener("keydown",a,!0),o.removeEventListener("keyup",h,!0)},o.addEventListener("keydown",a,!0),o.addEventListener("keyup",h,!0),n}return t})},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={moment:a,locales:h,locale:"en",id:void 0,title:void 0},this.options=s.extend({},this.defaultOptions),e&&e.time?this.customTime=e.time:this.customTime=new Date,this.eventParams={},this.setOptions(e),this._create()}var n=i(14),s=i(1),r=i(21),a=i(2),h=i(38);o.prototype=new r,o.prototype.setOptions=function(t){t&&s.selectiveExtend(["moment","locale","locales","id"],this.options,t)},o.prototype._create=function(){var t=document.createElement("div");t["custom-time"]=this,t.className="vis-custom-time "+(this.options.id||""),t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t;var e=document.createElement("div");e.style.position="relative",e.style.top="0px",e.style.left="-10px",e.style.height="100%",e.style.width="20px",t.appendChild(e),this.hammer=new n(e),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:n.DIRECTION_HORIZONTAL})},o.prototype.destroy=function(){this.hide(),this.hammer.destroy(),this.hammer=null,this.body=null},o.prototype.redraw=function(){var t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar));var e=this.body.util.toScreen(this.customTime),i=this.options.locales[this.options.locale];i||(this.warned||(console.log("WARNING: options.locales['"+this.options.locale+"'] not found. See http://visjs.org/docs/timeline.html#Localization"),this.warned=!0),i=this.options.locales.en);var o=this.options.title;return void 0===o&&(o=i.time+": "+this.options.moment(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss"),o=o.charAt(0).toUpperCase()+o.substring(1)),this.bar.style.left=e+"px",this.bar.title=o,!1},o.prototype.hide=function(){this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar)},o.prototype.setCustomTime=function(t){this.customTime=s.convert(t,"Date"),this.redraw()},o.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())},o.prototype.setCustomTitle=function(t){this.options.title=t},o.prototype._onDragStart=function(t){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,t.stopPropagation()},o.prototype._onDrag=function(t){if(this.eventParams.dragging){var e=this.body.util.toScreen(this.eventParams.customTime)+t.deltaX,i=this.body.util.toTime(e);this.setCustomTime(i),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf())}),t.stopPropagation()}},o.prototype._onDragEnd=function(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf())}),t.stopPropagation())},o.customTimeFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("custom-time"))return e["custom-time"];e=e.parentNode}return null},t.exports=o},function(t,e){e.en={current:"current",time:"time"},e.en_EN=e.en,e.en_US=e.en,e.nl={current:"huidige",time:"tijd"},e.nl_NL=e.nl,e.nl_BE=e.nl},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={rtl:!1,showCurrentTime:!0,moment:r,locales:a,locale:"en"},this.options=n.extend({},this.defaultOptions),this.offset=0,this._create(),this.setOptions(e)}var n=i(1),s=i(21),r=i(2),a=i(38);o.prototype=new s,o.prototype._create=function(){var t=document.createElement("div");t.className="vis-current-time",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t},o.prototype.destroy=function(){this.options.showCurrentTime=!1,this.redraw(),this.body=null},o.prototype.setOptions=function(t){t&&n.selectiveExtend(["rtl","showCurrentTime","moment","locale","locales"],this.options,t)},o.prototype.redraw=function(){if(this.options.showCurrentTime){var t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar),this.start());var e=this.options.moment((new Date).valueOf()+this.offset),i=this.body.util.toScreen(e),o=this.options.locales[this.options.locale];o||(this.warned||(console.log("WARNING: options.locales['"+this.options.locale+"'] not found. See http://visjs.org/docs/timeline/#Localization"),this.warned=!0),o=this.options.locales.en);var n=o.current+" "+o.time+": "+e.format("dddd, MMMM Do YYYY, H:mm:ss");n=n.charAt(0).toUpperCase()+n.substring(1),this.options.rtl?this.bar.style.right=i+"px":this.bar.style.left=i+"px",this.bar.title=n}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1},o.prototype.start=function(){function t(){e.stop();var i=e.body.range.conversion(e.body.domProps.center.width).scale,o=1/i/10;30>o&&(o=30),o>1e3&&(o=1e3),e.redraw(),e.body.emitter.emit("currentTimeTick"),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",u={configure:{enabled:{"boolean":o},filter:{"boolean":o,"function":"function"},container:{dom:h},__type__:{object:a,"boolean":o,"function":"function"}},align:{string:i},rtl:{"boolean":o,undefined:"undefined"},autoResize:{"boolean":o},throttleRedraw:{number:n},clickToUse:{"boolean":o},dataAttributes:{string:i,array:s},editable:{add:{"boolean":o,undefined:"undefined"},remove:{"boolean":o,undefined:"undefined"},updateGroup:{"boolean":o,undefined:"undefined"},updateTime:{"boolean":o,undefined:"undefined"},__type__:{"boolean":o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},__type__:{object:a}},moment:{"function":"function"},groupOrder:{string:i,"function":"function"},groupEditable:{add:{"boolean":o,undefined:"undefined"},remove:{"boolean":o,undefined:"undefined"},order:{"boolean":o,undefined:"undefined"},__type__:{"boolean":o,object:a}},groupOrderSwap:{"function":"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{"boolean":o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{"boolean":o},multiselect:{"boolean":o},multiselectPerGroup:{"boolean":o},onAdd:{"function":"function"},onUpdate:{"function":"function"},onMove:{"function":"function"},onMoving:{"function":"function"},onRemove:{"function":"function"},onAddGroup:{"function":"function"},onMoveGroup:{"function":"function"},onRemoveGroup:{"function":"function"},order:{"function":"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{"boolean":o},showCurrentTime:{"boolean":o},showMajorLabels:{"boolean":o},showMinorLabels:{"boolean":o},stack:{"boolean":o},snap:{"function":"function","null":"null"},start:{date:r,number:n,string:i,moment:d},template:{"function":"function"},groupTemplate:{"function":"function"},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{"boolean":o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},c={global:{align:["center","left","right"],direction:!1,autoResize:!0,throttleRedraw:[10,0,1e3,10],clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,start:"",type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};e.allOptions=u,e.configureOptions=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e,i,o){if(!(Array.isArray(i)||i instanceof u||i instanceof c)&&i instanceof Object){var n=o;o=i,i=n}var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new f(this.body),this.components.push(this.timeAxis),this.currentTime=new g(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){s.emit("click",s.getEventProperties(t))}),this.on("doubletap",function(t){s.emit("doubleClick",s.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(12),r=o(s),a=i(18),h=o(a),d=(i(19),i(14),i(2)),l=i(1),u=i(8),c=i(10),p=i(20),m=i(23),f=i(34),g=i(39),v=i(37),y=i(42),b=i(18).printStyle,_=i(50).allOptions,w=i(50).configureOptions;n.prototype=new m,n.prototype.setOptions=function(t){var e=h["default"].validate(t,_);e===!0&&console.log("%cErrors have been found in the supplied options object.",b),m.prototype.setOptions.call(this,t)},n.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof u||t instanceof c?t:new u(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(t){var e;e=t?t instanceof u||t instanceof c?t:new u(t):null,this.groupsData=e,this.linegraph.setGroups(e)},n.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},n.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]):!1},n.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;o<this.linegraph.groups[i].itemsData.length;o++){var n=this.linegraph.groups[i].itemsData[o],s=l.convert(n.x,"Date").valueOf();t=null==t?s:t>s?s:t,e=null==e?s:s>e?s:e}return{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,o=e-l.getAbsoluteLeft(this.dom.centerContainer),n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this._toTime(o),r=v.customTimeFromTarget(t),a=l.getTarget(t),h=null;l.hasParent(a,this.timeAxis.dom.foreground)?h="axis":this.timeAxis2&&l.hasParent(a,this.timeAxis2.dom.foreground)?h="axis":l.hasParent(a,this.linegraph.yAxisLeft.dom.frame)?h="data-axis":l.hasParent(a,this.linegraph.yAxisRight.dom.frame)?h="data-axis":l.hasParent(a,this.linegraph.legendLeft.dom.frame)?h="legend":l.hasParent(a,this.linegraph.legendRight.dom.frame)?h="legend":null!=r?h="custom-time":l.hasParent(a,this.currentTime.bar)?h="current-time":l.hasParent(a,this.dom.center)&&(h="background");var d=[],u=this.linegraph.yAxisLeft,c=this.linegraph.yAxisRight;return u.hidden||d.push(u.screenToValue(n)),c.hidden||d.push(c.screenToValue(n)),{event:t,what:h,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:s,value:d}},n.prototype._createConfigurator=function(){return new r["default"](this,this.dom.container,w)},t.exports=n},function(t,e,i){function o(t,e){this.id=s.randomUUID(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{},legend:{},groups:{visibility:{}}},this.options=s.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1,this.forceGraphUpdate=!0;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=s.option.asSize(-i.props.width),i.forceGraphUpdate=!0,i.redraw.call(i)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups}}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=i(7),a=i(8),h=i(10),d=i(21),l=i(43),u=i(45),c=i(49),p=i(46),m=i(48),f=i(47),g="__ungrouped__";o.prototype=new d,o.prototype._create=function(){var t=document.createElement("div");t.className="vis-line-graph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new l(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new l(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new c(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new c(this.body,this.options.legend,"right",this.options.groups),this.show()},o.prototype.setOptions=function(t){if(t){var e=["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===t.graphHeight&&void 0!==t.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))<this.body.domProps.centerContainer.height&&(this.updateSVGheight=!0),s.selectiveDeepExtend(e,this.options,t),s.mergeOptions(this.options,t,"interpolation"),s.mergeOptions(this.options,t,"drawPoints"),s.mergeOptions(this.options,t,"shaded"),s.mergeOptions(this.options,t,"legend"),t.interpolation&&"object"==n(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5)),this.yAxisLeft&&void 0!==t.dataAxis&&(this.yAxisLeft.setOptions(this.options.dataAxis),this.yAxisRight.setOptions(this.options.dataAxis)),this.legendLeft&&void 0!==t.legend&&(this.legendLeft.setOptions(this.options.legend),this.legendRight.setOptions(this.options.legend)),this.groups.hasOwnProperty(g)&&this.groups[g].setOptions(t)}this.dom.frame&&(this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0}))},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame)},o.prototype.setItems=function(t){var e,i=this,o=this.itemsData;if(t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=t}else this.itemsData=null;if(o&&(s.forEach(this.itemListeners,function(t,e){o.off(e,t)}),e=o.getIds(),this._onRemove(e)),this.itemsData){var n=this.id;s.forEach(this.itemListeners,function(t,e){i.itemsData.on(e,t,n)}),e=this.itemsData.getIds(),this._onAdd(e)}},o.prototype.setGroups=function(t){var e,i=this;if(this.groupsData){s.forEach(this.groupListeners,function(t,e){i.groupsData.off(e,t)}),e=this.groupsData.getIds(),this.groupsData=null;for(var o=0;o<e.length;o++)this._removeGroup(e[o])}if(t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var n=this.id;s.forEach(this.groupListeners,function(t,e){i.groupsData.on(e,t,n)}),e=this.groupsData.getIds(),this._onAddGroups(e)}},o.prototype._onUpdate=function(t){this._updateAllGroupData()},o.prototype._onAdd=function(t){this._onUpdate(t)},o.prototype._onRemove=function(t){this._onUpdate(t)},o.prototype._onUpdateGroups=function(t){this._updateAllGroupData()},o.prototype._onAddGroups=function(t){this._onUpdateGroups(t)},o.prototype._onRemoveGroups=function(t){for(var e=0;e<t.length;e++)this._removeGroup(t[e]);this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0})},o.prototype._removeGroup=function(t){this.groups.hasOwnProperty(t)&&("right"==this.groups[t].options.yAxisOrientation?(this.yAxisRight.removeGroup(t),this.legendRight.removeGroup(t),this.legendRight.redraw()):(this.yAxisLeft.removeGroup(t),this.legendLeft.removeGroup(t),this.legendLeft.redraw()),delete this.groups[t])},o.prototype._updateGroup=function(t,e){this.groups.hasOwnProperty(e)?(this.groups[e].update(t),"right"==this.groups[e].options.yAxisOrientation?(this.yAxisRight.updateGroup(e,this.groups[e]),this.legendRight.updateGroup(e,this.groups[e]),this.yAxisLeft.removeGroup(e),this.legendLeft.removeGroup(e)):(this.yAxisLeft.updateGroup(e,this.groups[e]),this.legendLeft.updateGroup(e,this.groups[e]),this.yAxisRight.removeGroup(e),this.legendRight.removeGroup(e))):(this.groups[e]=new u(t,e,this.options,this.groupsUsingDefaultStyles),"right"==this.groups[e].options.yAxisOrientation?(this.yAxisRight.addGroup(e,this.groups[e]),this.legendRight.addGroup(e,this.groups[e])):(this.yAxisLeft.addGroup(e,this.groups[e]),this.legendLeft.addGroup(e,this.groups[e]))),this.legendLeft.redraw(),this.legendRight.redraw()},o.prototype._updateAllGroupData=function(){if(null!=this.itemsData){for(var t={},e=this.itemsData.get(),i={},o=0;o<e.length;o++){var n=e[o],r=n.group;null!==r&&void 0!==r||(r=g),i.hasOwnProperty(r)?i[r]++:i[r]=1}for(var o=0;o<e.length;o++){var n=e[o],r=n.group;null!==r&&void 0!==r||(r=g),t.hasOwnProperty(r)||(t[r]=new Array(i[r]));var a=s.bridgeObject(n);a.x=s.convert(n.x,"Date"),a.orginalY=n.y,a.y=Number(n.y);var h=t[r].length-i[r]--;t[r][h]=a}for(var r in this.groups)this.groups.hasOwnProperty(r)&&(t.hasOwnProperty(r)||(t[r]=new Array(0)));for(var r in t)if(t.hasOwnProperty(r))if(0==t[r].length)this.groups.hasOwnProperty(r)&&this._removeGroup(r);else{var d=void 0;void 0!=this.groupsData&&(d=this.groupsData.get(r)),void 0==d&&(d={id:r,content:this.options.defaultGroup+r}),this._updateGroup(d,r),this.groups[r].setItems(t[r])}this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0})}},o.prototype.redraw=function(){var t=!1;this.props.width=this.dom.frame.offsetWidth,this.props.height=this.body.domProps.centerContainer.height-this.body.domProps.border.top-this.body.domProps.border.bottom,t=this._isResized()||t;var e=this.body.range.end-this.body.range.start,i=e!=this.lastVisibleInterval;if(this.lastVisibleInterval=e,1==t&&(this.svg.style.width=s.option.asSize(3*this.props.width),this.svg.style.left=s.option.asSize(-this.props.width),-1==(this.options.height+"").indexOf("%")&&1!=this.updateSVGheightOnResize||(this.updateSVGheight=!0)),1==this.updateSVGheight?(this.options.graphHeight!=this.props.height+"px"&&(this.options.graphHeight=this.props.height+"px",this.svg.style.height=this.props.height+"px"),this.updateSVGheight=!1):this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",1==t||1==i||1==this.abortedGraphUpdate||1==this.forceGraphUpdate)t=this._updateGraph()||t,this.forceGraphUpdate=!1;else if(0!=this.lastStart){var o=this.body.range.start-this.lastStart,n=this.body.range.end-this.body.range.start;if(0!=this.props.width){var r=this.props.width/n,a=o*r;this.svg.style.left=-this.props.width-a+"px"}}return this.legendLeft.redraw(),this.legendRight.redraw(),t},o.prototype._getSortedGroupIds=function(){var t=[];for(var e in this.groups)if(this.groups.hasOwnProperty(e)){var i=this.groups[e];1!=i.visible||void 0!==this.options.groups.visibility[e]&&1!=this.options.groups.visibility[e]||t.push({id:e,zIndex:i.options.zIndex})}s.insertSort(t,function(t,e){var i=t.zIndex,o=e.zIndex;return void 0===i&&(i=0),void 0===o&&(o=0),i==o?0:o>i?-1:1});for(var o=new Array(t.length),n=0;n<t.length;n++)o[n]=t[n].id;return o},o.prototype._updateGraph=function(){if(r.prepareElements(this.svgElements),0!=this.props.width&&null!=this.itemsData){var t,e,i={},o=!1,n=this.body.util.toGlobalTime(-this.body.domProps.root.width),s=this.body.util.toGlobalTime(2*this.body.domProps.root.width),a=this._getSortedGroupIds();if(a.length>0){var h={};for(this._getRelevantData(a,h,n,s),this._applySampling(a,h),e=0;e<a.length;e++)this._convertXcoordinates(h[a[e]]);if(this._getYRanges(a,h,i),o=this._updateYAxis(a,i),1==o)return r.cleanupElements(this.svgElements),this.abortedGraphUpdate=!0,!0;this.abortedGraphUpdate=!1;var d=void 0;for(e=0;e<a.length;e++)t=this.groups[a[e]],this.options.stack===!0&&"line"===this.options.style&&(void 0!=t.options.excludeFromStacking&&t.options.excludeFromStacking||(void 0!=d&&(this._stack(h[t.id],h[d.id]),1==t.options.shaded.enabled&&"group"!==t.options.shaded.orientation&&("top"==t.options.shaded.orientation&&"group"!==d.options.shaded.orientation?(d.options.shaded.orientation="group",d.options.shaded.groupId=t.id):(t.options.shaded.orientation="group",t.options.shaded.groupId=d.id))),d=t)),this._convertYcoordinates(h[a[e]],t);var l={};for(e=0;e<a.length;e++)if(t=this.groups[a[e]],"line"===t.options.style&&1==t.options.shaded.enabled){var u=h[a[e]];if(null==u||0==u.length)continue;if(l.hasOwnProperty(a[e])||(l[a[e]]=m.calcPath(u,t)),"group"===t.options.shaded.orientation){var c=t.options.shaded.groupId;if(-1===a.indexOf(c)){console.log(t.id+": Unknown shading group target given:"+c);continue}l.hasOwnProperty(c)||(l[c]=m.calcPath(h[c],this.groups[c])),m.drawShading(l[a[e]],t,l[c],this.framework)}else m.drawShading(l[a[e]],t,void 0,this.framework)}for(p.draw(a,h,this.framework),e=0;e<a.length;e++)if(t=this.groups[a[e]],h[a[e]].length>0)switch(t.options.style){case"line":l.hasOwnProperty(a[e])||(l[a[e]]=m.calcPath(h[a[e]],t)),m.draw(l[a[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||f.draw(h[a[e]],t,this.framework);break;case"bar":}}}return r.cleanupElements(this.svgElements),!1},o.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;a<t.length;a++){s=void 0,r=void 0;for(var h=i;h<e.length;h++){if(e[h].x===t[a].x){s=e[h],r=e[h],i=h;break}if(e[h].x>t[a].x){r=e[h],s=0==h?r:e[h-1],i=h;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?t[a].y=t[a].orginalY+r.y:t[a].y=t[a].orginalY+n/o*(t[a].x-s.x)+s.y}},o.prototype._getRelevantData=function(t,e,i,o){var n,r,a,h;if(t.length>0)for(r=0;r<t.length;r++){n=this.groups[t[r]];var d=n.getItems();if(1==n.options.sort){var l=function(t,e){return t.getTime()==e.getTime()?0:e>t?-1:1},u=Math.max(0,s.binarySearchValue(d,i,"x","before",l)),c=Math.min(d.length,s.binarySearchValue(d,o,"x","after",l)+1);0>=c&&(c=d.length);var p=new Array(c-u);for(a=u;c>a;a++)h=n.itemsData[a],p[a-u]=h;e[t[r]]=p}else e[t[r]]=n.itemsData}},o.prototype._applySampling=function(t,e){var i;if(t.length>0)for(var o=0;o<t.length;o++)if(i=this.groups[t[o]],1==i.options.sampling){var n=e[t[o]];if(n.length>0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=new Array(r),l=0;r>l;l+=s){var u=Math.round(l/s);d[u]=n[l]}e[t[o]]=d.splice(0,Math.round(r/s))}}},o.prototype._getYRanges=function(t,e,i){var o,n,s,r,a=[],h=[];if(t.length>0){for(s=0;s<t.length;s++)o=e[t[s]],r=this.groups[t[s]].options,o.length>0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[t[s]]=n.getYRange(o,t[s]));p.getStackedYRange(a,i,t,"__barStackLeft","left"),p.getStackedYRange(h,i,t,"__barStackRight","right")}},o.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var u=0;u<t.length;u++){var c=this.groups[t[u]];c&&"right"!=c.options.yAxisOrientation?(s=!0,a=1e9,d=-1e9):c&&c.options.yAxisOrientation&&(r=!0,h=1e9,l=-1e9)}for(var u=0;u<t.length;u++)e.hasOwnProperty(t[u])&&e[t[u]].ignore!==!0&&(i=e[t[u]].min,o=e[t[u]].max,"right"!=e[t[u]].yAxisOrientation?(s=!0,a=a>i?i:a,d=o>d?o:d):(r=!0,h=h>i?i:h,l=o>l?o:l));1==s&&this.yAxisLeft.setRange(a,d),1==r&&this.yAxisRight.setRange(h,l)}n=this._toggleAxisVisiblity(s,this.yAxisLeft)||n,n=this._toggleAxisVisiblity(r,this.yAxisRight)||n,1==r&&1==s?(this.yAxisLeft.drawIcons=!0,this.yAxisRight.drawIcons=!0):(this.yAxisLeft.drawIcons=!1,this.yAxisRight.drawIcons=!1),this.yAxisRight.master=!s,this.yAxisRight.masterAxis=this.yAxisLeft,0==this.yAxisRight.master?(1==r?this.yAxisLeft.lineOffset=this.yAxisRight.width:this.yAxisLeft.lineOffset=0,n=this.yAxisLeft.redraw()||n,n=this.yAxisRight.redraw()||n):n=this.yAxisRight.redraw()||n;for(var p=["__barStackLeft","__barStackRight","__lineStackLeft","__lineStackRight"],u=0;u<p.length;u++)-1!=t.indexOf(p[u])&&t.splice(t.indexOf(p[u]),1);return n},o.prototype._toggleAxisVisiblity=function(t,e){var i=!1;return 0==t?e.dom.frame.parentNode&&0==e.hidden&&(e.hide(),i=!0):e.dom.frame.parentNode||1!=e.hidden||(e.show(),i=!0),i},o.prototype._convertXcoordinates=function(t){for(var e=this.body.util.toScreen,i=0;i<t.length;i++)t[i].screen_x=e(t[i].x)+this.props.width,t[i].screen_y=t[i].y},o.prototype._convertYcoordinates=function(t,e){var i=this.yAxisLeft,o=Number(this.svg.style.height.replace("px",""));"right"==e.options.yAxisOrientation&&(i=this.yAxisRight);for(var n=0;n<t.length;n++)t[n].screen_y=Math.round(i.convertValue(t[n].y));e.setZeroPosition(Math.min(o,i.convertValue(0)))},t.exports=o},function(t,e,i){function o(t,e,i,o){this.id=n.randomUUID(),this.body=t,this.defaultOptions={orientation:"left",showMinorLabels:!0,showMajorLabels:!0,icons:!1,majorLinesOffset:7,minorLinesOffset:4,labelOffsetX:10,labelOffsetY:2,iconWidth:20,width:"40px",visible:!0,alignZeros:!0,left:{range:{min:void 0,max:void 0},format:function(t){return""+parseFloat(t.toPrecision(3))},title:{text:void 0,style:void 0}},right:{range:{min:void 0,max:void 0},format:function(t){return""+parseFloat(t.toPrecision(3))},title:{text:void 0,style:void 0}}},this.linegraphOptions=o,this.linegraphSVG=i,this.props={},this.DOMelements={lines:{},labels:{},title:{}},this.dom={},this.scale=void 0,this.range={start:0,end:0},this.options=n.extend({},this.defaultOptions),this.conversionFactor=1,this.setOptions(e),this.width=Number((""+this.options.width).replace("px","")),this.minWidth=this.width,this.height=this.linegraphSVG.getBoundingClientRect().height,this.hidden=!1,this.stepPixels=25,this.zeroCrossing=-1,this.amountOfSteps=-1,this.lineOffset=0,this.master=!0,this.masterAxis=null,this.svgElements={},this.iconsRemoved=!1,this.groups={},this.amountOfGroups=0,this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups};var s=this;this.body.emitter.on("verticalDrag",function(){s.dom.lineContainer.style.top=s.body.domProps.scrollTop+"px"})}var n=i(1),s=i(7),r=i(21),a=i(44);o.prototype=new r,o.prototype.addGroup=function(t,e){this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1},o.prototype.updateGroup=function(t,e){this.groups.hasOwnProperty(t)||(this.amountOfGroups+=1),this.groups[t]=e},o.prototype.removeGroup=function(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)},o.prototype.setOptions=function(t){if(t){var e=!1;this.options.orientation!=t.orientation&&void 0!==t.orientation&&(e=!0);var i=["orientation","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","width","visible","left","right","alignZeros"];n.selectiveDeepExtend(i,this.options,t),this.minWidth=Number((""+this.options.width).replace("px","")),e===!0&&this.dom.frame&&(this.hide(),this.show())}},o.prototype._create=function(){
+this.dom.frame=document.createElement("div"),this.dom.frame.style.width=this.options.width,this.dom.frame.style.height=this.height,this.dom.lineContainer=document.createElement("div"),this.dom.lineContainer.style.width="100%",this.dom.lineContainer.style.height=this.height,this.dom.lineContainer.style.position="relative",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.height="100%",this.svg.style.width="100%",this.svg.style.display="block",this.dom.frame.appendChild(this.svg)},o.prototype._redrawGroupIcons=function(){s.prepareElements(this.svgElements);var t,e=this.options.iconWidth,i=15,o=4,n=o+.5*i;t="left"===this.options.orientation?o:this.width-e-o;var r=Object.keys(this.groups);r.sort(function(t,e){return e>t?-1:1});for(var a=0;a<r.length;a++){var h=r[a];this.groups[h].visible!==!0||void 0!==this.linegraphOptions.visibility[h]&&this.linegraphOptions.visibility[h]!==!0||(this.groups[h].getLegend(e,i,this.framework,t,n),n+=i+o)}s.cleanupElements(this.svgElements),this.iconsRemoved=!1},o.prototype._cleanupIcons=function(){this.iconsRemoved===!1&&(s.prepareElements(this.svgElements),s.cleanupElements(this.svgElements),this.iconsRemoved=!0)},o.prototype.show=function(){this.hidden=!1,this.dom.frame.parentNode||(this.options.rtl?this.body.dom.left.appendChild(this.dom.frame):this.body.dom.left.appendChild(this.dom.frame)),this.dom.lineContainer.parentNode||this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer)},o.prototype.hide=function(){this.hidden=!0,this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.lineContainer.parentNode&&this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer)},o.prototype.setRange=function(t,e){this.range.start=t,this.range.end=e},o.prototype.redraw=function(){var t=!1,e=0;this.dom.lineContainer.style.top=this.body.domProps.scrollTop+"px";for(var i in this.groups)this.groups.hasOwnProperty(i)&&(this.groups[i].visible!==!0||void 0!==this.linegraphOptions.visibility[i]&&this.linegraphOptions.visibility[i]!==!0||e++);if(0===this.amountOfGroups||0===e)this.hide();else{this.show(),this.height=Number(this.linegraphSVG.style.height.replace("px","")),this.dom.lineContainer.style.height=this.height+"px",this.width=this.options.visible===!0?Number((""+this.options.width).replace("px","")):0;var o=this.props,n=this.dom.frame;n.className="vis-data-axis",this._calculateCharSize();var s=this.options.orientation,r=this.options.showMinorLabels,a=this.options.showMajorLabels;o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=a?o.majorCharHeight:0,o.minorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.minorLinesOffset,o.minorLineHeight=1,o.majorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.majorLinesOffset,o.majorLineHeight=1,"left"===s?(n.style.top="0",n.style.left="0",n.style.bottom="",n.style.width=this.width+"px",n.style.height=this.height+"px",this.props.width=this.body.domProps.left.width,this.props.height=this.body.domProps.left.height):(n.style.top="",n.style.bottom="0",n.style.left="0",n.style.width=this.width+"px",n.style.height=this.height+"px",this.props.width=this.body.domProps.right.width,this.props.height=this.body.domProps.right.height),t=this._redrawLabels(),t=this._isResized()||t,this.options.icons===!0?this._redrawGroupIcons():this._cleanupIcons(),this._redrawTitle(s)}return t},o.prototype._redrawLabels=function(){var t=this,e=!1;s.prepareElements(this.DOMelements.lines),s.prepareElements(this.DOMelements.labels);var i=this.options.orientation,o=void 0!=this.options[i].range?this.options[i].range:{},n=!0;void 0!=o.max&&(this.range.end=o.max,n=!1);var r=!0;void 0!=o.min&&(this.range.start=o.min,r=!1),this.scale=new a(this.range.start,this.range.end,r,n,this.dom.frame.offsetHeight,this.props.majorCharHeight,this.options.alignZeros,this.options[i].format),this.master===!1&&void 0!=this.masterAxis&&this.scale.followScale(this.masterAxis.scale),this.maxLabelSize=0;var h=this.scale.getLines();h.forEach(function(e){var o=e.y,n=e.major;t.options.showMinorLabels&&n===!1&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-minor",t.props.minorCharHeight),n&&o>=0&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-major",t.props.majorCharHeight),t.master===!0&&(n?t._redrawLine(o,i,"vis-grid vis-horizontal vis-major",t.options.majorLinesOffset,t.props.majorLineWidth):t._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",t.options.minorLinesOffset,t.props.minorLineWidth))});var d=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(d=this.props.titleCharHeight);var l=this.options.icons===!0?Math.max(this.options.iconWidth,d)+this.options.labelOffsetX+15:d+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-l&&this.options.visible===!0?(this.width=this.maxLabelSize+l,this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSize<this.width-l&&this.options.visible===!0&&this.width>this.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+l),this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),e=!1),e},o.prototype.convertValue=function(t){return this.scale.convertValue(t)},o.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},o.prototype._redrawLabel=function(t,e,i,o,n){var r=s.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=e,"left"===i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize<e.length*a&&(this.maxLabelSize=e.length*a)},o.prototype._redrawLine=function(t,e,i,o,n){if(this.master===!0){var r=s.getDOMElement("div",this.DOMelements.lines,this.dom.lineContainer);r.className=i,r.innerHTML="","left"===e?r.style.left=this.width-o+"px":r.style.right=this.width-o+"px",r.style.width=n+"px",r.style.top=t+"px"}},o.prototype._redrawTitle=function(t){if(s.prepareElements(this.DOMelements.title),void 0!==this.options[t].title&&void 0!==this.options[t].title.text){var e=s.getDOMElement("div",this.DOMelements.title,this.dom.frame);e.className="vis-y-axis vis-title vis-"+t,e.innerHTML=this.options[t].title.text,void 0!==this.options[t].title.style&&n.addCssText(e,this.options[t].title.style),"left"===t?e.style.left=this.props.titleCharHeight+"px":e.style.right=this.props.titleCharHeight+"px",e.style.width=this.height+"px"}s.cleanupElements(this.DOMelements.title)},o.prototype._calculateCharSize=function(){if(!("minorCharHeight"in this.props)){var t=document.createTextNode("0"),e=document.createElement("div");e.className="vis-y-axis vis-minor vis-measure",e.appendChild(t),this.dom.frame.appendChild(e),this.props.minorCharHeight=e.clientHeight,this.props.minorCharWidth=e.clientWidth,this.dom.frame.removeChild(e)}if(!("majorCharHeight"in this.props)){var i=document.createTextNode("0"),o=document.createElement("div");o.className="vis-y-axis vis-major vis-measure",o.appendChild(i),this.dom.frame.appendChild(o),this.props.majorCharHeight=o.clientHeight,this.props.majorCharWidth=o.clientWidth,this.dom.frame.removeChild(o)}if(!("titleCharHeight"in this.props)){var n=document.createTextNode("0"),s=document.createElement("div");s.className="vis-y-axis vis-title vis-measure",s.appendChild(n),this.dom.frame.appendChild(s),this.props.titleCharHeight=s.clientHeight,this.props.titleCharWidth=s.clientWidth,this.dom.frame.removeChild(s)}},t.exports=o},function(t,e){function i(t,e,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?!1:arguments[6],a=arguments.length<=7||void 0===arguments[7]?!1:arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=n,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=o,this.formattingFunction=a,i||o){var h=this,d=function(t){var e=t-t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx]);return t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx])>.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?e+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:e};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=d(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=d(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(t){this.majorCharHeight=t},i.prototype.setHeight=function(t){this.containerHeight=t},i.prototype.determineScale=function(){var t=this._end-this._start;this.scale=this.containerHeight/t;var e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;0>i&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r<this.minorSteps.length;r++){var a=this.magnitudefactor*this.minorSteps[r];if(a>=e){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)},i.prototype.formatValue=function(t){var e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?""+e:"string"==typeof e?e:t.toPrecision(5)},i.prototype.getLines=function(){for(var t=[],e=this.getStep(),i=(e-this._start%e)%e,o=this._start+i;this._end-o>1e-5;o+=e)o!=this._start&&t.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return t},i.prototype.followScale=function(t){var e=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdx<this.minorStepIdx?(this.minorStepIdx=1,2==e?s():(s(),s())):(this.minorStepIdx=2,1==e?r():(r(),r())));for(var a=(t.getLines(),t.convertValue(0)),h=t.getStep()*t.scale,d=!1,l=0;!d&&l++<5;){this.scale=h/(this.minorSteps[this.minorStepIdx]*this.magnitudefactor);var u=this.containerHeight/this.scale;this._start=i,this._end=this._start+u;var c=this._end*this.scale,p=this.magnitudefactor*this.majorSteps[this.minorStepIdx],m=this.getFirstMajor()-t.getFirstMajor();if(this.zeroAlign){var f=a-c;this._end+=f/this.scale,this._start=this._end-u}else this.autoScaleStart?(this._start-=m/this.scale,this._end=this._start+u):(this._start+=p-m/this.scale,this._end=this._start+u);if(!this.autoScaleEnd&&this._end>o+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start<i-1e-5){if(!(this.zeroAlign&&i>=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&o-i>u?(s(),d=!1):d=!0}}},i.prototype.convertValue=function(t){return this.containerHeight-(t-this._start)*this.scale},i.prototype.screenToValue=function(t){return(this.containerHeight-t)/this.scale+this._start},t.exports=i},function(t,e,i){function o(t,e,i,o){this.id=e;var n=["sampling","style","sort","yAxisOrientation","barChart","drawPoints","shaded","interpolation","zIndex","excludeFromStacking","excludeFromLegend"];this.options=s.selectiveBridgeObject(n,i),this.usingDefaultStyle=void 0===t.className,this.groupsUsingDefaultStyles=o,this.zeroPosition=0,this.update(t),1==this.usingDefaultStyle&&(this.groupsUsingDefaultStyles[0]+=1),this.itemsData=[],this.visible=void 0===t.visible?!0:t.visible}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=(i(7),i(46)),a=i(48),h=i(47);o.prototype.setItems=function(t){null!=t?(this.itemsData=t,1==this.options.sort&&s.insertSort(this.itemsData,function(t,e){return t.x>e.x?1:-1})):this.itemsData=[]},o.prototype.getItems=function(){return this.itemsData},o.prototype.setZeroPosition=function(t){this.zeroPosition=t},o.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];s.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),s.mergeOptions(this.options,t,"interpolation"),s.mergeOptions(this.options,t,"drawPoints"),s.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==n(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},o.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible?!0:t.visible,this.style=t.style,this.setOptions(t.options)},o.prototype.getLegend=function(t,e,i,o,n){if(void 0==i||null==i){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");i={svg:s,svgElements:{},options:this.options,groups:[this]}}switch(void 0!=o&&null!=o||(o=0),void 0!=n&&null!=n||(n=.5*e),this.options.style){case"line":a.drawIcon(this,o,n,t,e,i);break;case"points":case"point":h.drawIcon(this,o,n,t,e,i);break;case"bar":r.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},o.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;o<t.length;o++)e=e>t[o].y?t[o].y:e,i=i<t[o].y?t[o].y:i;return{min:e,max:i,yAxisOrientation:this.options.yAxisOrientation}},t.exports=o},function(t,e,i){function o(t,e){}var n=i(7),s=i(47);o.drawIcon=function(t,e,i,o,s,r){var a=.5*s,h=n.getSVGElement("rect",r.svgElements,r.svg);h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i-a),h.setAttributeNS(null,"width",o),h.setAttributeNS(null,"height",2*a),h.setAttributeNS(null,"class","vis-outline");var d=Math.round(.3*o),l=t.options.barChart.width,u=l/d,c=Math.round(.4*s),p=Math.round(.75*s),m=Math.round((o-2*d)/3);if(n.drawBar(e+.5*d+m,i+a-c-1,d,c,t.className+" vis-bar",r.svgElements,r.svg,t.style),n.drawBar(e+1.5*d+m+2,i+a-p-1,d,p,t.className+" vis-bar",r.svgElements,r.svg,t.style),1==t.options.drawPoints.enabled){var f={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size/u,className:t.className};n.drawPoint(e+.5*d+m,i+a-c-1,f,r.svgElements,r.svg),n.drawPoint(e+1.5*d+m+2,i+a-p-1,f,r.svgElements,r.svg)}},o.draw=function(t,e,i){var r,a,h,d,l,u,c=[],p={},m=0;for(l=0;l<t.length;l++)if(d=i.groups[t[l]],"bar"===d.options.style&&d.visible===!0&&(void 0===i.options.groups.visibility[t[l]]||i.options.groups.visibility[t[l]]===!0))for(u=0;u<e[t[l]].length;u++)c.push({screen_x:e[t[l]][u].screen_x,screen_y:e[t[l]][u].screen_y,x:e[t[l]][u].x,y:e[t[l]][u].y,groupId:t[l],label:e[t[l]][u].label}),m+=1;if(0!==m)for(c.sort(function(t,e){return t.screen_x===e.screen_x?t.groupId<e.groupId?-1:1:t.screen_x-e.screen_x}),o._getDataIntersections(p,c),l=0;l<c.length;l++){d=i.groups[c[l].groupId];var f=void 0!=d.options.barChart.minWidth?d.options.barChart.minWidth:.1*d.options.barChart.width;a=c[l].screen_x;var g=0;if(void 0===p[a])l+1<c.length&&(r=Math.abs(c[l+1].screen_x-a)),h=o._getSafeDrawData(r,d,f);else{var v=l+(p[a].amount-p[a].resolved);l-(p[a].resolved+1);v<c.length&&(r=Math.abs(c[v].screen_x-a)),h=o._getSafeDrawData(r,d,f),p[a].resolved+=1,d.options.stack===!0&&d.options.excludeFromStacking!==!0?c[l].screen_y<d.zeroPosition?(g=p[a].accumulatedNegative,p[a].accumulatedNegative+=d.zeroPosition-c[l].screen_y):(g=p[a].accumulatedPositive,p[a].accumulatedPositive+=d.zeroPosition-c[l].screen_y):d.options.barChart.sideBySide===!0&&(h.width=h.width/p[a].amount,h.offset+=p[a].resolved*h.width-.5*h.width*(p[a].amount+1))}if(n.drawBar(c[l].screen_x+h.offset,c[l].screen_y-g,h.width,d.zeroPosition-c[l].screen_y,d.className+" vis-bar",i.svgElements,i.svg,d.style),d.options.drawPoints.enabled===!0){var y={screen_x:c[l].screen_x,screen_y:c[l].screen_y-g,x:c[l].x,y:c[l].y,groupId:c[l].groupId,label:c[l].label};s.draw([y],d,i,h.offset)}}},o._getDataIntersections=function(t,e){for(var i,o=0;o<e.length;o++)o+1<e.length&&(i=Math.abs(e[o+1].screen_x-e[o].screen_x)),o>0&&(i=Math.min(i,Math.abs(e[o-1].screen_x-e[o].screen_x))),0===i&&(void 0===t[e[o].screen_x]&&(t[e[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].screen_x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t<e.options.barChart.width&&t>0?(o=i>t?i:t,n=0,"left"===e.options.barChart.align?n-=.5*t:"right"===e.options.barChart.align&&(n+=.5*t)):(o=e.options.barChart.width,n=0,"left"===e.options.barChart.align?n-=.5*e.options.barChart.width:"right"===e.options.barChart.align&&(n+=.5*e.options.barChart.width)),{width:o,offset:n}},o.getStackedYRange=function(t,e,i,n,s){if(t.length>0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupId<e.groupId?-1:1:t.screen_x-e.screen_x});var r={};o._getDataIntersections(r,t),e[n]=o._getStackedYRange(r,t),e[n].yAxisOrientation=s,i.push(n)}},o._getStackedYRange=function(t,e){for(var i,o=e[0].screen_y,n=e[0].screen_y,s=0;s<e.length;s++)i=e[s].screen_x,void 0===t[i]?(o=o>e[s].screen_y?e[s].screen_y:o,n=n<e[s].screen_y?e[s].screen_y:n):e[s].screen_y<0?t[i].accumulatedNegative+=e[s].screen_y:t[i].accumulatedPositive+=e[s].screen_y;for(var r in t)t.hasOwnProperty(r)&&(o=o>t[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n<t[r].accumulatedNegative?t[r].accumulatedNegative:n,n=n<t[r].accumulatedPositive?t[r].accumulatedPositive:n);return{min:o,max:n}},t.exports=o},function(t,e,i){function o(t,e){}function n(t,e){return e="undefined"==typeof e?{}:e,{style:e.style||t.options.drawPoints.style,styles:e.styles||t.options.drawPoints.styles,size:e.size||t.options.drawPoints.size,className:e.className||t.className}}function s(t,e){var i=void 0;return t.options&&t.options.drawPoints&&t.options.drawPoints.onRender&&"function"==typeof t.options.drawPoints.onRender&&(i=t.options.drawPoints.onRender),e.group.options&&e.group.options.drawPoints&&e.group.options.drawPoints.onRender&&"function"==typeof e.group.options.drawPoints.onRender&&(i=e.group.options.drawPoints.onRender),i}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=i(7);o.draw=function(t,e,i,o){o=o||0;for(var h=s(i,e),d=0;d<t.length;d++)if(h){var l=h(t[d],e);l!==!0&&"object"!==("undefined"==typeof l?"undefined":r(l))||a.drawPoint(t[d].screen_x+o,t[d].screen_y,n(e,l),i.svgElements,i.svg,t[d].label)}else a.drawPoint(t[d].screen_x+o,t[d].screen_y,n(e),i.svgElements,i.svg,t[d].label)},o.drawIcon=function(t,e,i,o,s,r){var h=.5*s,d=a.getSVGElement("rect",r.svgElements,r.svg);d.setAttributeNS(null,"x",e),d.setAttributeNS(null,"y",i-h),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",2*h),d.setAttributeNS(null,"class","vis-outline"),a.drawPoint(e+.5*o,i,n(t),r.svgElements,r.svg)},t.exports=o},function(t,e,i){function o(t,e){}var n=i(7);o.calcPath=function(t,e){if(null!=t&&t.length>0){var i=[];return i=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t)}},o.drawIcon=function(t,e,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",e),l.setAttributeNS(null,"y",i-d),l.setAttributeNS(null,"width",o),l.setAttributeNS(null,"height",2*d),l.setAttributeNS(null,"class","vis-outline"),a=n.getSVGElement("path",r.svgElements,r.svg),a.setAttributeNS(null,"class",t.className),void 0!==t.style&&a.setAttributeNS(null,"style",t.style),a.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+o)+","+i),1==t.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==t.options.shaded.orientation?h.setAttributeNS(null,"d","M"+e+", "+(i-d)+"L"+e+","+i+" L"+(e+o)+","+i+" L"+(e+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+d)+" L"+(e+o)+","+(i+d)+"L"+(e+o)+","+i),h.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&h.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled){var u={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className};n.drawPoint(e+.5*o,i,u,r.svgElements,r.svg)}},o.drawShading=function(t,e,i,o){if(1==e.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),h="group"==e.options.shaded.orientation&&null!=i&&void 0!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+d+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(t,e,i){if(null!=t&&void 0!=t){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",e.className),void 0!==e.style&&o.setAttributeNS(null,"style",e.style);var s="L";1==e.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,s,!1))}},o.serializePath=function(t,e,i){if(t.length<2)return"";var o=e;if(i)for(var n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(var n=1;n<t.length;n++)o+=t[n][0]+","+t[n][1]+" ";return o},o._catmullRomUniform=function(t){var e,i,o,n,s,r,a=[];a.push([Math.round(t[0].screen_x),Math.round(t[0].screen_y)]);for(var h=1/6,d=t.length,l=0;d-1>l;l++)e=0==l?t[0]:t[l-1],i=t[l],o=t[l+1],n=d>l+2?t[l+2]:o,s={screen_x:(-e.screen_x+6*i.screen_x+o.screen_x)*h,screen_y:(-e.screen_y+6*i.screen_y+o.screen_y)*h},r={screen_x:(i.screen_x+6*o.screen_x-n.screen_x)*h,screen_y:(i.screen_y+6*o.screen_y-n.screen_y)*h},a.push([s.screen_x,s.screen_y]),a.push([r.screen_x,r.screen_y]),a.push([o.screen_x,o.screen_y]);return a},o._catmullRom=function(t,e){var i=e.options.interpolation.alpha;if(0==i||void 0===i)return this._catmullRomUniform(t);var o,n,s,r,a,h,d,l,u,c,p,m,f,g,v,y,b,_,w,x=[];x.push([Math.round(t[0].screen_x),Math.round(t[0].screen_y)]);for(var D=t.length,k=0;D-1>k;k++)o=0==k?t[0]:t[k-1],n=t[k],s=t[k+1],r=D>k+2?t[k+2]:s,d=Math.sqrt(Math.pow(o.screen_x-n.screen_x,2)+Math.pow(o.screen_y-n.screen_y,2)),l=Math.sqrt(Math.pow(n.screen_x-s.screen_x,2)+Math.pow(n.screen_y-s.screen_y,2)),u=Math.sqrt(Math.pow(s.screen_x-r.screen_x,2)+Math.pow(s.screen_y-r.screen_y,2)),g=Math.pow(u,i),y=Math.pow(u,2*i),v=Math.pow(l,i),b=Math.pow(l,2*i),w=Math.pow(d,i),_=Math.pow(d,2*i),c=2*_+3*w*v+b,p=2*y+3*g*v+b,m=3*w*(w+v),m>0&&(m=1/m),f=3*g*(g+v),f>0&&(f=1/f),a={screen_x:(-b*o.screen_x+c*n.screen_x+_*s.screen_x)*m,screen_y:(-b*o.screen_y+c*n.screen_y+_*s.screen_y)*m},h={screen_x:(y*n.screen_x+p*s.screen_x-b*r.screen_x)*f,screen_y:(y*n.screen_y+p*s.screen_y-b*r.screen_y)*f},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(t){for(var e=[],i=0;i<t.length;i++)e.push([t[i].screen_x,t[i].screen_y]);return e},t.exports=o},function(t,e,i){function o(t,e,i,o){this.body=t,this.defaultOptions={enabled:!1,icons:!0,iconSize:20,iconSpacing:6,left:{visible:!0,position:"top-left"},right:{visible:!0,position:"top-right"}},this.side=i,this.options=n.extend({},this.defaultOptions),this.linegraphOptions=o,this.svgElements={},this.dom={},this.groups={},this.amountOfGroups=0,this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups},this.setOptions(e)}var n=i(1),s=i(7),r=i(21);o.prototype=new r,o.prototype.clear=function(){this.groups={},this.amountOfGroups=0},o.prototype.addGroup=function(t,e){1!=e.options.excludeFromLegend&&(this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1)},o.prototype.updateGroup=function(t,e){this.groups[t]=e},o.prototype.removeGroup=function(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)},o.prototype._create=function(){this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-legend",this.dom.frame.style.position="absolute",this.dom.frame.style.top="10px",this.dom.frame.style.display="block",this.dom.textArea=document.createElement("div"),this.dom.textArea.className="vis-legend-text",this.dom.textArea.style.position="relative",this.dom.textArea.style.top="0px",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.width=this.options.iconSize+5+"px",this.svg.style.height="100%",this.dom.frame.appendChild(this.svg),this.dom.frame.appendChild(this.dom.textArea)},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame)},o.prototype.setOptions=function(t){var e=["enabled","orientation","icons","left","right"];n.selectiveDeepExtend(e,this.options,t)},o.prototype.redraw=function(){var t=0,e=Object.keys(this.groups);e.sort(function(t,e){return e>t?-1:1});for(var i=0;i<e.length;i++){var o=e[i];1!=this.groups[o].visible||void 0!==this.linegraphOptions.visibility[o]&&1!=this.linegraphOptions.visibility[o]||t++}if(0==this.options[this.side].visible||0==this.amountOfGroups||0==this.options.enabled||0==t)this.hide();else{if(this.show(),"top-left"==this.options[this.side].position||"bottom-left"==this.options[this.side].position?(this.dom.frame.style.left="4px",this.dom.frame.style.textAlign="left",this.dom.textArea.style.textAlign="left",this.dom.textArea.style.left=this.options.iconSize+15+"px",this.dom.textArea.style.right="",this.svg.style.left="0px",this.svg.style.right=""):(this.dom.frame.style.right="4px",this.dom.frame.style.textAlign="right",this.dom.textArea.style.textAlign="right",this.dom.textArea.style.right=this.options.iconSize+15+"px",this.dom.textArea.style.left="",this.svg.style.right="0px",this.svg.style.left=""),"top-left"==this.options[this.side].position||"top-right"==this.options[this.side].position)this.dom.frame.style.top=4-Number(this.body.dom.center.style.top.replace("px",""))+"px",this.dom.frame.style.bottom="";else{var n=this.body.domProps.center.height-this.body.domProps.centerContainer.height;this.dom.frame.style.bottom=4+n+Number(this.body.dom.center.style.top.replace("px",""))+"px",this.dom.frame.style.top=""}0==this.options.icons?(this.dom.frame.style.width=this.dom.textArea.offsetWidth+10+"px",this.dom.textArea.style.right="",this.dom.textArea.style.left="",this.svg.style.width="0px"):(this.dom.frame.style.width=this.options.iconSize+15+this.dom.textArea.offsetWidth+10+"px",this.drawLegendIcons());for(var s="",i=0;i<e.length;i++){var o=e[i];1!=this.groups[o].visible||void 0!==this.linegraphOptions.visibility[o]&&1!=this.linegraphOptions.visibility[o]||(s+=this.groups[o].content+"<br />")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort(function(t,e){return e>t?-1:1}),s.resetElements(this.svgElements);var e=window.getComputedStyle(this.dom.frame).paddingTop,i=Number(e.replace("px","")),o=i,n=this.options.iconSize,r=.75*this.options.iconSize,a=i+.5*r+3;this.svg.style.width=n+5+i+"px";for(var h=0;h<t.length;h++){var d=t[h];1!=this.groups[d].visible||void 0!==this.linegraphOptions.visibility[d]&&1!=this.linegraphOptions.visibility[d]||(this.groups[d].getLegend(n,r,this.framework,o,a),a+=r+this.options.iconSpacing)}}},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",u={configure:{enabled:{"boolean":o},filter:{"boolean":o,"function":"function"},container:{dom:h},__type__:{object:a,"boolean":o,"function":"function"}},yAxisOrientation:{string:["left","right"]},defaultGroup:{string:i},sort:{"boolean":o},sampling:{"boolean":o},stack:{"boolean":o},graphHeight:{string:i,number:n},shaded:{enabled:{"boolean":o},orientation:{string:["bottom","top","zero","group"]},groupId:{object:a},__type__:{"boolean":o,object:a}},style:{string:["line","bar","points"]},barChart:{width:{number:n},minWidth:{number:n},sideBySide:{"boolean":o},align:{string:["left","center","right"]},__type__:{object:a}},interpolation:{enabled:{"boolean":o},parametrization:{string:["centripetal","chordal","uniform"]},alpha:{number:n},__type__:{object:a,"boolean":o}},drawPoints:{enabled:{"boolean":o},onRender:{"function":"function"},size:{number:n},style:{string:["square","circle"]},__type__:{object:a,"boolean":o,"function":"function"}},dataAxis:{showMinorLabels:{"boolean":o},showMajorLabels:{"boolean":o},icons:{"boolean":o},width:{string:i,number:n},visible:{"boolean":o},alignZeros:{"boolean":o},left:{range:{min:{number:n},max:{number:n},__type__:{object:a}},format:{"function":"function"},title:{text:{string:i,number:n},style:{string:i},__type__:{object:a}},__type__:{object:a}},right:{range:{min:{number:n},max:{number:n},__type__:{object:a}},format:{"function":"function"},title:{text:{string:i,number:n},style:{string:i},__type__:{object:a}},__type__:{object:a}},__type__:{object:a}},legend:{enabled:{"boolean":o},icons:{"boolean":o},left:{visible:{"boolean":o},position:{string:["top-right","bottom-right","top-left","bottom-left"]},__type__:{object:a}},right:{visible:{"boolean":o},position:{string:["top-right","bottom-right","top-left","bottom-left"]},__type__:{object:a}},__type__:{object:a,"boolean":o}},groups:{visibility:{any:l},__type__:{object:a}},autoResize:{"boolean":o},throttleRedraw:{number:n},clickToUse:{"boolean":o},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},__type__:{object:a}},moment:{"function":"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},locale:{string:i},locales:{
+__any__:{any:l},__type__:{object:a}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{"boolean":o},multiselect:{"boolean":o},orientation:{string:i},showCurrentTime:{"boolean":o},showMajorLabels:{"boolean":o},showMinorLabels:{"boolean":o},start:{date:r,number:n,string:i,moment:d},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},width:{string:i,number:n},zoomable:{"boolean":o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},zIndex:{number:n},__type__:{object:a}},c={global:{sort:!0,sampling:!0,stack:!1,shaded:{enabled:!1,orientation:["zero","top","bottom","group"]},style:["line","bar","points"],barChart:{width:[50,5,100,5],minWidth:[50,5,100,5],sideBySide:!1,align:["left","center","right"]},interpolation:{enabled:!0,parametrization:["centripetal","chordal","uniform"]},drawPoints:{enabled:!0,size:[6,2,30,1],style:["square","circle"]},dataAxis:{showMinorLabels:!0,showMajorLabels:!0,icons:!1,width:[40,0,200,1],visible:!0,alignZeros:!0,left:{title:{text:"",style:""}},right:{title:{text:"",style:""}}},legend:{enabled:!1,icons:!0,left:{visible:!0,position:["top-right","bottom-right","top-left","bottom-left"]},right:{visible:!0,position:["top-right","bottom-right","top-left","bottom-left"]}},autoResize:!0,throttleRedraw:[10,0,1e3,10],clickToUse:!1,end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},height:"",locale:"",max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!0,orientation:["both","bottom","top"],showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,start:"",width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1],zIndex:0}};e.allOptions=u,e.configureOptions=c}])});
\ No newline at end of file
--- /dev/null
+.vis .overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+
+ /* Must be displayed above for example selected Timeline items */
+ z-index: 10;
+}
+
+.vis-active {
+ box-shadow: 0 0 10px #86d5f8;
+}
+
+/* override some bootstrap styles screwing up the timelines css */
+
+.vis [class*="span"] {
+ min-height: 0;
+ width: auto;
+}
+
+div.vis-configuration {
+ position:relative;
+ display:block;
+ float:left;
+ font-size:12px;
+}
+
+div.vis-configuration-wrapper {
+ display:block;
+ width:700px;
+}
+
+div.vis-configuration-wrapper::after {
+ clear: both;
+ content: "";
+ display: block;
+}
+
+div.vis-configuration.vis-config-option-container{
+ display:block;
+ width:495px;
+ background-color: #ffffff;
+ border:2px solid #f7f8fa;
+ border-radius:4px;
+ margin-top:20px;
+ left:10px;
+ padding-left:5px;
+}
+
+div.vis-configuration.vis-config-button{
+ display:block;
+ width:495px;
+ height:25px;
+ vertical-align: middle;
+ line-height:25px;
+ background-color: #f7f8fa;
+ border:2px solid #ceced0;
+ border-radius:4px;
+ margin-top:20px;
+ left:10px;
+ padding-left:5px;
+ cursor: pointer;
+ margin-bottom:30px;
+}
+
+div.vis-configuration.vis-config-button.hover{
+ background-color: #4588e6;
+ border:2px solid #214373;
+ color:#ffffff;
+}
+
+div.vis-configuration.vis-config-item{
+ display:block;
+ float:left;
+ width:495px;
+ height:25px;
+ vertical-align: middle;
+ line-height:25px;
+}
+
+
+div.vis-configuration.vis-config-item.vis-config-s2{
+ left:10px;
+ background-color: #f7f8fa;
+ padding-left:5px;
+ border-radius:3px;
+}
+div.vis-configuration.vis-config-item.vis-config-s3{
+ left:20px;
+ background-color: #e4e9f0;
+ padding-left:5px;
+ border-radius:3px;
+}
+div.vis-configuration.vis-config-item.vis-config-s4{
+ left:30px;
+ background-color: #cfd8e6;
+ padding-left:5px;
+ border-radius:3px;
+}
+
+div.vis-configuration.vis-config-header{
+ font-size:18px;
+ font-weight: bold;
+}
+
+div.vis-configuration.vis-config-label{
+ width:120px;
+ height:25px;
+ line-height: 25px;
+}
+
+div.vis-configuration.vis-config-label.vis-config-s3{
+ width:110px;
+}
+div.vis-configuration.vis-config-label.vis-config-s4{
+ width:100px;
+}
+
+div.vis-configuration.vis-config-colorBlock{
+ top:1px;
+ width:30px;
+ height:19px;
+ border:1px solid #444444;
+ border-radius:2px;
+ padding:0px;
+ margin:0px;
+ cursor:pointer;
+}
+
+input.vis-configuration.vis-config-checkbox {
+ left:-5px;
+}
+
+
+input.vis-configuration.vis-config-rangeinput{
+ position:relative;
+ top:-5px;
+ width:60px;
+ /*height:13px;*/
+ padding:1px;
+ margin:0;
+ pointer-events:none;
+}
+
+input.vis-configuration.vis-config-range{
+ /*removes default webkit styles*/
+ -webkit-appearance: none;
+
+ /*fix for FF unable to apply focus style bug */
+ border: 0px solid white;
+ background-color:rgba(0,0,0,0);
+
+ /*required for proper track sizing in FF*/
+ width: 300px;
+ height:20px;
+}
+input.vis-configuration.vis-config-range::-webkit-slider-runnable-track {
+ width: 300px;
+ height: 5px;
+ background: #dedede; /* Old browsers */
+ background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedede), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* IE10+ */
+ background: linear-gradient(to bottom, #dedede 0%,#c8c8c8 99%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */
+
+ border: 1px solid #999999;
+ box-shadow: #aaaaaa 0px 0px 3px 0px;
+ border-radius: 3px;
+}
+input.vis-configuration.vis-config-range::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ border: 1px solid #14334b;
+ height: 17px;
+ width: 17px;
+ border-radius: 50%;
+ background: #3876c2; /* Old browsers */
+ background: -moz-linear-gradient(top, #3876c2 0%, #385380 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#3876c2), color-stop(100%,#385380)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #3876c2 0%,#385380 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #3876c2 0%,#385380 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #3876c2 0%,#385380 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #3876c2 0%,#385380 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380',GradientType=0 ); /* IE6-9 */
+ box-shadow: #111927 0px 0px 1px 0px;
+ margin-top: -7px;
+}
+input.vis-configuration.vis-config-range:focus {
+ outline: none;
+}
+input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track {
+ background: #9d9d9d; /* Old browsers */
+ background: -moz-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9d9d9d), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* IE10+ */
+ background: linear-gradient(to bottom, #9d9d9d 0%,#c8c8c8 99%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */
+}
+
+input.vis-configuration.vis-config-range::-moz-range-track {
+ width: 300px;
+ height: 10px;
+ background: #dedede; /* Old browsers */
+ background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedede), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* IE10+ */
+ background: linear-gradient(to bottom, #dedede 0%,#c8c8c8 99%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */
+
+ border: 1px solid #999999;
+ box-shadow: #aaaaaa 0px 0px 3px 0px;
+ border-radius: 3px;
+}
+input.vis-configuration.vis-config-range::-moz-range-thumb {
+ border: none;
+ height: 16px;
+ width: 16px;
+
+ border-radius: 50%;
+ background: #385380;
+}
+
+/*hide the outline behind the border*/
+input.vis-configuration.vis-config-range:-moz-focusring{
+ outline: 1px solid white;
+ outline-offset: -1px;
+}
+
+input.vis-configuration.vis-config-range::-ms-track {
+ width: 300px;
+ height: 5px;
+
+ /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
+ background: transparent;
+
+ /*leave room for the larger thumb to overflow with a transparent border */
+ border-color: transparent;
+ border-width: 6px 0;
+
+ /*remove default tick marks*/
+ color: transparent;
+}
+input.vis-configuration.vis-config-range::-ms-fill-lower {
+ background: #777;
+ border-radius: 10px;
+}
+input.vis-configuration.vis-config-range::-ms-fill-upper {
+ background: #ddd;
+ border-radius: 10px;
+}
+input.vis-configuration.vis-config-range::-ms-thumb {
+ border: none;
+ height: 16px;
+ width: 16px;
+ border-radius: 50%;
+ background: #385380;
+}
+input.vis-configuration.vis-config-range:focus::-ms-fill-lower {
+ background: #888;
+}
+input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
+ background: #ccc;
+}
+
+.vis-configuration-popup {
+ position: absolute;
+ background: rgba(57, 76, 89, 0.85);
+ border: 2px solid #f2faff;
+ line-height:30px;
+ height:30px;
+ width:150px;
+ text-align:center;
+ color: #ffffff;
+ font-size:14px;
+ border-radius:4px;
+ -webkit-transition: opacity 0.3s ease-in-out;
+ -moz-transition: opacity 0.3s ease-in-out;
+ transition: opacity 0.3s ease-in-out;
+}
+.vis-configuration-popup:after, .vis-configuration-popup:before {
+ left: 100%;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+
+.vis-configuration-popup:after {
+ border-color: rgba(136, 183, 213, 0);
+ border-left-color: rgba(57, 76, 89, 0.85);
+ border-width: 8px;
+ margin-top: -8px;
+}
+.vis-configuration-popup:before {
+ border-color: rgba(194, 225, 245, 0);
+ border-left-color: #f2faff;
+ border-width: 12px;
+ margin-top: -12px;
+}
+
+.vis-timeline {
+ position: relative;
+ border: 1px solid #bfbfbf;
+
+ overflow: hidden;
+ padding: 0;
+ margin: 0;
+
+ box-sizing: border-box;
+}
+
+
+.vis-panel {
+ position: absolute;
+
+ padding: 0;
+ margin: 0;
+
+ box-sizing: border-box;
+}
+
+.vis-panel.vis-center,
+.vis-panel.vis-left,
+.vis-panel.vis-right,
+.vis-panel.vis-top,
+.vis-panel.vis-bottom {
+ border: 1px #bfbfbf;
+}
+
+.vis-panel.vis-center,
+.vis-panel.vis-left,
+.vis-panel.vis-right {
+ border-top-style: solid;
+ border-bottom-style: solid;
+ overflow: hidden;
+}
+
+.vis-panel.vis-center,
+.vis-panel.vis-top,
+.vis-panel.vis-bottom {
+ border-left-style: solid;
+ border-right-style: solid;
+}
+
+.vis-background {
+ overflow: hidden;
+}
+
+.vis-panel > .vis-content {
+ position: relative;
+}
+
+.vis-panel .vis-shadow {
+ position: absolute;
+ width: 100%;
+ height: 1px;
+ box-shadow: 0 0 10px rgba(0,0,0,0.8);
+ /* TODO: find a nice way to ensure vis-shadows are drawn on top of items
+ z-index: 1;
+ */
+}
+
+.vis-panel .vis-shadow.vis-top {
+ top: -1px;
+ left: 0;
+}
+
+.vis-panel .vis-shadow.vis-bottom {
+ bottom: -1px;
+ left: 0;
+}
+
+.vis-labelset {
+ position: relative;
+
+ overflow: hidden;
+
+ box-sizing: border-box;
+}
+
+.vis-labelset .vis-label {
+ position: relative;
+ left: 0;
+ top: 0;
+ width: 100%;
+ color: #4d4d4d;
+
+ box-sizing: border-box;
+}
+
+.vis-labelset .vis-label {
+ border-bottom: 1px solid #bfbfbf;
+}
+
+.vis-labelset .vis-label.draggable {
+ cursor: pointer;
+}
+
+.vis-labelset .vis-label:last-child {
+ border-bottom: none;
+}
+
+.vis-labelset .vis-label .vis-inner {
+ display: inline-block;
+ padding: 5px;
+}
+
+.vis-labelset .vis-label .vis-inner.vis-hidden {
+ padding: 0;
+}
+
+
+.vis-itemset {
+ position: relative;
+ padding: 0;
+ margin: 0;
+
+ box-sizing: border-box;
+}
+
+.vis-itemset .vis-background,
+.vis-itemset .vis-foreground {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ overflow: visible;
+}
+
+.vis-axis {
+ position: absolute;
+ width: 100%;
+ height: 0;
+ left: 0;
+ z-index: 1;
+}
+
+.vis-foreground .vis-group {
+ position: relative;
+ box-sizing: border-box;
+ border-bottom: 1px solid #bfbfbf;
+}
+
+.vis-foreground .vis-group:last-child {
+ border-bottom: none;
+}
+
+.vis-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 10;
+}
+
+.vis-item {
+ position: absolute;
+ color: #1A1A1A;
+ border-color: #97B0F8;
+ border-width: 1px;
+ background-color: #D5DDF6;
+ display: inline-block;
+ /*overflow: hidden;*/
+}
+
+.vis-item.vis-selected {
+ border-color: #FFC200;
+ background-color: #FFF785;
+
+ /* z-index must be higher than the z-index of custom time bar and current time bar */
+ z-index: 2;
+}
+
+.vis-editable.vis-selected {
+ cursor: move;
+}
+
+.vis-item.vis-point.vis-selected {
+ background-color: #FFF785;
+}
+
+.vis-item.vis-box {
+ text-align: center;
+ border-style: solid;
+ border-radius: 2px;
+}
+
+.vis-item.vis-point {
+ background: none;
+}
+
+.vis-item.vis-dot {
+ position: absolute;
+ padding: 0;
+ border-width: 4px;
+ border-style: solid;
+ border-radius: 4px;
+}
+
+.vis-item.vis-range {
+ border-style: solid;
+ border-radius: 2px;
+ box-sizing: border-box;
+}
+
+.vis-item.vis-background {
+ border: none;
+ background-color: rgba(213, 221, 246, 0.4);
+ box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+}
+
+.vis-item .vis-item-overflow {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+}
+
+.vis-item.vis-range .vis-item-content {
+ position: relative;
+ display: inline-block;
+}
+
+.vis-item.vis-background .vis-item-content {
+ position: absolute;
+ display: inline-block;
+}
+
+.vis-item.vis-line {
+ padding: 0;
+ position: absolute;
+ width: 0;
+ border-left-width: 1px;
+ border-left-style: solid;
+}
+
+.vis-item .vis-item-content {
+ white-space: nowrap;
+ box-sizing: border-box;
+ padding: 5px;
+}
+
+.vis-item .vis-delete {
+ background: url('img/timeline/delete.png') no-repeat center;
+ position: absolute;
+ width: 24px;
+ height: 24px;
+ top: -4px;
+ right: -24px;
+ cursor: pointer;
+}
+
+.vis-item .vis-delete-rtl {
+ background: url('img/timeline/delete.png') no-repeat center;
+ position: absolute;
+ width: 24px;
+ height: 24px;
+ top: -4px;
+ left: -24px;
+ cursor: pointer;
+}
+
+
+.vis-item.vis-range .vis-drag-left {
+ position: absolute;
+ width: 24px;
+ max-width: 20%;
+ min-width: 2px;
+ height: 100%;
+ top: 0;
+ left: -4px;
+
+ cursor: w-resize;
+}
+
+.vis-item.vis-range .vis-drag-right {
+ position: absolute;
+ width: 24px;
+ max-width: 20%;
+ min-width: 2px;
+ height: 100%;
+ top: 0;
+ right: -4px;
+
+ cursor: e-resize;
+}
+
+.vis-range.vis-item.vis-readonly .vis-drag-left,
+.vis-range.vis-item.vis-readonly .vis-drag-right {
+ cursor: auto;
+}
+
+.vis-time-axis {
+ position: relative;
+ overflow: hidden;
+}
+
+.vis-time-axis.vis-foreground {
+ top: 0;
+ left: 0;
+ width: 100%;
+}
+
+.vis-time-axis.vis-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.vis-time-axis .vis-text {
+ position: absolute;
+ color: #4d4d4d;
+ padding: 3px;
+ overflow: hidden;
+ box-sizing: border-box;
+
+ white-space: nowrap;
+}
+
+.vis-time-axis .vis-text.vis-measure {
+ position: absolute;
+ padding-left: 0;
+ padding-right: 0;
+ margin-left: 0;
+ margin-right: 0;
+ visibility: hidden;
+}
+
+.vis-time-axis .vis-grid.vis-vertical {
+ position: absolute;
+ border-left: 1px solid;
+}
+
+.vis-time-axis .vis-grid.vis-vertical-rtl {
+ position: absolute;
+ border-right: 1px solid;
+}
+
+.vis-time-axis .vis-grid.vis-minor {
+ border-color: #e5e5e5;
+}
+
+.vis-time-axis .vis-grid.vis-major {
+ border-color: #bfbfbf;
+}
+
+.vis-current-time {
+ background-color: #FF7F6E;
+ width: 2px;
+ z-index: 1;
+}
+.vis-custom-time {
+ background-color: #6E94FF;
+ width: 2px;
+ cursor: move;
+ z-index: 1;
+}
+.vis-timeline {
+ /*
+ -webkit-transition: height .4s ease-in-out;
+ transition: height .4s ease-in-out;
+ */
+}
+
+.vis-panel {
+ /*
+ -webkit-transition: height .4s ease-in-out, top .4s ease-in-out;
+ transition: height .4s ease-in-out, top .4s ease-in-out;
+ */
+}
+
+.vis-axis {
+ /*
+ -webkit-transition: top .4s ease-in-out;
+ transition: top .4s ease-in-out;
+ */
+}
+
+/* TODO: get animation working nicely
+
+.vis-item {
+ -webkit-transition: top .4s ease-in-out;
+ transition: top .4s ease-in-out;
+}
+
+.vis-item.line {
+ -webkit-transition: height .4s ease-in-out, top .4s ease-in-out;
+ transition: height .4s ease-in-out, top .4s ease-in-out;
+}
+/**/
+
+.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal {
+ position: absolute;
+ width: 100%;
+ height: 0;
+ border-bottom: 1px solid;
+}
+
+.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor {
+ border-color: #e5e5e5;
+}
+
+.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major {
+ border-color: #bfbfbf;
+}
+
+
+.vis-data-axis .vis-y-axis.vis-major {
+ width: 100%;
+ position: absolute;
+ color: #4d4d4d;
+ white-space: nowrap;
+}
+
+.vis-data-axis .vis-y-axis.vis-major.vis-measure {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ visibility: hidden;
+ width: auto;
+}
+
+
+.vis-data-axis .vis-y-axis.vis-minor {
+ position: absolute;
+ width: 100%;
+ color: #bebebe;
+ white-space: nowrap;
+}
+
+.vis-data-axis .vis-y-axis.vis-minor.vis-measure {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ visibility: hidden;
+ width: auto;
+}
+
+.vis-data-axis .vis-y-axis.vis-title {
+ position: absolute;
+ color: #4d4d4d;
+ white-space: nowrap;
+ bottom: 20px;
+ text-align: center;
+}
+
+.vis-data-axis .vis-y-axis.vis-title.vis-measure {
+ padding: 0;
+ margin: 0;
+ visibility: hidden;
+ width: auto;
+}
+
+.vis-data-axis .vis-y-axis.vis-title.vis-left {
+ bottom: 0;
+ -webkit-transform-origin: left top;
+ -moz-transform-origin: left top;
+ -ms-transform-origin: left top;
+ -o-transform-origin: left top;
+ transform-origin: left bottom;
+ -webkit-transform: rotate(-90deg);
+ -moz-transform: rotate(-90deg);
+ -ms-transform: rotate(-90deg);
+ -o-transform: rotate(-90deg);
+ transform: rotate(-90deg);
+}
+
+.vis-data-axis .vis-y-axis.vis-title.vis-right {
+ bottom: 0;
+ -webkit-transform-origin: right bottom;
+ -moz-transform-origin: right bottom;
+ -ms-transform-origin: right bottom;
+ -o-transform-origin: right bottom;
+ transform-origin: right bottom;
+ -webkit-transform: rotate(90deg);
+ -moz-transform: rotate(90deg);
+ -ms-transform: rotate(90deg);
+ -o-transform: rotate(90deg);
+ transform: rotate(90deg);
+}
+
+.vis-legend {
+ background-color: rgba(247, 252, 255, 0.65);
+ padding: 5px;
+ border: 1px solid #b3b3b3;
+ box-shadow: 2px 2px 10px rgba(154, 154, 154, 0.55);
+}
+
+.vis-legend-text {
+ /*font-size: 10px;*/
+ white-space: nowrap;
+ display: inline-block
+}
+.vis-graph-group0 {
+ fill:#4f81bd;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #4f81bd;
+}
+
+.vis-graph-group1 {
+ fill:#f79646;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #f79646;
+}
+
+.vis-graph-group2 {
+ fill: #8c51cf;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #8c51cf;
+}
+
+.vis-graph-group3 {
+ fill: #75c841;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #75c841;
+}
+
+.vis-graph-group4 {
+ fill: #ff0100;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #ff0100;
+}
+
+.vis-graph-group5 {
+ fill: #37d8e6;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #37d8e6;
+}
+
+.vis-graph-group6 {
+ fill: #042662;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #042662;
+}
+
+.vis-graph-group7 {
+ fill:#00ff26;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #00ff26;
+}
+
+.vis-graph-group8 {
+ fill:#ff00ff;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #ff00ff;
+}
+
+.vis-graph-group9 {
+ fill: #8f3938;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #8f3938;
+}
+
+.vis-timeline .vis-fill {
+ fill-opacity:0.1;
+ stroke: none;
+}
+
+
+.vis-timeline .vis-bar {
+ fill-opacity:0.5;
+ stroke-width:1px;
+}
+
+.vis-timeline .vis-point {
+ stroke-width:2px;
+ fill-opacity:1.0;
+}
+
+
+.vis-timeline .vis-legend-background {
+ stroke-width:1px;
+ fill-opacity:0.9;
+ fill: #ffffff;
+ stroke: #c2c2c2;
+}
+
+
+.vis-timeline .vis-outline {
+ stroke-width:1px;
+ fill-opacity:1;
+ fill: #ffffff;
+ stroke: #e5e5e5;
+}
+
+.vis-timeline .vis-icon-fill {
+ fill-opacity:0.3;
+ stroke: none;
+}
+
+div.vis-network div.vis-manipulation {
+ border-width: 0;
+ border-bottom: 1px;
+ border-style:solid;
+ border-color: #d6d9d8;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #fcfcfc 48%, #fafafa 50%, #fcfcfc 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(48%,#fcfcfc), color-stop(50%,#fafafa), color-stop(100%,#fcfcfc)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc',GradientType=0 ); /* IE6-9 */
+
+ padding-top:4px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 28px;
+}
+
+div.vis-network div.vis-edit-mode {
+ position:absolute;
+ left: 0;
+ top: 5px;
+ height: 30px;
+}
+
+/* FIXME: shouldn't the vis-close button be a child of the vis-manipulation div? */
+
+div.vis-network div.vis-close {
+ position:absolute;
+ right: 0;
+ top: 0;
+ width: 30px;
+ height: 30px;
+
+ background-position: 20px 3px;
+ background-repeat: no-repeat;
+ background-image: url("img/network/cross.png");
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+div.vis-network div.vis-close:hover {
+ opacity: 0.6;
+}
+
+div.vis-network div.vis-manipulation div.vis-button,
+div.vis-network div.vis-edit-mode div.vis-button {
+ float:left;
+ font-family: verdana;
+ font-size: 12px;
+ -moz-border-radius: 15px;
+ border-radius: 15px;
+ display:inline-block;
+ background-position: 0px 0px;
+ background-repeat:no-repeat;
+ height:24px;
+ margin-left: 10px;
+ /*vertical-align:middle;*/
+ cursor: pointer;
+ padding: 0px 8px 0px 8px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+div.vis-network div.vis-manipulation div.vis-button:hover {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.20);
+}
+
+div.vis-network div.vis-manipulation div.vis-button:active {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.50);
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-back {
+ background-image: url("img/network/backIcon.png");
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-none:hover {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.0);
+ cursor: default;
+}
+div.vis-network div.vis-manipulation div.vis-button.vis-none:active {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.0);
+}
+div.vis-network div.vis-manipulation div.vis-button.vis-none {
+ padding: 0;
+}
+div.vis-network div.vis-manipulation div.notification {
+ margin: 2px;
+ font-weight: bold;
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-add {
+ background-image: url("img/network/addNodeIcon.png");
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-edit,
+div.vis-network div.vis-edit-mode div.vis-button.vis-edit {
+ background-image: url("img/network/editIcon.png");
+}
+
+div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode {
+ background-color: #fcfcfc;
+ border: 1px solid #cccccc;
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-connect {
+ background-image: url("img/network/connectIcon.png");
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-delete {
+ background-image: url("img/network/deleteIcon.png");
+}
+/* top right bottom left */
+div.vis-network div.vis-manipulation div.vis-label,
+div.vis-network div.vis-edit-mode div.vis-label {
+ margin: 0 0 0 23px;
+ line-height: 25px;
+}
+div.vis-network div.vis-manipulation div.vis-separator-line {
+ float:left;
+ display:inline-block;
+ width:1px;
+ height:21px;
+ background-color: #bdbdbd;
+ margin: 0px 7px 0 15px; /*top right bottom left*/
+}
+
+/* TODO: is this redundant?
+div.network-navigation_wrapper {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
+*/
+div.vis-network-tooltip {
+ position: absolute;
+ visibility: hidden;
+ padding: 5px;
+ white-space: nowrap;
+
+ font-family: verdana;
+ font-size:14px;
+ color:#000000;
+ background-color: #f5f4ed;
+
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ border: 1px solid #808074;
+
+ box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
+ pointer-events: none;
+}
+div.vis-network div.vis-navigation div.vis-button {
+ width:34px;
+ height:34px;
+ -moz-border-radius: 17px;
+ border-radius: 17px;
+ position:absolute;
+ display:inline-block;
+ background-position: 2px 2px;
+ background-repeat:no-repeat;
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+div.vis-network div.vis-navigation div.vis-button:hover {
+ box-shadow: 0 0 3px 3px rgba(56, 207, 21, 0.30);
+}
+
+div.vis-network div.vis-navigation div.vis-button:active {
+ box-shadow: 0 0 1px 3px rgba(56, 207, 21, 0.95);
+}
+
+div.vis-network div.vis-navigation div.vis-button.vis-up {
+ background-image: url("img/network/upArrow.png");
+ bottom:50px;
+ left:55px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-down {
+ background-image: url("img/network/downArrow.png");
+ bottom:10px;
+ left:55px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-left {
+ background-image: url("img/network/leftArrow.png");
+ bottom:10px;
+ left:15px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-right {
+ background-image: url("img/network/rightArrow.png");
+ bottom:10px;
+ left:95px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-zoomIn {
+ background-image: url("img/network/plus.png");
+ bottom:10px;
+ right:15px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-zoomOut {
+ background-image: url("img/network/minus.png");
+ bottom:10px;
+ right:55px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
+ background-image: url("img/network/zoomExtends.png");
+ bottom:50px;
+ right:15px;
+}
+
+div.vis-color-picker {
+ position:absolute;
+ top: 0px;
+ left: 30px;
+ margin-top:-140px;
+ margin-left:30px;
+ width:310px;
+ height:444px;
+ z-index: 1;
+ padding: 10px;
+ border-radius:15px;
+ background-color:#ffffff;
+ display: none;
+ box-shadow: rgba(0,0,0,0.5) 0px 0px 10px 0px;
+}
+
+div.vis-color-picker div.vis-arrow {
+ position: absolute;
+ top:147px;
+ left:5px;
+}
+
+div.vis-color-picker div.vis-arrow::after,
+div.vis-color-picker div.vis-arrow::before {
+ right: 100%;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+
+div.vis-color-picker div.vis-arrow:after {
+ border-color: rgba(255, 255, 255, 0);
+ border-right-color: #ffffff;
+ border-width: 30px;
+ margin-top: -30px;
+}
+
+div.vis-color-picker div.vis-color {
+ position:absolute;
+ width: 289px;
+ height: 289px;
+ cursor: pointer;
+}
+
+
+
+div.vis-color-picker div.vis-brightness {
+ position: absolute;
+ top:313px;
+}
+
+div.vis-color-picker div.vis-opacity {
+ position:absolute;
+ top:350px;
+}
+
+div.vis-color-picker div.vis-selector {
+ position:absolute;
+ top:137px;
+ left:137px;
+ width:15px;
+ height:15px;
+ border-radius:15px;
+ border:1px solid #ffffff;
+ background: #4c4c4c; /* Old browsers */
+ background: -moz-linear-gradient(top, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(12%,#595959), color-stop(25%,#666666), color-stop(39%,#474747), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(60%,#111111), color-stop(76%,#2b2b2b), color-stop(91%,#1c1c1c), color-stop(100%,#131313)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313',GradientType=0 ); /* IE6-9 */
+}
+
+
+
+div.vis-color-picker div.vis-new-color {
+ position:absolute;
+ width:140px;
+ height:20px;
+ border:1px solid rgba(0,0,0,0.1);
+ border-radius:5px;
+ top:380px;
+ left:159px;
+ text-align:right;
+ padding-right:2px;
+ font-size:10px;
+ color:rgba(0,0,0,0.4);
+ vertical-align:middle;
+ line-height:20px;
+
+}
+
+div.vis-color-picker div.vis-initial-color {
+ position:absolute;
+ width:140px;
+ height:20px;
+ border:1px solid rgba(0,0,0,0.1);
+ border-radius:5px;
+ top:380px;
+ left:10px;
+ text-align:left;
+ padding-left:2px;
+ font-size:10px;
+ color:rgba(0,0,0,0.4);
+ vertical-align:middle;
+ line-height:20px;
+}
+
+div.vis-color-picker div.vis-label {
+ position:absolute;
+ width:300px;
+ left:10px;
+}
+
+div.vis-color-picker div.vis-label.vis-brightness {
+ top:300px;
+}
+
+div.vis-color-picker div.vis-label.vis-opacity {
+ top:338px;
+}
+
+div.vis-color-picker div.vis-button {
+ position:absolute;
+ width:68px;
+ height:25px;
+ border-radius:10px;
+ vertical-align: middle;
+ text-align:center;
+ line-height: 25px;
+ top:410px;
+ border:2px solid #d9d9d9;
+ background-color: #f7f7f7;
+ cursor:pointer;
+}
+
+div.vis-color-picker div.vis-button.vis-cancel {
+ /*border:2px solid #ff4e33;*/
+ /*background-color: #ff7761;*/
+ left:5px;
+}
+div.vis-color-picker div.vis-button.vis-load {
+ /*border:2px solid #a153e6;*/
+ /*background-color: #cb8dff;*/
+ left:82px;
+}
+div.vis-color-picker div.vis-button.vis-apply {
+ /*border:2px solid #4588e6;*/
+ /*background-color: #82b6ff;*/
+ left:159px;
+}
+div.vis-color-picker div.vis-button.vis-save {
+ /*border:2px solid #45e655;*/
+ /*background-color: #6dff7c;*/
+ left:236px;
+}
+
+
+div.vis-color-picker input.vis-range {
+ width: 290px;
+ height:20px;
+}
+
+/* TODO: is this redundant?
+div.vis-color-picker input.vis-range-brightness {
+ width: 289px !important;
+}
+
+
+div.vis-color-picker input.vis-saturation-range {
+ width: 289px !important;
+}*/
\ No newline at end of file
--- /dev/null
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.16.1
+ * @date 2016-04-18
+ *
+ * @license
+ * Copyright (C) 2011-2016 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+
+"use strict";
+
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["vis"] = factory();
+ else
+ root["vis"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+
+ // Graph3d
+ util.extend(exports, __webpack_require__(7));
+
+ // Timeline & Graph2d
+ util.extend(exports, __webpack_require__(24));
+
+ // Network
+ util.extend(exports, __webpack_require__(60));
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ // utility functions
+
+ // first check if moment.js is already loaded in the browser window, if so,
+ // use this instance. Else, load via commonjs.
+
+ var moment = __webpack_require__(2);
+ var uuid = __webpack_require__(6);
+
+ /**
+ * Test whether given object is a number
+ * @param {*} object
+ * @return {Boolean} isNumber
+ */
+ exports.isNumber = function (object) {
+ return object instanceof Number || typeof object == 'number';
+ };
+
+ /**
+ * Remove everything in the DOM object
+ * @param DOMobject
+ */
+ exports.recursiveDOMDelete = function (DOMobject) {
+ if (DOMobject) {
+ while (DOMobject.hasChildNodes() === true) {
+ exports.recursiveDOMDelete(DOMobject.firstChild);
+ DOMobject.removeChild(DOMobject.firstChild);
+ }
+ }
+ };
+
+ /**
+ * this function gives you a range between 0 and 1 based on the min and max values in the set, the total sum of all values and the current value.
+ *
+ * @param min
+ * @param max
+ * @param total
+ * @param value
+ * @returns {number}
+ */
+ exports.giveRange = function (min, max, total, value) {
+ if (max == min) {
+ return 0.5;
+ } else {
+ var scale = 1 / (max - min);
+ return Math.max(0, (value - min) * scale);
+ }
+ };
+
+ /**
+ * Test whether given object is a string
+ * @param {*} object
+ * @return {Boolean} isString
+ */
+ exports.isString = function (object) {
+ return object instanceof String || typeof object == 'string';
+ };
+
+ /**
+ * Test whether given object is a Date, or a String containing a Date
+ * @param {Date | String} object
+ * @return {Boolean} isDate
+ */
+ exports.isDate = function (object) {
+ if (object instanceof Date) {
+ return true;
+ } else if (exports.isString(object)) {
+ // test whether this string contains a date
+ var match = ASPDateRegex.exec(object);
+ if (match) {
+ return true;
+ } else if (!isNaN(Date.parse(object))) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * Create a semi UUID
+ * source: http://stackoverflow.com/a/105074/1262753
+ * @return {String} uuid
+ */
+ exports.randomUUID = function () {
+ return uuid.v4();
+ };
+
+ /**
+ * assign all keys of an object that are not nested objects to a certain value (used for color objects).
+ * @param obj
+ * @param value
+ */
+ exports.assignAllKeys = function (obj, value) {
+ for (var prop in obj) {
+ if (obj.hasOwnProperty(prop)) {
+ if (_typeof(obj[prop]) !== 'object') {
+ obj[prop] = value;
+ }
+ }
+ }
+ };
+
+ /**
+ * Fill an object with a possibly partially defined other object. Only copies values if the a object has an object requiring values.
+ * That means an object is not created on a property if only the b object has it.
+ * @param obj
+ * @param value
+ */
+ exports.fillIfDefined = function (a, b) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ for (var prop in a) {
+ if (b[prop] !== undefined) {
+ if (_typeof(b[prop]) !== 'object') {
+ if ((b[prop] === undefined || b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ } else {
+ if (_typeof(a[prop]) === 'object') {
+ exports.fillIfDefined(a[prop], b[prop], allowDeletion);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Extend object a with the properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Object} a
+ * @param {... Object} b
+ * @return {Object} a
+ */
+ exports.protoExtend = function (a, b) {
+ for (var i = 1; i < arguments.length; i++) {
+ var other = arguments[i];
+ for (var prop in other) {
+ a[prop] = other[prop];
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with the properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Object} a
+ * @param {... Object} b
+ * @return {Object} a
+ */
+ exports.extend = function (a, b) {
+ for (var i = 1; i < arguments.length; i++) {
+ var other = arguments[i];
+ for (var prop in other) {
+ if (other.hasOwnProperty(prop)) {
+ a[prop] = other[prop];
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with selected properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Array.<String>} props
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ exports.selectiveExtend = function (props, a, b) {
+ if (!Array.isArray(props)) {
+ throw new Error('Array with property names expected as first argument');
+ }
+
+ for (var i = 2; i < arguments.length; i++) {
+ var other = arguments[i];
+
+ for (var p = 0; p < props.length; p++) {
+ var prop = props[p];
+ if (other.hasOwnProperty(prop)) {
+ a[prop] = other[prop];
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with selected properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Array.<String>} props
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ exports.selectiveDeepExtend = function (props, a, b) {
+ var allowDeletion = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ // TODO: add support for Arrays to deepExtend
+ if (Array.isArray(b)) {
+ throw new TypeError('Arrays are not supported by deepExtend');
+ }
+ for (var i = 2; i < arguments.length; i++) {
+ var other = arguments[i];
+ for (var p = 0; p < props.length; p++) {
+ var prop = props[p];
+ if (other.hasOwnProperty(prop)) {
+ if (b[prop] && b[prop].constructor === Object) {
+ if (a[prop] === undefined) {
+ a[prop] = {};
+ }
+ if (a[prop].constructor === Object) {
+ exports.deepExtend(a[prop], b[prop], false, allowDeletion);
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ } else if (Array.isArray(b[prop])) {
+ throw new TypeError('Arrays are not supported by deepExtend');
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with selected properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Array.<String>} props
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ exports.selectiveNotDeepExtend = function (props, a, b) {
+ var allowDeletion = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ // TODO: add support for Arrays to deepExtend
+ if (Array.isArray(b)) {
+ throw new TypeError('Arrays are not supported by deepExtend');
+ }
+ for (var prop in b) {
+ if (b.hasOwnProperty(prop)) {
+ if (props.indexOf(prop) == -1) {
+ if (b[prop] && b[prop].constructor === Object) {
+ if (a[prop] === undefined) {
+ a[prop] = {};
+ }
+ if (a[prop].constructor === Object) {
+ exports.deepExtend(a[prop], b[prop]);
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ } else if (Array.isArray(b[prop])) {
+ a[prop] = [];
+ for (var i = 0; i < b[prop].length; i++) {
+ a[prop].push(b[prop][i]);
+ }
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Deep extend an object a with the properties of object b
+ * @param {Object} a
+ * @param {Object} b
+ * @param [Boolean] protoExtend --> optional parameter. If true, the prototype values will also be extended.
+ * (ie. the options objects that inherit from others will also get the inherited options)
+ * @param [Boolean] global --> optional parameter. If true, the values of fields that are null will not deleted
+ * @returns {Object}
+ */
+ exports.deepExtend = function (a, b, protoExtend, allowDeletion) {
+ for (var prop in b) {
+ if (b.hasOwnProperty(prop) || protoExtend === true) {
+ if (b[prop] && b[prop].constructor === Object) {
+ if (a[prop] === undefined) {
+ a[prop] = {};
+ }
+ if (a[prop].constructor === Object) {
+ exports.deepExtend(a[prop], b[prop], protoExtend);
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ } else if (Array.isArray(b[prop])) {
+ a[prop] = [];
+ for (var i = 0; i < b[prop].length; i++) {
+ a[prop].push(b[prop][i]);
+ }
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Test whether all elements in two arrays are equal.
+ * @param {Array} a
+ * @param {Array} b
+ * @return {boolean} Returns true if both arrays have the same length and same
+ * elements.
+ */
+ exports.equalArray = function (a, b) {
+ if (a.length != b.length) return false;
+
+ for (var i = 0, len = a.length; i < len; i++) {
+ if (a[i] != b[i]) return false;
+ }
+
+ return true;
+ };
+
+ /**
+ * Convert an object to another type
+ * @param {Boolean | Number | String | Date | Moment | Null | undefined} object
+ * @param {String | undefined} type Name of the type. Available types:
+ * 'Boolean', 'Number', 'String',
+ * 'Date', 'Moment', ISODate', 'ASPDate'.
+ * @return {*} object
+ * @throws Error
+ */
+ exports.convert = function (object, type) {
+ var match;
+
+ if (object === undefined) {
+ return undefined;
+ }
+ if (object === null) {
+ return null;
+ }
+
+ if (!type) {
+ return object;
+ }
+ if (!(typeof type === 'string') && !(type instanceof String)) {
+ throw new Error('Type must be a string');
+ }
+
+ //noinspection FallthroughInSwitchStatementJS
+ switch (type) {
+ case 'boolean':
+ case 'Boolean':
+ return Boolean(object);
+
+ case 'number':
+ case 'Number':
+ return Number(object.valueOf());
+
+ case 'string':
+ case 'String':
+ return String(object);
+
+ case 'Date':
+ if (exports.isNumber(object)) {
+ return new Date(object);
+ }
+ if (object instanceof Date) {
+ return new Date(object.valueOf());
+ } else if (moment.isMoment(object)) {
+ return new Date(object.valueOf());
+ }
+ if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ if (match) {
+ // object is an ASP date
+ return new Date(Number(match[1])); // parse number
+ } else {
+ return moment(object).toDate(); // parse string
+ }
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type Date');
+ }
+
+ case 'Moment':
+ if (exports.isNumber(object)) {
+ return moment(object);
+ }
+ if (object instanceof Date) {
+ return moment(object.valueOf());
+ } else if (moment.isMoment(object)) {
+ return moment(object);
+ }
+ if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ if (match) {
+ // object is an ASP date
+ return moment(Number(match[1])); // parse number
+ } else {
+ return moment(object); // parse string
+ }
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type Date');
+ }
+
+ case 'ISODate':
+ if (exports.isNumber(object)) {
+ return new Date(object);
+ } else if (object instanceof Date) {
+ return object.toISOString();
+ } else if (moment.isMoment(object)) {
+ return object.toDate().toISOString();
+ } else if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ if (match) {
+ // object is an ASP date
+ return new Date(Number(match[1])).toISOString(); // parse number
+ } else {
+ return new Date(object).toISOString(); // parse string
+ }
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type ISODate');
+ }
+
+ case 'ASPDate':
+ if (exports.isNumber(object)) {
+ return '/Date(' + object + ')/';
+ } else if (object instanceof Date) {
+ return '/Date(' + object.valueOf() + ')/';
+ } else if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ var value;
+ if (match) {
+ // object is an ASP date
+ value = new Date(Number(match[1])).valueOf(); // parse number
+ } else {
+ value = new Date(object).valueOf(); // parse string
+ }
+ return '/Date(' + value + ')/';
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type ASPDate');
+ }
+
+ default:
+ throw new Error('Unknown type "' + type + '"');
+ }
+ };
+
+ // parse ASP.Net Date pattern,
+ // for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'
+ // code from http://momentjs.com/
+ var ASPDateRegex = /^\/?Date\((\-?\d+)/i;
+
+ /**
+ * Get the type of an object, for example exports.getType([]) returns 'Array'
+ * @param {*} object
+ * @return {String} type
+ */
+ exports.getType = function (object) {
+ var type = typeof object === 'undefined' ? 'undefined' : _typeof(object);
+
+ if (type == 'object') {
+ if (object === null) {
+ return 'null';
+ }
+ if (object instanceof Boolean) {
+ return 'Boolean';
+ }
+ if (object instanceof Number) {
+ return 'Number';
+ }
+ if (object instanceof String) {
+ return 'String';
+ }
+ if (Array.isArray(object)) {
+ return 'Array';
+ }
+ if (object instanceof Date) {
+ return 'Date';
+ }
+ return 'Object';
+ } else if (type == 'number') {
+ return 'Number';
+ } else if (type == 'boolean') {
+ return 'Boolean';
+ } else if (type == 'string') {
+ return 'String';
+ } else if (type === undefined) {
+ return 'undefined';
+ }
+
+ return type;
+ };
+
+ /**
+ * Used to extend an array and copy it. This is used to propagate paths recursively.
+ *
+ * @param arr
+ * @param newValue
+ * @returns {Array}
+ */
+ exports.copyAndExtendArray = function (arr, newValue) {
+ var newArr = [];
+ for (var i = 0; i < arr.length; i++) {
+ newArr.push(arr[i]);
+ }
+ newArr.push(newValue);
+ return newArr;
+ };
+
+ /**
+ * Used to extend an array and copy it. This is used to propagate paths recursively.
+ *
+ * @param arr
+ * @param newValue
+ * @returns {Array}
+ */
+ exports.copyArray = function (arr) {
+ var newArr = [];
+ for (var i = 0; i < arr.length; i++) {
+ newArr.push(arr[i]);
+ }
+ return newArr;
+ };
+
+ /**
+ * Retrieve the absolute left value of a DOM element
+ * @param {Element} elem A dom element, for example a div
+ * @return {number} left The absolute left position of this element
+ * in the browser page.
+ */
+ exports.getAbsoluteLeft = function (elem) {
+ return elem.getBoundingClientRect().left;
+ };
+
+ exports.getAbsoluteRight = function (elem) {
+ return elem.getBoundingClientRect().right;
+ };
+
+ /**
+ * Retrieve the absolute top value of a DOM element
+ * @param {Element} elem A dom element, for example a div
+ * @return {number} top The absolute top position of this element
+ * in the browser page.
+ */
+ exports.getAbsoluteTop = function (elem) {
+ return elem.getBoundingClientRect().top;
+ };
+
+ /**
+ * add a className to the given elements style
+ * @param {Element} elem
+ * @param {String} className
+ */
+ exports.addClassName = function (elem, className) {
+ var classes = elem.className.split(' ');
+ if (classes.indexOf(className) == -1) {
+ classes.push(className); // add the class to the array
+ elem.className = classes.join(' ');
+ }
+ };
+
+ /**
+ * add a className to the given elements style
+ * @param {Element} elem
+ * @param {String} className
+ */
+ exports.removeClassName = function (elem, className) {
+ var classes = elem.className.split(' ');
+ var index = classes.indexOf(className);
+ if (index != -1) {
+ classes.splice(index, 1); // remove the class from the array
+ elem.className = classes.join(' ');
+ }
+ };
+
+ /**
+ * For each method for both arrays and objects.
+ * In case of an array, the built-in Array.forEach() is applied.
+ * In case of an Object, the method loops over all properties of the object.
+ * @param {Object | Array} object An Object or Array
+ * @param {function} callback Callback method, called for each item in
+ * the object or array with three parameters:
+ * callback(value, index, object)
+ */
+ exports.forEach = function (object, callback) {
+ var i, len;
+ if (Array.isArray(object)) {
+ // array
+ for (i = 0, len = object.length; i < len; i++) {
+ callback(object[i], i, object);
+ }
+ } else {
+ // object
+ for (i in object) {
+ if (object.hasOwnProperty(i)) {
+ callback(object[i], i, object);
+ }
+ }
+ }
+ };
+
+ /**
+ * Convert an object into an array: all objects properties are put into the
+ * array. The resulting array is unordered.
+ * @param {Object} object
+ * @param {Array} array
+ */
+ exports.toArray = function (object) {
+ var array = [];
+
+ for (var prop in object) {
+ if (object.hasOwnProperty(prop)) array.push(object[prop]);
+ }
+
+ return array;
+ };
+
+ /**
+ * Update a property in an object
+ * @param {Object} object
+ * @param {String} key
+ * @param {*} value
+ * @return {Boolean} changed
+ */
+ exports.updateProperty = function (object, key, value) {
+ if (object[key] !== value) {
+ object[key] = value;
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ /**
+ * Throttle the given function to be only executed once every `wait` milliseconds
+ * @param {function} fn
+ * @param {number} wait Time in milliseconds
+ * @returns {function} Returns the throttled function
+ */
+ exports.throttle = function (fn, wait) {
+ var timeout = null;
+ var needExecution = false;
+
+ return function throttled() {
+ if (!timeout) {
+ needExecution = false;
+ fn();
+
+ timeout = setTimeout(function () {
+ timeout = null;
+ if (needExecution) {
+ throttled();
+ }
+ }, wait);
+ } else {
+ needExecution = true;
+ }
+ };
+ };
+
+ /**
+ * Add and event listener. Works for all browsers
+ * @param {Element} element An html element
+ * @param {string} action The action, for example "click",
+ * without the prefix "on"
+ * @param {function} listener The callback function to be executed
+ * @param {boolean} [useCapture]
+ */
+ exports.addEventListener = function (element, action, listener, useCapture) {
+ if (element.addEventListener) {
+ if (useCapture === undefined) useCapture = false;
+
+ if (action === "mousewheel" && navigator.userAgent.indexOf("Firefox") >= 0) {
+ action = "DOMMouseScroll"; // For Firefox
+ }
+
+ element.addEventListener(action, listener, useCapture);
+ } else {
+ element.attachEvent("on" + action, listener); // IE browsers
+ }
+ };
+
+ /**
+ * Remove an event listener from an element
+ * @param {Element} element An html dom element
+ * @param {string} action The name of the event, for example "mousedown"
+ * @param {function} listener The listener function
+ * @param {boolean} [useCapture]
+ */
+ exports.removeEventListener = function (element, action, listener, useCapture) {
+ if (element.removeEventListener) {
+ // non-IE browsers
+ if (useCapture === undefined) useCapture = false;
+
+ if (action === "mousewheel" && navigator.userAgent.indexOf("Firefox") >= 0) {
+ action = "DOMMouseScroll"; // For Firefox
+ }
+
+ element.removeEventListener(action, listener, useCapture);
+ } else {
+ // IE browsers
+ element.detachEvent("on" + action, listener);
+ }
+ };
+
+ /**
+ * Cancels the event if it is cancelable, without stopping further propagation of the event.
+ */
+ exports.preventDefault = function (event) {
+ if (!event) event = window.event;
+
+ if (event.preventDefault) {
+ event.preventDefault(); // non-IE browsers
+ } else {
+ event.returnValue = false; // IE browsers
+ }
+ };
+
+ /**
+ * Get HTML element which is the target of the event
+ * @param {Event} event
+ * @return {Element} target element
+ */
+ exports.getTarget = function (event) {
+ // code from http://www.quirksmode.org/js/events_properties.html
+ if (!event) {
+ event = window.event;
+ }
+
+ var target;
+
+ if (event.target) {
+ target = event.target;
+ } else if (event.srcElement) {
+ target = event.srcElement;
+ }
+
+ if (target.nodeType != undefined && target.nodeType == 3) {
+ // defeat Safari bug
+ target = target.parentNode;
+ }
+
+ return target;
+ };
+
+ /**
+ * Check if given element contains given parent somewhere in the DOM tree
+ * @param {Element} element
+ * @param {Element} parent
+ */
+ exports.hasParent = function (element, parent) {
+ var e = element;
+
+ while (e) {
+ if (e === parent) {
+ return true;
+ }
+ e = e.parentNode;
+ }
+
+ return false;
+ };
+
+ exports.option = {};
+
+ /**
+ * Convert a value into a boolean
+ * @param {Boolean | function | undefined} value
+ * @param {Boolean} [defaultValue]
+ * @returns {Boolean} bool
+ */
+ exports.option.asBoolean = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (value != null) {
+ return value != false;
+ }
+
+ return defaultValue || null;
+ };
+
+ /**
+ * Convert a value into a number
+ * @param {Boolean | function | undefined} value
+ * @param {Number} [defaultValue]
+ * @returns {Number} number
+ */
+ exports.option.asNumber = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (value != null) {
+ return Number(value) || defaultValue || null;
+ }
+
+ return defaultValue || null;
+ };
+
+ /**
+ * Convert a value into a string
+ * @param {String | function | undefined} value
+ * @param {String} [defaultValue]
+ * @returns {String} str
+ */
+ exports.option.asString = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (value != null) {
+ return String(value);
+ }
+
+ return defaultValue || null;
+ };
+
+ /**
+ * Convert a size or location into a string with pixels or a percentage
+ * @param {String | Number | function | undefined} value
+ * @param {String} [defaultValue]
+ * @returns {String} size
+ */
+ exports.option.asSize = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (exports.isString(value)) {
+ return value;
+ } else if (exports.isNumber(value)) {
+ return value + 'px';
+ } else {
+ return defaultValue || null;
+ }
+ };
+
+ /**
+ * Convert a value into a DOM element
+ * @param {HTMLElement | function | undefined} value
+ * @param {HTMLElement} [defaultValue]
+ * @returns {HTMLElement | null} dom
+ */
+ exports.option.asElement = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ return value || defaultValue || null;
+ };
+
+ /**
+ * http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
+ *
+ * @param {String} hex
+ * @returns {{r: *, g: *, b: *}} | 255 range
+ */
+ exports.hexToRGB = function (hex) {
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
+ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
+ hex = hex.replace(shorthandRegex, function (m, r, g, b) {
+ return r + r + g + g + b + b;
+ });
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
+ return result ? {
+ r: parseInt(result[1], 16),
+ g: parseInt(result[2], 16),
+ b: parseInt(result[3], 16)
+ } : null;
+ };
+
+ /**
+ * This function takes color in hex format or rgb() or rgba() format and overrides the opacity. Returns rgba() string.
+ * @param color
+ * @param opacity
+ * @returns {*}
+ */
+ exports.overrideOpacity = function (color, opacity) {
+ if (color.indexOf("rgba") != -1) {
+ return color;
+ } else if (color.indexOf("rgb") != -1) {
+ var rgb = color.substr(color.indexOf("(") + 1).replace(")", "").split(",");
+ return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + opacity + ")";
+ } else {
+ var rgb = exports.hexToRGB(color);
+ if (rgb == null) {
+ return color;
+ } else {
+ return "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + opacity + ")";
+ }
+ }
+ };
+
+ /**
+ *
+ * @param red 0 -- 255
+ * @param green 0 -- 255
+ * @param blue 0 -- 255
+ * @returns {string}
+ * @constructor
+ */
+ exports.RGBToHex = function (red, green, blue) {
+ return "#" + ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1);
+ };
+
+ /**
+ * Parse a color property into an object with border, background, and
+ * highlight colors
+ * @param {Object | String} color
+ * @return {Object} colorObject
+ */
+ exports.parseColor = function (color) {
+ var c;
+ if (exports.isString(color) === true) {
+ if (exports.isValidRGB(color) === true) {
+ var rgb = color.substr(4).substr(0, color.length - 5).split(',').map(function (value) {
+ return parseInt(value);
+ });
+ color = exports.RGBToHex(rgb[0], rgb[1], rgb[2]);
+ }
+ if (exports.isValidHex(color) === true) {
+ var hsv = exports.hexToHSV(color);
+ var lighterColorHSV = { h: hsv.h, s: hsv.s * 0.8, v: Math.min(1, hsv.v * 1.02) };
+ var darkerColorHSV = { h: hsv.h, s: Math.min(1, hsv.s * 1.25), v: hsv.v * 0.8 };
+ var darkerColorHex = exports.HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);
+ var lighterColorHex = exports.HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);
+ c = {
+ background: color,
+ border: darkerColorHex,
+ highlight: {
+ background: lighterColorHex,
+ border: darkerColorHex
+ },
+ hover: {
+ background: lighterColorHex,
+ border: darkerColorHex
+ }
+ };
+ } else {
+ c = {
+ background: color,
+ border: color,
+ highlight: {
+ background: color,
+ border: color
+ },
+ hover: {
+ background: color,
+ border: color
+ }
+ };
+ }
+ } else {
+ c = {};
+ c.background = color.background || undefined;
+ c.border = color.border || undefined;
+
+ if (exports.isString(color.highlight)) {
+ c.highlight = {
+ border: color.highlight,
+ background: color.highlight
+ };
+ } else {
+ c.highlight = {};
+ c.highlight.background = color.highlight && color.highlight.background || undefined;
+ c.highlight.border = color.highlight && color.highlight.border || undefined;
+ }
+
+ if (exports.isString(color.hover)) {
+ c.hover = {
+ border: color.hover,
+ background: color.hover
+ };
+ } else {
+ c.hover = {};
+ c.hover.background = color.hover && color.hover.background || undefined;
+ c.hover.border = color.hover && color.hover.border || undefined;
+ }
+ }
+
+ return c;
+ };
+
+ /**
+ * http://www.javascripter.net/faq/rgb2hsv.htm
+ *
+ * @param red
+ * @param green
+ * @param blue
+ * @returns {*}
+ * @constructor
+ */
+ exports.RGBToHSV = function (red, green, blue) {
+ red = red / 255;green = green / 255;blue = blue / 255;
+ var minRGB = Math.min(red, Math.min(green, blue));
+ var maxRGB = Math.max(red, Math.max(green, blue));
+
+ // Black-gray-white
+ if (minRGB == maxRGB) {
+ return { h: 0, s: 0, v: minRGB };
+ }
+
+ // Colors other than black-gray-white:
+ var d = red == minRGB ? green - blue : blue == minRGB ? red - green : blue - red;
+ var h = red == minRGB ? 3 : blue == minRGB ? 1 : 5;
+ var hue = 60 * (h - d / (maxRGB - minRGB)) / 360;
+ var saturation = (maxRGB - minRGB) / maxRGB;
+ var value = maxRGB;
+ return { h: hue, s: saturation, v: value };
+ };
+
+ var cssUtil = {
+ // split a string with css styles into an object with key/values
+ split: function split(cssText) {
+ var styles = {};
+
+ cssText.split(';').forEach(function (style) {
+ if (style.trim() != '') {
+ var parts = style.split(':');
+ var key = parts[0].trim();
+ var value = parts[1].trim();
+ styles[key] = value;
+ }
+ });
+
+ return styles;
+ },
+
+ // build a css text string from an object with key/values
+ join: function join(styles) {
+ return Object.keys(styles).map(function (key) {
+ return key + ': ' + styles[key];
+ }).join('; ');
+ }
+ };
+
+ /**
+ * Append a string with css styles to an element
+ * @param {Element} element
+ * @param {String} cssText
+ */
+ exports.addCssText = function (element, cssText) {
+ var currentStyles = cssUtil.split(element.style.cssText);
+ var newStyles = cssUtil.split(cssText);
+ var styles = exports.extend(currentStyles, newStyles);
+
+ element.style.cssText = cssUtil.join(styles);
+ };
+
+ /**
+ * Remove a string with css styles from an element
+ * @param {Element} element
+ * @param {String} cssText
+ */
+ exports.removeCssText = function (element, cssText) {
+ var styles = cssUtil.split(element.style.cssText);
+ var removeStyles = cssUtil.split(cssText);
+
+ for (var key in removeStyles) {
+ if (removeStyles.hasOwnProperty(key)) {
+ delete styles[key];
+ }
+ }
+
+ element.style.cssText = cssUtil.join(styles);
+ };
+
+ /**
+ * https://gist.github.com/mjijackson/5311256
+ * @param h
+ * @param s
+ * @param v
+ * @returns {{r: number, g: number, b: number}}
+ * @constructor
+ */
+ exports.HSVToRGB = function (h, s, v) {
+ var r, g, b;
+
+ var i = Math.floor(h * 6);
+ var f = h * 6 - i;
+ var p = v * (1 - s);
+ var q = v * (1 - f * s);
+ var t = v * (1 - (1 - f) * s);
+
+ switch (i % 6) {
+ case 0:
+ r = v, g = t, b = p;break;
+ case 1:
+ r = q, g = v, b = p;break;
+ case 2:
+ r = p, g = v, b = t;break;
+ case 3:
+ r = p, g = q, b = v;break;
+ case 4:
+ r = t, g = p, b = v;break;
+ case 5:
+ r = v, g = p, b = q;break;
+ }
+
+ return { r: Math.floor(r * 255), g: Math.floor(g * 255), b: Math.floor(b * 255) };
+ };
+
+ exports.HSVToHex = function (h, s, v) {
+ var rgb = exports.HSVToRGB(h, s, v);
+ return exports.RGBToHex(rgb.r, rgb.g, rgb.b);
+ };
+
+ exports.hexToHSV = function (hex) {
+ var rgb = exports.hexToRGB(hex);
+ return exports.RGBToHSV(rgb.r, rgb.g, rgb.b);
+ };
+
+ exports.isValidHex = function (hex) {
+ var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);
+ return isOk;
+ };
+
+ exports.isValidRGB = function (rgb) {
+ rgb = rgb.replace(" ", "");
+ var isOk = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(rgb);
+ return isOk;
+ };
+ exports.isValidRGBA = function (rgba) {
+ rgba = rgba.replace(" ", "");
+ var isOk = /rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(rgba);
+ return isOk;
+ };
+
+ /**
+ * This recursively redirects the prototype of JSON objects to the referenceObject
+ * This is used for default options.
+ *
+ * @param referenceObject
+ * @returns {*}
+ */
+ exports.selectiveBridgeObject = function (fields, referenceObject) {
+ if ((typeof referenceObject === 'undefined' ? 'undefined' : _typeof(referenceObject)) == "object") {
+ var objectTo = Object.create(referenceObject);
+ for (var i = 0; i < fields.length; i++) {
+ if (referenceObject.hasOwnProperty(fields[i])) {
+ if (_typeof(referenceObject[fields[i]]) == "object") {
+ objectTo[fields[i]] = exports.bridgeObject(referenceObject[fields[i]]);
+ }
+ }
+ }
+ return objectTo;
+ } else {
+ return null;
+ }
+ };
+
+ /**
+ * This recursively redirects the prototype of JSON objects to the referenceObject
+ * This is used for default options.
+ *
+ * @param referenceObject
+ * @returns {*}
+ */
+ exports.bridgeObject = function (referenceObject) {
+ if ((typeof referenceObject === 'undefined' ? 'undefined' : _typeof(referenceObject)) == "object") {
+ var objectTo = Object.create(referenceObject);
+ for (var i in referenceObject) {
+ if (referenceObject.hasOwnProperty(i)) {
+ if (_typeof(referenceObject[i]) == "object") {
+ objectTo[i] = exports.bridgeObject(referenceObject[i]);
+ }
+ }
+ }
+ return objectTo;
+ } else {
+ return null;
+ }
+ };
+
+ /**
+ * This method provides a stable sort implementation, very fast for presorted data
+ *
+ * @param a the array
+ * @param a order comparator
+ * @returns {the array}
+ */
+ exports.insertSort = function (a, compare) {
+ for (var i = 0; i < a.length; i++) {
+ var k = a[i];
+ for (var j = i; j > 0 && compare(k, a[j - 1]) < 0; j--) {
+ a[j] = a[j - 1];
+ }
+ a[j] = k;
+ }
+ return a;
+ };
+
+ /**
+ * this is used to set the options of subobjects in the options object. A requirement of these subobjects
+ * is that they have an 'enabled' element which is optional for the user but mandatory for the program.
+ *
+ * @param [object] mergeTarget | this is either this.options or the options used for the groups.
+ * @param [object] options | options
+ * @param [String] option | this is the option key in the options argument
+ */
+ exports.mergeOptions = function (mergeTarget, options, option) {
+ var allowDeletion = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+ var globalOptions = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4];
+
+ if (options[option] === null) {
+ mergeTarget[option] = Object.create(globalOptions[option]);
+ } else {
+ if (options[option] !== undefined) {
+ if (typeof options[option] === 'boolean') {
+ mergeTarget[option].enabled = options[option];
+ } else {
+ if (options[option].enabled === undefined) {
+ mergeTarget[option].enabled = true;
+ }
+ for (var prop in options[option]) {
+ if (options[option].hasOwnProperty(prop)) {
+ mergeTarget[option][prop] = options[option][prop];
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses
+ * this function will then iterate in both directions over this sorted list to find all visible items.
+ *
+ * @param {Item[]} orderedItems | Items ordered by start
+ * @param {function} comparator | -1 is lower, 0 is equal, 1 is higher
+ * @param {String} field
+ * @param {String} field2
+ * @returns {number}
+ * @private
+ */
+ exports.binarySearchCustom = function (orderedItems, comparator, field, field2) {
+ var maxIterations = 10000;
+ var iteration = 0;
+ var low = 0;
+ var high = orderedItems.length - 1;
+
+ while (low <= high && iteration < maxIterations) {
+ var middle = Math.floor((low + high) / 2);
+
+ var item = orderedItems[middle];
+ var value = field2 === undefined ? item[field] : item[field][field2];
+
+ var searchResult = comparator(value);
+ if (searchResult == 0) {
+ // jihaa, found a visible item!
+ return middle;
+ } else if (searchResult == -1) {
+ // it is too small --> increase low
+ low = middle + 1;
+ } else {
+ // it is too big --> decrease high
+ high = middle - 1;
+ }
+
+ iteration++;
+ }
+
+ return -1;
+ };
+
+ /**
+ * This function does a binary search for a specific value in a sorted array. If it does not exist but is in between of
+ * two values, we return either the one before or the one after, depending on user input
+ * If it is found, we return the index, else -1.
+ *
+ * @param {Array} orderedItems
+ * @param {{start: number, end: number}} target
+ * @param {String} field
+ * @param {String} sidePreference 'before' or 'after'
+ * @param {function} comparator an optional comparator, returning -1,0,1 for <,==,>.
+ * @returns {number}
+ * @private
+ */
+ exports.binarySearchValue = function (orderedItems, target, field, sidePreference, comparator) {
+ var maxIterations = 10000;
+ var iteration = 0;
+ var low = 0;
+ var high = orderedItems.length - 1;
+ var prevValue, value, nextValue, middle;
+
+ var comparator = comparator != undefined ? comparator : function (a, b) {
+ return a == b ? 0 : a < b ? -1 : 1;
+ };
+
+ while (low <= high && iteration < maxIterations) {
+ // get a new guess
+ middle = Math.floor(0.5 * (high + low));
+ prevValue = orderedItems[Math.max(0, middle - 1)][field];
+ value = orderedItems[middle][field];
+ nextValue = orderedItems[Math.min(orderedItems.length - 1, middle + 1)][field];
+
+ if (comparator(value, target) == 0) {
+ // we found the target
+ return middle;
+ } else if (comparator(prevValue, target) < 0 && comparator(value, target) > 0) {
+ // target is in between of the previous and the current
+ return sidePreference == 'before' ? Math.max(0, middle - 1) : middle;
+ } else if (comparator(value, target) < 0 && comparator(nextValue, target) > 0) {
+ // target is in between of the current and the next
+ return sidePreference == 'before' ? middle : Math.min(orderedItems.length - 1, middle + 1);
+ } else {
+ // didnt find the target, we need to change our boundaries.
+ if (comparator(value, target) < 0) {
+ // it is too small --> increase low
+ low = middle + 1;
+ } else {
+ // it is too big --> decrease high
+ high = middle - 1;
+ }
+ }
+ iteration++;
+ }
+
+ // didnt find anything. Return -1.
+ return -1;
+ };
+
+ /*
+ * Easing Functions - inspired from http://gizma.com/easing/
+ * only considering the t value for the range [0, 1] => [0, 1]
+ * https://gist.github.com/gre/1650294
+ */
+ exports.easingFunctions = {
+ // no easing, no acceleration
+ linear: function linear(t) {
+ return t;
+ },
+ // accelerating from zero velocity
+ easeInQuad: function easeInQuad(t) {
+ return t * t;
+ },
+ // decelerating to zero velocity
+ easeOutQuad: function easeOutQuad(t) {
+ return t * (2 - t);
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutQuad: function easeInOutQuad(t) {
+ return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
+ },
+ // accelerating from zero velocity
+ easeInCubic: function easeInCubic(t) {
+ return t * t * t;
+ },
+ // decelerating to zero velocity
+ easeOutCubic: function easeOutCubic(t) {
+ return --t * t * t + 1;
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutCubic: function easeInOutCubic(t) {
+ return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
+ },
+ // accelerating from zero velocity
+ easeInQuart: function easeInQuart(t) {
+ return t * t * t * t;
+ },
+ // decelerating to zero velocity
+ easeOutQuart: function easeOutQuart(t) {
+ return 1 - --t * t * t * t;
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutQuart: function easeInOutQuart(t) {
+ return t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
+ },
+ // accelerating from zero velocity
+ easeInQuint: function easeInQuint(t) {
+ return t * t * t * t * t;
+ },
+ // decelerating to zero velocity
+ easeOutQuint: function easeOutQuint(t) {
+ return 1 + --t * t * t * t * t;
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutQuint: function easeInOutQuint(t) {
+ return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
+ }
+ };
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ // first check if moment.js is already loaded in the browser window, if so,
+ // use this instance. Else, load via commonjs.
+ module.exports = typeof window !== 'undefined' && window['moment'] || __webpack_require__(3);
+
+/***/ },
+/* 3 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(module) {//! moment.js
+ //! version : 2.13.0
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+ //! license : MIT
+ //! momentjs.com
+
+ ;(function (global, factory) {
+ true ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ global.moment = factory()
+ }(this, function () { 'use strict';
+
+ var hookCallback;
+
+ function utils_hooks__hooks () {
+ return hookCallback.apply(null, arguments);
+ }
+
+ // This is done to register the method called with moment()
+ // without creating circular dependencies.
+ function setHookCallback (callback) {
+ hookCallback = callback;
+ }
+
+ function isArray(input) {
+ return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
+ }
+
+ function isDate(input) {
+ return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
+ }
+
+ function map(arr, fn) {
+ var res = [], i;
+ for (i = 0; i < arr.length; ++i) {
+ res.push(fn(arr[i], i));
+ }
+ return res;
+ }
+
+ function hasOwnProp(a, b) {
+ return Object.prototype.hasOwnProperty.call(a, b);
+ }
+
+ function extend(a, b) {
+ for (var i in b) {
+ if (hasOwnProp(b, i)) {
+ a[i] = b[i];
+ }
+ }
+
+ if (hasOwnProp(b, 'toString')) {
+ a.toString = b.toString;
+ }
+
+ if (hasOwnProp(b, 'valueOf')) {
+ a.valueOf = b.valueOf;
+ }
+
+ return a;
+ }
+
+ function create_utc__createUTC (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, true).utc();
+ }
+
+ function defaultParsingFlags() {
+ // We need to deep clone this object.
+ return {
+ empty : false,
+ unusedTokens : [],
+ unusedInput : [],
+ overflow : -2,
+ charsLeftOver : 0,
+ nullInput : false,
+ invalidMonth : null,
+ invalidFormat : false,
+ userInvalidated : false,
+ iso : false,
+ parsedDateParts : [],
+ meridiem : null
+ };
+ }
+
+ function getParsingFlags(m) {
+ if (m._pf == null) {
+ m._pf = defaultParsingFlags();
+ }
+ return m._pf;
+ }
+
+ var some;
+ if (Array.prototype.some) {
+ some = Array.prototype.some;
+ } else {
+ some = function (fun) {
+ var t = Object(this);
+ var len = t.length >>> 0;
+
+ for (var i = 0; i < len; i++) {
+ if (i in t && fun.call(this, t[i], i, t)) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+ }
+
+ function valid__isValid(m) {
+ if (m._isValid == null) {
+ var flags = getParsingFlags(m);
+ var parsedParts = some.call(flags.parsedDateParts, function (i) {
+ return i != null;
+ });
+ m._isValid = !isNaN(m._d.getTime()) &&
+ flags.overflow < 0 &&
+ !flags.empty &&
+ !flags.invalidMonth &&
+ !flags.invalidWeekday &&
+ !flags.nullInput &&
+ !flags.invalidFormat &&
+ !flags.userInvalidated &&
+ (!flags.meridiem || (flags.meridiem && parsedParts));
+
+ if (m._strict) {
+ m._isValid = m._isValid &&
+ flags.charsLeftOver === 0 &&
+ flags.unusedTokens.length === 0 &&
+ flags.bigHour === undefined;
+ }
+ }
+ return m._isValid;
+ }
+
+ function valid__createInvalid (flags) {
+ var m = create_utc__createUTC(NaN);
+ if (flags != null) {
+ extend(getParsingFlags(m), flags);
+ }
+ else {
+ getParsingFlags(m).userInvalidated = true;
+ }
+
+ return m;
+ }
+
+ function isUndefined(input) {
+ return input === void 0;
+ }
+
+ // Plugins that add properties should also add the key here (null value),
+ // so we can properly clone ourselves.
+ var momentProperties = utils_hooks__hooks.momentProperties = [];
+
+ function copyConfig(to, from) {
+ var i, prop, val;
+
+ if (!isUndefined(from._isAMomentObject)) {
+ to._isAMomentObject = from._isAMomentObject;
+ }
+ if (!isUndefined(from._i)) {
+ to._i = from._i;
+ }
+ if (!isUndefined(from._f)) {
+ to._f = from._f;
+ }
+ if (!isUndefined(from._l)) {
+ to._l = from._l;
+ }
+ if (!isUndefined(from._strict)) {
+ to._strict = from._strict;
+ }
+ if (!isUndefined(from._tzm)) {
+ to._tzm = from._tzm;
+ }
+ if (!isUndefined(from._isUTC)) {
+ to._isUTC = from._isUTC;
+ }
+ if (!isUndefined(from._offset)) {
+ to._offset = from._offset;
+ }
+ if (!isUndefined(from._pf)) {
+ to._pf = getParsingFlags(from);
+ }
+ if (!isUndefined(from._locale)) {
+ to._locale = from._locale;
+ }
+
+ if (momentProperties.length > 0) {
+ for (i in momentProperties) {
+ prop = momentProperties[i];
+ val = from[prop];
+ if (!isUndefined(val)) {
+ to[prop] = val;
+ }
+ }
+ }
+
+ return to;
+ }
+
+ var updateInProgress = false;
+
+ // Moment prototype object
+ function Moment(config) {
+ copyConfig(this, config);
+ this._d = new Date(config._d != null ? config._d.getTime() : NaN);
+ // Prevent infinite loop in case updateOffset creates new moment
+ // objects.
+ if (updateInProgress === false) {
+ updateInProgress = true;
+ utils_hooks__hooks.updateOffset(this);
+ updateInProgress = false;
+ }
+ }
+
+ function isMoment (obj) {
+ return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
+ }
+
+ function absFloor (number) {
+ if (number < 0) {
+ return Math.ceil(number);
+ } else {
+ return Math.floor(number);
+ }
+ }
+
+ function toInt(argumentForCoercion) {
+ var coercedNumber = +argumentForCoercion,
+ value = 0;
+
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
+ value = absFloor(coercedNumber);
+ }
+
+ return value;
+ }
+
+ // compare two arrays, return the number of differences
+ function compareArrays(array1, array2, dontConvert) {
+ var len = Math.min(array1.length, array2.length),
+ lengthDiff = Math.abs(array1.length - array2.length),
+ diffs = 0,
+ i;
+ for (i = 0; i < len; i++) {
+ if ((dontConvert && array1[i] !== array2[i]) ||
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
+ diffs++;
+ }
+ }
+ return diffs + lengthDiff;
+ }
+
+ function warn(msg) {
+ if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
+ (typeof console !== 'undefined') && console.warn) {
+ console.warn('Deprecation warning: ' + msg);
+ }
+ }
+
+ function deprecate(msg, fn) {
+ var firstTime = true;
+
+ return extend(function () {
+ if (utils_hooks__hooks.deprecationHandler != null) {
+ utils_hooks__hooks.deprecationHandler(null, msg);
+ }
+ if (firstTime) {
+ warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack);
+ firstTime = false;
+ }
+ return fn.apply(this, arguments);
+ }, fn);
+ }
+
+ var deprecations = {};
+
+ function deprecateSimple(name, msg) {
+ if (utils_hooks__hooks.deprecationHandler != null) {
+ utils_hooks__hooks.deprecationHandler(name, msg);
+ }
+ if (!deprecations[name]) {
+ warn(msg);
+ deprecations[name] = true;
+ }
+ }
+
+ utils_hooks__hooks.suppressDeprecationWarnings = false;
+ utils_hooks__hooks.deprecationHandler = null;
+
+ function isFunction(input) {
+ return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
+ }
+
+ function isObject(input) {
+ return Object.prototype.toString.call(input) === '[object Object]';
+ }
+
+ function locale_set__set (config) {
+ var prop, i;
+ for (i in config) {
+ prop = config[i];
+ if (isFunction(prop)) {
+ this[i] = prop;
+ } else {
+ this['_' + i] = prop;
+ }
+ }
+ this._config = config;
+ // Lenient ordinal parsing accepts just a number in addition to
+ // number + (possibly) stuff coming from _ordinalParseLenient.
+ this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
+ }
+
+ function mergeConfigs(parentConfig, childConfig) {
+ var res = extend({}, parentConfig), prop;
+ for (prop in childConfig) {
+ if (hasOwnProp(childConfig, prop)) {
+ if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
+ res[prop] = {};
+ extend(res[prop], parentConfig[prop]);
+ extend(res[prop], childConfig[prop]);
+ } else if (childConfig[prop] != null) {
+ res[prop] = childConfig[prop];
+ } else {
+ delete res[prop];
+ }
+ }
+ }
+ return res;
+ }
+
+ function Locale(config) {
+ if (config != null) {
+ this.set(config);
+ }
+ }
+
+ var keys;
+
+ if (Object.keys) {
+ keys = Object.keys;
+ } else {
+ keys = function (obj) {
+ var i, res = [];
+ for (i in obj) {
+ if (hasOwnProp(obj, i)) {
+ res.push(i);
+ }
+ }
+ return res;
+ };
+ }
+
+ // internal storage for locale config files
+ var locales = {};
+ var globalLocale;
+
+ function normalizeLocale(key) {
+ return key ? key.toLowerCase().replace('_', '-') : key;
+ }
+
+ // pick the locale from the array
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
+ function chooseLocale(names) {
+ var i = 0, j, next, locale, split;
+
+ while (i < names.length) {
+ split = normalizeLocale(names[i]).split('-');
+ j = split.length;
+ next = normalizeLocale(names[i + 1]);
+ next = next ? next.split('-') : null;
+ while (j > 0) {
+ locale = loadLocale(split.slice(0, j).join('-'));
+ if (locale) {
+ return locale;
+ }
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
+ //the next array item is better than a shallower substring of this one
+ break;
+ }
+ j--;
+ }
+ i++;
+ }
+ return null;
+ }
+
+ function loadLocale(name) {
+ var oldLocale = null;
+ // TODO: Find a better way to register and load all the locales in Node
+ if (!locales[name] && (typeof module !== 'undefined') &&
+ module && module.exports) {
+ try {
+ oldLocale = globalLocale._abbr;
+ !(function webpackMissingModule() { var e = new Error("Cannot find module \"./locale\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
+ // because defineLocale currently also sets the global locale, we
+ // want to undo that for lazy loaded locales
+ locale_locales__getSetGlobalLocale(oldLocale);
+ } catch (e) { }
+ }
+ return locales[name];
+ }
+
+ // This function will load locale and then set the global locale. If
+ // no arguments are passed in, it will simply return the current global
+ // locale key.
+ function locale_locales__getSetGlobalLocale (key, values) {
+ var data;
+ if (key) {
+ if (isUndefined(values)) {
+ data = locale_locales__getLocale(key);
+ }
+ else {
+ data = defineLocale(key, values);
+ }
+
+ if (data) {
+ // moment.duration._locale = moment._locale = data;
+ globalLocale = data;
+ }
+ }
+
+ return globalLocale._abbr;
+ }
+
+ function defineLocale (name, config) {
+ if (config !== null) {
+ config.abbr = name;
+ if (locales[name] != null) {
+ deprecateSimple('defineLocaleOverride',
+ 'use moment.updateLocale(localeName, config) to change ' +
+ 'an existing locale. moment.defineLocale(localeName, ' +
+ 'config) should only be used for creating a new locale');
+ config = mergeConfigs(locales[name]._config, config);
+ } else if (config.parentLocale != null) {
+ if (locales[config.parentLocale] != null) {
+ config = mergeConfigs(locales[config.parentLocale]._config, config);
+ } else {
+ // treat as if there is no base config
+ deprecateSimple('parentLocaleUndefined',
+ 'specified parentLocale is not defined yet');
+ }
+ }
+ locales[name] = new Locale(config);
+
+ // backwards compat for now: also set the locale
+ locale_locales__getSetGlobalLocale(name);
+
+ return locales[name];
+ } else {
+ // useful for testing
+ delete locales[name];
+ return null;
+ }
+ }
+
+ function updateLocale(name, config) {
+ if (config != null) {
+ var locale;
+ if (locales[name] != null) {
+ config = mergeConfigs(locales[name]._config, config);
+ }
+ locale = new Locale(config);
+ locale.parentLocale = locales[name];
+ locales[name] = locale;
+
+ // backwards compat for now: also set the locale
+ locale_locales__getSetGlobalLocale(name);
+ } else {
+ // pass null for config to unupdate, useful for tests
+ if (locales[name] != null) {
+ if (locales[name].parentLocale != null) {
+ locales[name] = locales[name].parentLocale;
+ } else if (locales[name] != null) {
+ delete locales[name];
+ }
+ }
+ }
+ return locales[name];
+ }
+
+ // returns locale data
+ function locale_locales__getLocale (key) {
+ var locale;
+
+ if (key && key._locale && key._locale._abbr) {
+ key = key._locale._abbr;
+ }
+
+ if (!key) {
+ return globalLocale;
+ }
+
+ if (!isArray(key)) {
+ //short-circuit everything else
+ locale = loadLocale(key);
+ if (locale) {
+ return locale;
+ }
+ key = [key];
+ }
+
+ return chooseLocale(key);
+ }
+
+ function locale_locales__listLocales() {
+ return keys(locales);
+ }
+
+ var aliases = {};
+
+ function addUnitAlias (unit, shorthand) {
+ var lowerCase = unit.toLowerCase();
+ aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
+ }
+
+ function normalizeUnits(units) {
+ return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
+ }
+
+ function normalizeObjectUnits(inputObject) {
+ var normalizedInput = {},
+ normalizedProp,
+ prop;
+
+ for (prop in inputObject) {
+ if (hasOwnProp(inputObject, prop)) {
+ normalizedProp = normalizeUnits(prop);
+ if (normalizedProp) {
+ normalizedInput[normalizedProp] = inputObject[prop];
+ }
+ }
+ }
+
+ return normalizedInput;
+ }
+
+ function makeGetSet (unit, keepTime) {
+ return function (value) {
+ if (value != null) {
+ get_set__set(this, unit, value);
+ utils_hooks__hooks.updateOffset(this, keepTime);
+ return this;
+ } else {
+ return get_set__get(this, unit);
+ }
+ };
+ }
+
+ function get_set__get (mom, unit) {
+ return mom.isValid() ?
+ mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
+ }
+
+ function get_set__set (mom, unit, value) {
+ if (mom.isValid()) {
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
+ }
+ }
+
+ // MOMENTS
+
+ function getSet (units, value) {
+ var unit;
+ if (typeof units === 'object') {
+ for (unit in units) {
+ this.set(unit, units[unit]);
+ }
+ } else {
+ units = normalizeUnits(units);
+ if (isFunction(this[units])) {
+ return this[units](value);
+ }
+ }
+ return this;
+ }
+
+ function zeroFill(number, targetLength, forceSign) {
+ var absNumber = '' + Math.abs(number),
+ zerosToFill = targetLength - absNumber.length,
+ sign = number >= 0;
+ return (sign ? (forceSign ? '+' : '') : '-') +
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
+ }
+
+ var formattingTokens = /(\[[^\[]*\])|(\\)?([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;
+
+ var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
+
+ var formatFunctions = {};
+
+ var formatTokenFunctions = {};
+
+ // token: 'M'
+ // padded: ['MM', 2]
+ // ordinal: 'Mo'
+ // callback: function () { this.month() + 1 }
+ function addFormatToken (token, padded, ordinal, callback) {
+ var func = callback;
+ if (typeof callback === 'string') {
+ func = function () {
+ return this[callback]();
+ };
+ }
+ if (token) {
+ formatTokenFunctions[token] = func;
+ }
+ if (padded) {
+ formatTokenFunctions[padded[0]] = function () {
+ return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
+ };
+ }
+ if (ordinal) {
+ formatTokenFunctions[ordinal] = function () {
+ return this.localeData().ordinal(func.apply(this, arguments), token);
+ };
+ }
+ }
+
+ function removeFormattingTokens(input) {
+ if (input.match(/\[[\s\S]/)) {
+ return input.replace(/^\[|\]$/g, '');
+ }
+ return input.replace(/\\/g, '');
+ }
+
+ function makeFormatFunction(format) {
+ var array = format.match(formattingTokens), i, length;
+
+ for (i = 0, length = array.length; i < length; i++) {
+ if (formatTokenFunctions[array[i]]) {
+ array[i] = formatTokenFunctions[array[i]];
+ } else {
+ array[i] = removeFormattingTokens(array[i]);
+ }
+ }
+
+ return function (mom) {
+ var output = '', i;
+ for (i = 0; i < length; i++) {
+ output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
+ }
+ return output;
+ };
+ }
+
+ // format date using native date object
+ function formatMoment(m, format) {
+ if (!m.isValid()) {
+ return m.localeData().invalidDate();
+ }
+
+ format = expandFormat(format, m.localeData());
+ formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
+
+ return formatFunctions[format](m);
+ }
+
+ function expandFormat(format, locale) {
+ var i = 5;
+
+ function replaceLongDateFormatTokens(input) {
+ return locale.longDateFormat(input) || input;
+ }
+
+ localFormattingTokens.lastIndex = 0;
+ while (i >= 0 && localFormattingTokens.test(format)) {
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
+ localFormattingTokens.lastIndex = 0;
+ i -= 1;
+ }
+
+ return format;
+ }
+
+ var match1 = /\d/; // 0 - 9
+ var match2 = /\d\d/; // 00 - 99
+ var match3 = /\d{3}/; // 000 - 999
+ var match4 = /\d{4}/; // 0000 - 9999
+ var match6 = /[+-]?\d{6}/; // -999999 - 999999
+ var match1to2 = /\d\d?/; // 0 - 99
+ var match3to4 = /\d\d\d\d?/; // 999 - 9999
+ var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
+ var match1to3 = /\d{1,3}/; // 0 - 999
+ var match1to4 = /\d{1,4}/; // 0 - 9999
+ var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
+
+ var matchUnsigned = /\d+/; // 0 - inf
+ var matchSigned = /[+-]?\d+/; // -inf - inf
+
+ var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
+ var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
+
+ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
+
+ // any word (or two) characters or numbers including two/three word month in arabic.
+ // includes scottish gaelic two word and hyphenated months
+ var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
+
+
+ var regexes = {};
+
+ function addRegexToken (token, regex, strictRegex) {
+ regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
+ return (isStrict && strictRegex) ? strictRegex : regex;
+ };
+ }
+
+ function getParseRegexForToken (token, config) {
+ if (!hasOwnProp(regexes, token)) {
+ return new RegExp(unescapeFormat(token));
+ }
+
+ return regexes[token](config._strict, config._locale);
+ }
+
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
+ function unescapeFormat(s) {
+ return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
+ return p1 || p2 || p3 || p4;
+ }));
+ }
+
+ function regexEscape(s) {
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ }
+
+ var tokens = {};
+
+ function addParseToken (token, callback) {
+ var i, func = callback;
+ if (typeof token === 'string') {
+ token = [token];
+ }
+ if (typeof callback === 'number') {
+ func = function (input, array) {
+ array[callback] = toInt(input);
+ };
+ }
+ for (i = 0; i < token.length; i++) {
+ tokens[token[i]] = func;
+ }
+ }
+
+ function addWeekParseToken (token, callback) {
+ addParseToken(token, function (input, array, config, token) {
+ config._w = config._w || {};
+ callback(input, config._w, config, token);
+ });
+ }
+
+ function addTimeToArrayFromToken(token, input, config) {
+ if (input != null && hasOwnProp(tokens, token)) {
+ tokens[token](input, config._a, config, token);
+ }
+ }
+
+ var YEAR = 0;
+ var MONTH = 1;
+ var DATE = 2;
+ var HOUR = 3;
+ var MINUTE = 4;
+ var SECOND = 5;
+ var MILLISECOND = 6;
+ var WEEK = 7;
+ var WEEKDAY = 8;
+
+ var indexOf;
+
+ if (Array.prototype.indexOf) {
+ indexOf = Array.prototype.indexOf;
+ } else {
+ indexOf = function (o) {
+ // I know
+ var i;
+ for (i = 0; i < this.length; ++i) {
+ if (this[i] === o) {
+ return i;
+ }
+ }
+ return -1;
+ };
+ }
+
+ function daysInMonth(year, month) {
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
+ }
+
+ // FORMATTING
+
+ addFormatToken('M', ['MM', 2], 'Mo', function () {
+ return this.month() + 1;
+ });
+
+ addFormatToken('MMM', 0, 0, function (format) {
+ return this.localeData().monthsShort(this, format);
+ });
+
+ addFormatToken('MMMM', 0, 0, function (format) {
+ return this.localeData().months(this, format);
+ });
+
+ // ALIASES
+
+ addUnitAlias('month', 'M');
+
+ // PARSING
+
+ addRegexToken('M', match1to2);
+ addRegexToken('MM', match1to2, match2);
+ addRegexToken('MMM', function (isStrict, locale) {
+ return locale.monthsShortRegex(isStrict);
+ });
+ addRegexToken('MMMM', function (isStrict, locale) {
+ return locale.monthsRegex(isStrict);
+ });
+
+ addParseToken(['M', 'MM'], function (input, array) {
+ array[MONTH] = toInt(input) - 1;
+ });
+
+ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
+ var month = config._locale.monthsParse(input, token, config._strict);
+ // if we didn't find a month name, mark the date as invalid.
+ if (month != null) {
+ array[MONTH] = month;
+ } else {
+ getParsingFlags(config).invalidMonth = input;
+ }
+ });
+
+ // LOCALES
+
+ var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/;
+ var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
+ function localeMonths (m, format) {
+ return isArray(this._months) ? this._months[m.month()] :
+ this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
+ }
+
+ var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
+ function localeMonthsShort (m, format) {
+ return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
+ this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
+ }
+
+ function units_month__handleStrictParse(monthName, format, strict) {
+ var i, ii, mom, llc = monthName.toLocaleLowerCase();
+ if (!this._monthsParse) {
+ // this is not used
+ this._monthsParse = [];
+ this._longMonthsParse = [];
+ this._shortMonthsParse = [];
+ for (i = 0; i < 12; ++i) {
+ mom = create_utc__createUTC([2000, i]);
+ this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
+ this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
+ }
+ }
+
+ if (strict) {
+ if (format === 'MMM') {
+ ii = indexOf.call(this._shortMonthsParse, llc);
+ return ii !== -1 ? ii : null;
+ } else {
+ ii = indexOf.call(this._longMonthsParse, llc);
+ return ii !== -1 ? ii : null;
+ }
+ } else {
+ if (format === 'MMM') {
+ ii = indexOf.call(this._shortMonthsParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._longMonthsParse, llc);
+ return ii !== -1 ? ii : null;
+ } else {
+ ii = indexOf.call(this._longMonthsParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._shortMonthsParse, llc);
+ return ii !== -1 ? ii : null;
+ }
+ }
+ }
+
+ function localeMonthsParse (monthName, format, strict) {
+ var i, mom, regex;
+
+ if (this._monthsParseExact) {
+ return units_month__handleStrictParse.call(this, monthName, format, strict);
+ }
+
+ if (!this._monthsParse) {
+ this._monthsParse = [];
+ this._longMonthsParse = [];
+ this._shortMonthsParse = [];
+ }
+
+ // TODO: add sorting
+ // Sorting makes sure if one month (or abbr) is a prefix of another
+ // see sorting in computeMonthsParse
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ if (strict && !this._longMonthsParse[i]) {
+ this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
+ this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
+ }
+ if (!strict && !this._monthsParse[i]) {
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (!strict && this._monthsParse[i].test(monthName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function setMonth (mom, value) {
+ var dayOfMonth;
+
+ if (!mom.isValid()) {
+ // No op
+ return mom;
+ }
+
+ if (typeof value === 'string') {
+ if (/^\d+$/.test(value)) {
+ value = toInt(value);
+ } else {
+ value = mom.localeData().monthsParse(value);
+ // TODO: Another silent failure?
+ if (typeof value !== 'number') {
+ return mom;
+ }
+ }
+ }
+
+ dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
+ return mom;
+ }
+
+ function getSetMonth (value) {
+ if (value != null) {
+ setMonth(this, value);
+ utils_hooks__hooks.updateOffset(this, true);
+ return this;
+ } else {
+ return get_set__get(this, 'Month');
+ }
+ }
+
+ function getDaysInMonth () {
+ return daysInMonth(this.year(), this.month());
+ }
+
+ var defaultMonthsShortRegex = matchWord;
+ function monthsShortRegex (isStrict) {
+ if (this._monthsParseExact) {
+ if (!hasOwnProp(this, '_monthsRegex')) {
+ computeMonthsParse.call(this);
+ }
+ if (isStrict) {
+ return this._monthsShortStrictRegex;
+ } else {
+ return this._monthsShortRegex;
+ }
+ } else {
+ return this._monthsShortStrictRegex && isStrict ?
+ this._monthsShortStrictRegex : this._monthsShortRegex;
+ }
+ }
+
+ var defaultMonthsRegex = matchWord;
+ function monthsRegex (isStrict) {
+ if (this._monthsParseExact) {
+ if (!hasOwnProp(this, '_monthsRegex')) {
+ computeMonthsParse.call(this);
+ }
+ if (isStrict) {
+ return this._monthsStrictRegex;
+ } else {
+ return this._monthsRegex;
+ }
+ } else {
+ return this._monthsStrictRegex && isStrict ?
+ this._monthsStrictRegex : this._monthsRegex;
+ }
+ }
+
+ function computeMonthsParse () {
+ function cmpLenRev(a, b) {
+ return b.length - a.length;
+ }
+
+ var shortPieces = [], longPieces = [], mixedPieces = [],
+ i, mom;
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ shortPieces.push(this.monthsShort(mom, ''));
+ longPieces.push(this.months(mom, ''));
+ mixedPieces.push(this.months(mom, ''));
+ mixedPieces.push(this.monthsShort(mom, ''));
+ }
+ // Sorting makes sure if one month (or abbr) is a prefix of another it
+ // will match the longer piece.
+ shortPieces.sort(cmpLenRev);
+ longPieces.sort(cmpLenRev);
+ mixedPieces.sort(cmpLenRev);
+ for (i = 0; i < 12; i++) {
+ shortPieces[i] = regexEscape(shortPieces[i]);
+ longPieces[i] = regexEscape(longPieces[i]);
+ mixedPieces[i] = regexEscape(mixedPieces[i]);
+ }
+
+ this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
+ this._monthsShortRegex = this._monthsRegex;
+ this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
+ this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
+ }
+
+ function checkOverflow (m) {
+ var overflow;
+ var a = m._a;
+
+ if (a && getParsingFlags(m).overflow === -2) {
+ overflow =
+ a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
+ a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
+ a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
+ a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
+ a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
+ a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
+ -1;
+
+ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
+ overflow = DATE;
+ }
+ if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
+ overflow = WEEK;
+ }
+ if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
+ overflow = WEEKDAY;
+ }
+
+ getParsingFlags(m).overflow = overflow;
+ }
+
+ return m;
+ }
+
+ // iso 8601 regex
+ // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
+ var extendedIsoRegex = /^\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)?)?/;
+ var basicIsoRegex = /^\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)?)?/;
+
+ var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
+
+ var isoDates = [
+ ['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/, false],
+ ['YYYY-DDD', /\d{4}-\d{3}/],
+ ['YYYY-MM', /\d{4}-\d\d/, false],
+ ['YYYYYYMMDD', /[+-]\d{10}/],
+ ['YYYYMMDD', /\d{8}/],
+ // YYYYMM is NOT allowed by the standard
+ ['GGGG[W]WWE', /\d{4}W\d{3}/],
+ ['GGGG[W]WW', /\d{4}W\d{2}/, false],
+ ['YYYYDDD', /\d{7}/]
+ ];
+
+ // iso time formats and regexes
+ var isoTimes = [
+ ['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/]
+ ];
+
+ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
+
+ // date from iso format
+ function configFromISO(config) {
+ var i, l,
+ string = config._i,
+ match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
+ allowTime, dateFormat, timeFormat, tzFormat;
+
+ if (match) {
+ getParsingFlags(config).iso = true;
+
+ for (i = 0, l = isoDates.length; i < l; i++) {
+ if (isoDates[i][1].exec(match[1])) {
+ dateFormat = isoDates[i][0];
+ allowTime = isoDates[i][2] !== false;
+ break;
+ }
+ }
+ if (dateFormat == null) {
+ config._isValid = false;
+ return;
+ }
+ if (match[3]) {
+ for (i = 0, l = isoTimes.length; i < l; i++) {
+ if (isoTimes[i][1].exec(match[3])) {
+ // match[2] should be 'T' or space
+ timeFormat = (match[2] || ' ') + isoTimes[i][0];
+ break;
+ }
+ }
+ if (timeFormat == null) {
+ config._isValid = false;
+ return;
+ }
+ }
+ if (!allowTime && timeFormat != null) {
+ config._isValid = false;
+ return;
+ }
+ if (match[4]) {
+ if (tzRegex.exec(match[4])) {
+ tzFormat = 'Z';
+ } else {
+ config._isValid = false;
+ return;
+ }
+ }
+ config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
+ configFromStringAndFormat(config);
+ } else {
+ config._isValid = false;
+ }
+ }
+
+ // date from iso format or fallback
+ function configFromString(config) {
+ var matched = aspNetJsonRegex.exec(config._i);
+
+ if (matched !== null) {
+ config._d = new Date(+matched[1]);
+ return;
+ }
+
+ configFromISO(config);
+ if (config._isValid === false) {
+ delete config._isValid;
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ utils_hooks__hooks.createFromInputFallback = deprecate(
+ 'moment construction falls back to js Date. This is ' +
+ 'discouraged and will be removed in upcoming major ' +
+ 'release. Please refer to ' +
+ 'https://github.com/moment/moment/issues/1407 for more info.',
+ function (config) {
+ config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
+ }
+ );
+
+ function createDate (y, m, d, h, M, s, ms) {
+ //can't just apply() to create a date:
+ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
+ var date = new Date(y, m, d, h, M, s, ms);
+
+ //the date constructor remaps years 0-99 to 1900-1999
+ if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
+ date.setFullYear(y);
+ }
+ return date;
+ }
+
+ function createUTCDate (y) {
+ var date = new Date(Date.UTC.apply(null, arguments));
+
+ //the Date.UTC function remaps years 0-99 to 1900-1999
+ if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
+ date.setUTCFullYear(y);
+ }
+ return date;
+ }
+
+ // FORMATTING
+
+ addFormatToken('Y', 0, 0, function () {
+ var y = this.year();
+ return y <= 9999 ? '' + y : '+' + y;
+ });
+
+ addFormatToken(0, ['YY', 2], 0, function () {
+ return this.year() % 100;
+ });
+
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
+
+ // ALIASES
+
+ addUnitAlias('year', 'y');
+
+ // PARSING
+
+ addRegexToken('Y', matchSigned);
+ addRegexToken('YY', match1to2, match2);
+ addRegexToken('YYYY', match1to4, match4);
+ addRegexToken('YYYYY', match1to6, match6);
+ addRegexToken('YYYYYY', match1to6, match6);
+
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+ addParseToken('YYYY', function (input, array) {
+ array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
+ });
+ addParseToken('YY', function (input, array) {
+ array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+ addParseToken('Y', function (input, array) {
+ array[YEAR] = parseInt(input, 10);
+ });
+
+ // HELPERS
+
+ function daysInYear(year) {
+ return isLeapYear(year) ? 366 : 365;
+ }
+
+ function isLeapYear(year) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ }
+
+ // HOOKS
+
+ utils_hooks__hooks.parseTwoDigitYear = function (input) {
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
+ };
+
+ // MOMENTS
+
+ var getSetYear = makeGetSet('FullYear', true);
+
+ function getIsLeapYear () {
+ return isLeapYear(this.year());
+ }
+
+ // start-of-first-week - start-of-year
+ function firstWeekOffset(year, dow, doy) {
+ var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
+ fwd = 7 + dow - doy,
+ // first-week day local weekday -- which local weekday is fwd
+ fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
+
+ return -fwdlw + fwd - 1;
+ }
+
+ //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
+ function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
+ var localWeekday = (7 + weekday - dow) % 7,
+ weekOffset = firstWeekOffset(year, dow, doy),
+ dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
+ resYear, resDayOfYear;
+
+ if (dayOfYear <= 0) {
+ resYear = year - 1;
+ resDayOfYear = daysInYear(resYear) + dayOfYear;
+ } else if (dayOfYear > daysInYear(year)) {
+ resYear = year + 1;
+ resDayOfYear = dayOfYear - daysInYear(year);
+ } else {
+ resYear = year;
+ resDayOfYear = dayOfYear;
+ }
+
+ return {
+ year: resYear,
+ dayOfYear: resDayOfYear
+ };
+ }
+
+ function weekOfYear(mom, dow, doy) {
+ var weekOffset = firstWeekOffset(mom.year(), dow, doy),
+ week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
+ resWeek, resYear;
+
+ if (week < 1) {
+ resYear = mom.year() - 1;
+ resWeek = week + weeksInYear(resYear, dow, doy);
+ } else if (week > weeksInYear(mom.year(), dow, doy)) {
+ resWeek = week - weeksInYear(mom.year(), dow, doy);
+ resYear = mom.year() + 1;
+ } else {
+ resYear = mom.year();
+ resWeek = week;
+ }
+
+ return {
+ week: resWeek,
+ year: resYear
+ };
+ }
+
+ function weeksInYear(year, dow, doy) {
+ var weekOffset = firstWeekOffset(year, dow, doy),
+ weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
+ return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
+ }
+
+ // Pick the first defined of two or three arguments.
+ function defaults(a, b, c) {
+ if (a != null) {
+ return a;
+ }
+ if (b != null) {
+ return b;
+ }
+ return c;
+ }
+
+ function currentDateArray(config) {
+ // hooks is actually the exported moment object
+ var nowValue = new Date(utils_hooks__hooks.now());
+ if (config._useUTC) {
+ return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
+ }
+ return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
+ }
+
+ // convert an array to a date.
+ // the array should mirror the parameters below
+ // note: all values past the year are optional and will default to the lowest possible value.
+ // [year, month, day , hour, minute, second, millisecond]
+ function configFromArray (config) {
+ var i, date, input = [], currentDate, yearToUse;
+
+ if (config._d) {
+ return;
+ }
+
+ currentDate = currentDateArray(config);
+
+ //compute day of the year from weeks and weekdays
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
+ dayOfYearFromWeekInfo(config);
+ }
+
+ //if the day of the year is set, figure out what it is
+ if (config._dayOfYear) {
+ yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
+
+ if (config._dayOfYear > daysInYear(yearToUse)) {
+ getParsingFlags(config)._overflowDayOfYear = true;
+ }
+
+ date = createUTCDate(yearToUse, 0, config._dayOfYear);
+ config._a[MONTH] = date.getUTCMonth();
+ config._a[DATE] = date.getUTCDate();
+ }
+
+ // Default to current date.
+ // * if no year, month, day of month are given, default to today
+ // * if day of month is given, default month and year
+ // * if month is given, default only year
+ // * if year is given, don't default anything
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
+ config._a[i] = input[i] = currentDate[i];
+ }
+
+ // Zero out whatever was not defaulted, including time
+ for (; i < 7; i++) {
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
+ }
+
+ // Check for 24:00:00.000
+ if (config._a[HOUR] === 24 &&
+ config._a[MINUTE] === 0 &&
+ config._a[SECOND] === 0 &&
+ config._a[MILLISECOND] === 0) {
+ config._nextDay = true;
+ config._a[HOUR] = 0;
+ }
+
+ config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
+ // Apply timezone offset from input. The actual utcOffset can be changed
+ // with parseZone.
+ if (config._tzm != null) {
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
+ }
+
+ if (config._nextDay) {
+ config._a[HOUR] = 24;
+ }
+ }
+
+ function dayOfYearFromWeekInfo(config) {
+ var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
+
+ w = config._w;
+ if (w.GG != null || w.W != null || w.E != null) {
+ dow = 1;
+ doy = 4;
+
+ // TODO: We need to take the current isoWeekYear, but that depends on
+ // how we interpret now (local, utc, fixed offset). So create
+ // a now version of current config (take local/utc/offset flags, and
+ // create now).
+ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
+ week = defaults(w.W, 1);
+ weekday = defaults(w.E, 1);
+ if (weekday < 1 || weekday > 7) {
+ weekdayOverflow = true;
+ }
+ } else {
+ dow = config._locale._week.dow;
+ doy = config._locale._week.doy;
+
+ weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
+ week = defaults(w.w, 1);
+
+ if (w.d != null) {
+ // weekday -- low day numbers are considered next week
+ weekday = w.d;
+ if (weekday < 0 || weekday > 6) {
+ weekdayOverflow = true;
+ }
+ } else if (w.e != null) {
+ // local weekday -- counting starts from begining of week
+ weekday = w.e + dow;
+ if (w.e < 0 || w.e > 6) {
+ weekdayOverflow = true;
+ }
+ } else {
+ // default to begining of week
+ weekday = dow;
+ }
+ }
+ if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
+ getParsingFlags(config)._overflowWeeks = true;
+ } else if (weekdayOverflow != null) {
+ getParsingFlags(config)._overflowWeekday = true;
+ } else {
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
+ config._a[YEAR] = temp.year;
+ config._dayOfYear = temp.dayOfYear;
+ }
+ }
+
+ // constant that refers to the ISO standard
+ utils_hooks__hooks.ISO_8601 = function () {};
+
+ // date from string and format string
+ function configFromStringAndFormat(config) {
+ // TODO: Move this to another part of the creation flow to prevent circular deps
+ if (config._f === utils_hooks__hooks.ISO_8601) {
+ configFromISO(config);
+ return;
+ }
+
+ config._a = [];
+ getParsingFlags(config).empty = true;
+
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
+ var string = '' + config._i,
+ i, parsedInput, tokens, token, skipped,
+ stringLength = string.length,
+ totalParsedInputLength = 0;
+
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
+
+ for (i = 0; i < tokens.length; i++) {
+ token = tokens[i];
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
+ // console.log('token', token, 'parsedInput', parsedInput,
+ // 'regex', getParseRegexForToken(token, config));
+ if (parsedInput) {
+ skipped = string.substr(0, string.indexOf(parsedInput));
+ if (skipped.length > 0) {
+ getParsingFlags(config).unusedInput.push(skipped);
+ }
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
+ totalParsedInputLength += parsedInput.length;
+ }
+ // don't parse if it's not a known token
+ if (formatTokenFunctions[token]) {
+ if (parsedInput) {
+ getParsingFlags(config).empty = false;
+ }
+ else {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ addTimeToArrayFromToken(token, parsedInput, config);
+ }
+ else if (config._strict && !parsedInput) {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ }
+
+ // add remaining unparsed input length to the string
+ getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
+ if (string.length > 0) {
+ getParsingFlags(config).unusedInput.push(string);
+ }
+
+ // clear _12h flag if hour is <= 12
+ if (getParsingFlags(config).bigHour === true &&
+ config._a[HOUR] <= 12 &&
+ config._a[HOUR] > 0) {
+ getParsingFlags(config).bigHour = undefined;
+ }
+
+ getParsingFlags(config).parsedDateParts = config._a.slice(0);
+ getParsingFlags(config).meridiem = config._meridiem;
+ // handle meridiem
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
+
+ configFromArray(config);
+ checkOverflow(config);
+ }
+
+
+ function meridiemFixWrap (locale, hour, meridiem) {
+ var isPm;
+
+ if (meridiem == null) {
+ // nothing to do
+ return hour;
+ }
+ if (locale.meridiemHour != null) {
+ return locale.meridiemHour(hour, meridiem);
+ } else if (locale.isPM != null) {
+ // Fallback
+ isPm = locale.isPM(meridiem);
+ if (isPm && hour < 12) {
+ hour += 12;
+ }
+ if (!isPm && hour === 12) {
+ hour = 0;
+ }
+ return hour;
+ } else {
+ // this is not supposed to happen
+ return hour;
+ }
+ }
+
+ // date from string and array of format strings
+ function configFromStringAndArray(config) {
+ var tempConfig,
+ bestMoment,
+
+ scoreToBeat,
+ i,
+ currentScore;
+
+ if (config._f.length === 0) {
+ getParsingFlags(config).invalidFormat = true;
+ config._d = new Date(NaN);
+ return;
+ }
+
+ for (i = 0; i < config._f.length; i++) {
+ currentScore = 0;
+ tempConfig = copyConfig({}, config);
+ if (config._useUTC != null) {
+ tempConfig._useUTC = config._useUTC;
+ }
+ tempConfig._f = config._f[i];
+ configFromStringAndFormat(tempConfig);
+
+ if (!valid__isValid(tempConfig)) {
+ continue;
+ }
+
+ // if there is any input that was not parsed add a penalty for that format
+ currentScore += getParsingFlags(tempConfig).charsLeftOver;
+
+ //or tokens
+ currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
+
+ getParsingFlags(tempConfig).score = currentScore;
+
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
+ scoreToBeat = currentScore;
+ bestMoment = tempConfig;
+ }
+ }
+
+ extend(config, bestMoment || tempConfig);
+ }
+
+ function configFromObject(config) {
+ if (config._d) {
+ return;
+ }
+
+ var i = normalizeObjectUnits(config._i);
+ config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
+ return obj && parseInt(obj, 10);
+ });
+
+ configFromArray(config);
+ }
+
+ function createFromConfig (config) {
+ var res = new Moment(checkOverflow(prepareConfig(config)));
+ if (res._nextDay) {
+ // Adding is smart enough around DST
+ res.add(1, 'd');
+ res._nextDay = undefined;
+ }
+
+ return res;
+ }
+
+ function prepareConfig (config) {
+ var input = config._i,
+ format = config._f;
+
+ config._locale = config._locale || locale_locales__getLocale(config._l);
+
+ if (input === null || (format === undefined && input === '')) {
+ return valid__createInvalid({nullInput: true});
+ }
+
+ if (typeof input === 'string') {
+ config._i = input = config._locale.preparse(input);
+ }
+
+ if (isMoment(input)) {
+ return new Moment(checkOverflow(input));
+ } else if (isArray(format)) {
+ configFromStringAndArray(config);
+ } else if (format) {
+ configFromStringAndFormat(config);
+ } else if (isDate(input)) {
+ config._d = input;
+ } else {
+ configFromInput(config);
+ }
+
+ if (!valid__isValid(config)) {
+ config._d = null;
+ }
+
+ return config;
+ }
+
+ function configFromInput(config) {
+ var input = config._i;
+ if (input === undefined) {
+ config._d = new Date(utils_hooks__hooks.now());
+ } else if (isDate(input)) {
+ config._d = new Date(input.valueOf());
+ } else if (typeof input === 'string') {
+ configFromString(config);
+ } else if (isArray(input)) {
+ config._a = map(input.slice(0), function (obj) {
+ return parseInt(obj, 10);
+ });
+ configFromArray(config);
+ } else if (typeof(input) === 'object') {
+ configFromObject(config);
+ } else if (typeof(input) === 'number') {
+ // from milliseconds
+ config._d = new Date(input);
+ } else {
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ function createLocalOrUTC (input, format, locale, strict, isUTC) {
+ var c = {};
+
+ if (typeof(locale) === 'boolean') {
+ strict = locale;
+ locale = undefined;
+ }
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c._isAMomentObject = true;
+ c._useUTC = c._isUTC = isUTC;
+ c._l = locale;
+ c._i = input;
+ c._f = format;
+ c._strict = strict;
+
+ return createFromConfig(c);
+ }
+
+ function local__createLocal (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, false);
+ }
+
+ var prototypeMin = deprecate(
+ 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ if (this.isValid() && other.isValid()) {
+ return other < this ? this : other;
+ } else {
+ return valid__createInvalid();
+ }
+ }
+ );
+
+ var prototypeMax = deprecate(
+ 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ if (this.isValid() && other.isValid()) {
+ return other > this ? this : other;
+ } else {
+ return valid__createInvalid();
+ }
+ }
+ );
+
+ // Pick a moment m from moments so that m[fn](other) is true for all
+ // other. This relies on the function fn to be transitive.
+ //
+ // moments should either be an array of moment objects or an array, whose
+ // first element is an array of moment objects.
+ function pickBy(fn, moments) {
+ var res, i;
+ if (moments.length === 1 && isArray(moments[0])) {
+ moments = moments[0];
+ }
+ if (!moments.length) {
+ return local__createLocal();
+ }
+ res = moments[0];
+ for (i = 1; i < moments.length; ++i) {
+ if (!moments[i].isValid() || moments[i][fn](res)) {
+ res = moments[i];
+ }
+ }
+ return res;
+ }
+
+ // TODO: Use [].sort instead?
+ function min () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isBefore', args);
+ }
+
+ function max () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isAfter', args);
+ }
+
+ var now = function () {
+ return Date.now ? Date.now() : +(new Date());
+ };
+
+ function Duration (duration) {
+ var normalizedInput = normalizeObjectUnits(duration),
+ years = normalizedInput.year || 0,
+ quarters = normalizedInput.quarter || 0,
+ months = normalizedInput.month || 0,
+ weeks = normalizedInput.week || 0,
+ days = normalizedInput.day || 0,
+ hours = normalizedInput.hour || 0,
+ minutes = normalizedInput.minute || 0,
+ seconds = normalizedInput.second || 0,
+ milliseconds = normalizedInput.millisecond || 0;
+
+ // representation for dateAddRemove
+ this._milliseconds = +milliseconds +
+ seconds * 1e3 + // 1000
+ minutes * 6e4 + // 1000 * 60
+ hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
+ // Because of dateAddRemove treats 24 hours as different from a
+ // day when working around DST, we need to store them separately
+ this._days = +days +
+ weeks * 7;
+ // It is impossible translate months into days without knowing
+ // which months you are are talking about, so we have to store
+ // it separately.
+ this._months = +months +
+ quarters * 3 +
+ years * 12;
+
+ this._data = {};
+
+ this._locale = locale_locales__getLocale();
+
+ this._bubble();
+ }
+
+ function isDuration (obj) {
+ return obj instanceof Duration;
+ }
+
+ // FORMATTING
+
+ function offset (token, separator) {
+ addFormatToken(token, 0, 0, function () {
+ var offset = this.utcOffset();
+ var sign = '+';
+ if (offset < 0) {
+ offset = -offset;
+ sign = '-';
+ }
+ return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
+ });
+ }
+
+ offset('Z', ':');
+ offset('ZZ', '');
+
+ // PARSING
+
+ addRegexToken('Z', matchShortOffset);
+ addRegexToken('ZZ', matchShortOffset);
+ addParseToken(['Z', 'ZZ'], function (input, array, config) {
+ config._useUTC = true;
+ config._tzm = offsetFromString(matchShortOffset, input);
+ });
+
+ // HELPERS
+
+ // timezone chunker
+ // '+10:00' > ['10', '00']
+ // '-1530' > ['-15', '30']
+ var chunkOffset = /([\+\-]|\d\d)/gi;
+
+ function offsetFromString(matcher, string) {
+ var matches = ((string || '').match(matcher) || []);
+ var chunk = matches[matches.length - 1] || [];
+ var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
+ var minutes = +(parts[1] * 60) + toInt(parts[2]);
+
+ return parts[0] === '+' ? minutes : -minutes;
+ }
+
+ // Return a moment from input, that is local/utc/zone equivalent to model.
+ function cloneWithOffset(input, model) {
+ var res, diff;
+ if (model._isUTC) {
+ res = model.clone();
+ diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();
+ // Use low-level api, because this fn is low-level api.
+ res._d.setTime(res._d.valueOf() + diff);
+ utils_hooks__hooks.updateOffset(res, false);
+ return res;
+ } else {
+ return local__createLocal(input).local();
+ }
+ }
+
+ function getDateOffset (m) {
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
+ // https://github.com/moment/moment/pull/1871
+ return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
+ }
+
+ // HOOKS
+
+ // This function will be called whenever a moment is mutated.
+ // It is intended to keep the offset in sync with the timezone.
+ utils_hooks__hooks.updateOffset = function () {};
+
+ // MOMENTS
+
+ // keepLocalTime = true means only change the timezone, without
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
+ // +0200, so we adjust the time as needed, to be valid.
+ //
+ // Keeping the time actually adds/subtracts (one hour)
+ // from the actual represented time. That is why we call updateOffset
+ // a second time. In case it wants us to change the offset again
+ // _changeInProgress == true case, then we have to adjust, because
+ // there is no such time in the given timezone.
+ function getSetOffset (input, keepLocalTime) {
+ var offset = this._offset || 0,
+ localAdjust;
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ if (input != null) {
+ if (typeof input === 'string') {
+ input = offsetFromString(matchShortOffset, input);
+ } else if (Math.abs(input) < 16) {
+ input = input * 60;
+ }
+ if (!this._isUTC && keepLocalTime) {
+ localAdjust = getDateOffset(this);
+ }
+ this._offset = input;
+ this._isUTC = true;
+ if (localAdjust != null) {
+ this.add(localAdjust, 'm');
+ }
+ if (offset !== input) {
+ if (!keepLocalTime || this._changeInProgress) {
+ add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
+ } else if (!this._changeInProgress) {
+ this._changeInProgress = true;
+ utils_hooks__hooks.updateOffset(this, true);
+ this._changeInProgress = null;
+ }
+ }
+ return this;
+ } else {
+ return this._isUTC ? offset : getDateOffset(this);
+ }
+ }
+
+ function getSetZone (input, keepLocalTime) {
+ if (input != null) {
+ if (typeof input !== 'string') {
+ input = -input;
+ }
+
+ this.utcOffset(input, keepLocalTime);
+
+ return this;
+ } else {
+ return -this.utcOffset();
+ }
+ }
+
+ function setOffsetToUTC (keepLocalTime) {
+ return this.utcOffset(0, keepLocalTime);
+ }
+
+ function setOffsetToLocal (keepLocalTime) {
+ if (this._isUTC) {
+ this.utcOffset(0, keepLocalTime);
+ this._isUTC = false;
+
+ if (keepLocalTime) {
+ this.subtract(getDateOffset(this), 'm');
+ }
+ }
+ return this;
+ }
+
+ function setOffsetToParsedOffset () {
+ if (this._tzm) {
+ this.utcOffset(this._tzm);
+ } else if (typeof this._i === 'string') {
+ this.utcOffset(offsetFromString(matchOffset, this._i));
+ }
+ return this;
+ }
+
+ function hasAlignedHourOffset (input) {
+ if (!this.isValid()) {
+ return false;
+ }
+ input = input ? local__createLocal(input).utcOffset() : 0;
+
+ return (this.utcOffset() - input) % 60 === 0;
+ }
+
+ function isDaylightSavingTime () {
+ return (
+ this.utcOffset() > this.clone().month(0).utcOffset() ||
+ this.utcOffset() > this.clone().month(5).utcOffset()
+ );
+ }
+
+ function isDaylightSavingTimeShifted () {
+ if (!isUndefined(this._isDSTShifted)) {
+ return this._isDSTShifted;
+ }
+
+ var c = {};
+
+ copyConfig(c, this);
+ c = prepareConfig(c);
+
+ if (c._a) {
+ var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
+ this._isDSTShifted = this.isValid() &&
+ compareArrays(c._a, other.toArray()) > 0;
+ } else {
+ this._isDSTShifted = false;
+ }
+
+ return this._isDSTShifted;
+ }
+
+ function isLocal () {
+ return this.isValid() ? !this._isUTC : false;
+ }
+
+ function isUtcOffset () {
+ return this.isValid() ? this._isUTC : false;
+ }
+
+ function isUtc () {
+ return this.isValid() ? this._isUTC && this._offset === 0 : false;
+ }
+
+ // ASP.NET json date format regex
+ var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/;
+
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
+ // and further modified to allow for strings containing both week and day
+ var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
+
+ function create__createDuration (input, key) {
+ var duration = input,
+ // matching against regexp is expensive, do it on demand
+ match = null,
+ sign,
+ ret,
+ diffRes;
+
+ if (isDuration(input)) {
+ duration = {
+ ms : input._milliseconds,
+ d : input._days,
+ M : input._months
+ };
+ } else if (typeof input === 'number') {
+ duration = {};
+ if (key) {
+ duration[key] = input;
+ } else {
+ duration.milliseconds = input;
+ }
+ } else if (!!(match = aspNetRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : 0,
+ d : toInt(match[DATE]) * sign,
+ h : toInt(match[HOUR]) * sign,
+ m : toInt(match[MINUTE]) * sign,
+ s : toInt(match[SECOND]) * sign,
+ ms : toInt(match[MILLISECOND]) * sign
+ };
+ } else if (!!(match = isoRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : parseIso(match[2], sign),
+ M : parseIso(match[3], sign),
+ w : parseIso(match[4], sign),
+ d : parseIso(match[5], sign),
+ h : parseIso(match[6], sign),
+ m : parseIso(match[7], sign),
+ s : parseIso(match[8], sign)
+ };
+ } else if (duration == null) {// checks for null or undefined
+ duration = {};
+ } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
+ diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
+
+ duration = {};
+ duration.ms = diffRes.milliseconds;
+ duration.M = diffRes.months;
+ }
+
+ ret = new Duration(duration);
+
+ if (isDuration(input) && hasOwnProp(input, '_locale')) {
+ ret._locale = input._locale;
+ }
+
+ return ret;
+ }
+
+ create__createDuration.fn = Duration.prototype;
+
+ function parseIso (inp, sign) {
+ // We'd normally use ~~inp for this, but unfortunately it also
+ // converts floats to ints.
+ // inp may be undefined, so careful calling replace on it.
+ var res = inp && parseFloat(inp.replace(',', '.'));
+ // apply sign while we're at it
+ return (isNaN(res) ? 0 : res) * sign;
+ }
+
+ function positiveMomentsDifference(base, other) {
+ var res = {milliseconds: 0, months: 0};
+
+ res.months = other.month() - base.month() +
+ (other.year() - base.year()) * 12;
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
+ --res.months;
+ }
+
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
+
+ return res;
+ }
+
+ function momentsDifference(base, other) {
+ var res;
+ if (!(base.isValid() && other.isValid())) {
+ return {milliseconds: 0, months: 0};
+ }
+
+ other = cloneWithOffset(other, base);
+ if (base.isBefore(other)) {
+ res = positiveMomentsDifference(base, other);
+ } else {
+ res = positiveMomentsDifference(other, base);
+ res.milliseconds = -res.milliseconds;
+ res.months = -res.months;
+ }
+
+ return res;
+ }
+
+ function absRound (number) {
+ if (number < 0) {
+ return Math.round(-1 * number) * -1;
+ } else {
+ return Math.round(number);
+ }
+ }
+
+ // TODO: remove 'name' arg after deprecation is removed
+ function createAdder(direction, name) {
+ return function (val, period) {
+ var dur, tmp;
+ //invert the arguments, but complain about it
+ if (period !== null && !isNaN(+period)) {
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
+ tmp = val; val = period; period = tmp;
+ }
+
+ val = typeof val === 'string' ? +val : val;
+ dur = create__createDuration(val, period);
+ add_subtract__addSubtract(this, dur, direction);
+ return this;
+ };
+ }
+
+ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
+ var milliseconds = duration._milliseconds,
+ days = absRound(duration._days),
+ months = absRound(duration._months);
+
+ if (!mom.isValid()) {
+ // No op
+ return;
+ }
+
+ updateOffset = updateOffset == null ? true : updateOffset;
+
+ if (milliseconds) {
+ mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
+ }
+ if (days) {
+ get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
+ }
+ if (months) {
+ setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
+ }
+ if (updateOffset) {
+ utils_hooks__hooks.updateOffset(mom, days || months);
+ }
+ }
+
+ var add_subtract__add = createAdder(1, 'add');
+ var add_subtract__subtract = createAdder(-1, 'subtract');
+
+ function moment_calendar__calendar (time, formats) {
+ // We want to compare the start of today, vs this.
+ // Getting start-of-today depends on whether we're local/utc/offset or not.
+ var now = time || local__createLocal(),
+ sod = cloneWithOffset(now, this).startOf('day'),
+ diff = this.diff(sod, 'days', true),
+ format = diff < -6 ? 'sameElse' :
+ diff < -1 ? 'lastWeek' :
+ diff < 0 ? 'lastDay' :
+ diff < 1 ? 'sameDay' :
+ diff < 2 ? 'nextDay' :
+ diff < 7 ? 'nextWeek' : 'sameElse';
+
+ var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]);
+
+ return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
+ }
+
+ function clone () {
+ return new Moment(this);
+ }
+
+ function isAfter (input, units) {
+ var localInput = isMoment(input) ? input : local__createLocal(input);
+ if (!(this.isValid() && localInput.isValid())) {
+ return false;
+ }
+ units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
+ if (units === 'millisecond') {
+ return this.valueOf() > localInput.valueOf();
+ } else {
+ return localInput.valueOf() < this.clone().startOf(units).valueOf();
+ }
+ }
+
+ function isBefore (input, units) {
+ var localInput = isMoment(input) ? input : local__createLocal(input);
+ if (!(this.isValid() && localInput.isValid())) {
+ return false;
+ }
+ units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
+ if (units === 'millisecond') {
+ return this.valueOf() < localInput.valueOf();
+ } else {
+ return this.clone().endOf(units).valueOf() < localInput.valueOf();
+ }
+ }
+
+ function isBetween (from, to, units, inclusivity) {
+ inclusivity = inclusivity || '()';
+ return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
+ (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
+ }
+
+ function isSame (input, units) {
+ var localInput = isMoment(input) ? input : local__createLocal(input),
+ inputMs;
+ if (!(this.isValid() && localInput.isValid())) {
+ return false;
+ }
+ units = normalizeUnits(units || 'millisecond');
+ if (units === 'millisecond') {
+ return this.valueOf() === localInput.valueOf();
+ } else {
+ inputMs = localInput.valueOf();
+ return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
+ }
+ }
+
+ function isSameOrAfter (input, units) {
+ return this.isSame(input, units) || this.isAfter(input,units);
+ }
+
+ function isSameOrBefore (input, units) {
+ return this.isSame(input, units) || this.isBefore(input,units);
+ }
+
+ function diff (input, units, asFloat) {
+ var that,
+ zoneDelta,
+ delta, output;
+
+ if (!this.isValid()) {
+ return NaN;
+ }
+
+ that = cloneWithOffset(input, this);
+
+ if (!that.isValid()) {
+ return NaN;
+ }
+
+ zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
+
+ units = normalizeUnits(units);
+
+ if (units === 'year' || units === 'month' || units === 'quarter') {
+ output = monthDiff(this, that);
+ if (units === 'quarter') {
+ output = output / 3;
+ } else if (units === 'year') {
+ output = output / 12;
+ }
+ } else {
+ delta = this - that;
+ output = units === 'second' ? delta / 1e3 : // 1000
+ units === 'minute' ? delta / 6e4 : // 1000 * 60
+ units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
+ units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
+ units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
+ delta;
+ }
+ return asFloat ? output : absFloor(output);
+ }
+
+ function monthDiff (a, b) {
+ // difference in months
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
+ // b is in (anchor - 1 month, anchor + 1 month)
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
+ anchor2, adjust;
+
+ if (b - anchor < 0) {
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor - anchor2);
+ } else {
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor2 - anchor);
+ }
+
+ //check for negative zero, return zero if negative zero
+ return -(wholeMonthDiff + adjust) || 0;
+ }
+
+ utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
+ utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
+
+ function toString () {
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
+ }
+
+ function moment_format__toISOString () {
+ var m = this.clone().utc();
+ if (0 < m.year() && m.year() <= 9999) {
+ if (isFunction(Date.prototype.toISOString)) {
+ // native implementation is ~50x faster, use it when we can
+ return this.toDate().toISOString();
+ } else {
+ return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ } else {
+ return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ }
+
+ function format (inputString) {
+ if (!inputString) {
+ inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;
+ }
+ var output = formatMoment(this, inputString);
+ return this.localeData().postformat(output);
+ }
+
+ function from (time, withoutSuffix) {
+ if (this.isValid() &&
+ ((isMoment(time) && time.isValid()) ||
+ local__createLocal(time).isValid())) {
+ return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
+ } else {
+ return this.localeData().invalidDate();
+ }
+ }
+
+ function fromNow (withoutSuffix) {
+ return this.from(local__createLocal(), withoutSuffix);
+ }
+
+ function to (time, withoutSuffix) {
+ if (this.isValid() &&
+ ((isMoment(time) && time.isValid()) ||
+ local__createLocal(time).isValid())) {
+ return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
+ } else {
+ return this.localeData().invalidDate();
+ }
+ }
+
+ function toNow (withoutSuffix) {
+ return this.to(local__createLocal(), withoutSuffix);
+ }
+
+ // If passed a locale key, it will set the locale for this
+ // instance. Otherwise, it will return the locale configuration
+ // variables for this instance.
+ function locale (key) {
+ var newLocaleData;
+
+ if (key === undefined) {
+ return this._locale._abbr;
+ } else {
+ newLocaleData = locale_locales__getLocale(key);
+ if (newLocaleData != null) {
+ this._locale = newLocaleData;
+ }
+ return this;
+ }
+ }
+
+ var lang = deprecate(
+ 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
+ function (key) {
+ if (key === undefined) {
+ return this.localeData();
+ } else {
+ return this.locale(key);
+ }
+ }
+ );
+
+ function localeData () {
+ return this._locale;
+ }
+
+ function startOf (units) {
+ units = normalizeUnits(units);
+ // the following switch intentionally omits break keywords
+ // to utilize falling through the cases.
+ switch (units) {
+ case 'year':
+ this.month(0);
+ /* falls through */
+ case 'quarter':
+ case 'month':
+ this.date(1);
+ /* falls through */
+ case 'week':
+ case 'isoWeek':
+ case 'day':
+ case 'date':
+ this.hours(0);
+ /* falls through */
+ case 'hour':
+ this.minutes(0);
+ /* falls through */
+ case 'minute':
+ this.seconds(0);
+ /* falls through */
+ case 'second':
+ this.milliseconds(0);
+ }
+
+ // weeks are a special case
+ if (units === 'week') {
+ this.weekday(0);
+ }
+ if (units === 'isoWeek') {
+ this.isoWeekday(1);
+ }
+
+ // quarters are also special
+ if (units === 'quarter') {
+ this.month(Math.floor(this.month() / 3) * 3);
+ }
+
+ return this;
+ }
+
+ function endOf (units) {
+ units = normalizeUnits(units);
+ if (units === undefined || units === 'millisecond') {
+ return this;
+ }
+
+ // 'date' is an alias for 'day', so it should be considered as such.
+ if (units === 'date') {
+ units = 'day';
+ }
+
+ return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
+ }
+
+ function to_type__valueOf () {
+ return this._d.valueOf() - ((this._offset || 0) * 60000);
+ }
+
+ function unix () {
+ return Math.floor(this.valueOf() / 1000);
+ }
+
+ function toDate () {
+ return this._offset ? new Date(this.valueOf()) : this._d;
+ }
+
+ function toArray () {
+ var m = this;
+ return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
+ }
+
+ function toObject () {
+ var m = this;
+ return {
+ years: m.year(),
+ months: m.month(),
+ date: m.date(),
+ hours: m.hours(),
+ minutes: m.minutes(),
+ seconds: m.seconds(),
+ milliseconds: m.milliseconds()
+ };
+ }
+
+ function toJSON () {
+ // new Date(NaN).toJSON() === null
+ return this.isValid() ? this.toISOString() : null;
+ }
+
+ function moment_valid__isValid () {
+ return valid__isValid(this);
+ }
+
+ function parsingFlags () {
+ return extend({}, getParsingFlags(this));
+ }
+
+ function invalidAt () {
+ return getParsingFlags(this).overflow;
+ }
+
+ function creationData() {
+ return {
+ input: this._i,
+ format: this._f,
+ locale: this._locale,
+ isUTC: this._isUTC,
+ strict: this._strict
+ };
+ }
+
+ // FORMATTING
+
+ addFormatToken(0, ['gg', 2], 0, function () {
+ return this.weekYear() % 100;
+ });
+
+ addFormatToken(0, ['GG', 2], 0, function () {
+ return this.isoWeekYear() % 100;
+ });
+
+ function addWeekYearFormatToken (token, getter) {
+ addFormatToken(0, [token, token.length], 0, getter);
+ }
+
+ addWeekYearFormatToken('gggg', 'weekYear');
+ addWeekYearFormatToken('ggggg', 'weekYear');
+ addWeekYearFormatToken('GGGG', 'isoWeekYear');
+ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
+
+ // ALIASES
+
+ addUnitAlias('weekYear', 'gg');
+ addUnitAlias('isoWeekYear', 'GG');
+
+ // PARSING
+
+ addRegexToken('G', matchSigned);
+ addRegexToken('g', matchSigned);
+ addRegexToken('GG', match1to2, match2);
+ addRegexToken('gg', match1to2, match2);
+ addRegexToken('GGGG', match1to4, match4);
+ addRegexToken('gggg', match1to4, match4);
+ addRegexToken('GGGGG', match1to6, match6);
+ addRegexToken('ggggg', match1to6, match6);
+
+ addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
+ week[token.substr(0, 2)] = toInt(input);
+ });
+
+ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
+ week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // MOMENTS
+
+ function getSetWeekYear (input) {
+ return getSetWeekYearHelper.call(this,
+ input,
+ this.week(),
+ this.weekday(),
+ this.localeData()._week.dow,
+ this.localeData()._week.doy);
+ }
+
+ function getSetISOWeekYear (input) {
+ return getSetWeekYearHelper.call(this,
+ input, this.isoWeek(), this.isoWeekday(), 1, 4);
+ }
+
+ function getISOWeeksInYear () {
+ return weeksInYear(this.year(), 1, 4);
+ }
+
+ function getWeeksInYear () {
+ var weekInfo = this.localeData()._week;
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
+ }
+
+ function getSetWeekYearHelper(input, week, weekday, dow, doy) {
+ var weeksTarget;
+ if (input == null) {
+ return weekOfYear(this, dow, doy).year;
+ } else {
+ weeksTarget = weeksInYear(input, dow, doy);
+ if (week > weeksTarget) {
+ week = weeksTarget;
+ }
+ return setWeekAll.call(this, input, week, weekday, dow, doy);
+ }
+ }
+
+ function setWeekAll(weekYear, week, weekday, dow, doy) {
+ var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
+ date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
+
+ this.year(date.getUTCFullYear());
+ this.month(date.getUTCMonth());
+ this.date(date.getUTCDate());
+ return this;
+ }
+
+ // FORMATTING
+
+ addFormatToken('Q', 0, 'Qo', 'quarter');
+
+ // ALIASES
+
+ addUnitAlias('quarter', 'Q');
+
+ // PARSING
+
+ addRegexToken('Q', match1);
+ addParseToken('Q', function (input, array) {
+ array[MONTH] = (toInt(input) - 1) * 3;
+ });
+
+ // MOMENTS
+
+ function getSetQuarter (input) {
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
+ }
+
+ // FORMATTING
+
+ addFormatToken('w', ['ww', 2], 'wo', 'week');
+ addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
+
+ // ALIASES
+
+ addUnitAlias('week', 'w');
+ addUnitAlias('isoWeek', 'W');
+
+ // PARSING
+
+ addRegexToken('w', match1to2);
+ addRegexToken('ww', match1to2, match2);
+ addRegexToken('W', match1to2);
+ addRegexToken('WW', match1to2, match2);
+
+ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
+ week[token.substr(0, 1)] = toInt(input);
+ });
+
+ // HELPERS
+
+ // LOCALES
+
+ function localeWeek (mom) {
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
+ }
+
+ var defaultLocaleWeek = {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ };
+
+ function localeFirstDayOfWeek () {
+ return this._week.dow;
+ }
+
+ function localeFirstDayOfYear () {
+ return this._week.doy;
+ }
+
+ // MOMENTS
+
+ function getSetWeek (input) {
+ var week = this.localeData().week(this);
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ function getSetISOWeek (input) {
+ var week = weekOfYear(this, 1, 4).week;
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ // FORMATTING
+
+ addFormatToken('D', ['DD', 2], 'Do', 'date');
+
+ // ALIASES
+
+ addUnitAlias('date', 'D');
+
+ // PARSING
+
+ addRegexToken('D', match1to2);
+ addRegexToken('DD', match1to2, match2);
+ addRegexToken('Do', function (isStrict, locale) {
+ return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
+ });
+
+ addParseToken(['D', 'DD'], DATE);
+ addParseToken('Do', function (input, array) {
+ array[DATE] = toInt(input.match(match1to2)[0], 10);
+ });
+
+ // MOMENTS
+
+ var getSetDayOfMonth = makeGetSet('Date', true);
+
+ // FORMATTING
+
+ addFormatToken('d', 0, 'do', 'day');
+
+ addFormatToken('dd', 0, 0, function (format) {
+ return this.localeData().weekdaysMin(this, format);
+ });
+
+ addFormatToken('ddd', 0, 0, function (format) {
+ return this.localeData().weekdaysShort(this, format);
+ });
+
+ addFormatToken('dddd', 0, 0, function (format) {
+ return this.localeData().weekdays(this, format);
+ });
+
+ addFormatToken('e', 0, 0, 'weekday');
+ addFormatToken('E', 0, 0, 'isoWeekday');
+
+ // ALIASES
+
+ addUnitAlias('day', 'd');
+ addUnitAlias('weekday', 'e');
+ addUnitAlias('isoWeekday', 'E');
+
+ // PARSING
+
+ addRegexToken('d', match1to2);
+ addRegexToken('e', match1to2);
+ addRegexToken('E', match1to2);
+ addRegexToken('dd', function (isStrict, locale) {
+ return locale.weekdaysMinRegex(isStrict);
+ });
+ addRegexToken('ddd', function (isStrict, locale) {
+ return locale.weekdaysShortRegex(isStrict);
+ });
+ addRegexToken('dddd', function (isStrict, locale) {
+ return locale.weekdaysRegex(isStrict);
+ });
+
+ addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
+ var weekday = config._locale.weekdaysParse(input, token, config._strict);
+ // if we didn't get a weekday name, mark the date as invalid
+ if (weekday != null) {
+ week.d = weekday;
+ } else {
+ getParsingFlags(config).invalidWeekday = input;
+ }
+ });
+
+ addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
+ week[token] = toInt(input);
+ });
+
+ // HELPERS
+
+ function parseWeekday(input, locale) {
+ if (typeof input !== 'string') {
+ return input;
+ }
+
+ if (!isNaN(input)) {
+ return parseInt(input, 10);
+ }
+
+ input = locale.weekdaysParse(input);
+ if (typeof input === 'number') {
+ return input;
+ }
+
+ return null;
+ }
+
+ // LOCALES
+
+ var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
+ function localeWeekdays (m, format) {
+ return isArray(this._weekdays) ? this._weekdays[m.day()] :
+ this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
+ }
+
+ var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
+ function localeWeekdaysShort (m) {
+ return this._weekdaysShort[m.day()];
+ }
+
+ var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
+ function localeWeekdaysMin (m) {
+ return this._weekdaysMin[m.day()];
+ }
+
+ function day_of_week__handleStrictParse(weekdayName, format, strict) {
+ var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
+ if (!this._weekdaysParse) {
+ this._weekdaysParse = [];
+ this._shortWeekdaysParse = [];
+ this._minWeekdaysParse = [];
+
+ for (i = 0; i < 7; ++i) {
+ mom = create_utc__createUTC([2000, 1]).day(i);
+ this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
+ this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
+ this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
+ }
+ }
+
+ if (strict) {
+ if (format === 'dddd') {
+ ii = indexOf.call(this._weekdaysParse, llc);
+ return ii !== -1 ? ii : null;
+ } else if (format === 'ddd') {
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
+ return ii !== -1 ? ii : null;
+ } else {
+ ii = indexOf.call(this._minWeekdaysParse, llc);
+ return ii !== -1 ? ii : null;
+ }
+ } else {
+ if (format === 'dddd') {
+ ii = indexOf.call(this._weekdaysParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._minWeekdaysParse, llc);
+ return ii !== -1 ? ii : null;
+ } else if (format === 'ddd') {
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._weekdaysParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._minWeekdaysParse, llc);
+ return ii !== -1 ? ii : null;
+ } else {
+ ii = indexOf.call(this._minWeekdaysParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._weekdaysParse, llc);
+ if (ii !== -1) {
+ return ii;
+ }
+ ii = indexOf.call(this._shortWeekdaysParse, llc);
+ return ii !== -1 ? ii : null;
+ }
+ }
+ }
+
+ function localeWeekdaysParse (weekdayName, format, strict) {
+ var i, mom, regex;
+
+ if (this._weekdaysParseExact) {
+ return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);
+ }
+
+ if (!this._weekdaysParse) {
+ this._weekdaysParse = [];
+ this._minWeekdaysParse = [];
+ this._shortWeekdaysParse = [];
+ this._fullWeekdaysParse = [];
+ }
+
+ for (i = 0; i < 7; i++) {
+ // make the regex if we don't have it already
+
+ mom = create_utc__createUTC([2000, 1]).day(i);
+ if (strict && !this._fullWeekdaysParse[i]) {
+ this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
+ this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
+ this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
+ }
+ if (!this._weekdaysParse[i]) {
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
+ return i;
+ } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
+ return i;
+ } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
+ return i;
+ } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function getSetDayOfWeek (input) {
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ if (input != null) {
+ input = parseWeekday(input, this.localeData());
+ return this.add(input - day, 'd');
+ } else {
+ return day;
+ }
+ }
+
+ function getSetLocaleDayOfWeek (input) {
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
+ return input == null ? weekday : this.add(input - weekday, 'd');
+ }
+
+ function getSetISODayOfWeek (input) {
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ // behaves the same as moment#day except
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
+ // as a setter, sunday should belong to the previous week.
+ return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
+ }
+
+ var defaultWeekdaysRegex = matchWord;
+ function weekdaysRegex (isStrict) {
+ if (this._weekdaysParseExact) {
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
+ computeWeekdaysParse.call(this);
+ }
+ if (isStrict) {
+ return this._weekdaysStrictRegex;
+ } else {
+ return this._weekdaysRegex;
+ }
+ } else {
+ return this._weekdaysStrictRegex && isStrict ?
+ this._weekdaysStrictRegex : this._weekdaysRegex;
+ }
+ }
+
+ var defaultWeekdaysShortRegex = matchWord;
+ function weekdaysShortRegex (isStrict) {
+ if (this._weekdaysParseExact) {
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
+ computeWeekdaysParse.call(this);
+ }
+ if (isStrict) {
+ return this._weekdaysShortStrictRegex;
+ } else {
+ return this._weekdaysShortRegex;
+ }
+ } else {
+ return this._weekdaysShortStrictRegex && isStrict ?
+ this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
+ }
+ }
+
+ var defaultWeekdaysMinRegex = matchWord;
+ function weekdaysMinRegex (isStrict) {
+ if (this._weekdaysParseExact) {
+ if (!hasOwnProp(this, '_weekdaysRegex')) {
+ computeWeekdaysParse.call(this);
+ }
+ if (isStrict) {
+ return this._weekdaysMinStrictRegex;
+ } else {
+ return this._weekdaysMinRegex;
+ }
+ } else {
+ return this._weekdaysMinStrictRegex && isStrict ?
+ this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
+ }
+ }
+
+
+ function computeWeekdaysParse () {
+ function cmpLenRev(a, b) {
+ return b.length - a.length;
+ }
+
+ var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
+ i, mom, minp, shortp, longp;
+ for (i = 0; i < 7; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, 1]).day(i);
+ minp = this.weekdaysMin(mom, '');
+ shortp = this.weekdaysShort(mom, '');
+ longp = this.weekdays(mom, '');
+ minPieces.push(minp);
+ shortPieces.push(shortp);
+ longPieces.push(longp);
+ mixedPieces.push(minp);
+ mixedPieces.push(shortp);
+ mixedPieces.push(longp);
+ }
+ // Sorting makes sure if one weekday (or abbr) is a prefix of another it
+ // will match the longer piece.
+ minPieces.sort(cmpLenRev);
+ shortPieces.sort(cmpLenRev);
+ longPieces.sort(cmpLenRev);
+ mixedPieces.sort(cmpLenRev);
+ for (i = 0; i < 7; i++) {
+ shortPieces[i] = regexEscape(shortPieces[i]);
+ longPieces[i] = regexEscape(longPieces[i]);
+ mixedPieces[i] = regexEscape(mixedPieces[i]);
+ }
+
+ this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
+ this._weekdaysShortRegex = this._weekdaysRegex;
+ this._weekdaysMinRegex = this._weekdaysRegex;
+
+ this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
+ this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
+ this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
+ }
+
+ // FORMATTING
+
+ addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
+
+ // ALIASES
+
+ addUnitAlias('dayOfYear', 'DDD');
+
+ // PARSING
+
+ addRegexToken('DDD', match1to3);
+ addRegexToken('DDDD', match3);
+ addParseToken(['DDD', 'DDDD'], function (input, array, config) {
+ config._dayOfYear = toInt(input);
+ });
+
+ // HELPERS
+
+ // MOMENTS
+
+ function getSetDayOfYear (input) {
+ var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
+ }
+
+ // FORMATTING
+
+ function hFormat() {
+ return this.hours() % 12 || 12;
+ }
+
+ function kFormat() {
+ return this.hours() || 24;
+ }
+
+ addFormatToken('H', ['HH', 2], 0, 'hour');
+ addFormatToken('h', ['hh', 2], 0, hFormat);
+ addFormatToken('k', ['kk', 2], 0, kFormat);
+
+ addFormatToken('hmm', 0, 0, function () {
+ return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
+ });
+
+ addFormatToken('hmmss', 0, 0, function () {
+ return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
+ zeroFill(this.seconds(), 2);
+ });
+
+ addFormatToken('Hmm', 0, 0, function () {
+ return '' + this.hours() + zeroFill(this.minutes(), 2);
+ });
+
+ addFormatToken('Hmmss', 0, 0, function () {
+ return '' + this.hours() + zeroFill(this.minutes(), 2) +
+ zeroFill(this.seconds(), 2);
+ });
+
+ function meridiem (token, lowercase) {
+ addFormatToken(token, 0, 0, function () {
+ return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
+ });
+ }
+
+ meridiem('a', true);
+ meridiem('A', false);
+
+ // ALIASES
+
+ addUnitAlias('hour', 'h');
+
+ // PARSING
+
+ function matchMeridiem (isStrict, locale) {
+ return locale._meridiemParse;
+ }
+
+ addRegexToken('a', matchMeridiem);
+ addRegexToken('A', matchMeridiem);
+ addRegexToken('H', match1to2);
+ addRegexToken('h', match1to2);
+ addRegexToken('HH', match1to2, match2);
+ addRegexToken('hh', match1to2, match2);
+
+ addRegexToken('hmm', match3to4);
+ addRegexToken('hmmss', match5to6);
+ addRegexToken('Hmm', match3to4);
+ addRegexToken('Hmmss', match5to6);
+
+ addParseToken(['H', 'HH'], HOUR);
+ addParseToken(['a', 'A'], function (input, array, config) {
+ config._isPm = config._locale.isPM(input);
+ config._meridiem = input;
+ });
+ addParseToken(['h', 'hh'], function (input, array, config) {
+ array[HOUR] = toInt(input);
+ getParsingFlags(config).bigHour = true;
+ });
+ addParseToken('hmm', function (input, array, config) {
+ var pos = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos));
+ array[MINUTE] = toInt(input.substr(pos));
+ getParsingFlags(config).bigHour = true;
+ });
+ addParseToken('hmmss', function (input, array, config) {
+ var pos1 = input.length - 4;
+ var pos2 = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos1));
+ array[MINUTE] = toInt(input.substr(pos1, 2));
+ array[SECOND] = toInt(input.substr(pos2));
+ getParsingFlags(config).bigHour = true;
+ });
+ addParseToken('Hmm', function (input, array, config) {
+ var pos = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos));
+ array[MINUTE] = toInt(input.substr(pos));
+ });
+ addParseToken('Hmmss', function (input, array, config) {
+ var pos1 = input.length - 4;
+ var pos2 = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos1));
+ array[MINUTE] = toInt(input.substr(pos1, 2));
+ array[SECOND] = toInt(input.substr(pos2));
+ });
+
+ // LOCALES
+
+ function localeIsPM (input) {
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
+ // Using charAt should be more compatible.
+ return ((input + '').toLowerCase().charAt(0) === 'p');
+ }
+
+ var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
+ function localeMeridiem (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'pm' : 'PM';
+ } else {
+ return isLower ? 'am' : 'AM';
+ }
+ }
+
+
+ // MOMENTS
+
+ // Setting the hour should keep the time, because the user explicitly
+ // specified which hour he wants. So trying to maintain the same hour (in
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
+ // this rule.
+ var getSetHour = makeGetSet('Hours', true);
+
+ // FORMATTING
+
+ addFormatToken('m', ['mm', 2], 0, 'minute');
+
+ // ALIASES
+
+ addUnitAlias('minute', 'm');
+
+ // PARSING
+
+ addRegexToken('m', match1to2);
+ addRegexToken('mm', match1to2, match2);
+ addParseToken(['m', 'mm'], MINUTE);
+
+ // MOMENTS
+
+ var getSetMinute = makeGetSet('Minutes', false);
+
+ // FORMATTING
+
+ addFormatToken('s', ['ss', 2], 0, 'second');
+
+ // ALIASES
+
+ addUnitAlias('second', 's');
+
+ // PARSING
+
+ addRegexToken('s', match1to2);
+ addRegexToken('ss', match1to2, match2);
+ addParseToken(['s', 'ss'], SECOND);
+
+ // MOMENTS
+
+ var getSetSecond = makeGetSet('Seconds', false);
+
+ // FORMATTING
+
+ addFormatToken('S', 0, 0, function () {
+ return ~~(this.millisecond() / 100);
+ });
+
+ addFormatToken(0, ['SS', 2], 0, function () {
+ return ~~(this.millisecond() / 10);
+ });
+
+ addFormatToken(0, ['SSS', 3], 0, 'millisecond');
+ addFormatToken(0, ['SSSS', 4], 0, function () {
+ return this.millisecond() * 10;
+ });
+ addFormatToken(0, ['SSSSS', 5], 0, function () {
+ return this.millisecond() * 100;
+ });
+ addFormatToken(0, ['SSSSSS', 6], 0, function () {
+ return this.millisecond() * 1000;
+ });
+ addFormatToken(0, ['SSSSSSS', 7], 0, function () {
+ return this.millisecond() * 10000;
+ });
+ addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
+ return this.millisecond() * 100000;
+ });
+ addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
+ return this.millisecond() * 1000000;
+ });
+
+
+ // ALIASES
+
+ addUnitAlias('millisecond', 'ms');
+
+ // PARSING
+
+ addRegexToken('S', match1to3, match1);
+ addRegexToken('SS', match1to3, match2);
+ addRegexToken('SSS', match1to3, match3);
+
+ var token;
+ for (token = 'SSSS'; token.length <= 9; token += 'S') {
+ addRegexToken(token, matchUnsigned);
+ }
+
+ function parseMs(input, array) {
+ array[MILLISECOND] = toInt(('0.' + input) * 1000);
+ }
+
+ for (token = 'S'; token.length <= 9; token += 'S') {
+ addParseToken(token, parseMs);
+ }
+ // MOMENTS
+
+ var getSetMillisecond = makeGetSet('Milliseconds', false);
+
+ // FORMATTING
+
+ addFormatToken('z', 0, 0, 'zoneAbbr');
+ addFormatToken('zz', 0, 0, 'zoneName');
+
+ // MOMENTS
+
+ function getZoneAbbr () {
+ return this._isUTC ? 'UTC' : '';
+ }
+
+ function getZoneName () {
+ return this._isUTC ? 'Coordinated Universal Time' : '';
+ }
+
+ var momentPrototype__proto = Moment.prototype;
+
+ momentPrototype__proto.add = add_subtract__add;
+ momentPrototype__proto.calendar = moment_calendar__calendar;
+ momentPrototype__proto.clone = clone;
+ momentPrototype__proto.diff = diff;
+ momentPrototype__proto.endOf = endOf;
+ momentPrototype__proto.format = format;
+ momentPrototype__proto.from = from;
+ momentPrototype__proto.fromNow = fromNow;
+ momentPrototype__proto.to = to;
+ momentPrototype__proto.toNow = toNow;
+ momentPrototype__proto.get = getSet;
+ momentPrototype__proto.invalidAt = invalidAt;
+ momentPrototype__proto.isAfter = isAfter;
+ momentPrototype__proto.isBefore = isBefore;
+ momentPrototype__proto.isBetween = isBetween;
+ momentPrototype__proto.isSame = isSame;
+ momentPrototype__proto.isSameOrAfter = isSameOrAfter;
+ momentPrototype__proto.isSameOrBefore = isSameOrBefore;
+ momentPrototype__proto.isValid = moment_valid__isValid;
+ momentPrototype__proto.lang = lang;
+ momentPrototype__proto.locale = locale;
+ momentPrototype__proto.localeData = localeData;
+ momentPrototype__proto.max = prototypeMax;
+ momentPrototype__proto.min = prototypeMin;
+ momentPrototype__proto.parsingFlags = parsingFlags;
+ momentPrototype__proto.set = getSet;
+ momentPrototype__proto.startOf = startOf;
+ momentPrototype__proto.subtract = add_subtract__subtract;
+ momentPrototype__proto.toArray = toArray;
+ momentPrototype__proto.toObject = toObject;
+ momentPrototype__proto.toDate = toDate;
+ momentPrototype__proto.toISOString = moment_format__toISOString;
+ momentPrototype__proto.toJSON = toJSON;
+ momentPrototype__proto.toString = toString;
+ momentPrototype__proto.unix = unix;
+ momentPrototype__proto.valueOf = to_type__valueOf;
+ momentPrototype__proto.creationData = creationData;
+
+ // Year
+ momentPrototype__proto.year = getSetYear;
+ momentPrototype__proto.isLeapYear = getIsLeapYear;
+
+ // Week Year
+ momentPrototype__proto.weekYear = getSetWeekYear;
+ momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
+
+ // Quarter
+ momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
+
+ // Month
+ momentPrototype__proto.month = getSetMonth;
+ momentPrototype__proto.daysInMonth = getDaysInMonth;
+
+ // Week
+ momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
+ momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
+ momentPrototype__proto.weeksInYear = getWeeksInYear;
+ momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
+
+ // Day
+ momentPrototype__proto.date = getSetDayOfMonth;
+ momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
+ momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
+ momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
+ momentPrototype__proto.dayOfYear = getSetDayOfYear;
+
+ // Hour
+ momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
+
+ // Minute
+ momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
+
+ // Second
+ momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
+
+ // Millisecond
+ momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
+
+ // Offset
+ momentPrototype__proto.utcOffset = getSetOffset;
+ momentPrototype__proto.utc = setOffsetToUTC;
+ momentPrototype__proto.local = setOffsetToLocal;
+ momentPrototype__proto.parseZone = setOffsetToParsedOffset;
+ momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
+ momentPrototype__proto.isDST = isDaylightSavingTime;
+ momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;
+ momentPrototype__proto.isLocal = isLocal;
+ momentPrototype__proto.isUtcOffset = isUtcOffset;
+ momentPrototype__proto.isUtc = isUtc;
+ momentPrototype__proto.isUTC = isUtc;
+
+ // Timezone
+ momentPrototype__proto.zoneAbbr = getZoneAbbr;
+ momentPrototype__proto.zoneName = getZoneName;
+
+ // Deprecations
+ momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
+ momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
+ momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
+ momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
+
+ var momentPrototype = momentPrototype__proto;
+
+ function moment__createUnix (input) {
+ return local__createLocal(input * 1000);
+ }
+
+ function moment__createInZone () {
+ return local__createLocal.apply(null, arguments).parseZone();
+ }
+
+ var defaultCalendar = {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ };
+
+ function locale_calendar__calendar (key, mom, now) {
+ var output = this._calendar[key];
+ return isFunction(output) ? output.call(mom, now) : output;
+ }
+
+ var defaultLongDateFormat = {
+ 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'
+ };
+
+ function longDateFormat (key) {
+ var format = this._longDateFormat[key],
+ formatUpper = this._longDateFormat[key.toUpperCase()];
+
+ if (format || !formatUpper) {
+ return format;
+ }
+
+ this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
+ return val.slice(1);
+ });
+
+ return this._longDateFormat[key];
+ }
+
+ var defaultInvalidDate = 'Invalid date';
+
+ function invalidDate () {
+ return this._invalidDate;
+ }
+
+ var defaultOrdinal = '%d';
+ var defaultOrdinalParse = /\d{1,2}/;
+
+ function ordinal (number) {
+ return this._ordinal.replace('%d', number);
+ }
+
+ function preParsePostFormat (string) {
+ return string;
+ }
+
+ var defaultRelativeTime = {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few 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'
+ };
+
+ function relative__relativeTime (number, withoutSuffix, string, isFuture) {
+ var output = this._relativeTime[string];
+ return (isFunction(output)) ?
+ output(number, withoutSuffix, string, isFuture) :
+ output.replace(/%d/i, number);
+ }
+
+ function pastFuture (diff, output) {
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
+ return isFunction(format) ? format(output) : format.replace(/%s/i, output);
+ }
+
+ var prototype__proto = Locale.prototype;
+
+ prototype__proto._calendar = defaultCalendar;
+ prototype__proto.calendar = locale_calendar__calendar;
+ prototype__proto._longDateFormat = defaultLongDateFormat;
+ prototype__proto.longDateFormat = longDateFormat;
+ prototype__proto._invalidDate = defaultInvalidDate;
+ prototype__proto.invalidDate = invalidDate;
+ prototype__proto._ordinal = defaultOrdinal;
+ prototype__proto.ordinal = ordinal;
+ prototype__proto._ordinalParse = defaultOrdinalParse;
+ prototype__proto.preparse = preParsePostFormat;
+ prototype__proto.postformat = preParsePostFormat;
+ prototype__proto._relativeTime = defaultRelativeTime;
+ prototype__proto.relativeTime = relative__relativeTime;
+ prototype__proto.pastFuture = pastFuture;
+ prototype__proto.set = locale_set__set;
+
+ // Month
+ prototype__proto.months = localeMonths;
+ prototype__proto._months = defaultLocaleMonths;
+ prototype__proto.monthsShort = localeMonthsShort;
+ prototype__proto._monthsShort = defaultLocaleMonthsShort;
+ prototype__proto.monthsParse = localeMonthsParse;
+ prototype__proto._monthsRegex = defaultMonthsRegex;
+ prototype__proto.monthsRegex = monthsRegex;
+ prototype__proto._monthsShortRegex = defaultMonthsShortRegex;
+ prototype__proto.monthsShortRegex = monthsShortRegex;
+
+ // Week
+ prototype__proto.week = localeWeek;
+ prototype__proto._week = defaultLocaleWeek;
+ prototype__proto.firstDayOfYear = localeFirstDayOfYear;
+ prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
+
+ // Day of Week
+ prototype__proto.weekdays = localeWeekdays;
+ prototype__proto._weekdays = defaultLocaleWeekdays;
+ prototype__proto.weekdaysMin = localeWeekdaysMin;
+ prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;
+ prototype__proto.weekdaysShort = localeWeekdaysShort;
+ prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;
+ prototype__proto.weekdaysParse = localeWeekdaysParse;
+
+ prototype__proto._weekdaysRegex = defaultWeekdaysRegex;
+ prototype__proto.weekdaysRegex = weekdaysRegex;
+ prototype__proto._weekdaysShortRegex = defaultWeekdaysShortRegex;
+ prototype__proto.weekdaysShortRegex = weekdaysShortRegex;
+ prototype__proto._weekdaysMinRegex = defaultWeekdaysMinRegex;
+ prototype__proto.weekdaysMinRegex = weekdaysMinRegex;
+
+ // Hours
+ prototype__proto.isPM = localeIsPM;
+ prototype__proto._meridiemParse = defaultLocaleMeridiemParse;
+ prototype__proto.meridiem = localeMeridiem;
+
+ function lists__get (format, index, field, setter) {
+ var locale = locale_locales__getLocale();
+ var utc = create_utc__createUTC().set(setter, index);
+ return locale[field](utc, format);
+ }
+
+ function listMonthsImpl (format, index, field) {
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+
+ if (index != null) {
+ return lists__get(format, index, field, 'month');
+ }
+
+ var i;
+ var out = [];
+ for (i = 0; i < 12; i++) {
+ out[i] = lists__get(format, i, field, 'month');
+ }
+ return out;
+ }
+
+ // ()
+ // (5)
+ // (fmt, 5)
+ // (fmt)
+ // (true)
+ // (true, 5)
+ // (true, fmt, 5)
+ // (true, fmt)
+ function listWeekdaysImpl (localeSorted, format, index, field) {
+ if (typeof localeSorted === 'boolean') {
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+ } else {
+ format = localeSorted;
+ index = format;
+ localeSorted = false;
+
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+ }
+
+ var locale = locale_locales__getLocale(),
+ shift = localeSorted ? locale._week.dow : 0;
+
+ if (index != null) {
+ return lists__get(format, (index + shift) % 7, field, 'day');
+ }
+
+ var i;
+ var out = [];
+ for (i = 0; i < 7; i++) {
+ out[i] = lists__get(format, (i + shift) % 7, field, 'day');
+ }
+ return out;
+ }
+
+ function lists__listMonths (format, index) {
+ return listMonthsImpl(format, index, 'months');
+ }
+
+ function lists__listMonthsShort (format, index) {
+ return listMonthsImpl(format, index, 'monthsShort');
+ }
+
+ function lists__listWeekdays (localeSorted, format, index) {
+ return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
+ }
+
+ function lists__listWeekdaysShort (localeSorted, format, index) {
+ return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
+ }
+
+ function lists__listWeekdaysMin (localeSorted, format, index) {
+ return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
+ }
+
+ locale_locales__getSetGlobalLocale('en', {
+ ordinalParse: /\d{1,2}(th|st|nd|rd)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+ });
+
+ // Side effect imports
+ utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
+ utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
+
+ var mathAbs = Math.abs;
+
+ function duration_abs__abs () {
+ var data = this._data;
+
+ this._milliseconds = mathAbs(this._milliseconds);
+ this._days = mathAbs(this._days);
+ this._months = mathAbs(this._months);
+
+ data.milliseconds = mathAbs(data.milliseconds);
+ data.seconds = mathAbs(data.seconds);
+ data.minutes = mathAbs(data.minutes);
+ data.hours = mathAbs(data.hours);
+ data.months = mathAbs(data.months);
+ data.years = mathAbs(data.years);
+
+ return this;
+ }
+
+ function duration_add_subtract__addSubtract (duration, input, value, direction) {
+ var other = create__createDuration(input, value);
+
+ duration._milliseconds += direction * other._milliseconds;
+ duration._days += direction * other._days;
+ duration._months += direction * other._months;
+
+ return duration._bubble();
+ }
+
+ // supports only 2.0-style add(1, 's') or add(duration)
+ function duration_add_subtract__add (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, 1);
+ }
+
+ // supports only 2.0-style subtract(1, 's') or subtract(duration)
+ function duration_add_subtract__subtract (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, -1);
+ }
+
+ function absCeil (number) {
+ if (number < 0) {
+ return Math.floor(number);
+ } else {
+ return Math.ceil(number);
+ }
+ }
+
+ function bubble () {
+ var milliseconds = this._milliseconds;
+ var days = this._days;
+ var months = this._months;
+ var data = this._data;
+ var seconds, minutes, hours, years, monthsFromDays;
+
+ // if we have a mix of positive and negative values, bubble down first
+ // check: https://github.com/moment/moment/issues/2166
+ if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
+ (milliseconds <= 0 && days <= 0 && months <= 0))) {
+ milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
+ days = 0;
+ months = 0;
+ }
+
+ // The following code bubbles up values, see the tests for
+ // examples of what that means.
+ data.milliseconds = milliseconds % 1000;
+
+ seconds = absFloor(milliseconds / 1000);
+ data.seconds = seconds % 60;
+
+ minutes = absFloor(seconds / 60);
+ data.minutes = minutes % 60;
+
+ hours = absFloor(minutes / 60);
+ data.hours = hours % 24;
+
+ days += absFloor(hours / 24);
+
+ // convert days to months
+ monthsFromDays = absFloor(daysToMonths(days));
+ months += monthsFromDays;
+ days -= absCeil(monthsToDays(monthsFromDays));
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+ data.days = days;
+ data.months = months;
+ data.years = years;
+
+ return this;
+ }
+
+ function daysToMonths (days) {
+ // 400 years have 146097 days (taking into account leap year rules)
+ // 400 years have 12 months === 4800
+ return days * 4800 / 146097;
+ }
+
+ function monthsToDays (months) {
+ // the reverse of daysToMonths
+ return months * 146097 / 4800;
+ }
+
+ function as (units) {
+ var days;
+ var months;
+ var milliseconds = this._milliseconds;
+
+ units = normalizeUnits(units);
+
+ if (units === 'month' || units === 'year') {
+ days = this._days + milliseconds / 864e5;
+ months = this._months + daysToMonths(days);
+ return units === 'month' ? months : months / 12;
+ } else {
+ // handle milliseconds separately because of floating point math errors (issue #1867)
+ days = this._days + Math.round(monthsToDays(this._months));
+ switch (units) {
+ case 'week' : return days / 7 + milliseconds / 6048e5;
+ case 'day' : return days + milliseconds / 864e5;
+ case 'hour' : return days * 24 + milliseconds / 36e5;
+ case 'minute' : return days * 1440 + milliseconds / 6e4;
+ case 'second' : return days * 86400 + milliseconds / 1000;
+ // Math.floor prevents floating point math errors here
+ case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
+ default: throw new Error('Unknown unit ' + units);
+ }
+ }
+ }
+
+ // TODO: Use this.as('ms')?
+ function duration_as__valueOf () {
+ return (
+ this._milliseconds +
+ this._days * 864e5 +
+ (this._months % 12) * 2592e6 +
+ toInt(this._months / 12) * 31536e6
+ );
+ }
+
+ function makeAs (alias) {
+ return function () {
+ return this.as(alias);
+ };
+ }
+
+ var asMilliseconds = makeAs('ms');
+ var asSeconds = makeAs('s');
+ var asMinutes = makeAs('m');
+ var asHours = makeAs('h');
+ var asDays = makeAs('d');
+ var asWeeks = makeAs('w');
+ var asMonths = makeAs('M');
+ var asYears = makeAs('y');
+
+ function duration_get__get (units) {
+ units = normalizeUnits(units);
+ return this[units + 's']();
+ }
+
+ function makeGetter(name) {
+ return function () {
+ return this._data[name];
+ };
+ }
+
+ var milliseconds = makeGetter('milliseconds');
+ var seconds = makeGetter('seconds');
+ var minutes = makeGetter('minutes');
+ var hours = makeGetter('hours');
+ var days = makeGetter('days');
+ var months = makeGetter('months');
+ var years = makeGetter('years');
+
+ function weeks () {
+ return absFloor(this.days() / 7);
+ }
+
+ var round = Math.round;
+ var thresholds = {
+ s: 45, // seconds to minute
+ m: 45, // minutes to hour
+ h: 22, // hours to day
+ d: 26, // days to month
+ M: 11 // months to year
+ };
+
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
+ }
+
+ function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
+ var duration = create__createDuration(posNegDuration).abs();
+ var seconds = round(duration.as('s'));
+ var minutes = round(duration.as('m'));
+ var hours = round(duration.as('h'));
+ var days = round(duration.as('d'));
+ var months = round(duration.as('M'));
+ var years = round(duration.as('y'));
+
+ var a = seconds < thresholds.s && ['s', seconds] ||
+ minutes <= 1 && ['m'] ||
+ minutes < thresholds.m && ['mm', minutes] ||
+ hours <= 1 && ['h'] ||
+ hours < thresholds.h && ['hh', hours] ||
+ days <= 1 && ['d'] ||
+ days < thresholds.d && ['dd', days] ||
+ months <= 1 && ['M'] ||
+ months < thresholds.M && ['MM', months] ||
+ years <= 1 && ['y'] || ['yy', years];
+
+ a[2] = withoutSuffix;
+ a[3] = +posNegDuration > 0;
+ a[4] = locale;
+ return substituteTimeAgo.apply(null, a);
+ }
+
+ // This function allows you to set a threshold for relative time strings
+ function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
+ if (thresholds[threshold] === undefined) {
+ return false;
+ }
+ if (limit === undefined) {
+ return thresholds[threshold];
+ }
+ thresholds[threshold] = limit;
+ return true;
+ }
+
+ function humanize (withSuffix) {
+ var locale = this.localeData();
+ var output = duration_humanize__relativeTime(this, !withSuffix, locale);
+
+ if (withSuffix) {
+ output = locale.pastFuture(+this, output);
+ }
+
+ return locale.postformat(output);
+ }
+
+ var iso_string__abs = Math.abs;
+
+ function iso_string__toISOString() {
+ // for ISO strings we do not use the normal bubbling rules:
+ // * milliseconds bubble up until they become hours
+ // * days do not bubble at all
+ // * months bubble up until they become years
+ // This is because there is no context-free conversion between hours and days
+ // (think of clock changes)
+ // and also not between days and months (28-31 days per month)
+ var seconds = iso_string__abs(this._milliseconds) / 1000;
+ var days = iso_string__abs(this._days);
+ var months = iso_string__abs(this._months);
+ var minutes, hours, years;
+
+ // 3600 seconds -> 60 minutes -> 1 hour
+ minutes = absFloor(seconds / 60);
+ hours = absFloor(minutes / 60);
+ seconds %= 60;
+ minutes %= 60;
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
+ var Y = years;
+ var M = months;
+ var D = days;
+ var h = hours;
+ var m = minutes;
+ var s = seconds;
+ var total = this.asSeconds();
+
+ if (!total) {
+ // this is the same as C#'s (Noda) and python (isodate)...
+ // but not other JS (goog.date)
+ return 'P0D';
+ }
+
+ return (total < 0 ? '-' : '') +
+ 'P' +
+ (Y ? Y + 'Y' : '') +
+ (M ? M + 'M' : '') +
+ (D ? D + 'D' : '') +
+ ((h || m || s) ? 'T' : '') +
+ (h ? h + 'H' : '') +
+ (m ? m + 'M' : '') +
+ (s ? s + 'S' : '');
+ }
+
+ var duration_prototype__proto = Duration.prototype;
+
+ duration_prototype__proto.abs = duration_abs__abs;
+ duration_prototype__proto.add = duration_add_subtract__add;
+ duration_prototype__proto.subtract = duration_add_subtract__subtract;
+ duration_prototype__proto.as = as;
+ duration_prototype__proto.asMilliseconds = asMilliseconds;
+ duration_prototype__proto.asSeconds = asSeconds;
+ duration_prototype__proto.asMinutes = asMinutes;
+ duration_prototype__proto.asHours = asHours;
+ duration_prototype__proto.asDays = asDays;
+ duration_prototype__proto.asWeeks = asWeeks;
+ duration_prototype__proto.asMonths = asMonths;
+ duration_prototype__proto.asYears = asYears;
+ duration_prototype__proto.valueOf = duration_as__valueOf;
+ duration_prototype__proto._bubble = bubble;
+ duration_prototype__proto.get = duration_get__get;
+ duration_prototype__proto.milliseconds = milliseconds;
+ duration_prototype__proto.seconds = seconds;
+ duration_prototype__proto.minutes = minutes;
+ duration_prototype__proto.hours = hours;
+ duration_prototype__proto.days = days;
+ duration_prototype__proto.weeks = weeks;
+ duration_prototype__proto.months = months;
+ duration_prototype__proto.years = years;
+ duration_prototype__proto.humanize = humanize;
+ duration_prototype__proto.toISOString = iso_string__toISOString;
+ duration_prototype__proto.toString = iso_string__toISOString;
+ duration_prototype__proto.toJSON = iso_string__toISOString;
+ duration_prototype__proto.locale = locale;
+ duration_prototype__proto.localeData = localeData;
+
+ // Deprecations
+ duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
+ duration_prototype__proto.lang = lang;
+
+ // Side effect imports
+
+ // FORMATTING
+
+ addFormatToken('X', 0, 0, 'unix');
+ addFormatToken('x', 0, 0, 'valueOf');
+
+ // PARSING
+
+ addRegexToken('x', matchSigned);
+ addRegexToken('X', matchTimestamp);
+ addParseToken('X', function (input, array, config) {
+ config._d = new Date(parseFloat(input, 10) * 1000);
+ });
+ addParseToken('x', function (input, array, config) {
+ config._d = new Date(toInt(input));
+ });
+
+ // Side effect imports
+
+
+ utils_hooks__hooks.version = '2.13.0';
+
+ setHookCallback(local__createLocal);
+
+ utils_hooks__hooks.fn = momentPrototype;
+ utils_hooks__hooks.min = min;
+ utils_hooks__hooks.max = max;
+ utils_hooks__hooks.now = now;
+ utils_hooks__hooks.utc = create_utc__createUTC;
+ utils_hooks__hooks.unix = moment__createUnix;
+ utils_hooks__hooks.months = lists__listMonths;
+ utils_hooks__hooks.isDate = isDate;
+ utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
+ utils_hooks__hooks.invalid = valid__createInvalid;
+ utils_hooks__hooks.duration = create__createDuration;
+ utils_hooks__hooks.isMoment = isMoment;
+ utils_hooks__hooks.weekdays = lists__listWeekdays;
+ utils_hooks__hooks.parseZone = moment__createInZone;
+ utils_hooks__hooks.localeData = locale_locales__getLocale;
+ utils_hooks__hooks.isDuration = isDuration;
+ utils_hooks__hooks.monthsShort = lists__listMonthsShort;
+ utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
+ utils_hooks__hooks.defineLocale = defineLocale;
+ utils_hooks__hooks.updateLocale = updateLocale;
+ utils_hooks__hooks.locales = locale_locales__listLocales;
+ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
+ utils_hooks__hooks.normalizeUnits = normalizeUnits;
+ utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
+ utils_hooks__hooks.prototype = momentPrototype;
+
+ var _moment = utils_hooks__hooks;
+
+ return _moment;
+
+ }));
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module)))
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ module.exports = function(module) {
+ if(!module.webpackPolyfill) {
+ module.deprecate = function() {};
+ module.paths = [];
+ // module.parent = undefined by default
+ module.children = [];
+ module.webpackPolyfill = 1;
+ }
+ return module;
+ }
+
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ function webpackContext(req) {
+ throw new Error("Cannot find module '" + req + "'.");
+ }
+ webpackContext.keys = function() { return []; };
+ webpackContext.resolve = webpackContext;
+ module.exports = webpackContext;
+ webpackContext.id = 5;
+
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+ var _rng;
+
+ var globalVar = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null;
+
+ if (globalVar && globalVar.crypto && crypto.getRandomValues) {
+ // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
+ // Moderately fast, high quality
+ var _rnds8 = new Uint8Array(16);
+ _rng = function whatwgRNG() {
+ crypto.getRandomValues(_rnds8);
+ return _rnds8;
+ };
+ }
+
+ if (!_rng) {
+ // Math.random()-based (RNG)
+ //
+ // If all else fails, use Math.random(). It's fast, but is of unspecified
+ // quality.
+ var _rnds = new Array(16);
+ _rng = function _rng() {
+ for (var i = 0, r; i < 16; i++) {
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
+ _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
+ }
+
+ return _rnds;
+ };
+ }
+
+ // uuid.js
+ //
+ // Copyright (c) 2010-2012 Robert Kieffer
+ // MIT License - http://opensource.org/licenses/mit-license.php
+
+ // Unique ID creation requires a high quality random # generator. We feature
+ // detect to determine the best RNG source, normalizing to a function that
+ // returns 128-bits of randomness, since that's what's usually required
+
+ //var _rng = require('./rng');
+
+ // Maps for number <-> hex string conversion
+ var _byteToHex = [];
+ var _hexToByte = {};
+ for (var i = 0; i < 256; i++) {
+ _byteToHex[i] = (i + 0x100).toString(16).substr(1);
+ _hexToByte[_byteToHex[i]] = i;
+ }
+
+ // **`parse()` - Parse a UUID into it's component bytes**
+ function parse(s, buf, offset) {
+ var i = buf && offset || 0,
+ ii = 0;
+
+ buf = buf || [];
+ s.toLowerCase().replace(/[0-9a-f]{2}/g, function (oct) {
+ if (ii < 16) {
+ // Don't overflow!
+ buf[i + ii++] = _hexToByte[oct];
+ }
+ });
+
+ // Zero out remaining bytes if string was short
+ while (ii < 16) {
+ buf[i + ii++] = 0;
+ }
+
+ return buf;
+ }
+
+ // **`unparse()` - Convert UUID byte array (ala parse()) into a string**
+ function unparse(buf, offset) {
+ var i = offset || 0,
+ bth = _byteToHex;
+ return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
+ }
+
+ // **`v1()` - Generate time-based UUID**
+ //
+ // Inspired by https://github.com/LiosK/UUID.js
+ // and http://docs.python.org/library/uuid.html
+
+ // random #'s we need to init node and clockseq
+ var _seedBytes = _rng();
+
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
+ var _nodeId = [_seedBytes[0] | 0x01, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]];
+
+ // Per 4.2.2, randomize (14 bit) clockseq
+ var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
+
+ // Previous uuid creation time
+ var _lastMSecs = 0,
+ _lastNSecs = 0;
+
+ // See https://github.com/broofa/node-uuid for API details
+ function v1(options, buf, offset) {
+ var i = buf && offset || 0;
+ var b = buf || [];
+
+ options = options || {};
+
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
+
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
+
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
+ // cycle to simulate higher resolution clock
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
+
+ // Time since last uuid creation (in msecs)
+ var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
+
+ // Per 4.2.1.2, Bump clockseq on clock regression
+ if (dt < 0 && options.clockseq === undefined) {
+ clockseq = clockseq + 1 & 0x3fff;
+ }
+
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
+ // time interval
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
+ nsecs = 0;
+ }
+
+ // Per 4.2.1.2 Throw error if too many uuids are requested
+ if (nsecs >= 10000) {
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+ }
+
+ _lastMSecs = msecs;
+ _lastNSecs = nsecs;
+ _clockseq = clockseq;
+
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
+ msecs += 12219292800000;
+
+ // `time_low`
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
+ b[i++] = tl >>> 24 & 0xff;
+ b[i++] = tl >>> 16 & 0xff;
+ b[i++] = tl >>> 8 & 0xff;
+ b[i++] = tl & 0xff;
+
+ // `time_mid`
+ var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
+ b[i++] = tmh >>> 8 & 0xff;
+ b[i++] = tmh & 0xff;
+
+ // `time_high_and_version`
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
+ b[i++] = tmh >>> 16 & 0xff;
+
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
+ b[i++] = clockseq >>> 8 | 0x80;
+
+ // `clock_seq_low`
+ b[i++] = clockseq & 0xff;
+
+ // `node`
+ var node = options.node || _nodeId;
+ for (var n = 0; n < 6; n++) {
+ b[i + n] = node[n];
+ }
+
+ return buf ? buf : unparse(b);
+ }
+
+ // **`v4()` - Generate random UUID**
+
+ // See https://github.com/broofa/node-uuid for API details
+ function v4(options, buf, offset) {
+ // Deprecated - 'format' argument, as supported in v1.2
+ var i = buf && offset || 0;
+
+ if (typeof options == 'string') {
+ buf = options == 'binary' ? new Array(16) : null;
+ options = null;
+ }
+ options = options || {};
+
+ var rnds = options.random || (options.rng || _rng)();
+
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
+ rnds[6] = rnds[6] & 0x0f | 0x40;
+ rnds[8] = rnds[8] & 0x3f | 0x80;
+
+ // Copy bytes to buffer, if provided
+ if (buf) {
+ for (var ii = 0; ii < 16; ii++) {
+ buf[i + ii] = rnds[ii];
+ }
+ }
+
+ return buf || unparse(rnds);
+ }
+
+ // Export public API
+ var uuid = v4;
+ uuid.v1 = v1;
+ uuid.v4 = v4;
+ uuid.parse = parse;
+ uuid.unparse = unparse;
+
+ module.exports = uuid;
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 7 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ // utils
+ exports.util = __webpack_require__(1);
+ exports.DOMutil = __webpack_require__(8);
+
+ // data
+ exports.DataSet = __webpack_require__(9);
+ exports.DataView = __webpack_require__(11);
+ exports.Queue = __webpack_require__(10);
+
+ // Graph3d
+ exports.Graph3d = __webpack_require__(12);
+ exports.graph3d = {
+ Camera: __webpack_require__(16),
+ Filter: __webpack_require__(17),
+ Point2d: __webpack_require__(15),
+ Point3d: __webpack_require__(14),
+ Slider: __webpack_require__(18),
+ StepNumber: __webpack_require__(19)
+ };
+
+ // bundled external libraries
+ exports.moment = __webpack_require__(2);
+ exports.Hammer = __webpack_require__(20);
+ exports.keycharm = __webpack_require__(23);
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ // DOM utility methods
+
+ /**
+ * this prepares the JSON container for allocating SVG elements
+ * @param JSONcontainer
+ * @private
+ */
+ exports.prepareElements = function (JSONcontainer) {
+ // cleanup the redundant svgElements;
+ for (var elementType in JSONcontainer) {
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;
+ JSONcontainer[elementType].used = [];
+ }
+ }
+ };
+
+ /**
+ * this cleans up all the unused SVG elements. By asking for the parentNode, we only need to supply the JSON container from
+ * which to remove the redundant elements.
+ *
+ * @param JSONcontainer
+ * @private
+ */
+ exports.cleanupElements = function (JSONcontainer) {
+ // cleanup the redundant svgElements;
+ for (var elementType in JSONcontainer) {
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ if (JSONcontainer[elementType].redundant) {
+ for (var i = 0; i < JSONcontainer[elementType].redundant.length; i++) {
+ JSONcontainer[elementType].redundant[i].parentNode.removeChild(JSONcontainer[elementType].redundant[i]);
+ }
+ JSONcontainer[elementType].redundant = [];
+ }
+ }
+ }
+ };
+
+ /**
+ * Ensures that all elements are removed first up so they can be recreated cleanly
+ * @param JSONcontainer
+ */
+ exports.resetElements = function (JSONcontainer) {
+ exports.prepareElements(JSONcontainer);
+ exports.cleanupElements(JSONcontainer);
+ exports.prepareElements(JSONcontainer);
+ };
+
+ /**
+ * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer
+ * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.
+ *
+ * @param elementType
+ * @param JSONcontainer
+ * @param svgContainer
+ * @returns {*}
+ * @private
+ */
+ exports.getSVGElement = function (elementType, JSONcontainer, svgContainer) {
+ var element;
+ // allocate SVG element, if it doesnt yet exist, create one.
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ // this element has been created before
+ // check if there is an redundant element
+ if (JSONcontainer[elementType].redundant.length > 0) {
+ element = JSONcontainer[elementType].redundant[0];
+ JSONcontainer[elementType].redundant.shift();
+ } else {
+ // create a new element and add it to the SVG
+ element = document.createElementNS('http://www.w3.org/2000/svg', elementType);
+ svgContainer.appendChild(element);
+ }
+ } else {
+ // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.
+ element = document.createElementNS('http://www.w3.org/2000/svg', elementType);
+ JSONcontainer[elementType] = { used: [], redundant: [] };
+ svgContainer.appendChild(element);
+ }
+ JSONcontainer[elementType].used.push(element);
+ return element;
+ };
+
+ /**
+ * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer
+ * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.
+ *
+ * @param elementType
+ * @param JSONcontainer
+ * @param DOMContainer
+ * @returns {*}
+ * @private
+ */
+ exports.getDOMElement = function (elementType, JSONcontainer, DOMContainer, insertBefore) {
+ var element;
+ // allocate DOM element, if it doesnt yet exist, create one.
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ // this element has been created before
+ // check if there is an redundant element
+ if (JSONcontainer[elementType].redundant.length > 0) {
+ element = JSONcontainer[elementType].redundant[0];
+ JSONcontainer[elementType].redundant.shift();
+ } else {
+ // create a new element and add it to the SVG
+ element = document.createElement(elementType);
+ if (insertBefore !== undefined) {
+ DOMContainer.insertBefore(element, insertBefore);
+ } else {
+ DOMContainer.appendChild(element);
+ }
+ }
+ } else {
+ // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.
+ element = document.createElement(elementType);
+ JSONcontainer[elementType] = { used: [], redundant: [] };
+ if (insertBefore !== undefined) {
+ DOMContainer.insertBefore(element, insertBefore);
+ } else {
+ DOMContainer.appendChild(element);
+ }
+ }
+ JSONcontainer[elementType].used.push(element);
+ return element;
+ };
+
+ /**
+ * Draw a point object. This is a separate function because it can also be called by the legend.
+ * The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions
+ * as well.
+ *
+ * @param x
+ * @param y
+ * @param groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' }
+ * @param JSONcontainer
+ * @param svgContainer
+ * @param labelObj
+ * @returns {*}
+ */
+ exports.drawPoint = function (x, y, groupTemplate, JSONcontainer, svgContainer, labelObj) {
+ var point;
+ if (groupTemplate.style == 'circle') {
+ point = exports.getSVGElement('circle', JSONcontainer, svgContainer);
+ point.setAttributeNS(null, "cx", x);
+ point.setAttributeNS(null, "cy", y);
+ point.setAttributeNS(null, "r", 0.5 * groupTemplate.size);
+ } else {
+ point = exports.getSVGElement('rect', JSONcontainer, svgContainer);
+ point.setAttributeNS(null, "x", x - 0.5 * groupTemplate.size);
+ point.setAttributeNS(null, "y", y - 0.5 * groupTemplate.size);
+ point.setAttributeNS(null, "width", groupTemplate.size);
+ point.setAttributeNS(null, "height", groupTemplate.size);
+ }
+
+ if (groupTemplate.styles !== undefined) {
+ point.setAttributeNS(null, "style", groupTemplate.styles);
+ }
+ point.setAttributeNS(null, "class", groupTemplate.className + " vis-point");
+ //handle label
+
+ if (labelObj) {
+ var label = exports.getSVGElement('text', JSONcontainer, svgContainer);
+ if (labelObj.xOffset) {
+ x = x + labelObj.xOffset;
+ }
+
+ if (labelObj.yOffset) {
+ y = y + labelObj.yOffset;
+ }
+ if (labelObj.content) {
+ label.textContent = labelObj.content;
+ }
+
+ if (labelObj.className) {
+ label.setAttributeNS(null, "class", labelObj.className + " vis-label");
+ }
+ label.setAttributeNS(null, "x", x);
+ label.setAttributeNS(null, "y", y);
+ }
+
+ return point;
+ };
+
+ /**
+ * draw a bar SVG element centered on the X coordinate
+ *
+ * @param x
+ * @param y
+ * @param className
+ */
+ exports.drawBar = function (x, y, width, height, className, JSONcontainer, svgContainer, style) {
+ if (height != 0) {
+ if (height < 0) {
+ height *= -1;
+ y -= height;
+ }
+ var rect = exports.getSVGElement('rect', JSONcontainer, svgContainer);
+ rect.setAttributeNS(null, "x", x - 0.5 * width);
+ rect.setAttributeNS(null, "y", y);
+ rect.setAttributeNS(null, "width", width);
+ rect.setAttributeNS(null, "height", height);
+ rect.setAttributeNS(null, "class", className);
+ if (style) {
+ rect.setAttributeNS(null, "style", style);
+ }
+ }
+ };
+
+/***/ },
+/* 9 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var util = __webpack_require__(1);
+ var Queue = __webpack_require__(10);
+
+ /**
+ * DataSet
+ *
+ * Usage:
+ * var dataSet = new DataSet({
+ * fieldId: '_id',
+ * type: {
+ * // ...
+ * }
+ * });
+ *
+ * dataSet.add(item);
+ * dataSet.add(data);
+ * dataSet.update(item);
+ * dataSet.update(data);
+ * dataSet.remove(id);
+ * dataSet.remove(ids);
+ * var data = dataSet.get();
+ * var data = dataSet.get(id);
+ * var data = dataSet.get(ids);
+ * var data = dataSet.get(ids, options, data);
+ * dataSet.clear();
+ *
+ * A data set can:
+ * - add/remove/update data
+ * - gives triggers upon changes in the data
+ * - can import/export data in various data formats
+ *
+ * @param {Array} [data] Optional array with initial data
+ * @param {Object} [options] Available options:
+ * {String} fieldId Field name of the id in the
+ * items, 'id' by default.
+ * {Object.<String, String} type
+ * A map with field names as key,
+ * and the field type as value.
+ * {Object} queue Queue changes to the DataSet,
+ * flush them all at once.
+ * Queue options:
+ * - {number} delay Delay in ms, null by default
+ * - {number} max Maximum number of entries in the queue, Infinity by default
+ * @constructor DataSet
+ */
+ // TODO: add a DataSet constructor DataSet(data, options)
+ function DataSet(data, options) {
+ // correctly read optional arguments
+ if (data && !Array.isArray(data)) {
+ options = data;
+ data = null;
+ }
+
+ this._options = options || {};
+ this._data = {}; // map with data indexed by id
+ this.length = 0; // number of items in the DataSet
+ this._fieldId = this._options.fieldId || 'id'; // name of the field containing id
+ this._type = {}; // internal field types (NOTE: this can differ from this._options.type)
+
+ // all variants of a Date are internally stored as Date, so we can convert
+ // from everything to everything (also from ISODate to Number for example)
+ if (this._options.type) {
+ var fields = Object.keys(this._options.type);
+ for (var i = 0, len = fields.length; i < len; i++) {
+ var field = fields[i];
+ var value = this._options.type[field];
+ if (value == 'Date' || value == 'ISODate' || value == 'ASPDate') {
+ this._type[field] = 'Date';
+ } else {
+ this._type[field] = value;
+ }
+ }
+ }
+
+ // TODO: deprecated since version 1.1.1 (or 2.0.0?)
+ if (this._options.convert) {
+ throw new Error('Option "convert" is deprecated. Use "type" instead.');
+ }
+
+ this._subscribers = {}; // event subscribers
+
+ // add initial data when provided
+ if (data) {
+ this.add(data);
+ }
+
+ this.setOptions(options);
+ }
+
+ /**
+ * @param {Object} [options] Available options:
+ * {Object} queue Queue changes to the DataSet,
+ * flush them all at once.
+ * Queue options:
+ * - {number} delay Delay in ms, null by default
+ * - {number} max Maximum number of entries in the queue, Infinity by default
+ * @param options
+ */
+ DataSet.prototype.setOptions = function (options) {
+ if (options && options.queue !== undefined) {
+ if (options.queue === false) {
+ // delete queue if loaded
+ if (this._queue) {
+ this._queue.destroy();
+ delete this._queue;
+ }
+ } else {
+ // create queue and update its options
+ if (!this._queue) {
+ this._queue = Queue.extend(this, {
+ replace: ['add', 'update', 'remove']
+ });
+ }
+
+ if (_typeof(options.queue) === 'object') {
+ this._queue.setOptions(options.queue);
+ }
+ }
+ }
+ };
+
+ /**
+ * Subscribe to an event, add an event listener
+ * @param {String} event Event name. Available events: 'put', 'update',
+ * 'remove'
+ * @param {function} callback Callback method. Called with three parameters:
+ * {String} event
+ * {Object | null} params
+ * {String | Number} senderId
+ */
+ DataSet.prototype.on = function (event, callback) {
+ var subscribers = this._subscribers[event];
+ if (!subscribers) {
+ subscribers = [];
+ this._subscribers[event] = subscribers;
+ }
+
+ subscribers.push({
+ callback: callback
+ });
+ };
+
+ // TODO: remove this deprecated function some day (replaced with `on` since version 0.5, deprecated since v4.0)
+ DataSet.prototype.subscribe = function () {
+ throw new Error('DataSet.subscribe is deprecated. Use DataSet.on instead.');
+ };
+
+ /**
+ * Unsubscribe from an event, remove an event listener
+ * @param {String} event
+ * @param {function} callback
+ */
+ DataSet.prototype.off = function (event, callback) {
+ var subscribers = this._subscribers[event];
+ if (subscribers) {
+ this._subscribers[event] = subscribers.filter(function (listener) {
+ return listener.callback != callback;
+ });
+ }
+ };
+
+ // TODO: remove this deprecated function some day (replaced with `on` since version 0.5, deprecated since v4.0)
+ DataSet.prototype.unsubscribe = function () {
+ throw new Error('DataSet.unsubscribe is deprecated. Use DataSet.off instead.');
+ };
+
+ /**
+ * Trigger an event
+ * @param {String} event
+ * @param {Object | null} params
+ * @param {String} [senderId] Optional id of the sender.
+ * @private
+ */
+ DataSet.prototype._trigger = function (event, params, senderId) {
+ if (event == '*') {
+ throw new Error('Cannot trigger event *');
+ }
+
+ var subscribers = [];
+ if (event in this._subscribers) {
+ subscribers = subscribers.concat(this._subscribers[event]);
+ }
+ if ('*' in this._subscribers) {
+ subscribers = subscribers.concat(this._subscribers['*']);
+ }
+
+ for (var i = 0, len = subscribers.length; i < len; i++) {
+ var subscriber = subscribers[i];
+ if (subscriber.callback) {
+ subscriber.callback(event, params, senderId || null);
+ }
+ }
+ };
+
+ /**
+ * Add data.
+ * Adding an item will fail when there already is an item with the same id.
+ * @param {Object | Array} data
+ * @param {String} [senderId] Optional sender id
+ * @return {Array} addedIds Array with the ids of the added items
+ */
+ DataSet.prototype.add = function (data, senderId) {
+ var addedIds = [],
+ id,
+ me = this;
+
+ if (Array.isArray(data)) {
+ // Array
+ for (var i = 0, len = data.length; i < len; i++) {
+ id = me._addItem(data[i]);
+ addedIds.push(id);
+ }
+ } else if (data instanceof Object) {
+ // Single item
+ id = me._addItem(data);
+ addedIds.push(id);
+ } else {
+ throw new Error('Unknown dataType');
+ }
+
+ if (addedIds.length) {
+ this._trigger('add', { items: addedIds }, senderId);
+ }
+
+ return addedIds;
+ };
+
+ /**
+ * Update existing items. When an item does not exist, it will be created
+ * @param {Object | Array} data
+ * @param {String} [senderId] Optional sender id
+ * @return {Array} updatedIds The ids of the added or updated items
+ */
+ DataSet.prototype.update = function (data, senderId) {
+ var addedIds = [];
+ var updatedIds = [];
+ var oldData = [];
+ var updatedData = [];
+ var me = this;
+ var fieldId = me._fieldId;
+
+ var addOrUpdate = function addOrUpdate(item) {
+ var id = item[fieldId];
+ if (me._data[id]) {
+ var oldItem = util.extend({}, me._data[id]);
+ // update item
+ id = me._updateItem(item);
+ updatedIds.push(id);
+ updatedData.push(item);
+ oldData.push(oldItem);
+ } else {
+ // add new item
+ id = me._addItem(item);
+ addedIds.push(id);
+ }
+ };
+
+ if (Array.isArray(data)) {
+ // Array
+ for (var i = 0, len = data.length; i < len; i++) {
+ if (data[i] instanceof Object) {
+ addOrUpdate(data[i]);
+ } else {
+ console.warn('Ignoring input item, which is not an object at index ' + i);
+ }
+ }
+ } else if (data instanceof Object) {
+ // Single item
+ addOrUpdate(data);
+ } else {
+ throw new Error('Unknown dataType');
+ }
+
+ if (addedIds.length) {
+ this._trigger('add', { items: addedIds }, senderId);
+ }
+ if (updatedIds.length) {
+ var props = { items: updatedIds, oldData: oldData, data: updatedData };
+ // TODO: remove deprecated property 'data' some day
+ //Object.defineProperty(props, 'data', {
+ // 'get': (function() {
+ // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');
+ // return updatedData;
+ // }).bind(this)
+ //});
+ this._trigger('update', props, senderId);
+ }
+
+ return addedIds.concat(updatedIds);
+ };
+
+ /**
+ * Get a data item or multiple items.
+ *
+ * Usage:
+ *
+ * get()
+ * get(options: Object)
+ *
+ * get(id: Number | String)
+ * get(id: Number | String, options: Object)
+ *
+ * get(ids: Number[] | String[])
+ * get(ids: Number[] | String[], options: Object)
+ *
+ * Where:
+ *
+ * {Number | String} id The id of an item
+ * {Number[] | String{}} ids An array with ids of items
+ * {Object} options An Object with options. Available options:
+ * {String} [returnType] Type of data to be returned.
+ * Can be 'Array' (default) or 'Object'.
+ * {Object.<String, String>} [type]
+ * {String[]} [fields] field names to be returned
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by a field name or custom sort function.
+ * @throws Error
+ */
+ DataSet.prototype.get = function (args) {
+ var me = this;
+
+ // parse the arguments
+ var id, ids, options;
+ var firstType = util.getType(arguments[0]);
+ if (firstType == 'String' || firstType == 'Number') {
+ // get(id [, options])
+ id = arguments[0];
+ options = arguments[1];
+ } else if (firstType == 'Array') {
+ // get(ids [, options])
+ ids = arguments[0];
+ options = arguments[1];
+ } else {
+ // get([, options])
+ options = arguments[0];
+ }
+
+ // determine the return type
+ var returnType;
+ if (options && options.returnType) {
+ var allowedValues = ['Array', 'Object'];
+ returnType = allowedValues.indexOf(options.returnType) == -1 ? 'Array' : options.returnType;
+ } else {
+ returnType = 'Array';
+ }
+
+ // build options
+ var type = options && options.type || this._options.type;
+ var filter = options && options.filter;
+ var items = [],
+ item,
+ itemIds,
+ itemId,
+ i,
+ len;
+
+ // convert items
+ if (id != undefined) {
+ // return a single item
+ item = me._getItem(id, type);
+ if (item && filter && !filter(item)) {
+ item = null;
+ }
+ } else if (ids != undefined) {
+ // return a subset of items
+ for (i = 0, len = ids.length; i < len; i++) {
+ item = me._getItem(ids[i], type);
+ if (!filter || filter(item)) {
+ items.push(item);
+ }
+ }
+ } else {
+ // return all items
+ itemIds = Object.keys(this._data);
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ itemId = itemIds[i];
+ item = me._getItem(itemId, type);
+ if (!filter || filter(item)) {
+ items.push(item);
+ }
+ }
+ }
+
+ // order the results
+ if (options && options.order && id == undefined) {
+ this._sort(items, options.order);
+ }
+
+ // filter fields of the items
+ if (options && options.fields) {
+ var fields = options.fields;
+ if (id != undefined) {
+ item = this._filterFields(item, fields);
+ } else {
+ for (i = 0, len = items.length; i < len; i++) {
+ items[i] = this._filterFields(items[i], fields);
+ }
+ }
+ }
+
+ // return the results
+ if (returnType == 'Object') {
+ var result = {},
+ resultant;
+ for (i = 0, len = items.length; i < len; i++) {
+ resultant = items[i];
+ result[resultant.id] = resultant;
+ }
+ return result;
+ } else {
+ if (id != undefined) {
+ // a single item
+ return item;
+ } else {
+ // just return our array
+ return items;
+ }
+ }
+ };
+
+ /**
+ * Get ids of all items or from a filtered set of items.
+ * @param {Object} [options] An Object with options. Available options:
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Array} ids
+ */
+ DataSet.prototype.getIds = function (options) {
+ var data = this._data,
+ filter = options && options.filter,
+ order = options && options.order,
+ type = options && options.type || this._options.type,
+ itemIds = Object.keys(data),
+ i,
+ len,
+ id,
+ item,
+ items,
+ ids = [];
+
+ if (filter) {
+ // get filtered items
+ if (order) {
+ // create ordered list
+ items = [];
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ id = itemIds[i];
+ item = this._getItem(id, type);
+ if (filter(item)) {
+ items.push(item);
+ }
+ }
+
+ this._sort(items, order);
+
+ for (i = 0, len = items.length; i < len; i++) {
+ ids.push(items[i][this._fieldId]);
+ }
+ } else {
+ // create unordered list
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ id = itemIds[i];
+ item = this._getItem(id, type);
+ if (filter(item)) {
+ ids.push(item[this._fieldId]);
+ }
+ }
+ }
+ } else {
+ // get all items
+ if (order) {
+ // create an ordered list
+ items = [];
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ id = itemIds[i];
+ items.push(data[id]);
+ }
+
+ this._sort(items, order);
+
+ for (i = 0, len = items.length; i < len; i++) {
+ ids.push(items[i][this._fieldId]);
+ }
+ } else {
+ // create unordered list
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ id = itemIds[i];
+ item = data[id];
+ ids.push(item[this._fieldId]);
+ }
+ }
+ }
+
+ return ids;
+ };
+
+ /**
+ * Returns the DataSet itself. Is overwritten for example by the DataView,
+ * which returns the DataSet it is connected to instead.
+ */
+ DataSet.prototype.getDataSet = function () {
+ return this;
+ };
+
+ /**
+ * Execute a callback function for every item in the dataset.
+ * @param {function} callback
+ * @param {Object} [options] Available options:
+ * {Object.<String, String>} [type]
+ * {String[]} [fields] filter fields
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ */
+ DataSet.prototype.forEach = function (callback, options) {
+ var filter = options && options.filter,
+ type = options && options.type || this._options.type,
+ data = this._data,
+ itemIds = Object.keys(data),
+ i,
+ len,
+ item,
+ id;
+
+ if (options && options.order) {
+ // execute forEach on ordered list
+ var items = this.get(options);
+
+ for (i = 0, len = items.length; i < len; i++) {
+ item = items[i];
+ id = item[this._fieldId];
+ callback(item, id);
+ }
+ } else {
+ // unordered
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ id = itemIds[i];
+ item = this._getItem(id, type);
+ if (!filter || filter(item)) {
+ callback(item, id);
+ }
+ }
+ }
+ };
+
+ /**
+ * Map every item in the dataset.
+ * @param {function} callback
+ * @param {Object} [options] Available options:
+ * {Object.<String, String>} [type]
+ * {String[]} [fields] filter fields
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Object[]} mappedItems
+ */
+ DataSet.prototype.map = function (callback, options) {
+ var filter = options && options.filter,
+ type = options && options.type || this._options.type,
+ mappedItems = [],
+ data = this._data,
+ itemIds = Object.keys(data),
+ i,
+ len,
+ id,
+ item;
+
+ // convert and filter items
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ id = itemIds[i];
+ item = this._getItem(id, type);
+ if (!filter || filter(item)) {
+ mappedItems.push(callback(item, id));
+ }
+ }
+
+ // order items
+ if (options && options.order) {
+ this._sort(mappedItems, options.order);
+ }
+
+ return mappedItems;
+ };
+
+ /**
+ * Filter the fields of an item
+ * @param {Object | null} item
+ * @param {String[]} fields Field names
+ * @return {Object | null} filteredItem or null if no item is provided
+ * @private
+ */
+ DataSet.prototype._filterFields = function (item, fields) {
+ if (!item) {
+ // item is null
+ return item;
+ }
+
+ var filteredItem = {},
+ itemFields = Object.keys(item),
+ len = itemFields.length,
+ i,
+ field;
+
+ if (Array.isArray(fields)) {
+ for (i = 0; i < len; i++) {
+ field = itemFields[i];
+ if (fields.indexOf(field) != -1) {
+ filteredItem[field] = item[field];
+ }
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ field = itemFields[i];
+ if (fields.hasOwnProperty(field)) {
+ filteredItem[fields[field]] = item[field];
+ }
+ }
+ }
+
+ return filteredItem;
+ };
+
+ /**
+ * Sort the provided array with items
+ * @param {Object[]} items
+ * @param {String | function} order A field name or custom sort function.
+ * @private
+ */
+ DataSet.prototype._sort = function (items, order) {
+ if (util.isString(order)) {
+ // order by provided field name
+ var name = order; // field name
+ items.sort(function (a, b) {
+ var av = a[name];
+ var bv = b[name];
+ return av > bv ? 1 : av < bv ? -1 : 0;
+ });
+ } else if (typeof order === 'function') {
+ // order by sort function
+ items.sort(order);
+ }
+ // TODO: extend order by an Object {field:String, direction:String}
+ // where direction can be 'asc' or 'desc'
+ else {
+ throw new TypeError('Order must be a function or a string');
+ }
+ };
+
+ /**
+ * Remove an object by pointer or by id
+ * @param {String | Number | Object | Array} id Object or id, or an array with
+ * objects or ids to be removed
+ * @param {String} [senderId] Optional sender id
+ * @return {Array} removedIds
+ */
+ DataSet.prototype.remove = function (id, senderId) {
+ var removedIds = [],
+ i,
+ len,
+ removedId;
+
+ if (Array.isArray(id)) {
+ for (i = 0, len = id.length; i < len; i++) {
+ removedId = this._remove(id[i]);
+ if (removedId != null) {
+ removedIds.push(removedId);
+ }
+ }
+ } else {
+ removedId = this._remove(id);
+ if (removedId != null) {
+ removedIds.push(removedId);
+ }
+ }
+
+ if (removedIds.length) {
+ this._trigger('remove', { items: removedIds }, senderId);
+ }
+
+ return removedIds;
+ };
+
+ /**
+ * Remove an item by its id
+ * @param {Number | String | Object} id id or item
+ * @returns {Number | String | null} id
+ * @private
+ */
+ DataSet.prototype._remove = function (id) {
+ if (util.isNumber(id) || util.isString(id)) {
+ if (this._data[id]) {
+ delete this._data[id];
+ this.length--;
+ return id;
+ }
+ } else if (id instanceof Object) {
+ var itemId = id[this._fieldId];
+ if (itemId !== undefined && this._data[itemId]) {
+ delete this._data[itemId];
+ this.length--;
+ return itemId;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Clear the data
+ * @param {String} [senderId] Optional sender id
+ * @return {Array} removedIds The ids of all removed items
+ */
+ DataSet.prototype.clear = function (senderId) {
+ var ids = Object.keys(this._data);
+
+ this._data = {};
+ this.length = 0;
+
+ this._trigger('remove', { items: ids }, senderId);
+
+ return ids;
+ };
+
+ /**
+ * Find the item with maximum value of a specified field
+ * @param {String} field
+ * @return {Object | null} item Item containing max value, or null if no items
+ */
+ DataSet.prototype.max = function (field) {
+ var data = this._data,
+ itemIds = Object.keys(data),
+ max = null,
+ maxField = null,
+ i,
+ len;
+
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ var id = itemIds[i];
+ var item = data[id];
+ var itemField = item[field];
+ if (itemField != null && (!max || itemField > maxField)) {
+ max = item;
+ maxField = itemField;
+ }
+ }
+
+ return max;
+ };
+
+ /**
+ * Find the item with minimum value of a specified field
+ * @param {String} field
+ * @return {Object | null} item Item containing max value, or null if no items
+ */
+ DataSet.prototype.min = function (field) {
+ var data = this._data,
+ itemIds = Object.keys(data),
+ min = null,
+ minField = null,
+ i,
+ len;
+
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ var id = itemIds[i];
+ var item = data[id];
+ var itemField = item[field];
+ if (itemField != null && (!min || itemField < minField)) {
+ min = item;
+ minField = itemField;
+ }
+ }
+
+ return min;
+ };
+
+ /**
+ * Find all distinct values of a specified field
+ * @param {String} field
+ * @return {Array} values Array containing all distinct values. If data items
+ * do not contain the specified field are ignored.
+ * The returned array is unordered.
+ */
+ DataSet.prototype.distinct = function (field) {
+ var data = this._data;
+ var itemIds = Object.keys(data);
+ var values = [];
+ var fieldType = this._options.type && this._options.type[field] || null;
+ var count = 0;
+ var i, j, len;
+
+ for (i = 0, len = itemIds.length; i < len; i++) {
+ var id = itemIds[i];
+ var item = data[id];
+ var value = item[field];
+ var exists = false;
+ for (j = 0; j < count; j++) {
+ if (values[j] == value) {
+ exists = true;
+ break;
+ }
+ }
+ if (!exists && value !== undefined) {
+ values[count] = value;
+ count++;
+ }
+ }
+
+ if (fieldType) {
+ for (i = 0, len = values.length; i < len; i++) {
+ values[i] = util.convert(values[i], fieldType);
+ }
+ }
+
+ return values;
+ };
+
+ /**
+ * Add a single item. Will fail when an item with the same id already exists.
+ * @param {Object} item
+ * @return {String} id
+ * @private
+ */
+ DataSet.prototype._addItem = function (item) {
+ var id = item[this._fieldId];
+
+ if (id != undefined) {
+ // check whether this id is already taken
+ if (this._data[id]) {
+ // item already exists
+ throw new Error('Cannot add item: item with id ' + id + ' already exists');
+ }
+ } else {
+ // generate an id
+ id = util.randomUUID();
+ item[this._fieldId] = id;
+ }
+
+ var d = {},
+ fields = Object.keys(item),
+ i,
+ len;
+ for (i = 0, len = fields.length; i < len; i++) {
+ var field = fields[i];
+ var fieldType = this._type[field]; // type may be undefined
+ d[field] = util.convert(item[field], fieldType);
+ }
+ this._data[id] = d;
+ this.length++;
+
+ return id;
+ };
+
+ /**
+ * Get an item. Fields can be converted to a specific type
+ * @param {String} id
+ * @param {Object.<String, String>} [types] field types to convert
+ * @return {Object | null} item
+ * @private
+ */
+ DataSet.prototype._getItem = function (id, types) {
+ var field, value, i, len;
+
+ // get the item from the dataset
+ var raw = this._data[id];
+ if (!raw) {
+ return null;
+ }
+
+ // convert the items field types
+ var converted = {},
+ fields = Object.keys(raw);
+
+ if (types) {
+ for (i = 0, len = fields.length; i < len; i++) {
+ field = fields[i];
+ value = raw[field];
+ converted[field] = util.convert(value, types[field]);
+ }
+ } else {
+ // no field types specified, no converting needed
+ for (i = 0, len = fields.length; i < len; i++) {
+ field = fields[i];
+ value = raw[field];
+ converted[field] = value;
+ }
+ }
+ return converted;
+ };
+
+ /**
+ * Update a single item: merge with existing item.
+ * Will fail when the item has no id, or when there does not exist an item
+ * with the same id.
+ * @param {Object} item
+ * @return {String} id
+ * @private
+ */
+ DataSet.prototype._updateItem = function (item) {
+ var id = item[this._fieldId];
+ if (id == undefined) {
+ throw new Error('Cannot update item: item has no id (item: ' + JSON.stringify(item) + ')');
+ }
+ var d = this._data[id];
+ if (!d) {
+ // item doesn't exist
+ throw new Error('Cannot update item: no item with id ' + id + ' found');
+ }
+
+ // merge with current item
+ var fields = Object.keys(item);
+ for (var i = 0, len = fields.length; i < len; i++) {
+ var field = fields[i];
+ var fieldType = this._type[field]; // type may be undefined
+ d[field] = util.convert(item[field], fieldType);
+ }
+
+ return id;
+ };
+
+ module.exports = DataSet;
+
+/***/ },
+/* 10 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ /**
+ * A queue
+ * @param {Object} options
+ * Available options:
+ * - delay: number When provided, the queue will be flushed
+ * automatically after an inactivity of this delay
+ * in milliseconds.
+ * Default value is null.
+ * - max: number When the queue exceeds the given maximum number
+ * of entries, the queue is flushed automatically.
+ * Default value of max is Infinity.
+ * @constructor
+ */
+ function Queue(options) {
+ // options
+ this.delay = null;
+ this.max = Infinity;
+
+ // properties
+ this._queue = [];
+ this._timeout = null;
+ this._extended = null;
+
+ this.setOptions(options);
+ }
+
+ /**
+ * Update the configuration of the queue
+ * @param {Object} options
+ * Available options:
+ * - delay: number When provided, the queue will be flushed
+ * automatically after an inactivity of this delay
+ * in milliseconds.
+ * Default value is null.
+ * - max: number When the queue exceeds the given maximum number
+ * of entries, the queue is flushed automatically.
+ * Default value of max is Infinity.
+ * @param options
+ */
+ Queue.prototype.setOptions = function (options) {
+ if (options && typeof options.delay !== 'undefined') {
+ this.delay = options.delay;
+ }
+ if (options && typeof options.max !== 'undefined') {
+ this.max = options.max;
+ }
+
+ this._flushIfNeeded();
+ };
+
+ /**
+ * Extend an object with queuing functionality.
+ * The object will be extended with a function flush, and the methods provided
+ * in options.replace will be replaced with queued ones.
+ * @param {Object} object
+ * @param {Object} options
+ * Available options:
+ * - replace: Array.<string>
+ * A list with method names of the methods
+ * on the object to be replaced with queued ones.
+ * - delay: number When provided, the queue will be flushed
+ * automatically after an inactivity of this delay
+ * in milliseconds.
+ * Default value is null.
+ * - max: number When the queue exceeds the given maximum number
+ * of entries, the queue is flushed automatically.
+ * Default value of max is Infinity.
+ * @return {Queue} Returns the created queue
+ */
+ Queue.extend = function (object, options) {
+ var queue = new Queue(options);
+
+ if (object.flush !== undefined) {
+ throw new Error('Target object already has a property flush');
+ }
+ object.flush = function () {
+ queue.flush();
+ };
+
+ var methods = [{
+ name: 'flush',
+ original: undefined
+ }];
+
+ if (options && options.replace) {
+ for (var i = 0; i < options.replace.length; i++) {
+ var name = options.replace[i];
+ methods.push({
+ name: name,
+ original: object[name]
+ });
+ queue.replace(object, name);
+ }
+ }
+
+ queue._extended = {
+ object: object,
+ methods: methods
+ };
+
+ return queue;
+ };
+
+ /**
+ * Destroy the queue. The queue will first flush all queued actions, and in
+ * case it has extended an object, will restore the original object.
+ */
+ Queue.prototype.destroy = function () {
+ this.flush();
+
+ if (this._extended) {
+ var object = this._extended.object;
+ var methods = this._extended.methods;
+ for (var i = 0; i < methods.length; i++) {
+ var method = methods[i];
+ if (method.original) {
+ object[method.name] = method.original;
+ } else {
+ delete object[method.name];
+ }
+ }
+ this._extended = null;
+ }
+ };
+
+ /**
+ * Replace a method on an object with a queued version
+ * @param {Object} object Object having the method
+ * @param {string} method The method name
+ */
+ Queue.prototype.replace = function (object, method) {
+ var me = this;
+ var original = object[method];
+ if (!original) {
+ throw new Error('Method ' + method + ' undefined');
+ }
+
+ object[method] = function () {
+ // create an Array with the arguments
+ var args = [];
+ for (var i = 0; i < arguments.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ // add this call to the queue
+ me.queue({
+ args: args,
+ fn: original,
+ context: this
+ });
+ };
+ };
+
+ /**
+ * Queue a call
+ * @param {function | {fn: function, args: Array} | {fn: function, args: Array, context: Object}} entry
+ */
+ Queue.prototype.queue = function (entry) {
+ if (typeof entry === 'function') {
+ this._queue.push({ fn: entry });
+ } else {
+ this._queue.push(entry);
+ }
+
+ this._flushIfNeeded();
+ };
+
+ /**
+ * Check whether the queue needs to be flushed
+ * @private
+ */
+ Queue.prototype._flushIfNeeded = function () {
+ // flush when the maximum is exceeded.
+ if (this._queue.length > this.max) {
+ this.flush();
+ }
+
+ // flush after a period of inactivity when a delay is configured
+ clearTimeout(this._timeout);
+ if (this.queue.length > 0 && typeof this.delay === 'number') {
+ var me = this;
+ this._timeout = setTimeout(function () {
+ me.flush();
+ }, this.delay);
+ }
+ };
+
+ /**
+ * Flush all queued calls
+ */
+ Queue.prototype.flush = function () {
+ while (this._queue.length > 0) {
+ var entry = this._queue.shift();
+ entry.fn.apply(entry.context || entry.fn, entry.args || []);
+ }
+ };
+
+ module.exports = Queue;
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+
+ /**
+ * DataView
+ *
+ * a dataview offers a filtered view on a dataset or an other dataview.
+ *
+ * @param {DataSet | DataView} data
+ * @param {Object} [options] Available options: see method get
+ *
+ * @constructor DataView
+ */
+ function DataView(data, options) {
+ this._data = null;
+ this._ids = {}; // ids of the items currently in memory (just contains a boolean true)
+ this.length = 0; // number of items in the DataView
+ this._options = options || {};
+ this._fieldId = 'id'; // name of the field containing id
+ this._subscribers = {}; // event subscribers
+
+ var me = this;
+ this.listener = function () {
+ me._onEvent.apply(me, arguments);
+ };
+
+ this.setData(data);
+ }
+
+ // TODO: implement a function .config() to dynamically update things like configured filter
+ // and trigger changes accordingly
+
+ /**
+ * Set a data source for the view
+ * @param {DataSet | DataView} data
+ */
+ DataView.prototype.setData = function (data) {
+ var ids, id, i, len;
+
+ if (this._data) {
+ // unsubscribe from current dataset
+ if (this._data.off) {
+ this._data.off('*', this.listener);
+ }
+
+ // trigger a remove of all items in memory
+ ids = Object.keys(this._ids);
+ this._ids = {};
+ this.length = 0;
+ this._trigger('remove', { items: ids });
+ }
+
+ this._data = data;
+
+ if (this._data) {
+ // update fieldId
+ this._fieldId = this._options.fieldId || this._data && this._data.options && this._data.options.fieldId || 'id';
+
+ // trigger an add of all added items
+ ids = this._data.getIds({ filter: this._options && this._options.filter });
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ this._ids[id] = true;
+ }
+ this.length = ids.length;
+ this._trigger('add', { items: ids });
+
+ // subscribe to new dataset
+ if (this._data.on) {
+ this._data.on('*', this.listener);
+ }
+ }
+ };
+
+ /**
+ * Refresh the DataView. Useful when the DataView has a filter function
+ * containing a variable parameter.
+ */
+ DataView.prototype.refresh = function () {
+ var id, i, len;
+ var ids = this._data.getIds({ filter: this._options && this._options.filter });
+ var oldIds = Object.keys(this._ids);
+ var newIds = {};
+ var added = [];
+ var removed = [];
+
+ // check for additions
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ newIds[id] = true;
+ if (!this._ids[id]) {
+ added.push(id);
+ this._ids[id] = true;
+ }
+ }
+
+ // check for removals
+ for (i = 0, len = oldIds.length; i < len; i++) {
+ id = oldIds[i];
+ if (!newIds[id]) {
+ removed.push(id);
+ delete this._ids[id];
+ }
+ }
+
+ this.length += added.length - removed.length;
+
+ // trigger events
+ if (added.length) {
+ this._trigger('add', { items: added });
+ }
+ if (removed.length) {
+ this._trigger('remove', { items: removed });
+ }
+ };
+
+ /**
+ * Get data from the data view
+ *
+ * Usage:
+ *
+ * get()
+ * get(options: Object)
+ * get(options: Object, data: Array | DataTable)
+ *
+ * get(id: Number)
+ * get(id: Number, options: Object)
+ * get(id: Number, options: Object, data: Array | DataTable)
+ *
+ * get(ids: Number[])
+ * get(ids: Number[], options: Object)
+ * get(ids: Number[], options: Object, data: Array | DataTable)
+ *
+ * Where:
+ *
+ * {Number | String} id The id of an item
+ * {Number[] | String{}} ids An array with ids of items
+ * {Object} options An Object with options. Available options:
+ * {String} [type] Type of data to be returned. Can
+ * be 'DataTable' or 'Array' (default)
+ * {Object.<String, String>} [convert]
+ * {String[]} [fields] field names to be returned
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * {Array | DataTable} [data] If provided, items will be appended to this
+ * array or table. Required in case of Google
+ * DataTable.
+ * @param args
+ */
+ DataView.prototype.get = function (args) {
+ var me = this;
+
+ // parse the arguments
+ var ids, options, data;
+ var firstType = util.getType(arguments[0]);
+ if (firstType == 'String' || firstType == 'Number' || firstType == 'Array') {
+ // get(id(s) [, options] [, data])
+ ids = arguments[0]; // can be a single id or an array with ids
+ options = arguments[1];
+ data = arguments[2];
+ } else {
+ // get([, options] [, data])
+ options = arguments[0];
+ data = arguments[1];
+ }
+
+ // extend the options with the default options and provided options
+ var viewOptions = util.extend({}, this._options, options);
+
+ // create a combined filter method when needed
+ if (this._options.filter && options && options.filter) {
+ viewOptions.filter = function (item) {
+ return me._options.filter(item) && options.filter(item);
+ };
+ }
+
+ // build up the call to the linked data set
+ var getArguments = [];
+ if (ids != undefined) {
+ getArguments.push(ids);
+ }
+ getArguments.push(viewOptions);
+ getArguments.push(data);
+
+ return this._data && this._data.get.apply(this._data, getArguments);
+ };
+
+ /**
+ * Get ids of all items or from a filtered set of items.
+ * @param {Object} [options] An Object with options. Available options:
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Array} ids
+ */
+ DataView.prototype.getIds = function (options) {
+ var ids;
+
+ if (this._data) {
+ var defaultFilter = this._options.filter;
+ var filter;
+
+ if (options && options.filter) {
+ if (defaultFilter) {
+ filter = function filter(item) {
+ return defaultFilter(item) && options.filter(item);
+ };
+ } else {
+ filter = options.filter;
+ }
+ } else {
+ filter = defaultFilter;
+ }
+
+ ids = this._data.getIds({
+ filter: filter,
+ order: options && options.order
+ });
+ } else {
+ ids = [];
+ }
+
+ return ids;
+ };
+
+ /**
+ * Map every item in the dataset.
+ * @param {function} callback
+ * @param {Object} [options] Available options:
+ * {Object.<String, String>} [type]
+ * {String[]} [fields] filter fields
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Object[]} mappedItems
+ */
+ DataView.prototype.map = function (callback, options) {
+ var mappedItems = [];
+ if (this._data) {
+ var defaultFilter = this._options.filter;
+ var filter;
+
+ if (options && options.filter) {
+ if (defaultFilter) {
+ filter = function filter(item) {
+ return defaultFilter(item) && options.filter(item);
+ };
+ } else {
+ filter = options.filter;
+ }
+ } else {
+ filter = defaultFilter;
+ }
+
+ mappedItems = this._data.map(callback, {
+ filter: filter,
+ order: options && options.order
+ });
+ } else {
+ mappedItems = [];
+ }
+
+ return mappedItems;
+ };
+
+ /**
+ * Get the DataSet to which this DataView is connected. In case there is a chain
+ * of multiple DataViews, the root DataSet of this chain is returned.
+ * @return {DataSet} dataSet
+ */
+ DataView.prototype.getDataSet = function () {
+ var dataSet = this;
+ while (dataSet instanceof DataView) {
+ dataSet = dataSet._data;
+ }
+ return dataSet || null;
+ };
+
+ /**
+ * Event listener. Will propagate all events from the connected data set to
+ * the subscribers of the DataView, but will filter the items and only trigger
+ * when there are changes in the filtered data set.
+ * @param {String} event
+ * @param {Object | null} params
+ * @param {String} senderId
+ * @private
+ */
+ DataView.prototype._onEvent = function (event, params, senderId) {
+ var i, len, id, item;
+ var ids = params && params.items;
+ var data = this._data;
+ var updatedData = [];
+ var added = [];
+ var updated = [];
+ var removed = [];
+
+ if (ids && data) {
+ switch (event) {
+ case 'add':
+ // filter the ids of the added items
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ item = this.get(id);
+ if (item) {
+ this._ids[id] = true;
+ added.push(id);
+ }
+ }
+
+ break;
+
+ case 'update':
+ // determine the event from the views viewpoint: an updated
+ // item can be added, updated, or removed from this view.
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ item = this.get(id);
+
+ if (item) {
+ if (this._ids[id]) {
+ updated.push(id);
+ updatedData.push(params.data[i]);
+ } else {
+ this._ids[id] = true;
+ added.push(id);
+ }
+ } else {
+ if (this._ids[id]) {
+ delete this._ids[id];
+ removed.push(id);
+ } else {
+ // nothing interesting for me :-(
+ }
+ }
+ }
+
+ break;
+
+ case 'remove':
+ // filter the ids of the removed items
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ if (this._ids[id]) {
+ delete this._ids[id];
+ removed.push(id);
+ }
+ }
+
+ break;
+ }
+
+ this.length += added.length - removed.length;
+
+ if (added.length) {
+ this._trigger('add', { items: added }, senderId);
+ }
+ if (updated.length) {
+ this._trigger('update', { items: updated, data: updatedData }, senderId);
+ }
+ if (removed.length) {
+ this._trigger('remove', { items: removed }, senderId);
+ }
+ }
+ };
+
+ // copy subscription functionality from DataSet
+ DataView.prototype.on = DataSet.prototype.on;
+ DataView.prototype.off = DataSet.prototype.off;
+ DataView.prototype._trigger = DataSet.prototype._trigger;
+
+ // TODO: make these functions deprecated (replaced with `on` and `off` since version 0.5)
+ DataView.prototype.subscribe = DataView.prototype.on;
+ DataView.prototype.unsubscribe = DataView.prototype.off;
+
+ module.exports = DataView;
+
+/***/ },
+/* 12 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var Emitter = __webpack_require__(13);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var util = __webpack_require__(1);
+ var Point3d = __webpack_require__(14);
+ var Point2d = __webpack_require__(15);
+ var Camera = __webpack_require__(16);
+ var Filter = __webpack_require__(17);
+ var Slider = __webpack_require__(18);
+ var StepNumber = __webpack_require__(19);
+
+ /**
+ * @constructor Graph3d
+ * Graph3d displays data in 3d.
+ *
+ * Graph3d is developed in javascript as a Google Visualization Chart.
+ *
+ * @param {Element} container The DOM element in which the Graph3d will
+ * be created. Normally a div element.
+ * @param {DataSet | DataView | Array} [data]
+ * @param {Object} [options]
+ */
+ function Graph3d(container, data, options) {
+ if (!(this instanceof Graph3d)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ // create variables and set default values
+ this.containerElement = container;
+ this.width = '400px';
+ this.height = '400px';
+ this.margin = 10; // px
+ this.defaultXCenter = '55%';
+ this.defaultYCenter = '50%';
+
+ this.xLabel = 'x';
+ this.yLabel = 'y';
+ this.zLabel = 'z';
+
+ var passValueFn = function passValueFn(v) {
+ return v;
+ };
+ this.xValueLabel = passValueFn;
+ this.yValueLabel = passValueFn;
+ this.zValueLabel = passValueFn;
+
+ this.filterLabel = 'time';
+ this.legendLabel = 'value';
+
+ this.style = Graph3d.STYLE.DOT;
+ this.showPerspective = true;
+ this.showGrid = true;
+ this.keepAspectRatio = true;
+ this.showShadow = false;
+ this.showGrayBottom = false; // TODO: this does not work correctly
+ this.showTooltip = false;
+ this.verticalRatio = 0.5; // 0.1 to 1.0, where 1.0 results in a 'cube'
+
+ this.animationInterval = 1000; // milliseconds
+ this.animationPreload = false;
+
+ this.camera = new Camera();
+ this.camera.setArmRotation(1.0, 0.5);
+ this.camera.setArmLength(1.7);
+ this.eye = new Point3d(0, 0, -1); // TODO: set eye.z about 3/4 of the width of the window?
+
+ this.dataTable = null; // The original data table
+ this.dataPoints = null; // The table with point objects
+
+ // the column indexes
+ this.colX = undefined;
+ this.colY = undefined;
+ this.colZ = undefined;
+ this.colValue = undefined;
+ this.colFilter = undefined;
+
+ this.xMin = 0;
+ this.xStep = undefined; // auto by default
+ this.xMax = 1;
+ this.yMin = 0;
+ this.yStep = undefined; // auto by default
+ this.yMax = 1;
+ this.zMin = 0;
+ this.zStep = undefined; // auto by default
+ this.zMax = 1;
+ this.valueMin = 0;
+ this.valueMax = 1;
+ this.xBarWidth = 1;
+ this.yBarWidth = 1;
+ // TODO: customize axis range
+
+ // colors
+ this.axisColor = '#4D4D4D';
+ this.gridColor = '#D3D3D3';
+ this.dataColor = {
+ fill: '#7DC1FF',
+ stroke: '#3267D2',
+ strokeWidth: 1 // px
+ };
+
+ this.dotSizeRatio = 0.02; // size of the dots as a fraction of the graph width
+
+ // create a frame and canvas
+ this.create();
+
+ // apply options (also when undefined)
+ this.setOptions(options);
+
+ // apply data
+ if (data) {
+ this.setData(data);
+ }
+ }
+
+ // Extend Graph3d with an Emitter mixin
+ Emitter(Graph3d.prototype);
+
+ /**
+ * Calculate the scaling values, dependent on the range in x, y, and z direction
+ */
+ Graph3d.prototype._setScale = function () {
+ this.scale = new Point3d(1 / (this.xMax - this.xMin), 1 / (this.yMax - this.yMin), 1 / (this.zMax - this.zMin));
+
+ // keep aspect ration between x and y scale if desired
+ if (this.keepAspectRatio) {
+ if (this.scale.x < this.scale.y) {
+ //noinspection JSSuspiciousNameCombination
+ this.scale.y = this.scale.x;
+ } else {
+ //noinspection JSSuspiciousNameCombination
+ this.scale.x = this.scale.y;
+ }
+ }
+
+ // scale the vertical axis
+ this.scale.z *= this.verticalRatio;
+ // TODO: can this be automated? verticalRatio?
+
+ // determine scale for (optional) value
+ this.scale.value = 1 / (this.valueMax - this.valueMin);
+
+ // position the camera arm
+ var xCenter = (this.xMax + this.xMin) / 2 * this.scale.x;
+ var yCenter = (this.yMax + this.yMin) / 2 * this.scale.y;
+ var zCenter = (this.zMax + this.zMin) / 2 * this.scale.z;
+ this.camera.setArmLocation(xCenter, yCenter, zCenter);
+ };
+
+ /**
+ * Convert a 3D location to a 2D location on screen
+ * http://en.wikipedia.org/wiki/3D_projection
+ * @param {Point3d} point3d A 3D point with parameters x, y, z
+ * @return {Point2d} point2d A 2D point with parameters x, y
+ */
+ Graph3d.prototype._convert3Dto2D = function (point3d) {
+ var translation = this._convertPointToTranslation(point3d);
+ return this._convertTranslationToScreen(translation);
+ };
+
+ /**
+ * Convert a 3D location its translation seen from the camera
+ * http://en.wikipedia.org/wiki/3D_projection
+ * @param {Point3d} point3d A 3D point with parameters x, y, z
+ * @return {Point3d} translation A 3D point with parameters x, y, z This is
+ * the translation of the point, seen from the
+ * camera
+ */
+ Graph3d.prototype._convertPointToTranslation = function (point3d) {
+ var ax = point3d.x * this.scale.x,
+ ay = point3d.y * this.scale.y,
+ az = point3d.z * this.scale.z,
+ cx = this.camera.getCameraLocation().x,
+ cy = this.camera.getCameraLocation().y,
+ cz = this.camera.getCameraLocation().z,
+
+
+ // calculate angles
+ sinTx = Math.sin(this.camera.getCameraRotation().x),
+ cosTx = Math.cos(this.camera.getCameraRotation().x),
+ sinTy = Math.sin(this.camera.getCameraRotation().y),
+ cosTy = Math.cos(this.camera.getCameraRotation().y),
+ sinTz = Math.sin(this.camera.getCameraRotation().z),
+ cosTz = Math.cos(this.camera.getCameraRotation().z),
+
+
+ // calculate translation
+ dx = cosTy * (sinTz * (ay - cy) + cosTz * (ax - cx)) - sinTy * (az - cz),
+ dy = sinTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) + cosTx * (cosTz * (ay - cy) - sinTz * (ax - cx)),
+ dz = cosTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) - sinTx * (cosTz * (ay - cy) - sinTz * (ax - cx));
+
+ return new Point3d(dx, dy, dz);
+ };
+
+ /**
+ * Convert a translation point to a point on the screen
+ * @param {Point3d} translation A 3D point with parameters x, y, z This is
+ * the translation of the point, seen from the
+ * camera
+ * @return {Point2d} point2d A 2D point with parameters x, y
+ */
+ Graph3d.prototype._convertTranslationToScreen = function (translation) {
+ var ex = this.eye.x,
+ ey = this.eye.y,
+ ez = this.eye.z,
+ dx = translation.x,
+ dy = translation.y,
+ dz = translation.z;
+
+ // calculate position on screen from translation
+ var bx;
+ var by;
+ if (this.showPerspective) {
+ bx = (dx - ex) * (ez / dz);
+ by = (dy - ey) * (ez / dz);
+ } else {
+ bx = dx * -(ez / this.camera.getArmLength());
+ by = dy * -(ez / this.camera.getArmLength());
+ }
+
+ // shift and scale the point to the center of the screen
+ // use the width of the graph to scale both horizontally and vertically.
+ return new Point2d(this.xcenter + bx * this.frame.canvas.clientWidth, this.ycenter - by * this.frame.canvas.clientWidth);
+ };
+
+ /**
+ * Set the background styling for the graph
+ * @param {string | {fill: string, stroke: string, strokeWidth: string}} backgroundColor
+ */
+ Graph3d.prototype._setBackgroundColor = function (backgroundColor) {
+ var fill = 'white';
+ var stroke = 'gray';
+ var strokeWidth = 1;
+
+ if (typeof backgroundColor === 'string') {
+ fill = backgroundColor;
+ stroke = 'none';
+ strokeWidth = 0;
+ } else if ((typeof backgroundColor === 'undefined' ? 'undefined' : _typeof(backgroundColor)) === 'object') {
+ if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;
+ if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;
+ if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;
+ } else if (backgroundColor === undefined) {
+ // use use defaults
+ } else {
+ throw 'Unsupported type of backgroundColor';
+ }
+
+ this.frame.style.backgroundColor = fill;
+ this.frame.style.borderColor = stroke;
+ this.frame.style.borderWidth = strokeWidth + 'px';
+ this.frame.style.borderStyle = 'solid';
+ };
+
+ /// enumerate the available styles
+ Graph3d.STYLE = {
+ BAR: 0,
+ BARCOLOR: 1,
+ BARSIZE: 2,
+ DOT: 3,
+ DOTLINE: 4,
+ DOTCOLOR: 5,
+ DOTSIZE: 6,
+ GRID: 7,
+ LINE: 8,
+ SURFACE: 9
+ };
+
+ /**
+ * Retrieve the style index from given styleName
+ * @param {string} styleName Style name such as 'dot', 'grid', 'dot-line'
+ * @return {Number} styleNumber Enumeration value representing the style, or -1
+ * when not found
+ */
+ Graph3d.prototype._getStyleNumber = function (styleName) {
+ switch (styleName) {
+ case 'dot':
+ return Graph3d.STYLE.DOT;
+ case 'dot-line':
+ return Graph3d.STYLE.DOTLINE;
+ case 'dot-color':
+ return Graph3d.STYLE.DOTCOLOR;
+ case 'dot-size':
+ return Graph3d.STYLE.DOTSIZE;
+ case 'line':
+ return Graph3d.STYLE.LINE;
+ case 'grid':
+ return Graph3d.STYLE.GRID;
+ case 'surface':
+ return Graph3d.STYLE.SURFACE;
+ case 'bar':
+ return Graph3d.STYLE.BAR;
+ case 'bar-color':
+ return Graph3d.STYLE.BARCOLOR;
+ case 'bar-size':
+ return Graph3d.STYLE.BARSIZE;
+ }
+
+ return -1;
+ };
+
+ /**
+ * Determine the indexes of the data columns, based on the given style and data
+ * @param {DataSet} data
+ * @param {Number} style
+ */
+ Graph3d.prototype._determineColumnIndexes = function (data, style) {
+ if (this.style === Graph3d.STYLE.DOT || this.style === Graph3d.STYLE.DOTLINE || this.style === Graph3d.STYLE.LINE || this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE || this.style === Graph3d.STYLE.BAR) {
+ // 3 columns expected, and optionally a 4th with filter values
+ this.colX = 0;
+ this.colY = 1;
+ this.colZ = 2;
+ this.colValue = undefined;
+
+ if (data.getNumberOfColumns() > 3) {
+ this.colFilter = 3;
+ }
+ } else if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
+ // 4 columns expected, and optionally a 5th with filter values
+ this.colX = 0;
+ this.colY = 1;
+ this.colZ = 2;
+ this.colValue = 3;
+
+ if (data.getNumberOfColumns() > 4) {
+ this.colFilter = 4;
+ }
+ } else {
+ throw 'Unknown style "' + this.style + '"';
+ }
+ };
+
+ Graph3d.prototype.getNumberOfRows = function (data) {
+ return data.length;
+ };
+
+ Graph3d.prototype.getNumberOfColumns = function (data) {
+ var counter = 0;
+ for (var column in data[0]) {
+ if (data[0].hasOwnProperty(column)) {
+ counter++;
+ }
+ }
+ return counter;
+ };
+
+ Graph3d.prototype.getDistinctValues = function (data, column) {
+ var distinctValues = [];
+ for (var i = 0; i < data.length; i++) {
+ if (distinctValues.indexOf(data[i][column]) == -1) {
+ distinctValues.push(data[i][column]);
+ }
+ }
+ return distinctValues;
+ };
+
+ Graph3d.prototype.getColumnRange = function (data, column) {
+ var minMax = { min: data[0][column], max: data[0][column] };
+ for (var i = 0; i < data.length; i++) {
+ if (minMax.min > data[i][column]) {
+ minMax.min = data[i][column];
+ }
+ if (minMax.max < data[i][column]) {
+ minMax.max = data[i][column];
+ }
+ }
+ return minMax;
+ };
+
+ /**
+ * Initialize the data from the data table. Calculate minimum and maximum values
+ * and column index values
+ * @param {Array | DataSet | DataView} rawData The data containing the items for the Graph.
+ * @param {Number} style Style Number
+ */
+ Graph3d.prototype._dataInitialize = function (rawData, style) {
+ var me = this;
+
+ // unsubscribe from the dataTable
+ if (this.dataSet) {
+ this.dataSet.off('*', this._onChange);
+ }
+
+ if (rawData === undefined) return;
+
+ if (Array.isArray(rawData)) {
+ rawData = new DataSet(rawData);
+ }
+
+ var data;
+ if (rawData instanceof DataSet || rawData instanceof DataView) {
+ data = rawData.get();
+ } else {
+ throw new Error('Array, DataSet, or DataView expected');
+ }
+
+ if (data.length == 0) return;
+
+ this.dataSet = rawData;
+ this.dataTable = data;
+
+ // subscribe to changes in the dataset
+ this._onChange = function () {
+ me.setData(me.dataSet);
+ };
+ this.dataSet.on('*', this._onChange);
+
+ // _determineColumnIndexes
+ // getNumberOfRows (points)
+ // getNumberOfColumns (x,y,z,v,t,t1,t2...)
+ // getDistinctValues (unique values?)
+ // getColumnRange
+
+ // determine the location of x,y,z,value,filter columns
+ this.colX = 'x';
+ this.colY = 'y';
+ this.colZ = 'z';
+ this.colValue = 'style';
+ this.colFilter = 'filter';
+
+ // check if a filter column is provided
+ if (data[0].hasOwnProperty('filter')) {
+ if (this.dataFilter === undefined) {
+ this.dataFilter = new Filter(rawData, this.colFilter, this);
+ this.dataFilter.setOnLoadCallback(function () {
+ me.redraw();
+ });
+ }
+ }
+
+ var withBars = this.style == Graph3d.STYLE.BAR || this.style == Graph3d.STYLE.BARCOLOR || this.style == Graph3d.STYLE.BARSIZE;
+
+ // determine barWidth from data
+ if (withBars) {
+ if (this.defaultXBarWidth !== undefined) {
+ this.xBarWidth = this.defaultXBarWidth;
+ } else {
+ var dataX = this.getDistinctValues(data, this.colX);
+ this.xBarWidth = dataX[1] - dataX[0] || 1;
+ }
+
+ if (this.defaultYBarWidth !== undefined) {
+ this.yBarWidth = this.defaultYBarWidth;
+ } else {
+ var dataY = this.getDistinctValues(data, this.colY);
+ this.yBarWidth = dataY[1] - dataY[0] || 1;
+ }
+ }
+
+ // calculate minimums and maximums
+ var xRange = this.getColumnRange(data, this.colX);
+ if (withBars) {
+ xRange.min -= this.xBarWidth / 2;
+ xRange.max += this.xBarWidth / 2;
+ }
+ this.xMin = this.defaultXMin !== undefined ? this.defaultXMin : xRange.min;
+ this.xMax = this.defaultXMax !== undefined ? this.defaultXMax : xRange.max;
+ if (this.xMax <= this.xMin) this.xMax = this.xMin + 1;
+ this.xStep = this.defaultXStep !== undefined ? this.defaultXStep : (this.xMax - this.xMin) / 5;
+
+ var yRange = this.getColumnRange(data, this.colY);
+ if (withBars) {
+ yRange.min -= this.yBarWidth / 2;
+ yRange.max += this.yBarWidth / 2;
+ }
+ this.yMin = this.defaultYMin !== undefined ? this.defaultYMin : yRange.min;
+ this.yMax = this.defaultYMax !== undefined ? this.defaultYMax : yRange.max;
+ if (this.yMax <= this.yMin) this.yMax = this.yMin + 1;
+ this.yStep = this.defaultYStep !== undefined ? this.defaultYStep : (this.yMax - this.yMin) / 5;
+
+ var zRange = this.getColumnRange(data, this.colZ);
+ this.zMin = this.defaultZMin !== undefined ? this.defaultZMin : zRange.min;
+ this.zMax = this.defaultZMax !== undefined ? this.defaultZMax : zRange.max;
+ if (this.zMax <= this.zMin) this.zMax = this.zMin + 1;
+ this.zStep = this.defaultZStep !== undefined ? this.defaultZStep : (this.zMax - this.zMin) / 5;
+
+ if (this.colValue !== undefined) {
+ var valueRange = this.getColumnRange(data, this.colValue);
+ this.valueMin = this.defaultValueMin !== undefined ? this.defaultValueMin : valueRange.min;
+ this.valueMax = this.defaultValueMax !== undefined ? this.defaultValueMax : valueRange.max;
+ if (this.valueMax <= this.valueMin) this.valueMax = this.valueMin + 1;
+ }
+
+ // set the scale dependent on the ranges.
+ this._setScale();
+ };
+
+ /**
+ * Filter the data based on the current filter
+ * @param {Array} data
+ * @return {Array} dataPoints Array with point objects which can be drawn on screen
+ */
+ Graph3d.prototype._getDataPoints = function (data) {
+ // TODO: store the created matrix dataPoints in the filters instead of reloading each time
+ var x, y, i, z, obj, point;
+
+ var dataPoints = [];
+
+ if (this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE) {
+ // copy all values from the google data table to a matrix
+ // the provided values are supposed to form a grid of (x,y) positions
+
+ // create two lists with all present x and y values
+ var dataX = [];
+ var dataY = [];
+ for (i = 0; i < this.getNumberOfRows(data); i++) {
+ x = data[i][this.colX] || 0;
+ y = data[i][this.colY] || 0;
+
+ if (dataX.indexOf(x) === -1) {
+ dataX.push(x);
+ }
+ if (dataY.indexOf(y) === -1) {
+ dataY.push(y);
+ }
+ }
+
+ var sortNumber = function sortNumber(a, b) {
+ return a - b;
+ };
+ dataX.sort(sortNumber);
+ dataY.sort(sortNumber);
+
+ // create a grid, a 2d matrix, with all values.
+ var dataMatrix = []; // temporary data matrix
+ for (i = 0; i < data.length; i++) {
+ x = data[i][this.colX] || 0;
+ y = data[i][this.colY] || 0;
+ z = data[i][this.colZ] || 0;
+
+ var xIndex = dataX.indexOf(x); // TODO: implement Array().indexOf() for Internet Explorer
+ var yIndex = dataY.indexOf(y);
+
+ if (dataMatrix[xIndex] === undefined) {
+ dataMatrix[xIndex] = [];
+ }
+
+ var point3d = new Point3d();
+ point3d.x = x;
+ point3d.y = y;
+ point3d.z = z;
+
+ obj = {};
+ obj.point = point3d;
+ obj.trans = undefined;
+ obj.screen = undefined;
+ obj.bottom = new Point3d(x, y, this.zMin);
+
+ dataMatrix[xIndex][yIndex] = obj;
+
+ dataPoints.push(obj);
+ }
+
+ // fill in the pointers to the neighbors.
+ for (x = 0; x < dataMatrix.length; x++) {
+ for (y = 0; y < dataMatrix[x].length; y++) {
+ if (dataMatrix[x][y]) {
+ dataMatrix[x][y].pointRight = x < dataMatrix.length - 1 ? dataMatrix[x + 1][y] : undefined;
+ dataMatrix[x][y].pointTop = y < dataMatrix[x].length - 1 ? dataMatrix[x][y + 1] : undefined;
+ dataMatrix[x][y].pointCross = x < dataMatrix.length - 1 && y < dataMatrix[x].length - 1 ? dataMatrix[x + 1][y + 1] : undefined;
+ }
+ }
+ }
+ } else {
+ // 'dot', 'dot-line', etc.
+ // copy all values from the google data table to a list with Point3d objects
+ for (i = 0; i < data.length; i++) {
+ point = new Point3d();
+ point.x = data[i][this.colX] || 0;
+ point.y = data[i][this.colY] || 0;
+ point.z = data[i][this.colZ] || 0;
+
+ if (this.colValue !== undefined) {
+ point.value = data[i][this.colValue] || 0;
+ }
+
+ obj = {};
+ obj.point = point;
+ obj.bottom = new Point3d(point.x, point.y, this.zMin);
+ obj.trans = undefined;
+ obj.screen = undefined;
+
+ dataPoints.push(obj);
+ }
+ }
+
+ return dataPoints;
+ };
+
+ /**
+ * Create the main frame for the Graph3d.
+ * This function is executed once when a Graph3d object is created. The frame
+ * contains a canvas, and this canvas contains all objects like the axis and
+ * nodes.
+ */
+ Graph3d.prototype.create = function () {
+ // remove all elements from the container element.
+ while (this.containerElement.hasChildNodes()) {
+ this.containerElement.removeChild(this.containerElement.firstChild);
+ }
+
+ this.frame = document.createElement('div');
+ this.frame.style.position = 'relative';
+ this.frame.style.overflow = 'hidden';
+
+ // create the graph canvas (HTML canvas element)
+ this.frame.canvas = document.createElement('canvas');
+ this.frame.canvas.style.position = 'relative';
+ this.frame.appendChild(this.frame.canvas);
+ //if (!this.frame.canvas.getContext) {
+ {
+ var noCanvas = document.createElement('DIV');
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold';
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.frame.canvas.appendChild(noCanvas);
+ }
+
+ this.frame.filter = document.createElement('div');
+ this.frame.filter.style.position = 'absolute';
+ this.frame.filter.style.bottom = '0px';
+ this.frame.filter.style.left = '0px';
+ this.frame.filter.style.width = '100%';
+ this.frame.appendChild(this.frame.filter);
+
+ // add event listeners to handle moving and zooming the contents
+ var me = this;
+ var onmousedown = function onmousedown(event) {
+ me._onMouseDown(event);
+ };
+ var ontouchstart = function ontouchstart(event) {
+ me._onTouchStart(event);
+ };
+ var onmousewheel = function onmousewheel(event) {
+ me._onWheel(event);
+ };
+ var ontooltip = function ontooltip(event) {
+ me._onTooltip(event);
+ };
+ // TODO: these events are never cleaned up... can give a 'memory leakage'
+
+ util.addEventListener(this.frame.canvas, 'keydown', onkeydown);
+ util.addEventListener(this.frame.canvas, 'mousedown', onmousedown);
+ util.addEventListener(this.frame.canvas, 'touchstart', ontouchstart);
+ util.addEventListener(this.frame.canvas, 'mousewheel', onmousewheel);
+ util.addEventListener(this.frame.canvas, 'mousemove', ontooltip);
+
+ // add the new graph to the container element
+ this.containerElement.appendChild(this.frame);
+ };
+
+ /**
+ * Set a new size for the graph
+ * @param {string} width Width in pixels or percentage (for example '800px'
+ * or '50%')
+ * @param {string} height Height in pixels or percentage (for example '400px'
+ * or '30%')
+ */
+ Graph3d.prototype.setSize = function (width, height) {
+ this.frame.style.width = width;
+ this.frame.style.height = height;
+
+ this._resizeCanvas();
+ };
+
+ /**
+ * Resize the canvas to the current size of the frame
+ */
+ Graph3d.prototype._resizeCanvas = function () {
+ this.frame.canvas.style.width = '100%';
+ this.frame.canvas.style.height = '100%';
+
+ this.frame.canvas.width = this.frame.canvas.clientWidth;
+ this.frame.canvas.height = this.frame.canvas.clientHeight;
+
+ // adjust with for margin
+ this.frame.filter.style.width = this.frame.canvas.clientWidth - 2 * 10 + 'px';
+ };
+
+ /**
+ * Start animation
+ */
+ Graph3d.prototype.animationStart = function () {
+ if (!this.frame.filter || !this.frame.filter.slider) throw 'No animation available';
+
+ this.frame.filter.slider.play();
+ };
+
+ /**
+ * Stop animation
+ */
+ Graph3d.prototype.animationStop = function () {
+ if (!this.frame.filter || !this.frame.filter.slider) return;
+
+ this.frame.filter.slider.stop();
+ };
+
+ /**
+ * Resize the center position based on the current values in this.defaultXCenter
+ * and this.defaultYCenter (which are strings with a percentage or a value
+ * in pixels). The center positions are the variables this.xCenter
+ * and this.yCenter
+ */
+ Graph3d.prototype._resizeCenter = function () {
+ // calculate the horizontal center position
+ if (this.defaultXCenter.charAt(this.defaultXCenter.length - 1) === '%') {
+ this.xcenter = parseFloat(this.defaultXCenter) / 100 * this.frame.canvas.clientWidth;
+ } else {
+ this.xcenter = parseFloat(this.defaultXCenter); // supposed to be in px
+ }
+
+ // calculate the vertical center position
+ if (this.defaultYCenter.charAt(this.defaultYCenter.length - 1) === '%') {
+ this.ycenter = parseFloat(this.defaultYCenter) / 100 * (this.frame.canvas.clientHeight - this.frame.filter.clientHeight);
+ } else {
+ this.ycenter = parseFloat(this.defaultYCenter); // supposed to be in px
+ }
+ };
+
+ /**
+ * Set the rotation and distance of the camera
+ * @param {Object} pos An object with the camera position. The object
+ * contains three parameters:
+ * - horizontal {Number}
+ * The horizontal rotation, between 0 and 2*PI.
+ * Optional, can be left undefined.
+ * - vertical {Number}
+ * The vertical rotation, between 0 and 0.5*PI
+ * if vertical=0.5*PI, the graph is shown from the
+ * top. Optional, can be left undefined.
+ * - distance {Number}
+ * The (normalized) distance of the camera to the
+ * center of the graph, a value between 0.71 and 5.0.
+ * Optional, can be left undefined.
+ */
+ Graph3d.prototype.setCameraPosition = function (pos) {
+ if (pos === undefined) {
+ return;
+ }
+
+ if (pos.horizontal !== undefined && pos.vertical !== undefined) {
+ this.camera.setArmRotation(pos.horizontal, pos.vertical);
+ }
+
+ if (pos.distance !== undefined) {
+ this.camera.setArmLength(pos.distance);
+ }
+
+ this.redraw();
+ };
+
+ /**
+ * Retrieve the current camera rotation
+ * @return {object} An object with parameters horizontal, vertical, and
+ * distance
+ */
+ Graph3d.prototype.getCameraPosition = function () {
+ var pos = this.camera.getArmRotation();
+ pos.distance = this.camera.getArmLength();
+ return pos;
+ };
+
+ /**
+ * Load data into the 3D Graph
+ */
+ Graph3d.prototype._readData = function (data) {
+ // read the data
+ this._dataInitialize(data, this.style);
+
+ if (this.dataFilter) {
+ // apply filtering
+ this.dataPoints = this.dataFilter._getDataPoints();
+ } else {
+ // no filtering. load all data
+ this.dataPoints = this._getDataPoints(this.dataTable);
+ }
+
+ // draw the filter
+ this._redrawFilter();
+ };
+
+ /**
+ * Replace the dataset of the Graph3d
+ * @param {Array | DataSet | DataView} data
+ */
+ Graph3d.prototype.setData = function (data) {
+ this._readData(data);
+ this.redraw();
+
+ // start animation when option is true
+ if (this.animationAutoStart && this.dataFilter) {
+ this.animationStart();
+ }
+ };
+
+ /**
+ * Update the options. Options will be merged with current options
+ * @param {Object} options
+ */
+ Graph3d.prototype.setOptions = function (options) {
+ var cameraPosition = undefined;
+
+ this.animationStop();
+
+ if (options !== undefined) {
+ // retrieve parameter values
+ if (options.width !== undefined) this.width = options.width;
+ if (options.height !== undefined) this.height = options.height;
+
+ if (options.xCenter !== undefined) this.defaultXCenter = options.xCenter;
+ if (options.yCenter !== undefined) this.defaultYCenter = options.yCenter;
+
+ if (options.filterLabel !== undefined) this.filterLabel = options.filterLabel;
+ if (options.legendLabel !== undefined) this.legendLabel = options.legendLabel;
+ if (options.xLabel !== undefined) this.xLabel = options.xLabel;
+ if (options.yLabel !== undefined) this.yLabel = options.yLabel;
+ if (options.zLabel !== undefined) this.zLabel = options.zLabel;
+
+ if (options.xValueLabel !== undefined) this.xValueLabel = options.xValueLabel;
+ if (options.yValueLabel !== undefined) this.yValueLabel = options.yValueLabel;
+ if (options.zValueLabel !== undefined) this.zValueLabel = options.zValueLabel;
+
+ if (options.dotSizeRatio !== undefined) this.dotSizeRatio = options.dotSizeRatio;
+
+ if (options.style !== undefined) {
+ var styleNumber = this._getStyleNumber(options.style);
+ if (styleNumber !== -1) {
+ this.style = styleNumber;
+ }
+ }
+ if (options.showGrid !== undefined) this.showGrid = options.showGrid;
+ if (options.showPerspective !== undefined) this.showPerspective = options.showPerspective;
+ if (options.showShadow !== undefined) this.showShadow = options.showShadow;
+ if (options.tooltip !== undefined) this.showTooltip = options.tooltip;
+ if (options.showAnimationControls !== undefined) this.showAnimationControls = options.showAnimationControls;
+ if (options.keepAspectRatio !== undefined) this.keepAspectRatio = options.keepAspectRatio;
+ if (options.verticalRatio !== undefined) this.verticalRatio = options.verticalRatio;
+
+ if (options.animationInterval !== undefined) this.animationInterval = options.animationInterval;
+ if (options.animationPreload !== undefined) this.animationPreload = options.animationPreload;
+ if (options.animationAutoStart !== undefined) this.animationAutoStart = options.animationAutoStart;
+
+ if (options.xBarWidth !== undefined) this.defaultXBarWidth = options.xBarWidth;
+ if (options.yBarWidth !== undefined) this.defaultYBarWidth = options.yBarWidth;
+
+ if (options.xMin !== undefined) this.defaultXMin = options.xMin;
+ if (options.xStep !== undefined) this.defaultXStep = options.xStep;
+ if (options.xMax !== undefined) this.defaultXMax = options.xMax;
+ if (options.yMin !== undefined) this.defaultYMin = options.yMin;
+ if (options.yStep !== undefined) this.defaultYStep = options.yStep;
+ if (options.yMax !== undefined) this.defaultYMax = options.yMax;
+ if (options.zMin !== undefined) this.defaultZMin = options.zMin;
+ if (options.zStep !== undefined) this.defaultZStep = options.zStep;
+ if (options.zMax !== undefined) this.defaultZMax = options.zMax;
+ if (options.valueMin !== undefined) this.defaultValueMin = options.valueMin;
+ if (options.valueMax !== undefined) this.defaultValueMax = options.valueMax;
+ if (options.backgroundColor !== undefined) this._setBackgroundColor(options.backgroundColor);
+
+ if (options.cameraPosition !== undefined) cameraPosition = options.cameraPosition;
+
+ if (cameraPosition !== undefined) {
+ this.camera.setArmRotation(cameraPosition.horizontal, cameraPosition.vertical);
+ this.camera.setArmLength(cameraPosition.distance);
+ }
+
+ // colors
+ if (options.axisColor !== undefined) this.axisColor = options.axisColor;
+ if (options.gridColor !== undefined) this.gridColor = options.gridColor;
+ if (options.dataColor) {
+ if (typeof options.dataColor === 'string') {
+ this.dataColor.fill = options.dataColor;
+ this.dataColor.stroke = options.dataColor;
+ } else {
+ if (options.dataColor.fill) {
+ this.dataColor.fill = options.dataColor.fill;
+ }
+ if (options.dataColor.stroke) {
+ this.dataColor.stroke = options.dataColor.stroke;
+ }
+ if (options.dataColor.strokeWidth !== undefined) {
+ this.dataColor.strokeWidth = options.dataColor.strokeWidth;
+ }
+ }
+ }
+ }
+
+ this.setSize(this.width, this.height);
+
+ // re-load the data
+ if (this.dataTable) {
+ this.setData(this.dataTable);
+ }
+
+ // start animation when option is true
+ if (this.animationAutoStart && this.dataFilter) {
+ this.animationStart();
+ }
+ };
+
+ /**
+ * Redraw the Graph.
+ */
+ Graph3d.prototype.redraw = function () {
+ if (this.dataPoints === undefined) {
+ throw 'Error: graph data not initialized';
+ }
+
+ this._resizeCanvas();
+ this._resizeCenter();
+ this._redrawSlider();
+ this._redrawClear();
+ this._redrawAxis();
+
+ if (this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE) {
+ this._redrawDataGrid();
+ } else if (this.style === Graph3d.STYLE.LINE) {
+ this._redrawDataLine();
+ } else if (this.style === Graph3d.STYLE.BAR || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
+ this._redrawDataBar();
+ } else {
+ // style is DOT, DOTLINE, DOTCOLOR, DOTSIZE
+ this._redrawDataDot();
+ }
+
+ this._redrawInfo();
+ this._redrawLegend();
+ };
+
+ /**
+ * Clear the canvas before redrawing
+ */
+ Graph3d.prototype._redrawClear = function () {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ };
+
+ /**
+ * Redraw the legend showing the colors
+ */
+ Graph3d.prototype._redrawLegend = function () {
+ var y;
+
+ if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE) {
+
+ var dotSize = this.frame.clientWidth * this.dotSizeRatio;
+
+ var widthMin, widthMax;
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ widthMin = dotSize / 2; // px
+ widthMax = dotSize / 2 + dotSize * 2; // Todo: put this in one function
+ } else {
+ widthMin = 20; // px
+ widthMax = 20; // px
+ }
+
+ var height = Math.max(this.frame.clientHeight * 0.25, 100);
+ var top = this.margin;
+ var right = this.frame.clientWidth - this.margin;
+ var left = right - widthMax;
+ var bottom = top + height;
+ }
+
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ ctx.lineWidth = 1;
+ ctx.font = '14px arial'; // TODO: put in options
+
+ if (this.style === Graph3d.STYLE.DOTCOLOR) {
+ // draw the color bar
+ var ymin = 0;
+ var ymax = height; // Todo: make height customizable
+ for (y = ymin; y < ymax; y++) {
+ var f = (y - ymin) / (ymax - ymin);
+
+ //var width = (dotSize / 2 + (1-f) * dotSize * 2); // Todo: put this in one function
+ var hue = f * 240;
+ var color = this._hsv2rgb(hue, 1, 1);
+
+ ctx.strokeStyle = color;
+ ctx.beginPath();
+ ctx.moveTo(left, top + y);
+ ctx.lineTo(right, top + y);
+ ctx.stroke();
+ }
+
+ ctx.strokeStyle = this.axisColor;
+ ctx.strokeRect(left, top, widthMax, height);
+ }
+
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ // draw border around color bar
+ ctx.strokeStyle = this.axisColor;
+ ctx.fillStyle = this.dataColor.fill;
+ ctx.beginPath();
+ ctx.moveTo(left, top);
+ ctx.lineTo(right, top);
+ ctx.lineTo(right - widthMax + widthMin, bottom);
+ ctx.lineTo(left, bottom);
+ ctx.closePath();
+ ctx.fill();
+ ctx.stroke();
+ }
+
+ if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE) {
+ // print values along the color bar
+ var gridLineLen = 5; // px
+ var step = new StepNumber(this.valueMin, this.valueMax, (this.valueMax - this.valueMin) / 5, true);
+ step.start();
+ if (step.getCurrent() < this.valueMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ y = bottom - (step.getCurrent() - this.valueMin) / (this.valueMax - this.valueMin) * height;
+
+ ctx.beginPath();
+ ctx.moveTo(left - gridLineLen, y);
+ ctx.lineTo(left, y);
+ ctx.stroke();
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(step.getCurrent(), left - 2 * gridLineLen, y);
+
+ step.next();
+ }
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'top';
+ var label = this.legendLabel;
+ ctx.fillText(label, right, bottom + this.margin);
+ }
+ };
+
+ /**
+ * Redraw the filter
+ */
+ Graph3d.prototype._redrawFilter = function () {
+ this.frame.filter.innerHTML = '';
+
+ if (this.dataFilter) {
+ var options = {
+ 'visible': this.showAnimationControls
+ };
+ var slider = new Slider(this.frame.filter, options);
+ this.frame.filter.slider = slider;
+
+ // TODO: css here is not nice here...
+ this.frame.filter.style.padding = '10px';
+ //this.frame.filter.style.backgroundColor = '#EFEFEF';
+
+ slider.setValues(this.dataFilter.values);
+ slider.setPlayInterval(this.animationInterval);
+
+ // create an event handler
+ var me = this;
+ var onchange = function onchange() {
+ var index = slider.getIndex();
+
+ me.dataFilter.selectValue(index);
+ me.dataPoints = me.dataFilter._getDataPoints();
+
+ me.redraw();
+ };
+ slider.setOnChangeCallback(onchange);
+ } else {
+ this.frame.filter.slider = undefined;
+ }
+ };
+
+ /**
+ * Redraw the slider
+ */
+ Graph3d.prototype._redrawSlider = function () {
+ if (this.frame.filter.slider !== undefined) {
+ this.frame.filter.slider.redraw();
+ }
+ };
+
+ /**
+ * Redraw common information
+ */
+ Graph3d.prototype._redrawInfo = function () {
+ if (this.dataFilter) {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+
+ ctx.font = '14px arial'; // TODO: put in options
+ ctx.lineStyle = 'gray';
+ ctx.fillStyle = 'gray';
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'top';
+
+ var x = this.margin;
+ var y = this.margin;
+ ctx.fillText(this.dataFilter.getLabel() + ': ' + this.dataFilter.getSelectedValue(), x, y);
+ }
+ };
+
+ /**
+ * Redraw the axis
+ */
+ Graph3d.prototype._redrawAxis = function () {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ from,
+ to,
+ step,
+ prettyStep,
+ text,
+ xText,
+ yText,
+ zText,
+ offset,
+ xOffset,
+ yOffset,
+ xMin2d,
+ xMax2d;
+
+ // TODO: get the actual rendered style of the containerElement
+ //ctx.font = this.containerElement.style.font;
+ ctx.font = 24 / this.camera.getArmLength() + 'px arial';
+
+ // calculate the length for the short grid lines
+ var gridLenX = 0.025 / this.scale.x;
+ var gridLenY = 0.025 / this.scale.y;
+ var textMargin = 5 / this.camera.getArmLength(); // px
+ var armAngle = this.camera.getArmRotation().horizontal;
+
+ // draw x-grid lines
+ ctx.lineWidth = 1;
+ prettyStep = this.defaultXStep === undefined;
+ step = new StepNumber(this.xMin, this.xMax, this.xStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.xMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ var x = step.getCurrent();
+
+ if (this.showGrid) {
+ from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
+ ctx.strokeStyle = this.gridColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ } else {
+ from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMin + gridLenX, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ from = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMax - gridLenX, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
+
+ yText = Math.cos(armAngle) > 0 ? this.yMin : this.yMax;
+ text = this._convert3Dto2D(new Point3d(x, yText, this.zMin));
+ if (Math.cos(armAngle * 2) > 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ text.y += textMargin;
+ } else if (Math.sin(armAngle * 2) < 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(' ' + this.xValueLabel(step.getCurrent()) + ' ', text.x, text.y);
+
+ step.next();
+ }
+
+ // draw y-grid lines
+ ctx.lineWidth = 1;
+ prettyStep = this.defaultYStep === undefined;
+ step = new StepNumber(this.yMin, this.yMax, this.yStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.yMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ if (this.showGrid) {
+ from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.gridColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ } else {
+ from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMin + gridLenY, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ from = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax - gridLenY, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
+
+ xText = Math.sin(armAngle) > 0 ? this.xMin : this.xMax;
+ text = this._convert3Dto2D(new Point3d(xText, step.getCurrent(), this.zMin));
+ if (Math.cos(armAngle * 2) < 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ text.y += textMargin;
+ } else if (Math.sin(armAngle * 2) > 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(' ' + this.yValueLabel(step.getCurrent()) + ' ', text.x, text.y);
+
+ step.next();
+ }
+
+ // draw z-grid lines and axis
+ ctx.lineWidth = 1;
+ prettyStep = this.defaultZStep === undefined;
+ step = new StepNumber(this.zMin, this.zMax, this.zStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.zMin) {
+ step.next();
+ }
+ xText = Math.cos(armAngle) > 0 ? this.xMin : this.xMax;
+ yText = Math.sin(armAngle) < 0 ? this.yMin : this.yMax;
+ while (!step.end()) {
+ // TODO: make z-grid lines really 3d?
+ from = this._convert3Dto2D(new Point3d(xText, yText, step.getCurrent()));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(from.x - textMargin, from.y);
+ ctx.stroke();
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(this.zValueLabel(step.getCurrent()) + ' ', from.x - 5, from.y);
+
+ step.next();
+ }
+ ctx.lineWidth = 1;
+ from = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ to = this._convert3Dto2D(new Point3d(xText, yText, this.zMax));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ // draw x-axis
+ ctx.lineWidth = 1;
+ // line at yMin
+ xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
+ xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(xMin2d.x, xMin2d.y);
+ ctx.lineTo(xMax2d.x, xMax2d.y);
+ ctx.stroke();
+ // line at ymax
+ xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
+ xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(xMin2d.x, xMin2d.y);
+ ctx.lineTo(xMax2d.x, xMax2d.y);
+ ctx.stroke();
+
+ // draw y-axis
+ ctx.lineWidth = 1;
+ // line at xMin
+ from = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ // line at xMax
+ from = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ // draw x-label
+ var xLabel = this.xLabel;
+ if (xLabel.length > 0) {
+ yOffset = 0.1 / this.scale.y;
+ xText = (this.xMin + this.xMax) / 2;
+ yText = Math.cos(armAngle) > 0 ? this.yMin - yOffset : this.yMax + yOffset;
+ text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ if (Math.cos(armAngle * 2) > 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ } else if (Math.sin(armAngle * 2) < 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(xLabel, text.x, text.y);
+ }
+
+ // draw y-label
+ var yLabel = this.yLabel;
+ if (yLabel.length > 0) {
+ xOffset = 0.1 / this.scale.x;
+ xText = Math.sin(armAngle) > 0 ? this.xMin - xOffset : this.xMax + xOffset;
+ yText = (this.yMin + this.yMax) / 2;
+ text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ if (Math.cos(armAngle * 2) < 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ } else if (Math.sin(armAngle * 2) > 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(yLabel, text.x, text.y);
+ }
+
+ // draw z-label
+ var zLabel = this.zLabel;
+ if (zLabel.length > 0) {
+ offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis?
+ xText = Math.cos(armAngle) > 0 ? this.xMin : this.xMax;
+ yText = Math.sin(armAngle) < 0 ? this.yMin : this.yMax;
+ zText = (this.zMin + this.zMax) / 2;
+ text = this._convert3Dto2D(new Point3d(xText, yText, zText));
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(zLabel, text.x - offset, text.y);
+ }
+ };
+
+ /**
+ * Calculate the color based on the given value.
+ * @param {Number} H Hue, a value be between 0 and 360
+ * @param {Number} S Saturation, a value between 0 and 1
+ * @param {Number} V Value, a value between 0 and 1
+ */
+ Graph3d.prototype._hsv2rgb = function (H, S, V) {
+ var R, G, B, C, Hi, X;
+
+ C = V * S;
+ Hi = Math.floor(H / 60); // hi = 0,1,2,3,4,5
+ X = C * (1 - Math.abs(H / 60 % 2 - 1));
+
+ switch (Hi) {
+ case 0:
+ R = C;G = X;B = 0;break;
+ case 1:
+ R = X;G = C;B = 0;break;
+ case 2:
+ R = 0;G = C;B = X;break;
+ case 3:
+ R = 0;G = X;B = C;break;
+ case 4:
+ R = X;G = 0;B = C;break;
+ case 5:
+ R = C;G = 0;B = X;break;
+
+ default:
+ R = 0;G = 0;B = 0;break;
+ }
+
+ return 'RGB(' + parseInt(R * 255) + ',' + parseInt(G * 255) + ',' + parseInt(B * 255) + ')';
+ };
+
+ /**
+ * Draw all datapoints as a grid
+ * This function can be used when the style is 'grid'
+ */
+ Graph3d.prototype._redrawDataGrid = function () {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ point,
+ right,
+ top,
+ cross,
+ i,
+ topSideVisible,
+ fillStyle,
+ strokeStyle,
+ lineWidth,
+ h,
+ s,
+ v,
+ zAvg;
+
+ ctx.lineJoin = 'round';
+ ctx.lineCap = 'round';
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations and screen position of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the translation of the point at the bottom (needed for sorting)
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // sort the points on depth of their (x,y) position (not on z)
+ var sortDepth = function sortDepth(a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
+
+ if (this.style === Graph3d.STYLE.SURFACE) {
+ for (i = 0; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ right = this.dataPoints[i].pointRight;
+ top = this.dataPoints[i].pointTop;
+ cross = this.dataPoints[i].pointCross;
+
+ if (point !== undefined && right !== undefined && top !== undefined && cross !== undefined) {
+
+ if (this.showGrayBottom || this.showShadow) {
+ // calculate the cross product of the two vectors from center
+ // to left and right, in order to know whether we are looking at the
+ // bottom or at the top side. We can also use the cross product
+ // for calculating light intensity
+ var aDiff = Point3d.subtract(cross.trans, point.trans);
+ var bDiff = Point3d.subtract(top.trans, right.trans);
+ var crossproduct = Point3d.crossProduct(aDiff, bDiff);
+ var len = crossproduct.length();
+ // FIXME: there is a bug with determining the surface side (shadow or colored)
+
+ topSideVisible = crossproduct.z > 0;
+ } else {
+ topSideVisible = true;
+ }
+
+ if (topSideVisible) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + right.point.z + top.point.z + cross.point.z) / 4;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ s = 1; // saturation
+
+ if (this.showShadow) {
+ v = Math.min(1 + crossproduct.x / len / 2, 1); // value. TODO: scale
+ fillStyle = this._hsv2rgb(h, s, v);
+ strokeStyle = fillStyle;
+ } else {
+ v = 1;
+ fillStyle = this._hsv2rgb(h, s, v);
+ strokeStyle = this.axisColor; // TODO: should be customizable
+ }
+ } else {
+ fillStyle = 'gray';
+ strokeStyle = this.axisColor;
+ }
+
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.fillStyle = fillStyle;
+ ctx.strokeStyle = strokeStyle;
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(right.screen.x, right.screen.y);
+ ctx.lineTo(cross.screen.x, cross.screen.y);
+ ctx.lineTo(top.screen.x, top.screen.y);
+ ctx.closePath();
+ ctx.fill();
+ ctx.stroke(); // TODO: only draw stroke when strokeWidth > 0
+ }
+ }
+ } else {
+ // grid style
+ for (i = 0; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ right = this.dataPoints[i].pointRight;
+ top = this.dataPoints[i].pointTop;
+
+ if (point !== undefined && right !== undefined) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + right.point.z) / 2;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+
+ ctx.lineWidth = this._getStrokeWidth(point) * 2;
+ ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(right.screen.x, right.screen.y);
+ ctx.stroke();
+ }
+
+ if (point !== undefined && top !== undefined) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + top.point.z) / 2;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+
+ ctx.lineWidth = this._getStrokeWidth(point) * 2;
+ ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(top.screen.x, top.screen.y);
+ ctx.stroke();
+ }
+ }
+ }
+ };
+
+ Graph3d.prototype._getStrokeWidth = function (point) {
+ if (point !== undefined) {
+ if (this.showPerspective) {
+ return 1 / -point.trans.z * this.dataColor.strokeWidth;
+ } else {
+ return -(this.eye.z / this.camera.getArmLength()) * this.dataColor.strokeWidth;
+ }
+ }
+
+ return this.dataColor.strokeWidth;
+ };
+
+ /**
+ * Draw all datapoints as dots.
+ * This function can be used when the style is 'dot' or 'dot-line'
+ */
+ Graph3d.prototype._redrawDataDot = function () {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ var i;
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the distance from the point at the bottom to the camera
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // order the translated points by depth
+ var sortDepth = function sortDepth(a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
+
+ // draw the datapoints as colored circles
+ var dotSize = this.frame.clientWidth * this.dotSizeRatio; // px
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var point = this.dataPoints[i];
+
+ if (this.style === Graph3d.STYLE.DOTLINE) {
+ // draw a vertical line from the bottom to the graph value
+ //var from = this._convert3Dto2D(new Point3d(point.point.x, point.point.y, this.zMin));
+ var from = this._convert3Dto2D(point.bottom);
+ ctx.lineWidth = 1;
+ ctx.strokeStyle = this.gridColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(point.screen.x, point.screen.y);
+ ctx.stroke();
+ }
+
+ // calculate radius for the circle
+ var size;
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ size = dotSize / 2 + 2 * dotSize * (point.point.value - this.valueMin) / (this.valueMax - this.valueMin);
+ } else {
+ size = dotSize;
+ }
+
+ var radius;
+ if (this.showPerspective) {
+ radius = size / -point.trans.z;
+ } else {
+ radius = size * -(this.eye.z / this.camera.getArmLength());
+ }
+ if (radius < 0) {
+ radius = 0;
+ }
+
+ var hue, color, borderColor;
+ if (this.style === Graph3d.STYLE.DOTCOLOR) {
+ // calculate the color based on the value
+ hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ } else if (this.style === Graph3d.STYLE.DOTSIZE) {
+ color = this.dataColor.fill;
+ borderColor = this.dataColor.stroke;
+ } else {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+
+ // draw the circle
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.strokeStyle = borderColor;
+ ctx.fillStyle = color;
+ ctx.beginPath();
+ ctx.arc(point.screen.x, point.screen.y, radius, 0, Math.PI * 2, true);
+ ctx.fill();
+ ctx.stroke();
+ }
+ };
+
+ /**
+ * Draw all datapoints as bars.
+ * This function can be used when the style is 'bar', 'bar-color', or 'bar-size'
+ */
+ Graph3d.prototype._redrawDataBar = function () {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ var i, j, surface, corners;
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the distance from the point at the bottom to the camera
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // order the translated points by depth
+ var sortDepth = function sortDepth(a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
+
+ ctx.lineJoin = 'round';
+ ctx.lineCap = 'round';
+
+ // draw the datapoints as bars
+ var xWidth = this.xBarWidth / 2;
+ var yWidth = this.yBarWidth / 2;
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var point = this.dataPoints[i];
+
+ // determine color
+ var hue, color, borderColor;
+ if (this.style === Graph3d.STYLE.BARCOLOR) {
+ // calculate the color based on the value
+ hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ } else if (this.style === Graph3d.STYLE.BARSIZE) {
+ color = this.dataColor.fill;
+ borderColor = this.dataColor.stroke;
+ } else {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+
+ // calculate size for the bar
+ if (this.style === Graph3d.STYLE.BARSIZE) {
+ xWidth = this.xBarWidth / 2 * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
+ yWidth = this.yBarWidth / 2 * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
+ }
+
+ // calculate all corner points
+ var me = this;
+ var point3d = point.point;
+ var top = [{ point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, point3d.z) }, { point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, point3d.z) }, { point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, point3d.z) }, { point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, point3d.z) }];
+ var bottom = [{ point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, this.zMin) }, { point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, this.zMin) }, { point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, this.zMin) }, { point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, this.zMin) }];
+
+ // calculate screen location of the points
+ top.forEach(function (obj) {
+ obj.screen = me._convert3Dto2D(obj.point);
+ });
+ bottom.forEach(function (obj) {
+ obj.screen = me._convert3Dto2D(obj.point);
+ });
+
+ // create five sides, calculate both corner points and center points
+ var surfaces = [{ corners: top, center: Point3d.avg(bottom[0].point, bottom[2].point) }, { corners: [top[0], top[1], bottom[1], bottom[0]], center: Point3d.avg(bottom[1].point, bottom[0].point) }, { corners: [top[1], top[2], bottom[2], bottom[1]], center: Point3d.avg(bottom[2].point, bottom[1].point) }, { corners: [top[2], top[3], bottom[3], bottom[2]], center: Point3d.avg(bottom[3].point, bottom[2].point) }, { corners: [top[3], top[0], bottom[0], bottom[3]], center: Point3d.avg(bottom[0].point, bottom[3].point) }];
+ point.surfaces = surfaces;
+
+ // calculate the distance of each of the surface centers to the camera
+ for (j = 0; j < surfaces.length; j++) {
+ surface = surfaces[j];
+ var transCenter = this._convertPointToTranslation(surface.center);
+ surface.dist = this.showPerspective ? transCenter.length() : -transCenter.z;
+ // TODO: this dept calculation doesn't work 100% of the cases due to perspective,
+ // but the current solution is fast/simple and works in 99.9% of all cases
+ // the issue is visible in example 14, with graph.setCameraPosition({horizontal: 2.97, vertical: 0.5, distance: 0.9})
+ }
+
+ // order the surfaces by their (translated) depth
+ surfaces.sort(function (a, b) {
+ var diff = b.dist - a.dist;
+ if (diff) return diff;
+
+ // if equal depth, sort the top surface last
+ if (a.corners === top) return 1;
+ if (b.corners === top) return -1;
+
+ // both are equal
+ return 0;
+ });
+
+ // draw the ordered surfaces
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.strokeStyle = borderColor;
+ ctx.fillStyle = color;
+ // NOTE: we start at j=2 instead of j=0 as we don't need to draw the two surfaces at the backside
+ for (j = 2; j < surfaces.length; j++) {
+ surface = surfaces[j];
+ corners = surface.corners;
+ ctx.beginPath();
+ ctx.moveTo(corners[3].screen.x, corners[3].screen.y);
+ ctx.lineTo(corners[0].screen.x, corners[0].screen.y);
+ ctx.lineTo(corners[1].screen.x, corners[1].screen.y);
+ ctx.lineTo(corners[2].screen.x, corners[2].screen.y);
+ ctx.lineTo(corners[3].screen.x, corners[3].screen.y);
+ ctx.fill();
+ ctx.stroke();
+ }
+ }
+ };
+
+ /**
+ * Draw a line through all datapoints.
+ * This function can be used when the style is 'line'
+ */
+ Graph3d.prototype._redrawDataLine = function () {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ point,
+ i;
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+ }
+
+ // start the line
+ if (this.dataPoints.length > 0) {
+ point = this.dataPoints[0];
+
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.lineJoin = 'round';
+ ctx.lineCap = 'round';
+ ctx.strokeStyle = this.dataColor.stroke;
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+
+ // draw the datapoints as colored circles
+ for (i = 1; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ ctx.lineTo(point.screen.x, point.screen.y);
+ }
+
+ // finish the line
+ ctx.stroke();
+ }
+ };
+
+ /**
+ * Start a moving operation inside the provided parent element
+ * @param {Event} event The event that occurred (required for
+ * retrieving the mouse position)
+ */
+ Graph3d.prototype._onMouseDown = function (event) {
+ event = event || window.event;
+
+ // check if mouse is still down (may be up when focus is lost for example
+ // in an iframe)
+ if (this.leftButtonDown) {
+ this._onMouseUp(event);
+ }
+
+ // only react on left mouse button down
+ this.leftButtonDown = event.which ? event.which === 1 : event.button === 1;
+ if (!this.leftButtonDown && !this.touchDown) return;
+
+ // get mouse position (different code for IE and all other browsers)
+ this.startMouseX = getMouseX(event);
+ this.startMouseY = getMouseY(event);
+
+ this.startStart = new Date(this.start);
+ this.startEnd = new Date(this.end);
+ this.startArmRotation = this.camera.getArmRotation();
+
+ this.frame.style.cursor = 'move';
+
+ // add event listeners to handle moving the contents
+ // we store the function onmousemove and onmouseup in the graph, so we can
+ // remove the eventlisteners lateron in the function mouseUp()
+ var me = this;
+ this.onmousemove = function (event) {
+ me._onMouseMove(event);
+ };
+ this.onmouseup = function (event) {
+ me._onMouseUp(event);
+ };
+ util.addEventListener(document, 'mousemove', me.onmousemove);
+ util.addEventListener(document, 'mouseup', me.onmouseup);
+ util.preventDefault(event);
+ };
+
+ /**
+ * Perform moving operating.
+ * This function activated from within the funcion Graph.mouseDown().
+ * @param {Event} event Well, eehh, the event
+ */
+ Graph3d.prototype._onMouseMove = function (event) {
+ event = event || window.event;
+
+ // calculate change in mouse position
+ var diffX = parseFloat(getMouseX(event)) - this.startMouseX;
+ var diffY = parseFloat(getMouseY(event)) - this.startMouseY;
+
+ var horizontalNew = this.startArmRotation.horizontal + diffX / 200;
+ var verticalNew = this.startArmRotation.vertical + diffY / 200;
+
+ var snapAngle = 4; // degrees
+ var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI);
+
+ // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc...
+ // the -0.001 is to take care that the vertical axis is always drawn at the left front corner
+ if (Math.abs(Math.sin(horizontalNew)) < snapValue) {
+ horizontalNew = Math.round(horizontalNew / Math.PI) * Math.PI - 0.001;
+ }
+ if (Math.abs(Math.cos(horizontalNew)) < snapValue) {
+ horizontalNew = (Math.round(horizontalNew / Math.PI - 0.5) + 0.5) * Math.PI - 0.001;
+ }
+
+ // snap vertically to nice angles
+ if (Math.abs(Math.sin(verticalNew)) < snapValue) {
+ verticalNew = Math.round(verticalNew / Math.PI) * Math.PI;
+ }
+ if (Math.abs(Math.cos(verticalNew)) < snapValue) {
+ verticalNew = (Math.round(verticalNew / Math.PI - 0.5) + 0.5) * Math.PI;
+ }
+
+ this.camera.setArmRotation(horizontalNew, verticalNew);
+ this.redraw();
+
+ // fire a cameraPositionChange event
+ var parameters = this.getCameraPosition();
+ this.emit('cameraPositionChange', parameters);
+
+ util.preventDefault(event);
+ };
+
+ /**
+ * Stop moving operating.
+ * This function activated from within the funcion Graph.mouseDown().
+ * @param {event} event The event
+ */
+ Graph3d.prototype._onMouseUp = function (event) {
+ this.frame.style.cursor = 'auto';
+ this.leftButtonDown = false;
+
+ // remove event listeners here
+ util.removeEventListener(document, 'mousemove', this.onmousemove);
+ util.removeEventListener(document, 'mouseup', this.onmouseup);
+ util.preventDefault(event);
+ };
+
+ /**
+ * After having moved the mouse, a tooltip should pop up when the mouse is resting on a data point
+ * @param {Event} event A mouse move event
+ */
+ Graph3d.prototype._onTooltip = function (event) {
+ var delay = 300; // ms
+ var boundingRect = this.frame.getBoundingClientRect();
+ var mouseX = getMouseX(event) - boundingRect.left;
+ var mouseY = getMouseY(event) - boundingRect.top;
+
+ if (!this.showTooltip) {
+ return;
+ }
+
+ if (this.tooltipTimeout) {
+ clearTimeout(this.tooltipTimeout);
+ }
+
+ // (delayed) display of a tooltip only if no mouse button is down
+ if (this.leftButtonDown) {
+ this._hideTooltip();
+ return;
+ }
+
+ if (this.tooltip && this.tooltip.dataPoint) {
+ // tooltip is currently visible
+ var dataPoint = this._dataPointFromXY(mouseX, mouseY);
+ if (dataPoint !== this.tooltip.dataPoint) {
+ // datapoint changed
+ if (dataPoint) {
+ this._showTooltip(dataPoint);
+ } else {
+ this._hideTooltip();
+ }
+ }
+ } else {
+ // tooltip is currently not visible
+ var me = this;
+ this.tooltipTimeout = setTimeout(function () {
+ me.tooltipTimeout = null;
+
+ // show a tooltip if we have a data point
+ var dataPoint = me._dataPointFromXY(mouseX, mouseY);
+ if (dataPoint) {
+ me._showTooltip(dataPoint);
+ }
+ }, delay);
+ }
+ };
+
+ /**
+ * Event handler for touchstart event on mobile devices
+ */
+ Graph3d.prototype._onTouchStart = function (event) {
+ this.touchDown = true;
+
+ var me = this;
+ this.ontouchmove = function (event) {
+ me._onTouchMove(event);
+ };
+ this.ontouchend = function (event) {
+ me._onTouchEnd(event);
+ };
+ util.addEventListener(document, 'touchmove', me.ontouchmove);
+ util.addEventListener(document, 'touchend', me.ontouchend);
+
+ this._onMouseDown(event);
+ };
+
+ /**
+ * Event handler for touchmove event on mobile devices
+ */
+ Graph3d.prototype._onTouchMove = function (event) {
+ this._onMouseMove(event);
+ };
+
+ /**
+ * Event handler for touchend event on mobile devices
+ */
+ Graph3d.prototype._onTouchEnd = function (event) {
+ this.touchDown = false;
+
+ util.removeEventListener(document, 'touchmove', this.ontouchmove);
+ util.removeEventListener(document, 'touchend', this.ontouchend);
+
+ this._onMouseUp(event);
+ };
+
+ /**
+ * Event handler for mouse wheel event, used to zoom the graph
+ * Code from http://adomas.org/javascript-mouse-wheel/
+ * @param {event} event The event
+ */
+ Graph3d.prototype._onWheel = function (event) {
+ if (!event) /* For IE. */
+ event = window.event;
+
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) {
+ /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) {
+ /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta) {
+ var oldLength = this.camera.getArmLength();
+ var newLength = oldLength * (1 - delta / 10);
+
+ this.camera.setArmLength(newLength);
+ this.redraw();
+
+ this._hideTooltip();
+ }
+
+ // fire a cameraPositionChange event
+ var parameters = this.getCameraPosition();
+ this.emit('cameraPositionChange', parameters);
+
+ // Prevent default actions caused by mouse wheel.
+ // That might be ugly, but we handle scrolls somehow
+ // anyway, so don't bother here..
+ util.preventDefault(event);
+ };
+
+ /**
+ * Test whether a point lies inside given 2D triangle
+ * @param {Point2d} point
+ * @param {Point2d[]} triangle
+ * @return {boolean} Returns true if given point lies inside or on the edge of the triangle
+ * @private
+ */
+ Graph3d.prototype._insideTriangle = function (point, triangle) {
+ var a = triangle[0],
+ b = triangle[1],
+ c = triangle[2];
+
+ function sign(x) {
+ return x > 0 ? 1 : x < 0 ? -1 : 0;
+ }
+
+ var as = sign((b.x - a.x) * (point.y - a.y) - (b.y - a.y) * (point.x - a.x));
+ var bs = sign((c.x - b.x) * (point.y - b.y) - (c.y - b.y) * (point.x - b.x));
+ var cs = sign((a.x - c.x) * (point.y - c.y) - (a.y - c.y) * (point.x - c.x));
+
+ // each of the three signs must be either equal to each other or zero
+ return (as == 0 || bs == 0 || as == bs) && (bs == 0 || cs == 0 || bs == cs) && (as == 0 || cs == 0 || as == cs);
+ };
+
+ /**
+ * Find a data point close to given screen position (x, y)
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object | null} The closest data point or null if not close to any data point
+ * @private
+ */
+ Graph3d.prototype._dataPointFromXY = function (x, y) {
+ var i,
+ distMax = 100,
+ // px
+ dataPoint = null,
+ closestDataPoint = null,
+ closestDist = null,
+ center = new Point2d(x, y);
+
+ if (this.style === Graph3d.STYLE.BAR || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
+ // the data points are ordered from far away to closest
+ for (i = this.dataPoints.length - 1; i >= 0; i--) {
+ dataPoint = this.dataPoints[i];
+ var surfaces = dataPoint.surfaces;
+ if (surfaces) {
+ for (var s = surfaces.length - 1; s >= 0; s--) {
+ // split each surface in two triangles, and see if the center point is inside one of these
+ var surface = surfaces[s];
+ var corners = surface.corners;
+ var triangle1 = [corners[0].screen, corners[1].screen, corners[2].screen];
+ var triangle2 = [corners[2].screen, corners[3].screen, corners[0].screen];
+ if (this._insideTriangle(center, triangle1) || this._insideTriangle(center, triangle2)) {
+ // return immediately at the first hit
+ return dataPoint;
+ }
+ }
+ }
+ }
+ } else {
+ // find the closest data point, using distance to the center of the point on 2d screen
+ for (i = 0; i < this.dataPoints.length; i++) {
+ dataPoint = this.dataPoints[i];
+ var point = dataPoint.screen;
+ if (point) {
+ var distX = Math.abs(x - point.x);
+ var distY = Math.abs(y - point.y);
+ var dist = Math.sqrt(distX * distX + distY * distY);
+
+ if ((closestDist === null || dist < closestDist) && dist < distMax) {
+ closestDist = dist;
+ closestDataPoint = dataPoint;
+ }
+ }
+ }
+ }
+
+ return closestDataPoint;
+ };
+
+ /**
+ * Display a tooltip for given data point
+ * @param {Object} dataPoint
+ * @private
+ */
+ Graph3d.prototype._showTooltip = function (dataPoint) {
+ var content, line, dot;
+
+ if (!this.tooltip) {
+ content = document.createElement('div');
+ content.style.position = 'absolute';
+ content.style.padding = '10px';
+ content.style.border = '1px solid #4d4d4d';
+ content.style.color = '#1a1a1a';
+ content.style.background = 'rgba(255,255,255,0.7)';
+ content.style.borderRadius = '2px';
+ content.style.boxShadow = '5px 5px 10px rgba(128,128,128,0.5)';
+
+ line = document.createElement('div');
+ line.style.position = 'absolute';
+ line.style.height = '40px';
+ line.style.width = '0';
+ line.style.borderLeft = '1px solid #4d4d4d';
+
+ dot = document.createElement('div');
+ dot.style.position = 'absolute';
+ dot.style.height = '0';
+ dot.style.width = '0';
+ dot.style.border = '5px solid #4d4d4d';
+ dot.style.borderRadius = '5px';
+
+ this.tooltip = {
+ dataPoint: null,
+ dom: {
+ content: content,
+ line: line,
+ dot: dot
+ }
+ };
+ } else {
+ content = this.tooltip.dom.content;
+ line = this.tooltip.dom.line;
+ dot = this.tooltip.dom.dot;
+ }
+
+ this._hideTooltip();
+
+ this.tooltip.dataPoint = dataPoint;
+ if (typeof this.showTooltip === 'function') {
+ content.innerHTML = this.showTooltip(dataPoint.point);
+ } else {
+ content.innerHTML = '<table>' + '<tr><td>' + this.xLabel + ':</td><td>' + dataPoint.point.x + '</td></tr>' + '<tr><td>' + this.yLabel + ':</td><td>' + dataPoint.point.y + '</td></tr>' + '<tr><td>' + this.zLabel + ':</td><td>' + dataPoint.point.z + '</td></tr>' + '</table>';
+ }
+
+ content.style.left = '0';
+ content.style.top = '0';
+ this.frame.appendChild(content);
+ this.frame.appendChild(line);
+ this.frame.appendChild(dot);
+
+ // calculate sizes
+ var contentWidth = content.offsetWidth;
+ var contentHeight = content.offsetHeight;
+ var lineHeight = line.offsetHeight;
+ var dotWidth = dot.offsetWidth;
+ var dotHeight = dot.offsetHeight;
+
+ var left = dataPoint.screen.x - contentWidth / 2;
+ left = Math.min(Math.max(left, 10), this.frame.clientWidth - 10 - contentWidth);
+
+ line.style.left = dataPoint.screen.x + 'px';
+ line.style.top = dataPoint.screen.y - lineHeight + 'px';
+ content.style.left = left + 'px';
+ content.style.top = dataPoint.screen.y - lineHeight - contentHeight + 'px';
+ dot.style.left = dataPoint.screen.x - dotWidth / 2 + 'px';
+ dot.style.top = dataPoint.screen.y - dotHeight / 2 + 'px';
+ };
+
+ /**
+ * Hide the tooltip when displayed
+ * @private
+ */
+ Graph3d.prototype._hideTooltip = function () {
+ if (this.tooltip) {
+ this.tooltip.dataPoint = null;
+
+ for (var prop in this.tooltip.dom) {
+ if (this.tooltip.dom.hasOwnProperty(prop)) {
+ var elem = this.tooltip.dom[prop];
+ if (elem && elem.parentNode) {
+ elem.parentNode.removeChild(elem);
+ }
+ }
+ }
+ }
+ };
+
+ /**--------------------------------------------------------------------------**/
+
+ /**
+ * Get the horizontal mouse position from a mouse event
+ * @param {Event} event
+ * @return {Number} mouse x
+ */
+ function getMouseX(event) {
+ if ('clientX' in event) return event.clientX;
+ return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
+ }
+
+ /**
+ * Get the vertical mouse position from a mouse event
+ * @param {Event} event
+ * @return {Number} mouse y
+ */
+ function getMouseY(event) {
+ if ('clientY' in event) return event.clientY;
+ return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
+ }
+
+ module.exports = Graph3d;
+
+/***/ },
+/* 13 */
+/***/ function(module, exports) {
+
+
+ /**
+ * Expose `Emitter`.
+ */
+
+ module.exports = Emitter;
+
+ /**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
+
+ function Emitter(obj) {
+ if (obj) return mixin(obj);
+ };
+
+ /**
+ * Mixin the emitter properties.
+ *
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
+ */
+
+ function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
+ }
+ return obj;
+ }
+
+ /**
+ * Listen on the given `event` with `fn`.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.on =
+ Emitter.prototype.addEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks[event] = this._callbacks[event] || [])
+ .push(fn);
+ return this;
+ };
+
+ /**
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.once = function(event, fn){
+ var self = this;
+ this._callbacks = this._callbacks || {};
+
+ function on() {
+ self.off(event, on);
+ fn.apply(this, arguments);
+ }
+
+ on.fn = fn;
+ this.on(event, on);
+ return this;
+ };
+
+ /**
+ * Remove the given callback for `event` or all
+ * registered callbacks.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.off =
+ Emitter.prototype.removeListener =
+ Emitter.prototype.removeAllListeners =
+ Emitter.prototype.removeEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
+ var callbacks = this._callbacks[event];
+ if (!callbacks) return this;
+
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks[event];
+ return this;
+ }
+
+ // remove specific handler
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+ return this;
+ };
+
+ /**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+ Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks[event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
+ }
+ }
+
+ return this;
+ };
+
+ /**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+
+ Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks[event] || [];
+ };
+
+ /**
+ * Check if this emitter has `event` handlers.
+ *
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
+ */
+
+ Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+ };
+
+
+/***/ },
+/* 14 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ /**
+ * @prototype Point3d
+ * @param {Number} [x]
+ * @param {Number} [y]
+ * @param {Number} [z]
+ */
+ function Point3d(x, y, z) {
+ this.x = x !== undefined ? x : 0;
+ this.y = y !== undefined ? y : 0;
+ this.z = z !== undefined ? z : 0;
+ };
+
+ /**
+ * Subtract the two provided points, returns a-b
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} a-b
+ */
+ Point3d.subtract = function (a, b) {
+ var sub = new Point3d();
+ sub.x = a.x - b.x;
+ sub.y = a.y - b.y;
+ sub.z = a.z - b.z;
+ return sub;
+ };
+
+ /**
+ * Add the two provided points, returns a+b
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} a+b
+ */
+ Point3d.add = function (a, b) {
+ var sum = new Point3d();
+ sum.x = a.x + b.x;
+ sum.y = a.y + b.y;
+ sum.z = a.z + b.z;
+ return sum;
+ };
+
+ /**
+ * Calculate the average of two 3d points
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} The average, (a+b)/2
+ */
+ Point3d.avg = function (a, b) {
+ return new Point3d((a.x + b.x) / 2, (a.y + b.y) / 2, (a.z + b.z) / 2);
+ };
+
+ /**
+ * Calculate the cross product of the two provided points, returns axb
+ * Documentation: http://en.wikipedia.org/wiki/Cross_product
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} cross product axb
+ */
+ Point3d.crossProduct = function (a, b) {
+ var crossproduct = new Point3d();
+
+ crossproduct.x = a.y * b.z - a.z * b.y;
+ crossproduct.y = a.z * b.x - a.x * b.z;
+ crossproduct.z = a.x * b.y - a.y * b.x;
+
+ return crossproduct;
+ };
+
+ /**
+ * Rtrieve the length of the vector (or the distance from this point to the origin
+ * @return {Number} length
+ */
+ Point3d.prototype.length = function () {
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
+ };
+
+ module.exports = Point3d;
+
+/***/ },
+/* 15 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ /**
+ * @prototype Point2d
+ * @param {Number} [x]
+ * @param {Number} [y]
+ */
+ function Point2d(x, y) {
+ this.x = x !== undefined ? x : 0;
+ this.y = y !== undefined ? y : 0;
+ }
+
+ module.exports = Point2d;
+
+/***/ },
+/* 16 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Point3d = __webpack_require__(14);
+
+ /**
+ * @class Camera
+ * The camera is mounted on a (virtual) camera arm. The camera arm can rotate
+ * The camera is always looking in the direction of the origin of the arm.
+ * This way, the camera always rotates around one fixed point, the location
+ * of the camera arm.
+ *
+ * Documentation:
+ * http://en.wikipedia.org/wiki/3D_projection
+ */
+ function Camera() {
+ this.armLocation = new Point3d();
+ this.armRotation = {};
+ this.armRotation.horizontal = 0;
+ this.armRotation.vertical = 0;
+ this.armLength = 1.7;
+
+ this.cameraLocation = new Point3d();
+ this.cameraRotation = new Point3d(0.5 * Math.PI, 0, 0);
+
+ this.calculateCameraOrientation();
+ }
+
+ /**
+ * Set the location (origin) of the arm
+ * @param {Number} x Normalized value of x
+ * @param {Number} y Normalized value of y
+ * @param {Number} z Normalized value of z
+ */
+ Camera.prototype.setArmLocation = function (x, y, z) {
+ this.armLocation.x = x;
+ this.armLocation.y = y;
+ this.armLocation.z = z;
+
+ this.calculateCameraOrientation();
+ };
+
+ /**
+ * Set the rotation of the camera arm
+ * @param {Number} horizontal The horizontal rotation, between 0 and 2*PI.
+ * Optional, can be left undefined.
+ * @param {Number} vertical The vertical rotation, between 0 and 0.5*PI
+ * if vertical=0.5*PI, the graph is shown from the
+ * top. Optional, can be left undefined.
+ */
+ Camera.prototype.setArmRotation = function (horizontal, vertical) {
+ if (horizontal !== undefined) {
+ this.armRotation.horizontal = horizontal;
+ }
+
+ if (vertical !== undefined) {
+ this.armRotation.vertical = vertical;
+ if (this.armRotation.vertical < 0) this.armRotation.vertical = 0;
+ if (this.armRotation.vertical > 0.5 * Math.PI) this.armRotation.vertical = 0.5 * Math.PI;
+ }
+
+ if (horizontal !== undefined || vertical !== undefined) {
+ this.calculateCameraOrientation();
+ }
+ };
+
+ /**
+ * Retrieve the current arm rotation
+ * @return {object} An object with parameters horizontal and vertical
+ */
+ Camera.prototype.getArmRotation = function () {
+ var rot = {};
+ rot.horizontal = this.armRotation.horizontal;
+ rot.vertical = this.armRotation.vertical;
+
+ return rot;
+ };
+
+ /**
+ * Set the (normalized) length of the camera arm.
+ * @param {Number} length A length between 0.71 and 5.0
+ */
+ Camera.prototype.setArmLength = function (length) {
+ if (length === undefined) return;
+
+ this.armLength = length;
+
+ // Radius must be larger than the corner of the graph,
+ // which has a distance of sqrt(0.5^2+0.5^2) = 0.71 from the center of the
+ // graph
+ if (this.armLength < 0.71) this.armLength = 0.71;
+ if (this.armLength > 5.0) this.armLength = 5.0;
+
+ this.calculateCameraOrientation();
+ };
+
+ /**
+ * Retrieve the arm length
+ * @return {Number} length
+ */
+ Camera.prototype.getArmLength = function () {
+ return this.armLength;
+ };
+
+ /**
+ * Retrieve the camera location
+ * @return {Point3d} cameraLocation
+ */
+ Camera.prototype.getCameraLocation = function () {
+ return this.cameraLocation;
+ };
+
+ /**
+ * Retrieve the camera rotation
+ * @return {Point3d} cameraRotation
+ */
+ Camera.prototype.getCameraRotation = function () {
+ return this.cameraRotation;
+ };
+
+ /**
+ * Calculate the location and rotation of the camera based on the
+ * position and orientation of the camera arm
+ */
+ Camera.prototype.calculateCameraOrientation = function () {
+ // calculate location of the camera
+ this.cameraLocation.x = this.armLocation.x - this.armLength * Math.sin(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
+ this.cameraLocation.y = this.armLocation.y - this.armLength * Math.cos(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
+ this.cameraLocation.z = this.armLocation.z + this.armLength * Math.sin(this.armRotation.vertical);
+
+ // calculate rotation of the camera
+ this.cameraRotation.x = Math.PI / 2 - this.armRotation.vertical;
+ this.cameraRotation.y = 0;
+ this.cameraRotation.z = -this.armRotation.horizontal;
+ };
+
+ module.exports = Camera;
+
+/***/ },
+/* 17 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var DataView = __webpack_require__(11);
+
+ /**
+ * @class Filter
+ *
+ * @param {DataSet} data The google data table
+ * @param {Number} column The index of the column to be filtered
+ * @param {Graph} graph The graph
+ */
+ function Filter(data, column, graph) {
+ this.data = data;
+ this.column = column;
+ this.graph = graph; // the parent graph
+
+ this.index = undefined;
+ this.value = undefined;
+
+ // read all distinct values and select the first one
+ this.values = graph.getDistinctValues(data.get(), this.column);
+
+ // sort both numeric and string values correctly
+ this.values.sort(function (a, b) {
+ return a > b ? 1 : a < b ? -1 : 0;
+ });
+
+ if (this.values.length > 0) {
+ this.selectValue(0);
+ }
+
+ // create an array with the filtered datapoints. this will be loaded afterwards
+ this.dataPoints = [];
+
+ this.loaded = false;
+ this.onLoadCallback = undefined;
+
+ if (graph.animationPreload) {
+ this.loaded = false;
+ this.loadInBackground();
+ } else {
+ this.loaded = true;
+ }
+ };
+
+ /**
+ * Return the label
+ * @return {string} label
+ */
+ Filter.prototype.isLoaded = function () {
+ return this.loaded;
+ };
+
+ /**
+ * Return the loaded progress
+ * @return {Number} percentage between 0 and 100
+ */
+ Filter.prototype.getLoadedProgress = function () {
+ var len = this.values.length;
+
+ var i = 0;
+ while (this.dataPoints[i]) {
+ i++;
+ }
+
+ return Math.round(i / len * 100);
+ };
+
+ /**
+ * Return the label
+ * @return {string} label
+ */
+ Filter.prototype.getLabel = function () {
+ return this.graph.filterLabel;
+ };
+
+ /**
+ * Return the columnIndex of the filter
+ * @return {Number} columnIndex
+ */
+ Filter.prototype.getColumn = function () {
+ return this.column;
+ };
+
+ /**
+ * Return the currently selected value. Returns undefined if there is no selection
+ * @return {*} value
+ */
+ Filter.prototype.getSelectedValue = function () {
+ if (this.index === undefined) return undefined;
+
+ return this.values[this.index];
+ };
+
+ /**
+ * Retrieve all values of the filter
+ * @return {Array} values
+ */
+ Filter.prototype.getValues = function () {
+ return this.values;
+ };
+
+ /**
+ * Retrieve one value of the filter
+ * @param {Number} index
+ * @return {*} value
+ */
+ Filter.prototype.getValue = function (index) {
+ if (index >= this.values.length) throw 'Error: index out of range';
+
+ return this.values[index];
+ };
+
+ /**
+ * Retrieve the (filtered) dataPoints for the currently selected filter index
+ * @param {Number} [index] (optional)
+ * @return {Array} dataPoints
+ */
+ Filter.prototype._getDataPoints = function (index) {
+ if (index === undefined) index = this.index;
+
+ if (index === undefined) return [];
+
+ var dataPoints;
+ if (this.dataPoints[index]) {
+ dataPoints = this.dataPoints[index];
+ } else {
+ var f = {};
+ f.column = this.column;
+ f.value = this.values[index];
+
+ var dataView = new DataView(this.data, { filter: function filter(item) {
+ return item[f.column] == f.value;
+ } }).get();
+ dataPoints = this.graph._getDataPoints(dataView);
+
+ this.dataPoints[index] = dataPoints;
+ }
+
+ return dataPoints;
+ };
+
+ /**
+ * Set a callback function when the filter is fully loaded.
+ */
+ Filter.prototype.setOnLoadCallback = function (callback) {
+ this.onLoadCallback = callback;
+ };
+
+ /**
+ * Add a value to the list with available values for this filter
+ * No double entries will be created.
+ * @param {Number} index
+ */
+ Filter.prototype.selectValue = function (index) {
+ if (index >= this.values.length) throw 'Error: index out of range';
+
+ this.index = index;
+ this.value = this.values[index];
+ };
+
+ /**
+ * Load all filtered rows in the background one by one
+ * Start this method without providing an index!
+ */
+ Filter.prototype.loadInBackground = function (index) {
+ if (index === undefined) index = 0;
+
+ var frame = this.graph.frame;
+
+ if (index < this.values.length) {
+ var dataPointsTemp = this._getDataPoints(index);
+ //this.graph.redrawInfo(); // TODO: not neat
+
+ // create a progress box
+ if (frame.progress === undefined) {
+ frame.progress = document.createElement('DIV');
+ frame.progress.style.position = 'absolute';
+ frame.progress.style.color = 'gray';
+ frame.appendChild(frame.progress);
+ }
+ var progress = this.getLoadedProgress();
+ frame.progress.innerHTML = 'Loading animation... ' + progress + '%';
+ // TODO: this is no nice solution...
+ frame.progress.style.bottom = 60 + 'px'; // TODO: use height of slider
+ frame.progress.style.left = 10 + 'px';
+
+ var me = this;
+ setTimeout(function () {
+ me.loadInBackground(index + 1);
+ }, 10);
+ this.loaded = false;
+ } else {
+ this.loaded = true;
+
+ // remove the progress box
+ if (frame.progress !== undefined) {
+ frame.removeChild(frame.progress);
+ frame.progress = undefined;
+ }
+
+ if (this.onLoadCallback) this.onLoadCallback();
+ }
+ };
+
+ module.exports = Filter;
+
+/***/ },
+/* 18 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor Slider
+ *
+ * An html slider control with start/stop/prev/next buttons
+ * @param {Element} container The element where the slider will be created
+ * @param {Object} options Available options:
+ * {boolean} visible If true (default) the
+ * slider is visible.
+ */
+ function Slider(container, options) {
+ if (container === undefined) {
+ throw 'Error: No container element defined';
+ }
+ this.container = container;
+ this.visible = options && options.visible != undefined ? options.visible : true;
+
+ if (this.visible) {
+ this.frame = document.createElement('DIV');
+ //this.frame.style.backgroundColor = '#E5E5E5';
+ this.frame.style.width = '100%';
+ this.frame.style.position = 'relative';
+ this.container.appendChild(this.frame);
+
+ this.frame.prev = document.createElement('INPUT');
+ this.frame.prev.type = 'BUTTON';
+ this.frame.prev.value = 'Prev';
+ this.frame.appendChild(this.frame.prev);
+
+ this.frame.play = document.createElement('INPUT');
+ this.frame.play.type = 'BUTTON';
+ this.frame.play.value = 'Play';
+ this.frame.appendChild(this.frame.play);
+
+ this.frame.next = document.createElement('INPUT');
+ this.frame.next.type = 'BUTTON';
+ this.frame.next.value = 'Next';
+ this.frame.appendChild(this.frame.next);
+
+ this.frame.bar = document.createElement('INPUT');
+ this.frame.bar.type = 'BUTTON';
+ this.frame.bar.style.position = 'absolute';
+ this.frame.bar.style.border = '1px solid red';
+ this.frame.bar.style.width = '100px';
+ this.frame.bar.style.height = '6px';
+ this.frame.bar.style.borderRadius = '2px';
+ this.frame.bar.style.MozBorderRadius = '2px';
+ this.frame.bar.style.border = '1px solid #7F7F7F';
+ this.frame.bar.style.backgroundColor = '#E5E5E5';
+ this.frame.appendChild(this.frame.bar);
+
+ this.frame.slide = document.createElement('INPUT');
+ this.frame.slide.type = 'BUTTON';
+ this.frame.slide.style.margin = '0px';
+ this.frame.slide.value = ' ';
+ this.frame.slide.style.position = 'relative';
+ this.frame.slide.style.left = '-100px';
+ this.frame.appendChild(this.frame.slide);
+
+ // create events
+ var me = this;
+ this.frame.slide.onmousedown = function (event) {
+ me._onMouseDown(event);
+ };
+ this.frame.prev.onclick = function (event) {
+ me.prev(event);
+ };
+ this.frame.play.onclick = function (event) {
+ me.togglePlay(event);
+ };
+ this.frame.next.onclick = function (event) {
+ me.next(event);
+ };
+ }
+
+ this.onChangeCallback = undefined;
+
+ this.values = [];
+ this.index = undefined;
+
+ this.playTimeout = undefined;
+ this.playInterval = 1000; // milliseconds
+ this.playLoop = true;
+ }
+
+ /**
+ * Select the previous index
+ */
+ Slider.prototype.prev = function () {
+ var index = this.getIndex();
+ if (index > 0) {
+ index--;
+ this.setIndex(index);
+ }
+ };
+
+ /**
+ * Select the next index
+ */
+ Slider.prototype.next = function () {
+ var index = this.getIndex();
+ if (index < this.values.length - 1) {
+ index++;
+ this.setIndex(index);
+ }
+ };
+
+ /**
+ * Select the next index
+ */
+ Slider.prototype.playNext = function () {
+ var start = new Date();
+
+ var index = this.getIndex();
+ if (index < this.values.length - 1) {
+ index++;
+ this.setIndex(index);
+ } else if (this.playLoop) {
+ // jump to the start
+ index = 0;
+ this.setIndex(index);
+ }
+
+ var end = new Date();
+ var diff = end - start;
+
+ // calculate how much time it to to set the index and to execute the callback
+ // function.
+ var interval = Math.max(this.playInterval - diff, 0);
+ // document.title = diff // TODO: cleanup
+
+ var me = this;
+ this.playTimeout = setTimeout(function () {
+ me.playNext();
+ }, interval);
+ };
+
+ /**
+ * Toggle start or stop playing
+ */
+ Slider.prototype.togglePlay = function () {
+ if (this.playTimeout === undefined) {
+ this.play();
+ } else {
+ this.stop();
+ }
+ };
+
+ /**
+ * Start playing
+ */
+ Slider.prototype.play = function () {
+ // Test whether already playing
+ if (this.playTimeout) return;
+
+ this.playNext();
+
+ if (this.frame) {
+ this.frame.play.value = 'Stop';
+ }
+ };
+
+ /**
+ * Stop playing
+ */
+ Slider.prototype.stop = function () {
+ clearInterval(this.playTimeout);
+ this.playTimeout = undefined;
+
+ if (this.frame) {
+ this.frame.play.value = 'Play';
+ }
+ };
+
+ /**
+ * Set a callback function which will be triggered when the value of the
+ * slider bar has changed.
+ */
+ Slider.prototype.setOnChangeCallback = function (callback) {
+ this.onChangeCallback = callback;
+ };
+
+ /**
+ * Set the interval for playing the list
+ * @param {Number} interval The interval in milliseconds
+ */
+ Slider.prototype.setPlayInterval = function (interval) {
+ this.playInterval = interval;
+ };
+
+ /**
+ * Retrieve the current play interval
+ * @return {Number} interval The interval in milliseconds
+ */
+ Slider.prototype.getPlayInterval = function (interval) {
+ return this.playInterval;
+ };
+
+ /**
+ * Set looping on or off
+ * @pararm {boolean} doLoop If true, the slider will jump to the start when
+ * the end is passed, and will jump to the end
+ * when the start is passed.
+ */
+ Slider.prototype.setPlayLoop = function (doLoop) {
+ this.playLoop = doLoop;
+ };
+
+ /**
+ * Execute the onchange callback function
+ */
+ Slider.prototype.onChange = function () {
+ if (this.onChangeCallback !== undefined) {
+ this.onChangeCallback();
+ }
+ };
+
+ /**
+ * redraw the slider on the correct place
+ */
+ Slider.prototype.redraw = function () {
+ if (this.frame) {
+ // resize the bar
+ this.frame.bar.style.top = this.frame.clientHeight / 2 - this.frame.bar.offsetHeight / 2 + 'px';
+ this.frame.bar.style.width = this.frame.clientWidth - this.frame.prev.clientWidth - this.frame.play.clientWidth - this.frame.next.clientWidth - 30 + 'px';
+
+ // position the slider button
+ var left = this.indexToLeft(this.index);
+ this.frame.slide.style.left = left + 'px';
+ }
+ };
+
+ /**
+ * Set the list with values for the slider
+ * @param {Array} values A javascript array with values (any type)
+ */
+ Slider.prototype.setValues = function (values) {
+ this.values = values;
+
+ if (this.values.length > 0) this.setIndex(0);else this.index = undefined;
+ };
+
+ /**
+ * Select a value by its index
+ * @param {Number} index
+ */
+ Slider.prototype.setIndex = function (index) {
+ if (index < this.values.length) {
+ this.index = index;
+
+ this.redraw();
+ this.onChange();
+ } else {
+ throw 'Error: index out of range';
+ }
+ };
+
+ /**
+ * retrieve the index of the currently selected vaue
+ * @return {Number} index
+ */
+ Slider.prototype.getIndex = function () {
+ return this.index;
+ };
+
+ /**
+ * retrieve the currently selected value
+ * @return {*} value
+ */
+ Slider.prototype.get = function () {
+ return this.values[this.index];
+ };
+
+ Slider.prototype._onMouseDown = function (event) {
+ // only react on left mouse button down
+ var leftButtonDown = event.which ? event.which === 1 : event.button === 1;
+ if (!leftButtonDown) return;
+
+ this.startClientX = event.clientX;
+ this.startSlideX = parseFloat(this.frame.slide.style.left);
+
+ this.frame.style.cursor = 'move';
+
+ // add event listeners to handle moving the contents
+ // we store the function onmousemove and onmouseup in the graph, so we can
+ // remove the eventlisteners lateron in the function mouseUp()
+ var me = this;
+ this.onmousemove = function (event) {
+ me._onMouseMove(event);
+ };
+ this.onmouseup = function (event) {
+ me._onMouseUp(event);
+ };
+ util.addEventListener(document, 'mousemove', this.onmousemove);
+ util.addEventListener(document, 'mouseup', this.onmouseup);
+ util.preventDefault(event);
+ };
+
+ Slider.prototype.leftToIndex = function (left) {
+ var width = parseFloat(this.frame.bar.style.width) - this.frame.slide.clientWidth - 10;
+ var x = left - 3;
+
+ var index = Math.round(x / width * (this.values.length - 1));
+ if (index < 0) index = 0;
+ if (index > this.values.length - 1) index = this.values.length - 1;
+
+ return index;
+ };
+
+ Slider.prototype.indexToLeft = function (index) {
+ var width = parseFloat(this.frame.bar.style.width) - this.frame.slide.clientWidth - 10;
+
+ var x = index / (this.values.length - 1) * width;
+ var left = x + 3;
+
+ return left;
+ };
+
+ Slider.prototype._onMouseMove = function (event) {
+ var diff = event.clientX - this.startClientX;
+ var x = this.startSlideX + diff;
+
+ var index = this.leftToIndex(x);
+
+ this.setIndex(index);
+
+ util.preventDefault();
+ };
+
+ Slider.prototype._onMouseUp = function (event) {
+ this.frame.style.cursor = 'auto';
+
+ // remove event listeners
+ util.removeEventListener(document, 'mousemove', this.onmousemove);
+ util.removeEventListener(document, 'mouseup', this.onmouseup);
+
+ util.preventDefault();
+ };
+
+ module.exports = Slider;
+
+/***/ },
+/* 19 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ /**
+ * @prototype StepNumber
+ * The class StepNumber is an iterator for Numbers. You provide a start and end
+ * value, and a best step size. StepNumber itself rounds to fixed values and
+ * a finds the step that best fits the provided step.
+ *
+ * If prettyStep is true, the step size is chosen as close as possible to the
+ * provided step, but being a round value like 1, 2, 5, 10, 20, 50, ....
+ *
+ * Example usage:
+ * var step = new StepNumber(0, 10, 2.5, true);
+ * step.start();
+ * while (!step.end()) {
+ * alert(step.getCurrent());
+ * step.next();
+ * }
+ *
+ * Version: 1.0
+ *
+ * @param {Number} start The start value
+ * @param {Number} end The end value
+ * @param {Number} step Optional. Step size. Must be a positive value.
+ * @param {boolean} prettyStep Optional. If true, the step size is rounded
+ * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ */
+ function StepNumber(start, end, step, prettyStep) {
+ // set default values
+ this._start = 0;
+ this._end = 0;
+ this._step = 1;
+ this.prettyStep = true;
+ this.precision = 5;
+
+ this._current = 0;
+ this.setRange(start, end, step, prettyStep);
+ };
+
+ /**
+ * Set a new range: start, end and step.
+ *
+ * @param {Number} start The start value
+ * @param {Number} end The end value
+ * @param {Number} step Optional. Step size. Must be a positive value.
+ * @param {boolean} prettyStep Optional. If true, the step size is rounded
+ * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ */
+ StepNumber.prototype.setRange = function (start, end, step, prettyStep) {
+ this._start = start ? start : 0;
+ this._end = end ? end : 0;
+
+ this.setStep(step, prettyStep);
+ };
+
+ /**
+ * Set a new step size
+ * @param {Number} step New step size. Must be a positive value
+ * @param {boolean} prettyStep Optional. If true, the provided step is rounded
+ * to a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ */
+ StepNumber.prototype.setStep = function (step, prettyStep) {
+ if (step === undefined || step <= 0) return;
+
+ if (prettyStep !== undefined) this.prettyStep = prettyStep;
+
+ if (this.prettyStep === true) this._step = StepNumber.calculatePrettyStep(step);else this._step = step;
+ };
+
+ /**
+ * Calculate a nice step size, closest to the desired step size.
+ * Returns a value in one of the ranges 1*10^n, 2*10^n, or 5*10^n, where n is an
+ * integer Number. For example 1, 2, 5, 10, 20, 50, etc...
+ * @param {Number} step Desired step size
+ * @return {Number} Nice step size
+ */
+ StepNumber.calculatePrettyStep = function (step) {
+ var log10 = function log10(x) {
+ return Math.log(x) / Math.LN10;
+ };
+
+ // try three steps (multiple of 1, 2, or 5
+ var step1 = Math.pow(10, Math.round(log10(step))),
+ step2 = 2 * Math.pow(10, Math.round(log10(step / 2))),
+ step5 = 5 * Math.pow(10, Math.round(log10(step / 5)));
+
+ // choose the best step (closest to minimum step)
+ var prettyStep = step1;
+ if (Math.abs(step2 - step) <= Math.abs(prettyStep - step)) prettyStep = step2;
+ if (Math.abs(step5 - step) <= Math.abs(prettyStep - step)) prettyStep = step5;
+
+ // for safety
+ if (prettyStep <= 0) {
+ prettyStep = 1;
+ }
+
+ return prettyStep;
+ };
+
+ /**
+ * returns the current value of the step
+ * @return {Number} current value
+ */
+ StepNumber.prototype.getCurrent = function () {
+ return parseFloat(this._current.toPrecision(this.precision));
+ };
+
+ /**
+ * returns the current step size
+ * @return {Number} current step size
+ */
+ StepNumber.prototype.getStep = function () {
+ return this._step;
+ };
+
+ /**
+ * Set the current value to the largest value smaller than start, which
+ * is a multiple of the step size
+ */
+ StepNumber.prototype.start = function () {
+ this._current = this._start - this._start % this._step;
+ };
+
+ /**
+ * Do a step, add the step size to the current value
+ */
+ StepNumber.prototype.next = function () {
+ this._current += this._step;
+ };
+
+ /**
+ * Returns true whether the end is reached
+ * @return {boolean} True if the current value has passed the end value.
+ */
+ StepNumber.prototype.end = function () {
+ return this._current > this._end;
+ };
+
+ module.exports = StepNumber;
+
+/***/ },
+/* 20 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ // Only load hammer.js when in a browser environment
+ // (loading hammer.js in a node.js environment gives errors)
+ if (typeof window !== 'undefined') {
+ var propagating = __webpack_require__(21);
+ var Hammer = window['Hammer'] || __webpack_require__(22);
+ module.exports = propagating(Hammer, {
+ preventDefault: 'mouse'
+ });
+ } else {
+ module.exports = function () {
+ throw Error('hammer.js is only available in a browser, not in node.js.');
+ };
+ }
+
+/***/ },
+/* 21 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;'use strict';
+
+ (function (factory) {
+ if (true) {
+ // AMD. Register as an anonymous module.
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ window.propagating = factory();
+ }
+ }(function () {
+ var _firstTarget = null; // singleton, will contain the target element where the touch event started
+
+ /**
+ * Extend an Hammer.js instance with event propagation.
+ *
+ * Features:
+ * - Events emitted by hammer will propagate in order from child to parent
+ * elements.
+ * - Events are extended with a function `event.stopPropagation()` to stop
+ * propagation to parent elements.
+ * - An option `preventDefault` to stop all default browser behavior.
+ *
+ * Usage:
+ * var hammer = propagatingHammer(new Hammer(element));
+ * var hammer = propagatingHammer(new Hammer(element), {preventDefault: true});
+ *
+ * @param {Hammer.Manager} hammer An hammer instance.
+ * @param {Object} [options] Available options:
+ * - `preventDefault: true | false | 'mouse' | 'touch' | 'pen'`.
+ * Enforce preventing the default browser behavior.
+ * Cannot be set to `false`.
+ * @return {Hammer.Manager} Returns the same hammer instance with extended
+ * functionality
+ */
+ return function propagating(hammer, options) {
+ var _options = options || {
+ preventDefault: false
+ };
+
+ if (hammer.Manager) {
+ // This looks like the Hammer constructor.
+ // Overload the constructors with our own.
+ var Hammer = hammer;
+
+ var PropagatingHammer = function(element, options) {
+ var o = Object.create(_options);
+ if (options) Hammer.assign(o, options);
+ return propagating(new Hammer(element, o), o);
+ };
+ Hammer.assign(PropagatingHammer, Hammer);
+
+ PropagatingHammer.Manager = function (element, options) {
+ var o = Object.create(_options);
+ if (options) Hammer.assign(o, options);
+ return propagating(new Hammer.Manager(element, o), o);
+ };
+
+ return PropagatingHammer;
+ }
+
+ // create a wrapper object which will override the functions
+ // `on`, `off`, `destroy`, and `emit` of the hammer instance
+ var wrapper = Object.create(hammer);
+
+ // attach to DOM element
+ var element = hammer.element;
+
+ if(!element.hammer) element.hammer = [];
+ element.hammer.push(wrapper);
+
+ // register an event to catch the start of a gesture and store the
+ // target in a singleton
+ hammer.on('hammer.input', function (event) {
+ if (_options.preventDefault === true || (_options.preventDefault === event.pointerType)) {
+ event.preventDefault();
+ }
+ if (event.isFirst) {
+ _firstTarget = event.target;
+ }
+ });
+
+ /** @type {Object.<String, Array.<function>>} */
+ wrapper._handlers = {};
+
+ /**
+ * Register a handler for one or multiple events
+ * @param {String} events A space separated string with events
+ * @param {function} handler A callback function, called as handler(event)
+ * @returns {Hammer.Manager} Returns the hammer instance
+ */
+ wrapper.on = function (events, handler) {
+ // register the handler
+ split(events).forEach(function (event) {
+ var _handlers = wrapper._handlers[event];
+ if (!_handlers) {
+ wrapper._handlers[event] = _handlers = [];
+
+ // register the static, propagated handler
+ hammer.on(event, propagatedHandler);
+ }
+ _handlers.push(handler);
+ });
+
+ return wrapper;
+ };
+
+ /**
+ * Unregister a handler for one or multiple events
+ * @param {String} events A space separated string with events
+ * @param {function} [handler] Optional. The registered handler. If not
+ * provided, all handlers for given events
+ * are removed.
+ * @returns {Hammer.Manager} Returns the hammer instance
+ */
+ wrapper.off = function (events, handler) {
+ // unregister the handler
+ split(events).forEach(function (event) {
+ var _handlers = wrapper._handlers[event];
+ if (_handlers) {
+ _handlers = handler ? _handlers.filter(function (h) {
+ return h !== handler;
+ }) : [];
+
+ if (_handlers.length > 0) {
+ wrapper._handlers[event] = _handlers;
+ }
+ else {
+ // remove static, propagated handler
+ hammer.off(event, propagatedHandler);
+ delete wrapper._handlers[event];
+ }
+ }
+ });
+
+ return wrapper;
+ };
+
+ /**
+ * Emit to the event listeners
+ * @param {string} eventType
+ * @param {Event} event
+ */
+ wrapper.emit = function(eventType, event) {
+ _firstTarget = event.target;
+ hammer.emit(eventType, event);
+ };
+
+ wrapper.destroy = function () {
+ // Detach from DOM element
+ var hammers = hammer.element.hammer;
+ var idx = hammers.indexOf(wrapper);
+ if(idx !== -1) hammers.splice(idx,1);
+ if(!hammers.length) delete hammer.element.hammer;
+
+ // clear all handlers
+ wrapper._handlers = {};
+
+ // call original hammer destroy
+ hammer.destroy();
+ };
+
+ // split a string with space separated words
+ function split(events) {
+ return events.match(/[^ ]+/g);
+ }
+
+ /**
+ * A static event handler, applying event propagation.
+ * @param {Object} event
+ */
+ function propagatedHandler(event) {
+ // let only a single hammer instance handle this event
+ if (event.type !== 'hammer.input') {
+ // it is possible that the same srcEvent is used with multiple hammer events,
+ // we keep track on which events are handled in an object _handled
+ if (!event.srcEvent._handled) {
+ event.srcEvent._handled = {};
+ }
+
+ if (event.srcEvent._handled[event.type]) {
+ return;
+ }
+ else {
+ event.srcEvent._handled[event.type] = true;
+ }
+ }
+
+ // attach a stopPropagation function to the event
+ var stopped = false;
+ event.stopPropagation = function () {
+ stopped = true;
+ };
+
+ //wrap the srcEvent's stopPropagation to also stop hammer propagation:
+ var srcStop = event.srcEvent.stopPropagation.bind(event.srcEvent);
+ if(typeof srcStop == "function") {
+ event.srcEvent.stopPropagation = function(){
+ srcStop();
+ event.stopPropagation();
+ }
+ }
+
+ // attach firstTarget property to the event
+ event.firstTarget = _firstTarget;
+
+ // propagate over all elements (until stopped)
+ var elem = _firstTarget;
+ while (elem && !stopped) {
+ var elemHammer = elem.hammer;
+ if(elemHammer){
+ var _handlers;
+ for(var k = 0; k < elemHammer.length; k++){
+ _handlers = elemHammer[k]._handlers[event.type];
+ if(_handlers) for (var i = 0; i < _handlers.length && !stopped; i++) {
+ _handlers[i](event);
+ }
+ }
+ }
+ elem = elem.parentNode;
+ }
+ }
+
+ return wrapper;
+ };
+ }));
+
+
+/***/ },
+/* 22 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.6 - 2015-12-23
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2015 Jorik Tangelder;
+ * Licensed under the license */
+ (function(window, document, exportName, undefined) {
+ 'use strict';
+
+ var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
+ var TEST_ELEMENT = document.createElement('div');
+
+ var TYPE_FUNCTION = 'function';
+
+ var round = Math.round;
+ var abs = Math.abs;
+ var now = Date.now;
+
+ /**
+ * set a timeout with a given scope
+ * @param {Function} fn
+ * @param {Number} timeout
+ * @param {Object} context
+ * @returns {number}
+ */
+ function setTimeoutContext(fn, timeout, context) {
+ return setTimeout(bindFn(fn, context), timeout);
+ }
+
+ /**
+ * if the argument is an array, we want to execute the fn on each entry
+ * if it aint an array we don't want to do a thing.
+ * this is used by all the methods that accept a single and array argument.
+ * @param {*|Array} arg
+ * @param {String} fn
+ * @param {Object} [context]
+ * @returns {Boolean}
+ */
+ function invokeArrayArg(arg, fn, context) {
+ if (Array.isArray(arg)) {
+ each(arg, context[fn], context);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * walk objects and arrays
+ * @param {Object} obj
+ * @param {Function} iterator
+ * @param {Object} context
+ */
+ function each(obj, iterator, context) {
+ var i;
+
+ if (!obj) {
+ return;
+ }
+
+ if (obj.forEach) {
+ obj.forEach(iterator, context);
+ } else if (obj.length !== undefined) {
+ i = 0;
+ while (i < obj.length) {
+ iterator.call(context, obj[i], i, obj);
+ i++;
+ }
+ } else {
+ for (i in obj) {
+ obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
+ }
+ }
+ }
+
+ /**
+ * wrap a method with a deprecation warning and stack trace
+ * @param {Function} method
+ * @param {String} name
+ * @param {String} message
+ * @returns {Function} A new function wrapping the supplied method.
+ */
+ function deprecate(method, name, message) {
+ var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
+ return function() {
+ var e = new Error('get-stack-trace');
+ var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
+ .replace(/^\s+at\s+/gm, '')
+ .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
+
+ var log = window.console && (window.console.warn || window.console.log);
+ if (log) {
+ log.call(window.console, deprecationMessage, stack);
+ }
+ return method.apply(this, arguments);
+ };
+ }
+
+ /**
+ * extend object.
+ * means that properties in dest will be overwritten by the ones in src.
+ * @param {Object} target
+ * @param {...Object} objects_to_assign
+ * @returns {Object} target
+ */
+ var assign;
+ if (typeof Object.assign !== 'function') {
+ assign = function assign(target) {
+ if (target === undefined || target === null) {
+ throw new TypeError('Cannot convert undefined or null to object');
+ }
+
+ var output = Object(target);
+ for (var index = 1; index < arguments.length; index++) {
+ var source = arguments[index];
+ if (source !== undefined && source !== null) {
+ for (var nextKey in source) {
+ if (source.hasOwnProperty(nextKey)) {
+ output[nextKey] = source[nextKey];
+ }
+ }
+ }
+ }
+ return output;
+ };
+ } else {
+ assign = Object.assign;
+ }
+
+ /**
+ * extend object.
+ * means that properties in dest will be overwritten by the ones in src.
+ * @param {Object} dest
+ * @param {Object} src
+ * @param {Boolean=false} [merge]
+ * @returns {Object} dest
+ */
+ var extend = deprecate(function extend(dest, src, merge) {
+ var keys = Object.keys(src);
+ var i = 0;
+ while (i < keys.length) {
+ if (!merge || (merge && dest[keys[i]] === undefined)) {
+ dest[keys[i]] = src[keys[i]];
+ }
+ i++;
+ }
+ return dest;
+ }, 'extend', 'Use `assign`.');
+
+ /**
+ * merge the values from src in the dest.
+ * means that properties that exist in dest will not be overwritten by src
+ * @param {Object} dest
+ * @param {Object} src
+ * @returns {Object} dest
+ */
+ var merge = deprecate(function merge(dest, src) {
+ return extend(dest, src, true);
+ }, 'merge', 'Use `assign`.');
+
+ /**
+ * simple class inheritance
+ * @param {Function} child
+ * @param {Function} base
+ * @param {Object} [properties]
+ */
+ function inherit(child, base, properties) {
+ var baseP = base.prototype,
+ childP;
+
+ childP = child.prototype = Object.create(baseP);
+ childP.constructor = child;
+ childP._super = baseP;
+
+ if (properties) {
+ assign(childP, properties);
+ }
+ }
+
+ /**
+ * simple function bind
+ * @param {Function} fn
+ * @param {Object} context
+ * @returns {Function}
+ */
+ function bindFn(fn, context) {
+ return function boundFn() {
+ return fn.apply(context, arguments);
+ };
+ }
+
+ /**
+ * let a boolean value also be a function that must return a boolean
+ * this first item in args will be used as the context
+ * @param {Boolean|Function} val
+ * @param {Array} [args]
+ * @returns {Boolean}
+ */
+ function boolOrFn(val, args) {
+ if (typeof val == TYPE_FUNCTION) {
+ return val.apply(args ? args[0] || undefined : undefined, args);
+ }
+ return val;
+ }
+
+ /**
+ * use the val2 when val1 is undefined
+ * @param {*} val1
+ * @param {*} val2
+ * @returns {*}
+ */
+ function ifUndefined(val1, val2) {
+ return (val1 === undefined) ? val2 : val1;
+ }
+
+ /**
+ * addEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+ function addEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.addEventListener(type, handler, false);
+ });
+ }
+
+ /**
+ * removeEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+ function removeEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.removeEventListener(type, handler, false);
+ });
+ }
+
+ /**
+ * find if a node is in the given parent
+ * @method hasParent
+ * @param {HTMLElement} node
+ * @param {HTMLElement} parent
+ * @return {Boolean} found
+ */
+ function hasParent(node, parent) {
+ while (node) {
+ if (node == parent) {
+ return true;
+ }
+ node = node.parentNode;
+ }
+ return false;
+ }
+
+ /**
+ * small indexOf wrapper
+ * @param {String} str
+ * @param {String} find
+ * @returns {Boolean} found
+ */
+ function inStr(str, find) {
+ return str.indexOf(find) > -1;
+ }
+
+ /**
+ * split string on whitespace
+ * @param {String} str
+ * @returns {Array} words
+ */
+ function splitStr(str) {
+ return str.trim().split(/\s+/g);
+ }
+
+ /**
+ * find if a array contains the object using indexOf or a simple polyFill
+ * @param {Array} src
+ * @param {String} find
+ * @param {String} [findByKey]
+ * @return {Boolean|Number} false when not found, or the index
+ */
+ function inArray(src, find, findByKey) {
+ if (src.indexOf && !findByKey) {
+ return src.indexOf(find);
+ } else {
+ var i = 0;
+ while (i < src.length) {
+ if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
+ return i;
+ }
+ i++;
+ }
+ return -1;
+ }
+ }
+
+ /**
+ * convert array-like objects to real arrays
+ * @param {Object} obj
+ * @returns {Array}
+ */
+ function toArray(obj) {
+ return Array.prototype.slice.call(obj, 0);
+ }
+
+ /**
+ * unique array with objects based on a key (like 'id') or just by the array's value
+ * @param {Array} src [{id:1},{id:2},{id:1}]
+ * @param {String} [key]
+ * @param {Boolean} [sort=False]
+ * @returns {Array} [{id:1},{id:2}]
+ */
+ function uniqueArray(src, key, sort) {
+ var results = [];
+ var values = [];
+ var i = 0;
+
+ while (i < src.length) {
+ var val = key ? src[i][key] : src[i];
+ if (inArray(values, val) < 0) {
+ results.push(src[i]);
+ }
+ values[i] = val;
+ i++;
+ }
+
+ if (sort) {
+ if (!key) {
+ results = results.sort();
+ } else {
+ results = results.sort(function sortUniqueArray(a, b) {
+ return a[key] > b[key];
+ });
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * get the prefixed property
+ * @param {Object} obj
+ * @param {String} property
+ * @returns {String|Undefined} prefixed
+ */
+ function prefixed(obj, property) {
+ var prefix, prop;
+ var camelProp = property[0].toUpperCase() + property.slice(1);
+
+ var i = 0;
+ while (i < VENDOR_PREFIXES.length) {
+ prefix = VENDOR_PREFIXES[i];
+ prop = (prefix) ? prefix + camelProp : property;
+
+ if (prop in obj) {
+ return prop;
+ }
+ i++;
+ }
+ return undefined;
+ }
+
+ /**
+ * get a unique id
+ * @returns {number} uniqueId
+ */
+ var _uniqueId = 1;
+ function uniqueId() {
+ return _uniqueId++;
+ }
+
+ /**
+ * get the window object of an element
+ * @param {HTMLElement} element
+ * @returns {DocumentView|Window}
+ */
+ function getWindowForElement(element) {
+ var doc = element.ownerDocument || element;
+ return (doc.defaultView || doc.parentWindow || window);
+ }
+
+ var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
+
+ var SUPPORT_TOUCH = ('ontouchstart' in window);
+ var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
+ var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
+
+ var INPUT_TYPE_TOUCH = 'touch';
+ var INPUT_TYPE_PEN = 'pen';
+ var INPUT_TYPE_MOUSE = 'mouse';
+ var INPUT_TYPE_KINECT = 'kinect';
+
+ var COMPUTE_INTERVAL = 25;
+
+ var INPUT_START = 1;
+ var INPUT_MOVE = 2;
+ var INPUT_END = 4;
+ var INPUT_CANCEL = 8;
+
+ var DIRECTION_NONE = 1;
+ var DIRECTION_LEFT = 2;
+ var DIRECTION_RIGHT = 4;
+ var DIRECTION_UP = 8;
+ var DIRECTION_DOWN = 16;
+
+ var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
+ var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
+ var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
+
+ var PROPS_XY = ['x', 'y'];
+ var PROPS_CLIENT_XY = ['clientX', 'clientY'];
+
+ /**
+ * create new input type manager
+ * @param {Manager} manager
+ * @param {Function} callback
+ * @returns {Input}
+ * @constructor
+ */
+ function Input(manager, callback) {
+ var self = this;
+ this.manager = manager;
+ this.callback = callback;
+ this.element = manager.element;
+ this.target = manager.options.inputTarget;
+
+ // smaller wrapper around the handler, for the scope and the enabled state of the manager,
+ // so when disabled the input events are completely bypassed.
+ this.domHandler = function(ev) {
+ if (boolOrFn(manager.options.enable, [manager])) {
+ self.handler(ev);
+ }
+ };
+
+ this.init();
+
+ }
+
+ Input.prototype = {
+ /**
+ * should handle the inputEvent data and trigger the callback
+ * @virtual
+ */
+ handler: function() { },
+
+ /**
+ * bind the events
+ */
+ init: function() {
+ this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ },
+
+ /**
+ * unbind the events
+ */
+ destroy: function() {
+ this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ }
+ };
+
+ /**
+ * create new input type manager
+ * called by the Manager constructor
+ * @param {Hammer} manager
+ * @returns {Input}
+ */
+ function createInputInstance(manager) {
+ var Type;
+ var inputClass = manager.options.inputClass;
+
+ if (inputClass) {
+ Type = inputClass;
+ } else if (SUPPORT_POINTER_EVENTS) {
+ Type = PointerEventInput;
+ } else if (SUPPORT_ONLY_TOUCH) {
+ Type = TouchInput;
+ } else if (!SUPPORT_TOUCH) {
+ Type = MouseInput;
+ } else {
+ Type = TouchMouseInput;
+ }
+ return new (Type)(manager, inputHandler);
+ }
+
+ /**
+ * handle input events
+ * @param {Manager} manager
+ * @param {String} eventType
+ * @param {Object} input
+ */
+ function inputHandler(manager, eventType, input) {
+ var pointersLen = input.pointers.length;
+ var changedPointersLen = input.changedPointers.length;
+ var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
+ var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
+
+ input.isFirst = !!isFirst;
+ input.isFinal = !!isFinal;
+
+ if (isFirst) {
+ manager.session = {};
+ }
+
+ // source event is the normalized value of the domEvents
+ // like 'touchstart, mouseup, pointerdown'
+ input.eventType = eventType;
+
+ // compute scale, rotation etc
+ computeInputData(manager, input);
+
+ // emit secret event
+ manager.emit('hammer.input', input);
+
+ manager.recognize(input);
+ manager.session.prevInput = input;
+ }
+
+ /**
+ * extend the data with some usable properties like scale, rotate, velocity etc
+ * @param {Object} manager
+ * @param {Object} input
+ */
+ function computeInputData(manager, input) {
+ var session = manager.session;
+ var pointers = input.pointers;
+ var pointersLength = pointers.length;
+
+ // store the first input to calculate the distance and direction
+ if (!session.firstInput) {
+ session.firstInput = simpleCloneInputData(input);
+ }
+
+ // to compute scale and rotation we need to store the multiple touches
+ if (pointersLength > 1 && !session.firstMultiple) {
+ session.firstMultiple = simpleCloneInputData(input);
+ } else if (pointersLength === 1) {
+ session.firstMultiple = false;
+ }
+
+ var firstInput = session.firstInput;
+ var firstMultiple = session.firstMultiple;
+ var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
+
+ var center = input.center = getCenter(pointers);
+ input.timeStamp = now();
+ input.deltaTime = input.timeStamp - firstInput.timeStamp;
+
+ input.angle = getAngle(offsetCenter, center);
+ input.distance = getDistance(offsetCenter, center);
+
+ computeDeltaXY(session, input);
+ input.offsetDirection = getDirection(input.deltaX, input.deltaY);
+
+ var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
+ input.overallVelocityX = overallVelocity.x;
+ input.overallVelocityY = overallVelocity.y;
+ input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
+
+ input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
+ input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
+
+ input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
+ session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
+
+ computeIntervalInputData(session, input);
+
+ // find the correct target
+ var target = manager.element;
+ if (hasParent(input.srcEvent.target, target)) {
+ target = input.srcEvent.target;
+ }
+ input.target = target;
+ }
+
+ function computeDeltaXY(session, input) {
+ var center = input.center;
+ var offset = session.offsetDelta || {};
+ var prevDelta = session.prevDelta || {};
+ var prevInput = session.prevInput || {};
+
+ if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
+ prevDelta = session.prevDelta = {
+ x: prevInput.deltaX || 0,
+ y: prevInput.deltaY || 0
+ };
+
+ offset = session.offsetDelta = {
+ x: center.x,
+ y: center.y
+ };
+ }
+
+ input.deltaX = prevDelta.x + (center.x - offset.x);
+ input.deltaY = prevDelta.y + (center.y - offset.y);
+ }
+
+ /**
+ * velocity is calculated every x ms
+ * @param {Object} session
+ * @param {Object} input
+ */
+ function computeIntervalInputData(session, input) {
+ var last = session.lastInterval || input,
+ deltaTime = input.timeStamp - last.timeStamp,
+ velocity, velocityX, velocityY, direction;
+
+ if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
+ var deltaX = input.deltaX - last.deltaX;
+ var deltaY = input.deltaY - last.deltaY;
+
+ var v = getVelocity(deltaTime, deltaX, deltaY);
+ velocityX = v.x;
+ velocityY = v.y;
+ velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
+ direction = getDirection(deltaX, deltaY);
+
+ session.lastInterval = input;
+ } else {
+ // use latest velocity info if it doesn't overtake a minimum period
+ velocity = last.velocity;
+ velocityX = last.velocityX;
+ velocityY = last.velocityY;
+ direction = last.direction;
+ }
+
+ input.velocity = velocity;
+ input.velocityX = velocityX;
+ input.velocityY = velocityY;
+ input.direction = direction;
+ }
+
+ /**
+ * create a simple clone from the input used for storage of firstInput and firstMultiple
+ * @param {Object} input
+ * @returns {Object} clonedInputData
+ */
+ function simpleCloneInputData(input) {
+ // make a simple copy of the pointers because we will get a reference if we don't
+ // we only need clientXY for the calculations
+ var pointers = [];
+ var i = 0;
+ while (i < input.pointers.length) {
+ pointers[i] = {
+ clientX: round(input.pointers[i].clientX),
+ clientY: round(input.pointers[i].clientY)
+ };
+ i++;
+ }
+
+ return {
+ timeStamp: now(),
+ pointers: pointers,
+ center: getCenter(pointers),
+ deltaX: input.deltaX,
+ deltaY: input.deltaY
+ };
+ }
+
+ /**
+ * get the center of all the pointers
+ * @param {Array} pointers
+ * @return {Object} center contains `x` and `y` properties
+ */
+ function getCenter(pointers) {
+ var pointersLength = pointers.length;
+
+ // no need to loop when only one touch
+ if (pointersLength === 1) {
+ return {
+ x: round(pointers[0].clientX),
+ y: round(pointers[0].clientY)
+ };
+ }
+
+ var x = 0, y = 0, i = 0;
+ while (i < pointersLength) {
+ x += pointers[i].clientX;
+ y += pointers[i].clientY;
+ i++;
+ }
+
+ return {
+ x: round(x / pointersLength),
+ y: round(y / pointersLength)
+ };
+ }
+
+ /**
+ * calculate the velocity between two points. unit is in px per ms.
+ * @param {Number} deltaTime
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object} velocity `x` and `y`
+ */
+ function getVelocity(deltaTime, x, y) {
+ return {
+ x: x / deltaTime || 0,
+ y: y / deltaTime || 0
+ };
+ }
+
+ /**
+ * get the direction between two points
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Number} direction
+ */
+ function getDirection(x, y) {
+ if (x === y) {
+ return DIRECTION_NONE;
+ }
+
+ if (abs(x) >= abs(y)) {
+ return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ }
+ return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
+ }
+
+ /**
+ * calculate the absolute distance between two points
+ * @param {Object} p1 {x, y}
+ * @param {Object} p2 {x, y}
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} distance
+ */
+ function getDistance(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+
+ return Math.sqrt((x * x) + (y * y));
+ }
+
+ /**
+ * calculate the angle between two coordinates
+ * @param {Object} p1
+ * @param {Object} p2
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} angle
+ */
+ function getAngle(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+ return Math.atan2(y, x) * 180 / Math.PI;
+ }
+
+ /**
+ * calculate the rotation degrees between two pointersets
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} rotation
+ */
+ function getRotation(start, end) {
+ return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
+ }
+
+ /**
+ * calculate the scale factor between two pointersets
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} scale
+ */
+ function getScale(start, end) {
+ return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
+ }
+
+ var MOUSE_INPUT_MAP = {
+ mousedown: INPUT_START,
+ mousemove: INPUT_MOVE,
+ mouseup: INPUT_END
+ };
+
+ var MOUSE_ELEMENT_EVENTS = 'mousedown';
+ var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
+
+ /**
+ * Mouse events input
+ * @constructor
+ * @extends Input
+ */
+ function MouseInput() {
+ this.evEl = MOUSE_ELEMENT_EVENTS;
+ this.evWin = MOUSE_WINDOW_EVENTS;
+
+ this.allow = true; // used by Input.TouchMouse to disable mouse events
+ this.pressed = false; // mousedown state
+
+ Input.apply(this, arguments);
+ }
+
+ inherit(MouseInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function MEhandler(ev) {
+ var eventType = MOUSE_INPUT_MAP[ev.type];
+
+ // on start we want to have the left mouse button down
+ if (eventType & INPUT_START && ev.button === 0) {
+ this.pressed = true;
+ }
+
+ if (eventType & INPUT_MOVE && ev.which !== 1) {
+ eventType = INPUT_END;
+ }
+
+ // mouse must be down, and mouse events are allowed (see the TouchMouse input)
+ if (!this.pressed || !this.allow) {
+ return;
+ }
+
+ if (eventType & INPUT_END) {
+ this.pressed = false;
+ }
+
+ this.callback(this.manager, eventType, {
+ pointers: [ev],
+ changedPointers: [ev],
+ pointerType: INPUT_TYPE_MOUSE,
+ srcEvent: ev
+ });
+ }
+ });
+
+ var POINTER_INPUT_MAP = {
+ pointerdown: INPUT_START,
+ pointermove: INPUT_MOVE,
+ pointerup: INPUT_END,
+ pointercancel: INPUT_CANCEL,
+ pointerout: INPUT_CANCEL
+ };
+
+ // in IE10 the pointer types is defined as an enum
+ var IE10_POINTER_TYPE_ENUM = {
+ 2: INPUT_TYPE_TOUCH,
+ 3: INPUT_TYPE_PEN,
+ 4: INPUT_TYPE_MOUSE,
+ 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
+ };
+
+ var POINTER_ELEMENT_EVENTS = 'pointerdown';
+ var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
+
+ // IE10 has prefixed support, and case-sensitive
+ if (window.MSPointerEvent && !window.PointerEvent) {
+ POINTER_ELEMENT_EVENTS = 'MSPointerDown';
+ POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
+ }
+
+ /**
+ * Pointer events input
+ * @constructor
+ * @extends Input
+ */
+ function PointerEventInput() {
+ this.evEl = POINTER_ELEMENT_EVENTS;
+ this.evWin = POINTER_WINDOW_EVENTS;
+
+ Input.apply(this, arguments);
+
+ this.store = (this.manager.session.pointerEvents = []);
+ }
+
+ inherit(PointerEventInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function PEhandler(ev) {
+ var store = this.store;
+ var removePointer = false;
+
+ var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
+ var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
+ var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
+
+ var isTouch = (pointerType == INPUT_TYPE_TOUCH);
+
+ // get index of the event in the store
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
+
+ // start and mouse must be down
+ if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
+ if (storeIndex < 0) {
+ store.push(ev);
+ storeIndex = store.length - 1;
+ }
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
+ removePointer = true;
+ }
+
+ // it not found, so the pointer hasn't been down (so it's probably a hover)
+ if (storeIndex < 0) {
+ return;
+ }
+
+ // update the event in the store
+ store[storeIndex] = ev;
+
+ this.callback(this.manager, eventType, {
+ pointers: store,
+ changedPointers: [ev],
+ pointerType: pointerType,
+ srcEvent: ev
+ });
+
+ if (removePointer) {
+ // remove from the store
+ store.splice(storeIndex, 1);
+ }
+ }
+ });
+
+ var SINGLE_TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+ };
+
+ var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
+ var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+ /**
+ * Touch events input
+ * @constructor
+ * @extends Input
+ */
+ function SingleTouchInput() {
+ this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
+ this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
+ this.started = false;
+
+ Input.apply(this, arguments);
+ }
+
+ inherit(SingleTouchInput, Input, {
+ handler: function TEhandler(ev) {
+ var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
+
+ // should we handle the touch events?
+ if (type === INPUT_START) {
+ this.started = true;
+ }
+
+ if (!this.started) {
+ return;
+ }
+
+ var touches = normalizeSingleTouches.call(this, ev, type);
+
+ // when done, reset the started state
+ if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
+ this.started = false;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+ });
+
+ /**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+ function normalizeSingleTouches(ev, type) {
+ var all = toArray(ev.touches);
+ var changed = toArray(ev.changedTouches);
+
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ all = uniqueArray(all.concat(changed), 'identifier', true);
+ }
+
+ return [all, changed];
+ }
+
+ var TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+ };
+
+ var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+ /**
+ * Multi-user touch events input
+ * @constructor
+ * @extends Input
+ */
+ function TouchInput() {
+ this.evTarget = TOUCH_TARGET_EVENTS;
+ this.targetIds = {};
+
+ Input.apply(this, arguments);
+ }
+
+ inherit(TouchInput, Input, {
+ handler: function MTEhandler(ev) {
+ var type = TOUCH_INPUT_MAP[ev.type];
+ var touches = getTouches.call(this, ev, type);
+ if (!touches) {
+ return;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+ });
+
+ /**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+ function getTouches(ev, type) {
+ var allTouches = toArray(ev.touches);
+ var targetIds = this.targetIds;
+
+ // when there is only one touch, the process can be simplified
+ if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
+ targetIds[allTouches[0].identifier] = true;
+ return [allTouches, allTouches];
+ }
+
+ var i,
+ targetTouches,
+ changedTouches = toArray(ev.changedTouches),
+ changedTargetTouches = [],
+ target = this.target;
+
+ // get target touches from touches
+ targetTouches = allTouches.filter(function(touch) {
+ return hasParent(touch.target, target);
+ });
+
+ // collect touches
+ if (type === INPUT_START) {
+ i = 0;
+ while (i < targetTouches.length) {
+ targetIds[targetTouches[i].identifier] = true;
+ i++;
+ }
+ }
+
+ // filter changed touches to only contain touches that exist in the collected target ids
+ i = 0;
+ while (i < changedTouches.length) {
+ if (targetIds[changedTouches[i].identifier]) {
+ changedTargetTouches.push(changedTouches[i]);
+ }
+
+ // cleanup removed touches
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ delete targetIds[changedTouches[i].identifier];
+ }
+ i++;
+ }
+
+ if (!changedTargetTouches.length) {
+ return;
+ }
+
+ return [
+ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
+ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
+ changedTargetTouches
+ ];
+ }
+
+ /**
+ * Combined touch and mouse input
+ *
+ * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
+ * This because touch devices also emit mouse events while doing a touch.
+ *
+ * @constructor
+ * @extends Input
+ */
+ function TouchMouseInput() {
+ Input.apply(this, arguments);
+
+ var handler = bindFn(this.handler, this);
+ this.touch = new TouchInput(this.manager, handler);
+ this.mouse = new MouseInput(this.manager, handler);
+ }
+
+ inherit(TouchMouseInput, Input, {
+ /**
+ * handle mouse and touch events
+ * @param {Hammer} manager
+ * @param {String} inputEvent
+ * @param {Object} inputData
+ */
+ handler: function TMEhandler(manager, inputEvent, inputData) {
+ var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
+ isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
+
+ // when we're in a touch event, so block all upcoming mouse events
+ // most mobile browser also emit mouseevents, right after touchstart
+ if (isTouch) {
+ this.mouse.allow = false;
+ } else if (isMouse && !this.mouse.allow) {
+ return;
+ }
+
+ // reset the allowMouse when we're done
+ if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
+ this.mouse.allow = true;
+ }
+
+ this.callback(manager, inputEvent, inputData);
+ },
+
+ /**
+ * remove the event listeners
+ */
+ destroy: function destroy() {
+ this.touch.destroy();
+ this.mouse.destroy();
+ }
+ });
+
+ var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
+ var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
+
+ // magical touchAction value
+ var TOUCH_ACTION_COMPUTE = 'compute';
+ var TOUCH_ACTION_AUTO = 'auto';
+ var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
+ var TOUCH_ACTION_NONE = 'none';
+ var TOUCH_ACTION_PAN_X = 'pan-x';
+ var TOUCH_ACTION_PAN_Y = 'pan-y';
+
+ /**
+ * Touch Action
+ * sets the touchAction property or uses the js alternative
+ * @param {Manager} manager
+ * @param {String} value
+ * @constructor
+ */
+ function TouchAction(manager, value) {
+ this.manager = manager;
+ this.set(value);
+ }
+
+ TouchAction.prototype = {
+ /**
+ * set the touchAction value on the element or enable the polyfill
+ * @param {String} value
+ */
+ set: function(value) {
+ // find out the touch-action by the event handlers
+ if (value == TOUCH_ACTION_COMPUTE) {
+ value = this.compute();
+ }
+
+ if (NATIVE_TOUCH_ACTION && this.manager.element.style) {
+ this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
+ }
+ this.actions = value.toLowerCase().trim();
+ },
+
+ /**
+ * just re-set the touchAction value
+ */
+ update: function() {
+ this.set(this.manager.options.touchAction);
+ },
+
+ /**
+ * compute the value for the touchAction property based on the recognizer's settings
+ * @returns {String} value
+ */
+ compute: function() {
+ var actions = [];
+ each(this.manager.recognizers, function(recognizer) {
+ if (boolOrFn(recognizer.options.enable, [recognizer])) {
+ actions = actions.concat(recognizer.getTouchAction());
+ }
+ });
+ return cleanTouchActions(actions.join(' '));
+ },
+
+ /**
+ * this method is called on each input cycle and provides the preventing of the browser behavior
+ * @param {Object} input
+ */
+ preventDefaults: function(input) {
+ // not needed with native support for the touchAction property
+ if (NATIVE_TOUCH_ACTION) {
+ return;
+ }
+
+ var srcEvent = input.srcEvent;
+ var direction = input.offsetDirection;
+
+ // if the touch action did prevented once this session
+ if (this.manager.session.prevented) {
+ srcEvent.preventDefault();
+ return;
+ }
+
+ var actions = this.actions;
+ var hasNone = inStr(actions, TOUCH_ACTION_NONE);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+
+ if (hasNone) {
+ //do not prevent defaults if this is a tap gesture
+
+ var isTapPointer = input.pointers.length === 1;
+ var isTapMovement = input.distance < 2;
+ var isTapTouchTime = input.deltaTime < 250;
+
+ if (isTapPointer && isTapMovement && isTapTouchTime) {
+ return;
+ }
+ }
+
+ if (hasPanX && hasPanY) {
+ // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
+ return;
+ }
+
+ if (hasNone ||
+ (hasPanY && direction & DIRECTION_HORIZONTAL) ||
+ (hasPanX && direction & DIRECTION_VERTICAL)) {
+ return this.preventSrc(srcEvent);
+ }
+ },
+
+ /**
+ * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
+ * @param {Object} srcEvent
+ */
+ preventSrc: function(srcEvent) {
+ this.manager.session.prevented = true;
+ srcEvent.preventDefault();
+ }
+ };
+
+ /**
+ * when the touchActions are collected they are not a valid value, so we need to clean things up. *
+ * @param {String} actions
+ * @returns {*}
+ */
+ function cleanTouchActions(actions) {
+ // none
+ if (inStr(actions, TOUCH_ACTION_NONE)) {
+ return TOUCH_ACTION_NONE;
+ }
+
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+
+ // if both pan-x and pan-y are set (different recognizers
+ // for different directions, e.g. horizontal pan but vertical swipe?)
+ // we need none (as otherwise with pan-x pan-y combined none of these
+ // recognizers will work, since the browser would handle all panning
+ if (hasPanX && hasPanY) {
+ return TOUCH_ACTION_NONE;
+ }
+
+ // pan-x OR pan-y
+ if (hasPanX || hasPanY) {
+ return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
+ }
+
+ // manipulation
+ if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
+ return TOUCH_ACTION_MANIPULATION;
+ }
+
+ return TOUCH_ACTION_AUTO;
+ }
+
+ /**
+ * Recognizer flow explained; *
+ * All recognizers have the initial state of POSSIBLE when a input session starts.
+ * The definition of a input session is from the first input until the last input, with all it's movement in it. *
+ * Example session for mouse-input: mousedown -> mousemove -> mouseup
+ *
+ * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
+ * which determines with state it should be.
+ *
+ * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
+ * POSSIBLE to give it another change on the next cycle.
+ *
+ * Possible
+ * |
+ * +-----+---------------+
+ * | |
+ * +-----+-----+ |
+ * | | |
+ * Failed Cancelled |
+ * +-------+------+
+ * | |
+ * Recognized Began
+ * |
+ * Changed
+ * |
+ * Ended/Recognized
+ */
+ var STATE_POSSIBLE = 1;
+ var STATE_BEGAN = 2;
+ var STATE_CHANGED = 4;
+ var STATE_ENDED = 8;
+ var STATE_RECOGNIZED = STATE_ENDED;
+ var STATE_CANCELLED = 16;
+ var STATE_FAILED = 32;
+
+ /**
+ * Recognizer
+ * Every recognizer needs to extend from this class.
+ * @constructor
+ * @param {Object} options
+ */
+ function Recognizer(options) {
+ this.options = assign({}, this.defaults, options || {});
+
+ this.id = uniqueId();
+
+ this.manager = null;
+
+ // default is enable true
+ this.options.enable = ifUndefined(this.options.enable, true);
+
+ this.state = STATE_POSSIBLE;
+
+ this.simultaneous = {};
+ this.requireFail = [];
+ }
+
+ Recognizer.prototype = {
+ /**
+ * @virtual
+ * @type {Object}
+ */
+ defaults: {},
+
+ /**
+ * set options
+ * @param {Object} options
+ * @return {Recognizer}
+ */
+ set: function(options) {
+ assign(this.options, options);
+
+ // also update the touchAction, in case something changed about the directions/enabled state
+ this.manager && this.manager.touchAction.update();
+ return this;
+ },
+
+ /**
+ * recognize simultaneous with an other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ recognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
+ return this;
+ }
+
+ var simultaneous = this.simultaneous;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (!simultaneous[otherRecognizer.id]) {
+ simultaneous[otherRecognizer.id] = otherRecognizer;
+ otherRecognizer.recognizeWith(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the simultaneous link. it doesnt remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRecognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ delete this.simultaneous[otherRecognizer.id];
+ return this;
+ },
+
+ /**
+ * recognizer can only run when an other is failing
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ requireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
+ return this;
+ }
+
+ var requireFail = this.requireFail;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (inArray(requireFail, otherRecognizer) === -1) {
+ requireFail.push(otherRecognizer);
+ otherRecognizer.requireFailure(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the requireFailure link. it does not remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRequireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ var index = inArray(this.requireFail, otherRecognizer);
+ if (index > -1) {
+ this.requireFail.splice(index, 1);
+ }
+ return this;
+ },
+
+ /**
+ * has require failures boolean
+ * @returns {boolean}
+ */
+ hasRequireFailures: function() {
+ return this.requireFail.length > 0;
+ },
+
+ /**
+ * if the recognizer can recognize simultaneous with an other recognizer
+ * @param {Recognizer} otherRecognizer
+ * @returns {Boolean}
+ */
+ canRecognizeWith: function(otherRecognizer) {
+ return !!this.simultaneous[otherRecognizer.id];
+ },
+
+ /**
+ * You should use `tryEmit` instead of `emit` directly to check
+ * that all the needed recognizers has failed before emitting.
+ * @param {Object} input
+ */
+ emit: function(input) {
+ var self = this;
+ var state = this.state;
+
+ function emit(event) {
+ self.manager.emit(event, input);
+ }
+
+ // 'panstart' and 'panmove'
+ if (state < STATE_ENDED) {
+ emit(self.options.event + stateStr(state));
+ }
+
+ emit(self.options.event); // simple 'eventName' events
+
+ if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
+ emit(input.additionalEvent);
+ }
+
+ // panend and pancancel
+ if (state >= STATE_ENDED) {
+ emit(self.options.event + stateStr(state));
+ }
+ },
+
+ /**
+ * Check that all the require failure recognizers has failed,
+ * if true, it emits a gesture event,
+ * otherwise, setup the state to FAILED.
+ * @param {Object} input
+ */
+ tryEmit: function(input) {
+ if (this.canEmit()) {
+ return this.emit(input);
+ }
+ // it's failing anyway
+ this.state = STATE_FAILED;
+ },
+
+ /**
+ * can we emit?
+ * @returns {boolean}
+ */
+ canEmit: function() {
+ var i = 0;
+ while (i < this.requireFail.length) {
+ if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
+ return false;
+ }
+ i++;
+ }
+ return true;
+ },
+
+ /**
+ * update the recognizer
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ // make a new copy of the inputData
+ // so we can change the inputData without messing up the other recognizers
+ var inputDataClone = assign({}, inputData);
+
+ // is is enabled and allow recognizing?
+ if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
+ this.reset();
+ this.state = STATE_FAILED;
+ return;
+ }
+
+ // reset when we've reached the end
+ if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
+ this.state = STATE_POSSIBLE;
+ }
+
+ this.state = this.process(inputDataClone);
+
+ // the recognizer has recognized a gesture
+ // so trigger an event
+ if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
+ this.tryEmit(inputDataClone);
+ }
+ },
+
+ /**
+ * return the state of the recognizer
+ * the actual recognizing happens in this method
+ * @virtual
+ * @param {Object} inputData
+ * @returns {Const} STATE
+ */
+ process: function(inputData) { }, // jshint ignore:line
+
+ /**
+ * return the preferred touch-action
+ * @virtual
+ * @returns {Array}
+ */
+ getTouchAction: function() { },
+
+ /**
+ * called when the gesture isn't allowed to recognize
+ * like when another is being recognized or it is disabled
+ * @virtual
+ */
+ reset: function() { }
+ };
+
+ /**
+ * get a usable string, used as event postfix
+ * @param {Const} state
+ * @returns {String} state
+ */
+ function stateStr(state) {
+ if (state & STATE_CANCELLED) {
+ return 'cancel';
+ } else if (state & STATE_ENDED) {
+ return 'end';
+ } else if (state & STATE_CHANGED) {
+ return 'move';
+ } else if (state & STATE_BEGAN) {
+ return 'start';
+ }
+ return '';
+ }
+
+ /**
+ * direction cons to string
+ * @param {Const} direction
+ * @returns {String}
+ */
+ function directionStr(direction) {
+ if (direction == DIRECTION_DOWN) {
+ return 'down';
+ } else if (direction == DIRECTION_UP) {
+ return 'up';
+ } else if (direction == DIRECTION_LEFT) {
+ return 'left';
+ } else if (direction == DIRECTION_RIGHT) {
+ return 'right';
+ }
+ return '';
+ }
+
+ /**
+ * get a recognizer by name if it is bound to a manager
+ * @param {Recognizer|String} otherRecognizer
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer}
+ */
+ function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
+ var manager = recognizer.manager;
+ if (manager) {
+ return manager.get(otherRecognizer);
+ }
+ return otherRecognizer;
+ }
+
+ /**
+ * This recognizer is just used as a base for the simple attribute recognizers.
+ * @constructor
+ * @extends Recognizer
+ */
+ function AttrRecognizer() {
+ Recognizer.apply(this, arguments);
+ }
+
+ inherit(AttrRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof AttrRecognizer
+ */
+ defaults: {
+ /**
+ * @type {Number}
+ * @default 1
+ */
+ pointers: 1
+ },
+
+ /**
+ * Used to check if it the recognizer receives valid input, like input.distance > 10.
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {Boolean} recognized
+ */
+ attrTest: function(input) {
+ var optionPointers = this.options.pointers;
+ return optionPointers === 0 || input.pointers.length === optionPointers;
+ },
+
+ /**
+ * Process the input and return the state for the recognizer
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {*} State
+ */
+ process: function(input) {
+ var state = this.state;
+ var eventType = input.eventType;
+
+ var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
+ var isValid = this.attrTest(input);
+
+ // on cancel input and we've recognized before, return STATE_CANCELLED
+ if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
+ return state | STATE_CANCELLED;
+ } else if (isRecognized || isValid) {
+ if (eventType & INPUT_END) {
+ return state | STATE_ENDED;
+ } else if (!(state & STATE_BEGAN)) {
+ return STATE_BEGAN;
+ }
+ return state | STATE_CHANGED;
+ }
+ return STATE_FAILED;
+ }
+ });
+
+ /**
+ * Pan
+ * Recognized when the pointer is down and moved in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function PanRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+
+ this.pX = null;
+ this.pY = null;
+ }
+
+ inherit(PanRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PanRecognizer
+ */
+ defaults: {
+ event: 'pan',
+ threshold: 10,
+ pointers: 1,
+ direction: DIRECTION_ALL
+ },
+
+ getTouchAction: function() {
+ var direction = this.options.direction;
+ var actions = [];
+ if (direction & DIRECTION_HORIZONTAL) {
+ actions.push(TOUCH_ACTION_PAN_Y);
+ }
+ if (direction & DIRECTION_VERTICAL) {
+ actions.push(TOUCH_ACTION_PAN_X);
+ }
+ return actions;
+ },
+
+ directionTest: function(input) {
+ var options = this.options;
+ var hasMoved = true;
+ var distance = input.distance;
+ var direction = input.direction;
+ var x = input.deltaX;
+ var y = input.deltaY;
+
+ // lock to axis?
+ if (!(direction & options.direction)) {
+ if (options.direction & DIRECTION_HORIZONTAL) {
+ direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ hasMoved = x != this.pX;
+ distance = Math.abs(input.deltaX);
+ } else {
+ direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
+ hasMoved = y != this.pY;
+ distance = Math.abs(input.deltaY);
+ }
+ }
+ input.direction = direction;
+ return hasMoved && distance > options.threshold && direction & options.direction;
+ },
+
+ attrTest: function(input) {
+ return AttrRecognizer.prototype.attrTest.call(this, input) &&
+ (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
+ },
+
+ emit: function(input) {
+
+ this.pX = input.deltaX;
+ this.pY = input.deltaY;
+
+ var direction = directionStr(input.direction);
+
+ if (direction) {
+ input.additionalEvent = this.options.event + direction;
+ }
+ this._super.emit.call(this, input);
+ }
+ });
+
+ /**
+ * Pinch
+ * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function PinchRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+ }
+
+ inherit(PinchRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'pinch',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
+ },
+
+ emit: function(input) {
+ if (input.scale !== 1) {
+ var inOut = input.scale < 1 ? 'in' : 'out';
+ input.additionalEvent = this.options.event + inOut;
+ }
+ this._super.emit.call(this, input);
+ }
+ });
+
+ /**
+ * Press
+ * Recognized when the pointer is down for x ms without any movement.
+ * @constructor
+ * @extends Recognizer
+ */
+ function PressRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ this._timer = null;
+ this._input = null;
+ }
+
+ inherit(PressRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PressRecognizer
+ */
+ defaults: {
+ event: 'press',
+ pointers: 1,
+ time: 251, // minimal time of the pointer to be pressed
+ threshold: 9 // a minimal movement is ok, but keep it low
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_AUTO];
+ },
+
+ process: function(input) {
+ var options = this.options;
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTime = input.deltaTime > options.time;
+
+ this._input = input;
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
+ this.reset();
+ } else if (input.eventType & INPUT_START) {
+ this.reset();
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.time, this);
+ } else if (input.eventType & INPUT_END) {
+ return STATE_RECOGNIZED;
+ }
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function(input) {
+ if (this.state !== STATE_RECOGNIZED) {
+ return;
+ }
+
+ if (input && (input.eventType & INPUT_END)) {
+ this.manager.emit(this.options.event + 'up', input);
+ } else {
+ this._input.timeStamp = now();
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+ });
+
+ /**
+ * Rotate
+ * Recognized when two or more pointer are moving in a circular motion.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function RotateRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+ }
+
+ inherit(RotateRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof RotateRecognizer
+ */
+ defaults: {
+ event: 'rotate',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
+ }
+ });
+
+ /**
+ * Swipe
+ * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function SwipeRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+ }
+
+ inherit(SwipeRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof SwipeRecognizer
+ */
+ defaults: {
+ event: 'swipe',
+ threshold: 10,
+ velocity: 0.3,
+ direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
+ pointers: 1
+ },
+
+ getTouchAction: function() {
+ return PanRecognizer.prototype.getTouchAction.call(this);
+ },
+
+ attrTest: function(input) {
+ var direction = this.options.direction;
+ var velocity;
+
+ if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
+ velocity = input.overallVelocity;
+ } else if (direction & DIRECTION_HORIZONTAL) {
+ velocity = input.overallVelocityX;
+ } else if (direction & DIRECTION_VERTICAL) {
+ velocity = input.overallVelocityY;
+ }
+
+ return this._super.attrTest.call(this, input) &&
+ direction & input.offsetDirection &&
+ input.distance > this.options.threshold &&
+ input.maxPointers == this.options.pointers &&
+ abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
+ },
+
+ emit: function(input) {
+ var direction = directionStr(input.offsetDirection);
+ if (direction) {
+ this.manager.emit(this.options.event + direction, input);
+ }
+
+ this.manager.emit(this.options.event, input);
+ }
+ });
+
+ /**
+ * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
+ * between the given interval and position. The delay option can be used to recognize multi-taps without firing
+ * a single tap.
+ *
+ * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
+ * multi-taps being recognized.
+ * @constructor
+ * @extends Recognizer
+ */
+ function TapRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ // previous time and center,
+ // used for tap counting
+ this.pTime = false;
+ this.pCenter = false;
+
+ this._timer = null;
+ this._input = null;
+ this.count = 0;
+ }
+
+ inherit(TapRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'tap',
+ pointers: 1,
+ taps: 1,
+ interval: 300, // max time between the multi-tap taps
+ time: 250, // max time of the pointer to be down (like finger on the screen)
+ threshold: 9, // a minimal movement is ok, but keep it low
+ posThreshold: 10 // a multi-tap can be a bit off the initial position
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_MANIPULATION];
+ },
+
+ process: function(input) {
+ var options = this.options;
+
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTouchTime = input.deltaTime < options.time;
+
+ this.reset();
+
+ if ((input.eventType & INPUT_START) && (this.count === 0)) {
+ return this.failTimeout();
+ }
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (validMovement && validTouchTime && validPointers) {
+ if (input.eventType != INPUT_END) {
+ return this.failTimeout();
+ }
+
+ var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
+ var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
+
+ this.pTime = input.timeStamp;
+ this.pCenter = input.center;
+
+ if (!validMultiTap || !validInterval) {
+ this.count = 1;
+ } else {
+ this.count += 1;
+ }
+
+ this._input = input;
+
+ // if tap count matches we have recognized it,
+ // else it has began recognizing...
+ var tapCount = this.count % options.taps;
+ if (tapCount === 0) {
+ // no failing requirements, immediately trigger the tap event
+ // or wait as long as the multitap interval to trigger
+ if (!this.hasRequireFailures()) {
+ return STATE_RECOGNIZED;
+ } else {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.interval, this);
+ return STATE_BEGAN;
+ }
+ }
+ }
+ return STATE_FAILED;
+ },
+
+ failTimeout: function() {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_FAILED;
+ }, this.options.interval, this);
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function() {
+ if (this.state == STATE_RECOGNIZED) {
+ this._input.tapCount = this.count;
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+ });
+
+ /**
+ * Simple way to create a manager with a default set of recognizers.
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+ function Hammer(element, options) {
+ options = options || {};
+ options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
+ return new Manager(element, options);
+ }
+
+ /**
+ * @const {string}
+ */
+ Hammer.VERSION = '2.0.6';
+
+ /**
+ * default settings
+ * @namespace
+ */
+ Hammer.defaults = {
+ /**
+ * set if DOM events are being triggered.
+ * But this is slower and unused by simple implementations, so disabled by default.
+ * @type {Boolean}
+ * @default false
+ */
+ domEvents: false,
+
+ /**
+ * The value for the touchAction property/fallback.
+ * When set to `compute` it will magically set the correct value based on the added recognizers.
+ * @type {String}
+ * @default compute
+ */
+ touchAction: TOUCH_ACTION_COMPUTE,
+
+ /**
+ * @type {Boolean}
+ * @default true
+ */
+ enable: true,
+
+ /**
+ * EXPERIMENTAL FEATURE -- can be removed/changed
+ * Change the parent input target element.
+ * If Null, then it is being set the to main element.
+ * @type {Null|EventTarget}
+ * @default null
+ */
+ inputTarget: null,
+
+ /**
+ * force an input class
+ * @type {Null|Function}
+ * @default null
+ */
+ inputClass: null,
+
+ /**
+ * Default recognizer setup when calling `Hammer()`
+ * When creating a new Manager these will be skipped.
+ * @type {Array}
+ */
+ preset: [
+ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
+ [RotateRecognizer, {enable: false}],
+ [PinchRecognizer, {enable: false}, ['rotate']],
+ [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
+ [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
+ [TapRecognizer],
+ [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
+ [PressRecognizer]
+ ],
+
+ /**
+ * Some CSS properties can be used to improve the working of Hammer.
+ * Add them to this method and they will be set when creating a new Manager.
+ * @namespace
+ */
+ cssProps: {
+ /**
+ * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userSelect: 'none',
+
+ /**
+ * Disable the Windows Phone grippers when pressing an element.
+ * @type {String}
+ * @default 'none'
+ */
+ touchSelect: 'none',
+
+ /**
+ * Disables the default callout shown when you touch and hold a touch target.
+ * On iOS, when you touch and hold a touch target such as a link, Safari displays
+ * a callout containing information about the link. This property allows you to disable that callout.
+ * @type {String}
+ * @default 'none'
+ */
+ touchCallout: 'none',
+
+ /**
+ * Specifies whether zooming is enabled. Used by IE10>
+ * @type {String}
+ * @default 'none'
+ */
+ contentZooming: 'none',
+
+ /**
+ * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userDrag: 'none',
+
+ /**
+ * Overrides the highlight color shown when the user taps a link or a JavaScript
+ * clickable element in iOS. This property obeys the alpha value, if specified.
+ * @type {String}
+ * @default 'rgba(0,0,0,0)'
+ */
+ tapHighlightColor: 'rgba(0,0,0,0)'
+ }
+ };
+
+ var STOP = 1;
+ var FORCED_STOP = 2;
+
+ /**
+ * Manager
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+ function Manager(element, options) {
+ this.options = assign({}, Hammer.defaults, options || {});
+
+ this.options.inputTarget = this.options.inputTarget || element;
+
+ this.handlers = {};
+ this.session = {};
+ this.recognizers = [];
+
+ this.element = element;
+ this.input = createInputInstance(this);
+ this.touchAction = new TouchAction(this, this.options.touchAction);
+
+ toggleCssProps(this, true);
+
+ each(this.options.recognizers, function(item) {
+ var recognizer = this.add(new (item[0])(item[1]));
+ item[2] && recognizer.recognizeWith(item[2]);
+ item[3] && recognizer.requireFailure(item[3]);
+ }, this);
+ }
+
+ Manager.prototype = {
+ /**
+ * set options
+ * @param {Object} options
+ * @returns {Manager}
+ */
+ set: function(options) {
+ assign(this.options, options);
+
+ // Options that need a little more setup
+ if (options.touchAction) {
+ this.touchAction.update();
+ }
+ if (options.inputTarget) {
+ // Clean up existing event listeners and reinitialize
+ this.input.destroy();
+ this.input.target = options.inputTarget;
+ this.input.init();
+ }
+ return this;
+ },
+
+ /**
+ * stop recognizing for this session.
+ * This session will be discarded, when a new [input]start event is fired.
+ * When forced, the recognizer cycle is stopped immediately.
+ * @param {Boolean} [force]
+ */
+ stop: function(force) {
+ this.session.stopped = force ? FORCED_STOP : STOP;
+ },
+
+ /**
+ * run the recognizers!
+ * called by the inputHandler function on every movement of the pointers (touches)
+ * it walks through all the recognizers and tries to detect the gesture that is being made
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ var session = this.session;
+ if (session.stopped) {
+ return;
+ }
+
+ // run the touch-action polyfill
+ this.touchAction.preventDefaults(inputData);
+
+ var recognizer;
+ var recognizers = this.recognizers;
+
+ // this holds the recognizer that is being recognized.
+ // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
+ // if no recognizer is detecting a thing, it is set to `null`
+ var curRecognizer = session.curRecognizer;
+
+ // reset when the last recognizer is recognized
+ // or when we're in a new session
+ if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
+ curRecognizer = session.curRecognizer = null;
+ }
+
+ var i = 0;
+ while (i < recognizers.length) {
+ recognizer = recognizers[i];
+
+ // find out if we are allowed try to recognize the input for this one.
+ // 1. allow if the session is NOT forced stopped (see the .stop() method)
+ // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
+ // that is being recognized.
+ // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
+ // this can be setup with the `recognizeWith()` method on the recognizer.
+ if (session.stopped !== FORCED_STOP && ( // 1
+ !curRecognizer || recognizer == curRecognizer || // 2
+ recognizer.canRecognizeWith(curRecognizer))) { // 3
+ recognizer.recognize(inputData);
+ } else {
+ recognizer.reset();
+ }
+
+ // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
+ // current active recognizer. but only if we don't already have an active recognizer
+ if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
+ curRecognizer = session.curRecognizer = recognizer;
+ }
+ i++;
+ }
+ },
+
+ /**
+ * get a recognizer by its event name.
+ * @param {Recognizer|String} recognizer
+ * @returns {Recognizer|Null}
+ */
+ get: function(recognizer) {
+ if (recognizer instanceof Recognizer) {
+ return recognizer;
+ }
+
+ var recognizers = this.recognizers;
+ for (var i = 0; i < recognizers.length; i++) {
+ if (recognizers[i].options.event == recognizer) {
+ return recognizers[i];
+ }
+ }
+ return null;
+ },
+
+ /**
+ * add a recognizer to the manager
+ * existing recognizers with the same event name will be removed
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer|Manager}
+ */
+ add: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'add', this)) {
+ return this;
+ }
+
+ // remove existing
+ var existing = this.get(recognizer.options.event);
+ if (existing) {
+ this.remove(existing);
+ }
+
+ this.recognizers.push(recognizer);
+ recognizer.manager = this;
+
+ this.touchAction.update();
+ return recognizer;
+ },
+
+ /**
+ * remove a recognizer by name or instance
+ * @param {Recognizer|String} recognizer
+ * @returns {Manager}
+ */
+ remove: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'remove', this)) {
+ return this;
+ }
+
+ recognizer = this.get(recognizer);
+
+ // let's make sure this recognizer exists
+ if (recognizer) {
+ var recognizers = this.recognizers;
+ var index = inArray(recognizers, recognizer);
+
+ if (index !== -1) {
+ recognizers.splice(index, 1);
+ this.touchAction.update();
+ }
+ }
+
+ return this;
+ },
+
+ /**
+ * bind event
+ * @param {String} events
+ * @param {Function} handler
+ * @returns {EventEmitter} this
+ */
+ on: function(events, handler) {
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ handlers[event] = handlers[event] || [];
+ handlers[event].push(handler);
+ });
+ return this;
+ },
+
+ /**
+ * unbind event, leave emit blank to remove all handlers
+ * @param {String} events
+ * @param {Function} [handler]
+ * @returns {EventEmitter} this
+ */
+ off: function(events, handler) {
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ if (!handler) {
+ delete handlers[event];
+ } else {
+ handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
+ }
+ });
+ return this;
+ },
+
+ /**
+ * emit event to the listeners
+ * @param {String} event
+ * @param {Object} data
+ */
+ emit: function(event, data) {
+ // we also want to trigger dom events
+ if (this.options.domEvents) {
+ triggerDomEvent(event, data);
+ }
+
+ // no handlers, so skip it all
+ var handlers = this.handlers[event] && this.handlers[event].slice();
+ if (!handlers || !handlers.length) {
+ return;
+ }
+
+ data.type = event;
+ data.preventDefault = function() {
+ data.srcEvent.preventDefault();
+ };
+
+ var i = 0;
+ while (i < handlers.length) {
+ handlers[i](data);
+ i++;
+ }
+ },
+
+ /**
+ * destroy the manager and unbinds all events
+ * it doesn't unbind dom events, that is the user own responsibility
+ */
+ destroy: function() {
+ this.element && toggleCssProps(this, false);
+
+ this.handlers = {};
+ this.session = {};
+ this.input.destroy();
+ this.element = null;
+ }
+ };
+
+ /**
+ * add/remove the css properties as defined in manager.options.cssProps
+ * @param {Manager} manager
+ * @param {Boolean} add
+ */
+ function toggleCssProps(manager, add) {
+ var element = manager.element;
+ if (!element.style) {
+ return;
+ }
+ each(manager.options.cssProps, function(value, name) {
+ element.style[prefixed(element.style, name)] = add ? value : '';
+ });
+ }
+
+ /**
+ * trigger dom event
+ * @param {String} event
+ * @param {Object} data
+ */
+ function triggerDomEvent(event, data) {
+ var gestureEvent = document.createEvent('Event');
+ gestureEvent.initEvent(event, true, true);
+ gestureEvent.gesture = data;
+ data.target.dispatchEvent(gestureEvent);
+ }
+
+ assign(Hammer, {
+ INPUT_START: INPUT_START,
+ INPUT_MOVE: INPUT_MOVE,
+ INPUT_END: INPUT_END,
+ INPUT_CANCEL: INPUT_CANCEL,
+
+ STATE_POSSIBLE: STATE_POSSIBLE,
+ STATE_BEGAN: STATE_BEGAN,
+ STATE_CHANGED: STATE_CHANGED,
+ STATE_ENDED: STATE_ENDED,
+ STATE_RECOGNIZED: STATE_RECOGNIZED,
+ STATE_CANCELLED: STATE_CANCELLED,
+ STATE_FAILED: STATE_FAILED,
+
+ DIRECTION_NONE: DIRECTION_NONE,
+ DIRECTION_LEFT: DIRECTION_LEFT,
+ DIRECTION_RIGHT: DIRECTION_RIGHT,
+ DIRECTION_UP: DIRECTION_UP,
+ DIRECTION_DOWN: DIRECTION_DOWN,
+ DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
+ DIRECTION_VERTICAL: DIRECTION_VERTICAL,
+ DIRECTION_ALL: DIRECTION_ALL,
+
+ Manager: Manager,
+ Input: Input,
+ TouchAction: TouchAction,
+
+ TouchInput: TouchInput,
+ MouseInput: MouseInput,
+ PointerEventInput: PointerEventInput,
+ TouchMouseInput: TouchMouseInput,
+ SingleTouchInput: SingleTouchInput,
+
+ Recognizer: Recognizer,
+ AttrRecognizer: AttrRecognizer,
+ Tap: TapRecognizer,
+ Pan: PanRecognizer,
+ Swipe: SwipeRecognizer,
+ Pinch: PinchRecognizer,
+ Rotate: RotateRecognizer,
+ Press: PressRecognizer,
+
+ on: addEventListeners,
+ off: removeEventListeners,
+ each: each,
+ merge: merge,
+ extend: extend,
+ assign: assign,
+ inherit: inherit,
+ bindFn: bindFn,
+ prefixed: prefixed
+ });
+
+ // this prevents errors when Hammer is loaded in the presence of an AMD
+ // style loader but by script tag, not by the loader.
+ var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
+ freeGlobal.Hammer = Hammer;
+
+ if (true) {
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
+ return Hammer;
+ }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof module != 'undefined' && module.exports) {
+ module.exports = Hammer;
+ } else {
+ window[exportName] = Hammer;
+ }
+
+ })(window, document, 'Hammer');
+
+
+/***/ },
+/* 23 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;"use strict";
+ /**
+ * Created by Alex on 11/6/2014.
+ */
+
+ // https://github.com/umdjs/umd/blob/master/returnExports.js#L40-L60
+ // if the module has no dependencies, the above pattern can be simplified to
+ (function (root, factory) {
+ if (true) {
+ // AMD. Register as an anonymous module.
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ root.keycharm = factory();
+ }
+ }(this, function () {
+
+ function keycharm(options) {
+ var preventDefault = options && options.preventDefault || false;
+
+ var container = options && options.container || window;
+
+ var _exportFunctions = {};
+ var _bound = {keydown:{}, keyup:{}};
+ var _keys = {};
+ var i;
+
+ // a - z
+ for (i = 97; i <= 122; i++) {_keys[String.fromCharCode(i)] = {code:65 + (i - 97), shift: false};}
+ // A - Z
+ for (i = 65; i <= 90; i++) {_keys[String.fromCharCode(i)] = {code:i, shift: true};}
+ // 0 - 9
+ for (i = 0; i <= 9; i++) {_keys['' + i] = {code:48 + i, shift: false};}
+ // F1 - F12
+ for (i = 1; i <= 12; i++) {_keys['F' + i] = {code:111 + i, shift: false};}
+ // num0 - num9
+ for (i = 0; i <= 9; i++) {_keys['num' + i] = {code:96 + i, shift: false};}
+
+ // numpad misc
+ _keys['num*'] = {code:106, shift: false};
+ _keys['num+'] = {code:107, shift: false};
+ _keys['num-'] = {code:109, shift: false};
+ _keys['num/'] = {code:111, shift: false};
+ _keys['num.'] = {code:110, shift: false};
+ // arrows
+ _keys['left'] = {code:37, shift: false};
+ _keys['up'] = {code:38, shift: false};
+ _keys['right'] = {code:39, shift: false};
+ _keys['down'] = {code:40, shift: false};
+ // extra keys
+ _keys['space'] = {code:32, shift: false};
+ _keys['enter'] = {code:13, shift: false};
+ _keys['shift'] = {code:16, shift: undefined};
+ _keys['esc'] = {code:27, shift: false};
+ _keys['backspace'] = {code:8, shift: false};
+ _keys['tab'] = {code:9, shift: false};
+ _keys['ctrl'] = {code:17, shift: false};
+ _keys['alt'] = {code:18, shift: false};
+ _keys['delete'] = {code:46, shift: false};
+ _keys['pageup'] = {code:33, shift: false};
+ _keys['pagedown'] = {code:34, shift: false};
+ // symbols
+ _keys['='] = {code:187, shift: false};
+ _keys['-'] = {code:189, shift: false};
+ _keys[']'] = {code:221, shift: false};
+ _keys['['] = {code:219, shift: false};
+
+
+
+ var down = function(event) {handleEvent(event,'keydown');};
+ var up = function(event) {handleEvent(event,'keyup');};
+
+ // handle the actualy bound key with the event
+ var handleEvent = function(event,type) {
+ if (_bound[type][event.keyCode] !== undefined) {
+ var bound = _bound[type][event.keyCode];
+ for (var i = 0; i < bound.length; i++) {
+ if (bound[i].shift === undefined) {
+ bound[i].fn(event);
+ }
+ else if (bound[i].shift == true && event.shiftKey == true) {
+ bound[i].fn(event);
+ }
+ else if (bound[i].shift == false && event.shiftKey == false) {
+ bound[i].fn(event);
+ }
+ }
+
+ if (preventDefault == true) {
+ event.preventDefault();
+ }
+ }
+ };
+
+ // bind a key to a callback
+ _exportFunctions.bind = function(key, callback, type) {
+ if (type === undefined) {
+ type = 'keydown';
+ }
+ if (_keys[key] === undefined) {
+ throw new Error("unsupported key: " + key);
+ }
+ if (_bound[type][_keys[key].code] === undefined) {
+ _bound[type][_keys[key].code] = [];
+ }
+ _bound[type][_keys[key].code].push({fn:callback, shift:_keys[key].shift});
+ };
+
+
+ // bind all keys to a call back (demo purposes)
+ _exportFunctions.bindAll = function(callback, type) {
+ if (type === undefined) {
+ type = 'keydown';
+ }
+ for (var key in _keys) {
+ if (_keys.hasOwnProperty(key)) {
+ _exportFunctions.bind(key,callback,type);
+ }
+ }
+ };
+
+ // get the key label from an event
+ _exportFunctions.getKey = function(event) {
+ for (var key in _keys) {
+ if (_keys.hasOwnProperty(key)) {
+ if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) {
+ return key;
+ }
+ else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) {
+ return key;
+ }
+ else if (event.keyCode == _keys[key].code && key == 'shift') {
+ return key;
+ }
+ }
+ }
+ return "unknown key, currently not supported";
+ };
+
+ // unbind either a specific callback from a key or all of them (by leaving callback undefined)
+ _exportFunctions.unbind = function(key, callback, type) {
+ if (type === undefined) {
+ type = 'keydown';
+ }
+ if (_keys[key] === undefined) {
+ throw new Error("unsupported key: " + key);
+ }
+ if (callback !== undefined) {
+ var newBindings = [];
+ var bound = _bound[type][_keys[key].code];
+ if (bound !== undefined) {
+ for (var i = 0; i < bound.length; i++) {
+ if (!(bound[i].fn == callback && bound[i].shift == _keys[key].shift)) {
+ newBindings.push(_bound[type][_keys[key].code][i]);
+ }
+ }
+ }
+ _bound[type][_keys[key].code] = newBindings;
+ }
+ else {
+ _bound[type][_keys[key].code] = [];
+ }
+ };
+
+ // reset all bound variables.
+ _exportFunctions.reset = function() {
+ _bound = {keydown:{}, keyup:{}};
+ };
+
+ // unbind all listeners and reset all variables.
+ _exportFunctions.destroy = function() {
+ _bound = {keydown:{}, keyup:{}};
+ container.removeEventListener('keydown', down, true);
+ container.removeEventListener('keyup', up, true);
+ };
+
+ // create listeners.
+ container.addEventListener('keydown',down,true);
+ container.addEventListener('keyup',up,true);
+
+ // return the public functions.
+ return _exportFunctions;
+ }
+
+ return keycharm;
+ }));
+
+
+
+
+/***/ },
+/* 24 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ // utils
+ exports.util = __webpack_require__(1);
+ exports.DOMutil = __webpack_require__(8);
+
+ // data
+ exports.DataSet = __webpack_require__(9);
+ exports.DataView = __webpack_require__(11);
+ exports.Queue = __webpack_require__(10);
+
+ // Timeline
+ exports.Timeline = __webpack_require__(25);
+ exports.Graph2d = __webpack_require__(50);
+ exports.timeline = {
+ Core: __webpack_require__(33),
+ DateUtil: __webpack_require__(32),
+ Range: __webpack_require__(30),
+ stack: __webpack_require__(37),
+ TimeStep: __webpack_require__(35),
+
+ components: {
+ items: {
+ Item: __webpack_require__(39),
+ BackgroundItem: __webpack_require__(43),
+ BoxItem: __webpack_require__(41),
+ PointItem: __webpack_require__(42),
+ RangeItem: __webpack_require__(38)
+ },
+
+ BackgroundGroup: __webpack_require__(40),
+ Component: __webpack_require__(31),
+ CurrentTime: __webpack_require__(48),
+ CustomTime: __webpack_require__(46),
+ DataAxis: __webpack_require__(52),
+ DataScale: __webpack_require__(53),
+ GraphGroup: __webpack_require__(54),
+ Group: __webpack_require__(36),
+ ItemSet: __webpack_require__(34),
+ Legend: __webpack_require__(58),
+ LineGraph: __webpack_require__(51),
+ TimeAxis: __webpack_require__(44)
+ }
+ };
+
+ // bundled external libraries
+ exports.moment = __webpack_require__(2);
+ exports.Hammer = __webpack_require__(20);
+ exports.keycharm = __webpack_require__(23);
+
+/***/ },
+/* 25 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _Configurator = __webpack_require__(26);
+
+ var _Configurator2 = _interopRequireDefault(_Configurator);
+
+ var _Validator = __webpack_require__(29);
+
+ var _Validator2 = _interopRequireDefault(_Validator);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var Emitter = __webpack_require__(13);
+ var Hammer = __webpack_require__(20);
+ var moment = __webpack_require__(2);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var Range = __webpack_require__(30);
+ var Core = __webpack_require__(33);
+ var TimeAxis = __webpack_require__(44);
+ var CurrentTime = __webpack_require__(48);
+ var CustomTime = __webpack_require__(46);
+ var ItemSet = __webpack_require__(34);
+
+ var printStyle = __webpack_require__(29).printStyle;
+ var allOptions = __webpack_require__(49).allOptions;
+ var configureOptions = __webpack_require__(49).configureOptions;
+
+ /**
+ * Create a timeline visualization
+ * @param {HTMLElement} container
+ * @param {vis.DataSet | vis.DataView | Array} [items]
+ * @param {vis.DataSet | vis.DataView | Array} [groups]
+ * @param {Object} [options] See Timeline.setOptions for the available options.
+ * @constructor
+ * @extends Core
+ */
+ function Timeline(container, items, groups, options) {
+
+ if (!(this instanceof Timeline)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ // if the third element is options, the forth is groups (optionally);
+ if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {
+ var forthArgument = options;
+ options = groups;
+ groups = forthArgument;
+ }
+
+ var me = this;
+ this.defaultOptions = {
+ start: null,
+ end: null,
+
+ autoResize: true,
+ throttleRedraw: 0, // ms
+
+ orientation: {
+ axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'
+ item: 'bottom' // not relevant
+ },
+ rtl: false,
+ moment: moment,
+
+ width: null,
+ height: null,
+ maxHeight: null,
+ minHeight: null
+ };
+ this.options = util.deepExtend({}, this.defaultOptions);
+
+ // Create the DOM, props, and emitter
+ this._create(container);
+
+ // all components listed here will be repainted automatically
+ this.components = [];
+
+ this.body = {
+ dom: this.dom,
+ domProps: this.props,
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this)
+ },
+ hiddenDates: [],
+ util: {
+ getScale: function getScale() {
+ return me.timeAxis.step.scale;
+ },
+ getStep: function getStep() {
+ return me.timeAxis.step.step;
+ },
+
+ toScreen: me._toScreen.bind(me),
+ toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
+ toTime: me._toTime.bind(me),
+ toGlobalTime: me._toGlobalTime.bind(me)
+ }
+ };
+
+ // range
+ this.range = new Range(this.body);
+ this.components.push(this.range);
+ this.body.range = this.range;
+
+ // time axis
+ this.timeAxis = new TimeAxis(this.body);
+ this.timeAxis2 = null; // used in case of orientation option 'both'
+ this.components.push(this.timeAxis);
+
+ // current time bar
+ this.currentTime = new CurrentTime(this.body);
+ this.components.push(this.currentTime);
+
+ // item set
+ this.itemSet = new ItemSet(this.body, this.options);
+ this.components.push(this.itemSet);
+
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ this.on('tap', function (event) {
+ me.emit('click', me.getEventProperties(event));
+ });
+ this.on('doubletap', function (event) {
+ me.emit('doubleClick', me.getEventProperties(event));
+ });
+ this.dom.root.oncontextmenu = function (event) {
+ me.emit('contextmenu', me.getEventProperties(event));
+ };
+
+ //Single time autoscale/fit
+ this.fitDone = false;
+ this.on('changed', function () {
+ if (this.itemsData == null) return;
+ if (!me.fitDone) {
+ me.fitDone = true;
+ if (me.options.start != undefined || me.options.end != undefined) {
+ if (me.options.start == undefined || me.options.end == undefined) {
+ var range = me.getItemRange();
+ }
+
+ var start = me.options.start != undefined ? me.options.start : range.min;
+ var end = me.options.end != undefined ? me.options.end : range.max;
+
+ me.setWindow(start, end, { animation: false });
+ } else {
+ me.fit({ animation: false });
+ }
+ }
+ });
+
+ // apply options
+ if (options) {
+ this.setOptions(options);
+ }
+
+ // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!
+ if (groups) {
+ this.setGroups(groups);
+ }
+
+ // create itemset
+ if (items) {
+ this.setItems(items);
+ }
+
+ // draw for the first time
+ this._redraw();
+ }
+
+ // Extend the functionality from Core
+ Timeline.prototype = new Core();
+
+ /**
+ * Load a configurator
+ * @return {Object}
+ * @private
+ */
+ Timeline.prototype._createConfigurator = function () {
+ return new _Configurator2.default(this, this.dom.container, configureOptions);
+ };
+
+ /**
+ * Force a redraw. The size of all items will be recalculated.
+ * Can be useful to manually redraw when option autoResize=false and the window
+ * has been resized, or when the items CSS has been changed.
+ *
+ * Note: this function will be overridden on construction with a trottled version
+ */
+ Timeline.prototype.redraw = function () {
+ this.itemSet && this.itemSet.markDirty({ refreshItems: true });
+ this._redraw();
+ };
+
+ Timeline.prototype.setOptions = function (options) {
+ // validate options
+ var errorFound = _Validator2.default.validate(options, allOptions);
+
+ if (errorFound === true) {
+ console.log('%cErrors have been found in the supplied options object.', printStyle);
+ }
+
+ Core.prototype.setOptions.call(this, options);
+
+ if ('type' in options) {
+ if (options.type !== this.options.type) {
+ this.options.type = options.type;
+
+ // force recreation of all items
+ var itemsData = this.itemsData;
+ if (itemsData) {
+ var selection = this.getSelection();
+ this.setItems(null); // remove all
+ this.setItems(itemsData); // add all
+ this.setSelection(selection); // restore selection
+ }
+ }
+ }
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | Array | null} items
+ */
+ Timeline.prototype.setItems = function (items) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!items) {
+ newDataSet = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ newDataSet = items;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(items, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
+ }
+
+ // set items
+ this.itemsData = newDataSet;
+ this.itemSet && this.itemSet.setItems(newDataSet);
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet | Array} groups
+ */
+ Timeline.prototype.setGroups = function (groups) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!groups) {
+ newDataSet = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ newDataSet = groups;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(groups);
+ }
+
+ this.groupsData = newDataSet;
+ this.itemSet.setGroups(newDataSet);
+ };
+
+ /**
+ * Set both items and groups in one go
+ * @param {{items: Array | vis.DataSet, groups: Array | vis.DataSet}} data
+ */
+ Timeline.prototype.setData = function (data) {
+ if (data && data.groups) {
+ this.setGroups(data.groups);
+ }
+
+ if (data && data.items) {
+ this.setItems(data.items);
+ }
+ };
+
+ /**
+ * Set selected items by their id. Replaces the current selection
+ * Unknown id's are silently ignored.
+ * @param {string[] | string} [ids] An array with zero or more id's of the items to be
+ * selected. If ids is an empty array, all items will be
+ * unselected.
+ * @param {Object} [options] Available options:
+ * `focus: boolean`
+ * If true, focus will be set to the selected item(s)
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ * Only applicable when option focus is true.
+ */
+ Timeline.prototype.setSelection = function (ids, options) {
+ this.itemSet && this.itemSet.setSelection(ids);
+
+ if (options && options.focus) {
+ this.focus(ids, options);
+ }
+ };
+
+ /**
+ * Get the selected items by their id
+ * @return {Array} ids The ids of the selected items
+ */
+ Timeline.prototype.getSelection = function () {
+ return this.itemSet && this.itemSet.getSelection() || [];
+ };
+
+ /**
+ * Adjust the visible window such that the selected item (or multiple items)
+ * are centered on screen.
+ * @param {String | String[]} id An item id or array with item ids
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Timeline.prototype.focus = function (id, options) {
+ if (!this.itemsData || id == undefined) return;
+
+ var ids = Array.isArray(id) ? id : [id];
+
+ // get the specified item(s)
+ var itemsData = this.itemsData.getDataSet().get(ids, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
+
+ // calculate minimum start and maximum end of specified items
+ var start = null;
+ var end = null;
+ itemsData.forEach(function (itemData) {
+ var s = itemData.start.valueOf();
+ var e = 'end' in itemData ? itemData.end.valueOf() : itemData.start.valueOf();
+
+ if (start === null || s < start) {
+ start = s;
+ }
+
+ if (end === null || e > end) {
+ end = e;
+ }
+ });
+
+ if (start !== null && end !== null) {
+ // calculate the new middle and interval for the window
+ var middle = (start + end) / 2;
+ var interval = Math.max(this.range.end - this.range.start, (end - start) * 1.1);
+
+ var animation = options && options.animation !== undefined ? options.animation : true;
+ this.range.setRange(middle - interval / 2, middle + interval / 2, animation);
+ }
+ };
+
+ /**
+ * Set Timeline window such that it fits all items
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Timeline.prototype.fit = function (options) {
+ var animation = options && options.animation !== undefined ? options.animation : true;
+ var range;
+
+ var dataset = this.itemsData && this.itemsData.getDataSet();
+ if (dataset.length === 1 && dataset.get()[0].end === undefined) {
+ // a single item -> don't fit, just show a range around the item from -4 to +3 days
+ range = this.getDataRange();
+ this.moveTo(range.min.valueOf(), { animation: animation });
+ } else {
+ // exactly fit the items (plus a small margin)
+ range = this.getItemRange();
+ this.range.setRange(range.min, range.max, animation);
+ }
+ };
+
+ /**
+ * Determine the range of the items, taking into account their actual width
+ * and a margin of 10 pixels on both sides.
+ * @return {{min: Date | null, max: Date | null}}
+ */
+ Timeline.prototype.getItemRange = function () {
+ var _this = this;
+
+ // get a rough approximation for the range based on the items start and end dates
+ var range = this.getDataRange();
+ var min = range.min !== null ? range.min.valueOf() : null;
+ var max = range.max !== null ? range.max.valueOf() : null;
+ var minItem = null;
+ var maxItem = null;
+
+ if (min != null && max != null) {
+ var interval;
+ var factor;
+ var lhs;
+ var rhs;
+ var delta;
+
+ (function () {
+ var getStart = function getStart(item) {
+ return util.convert(item.data.start, 'Date').valueOf();
+ };
+
+ var getEnd = function getEnd(item) {
+ var end = item.data.end != undefined ? item.data.end : item.data.start;
+ return util.convert(end, 'Date').valueOf();
+ };
+
+ // calculate the date of the left side and right side of the items given
+
+
+ interval = max - min; // ms
+
+ if (interval <= 0) {
+ interval = 10;
+ }
+ factor = interval / _this.props.center.width;
+ util.forEach(_this.itemSet.items, function (item) {
+ item.show();
+ item.repositionX();
+
+ var start = getStart(item);
+ var end = getEnd(item);
+
+ if (this.options.rtl) {
+ var startSide = start - (item.getWidthRight() + 10) * factor;
+ var endSide = end + (item.getWidthLeft() + 10) * factor;
+ } else {
+ var startSide = start - (item.getWidthLeft() + 10) * factor;
+ var endSide = end + (item.getWidthRight() + 10) * factor;
+ }
+
+ if (startSide < min) {
+ min = startSide;
+ minItem = item;
+ }
+ if (endSide > max) {
+ max = endSide;
+ maxItem = item;
+ }
+ }.bind(_this));
+
+ if (minItem && maxItem) {
+ lhs = minItem.getWidthLeft() + 10;
+ rhs = maxItem.getWidthRight() + 10;
+ delta = _this.props.center.width - lhs - rhs; // px
+
+ if (delta > 0) {
+ if (_this.options.rtl) {
+ min = getStart(minItem) - rhs * interval / delta; // ms
+ max = getEnd(maxItem) + lhs * interval / delta; // ms
+ } else {
+ min = getStart(minItem) - lhs * interval / delta; // ms
+ max = getEnd(maxItem) + rhs * interval / delta; // ms
+ }
+ }
+ }
+ })();
+ }
+
+ return {
+ min: min != null ? new Date(min) : null,
+ max: max != null ? new Date(max) : null
+ };
+ };
+
+ /**
+ * Calculate the data range of the items start and end dates
+ * @returns {{min: Date | null, max: Date | null}}
+ */
+ Timeline.prototype.getDataRange = function () {
+ var min = null;
+ var max = null;
+
+ var dataset = this.itemsData && this.itemsData.getDataSet();
+ if (dataset) {
+ dataset.forEach(function (item) {
+ var start = util.convert(item.start, 'Date').valueOf();
+ var end = util.convert(item.end != undefined ? item.end : item.start, 'Date').valueOf();
+ if (min === null || start < min) {
+ min = start;
+ }
+ if (max === null || end > max) {
+ max = end;
+ }
+ });
+ }
+
+ return {
+ min: min != null ? new Date(min) : null,
+ max: max != null ? new Date(max) : null
+ };
+ };
+
+ /**
+ * Generate Timeline related information from an event
+ * @param {Event} event
+ * @return {Object} An object with related information, like on which area
+ * The event happened, whether clicked on an item, etc.
+ */
+ Timeline.prototype.getEventProperties = function (event) {
+ var clientX = event.center ? event.center.x : event.clientX;
+ var clientY = event.center ? event.center.y : event.clientY;
+ if (this.options.rtl) {
+ var x = util.getAbsoluteRight(this.dom.centerContainer) - clientX;
+ } else {
+ var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);
+ }
+ var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);
+
+ var item = this.itemSet.itemFromTarget(event);
+ var group = this.itemSet.groupFromTarget(event);
+ var customTime = CustomTime.customTimeFromTarget(event);
+
+ var snap = this.itemSet.options.snap || null;
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+ var time = this._toTime(x);
+ var snappedTime = snap ? snap(time, scale, step) : time;
+
+ var element = util.getTarget(event);
+ var what = null;
+ if (item != null) {
+ what = 'item';
+ } else if (customTime != null) {
+ what = 'custom-time';
+ } else if (util.hasParent(element, this.timeAxis.dom.foreground)) {
+ what = 'axis';
+ } else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {
+ what = 'axis';
+ } else if (util.hasParent(element, this.itemSet.dom.labelSet)) {
+ what = 'group-label';
+ } else if (util.hasParent(element, this.currentTime.bar)) {
+ what = 'current-time';
+ } else if (util.hasParent(element, this.dom.center)) {
+ what = 'background';
+ }
+
+ return {
+ event: event,
+ item: item ? item.id : null,
+ group: group ? group.groupId : null,
+ what: what,
+ pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,
+ pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,
+ x: x,
+ y: y,
+ time: time,
+ snappedTime: snappedTime
+ };
+ };
+
+ module.exports = Timeline;
+
+/***/ },
+/* 26 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ColorPicker = __webpack_require__(27);
+
+ var _ColorPicker2 = _interopRequireDefault(_ColorPicker);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ /**
+ * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.
+ * Boolean options are recognised as Boolean
+ * Number options should be written as array: [default value, min value, max value, stepsize]
+ * Colors should be written as array: ['color', '#ffffff']
+ * Strings with should be written as array: [option1, option2, option3, ..]
+ *
+ * The options are matched with their counterparts in each of the modules and the values used in the configuration are
+ *
+ * @param parentModule | the location where parentModule.setOptions() can be called
+ * @param defaultContainer | the default container of the module
+ * @param configureOptions | the fully configured and predefined options set found in allOptions.js
+ * @param pixelRatio | canvas pixel ratio
+ */
+
+ var Configurator = function () {
+ function Configurator(parentModule, defaultContainer, configureOptions) {
+ var pixelRatio = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3];
+
+ _classCallCheck(this, Configurator);
+
+ this.parent = parentModule;
+ this.changedOptions = [];
+ this.container = defaultContainer;
+ this.allowCreation = false;
+
+ this.options = {};
+ this.initialized = false;
+ this.popupCounter = 0;
+ this.defaultOptions = {
+ enabled: false,
+ filter: true,
+ container: undefined,
+ showButton: true
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.configureOptions = configureOptions;
+ this.moduleOptions = {};
+ this.domElements = [];
+ this.popupDiv = {};
+ this.popupLimit = 5;
+ this.popupHistory = {};
+ this.colorPicker = new _ColorPicker2.default(pixelRatio);
+ this.wrapper = undefined;
+ }
+
+ /**
+ * refresh all options.
+ * Because all modules parse their options by themselves, we just use their options. We copy them here.
+ *
+ * @param options
+ */
+
+
+ _createClass(Configurator, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ // reset the popup history because the indices may have been changed.
+ this.popupHistory = {};
+ this._removePopup();
+
+ var enabled = true;
+ if (typeof options === 'string') {
+ this.options.filter = options;
+ } else if (options instanceof Array) {
+ this.options.filter = options.join();
+ } else if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
+ if (options.container !== undefined) {
+ this.options.container = options.container;
+ }
+ if (options.filter !== undefined) {
+ this.options.filter = options.filter;
+ }
+ if (options.showButton !== undefined) {
+ this.options.showButton = options.showButton;
+ }
+ if (options.enabled !== undefined) {
+ enabled = options.enabled;
+ }
+ } else if (typeof options === 'boolean') {
+ this.options.filter = true;
+ enabled = options;
+ } else if (typeof options === 'function') {
+ this.options.filter = options;
+ enabled = true;
+ }
+ if (this.options.filter === false) {
+ enabled = false;
+ }
+
+ this.options.enabled = enabled;
+ }
+ this._clean();
+ }
+ }, {
+ key: 'setModuleOptions',
+ value: function setModuleOptions(moduleOptions) {
+ this.moduleOptions = moduleOptions;
+ if (this.options.enabled === true) {
+ this._clean();
+ if (this.options.container !== undefined) {
+ this.container = this.options.container;
+ }
+ this._create();
+ }
+ }
+
+ /**
+ * Create all DOM elements
+ * @private
+ */
+
+ }, {
+ key: '_create',
+ value: function _create() {
+ var _this = this;
+
+ this._clean();
+ this.changedOptions = [];
+
+ var filter = this.options.filter;
+ var counter = 0;
+ var show = false;
+ for (var option in this.configureOptions) {
+ if (this.configureOptions.hasOwnProperty(option)) {
+ this.allowCreation = false;
+ show = false;
+ if (typeof filter === 'function') {
+ show = filter(option, []);
+ show = show || this._handleObject(this.configureOptions[option], [option], true);
+ } else if (filter === true || filter.indexOf(option) !== -1) {
+ show = true;
+ }
+
+ if (show !== false) {
+ this.allowCreation = true;
+
+ // linebreak between categories
+ if (counter > 0) {
+ this._makeItem([]);
+ }
+ // a header for the category
+ this._makeHeader(option);
+
+ // get the sub options
+ this._handleObject(this.configureOptions[option], [option]);
+ }
+ counter++;
+ }
+ }
+
+ if (this.options.showButton === true) {
+ (function () {
+ var generateButton = document.createElement('div');
+ generateButton.className = 'vis-configuration vis-config-button';
+ generateButton.innerHTML = 'generate options';
+ generateButton.onclick = function () {
+ _this._printOptions();
+ };
+ generateButton.onmouseover = function () {
+ generateButton.className = 'vis-configuration vis-config-button hover';
+ };
+ generateButton.onmouseout = function () {
+ generateButton.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(generateButton);
+ })();
+ }
+
+ this._push();
+ //~ this.colorPicker.insertTo(this.container);
+ }
+
+ /**
+ * draw all DOM elements on the screen
+ * @private
+ */
+
+ }, {
+ key: '_push',
+ value: function _push() {
+ this.wrapper = document.createElement('div');
+ this.wrapper.className = 'vis-configuration-wrapper';
+ this.container.appendChild(this.wrapper);
+ for (var i = 0; i < this.domElements.length; i++) {
+ this.wrapper.appendChild(this.domElements[i]);
+ }
+
+ this._showPopupIfNeeded();
+ }
+
+ /**
+ * delete all DOM elements
+ * @private
+ */
+
+ }, {
+ key: '_clean',
+ value: function _clean() {
+ for (var i = 0; i < this.domElements.length; i++) {
+ this.wrapper.removeChild(this.domElements[i]);
+ }
+
+ if (this.wrapper !== undefined) {
+ this.container.removeChild(this.wrapper);
+ this.wrapper = undefined;
+ }
+ this.domElements = [];
+
+ this._removePopup();
+ }
+
+ /**
+ * get the value from the actualOptions if it exists
+ * @param {array} path | where to look for the actual option
+ * @returns {*}
+ * @private
+ */
+
+ }, {
+ key: '_getValue',
+ value: function _getValue(path) {
+ var base = this.moduleOptions;
+ for (var i = 0; i < path.length; i++) {
+ if (base[path[i]] !== undefined) {
+ base = base[path[i]];
+ } else {
+ base = undefined;
+ break;
+ }
+ }
+ return base;
+ }
+
+ /**
+ * all option elements are wrapped in an item
+ * @param path
+ * @param domElements
+ * @private
+ */
+
+ }, {
+ key: '_makeItem',
+ value: function _makeItem(path) {
+ var _arguments = arguments,
+ _this2 = this;
+
+ if (this.allowCreation === true) {
+ var _len, domElements, _key;
+
+ var _ret2 = function () {
+ var item = document.createElement('div');
+ item.className = 'vis-configuration vis-config-item vis-config-s' + path.length;
+
+ for (_len = _arguments.length, domElements = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ domElements[_key - 1] = _arguments[_key];
+ }
+
+ domElements.forEach(function (element) {
+ item.appendChild(element);
+ });
+ _this2.domElements.push(item);
+ return {
+ v: _this2.domElements.length
+ };
+ }();
+
+ if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
+ }
+ return 0;
+ }
+
+ /**
+ * header for major subjects
+ * @param name
+ * @private
+ */
+
+ }, {
+ key: '_makeHeader',
+ value: function _makeHeader(name) {
+ var div = document.createElement('div');
+ div.className = 'vis-configuration vis-config-header';
+ div.innerHTML = name;
+ this._makeItem([], div);
+ }
+
+ /**
+ * make a label, if it is an object label, it gets different styling.
+ * @param name
+ * @param path
+ * @param objectLabel
+ * @returns {HTMLElement}
+ * @private
+ */
+
+ }, {
+ key: '_makeLabel',
+ value: function _makeLabel(name, path) {
+ var objectLabel = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ var div = document.createElement('div');
+ div.className = 'vis-configuration vis-config-label vis-config-s' + path.length;
+ if (objectLabel === true) {
+ div.innerHTML = '<i><b>' + name + ':</b></i>';
+ } else {
+ div.innerHTML = name + ':';
+ }
+ return div;
+ }
+
+ /**
+ * make a dropdown list for multiple possible string optoins
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_makeDropdown',
+ value: function _makeDropdown(arr, value, path) {
+ var select = document.createElement('select');
+ select.className = 'vis-configuration vis-config-select';
+ var selectedValue = 0;
+ if (value !== undefined) {
+ if (arr.indexOf(value) !== -1) {
+ selectedValue = arr.indexOf(value);
+ }
+ }
+
+ for (var i = 0; i < arr.length; i++) {
+ var option = document.createElement('option');
+ option.value = arr[i];
+ if (i === selectedValue) {
+ option.selected = 'selected';
+ }
+ option.innerHTML = arr[i];
+ select.appendChild(option);
+ }
+
+ var me = this;
+ select.onchange = function () {
+ me._update(this.value, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, select);
+ }
+
+ /**
+ * make a range object for numeric options
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_makeRange',
+ value: function _makeRange(arr, value, path) {
+ var defaultValue = arr[0];
+ var min = arr[1];
+ var max = arr[2];
+ var step = arr[3];
+ var range = document.createElement('input');
+ range.className = 'vis-configuration vis-config-range';
+ try {
+ range.type = 'range'; // not supported on IE9
+ range.min = min;
+ range.max = max;
+ } catch (err) {}
+ range.step = step;
+
+ // set up the popup settings in case they are needed.
+ var popupString = '';
+ var popupValue = 0;
+
+ if (value !== undefined) {
+ var factor = 1.20;
+ if (value < 0 && value * factor < min) {
+ range.min = Math.ceil(value * factor);
+ popupValue = range.min;
+ popupString = 'range increased';
+ } else if (value / factor < min) {
+ range.min = Math.ceil(value / factor);
+ popupValue = range.min;
+ popupString = 'range increased';
+ }
+ if (value * factor > max && max !== 1) {
+ range.max = Math.ceil(value * factor);
+ popupValue = range.max;
+ popupString = 'range increased';
+ }
+ range.value = value;
+ } else {
+ range.value = defaultValue;
+ }
+
+ var input = document.createElement('input');
+ input.className = 'vis-configuration vis-config-rangeinput';
+ input.value = range.value;
+
+ var me = this;
+ range.onchange = function () {
+ input.value = this.value;me._update(Number(this.value), path);
+ };
+ range.oninput = function () {
+ input.value = this.value;
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ var itemIndex = this._makeItem(path, label, range, input);
+
+ // if a popup is needed AND it has not been shown for this value, show it.
+ if (popupString !== '' && this.popupHistory[itemIndex] !== popupValue) {
+ this.popupHistory[itemIndex] = popupValue;
+ this._setupPopup(popupString, itemIndex);
+ }
+ }
+
+ /**
+ * prepare the popup
+ * @param string
+ * @param index
+ * @private
+ */
+
+ }, {
+ key: '_setupPopup',
+ value: function _setupPopup(string, index) {
+ var _this3 = this;
+
+ if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) {
+ var div = document.createElement("div");
+ div.id = "vis-configuration-popup";
+ div.className = "vis-configuration-popup";
+ div.innerHTML = string;
+ div.onclick = function () {
+ _this3._removePopup();
+ };
+ this.popupCounter += 1;
+ this.popupDiv = { html: div, index: index };
+ }
+ }
+
+ /**
+ * remove the popup from the dom
+ * @private
+ */
+
+ }, {
+ key: '_removePopup',
+ value: function _removePopup() {
+ if (this.popupDiv.html !== undefined) {
+ this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);
+ clearTimeout(this.popupDiv.hideTimeout);
+ clearTimeout(this.popupDiv.deleteTimeout);
+ this.popupDiv = {};
+ }
+ }
+
+ /**
+ * Show the popup if it is needed.
+ * @private
+ */
+
+ }, {
+ key: '_showPopupIfNeeded',
+ value: function _showPopupIfNeeded() {
+ var _this4 = this;
+
+ if (this.popupDiv.html !== undefined) {
+ var correspondingElement = this.domElements[this.popupDiv.index];
+ var rect = correspondingElement.getBoundingClientRect();
+ this.popupDiv.html.style.left = rect.left + "px";
+ this.popupDiv.html.style.top = rect.top - 30 + "px"; // 30 is the height;
+ document.body.appendChild(this.popupDiv.html);
+ this.popupDiv.hideTimeout = setTimeout(function () {
+ _this4.popupDiv.html.style.opacity = 0;
+ }, 1500);
+ this.popupDiv.deleteTimeout = setTimeout(function () {
+ _this4._removePopup();
+ }, 1800);
+ }
+ }
+
+ /**
+ * make a checkbox for boolean options.
+ * @param defaultValue
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_makeCheckbox',
+ value: function _makeCheckbox(defaultValue, value, path) {
+ var checkbox = document.createElement('input');
+ checkbox.type = 'checkbox';
+ checkbox.className = 'vis-configuration vis-config-checkbox';
+ checkbox.checked = defaultValue;
+ if (value !== undefined) {
+ checkbox.checked = value;
+ if (value !== defaultValue) {
+ if ((typeof defaultValue === 'undefined' ? 'undefined' : _typeof(defaultValue)) === 'object') {
+ if (value !== defaultValue.enabled) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ } else {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ }
+ }
+
+ var me = this;
+ checkbox.onchange = function () {
+ me._update(this.checked, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, checkbox);
+ }
+
+ /**
+ * make a text input field for string options.
+ * @param defaultValue
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_makeTextInput',
+ value: function _makeTextInput(defaultValue, value, path) {
+ var checkbox = document.createElement('input');
+ checkbox.type = 'text';
+ checkbox.className = 'vis-configuration vis-config-text';
+ checkbox.value = value;
+ if (value !== defaultValue) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+
+ var me = this;
+ checkbox.onchange = function () {
+ me._update(this.value, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, checkbox);
+ }
+
+ /**
+ * make a color field with a color picker for color fields
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_makeColorField',
+ value: function _makeColorField(arr, value, path) {
+ var _this5 = this;
+
+ var defaultColor = arr[1];
+ var div = document.createElement('div');
+ value = value === undefined ? defaultColor : value;
+
+ if (value !== 'none') {
+ div.className = 'vis-configuration vis-config-colorBlock';
+ div.style.backgroundColor = value;
+ } else {
+ div.className = 'vis-configuration vis-config-colorBlock none';
+ }
+
+ value = value === undefined ? defaultColor : value;
+ div.onclick = function () {
+ _this5._showColorPicker(value, div, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, div);
+ }
+
+ /**
+ * used by the color buttons to call the color picker.
+ * @param event
+ * @param value
+ * @param div
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_showColorPicker',
+ value: function _showColorPicker(value, div, path) {
+ var _this6 = this;
+
+ // clear the callback from this div
+ div.onclick = function () {};
+
+ this.colorPicker.insertTo(div);
+ this.colorPicker.show();
+
+ this.colorPicker.setColor(value);
+ this.colorPicker.setUpdateCallback(function (color) {
+ var colorString = 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';
+ div.style.backgroundColor = colorString;
+ _this6._update(colorString, path);
+ });
+
+ // on close of the colorpicker, restore the callback.
+ this.colorPicker.setCloseCallback(function () {
+ div.onclick = function () {
+ _this6._showColorPicker(value, div, path);
+ };
+ });
+ }
+
+ /**
+ * parse an object and draw the correct items
+ * @param obj
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_handleObject',
+ value: function _handleObject(obj) {
+ var path = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+ var checkOnly = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ var show = false;
+ var filter = this.options.filter;
+ var visibleInSet = false;
+ for (var subObj in obj) {
+ if (obj.hasOwnProperty(subObj)) {
+ show = true;
+ var item = obj[subObj];
+ var newPath = util.copyAndExtendArray(path, subObj);
+ if (typeof filter === 'function') {
+ show = filter(subObj, path);
+
+ // if needed we must go deeper into the object.
+ if (show === false) {
+ if (!(item instanceof Array) && typeof item !== 'string' && typeof item !== 'boolean' && item instanceof Object) {
+ this.allowCreation = false;
+ show = this._handleObject(item, newPath, true);
+ this.allowCreation = checkOnly === false;
+ }
+ }
+ }
+
+ if (show !== false) {
+ visibleInSet = true;
+ var value = this._getValue(newPath);
+
+ if (item instanceof Array) {
+ this._handleArray(item, value, newPath);
+ } else if (typeof item === 'string') {
+ this._makeTextInput(item, value, newPath);
+ } else if (typeof item === 'boolean') {
+ this._makeCheckbox(item, value, newPath);
+ } else if (item instanceof Object) {
+ // collapse the physics options that are not enabled
+ var draw = true;
+ if (path.indexOf('physics') !== -1) {
+ if (this.moduleOptions.physics.solver !== subObj) {
+ draw = false;
+ }
+ }
+
+ if (draw === true) {
+ // initially collapse options with an disabled enabled option.
+ if (item.enabled !== undefined) {
+ var enabledPath = util.copyAndExtendArray(newPath, 'enabled');
+ var enabledValue = this._getValue(enabledPath);
+ if (enabledValue === true) {
+ var label = this._makeLabel(subObj, newPath, true);
+ this._makeItem(newPath, label);
+ visibleInSet = this._handleObject(item, newPath) || visibleInSet;
+ } else {
+ this._makeCheckbox(item, enabledValue, newPath);
+ }
+ } else {
+ var _label = this._makeLabel(subObj, newPath, true);
+ this._makeItem(newPath, _label);
+ visibleInSet = this._handleObject(item, newPath) || visibleInSet;
+ }
+ }
+ } else {
+ console.error('dont know how to handle', item, subObj, newPath);
+ }
+ }
+ }
+ }
+ return visibleInSet;
+ }
+
+ /**
+ * handle the array type of option
+ * @param optionName
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_handleArray',
+ value: function _handleArray(arr, value, path) {
+ if (typeof arr[0] === 'string' && arr[0] === 'color') {
+ this._makeColorField(arr, value, path);
+ if (arr[1] !== value) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ } else if (typeof arr[0] === 'string') {
+ this._makeDropdown(arr, value, path);
+ if (arr[0] !== value) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ } else if (typeof arr[0] === 'number') {
+ this._makeRange(arr, value, path);
+ if (arr[0] !== value) {
+ this.changedOptions.push({ path: path, value: Number(value) });
+ }
+ }
+ }
+
+ /**
+ * called to update the network with the new settings.
+ * @param value
+ * @param path
+ * @private
+ */
+
+ }, {
+ key: '_update',
+ value: function _update(value, path) {
+ var options = this._constructOptions(value, path);
+
+ if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) {
+ this.parent.body.emitter.emit("configChange", options);
+ }
+ this.initialized = true;
+ this.parent.setOptions(options);
+ }
+ }, {
+ key: '_constructOptions',
+ value: function _constructOptions(value, path) {
+ var optionsObj = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+ var pointer = optionsObj;
+
+ // when dropdown boxes can be string or boolean, we typecast it into correct types
+ value = value === 'true' ? true : value;
+ value = value === 'false' ? false : value;
+
+ for (var i = 0; i < path.length; i++) {
+ if (path[i] !== 'global') {
+ if (pointer[path[i]] === undefined) {
+ pointer[path[i]] = {};
+ }
+ if (i !== path.length - 1) {
+ pointer = pointer[path[i]];
+ } else {
+ pointer[path[i]] = value;
+ }
+ }
+ }
+ return optionsObj;
+ }
+ }, {
+ key: '_printOptions',
+ value: function _printOptions() {
+ var options = this.getOptions();
+ this.optionsContainer.innerHTML = '<pre>var options = ' + JSON.stringify(options, null, 2) + '</pre>';
+ }
+ }, {
+ key: 'getOptions',
+ value: function getOptions() {
+ var options = {};
+ for (var i = 0; i < this.changedOptions.length; i++) {
+ this._constructOptions(this.changedOptions[i].value, this.changedOptions[i].path, options);
+ }
+ return options;
+ }
+ }]);
+
+ return Configurator;
+ }();
+
+ exports.default = Configurator;
+
+/***/ },
+/* 27 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(28);
+ var util = __webpack_require__(1);
+
+ var ColorPicker = function () {
+ function ColorPicker() {
+ var pixelRatio = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];
+
+ _classCallCheck(this, ColorPicker);
+
+ this.pixelRatio = pixelRatio;
+ this.generated = false;
+ this.centerCoordinates = { x: 289 / 2, y: 289 / 2 };
+ this.r = 289 * 0.49;
+ this.color = { r: 255, g: 255, b: 255, a: 1.0 };
+ this.hueCircle = undefined;
+ this.initialColor = { r: 255, g: 255, b: 255, a: 1.0 };
+ this.previousColor = undefined;
+ this.applied = false;
+
+ // bound by
+ this.updateCallback = function () {};
+ this.closeCallback = function () {};
+
+ // create all DOM elements
+ this._create();
+ }
+
+ /**
+ * this inserts the colorPicker into a div from the DOM
+ * @param container
+ */
+
+
+ _createClass(ColorPicker, [{
+ key: 'insertTo',
+ value: function insertTo(container) {
+ if (this.hammer !== undefined) {
+ this.hammer.destroy();
+ this.hammer = undefined;
+ }
+ this.container = container;
+ this.container.appendChild(this.frame);
+ this._bindHammer();
+
+ this._setSize();
+ }
+
+ /**
+ * the callback is executed on apply and save. Bind it to the application
+ * @param callback
+ */
+
+ }, {
+ key: 'setUpdateCallback',
+ value: function setUpdateCallback(callback) {
+ if (typeof callback === 'function') {
+ this.updateCallback = callback;
+ } else {
+ throw new Error("Function attempted to set as colorPicker update callback is not a function.");
+ }
+ }
+
+ /**
+ * the callback is executed on apply and save. Bind it to the application
+ * @param callback
+ */
+
+ }, {
+ key: 'setCloseCallback',
+ value: function setCloseCallback(callback) {
+ if (typeof callback === 'function') {
+ this.closeCallback = callback;
+ } else {
+ throw new Error("Function attempted to set as colorPicker closing callback is not a function.");
+ }
+ }
+ }, {
+ key: '_isColorString',
+ value: function _isColorString(color) {
+ var htmlColors = { 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' };
+ if (typeof color === 'string') {
+ return htmlColors[color];
+ }
+ }
+
+ /**
+ * Set the color of the colorPicker
+ * Supported formats:
+ * 'red' --> HTML color string
+ * '#ffffff' --> hex string
+ * 'rbg(255,255,255)' --> rgb string
+ * 'rgba(255,255,255,1.0)' --> rgba string
+ * {r:255,g:255,b:255} --> rgb object
+ * {r:255,g:255,b:255,a:1.0} --> rgba object
+ * @param color
+ * @param setInitial
+ */
+
+ }, {
+ key: 'setColor',
+ value: function setColor(color) {
+ var setInitial = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ if (color === 'none') {
+ return;
+ }
+
+ var rgba = void 0;
+
+ // if a html color shorthand is used, convert to hex
+ var htmlColor = this._isColorString(color);
+ if (htmlColor !== undefined) {
+ color = htmlColor;
+ }
+
+ // check format
+ if (util.isString(color) === true) {
+ if (util.isValidRGB(color) === true) {
+ var rgbaArray = color.substr(4).substr(0, color.length - 5).split(',');
+ rgba = { r: rgbaArray[0], g: rgbaArray[1], b: rgbaArray[2], a: 1.0 };
+ } else if (util.isValidRGBA(color) === true) {
+ var _rgbaArray = color.substr(5).substr(0, color.length - 6).split(',');
+ rgba = { r: _rgbaArray[0], g: _rgbaArray[1], b: _rgbaArray[2], a: _rgbaArray[3] };
+ } else if (util.isValidHex(color) === true) {
+ var rgbObj = util.hexToRGB(color);
+ rgba = { r: rgbObj.r, g: rgbObj.g, b: rgbObj.b, a: 1.0 };
+ }
+ } else {
+ if (color instanceof Object) {
+ if (color.r !== undefined && color.g !== undefined && color.b !== undefined) {
+ var alpha = color.a !== undefined ? color.a : '1.0';
+ rgba = { r: color.r, g: color.g, b: color.b, a: alpha };
+ }
+ }
+ }
+
+ // set color
+ if (rgba === undefined) {
+ 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(color));
+ } else {
+ this._setColor(rgba, setInitial);
+ }
+ }
+
+ /**
+ * this shows the color picker.
+ * The hue circle is constructed once and stored.
+ */
+
+ }, {
+ key: 'show',
+ value: function show() {
+ if (this.closeCallback !== undefined) {
+ this.closeCallback();
+ this.closeCallback = undefined;
+ }
+
+ this.applied = false;
+ this.frame.style.display = 'block';
+ this._generateHueCircle();
+ }
+
+ // ------------------------------------------ PRIVATE ----------------------------- //
+
+ /**
+ * Hide the picker. Is called by the cancel button.
+ * Optional boolean to store the previous color for easy access later on.
+ * @param storePrevious
+ * @private
+ */
+
+ }, {
+ key: '_hide',
+ value: function _hide() {
+ var _this = this;
+
+ var storePrevious = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
+
+ // store the previous color for next time;
+ if (storePrevious === true) {
+ this.previousColor = util.extend({}, this.color);
+ }
+
+ if (this.applied === true) {
+ this.updateCallback(this.initialColor);
+ }
+
+ this.frame.style.display = 'none';
+
+ // call the closing callback, restoring the onclick method.
+ // this is in a setTimeout because it will trigger the show again before the click is done.
+ setTimeout(function () {
+ if (_this.closeCallback !== undefined) {
+ _this.closeCallback();
+ _this.closeCallback = undefined;
+ }
+ }, 0);
+ }
+
+ /**
+ * bound to the save button. Saves and hides.
+ * @private
+ */
+
+ }, {
+ key: '_save',
+ value: function _save() {
+ this.updateCallback(this.color);
+ this.applied = false;
+ this._hide();
+ }
+
+ /**
+ * Bound to apply button. Saves but does not close. Is undone by the cancel button.
+ * @private
+ */
+
+ }, {
+ key: '_apply',
+ value: function _apply() {
+ this.applied = true;
+ this.updateCallback(this.color);
+ this._updatePicker(this.color);
+ }
+
+ /**
+ * load the color from the previous session.
+ * @private
+ */
+
+ }, {
+ key: '_loadLast',
+ value: function _loadLast() {
+ if (this.previousColor !== undefined) {
+ this.setColor(this.previousColor, false);
+ } else {
+ alert("There is no last color to load...");
+ }
+ }
+
+ /**
+ * set the color, place the picker
+ * @param rgba
+ * @param setInitial
+ * @private
+ */
+
+ }, {
+ key: '_setColor',
+ value: function _setColor(rgba) {
+ var setInitial = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ // store the initial color
+ if (setInitial === true) {
+ this.initialColor = util.extend({}, rgba);
+ }
+
+ this.color = rgba;
+ var hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);
+
+ var angleConvert = 2 * Math.PI;
+ var radius = this.r * hsv.s;
+ var x = this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);
+ var y = this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);
+
+ this.colorPickerSelector.style.left = x - 0.5 * this.colorPickerSelector.clientWidth + 'px';
+ this.colorPickerSelector.style.top = y - 0.5 * this.colorPickerSelector.clientHeight + 'px';
+
+ this._updatePicker(rgba);
+ }
+
+ /**
+ * bound to opacity control
+ * @param value
+ * @private
+ */
+
+ }, {
+ key: '_setOpacity',
+ value: function _setOpacity(value) {
+ this.color.a = value / 100;
+ this._updatePicker(this.color);
+ }
+
+ /**
+ * bound to brightness control
+ * @param value
+ * @private
+ */
+
+ }, {
+ key: '_setBrightness',
+ value: function _setBrightness(value) {
+ var hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);
+ hsv.v = value / 100;
+ var rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);
+ rgba['a'] = this.color.a;
+ this.color = rgba;
+ this._updatePicker();
+ }
+
+ /**
+ * update the color picker. A black circle overlays the hue circle to mimic the brightness decreasing.
+ * @param rgba
+ * @private
+ */
+
+ }, {
+ key: '_updatePicker',
+ value: function _updatePicker() {
+ var rgba = arguments.length <= 0 || arguments[0] === undefined ? this.color : arguments[0];
+
+ var hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);
+ var ctx = this.colorPickerCanvas.getContext('2d');
+ if (this.pixelRation === undefined) {
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+ }
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+
+ // clear the canvas
+ var w = this.colorPickerCanvas.clientWidth;
+ var h = this.colorPickerCanvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ ctx.putImageData(this.hueCircle, 0, 0);
+ ctx.fillStyle = 'rgba(0,0,0,' + (1 - hsv.v) + ')';
+ ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);
+ ctx.fill();
+
+ this.brightnessRange.value = 100 * hsv.v;
+ this.opacityRange.value = 100 * rgba.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 + ')';
+ }
+
+ /**
+ * used by create to set the size of the canvas.
+ * @private
+ */
+
+ }, {
+ key: '_setSize',
+ value: function _setSize() {
+ this.colorPickerCanvas.style.width = '100%';
+ this.colorPickerCanvas.style.height = '100%';
+
+ this.colorPickerCanvas.width = 289 * this.pixelRatio;
+ this.colorPickerCanvas.height = 289 * this.pixelRatio;
+ }
+
+ /**
+ * create all dom elements
+ * TODO: cleanup, lots of similar dom elements
+ * @private
+ */
+
+ }, {
+ key: '_create',
+ value: function _create() {
+ 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);
+
+ if (!this.colorPickerCanvas.getContext) {
+ var noCanvas = document.createElement('DIV');
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold';
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.colorPickerCanvas.appendChild(noCanvas);
+ } else {
+ var ctx = this.colorPickerCanvas.getContext("2d");
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+ }
+
+ this.colorPickerDiv.className = 'vis-color';
+
+ this.opacityDiv = document.createElement('div');
+ this.opacityDiv.className = 'vis-opacity';
+
+ this.brightnessDiv = document.createElement('div');
+ this.brightnessDiv.className = 'vis-brightness';
+
+ this.arrowDiv = document.createElement('div');
+ this.arrowDiv.className = 'vis-arrow';
+
+ this.opacityRange = document.createElement('input');
+ try {
+ this.opacityRange.type = 'range'; // Not supported on IE9
+ this.opacityRange.min = '0';
+ this.opacityRange.max = '100';
+ } catch (err) {}
+ this.opacityRange.value = '100';
+ this.opacityRange.className = 'vis-range';
+
+ this.brightnessRange = document.createElement('input');
+ try {
+ this.brightnessRange.type = 'range'; // Not supported on IE9
+ this.brightnessRange.min = '0';
+ this.brightnessRange.max = '100';
+ } catch (err) {}
+ this.brightnessRange.value = '100';
+ this.brightnessRange.className = 'vis-range';
+
+ this.opacityDiv.appendChild(this.opacityRange);
+ this.brightnessDiv.appendChild(this.brightnessRange);
+
+ var me = this;
+ this.opacityRange.onchange = function () {
+ me._setOpacity(this.value);
+ };
+ this.opacityRange.oninput = function () {
+ me._setOpacity(this.value);
+ };
+ this.brightnessRange.onchange = function () {
+ me._setBrightness(this.value);
+ };
+ this.brightnessRange.oninput = function () {
+ me._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, false);
+
+ 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);
+ }
+
+ /**
+ * bind hammer to the color picker
+ * @private
+ */
+
+ }, {
+ key: '_bindHammer',
+ value: function _bindHammer() {
+ var _this2 = this;
+
+ this.drag = {};
+ this.pinch = {};
+ this.hammer = new Hammer(this.colorPickerCanvas);
+ this.hammer.get('pinch').set({ enable: true });
+
+ hammerUtil.onTouch(this.hammer, function (event) {
+ _this2._moveSelector(event);
+ });
+ this.hammer.on('tap', function (event) {
+ _this2._moveSelector(event);
+ });
+ this.hammer.on('panstart', function (event) {
+ _this2._moveSelector(event);
+ });
+ this.hammer.on('panmove', function (event) {
+ _this2._moveSelector(event);
+ });
+ this.hammer.on('panend', function (event) {
+ _this2._moveSelector(event);
+ });
+ }
+
+ /**
+ * generate the hue circle. This is relatively heavy (200ms) and is done only once on the first time it is shown.
+ * @private
+ */
+
+ }, {
+ key: '_generateHueCircle',
+ value: function _generateHueCircle() {
+ if (this.generated === false) {
+ var ctx = this.colorPickerCanvas.getContext('2d');
+ if (this.pixelRation === undefined) {
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+ }
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+
+ // clear the canvas
+ var w = this.colorPickerCanvas.clientWidth;
+ var h = this.colorPickerCanvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ // draw hue circle
+ var x = void 0,
+ y = void 0,
+ hue = void 0,
+ sat = void 0;
+ this.centerCoordinates = { x: w * 0.5, y: h * 0.5 };
+ this.r = 0.49 * w;
+ var angleConvert = 2 * Math.PI / 360;
+ var hfac = 1 / 360;
+ var sfac = 1 / this.r;
+ var rgb = void 0;
+ for (hue = 0; hue < 360; hue++) {
+ for (sat = 0; sat < this.r; sat++) {
+ x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);
+ y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);
+ rgb = util.HSVToRGB(hue * hfac, sat * sfac, 1);
+ ctx.fillStyle = 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
+ ctx.fillRect(x - 0.5, y - 0.5, 2, 2);
+ }
+ }
+ ctx.strokeStyle = 'rgba(0,0,0,1)';
+ ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);
+ ctx.stroke();
+
+ this.hueCircle = ctx.getImageData(0, 0, w, h);
+ }
+ this.generated = true;
+ }
+
+ /**
+ * move the selector. This is called by hammer functions.
+ *
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: '_moveSelector',
+ value: function _moveSelector(event) {
+ var rect = this.colorPickerDiv.getBoundingClientRect();
+ var left = event.center.x - rect.left;
+ var top = event.center.y - rect.top;
+
+ var centerY = 0.5 * this.colorPickerDiv.clientHeight;
+ var centerX = 0.5 * this.colorPickerDiv.clientWidth;
+
+ var x = left - centerX;
+ var y = top - centerY;
+
+ var angle = Math.atan2(x, y);
+ var radius = 0.98 * Math.min(Math.sqrt(x * x + y * y), centerX);
+
+ var newTop = Math.cos(angle) * radius + centerY;
+ var newLeft = Math.sin(angle) * radius + centerX;
+
+ this.colorPickerSelector.style.top = newTop - 0.5 * this.colorPickerSelector.clientHeight + 'px';
+ this.colorPickerSelector.style.left = newLeft - 0.5 * this.colorPickerSelector.clientWidth + 'px';
+
+ // set color
+ var h = angle / (2 * Math.PI);
+ h = h < 0 ? h + 1 : h;
+ var s = radius / this.r;
+ var hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);
+ hsv.h = h;
+ hsv.s = s;
+ var rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);
+ rgba['a'] = this.color.a;
+ this.color = rgba;
+
+ // update previews
+ 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 + ')';
+ }
+ }]);
+
+ return ColorPicker;
+ }();
+
+ exports.default = ColorPicker;
+
+/***/ },
+/* 28 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+
+ /**
+ * Register a touch event, taking place before a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.onTouch = function (hammer, callback) {
+ callback.inputHandler = function (event) {
+ if (event.isFirst) {
+ callback(event);
+ }
+ };
+
+ hammer.on('hammer.input', callback.inputHandler);
+ };
+
+ /**
+ * Register a release event, taking place after a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.onRelease = function (hammer, callback) {
+ callback.inputHandler = function (event) {
+ if (event.isFinal) {
+ callback(event);
+ }
+ };
+
+ return hammer.on('hammer.input', callback.inputHandler);
+ };
+
+ /**
+ * Unregister a touch event, taking place before a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.offTouch = function (hammer, callback) {
+ hammer.off('hammer.input', callback.inputHandler);
+ };
+
+ /**
+ * Unregister a release event, taking place before a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.offRelease = exports.offTouch;
+
+ /**
+ * Hack the PinchRecognizer such that it doesn't prevent default behavior
+ * for vertical panning.
+ *
+ * Yeah ... this is quite a hack ... see https://github.com/hammerjs/hammer.js/issues/932
+ *
+ * @param {Hammer.Pinch} pinchRecognizer
+ * @return {Hammer.Pinch} returns the pinchRecognizer
+ */
+ exports.disablePreventDefaultVertically = function (pinchRecognizer) {
+ var TOUCH_ACTION_PAN_Y = 'pan-y';
+
+ pinchRecognizer.getTouchAction = function () {
+ // default method returns [TOUCH_ACTION_NONE]
+ return [TOUCH_ACTION_PAN_Y];
+ };
+
+ return pinchRecognizer;
+ };
+
+/***/ },
+/* 29 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var errorFound = false;
+ var allOptions = void 0;
+ var printStyle = 'background: #FFeeee; color: #dd0000';
+ /**
+ * Used to validate options.
+ */
+
+ var Validator = function () {
+ function Validator() {
+ _classCallCheck(this, Validator);
+ }
+
+ /**
+ * Main function to be called
+ * @param options
+ * @param subObject
+ * @returns {boolean}
+ */
+
+
+ _createClass(Validator, null, [{
+ key: 'validate',
+ value: function validate(options, referenceOptions, subObject) {
+ errorFound = false;
+ allOptions = referenceOptions;
+ var usedOptions = referenceOptions;
+ if (subObject !== undefined) {
+ usedOptions = referenceOptions[subObject];
+ }
+ Validator.parse(options, usedOptions, []);
+ return errorFound;
+ }
+
+ /**
+ * Will traverse an object recursively and check every value
+ * @param options
+ * @param referenceOptions
+ * @param path
+ */
+
+ }, {
+ key: 'parse',
+ value: function parse(options, referenceOptions, path) {
+ for (var option in options) {
+ if (options.hasOwnProperty(option)) {
+ Validator.check(option, options, referenceOptions, path);
+ }
+ }
+ }
+
+ /**
+ * Check every value. If the value is an object, call the parse function on that object.
+ * @param option
+ * @param options
+ * @param referenceOptions
+ * @param path
+ */
+
+ }, {
+ key: 'check',
+ value: function check(option, options, referenceOptions, path) {
+ if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) {
+ Validator.getSuggestion(option, referenceOptions, path);
+ } else if (referenceOptions[option] === undefined && referenceOptions.__any__ !== undefined) {
+ // __any__ is a wildcard. Any value is accepted and will be further analysed by reference.
+ if (Validator.getType(options[option]) === 'object' && referenceOptions['__any__'].__type__ !== undefined) {
+ // if the any subgroup is not a predefined object int he configurator we do not look deeper into the object.
+ Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions['__any__'].__type__, path);
+ } else {
+ Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions['__any__'], path);
+ }
+ } else {
+ // Since all options in the reference are objects, we can check whether they are supposed to be object to look for the __type__ field.
+ if (referenceOptions[option].__type__ !== undefined) {
+ // if this should be an object, we check if the correct type has been supplied to account for shorthand options.
+ Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option].__type__, path);
+ } else {
+ Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option], path);
+ }
+ }
+ }
+
+ /**
+ *
+ * @param {String} option | the option property
+ * @param {Object} options | The supplied options object
+ * @param {Object} referenceOptions | The reference options containing all options and their allowed formats
+ * @param {String} referenceOption | Usually this is the same as option, except when handling an __any__ tag.
+ * @param {String} refOptionType | This is the type object from the reference options
+ * @param {Array} path | where in the object is the option
+ */
+
+ }, {
+ key: 'checkFields',
+ value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) {
+ var optionType = Validator.getType(options[option]);
+ var refOptionType = refOptionObj[optionType];
+ if (refOptionType !== undefined) {
+ // if the type is correct, we check if it is supposed to be one of a few select values
+ if (Validator.getType(refOptionType) === 'array') {
+ if (refOptionType.indexOf(options[option]) === -1) {
+ console.log('%cInvalid option detected in "' + option + '".' + ' Allowed values are:' + Validator.print(refOptionType) + ' not "' + options[option] + '". ' + Validator.printLocation(path, option), printStyle);
+ errorFound = true;
+ } else if (optionType === 'object' && referenceOption !== "__any__") {
+ path = util.copyAndExtendArray(path, option);
+ Validator.parse(options[option], referenceOptions[referenceOption], path);
+ }
+ } else if (optionType === 'object' && referenceOption !== "__any__") {
+ path = util.copyAndExtendArray(path, option);
+ Validator.parse(options[option], referenceOptions[referenceOption], path);
+ }
+ } else if (refOptionObj['any'] === undefined) {
+ // type of the field is incorrect and the field cannot be any
+ console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle);
+ errorFound = true;
+ }
+ }
+ }, {
+ key: 'getType',
+ value: function getType(object) {
+ var type = typeof object === 'undefined' ? 'undefined' : _typeof(object);
+
+ if (type === 'object') {
+ if (object === null) {
+ return 'null';
+ }
+ if (object instanceof Boolean) {
+ return 'boolean';
+ }
+ if (object instanceof Number) {
+ return 'number';
+ }
+ if (object instanceof String) {
+ return 'string';
+ }
+ if (Array.isArray(object)) {
+ return 'array';
+ }
+ if (object instanceof Date) {
+ return 'date';
+ }
+ if (object.nodeType !== undefined) {
+ return 'dom';
+ }
+ if (object._isAMomentObject === true) {
+ return 'moment';
+ }
+ return 'object';
+ } else if (type === 'number') {
+ return 'number';
+ } else if (type === 'boolean') {
+ return 'boolean';
+ } else if (type === 'string') {
+ return 'string';
+ } else if (type === undefined) {
+ return 'undefined';
+ }
+ return type;
+ }
+ }, {
+ key: 'getSuggestion',
+ value: function getSuggestion(option, options, path) {
+ var localSearch = Validator.findInOptions(option, options, path, false);
+ var globalSearch = Validator.findInOptions(option, allOptions, [], true);
+
+ var localSearchThreshold = 8;
+ var globalSearchThreshold = 4;
+
+ if (localSearch.indexMatch !== undefined) {
+ console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was incomplete? Did you mean: "' + localSearch.indexMatch + '"?\n\n', printStyle);
+ } else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
+ console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch, ''), printStyle);
+ } else if (localSearch.distance <= localSearchThreshold) {
+ console.log('%cUnknown option detected: "' + option + '". Did you mean "' + localSearch.closestMatch + '"?' + Validator.printLocation(localSearch.path, option), printStyle);
+ } else {
+ console.log('%cUnknown option detected: "' + option + '". Did you mean one of these: ' + Validator.print(Object.keys(options)) + Validator.printLocation(path, option), printStyle);
+ }
+
+ errorFound = true;
+ }
+
+ /**
+ * traverse the options in search for a match.
+ * @param option
+ * @param options
+ * @param path
+ * @param recursive
+ * @returns {{closestMatch: string, path: Array, distance: number}}
+ */
+
+ }, {
+ key: 'findInOptions',
+ value: function findInOptions(option, options, path) {
+ var recursive = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ var min = 1e9;
+ var closestMatch = '';
+ var closestMatchPath = [];
+ var lowerCaseOption = option.toLowerCase();
+ var indexMatch = undefined;
+ for (var op in options) {
+ var distance = void 0;
+ if (options[op].__type__ !== undefined && recursive === true) {
+ var result = Validator.findInOptions(option, options[op], util.copyAndExtendArray(path, op));
+ if (min > result.distance) {
+ closestMatch = result.closestMatch;
+ closestMatchPath = result.path;
+ min = result.distance;
+ indexMatch = result.indexMatch;
+ }
+ } else {
+ if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {
+ indexMatch = op;
+ }
+ distance = Validator.levenshteinDistance(option, op);
+ if (min > distance) {
+ closestMatch = op;
+ closestMatchPath = util.copyArray(path);
+ min = distance;
+ }
+ }
+ }
+ return { closestMatch: closestMatch, path: closestMatchPath, distance: min, indexMatch: indexMatch };
+ }
+ }, {
+ key: 'printLocation',
+ value: function printLocation(path, option) {
+ var prefix = arguments.length <= 2 || arguments[2] === undefined ? 'Problem value found at: \n' : arguments[2];
+
+ var str = '\n\n' + prefix + 'options = {\n';
+ for (var i = 0; i < path.length; i++) {
+ for (var j = 0; j < i + 1; j++) {
+ str += ' ';
+ }
+ str += path[i] + ': {\n';
+ }
+ for (var _j = 0; _j < path.length + 1; _j++) {
+ str += ' ';
+ }
+ str += option + '\n';
+ for (var _i = 0; _i < path.length + 1; _i++) {
+ for (var _j2 = 0; _j2 < path.length - _i; _j2++) {
+ str += ' ';
+ }
+ str += '}\n';
+ }
+ return str + '\n\n';
+ }
+ }, {
+ key: 'print',
+ value: function print(options) {
+ return JSON.stringify(options).replace(/(\")|(\[)|(\])|(,"__type__")/g, "").replace(/(\,)/g, ', ');
+ }
+
+ // Compute the edit distance between the two given strings
+ // http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript
+ /*
+ Copyright (c) 2011 Andrei Mackenzie
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+ }, {
+ key: 'levenshteinDistance',
+ value: function levenshteinDistance(a, b) {
+ if (a.length === 0) return b.length;
+ if (b.length === 0) return a.length;
+
+ var matrix = [];
+
+ // increment along the first column of each row
+ var i;
+ for (i = 0; i <= b.length; i++) {
+ matrix[i] = [i];
+ }
+
+ // increment each column in the first row
+ var j;
+ for (j = 0; j <= a.length; j++) {
+ matrix[0][j] = j;
+ }
+
+ // Fill in the rest of the matrix
+ for (i = 1; i <= b.length; i++) {
+ for (j = 1; j <= a.length; j++) {
+ if (b.charAt(i - 1) == a.charAt(j - 1)) {
+ matrix[i][j] = matrix[i - 1][j - 1];
+ } else {
+ matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
+ Math.min(matrix[i][j - 1] + 1, // insertion
+ matrix[i - 1][j] + 1)); // deletion
+ }
+ }
+ }
+
+ return matrix[b.length][a.length];
+ }
+ }]);
+
+ return Validator;
+ }();
+
+ exports.default = Validator;
+ exports.printStyle = printStyle;
+
+/***/ },
+/* 30 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var util = __webpack_require__(1);
+ var hammerUtil = __webpack_require__(28);
+ var moment = __webpack_require__(2);
+ var Component = __webpack_require__(31);
+ var DateUtil = __webpack_require__(32);
+
+ /**
+ * @constructor Range
+ * A Range controls a numeric range with a start and end value.
+ * The Range adjusts the range based on mouse events or programmatic changes,
+ * and triggers events when the range is changing or has been changed.
+ * @param {{dom: Object, domProps: Object, emitter: Emitter}} body
+ * @param {Object} [options] See description at Range.setOptions
+ */
+ function Range(body, options) {
+ var now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);
+ this.start = now.clone().add(-3, 'days').valueOf(); // Number
+ this.end = now.clone().add(4, 'days').valueOf(); // Number
+
+ this.body = body;
+ this.deltaDifference = 0;
+ this.scaleOffset = 0;
+ this.startToFront = false;
+ this.endToFront = true;
+
+ // default options
+ this.defaultOptions = {
+ rtl: false,
+ start: null,
+ end: null,
+ moment: moment,
+ direction: 'horizontal', // 'horizontal' or 'vertical'
+ moveable: true,
+ zoomable: true,
+ min: null,
+ max: null,
+ zoomMin: 10, // milliseconds
+ zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000 // milliseconds
+ };
+ this.options = util.extend({}, this.defaultOptions);
+ this.props = {
+ touch: {}
+ };
+ this.animationTimer = null;
+
+ // drag listeners for dragging
+ this.body.emitter.on('panstart', this._onDragStart.bind(this));
+ this.body.emitter.on('panmove', this._onDrag.bind(this));
+ this.body.emitter.on('panend', this._onDragEnd.bind(this));
+
+ // mouse wheel for zooming
+ this.body.emitter.on('mousewheel', this._onMouseWheel.bind(this));
+
+ // pinch to zoom
+ this.body.emitter.on('touch', this._onTouch.bind(this));
+ this.body.emitter.on('pinch', this._onPinch.bind(this));
+
+ this.setOptions(options);
+ }
+
+ Range.prototype = new Component();
+
+ /**
+ * Set options for the range controller
+ * @param {Object} options Available options:
+ * {Number | Date | String} start Start date for the range
+ * {Number | Date | String} end End date for the range
+ * {Number} min Minimum value for start
+ * {Number} max Maximum value for end
+ * {Number} zoomMin Set a minimum value for
+ * (end - start).
+ * {Number} zoomMax Set a maximum value for
+ * (end - start).
+ * {Boolean} moveable Enable moving of the range
+ * by dragging. True by default
+ * {Boolean} zoomable Enable zooming of the range
+ * by pinching/scrolling. True by default
+ */
+ Range.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the options that we know
+ var fields = ['direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable', 'moment', 'activate', 'hiddenDates', 'zoomKey', 'rtl'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if ('start' in options || 'end' in options) {
+ // apply a new range. both start and end are optional
+ this.setRange(options.start, options.end);
+ }
+ }
+ };
+
+ /**
+ * Test whether direction has a valid value
+ * @param {String} direction 'horizontal' or 'vertical'
+ */
+ function validateDirection(direction) {
+ if (direction != 'horizontal' && direction != 'vertical') {
+ throw new TypeError('Unknown direction "' + direction + '". ' + 'Choose "horizontal" or "vertical".');
+ }
+ }
+
+ /**
+ * Set a new start and end range
+ * @param {Date | Number | String} [start]
+ * @param {Date | Number | String} [end]
+ * @param {boolean | {duration: number, easingFunction: string}} [animation=false]
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ * @param {Boolean} [byUser=false]
+ *
+ */
+ Range.prototype.setRange = function (start, end, animation, byUser) {
+ if (byUser !== true) {
+ byUser = false;
+ }
+ var finalStart = start != undefined ? util.convert(start, 'Date').valueOf() : null;
+ var finalEnd = end != undefined ? util.convert(end, 'Date').valueOf() : null;
+ this._cancelAnimation();
+
+ if (animation) {
+ // true or an Object
+ var me = this;
+ var initStart = this.start;
+ var initEnd = this.end;
+ var duration = (typeof animation === 'undefined' ? 'undefined' : _typeof(animation)) === 'object' && 'duration' in animation ? animation.duration : 500;
+ var easingName = (typeof animation === 'undefined' ? 'undefined' : _typeof(animation)) === 'object' && 'easingFunction' in animation ? animation.easingFunction : 'easeInOutQuad';
+ var easingFunction = util.easingFunctions[easingName];
+ if (!easingFunction) {
+ throw new Error('Unknown easing function ' + JSON.stringify(easingName) + '. ' + 'Choose from: ' + Object.keys(util.easingFunctions).join(', '));
+ }
+
+ var initTime = new Date().valueOf();
+ var anyChanged = false;
+
+ var next = function next() {
+ if (!me.props.touch.dragging) {
+ var now = new Date().valueOf();
+ var time = now - initTime;
+ var ease = easingFunction(time / duration);
+ var done = time > duration;
+ var s = done || finalStart === null ? finalStart : initStart + (finalStart - initStart) * ease;
+ var e = done || finalEnd === null ? finalEnd : initEnd + (finalEnd - initEnd) * ease;
+
+ changed = me._applyRange(s, e);
+ DateUtil.updateHiddenDates(me.options.moment, me.body, me.options.hiddenDates);
+ anyChanged = anyChanged || changed;
+ if (changed) {
+ me.body.emitter.emit('rangechange', { start: new Date(me.start), end: new Date(me.end), byUser: byUser });
+ }
+
+ if (done) {
+ if (anyChanged) {
+ me.body.emitter.emit('rangechanged', { start: new Date(me.start), end: new Date(me.end), byUser: byUser });
+ }
+ } else {
+ // animate with as high as possible frame rate, leave 20 ms in between
+ // each to prevent the browser from blocking
+ me.animationTimer = setTimeout(next, 20);
+ }
+ }
+ };
+
+ return next();
+ } else {
+ var changed = this._applyRange(finalStart, finalEnd);
+ DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);
+ if (changed) {
+ var params = { start: new Date(this.start), end: new Date(this.end), byUser: byUser };
+ this.body.emitter.emit('rangechange', params);
+ this.body.emitter.emit('rangechanged', params);
+ }
+ }
+ };
+
+ /**
+ * Stop an animation
+ * @private
+ */
+ Range.prototype._cancelAnimation = function () {
+ if (this.animationTimer) {
+ clearTimeout(this.animationTimer);
+ this.animationTimer = null;
+ }
+ };
+
+ /**
+ * Set a new start and end range. This method is the same as setRange, but
+ * does not trigger a range change and range changed event, and it returns
+ * true when the range is changed
+ * @param {Number} [start]
+ * @param {Number} [end]
+ * @return {Boolean} changed
+ * @private
+ */
+ Range.prototype._applyRange = function (start, end) {
+ var newStart = start != null ? util.convert(start, 'Date').valueOf() : this.start,
+ newEnd = end != null ? util.convert(end, 'Date').valueOf() : this.end,
+ max = this.options.max != null ? util.convert(this.options.max, 'Date').valueOf() : null,
+ min = this.options.min != null ? util.convert(this.options.min, 'Date').valueOf() : null,
+ diff;
+
+ // check for valid number
+ if (isNaN(newStart) || newStart === null) {
+ throw new Error('Invalid start "' + start + '"');
+ }
+ if (isNaN(newEnd) || newEnd === null) {
+ throw new Error('Invalid end "' + end + '"');
+ }
+
+ // prevent start < end
+ if (newEnd < newStart) {
+ newEnd = newStart;
+ }
+
+ // prevent start < min
+ if (min !== null) {
+ if (newStart < min) {
+ diff = min - newStart;
+ newStart += diff;
+ newEnd += diff;
+
+ // prevent end > max
+ if (max != null) {
+ if (newEnd > max) {
+ newEnd = max;
+ }
+ }
+ }
+ }
+
+ // prevent end > max
+ if (max !== null) {
+ if (newEnd > max) {
+ diff = newEnd - max;
+ newStart -= diff;
+ newEnd -= diff;
+
+ // prevent start < min
+ if (min != null) {
+ if (newStart < min) {
+ newStart = min;
+ }
+ }
+ }
+ }
+
+ // prevent (end-start) < zoomMin
+ if (this.options.zoomMin !== null) {
+ var zoomMin = parseFloat(this.options.zoomMin);
+ if (zoomMin < 0) {
+ zoomMin = 0;
+ }
+ if (newEnd - newStart < zoomMin) {
+ if (this.end - this.start === zoomMin && newStart > this.start && newEnd < this.end) {
+ // ignore this action, we are already zoomed to the minimum
+ newStart = this.start;
+ newEnd = this.end;
+ } else {
+ // zoom to the minimum
+ diff = zoomMin - (newEnd - newStart);
+ newStart -= diff / 2;
+ newEnd += diff / 2;
+ }
+ }
+ }
+
+ // prevent (end-start) > zoomMax
+ if (this.options.zoomMax !== null) {
+ var zoomMax = parseFloat(this.options.zoomMax);
+ if (zoomMax < 0) {
+ zoomMax = 0;
+ }
+
+ if (newEnd - newStart > zoomMax) {
+ if (this.end - this.start === zoomMax && newStart < this.start && newEnd > this.end) {
+ // ignore this action, we are already zoomed to the maximum
+ newStart = this.start;
+ newEnd = this.end;
+ } else {
+ // zoom to the maximum
+ diff = newEnd - newStart - zoomMax;
+ newStart += diff / 2;
+ newEnd -= diff / 2;
+ }
+ }
+ }
+
+ var changed = this.start != newStart || this.end != newEnd;
+
+ // if the new range does NOT overlap with the old range, emit checkRangedItems to avoid not showing ranged items (ranged meaning has end time, not necessarily of type Range)
+ if (!(newStart >= this.start && newStart <= this.end || newEnd >= this.start && newEnd <= this.end) && !(this.start >= newStart && this.start <= newEnd || this.end >= newStart && this.end <= newEnd)) {
+ this.body.emitter.emit('checkRangedItems');
+ }
+
+ this.start = newStart;
+ this.end = newEnd;
+ return changed;
+ };
+
+ /**
+ * Retrieve the current range.
+ * @return {Object} An object with start and end properties
+ */
+ Range.prototype.getRange = function () {
+ return {
+ start: this.start,
+ end: this.end
+ };
+ };
+
+ /**
+ * Calculate the conversion offset and scale for current range, based on
+ * the provided width
+ * @param {Number} width
+ * @returns {{offset: number, scale: number}} conversion
+ */
+ Range.prototype.conversion = function (width, totalHidden) {
+ return Range.conversion(this.start, this.end, width, totalHidden);
+ };
+
+ /**
+ * Static method to calculate the conversion offset and scale for a range,
+ * based on the provided start, end, and width
+ * @param {Number} start
+ * @param {Number} end
+ * @param {Number} width
+ * @returns {{offset: number, scale: number}} conversion
+ */
+ Range.conversion = function (start, end, width, totalHidden) {
+ if (totalHidden === undefined) {
+ totalHidden = 0;
+ }
+ if (width != 0 && end - start != 0) {
+ return {
+ offset: start,
+ scale: width / (end - start - totalHidden)
+ };
+ } else {
+ return {
+ offset: 0,
+ scale: 1
+ };
+ }
+ };
+
+ /**
+ * Start dragging horizontally or vertically
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onDragStart = function (event) {
+ this.deltaDifference = 0;
+ this.previousDelta = 0;
+
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+
+ // only start dragging when the mouse is inside the current range
+ if (!this._isInsideRange(event)) return;
+
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ this.props.touch.start = this.start;
+ this.props.touch.end = this.end;
+ this.props.touch.dragging = true;
+
+ if (this.body.dom.root) {
+ this.body.dom.root.style.cursor = 'move';
+ }
+ };
+
+ /**
+ * Perform dragging operation
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onDrag = function (event) {
+ if (!this.props.touch.dragging) return;
+
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+
+ // TODO: this may be redundant in hammerjs2
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ var direction = this.options.direction;
+ validateDirection(direction);
+ var delta = direction == 'horizontal' ? event.deltaX : event.deltaY;
+ delta -= this.deltaDifference;
+ var interval = this.props.touch.end - this.props.touch.start;
+
+ // normalize dragging speed if cutout is in between.
+ var duration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);
+ interval -= duration;
+
+ var width = direction == 'horizontal' ? this.body.domProps.center.width : this.body.domProps.center.height;
+
+ if (this.options.rtl) {
+ var diffRange = delta / width * interval;
+ } else {
+ var diffRange = -delta / width * interval;
+ }
+
+ var newStart = this.props.touch.start + diffRange;
+ var newEnd = this.props.touch.end + diffRange;
+
+ // snapping times away from hidden zones
+ var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, this.previousDelta - delta, true);
+ var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, this.previousDelta - delta, true);
+ if (safeStart != newStart || safeEnd != newEnd) {
+ this.deltaDifference += delta;
+ this.props.touch.start = safeStart;
+ this.props.touch.end = safeEnd;
+ this._onDrag(event);
+ return;
+ }
+
+ this.previousDelta = delta;
+ this._applyRange(newStart, newEnd);
+
+ var startDate = new Date(this.start);
+ var endDate = new Date(this.end);
+
+ // fire a rangechange event
+ this.body.emitter.emit('rangechange', {
+ start: startDate,
+ end: endDate,
+ byUser: true
+ });
+ };
+
+ /**
+ * Stop dragging operation
+ * @param {event} event
+ * @private
+ */
+ Range.prototype._onDragEnd = function (event) {
+ if (!this.props.touch.dragging) return;
+
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+
+ // TODO: this may be redundant in hammerjs2
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ this.props.touch.dragging = false;
+ if (this.body.dom.root) {
+ this.body.dom.root.style.cursor = 'auto';
+ }
+
+ // fire a rangechanged event
+ this.body.emitter.emit('rangechanged', {
+ start: new Date(this.start),
+ end: new Date(this.end),
+ byUser: true
+ });
+ };
+
+ /**
+ * Event handler for mouse wheel event, used to zoom
+ * Code from http://adomas.org/javascript-mouse-wheel/
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onMouseWheel = function (event) {
+ // only allow zooming when configured as zoomable and moveable
+ if (!(this.options.zoomable && this.options.moveable)) return;
+
+ // only zoom when the mouse is inside the current range
+ if (!this._isInsideRange(event)) return;
+
+ // only zoom when the according key is pressed and the zoomKey option is set
+ if (this.options.zoomKey && !event[this.options.zoomKey]) return;
+
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) {
+ /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) {
+ /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta) {
+ // perform the zoom action. Delta is normally 1 or -1
+
+ // adjust a negative delta such that zooming in with delta 0.1
+ // equals zooming out with a delta -0.1
+ var scale;
+ if (delta < 0) {
+ scale = 1 - delta / 5;
+ } else {
+ scale = 1 / (1 + delta / 5);
+ }
+
+ // calculate center, the date to zoom around
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY }, this.body.dom.center);
+ var pointerDate = this._pointerToDate(pointer);
+
+ this.zoom(scale, pointerDate, delta);
+ }
+
+ // Prevent default actions caused by mouse wheel
+ // (else the page and timeline both zoom and scroll)
+ event.preventDefault();
+ };
+
+ /**
+ * Start of a touch gesture
+ * @private
+ */
+ Range.prototype._onTouch = function (event) {
+ this.props.touch.start = this.start;
+ this.props.touch.end = this.end;
+ this.props.touch.allowDragging = true;
+ this.props.touch.center = null;
+ this.scaleOffset = 0;
+ this.deltaDifference = 0;
+ };
+
+ /**
+ * Handle pinch event
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onPinch = function (event) {
+ // only allow zooming when configured as zoomable and moveable
+ if (!(this.options.zoomable && this.options.moveable)) return;
+
+ this.props.touch.allowDragging = false;
+
+ if (!this.props.touch.center) {
+ this.props.touch.center = this.getPointer(event.center, this.body.dom.center);
+ }
+
+ var scale = 1 / (event.scale + this.scaleOffset);
+ var centerDate = this._pointerToDate(this.props.touch.center);
+
+ var hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);
+ var hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, centerDate);
+ var hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;
+
+ // calculate new start and end
+ var newStart = centerDate - hiddenDurationBefore + (this.props.touch.start - (centerDate - hiddenDurationBefore)) * scale;
+ var newEnd = centerDate + hiddenDurationAfter + (this.props.touch.end - (centerDate + hiddenDurationAfter)) * scale;
+
+ // snapping times away from hidden zones
+ this.startToFront = 1 - scale <= 0; // used to do the right auto correction with periodic hidden times
+ this.endToFront = scale - 1 <= 0; // used to do the right auto correction with periodic hidden times
+
+ var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, 1 - scale, true);
+ var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, scale - 1, true);
+ if (safeStart != newStart || safeEnd != newEnd) {
+ this.props.touch.start = safeStart;
+ this.props.touch.end = safeEnd;
+ this.scaleOffset = 1 - event.scale;
+ newStart = safeStart;
+ newEnd = safeEnd;
+ }
+
+ this.setRange(newStart, newEnd, false, true);
+
+ this.startToFront = false; // revert to default
+ this.endToFront = true; // revert to default
+ };
+
+ /**
+ * Test whether the mouse from a mouse event is inside the visible window,
+ * between the current start and end date
+ * @param {Object} event
+ * @return {boolean} Returns true when inside the visible window
+ * @private
+ */
+ Range.prototype._isInsideRange = function (event) {
+ // calculate the time where the mouse is, check whether inside
+ // and no scroll action should happen.
+ var clientX = event.center ? event.center.x : event.clientX;
+ if (this.options.rtl) {
+ var x = clientX - util.getAbsoluteLeft(this.body.dom.centerContainer);
+ } else {
+ var x = util.getAbsoluteRight(this.body.dom.centerContainer) - clientX;
+ }
+ var time = this.body.util.toTime(x);
+
+ return time >= this.start && time <= this.end;
+ };
+
+ /**
+ * Helper function to calculate the center date for zooming
+ * @param {{x: Number, y: Number}} pointer
+ * @return {number} date
+ * @private
+ */
+ Range.prototype._pointerToDate = function (pointer) {
+ var conversion;
+ var direction = this.options.direction;
+
+ validateDirection(direction);
+
+ if (direction == 'horizontal') {
+ return this.body.util.toTime(pointer.x).valueOf();
+ } else {
+ var height = this.body.domProps.center.height;
+ conversion = this.conversion(height);
+ return pointer.y / conversion.scale + conversion.offset;
+ }
+ };
+
+ /**
+ * Get the pointer location relative to the location of the dom element
+ * @param {{x: Number, y: Number}} touch
+ * @param {Element} element HTML DOM element
+ * @return {{x: Number, y: Number}} pointer
+ * @private
+ */
+ Range.prototype.getPointer = function (touch, element) {
+ if (this.options.rtl) {
+ return {
+ x: util.getAbsoluteRight(element) - touch.x,
+ y: touch.y - util.getAbsoluteTop(element)
+ };
+ } else {
+ return {
+ x: touch.x - util.getAbsoluteLeft(element),
+ y: touch.y - util.getAbsoluteTop(element)
+ };
+ }
+ };
+
+ /**
+ * Zoom the range the given scale in or out. Start and end date will
+ * be adjusted, and the timeline will be redrawn. You can optionally give a
+ * date around which to zoom.
+ * For example, try scale = 0.9 or 1.1
+ * @param {Number} scale Scaling factor. Values above 1 will zoom out,
+ * values below 1 will zoom in.
+ * @param {Number} [center] Value representing a date around which will
+ * be zoomed.
+ */
+ Range.prototype.zoom = function (scale, center, delta) {
+ // if centerDate is not provided, take it half between start Date and end Date
+ if (center == null) {
+ center = (this.start + this.end) / 2;
+ }
+
+ var hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);
+ var hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, center);
+ var hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;
+
+ // calculate new start and end
+ var newStart = center - hiddenDurationBefore + (this.start - (center - hiddenDurationBefore)) * scale;
+ var newEnd = center + hiddenDurationAfter + (this.end - (center + hiddenDurationAfter)) * scale;
+
+ // snapping times away from hidden zones
+ this.startToFront = delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times
+ this.endToFront = -delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times
+ var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, delta, true);
+ var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, -delta, true);
+ if (safeStart != newStart || safeEnd != newEnd) {
+ newStart = safeStart;
+ newEnd = safeEnd;
+ }
+
+ this.setRange(newStart, newEnd, false, true);
+
+ this.startToFront = false; // revert to default
+ this.endToFront = true; // revert to default
+ };
+
+ /**
+ * Move the range with a given delta to the left or right. Start and end
+ * value will be adjusted. For example, try delta = 0.1 or -0.1
+ * @param {Number} delta Moving amount. Positive value will move right,
+ * negative value will move left
+ */
+ Range.prototype.move = function (delta) {
+ // zoom start Date and end Date relative to the centerDate
+ var diff = this.end - this.start;
+
+ // apply new values
+ var newStart = this.start + diff * delta;
+ var newEnd = this.end + diff * delta;
+
+ // TODO: reckon with min and max range
+
+ this.start = newStart;
+ this.end = newEnd;
+ };
+
+ /**
+ * Move the range to a new center point
+ * @param {Number} moveTo New center point of the range
+ */
+ Range.prototype.moveTo = function (moveTo) {
+ var center = (this.start + this.end) / 2;
+
+ var diff = center - moveTo;
+
+ // calculate new start and end
+ var newStart = this.start - diff;
+ var newEnd = this.end - diff;
+
+ this.setRange(newStart, newEnd);
+ };
+
+ module.exports = Range;
+
+/***/ },
+/* 31 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ /**
+ * Prototype for visual components
+ * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} [body]
+ * @param {Object} [options]
+ */
+ function Component(body, options) {
+ this.options = null;
+ this.props = null;
+ }
+
+ /**
+ * Set options for the component. The new options will be merged into the
+ * current options.
+ * @param {Object} options
+ */
+ Component.prototype.setOptions = function (options) {
+ if (options) {
+ util.extend(this.options, options);
+ }
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ Component.prototype.redraw = function () {
+ // should be implemented by the component
+ return false;
+ };
+
+ /**
+ * Destroy the component. Cleanup DOM and event listeners
+ */
+ Component.prototype.destroy = function () {
+ // should be implemented by the component
+ };
+
+ /**
+ * Test whether the component is resized since the last time _isResized() was
+ * called.
+ * @return {Boolean} Returns true if the component is resized
+ * @protected
+ */
+ Component.prototype._isResized = function () {
+ var resized = this.props._previousWidth !== this.props.width || this.props._previousHeight !== this.props.height;
+
+ this.props._previousWidth = this.props.width;
+ this.props._previousHeight = this.props.height;
+
+ return resized;
+ };
+
+ module.exports = Component;
+
+/***/ },
+/* 32 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ /**
+ * used in Core to convert the options into a volatile variable
+ *
+ * @param {function} moment
+ * @param {Object} body
+ * @param {Array | Object} hiddenDates
+ */
+ exports.convertHiddenOptions = function (moment, body, hiddenDates) {
+ if (hiddenDates && !Array.isArray(hiddenDates)) {
+ return exports.convertHiddenOptions(moment, body, [hiddenDates]);
+ }
+
+ body.hiddenDates = [];
+ if (hiddenDates) {
+ if (Array.isArray(hiddenDates) == true) {
+ for (var i = 0; i < hiddenDates.length; i++) {
+ if (hiddenDates[i].repeat === undefined) {
+ var dateItem = {};
+ dateItem.start = moment(hiddenDates[i].start).toDate().valueOf();
+ dateItem.end = moment(hiddenDates[i].end).toDate().valueOf();
+ body.hiddenDates.push(dateItem);
+ }
+ }
+ body.hiddenDates.sort(function (a, b) {
+ return a.start - b.start;
+ }); // sort by start time
+ }
+ }
+ };
+
+ /**
+ * create new entrees for the repeating hidden dates
+ * @param {function} moment
+ * @param {Object} body
+ * @param {Array | Object} hiddenDates
+ */
+ exports.updateHiddenDates = function (moment, body, hiddenDates) {
+ if (hiddenDates && !Array.isArray(hiddenDates)) {
+ return exports.updateHiddenDates(moment, body, [hiddenDates]);
+ }
+
+ if (hiddenDates && body.domProps.centerContainer.width !== undefined) {
+ exports.convertHiddenOptions(moment, body, hiddenDates);
+
+ var start = moment(body.range.start);
+ var end = moment(body.range.end);
+
+ var totalRange = body.range.end - body.range.start;
+ var pixelTime = totalRange / body.domProps.centerContainer.width;
+
+ for (var i = 0; i < hiddenDates.length; i++) {
+ if (hiddenDates[i].repeat !== undefined) {
+ var startDate = moment(hiddenDates[i].start);
+ var endDate = moment(hiddenDates[i].end);
+
+ if (startDate._d == "Invalid Date") {
+ throw new Error("Supplied start date is not valid: " + hiddenDates[i].start);
+ }
+ if (endDate._d == "Invalid Date") {
+ throw new Error("Supplied end date is not valid: " + hiddenDates[i].end);
+ }
+
+ var duration = endDate - startDate;
+ if (duration >= 4 * pixelTime) {
+
+ var offset = 0;
+ var runUntil = end.clone();
+ switch (hiddenDates[i].repeat) {
+ case "daily":
+ // case of time
+ if (startDate.day() != endDate.day()) {
+ offset = 1;
+ }
+ startDate.dayOfYear(start.dayOfYear());
+ startDate.year(start.year());
+ startDate.subtract(7, 'days');
+
+ endDate.dayOfYear(start.dayOfYear());
+ endDate.year(start.year());
+ endDate.subtract(7 - offset, 'days');
+
+ runUntil.add(1, 'weeks');
+ break;
+ case "weekly":
+ var dayOffset = endDate.diff(startDate, 'days');
+ var day = startDate.day();
+
+ // set the start date to the range.start
+ startDate.date(start.date());
+ startDate.month(start.month());
+ startDate.year(start.year());
+ endDate = startDate.clone();
+
+ // force
+ startDate.day(day);
+ endDate.day(day);
+ endDate.add(dayOffset, 'days');
+
+ startDate.subtract(1, 'weeks');
+ endDate.subtract(1, 'weeks');
+
+ runUntil.add(1, 'weeks');
+ break;
+ case "monthly":
+ if (startDate.month() != endDate.month()) {
+ offset = 1;
+ }
+ startDate.month(start.month());
+ startDate.year(start.year());
+ startDate.subtract(1, 'months');
+
+ endDate.month(start.month());
+ endDate.year(start.year());
+ endDate.subtract(1, 'months');
+ endDate.add(offset, 'months');
+
+ runUntil.add(1, 'months');
+ break;
+ case "yearly":
+ if (startDate.year() != endDate.year()) {
+ offset = 1;
+ }
+ startDate.year(start.year());
+ startDate.subtract(1, 'years');
+ endDate.year(start.year());
+ endDate.subtract(1, 'years');
+ endDate.add(offset, 'years');
+
+ runUntil.add(1, 'years');
+ break;
+ default:
+ console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:", hiddenDates[i].repeat);
+ return;
+ }
+ while (startDate < runUntil) {
+ body.hiddenDates.push({ start: startDate.valueOf(), end: endDate.valueOf() });
+ switch (hiddenDates[i].repeat) {
+ case "daily":
+ startDate.add(1, 'days');
+ endDate.add(1, 'days');
+ break;
+ case "weekly":
+ startDate.add(1, 'weeks');
+ endDate.add(1, 'weeks');
+ break;
+ case "monthly":
+ startDate.add(1, 'months');
+ endDate.add(1, 'months');
+ break;
+ case "yearly":
+ startDate.add(1, 'y');
+ endDate.add(1, 'y');
+ break;
+ default:
+ console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:", hiddenDates[i].repeat);
+ return;
+ }
+ }
+ body.hiddenDates.push({ start: startDate.valueOf(), end: endDate.valueOf() });
+ }
+ }
+ }
+ // remove duplicates, merge where possible
+ exports.removeDuplicates(body);
+ // ensure the new positions are not on hidden dates
+ var startHidden = exports.isHidden(body.range.start, body.hiddenDates);
+ var endHidden = exports.isHidden(body.range.end, body.hiddenDates);
+ var rangeStart = body.range.start;
+ var rangeEnd = body.range.end;
+ if (startHidden.hidden == true) {
+ rangeStart = body.range.startToFront == true ? startHidden.startDate - 1 : startHidden.endDate + 1;
+ }
+ if (endHidden.hidden == true) {
+ rangeEnd = body.range.endToFront == true ? endHidden.startDate - 1 : endHidden.endDate + 1;
+ }
+ if (startHidden.hidden == true || endHidden.hidden == true) {
+ body.range._applyRange(rangeStart, rangeEnd);
+ }
+ }
+ };
+
+ /**
+ * remove duplicates from the hidden dates list. Duplicates are evil. They mess everything up.
+ * Scales with N^2
+ * @param body
+ */
+ exports.removeDuplicates = function (body) {
+ var hiddenDates = body.hiddenDates;
+ var safeDates = [];
+ for (var i = 0; i < hiddenDates.length; i++) {
+ for (var j = 0; j < hiddenDates.length; j++) {
+ if (i != j && hiddenDates[j].remove != true && hiddenDates[i].remove != true) {
+ // j inside i
+ if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {
+ hiddenDates[j].remove = true;
+ }
+ // j start inside i
+ else if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].start <= hiddenDates[i].end) {
+ hiddenDates[i].end = hiddenDates[j].end;
+ hiddenDates[j].remove = true;
+ }
+ // j end inside i
+ else if (hiddenDates[j].end >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {
+ hiddenDates[i].start = hiddenDates[j].start;
+ hiddenDates[j].remove = true;
+ }
+ }
+ }
+ }
+
+ for (var i = 0; i < hiddenDates.length; i++) {
+ if (hiddenDates[i].remove !== true) {
+ safeDates.push(hiddenDates[i]);
+ }
+ }
+
+ body.hiddenDates = safeDates;
+ body.hiddenDates.sort(function (a, b) {
+ return a.start - b.start;
+ }); // sort by start time
+ };
+
+ exports.printDates = function (dates) {
+ for (var i = 0; i < dates.length; i++) {
+ console.log(i, new Date(dates[i].start), new Date(dates[i].end), dates[i].start, dates[i].end, dates[i].remove);
+ }
+ };
+
+ /**
+ * Used in TimeStep to avoid the hidden times.
+ * @param {function} moment
+ * @param {TimeStep} timeStep
+ * @param previousTime
+ */
+ exports.stepOverHiddenDates = function (moment, timeStep, previousTime) {
+ var stepInHidden = false;
+ var currentValue = timeStep.current.valueOf();
+ for (var i = 0; i < timeStep.hiddenDates.length; i++) {
+ var startDate = timeStep.hiddenDates[i].start;
+ var endDate = timeStep.hiddenDates[i].end;
+ if (currentValue >= startDate && currentValue < endDate) {
+ stepInHidden = true;
+ break;
+ }
+ }
+
+ if (stepInHidden == true && currentValue < timeStep._end.valueOf() && currentValue != previousTime) {
+ var prevValue = moment(previousTime);
+ var newValue = moment(endDate);
+ //check if the next step should be major
+ if (prevValue.year() != newValue.year()) {
+ timeStep.switchedYear = true;
+ } else if (prevValue.month() != newValue.month()) {
+ timeStep.switchedMonth = true;
+ } else if (prevValue.dayOfYear() != newValue.dayOfYear()) {
+ timeStep.switchedDay = true;
+ }
+
+ timeStep.current = newValue;
+ }
+ };
+
+ ///**
+ // * Used in TimeStep to avoid the hidden times.
+ // * @param timeStep
+ // * @param previousTime
+ // */
+ //exports.checkFirstStep = function(timeStep) {
+ // var stepInHidden = false;
+ // var currentValue = timeStep.current.valueOf();
+ // for (var i = 0; i < timeStep.hiddenDates.length; i++) {
+ // var startDate = timeStep.hiddenDates[i].start;
+ // var endDate = timeStep.hiddenDates[i].end;
+ // if (currentValue >= startDate && currentValue < endDate) {
+ // stepInHidden = true;
+ // break;
+ // }
+ // }
+ //
+ // if (stepInHidden == true && currentValue <= timeStep._end.valueOf()) {
+ // var newValue = moment(endDate);
+ // timeStep.current = newValue.toDate();
+ // }
+ //};
+
+ /**
+ * replaces the Core toScreen methods
+ * @param Core
+ * @param time
+ * @param width
+ * @returns {number}
+ */
+ exports.toScreen = function (Core, time, width) {
+ if (Core.body.hiddenDates.length == 0) {
+ var conversion = Core.range.conversion(width);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
+ } else {
+ var hidden = exports.isHidden(time, Core.body.hiddenDates);
+ if (hidden.hidden == true) {
+ time = hidden.startDate;
+ }
+
+ var duration = exports.getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);
+ time = exports.correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, Core.range, time);
+
+ var conversion = Core.range.conversion(width, duration);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
+ }
+ };
+
+ /**
+ * Replaces the core toTime methods
+ * @param body
+ * @param range
+ * @param x
+ * @param width
+ * @returns {Date}
+ */
+ exports.toTime = function (Core, x, width) {
+ if (Core.body.hiddenDates.length == 0) {
+ var conversion = Core.range.conversion(width);
+ return new Date(x / conversion.scale + conversion.offset);
+ } else {
+ var hiddenDuration = exports.getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);
+ var totalDuration = Core.range.end - Core.range.start - hiddenDuration;
+ var partialDuration = totalDuration * x / width;
+ var accumulatedHiddenDuration = exports.getAccumulatedHiddenDuration(Core.body.hiddenDates, Core.range, partialDuration);
+
+ var newTime = new Date(accumulatedHiddenDuration + partialDuration + Core.range.start);
+ return newTime;
+ }
+ };
+
+ /**
+ * Support function
+ *
+ * @param hiddenDates
+ * @param range
+ * @returns {number}
+ */
+ exports.getHiddenDurationBetween = function (hiddenDates, start, end) {
+ var duration = 0;
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+ // if time after the cutout, and the
+ if (startDate >= start && endDate < end) {
+ duration += endDate - startDate;
+ }
+ }
+ return duration;
+ };
+
+ /**
+ * Support function
+ * @param moment
+ * @param hiddenDates
+ * @param range
+ * @param time
+ * @returns {{duration: number, time: *, offset: number}}
+ */
+ exports.correctTimeForHidden = function (moment, hiddenDates, range, time) {
+ time = moment(time).toDate().valueOf();
+ time -= exports.getHiddenDurationBefore(moment, hiddenDates, range, time);
+ return time;
+ };
+
+ exports.getHiddenDurationBefore = function (moment, hiddenDates, range, time) {
+ var timeOffset = 0;
+ time = moment(time).toDate().valueOf();
+
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+ // if time after the cutout, and the
+ if (startDate >= range.start && endDate < range.end) {
+ if (time >= endDate) {
+ timeOffset += endDate - startDate;
+ }
+ }
+ }
+ return timeOffset;
+ };
+
+ /**
+ * sum the duration from start to finish, including the hidden duration,
+ * until the required amount has been reached, return the accumulated hidden duration
+ * @param hiddenDates
+ * @param range
+ * @param time
+ * @returns {{duration: number, time: *, offset: number}}
+ */
+ exports.getAccumulatedHiddenDuration = function (hiddenDates, range, requiredDuration) {
+ var hiddenDuration = 0;
+ var duration = 0;
+ var previousPoint = range.start;
+ //exports.printDates(hiddenDates)
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+ // if time after the cutout, and the
+ if (startDate >= range.start && endDate < range.end) {
+ duration += startDate - previousPoint;
+ previousPoint = endDate;
+ if (duration >= requiredDuration) {
+ break;
+ } else {
+ hiddenDuration += endDate - startDate;
+ }
+ }
+ }
+
+ return hiddenDuration;
+ };
+
+ /**
+ * used to step over to either side of a hidden block. Correction is disabled on tablets, might be set to true
+ * @param hiddenDates
+ * @param time
+ * @param direction
+ * @param correctionEnabled
+ * @returns {*}
+ */
+ exports.snapAwayFromHidden = function (hiddenDates, time, direction, correctionEnabled) {
+ var isHidden = exports.isHidden(time, hiddenDates);
+ if (isHidden.hidden == true) {
+ if (direction < 0) {
+ if (correctionEnabled == true) {
+ return isHidden.startDate - (isHidden.endDate - time) - 1;
+ } else {
+ return isHidden.startDate - 1;
+ }
+ } else {
+ if (correctionEnabled == true) {
+ return isHidden.endDate + (time - isHidden.startDate) + 1;
+ } else {
+ return isHidden.endDate + 1;
+ }
+ }
+ } else {
+ return time;
+ }
+ };
+
+ /**
+ * Check if a time is hidden
+ *
+ * @param time
+ * @param hiddenDates
+ * @returns {{hidden: boolean, startDate: Window.start, endDate: *}}
+ */
+ exports.isHidden = function (time, hiddenDates) {
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+
+ if (time >= startDate && time < endDate) {
+ // if the start is entering a hidden zone
+ return { hidden: true, startDate: startDate, endDate: endDate };
+ break;
+ }
+ }
+ return { hidden: false, startDate: startDate, endDate: endDate };
+ };
+
+/***/ },
+/* 33 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var Emitter = __webpack_require__(13);
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(28);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var Range = __webpack_require__(30);
+ var ItemSet = __webpack_require__(34);
+ var TimeAxis = __webpack_require__(44);
+ var Activator = __webpack_require__(45);
+ var DateUtil = __webpack_require__(32);
+ var CustomTime = __webpack_require__(46);
+
+ /**
+ * Create a timeline visualization
+ * @constructor
+ */
+ function Core() {}
+
+ // turn Core into an event emitter
+ Emitter(Core.prototype);
+
+ /**
+ * Create the main DOM for the Core: a root panel containing left, right,
+ * top, bottom, content, and background panel.
+ * @param {Element} container The container element where the Core will
+ * be attached.
+ * @protected
+ */
+ Core.prototype._create = function (container) {
+ this.dom = {};
+
+ this.dom.container = container;
+
+ this.dom.root = document.createElement('div');
+ this.dom.background = document.createElement('div');
+ this.dom.backgroundVertical = document.createElement('div');
+ this.dom.backgroundHorizontal = document.createElement('div');
+ this.dom.centerContainer = document.createElement('div');
+ this.dom.leftContainer = document.createElement('div');
+ this.dom.rightContainer = document.createElement('div');
+ this.dom.center = document.createElement('div');
+ this.dom.left = document.createElement('div');
+ this.dom.right = document.createElement('div');
+ this.dom.top = document.createElement('div');
+ this.dom.bottom = document.createElement('div');
+ this.dom.shadowTop = document.createElement('div');
+ this.dom.shadowBottom = document.createElement('div');
+ this.dom.shadowTopLeft = document.createElement('div');
+ this.dom.shadowBottomLeft = document.createElement('div');
+ this.dom.shadowTopRight = document.createElement('div');
+ this.dom.shadowBottomRight = document.createElement('div');
+
+ this.dom.root.className = 'vis-timeline';
+ this.dom.background.className = 'vis-panel vis-background';
+ this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical';
+ this.dom.backgroundHorizontal.className = 'vis-panel vis-background vis-horizontal';
+ this.dom.centerContainer.className = 'vis-panel vis-center';
+ this.dom.leftContainer.className = 'vis-panel vis-left';
+ this.dom.rightContainer.className = 'vis-panel vis-right';
+ this.dom.top.className = 'vis-panel vis-top';
+ this.dom.bottom.className = 'vis-panel vis-bottom';
+ this.dom.left.className = 'vis-content';
+ this.dom.center.className = 'vis-content';
+ this.dom.right.className = 'vis-content';
+ this.dom.shadowTop.className = 'vis-shadow vis-top';
+ this.dom.shadowBottom.className = 'vis-shadow vis-bottom';
+ this.dom.shadowTopLeft.className = 'vis-shadow vis-top';
+ this.dom.shadowBottomLeft.className = 'vis-shadow vis-bottom';
+ this.dom.shadowTopRight.className = 'vis-shadow vis-top';
+ this.dom.shadowBottomRight.className = 'vis-shadow vis-bottom';
+
+ this.dom.root.appendChild(this.dom.background);
+ this.dom.root.appendChild(this.dom.backgroundVertical);
+ this.dom.root.appendChild(this.dom.backgroundHorizontal);
+ this.dom.root.appendChild(this.dom.centerContainer);
+ this.dom.root.appendChild(this.dom.leftContainer);
+ this.dom.root.appendChild(this.dom.rightContainer);
+ this.dom.root.appendChild(this.dom.top);
+ this.dom.root.appendChild(this.dom.bottom);
+
+ this.dom.centerContainer.appendChild(this.dom.center);
+ this.dom.leftContainer.appendChild(this.dom.left);
+ this.dom.rightContainer.appendChild(this.dom.right);
+
+ this.dom.centerContainer.appendChild(this.dom.shadowTop);
+ this.dom.centerContainer.appendChild(this.dom.shadowBottom);
+ this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);
+ this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);
+ this.dom.rightContainer.appendChild(this.dom.shadowTopRight);
+ this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);
+
+ this.on('rangechange', function () {
+ if (this.initialDrawDone === true) {
+ this._redraw(); // this allows overriding the _redraw method
+ }
+ }.bind(this));
+ this.on('touch', this._onTouch.bind(this));
+ this.on('pan', this._onDrag.bind(this));
+
+ var me = this;
+ this.on('_change', function (properties) {
+ if (properties && properties.queue == true) {
+ // redraw once on next tick
+ if (!me._redrawTimer) {
+ me._redrawTimer = setTimeout(function () {
+ me._redrawTimer = null;
+ me._redraw();
+ }, 0);
+ }
+ } else {
+ // redraw immediately
+ me._redraw();
+ }
+ });
+
+ // create event listeners for all interesting events, these events will be
+ // emitted via emitter
+ this.hammer = new Hammer(this.dom.root);
+ var pinchRecognizer = this.hammer.get('pinch').set({ enable: true });
+ hammerUtil.disablePreventDefaultVertically(pinchRecognizer);
+ this.hammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_HORIZONTAL });
+ this.listeners = {};
+
+ var events = ['tap', 'doubletap', 'press', 'pinch', 'pan', 'panstart', 'panmove', 'panend'
+ // TODO: cleanup
+ //'touch', 'pinch',
+ //'tap', 'doubletap', 'hold',
+ //'dragstart', 'drag', 'dragend',
+ //'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
+ ];
+ events.forEach(function (type) {
+ var listener = function listener(event) {
+ if (me.isActive()) {
+ me.emit(type, event);
+ }
+ };
+ me.hammer.on(type, listener);
+ me.listeners[type] = listener;
+ });
+
+ // emulate a touch event (emitted before the start of a pan, pinch, tap, or press)
+ hammerUtil.onTouch(this.hammer, function (event) {
+ me.emit('touch', event);
+ }.bind(this));
+
+ // emulate a release event (emitted after a pan, pinch, tap, or press)
+ hammerUtil.onRelease(this.hammer, function (event) {
+ me.emit('release', event);
+ }.bind(this));
+
+ function onMouseWheel(event) {
+ if (me.isActive()) {
+ me.emit('mousewheel', event);
+ }
+ }
+ this.dom.root.addEventListener('mousewheel', onMouseWheel);
+ this.dom.root.addEventListener('DOMMouseScroll', onMouseWheel);
+
+ // size properties of each of the panels
+ this.props = {
+ root: {},
+ background: {},
+ centerContainer: {},
+ leftContainer: {},
+ rightContainer: {},
+ center: {},
+ left: {},
+ right: {},
+ top: {},
+ bottom: {},
+ border: {},
+ scrollTop: 0,
+ scrollTopMin: 0
+ };
+
+ this.customTimes = [];
+
+ // store state information needed for touch events
+ this.touch = {};
+
+ this.redrawCount = 0;
+ this.initialDrawDone = false;
+
+ // attach the root panel to the provided container
+ if (!container) throw new Error('No container provided');
+ container.appendChild(this.dom.root);
+ };
+
+ /**
+ * Set options. Options will be passed to all components loaded in the Timeline.
+ * @param {Object} [options]
+ * {String} orientation
+ * Vertical orientation for the Timeline,
+ * can be 'bottom' (default) or 'top'.
+ * {String | Number} width
+ * Width for the timeline, a number in pixels or
+ * a css string like '1000px' or '75%'. '100%' by default.
+ * {String | Number} height
+ * Fixed height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'. If undefined,
+ * The Timeline will automatically size such that
+ * its contents fit.
+ * {String | Number} minHeight
+ * Minimum height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {String | Number} maxHeight
+ * Maximum height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {Number | Date | String} start
+ * Start date for the visible window
+ * {Number | Date | String} end
+ * End date for the visible window
+ */
+ Core.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the known options
+ var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', 'locale', 'locales', 'moment', 'rtl', 'throttleRedraw'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if (this.options.rtl) {
+ var contentContainer = this.dom.leftContainer;
+ this.dom.leftContainer = this.dom.rightContainer;
+ this.dom.rightContainer = contentContainer;
+ this.dom.container.style.direction = "rtl";
+ this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical-rtl';
+ }
+
+ this.options.orientation = { item: undefined, axis: undefined };
+ if ('orientation' in options) {
+ if (typeof options.orientation === 'string') {
+ this.options.orientation = {
+ item: options.orientation,
+ axis: options.orientation
+ };
+ } else if (_typeof(options.orientation) === 'object') {
+ if ('item' in options.orientation) {
+ this.options.orientation.item = options.orientation.item;
+ }
+ if ('axis' in options.orientation) {
+ this.options.orientation.axis = options.orientation.axis;
+ }
+ }
+ }
+
+ if (this.options.orientation.axis === 'both') {
+ if (!this.timeAxis2) {
+ var timeAxis2 = this.timeAxis2 = new TimeAxis(this.body);
+ timeAxis2.setOptions = function (options) {
+ var _options = options ? util.extend({}, options) : {};
+ _options.orientation = 'top'; // override the orientation option, always top
+ TimeAxis.prototype.setOptions.call(timeAxis2, _options);
+ };
+ this.components.push(timeAxis2);
+ }
+ } else {
+ if (this.timeAxis2) {
+ var index = this.components.indexOf(this.timeAxis2);
+ if (index !== -1) {
+ this.components.splice(index, 1);
+ }
+ this.timeAxis2.destroy();
+ this.timeAxis2 = null;
+ }
+ }
+
+ // if the graph2d's drawPoints is a function delegate the callback to the onRender property
+ if (typeof options.drawPoints == 'function') {
+ options.drawPoints = {
+ onRender: options.drawPoints
+ };
+ }
+
+ if ('hiddenDates' in this.options) {
+ DateUtil.convertHiddenOptions(this.options.moment, this.body, this.options.hiddenDates);
+ }
+
+ if ('clickToUse' in options) {
+ if (options.clickToUse) {
+ if (!this.activator) {
+ this.activator = new Activator(this.dom.root);
+ }
+ } else {
+ if (this.activator) {
+ this.activator.destroy();
+ delete this.activator;
+ }
+ }
+ }
+
+ if ('showCustomTime' in options) {
+ throw new Error('Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])');
+ }
+
+ // enable/disable autoResize
+ this._initAutoResize();
+ }
+
+ // propagate options to all components
+ this.components.forEach(function (component) {
+ return component.setOptions(options);
+ });
+
+ // enable/disable configure
+ if ('configure' in options) {
+ if (!this.configurator) {
+ this.configurator = this._createConfigurator();
+ }
+
+ this.configurator.setOptions(options.configure);
+
+ // collect the settings of all components, and pass them to the configuration system
+ var appliedOptions = util.deepExtend({}, this.options);
+ this.components.forEach(function (component) {
+ util.deepExtend(appliedOptions, component.options);
+ });
+ this.configurator.setModuleOptions({ global: appliedOptions });
+ }
+
+ // override redraw with a throttled version
+ if (!this._origRedraw) {
+ this._origRedraw = this._redraw.bind(this);
+ this._redraw = util.throttle(this._origRedraw, this.options.throttleRedraw);
+ } else {
+ // Not the initial run: redraw everything
+ this._redraw();
+ }
+ };
+
+ /**
+ * Returns true when the Timeline is active.
+ * @returns {boolean}
+ */
+ Core.prototype.isActive = function () {
+ return !this.activator || this.activator.active;
+ };
+
+ /**
+ * Destroy the Core, clean up all DOM elements and event listeners.
+ */
+ Core.prototype.destroy = function () {
+ // unbind datasets
+ this.setItems(null);
+ this.setGroups(null);
+
+ // remove all event listeners
+ this.off();
+
+ // stop checking for changed size
+ this._stopAutoResize();
+
+ // remove from DOM
+ if (this.dom.root.parentNode) {
+ this.dom.root.parentNode.removeChild(this.dom.root);
+ }
+ this.dom = null;
+
+ // remove Activator
+ if (this.activator) {
+ this.activator.destroy();
+ delete this.activator;
+ }
+
+ // cleanup hammer touch events
+ for (var event in this.listeners) {
+ if (this.listeners.hasOwnProperty(event)) {
+ delete this.listeners[event];
+ }
+ }
+ this.listeners = null;
+ this.hammer = null;
+
+ // give all components the opportunity to cleanup
+ this.components.forEach(function (component) {
+ return component.destroy();
+ });
+
+ this.body = null;
+ };
+
+ /**
+ * Set a custom time bar
+ * @param {Date} time
+ * @param {number} [id=undefined] Optional id of the custom time bar to be adjusted.
+ */
+ Core.prototype.setCustomTime = function (time, id) {
+ var customTimes = this.customTimes.filter(function (component) {
+ return id === component.options.id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+
+ if (customTimes.length > 0) {
+ customTimes[0].setCustomTime(time);
+ }
+ };
+
+ /**
+ * Retrieve the current custom time.
+ * @param {number} [id=undefined] Id of the custom time bar.
+ * @return {Date | undefined} customTime
+ */
+ Core.prototype.getCustomTime = function (id) {
+ var customTimes = this.customTimes.filter(function (component) {
+ return component.options.id === id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+ return customTimes[0].getCustomTime();
+ };
+
+ /**
+ * Set a custom title for the custom time bar.
+ * @param {String} [title] Custom title
+ * @param {number} [id=undefined] Id of the custom time bar.
+ */
+ Core.prototype.setCustomTimeTitle = function (title, id) {
+ var customTimes = this.customTimes.filter(function (component) {
+ return component.options.id === id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+ if (customTimes.length > 0) {
+ return customTimes[0].setCustomTitle(title);
+ }
+ };
+
+ /**
+ * Retrieve meta information from an event.
+ * Should be overridden by classes extending Core
+ * @param {Event} event
+ * @return {Object} An object with related information.
+ */
+ Core.prototype.getEventProperties = function (event) {
+ return { event: event };
+ };
+
+ /**
+ * Add custom vertical bar
+ * @param {Date | String | Number} [time] A Date, unix timestamp, or
+ * ISO date string. Time point where
+ * the new bar should be placed.
+ * If not provided, `new Date()` will
+ * be used.
+ * @param {Number | String} [id=undefined] Id of the new bar. Optional
+ * @return {Number | String} Returns the id of the new bar
+ */
+ Core.prototype.addCustomTime = function (time, id) {
+ var timestamp = time !== undefined ? util.convert(time, 'Date').valueOf() : new Date();
+
+ var exists = this.customTimes.some(function (customTime) {
+ return customTime.options.id === id;
+ });
+ if (exists) {
+ throw new Error('A custom time with id ' + JSON.stringify(id) + ' already exists');
+ }
+
+ var customTime = new CustomTime(this.body, util.extend({}, this.options, {
+ time: timestamp,
+ id: id
+ }));
+
+ this.customTimes.push(customTime);
+ this.components.push(customTime);
+ this._redraw();
+
+ return id;
+ };
+
+ /**
+ * Remove previously added custom bar
+ * @param {int} id ID of the custom bar to be removed
+ * @return {boolean} True if the bar exists and is removed, false otherwise
+ */
+ Core.prototype.removeCustomTime = function (id) {
+ var customTimes = this.customTimes.filter(function (bar) {
+ return bar.options.id === id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+
+ customTimes.forEach(function (customTime) {
+ this.customTimes.splice(this.customTimes.indexOf(customTime), 1);
+ this.components.splice(this.components.indexOf(customTime), 1);
+ customTime.destroy();
+ }.bind(this));
+ };
+
+ /**
+ * Get the id's of the currently visible items.
+ * @returns {Array} The ids of the visible items
+ */
+ Core.prototype.getVisibleItems = function () {
+ return this.itemSet && this.itemSet.getVisibleItems() || [];
+ };
+
+ /**
+ * Set Core window such that it fits all items
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Core.prototype.fit = function (options) {
+ var range = this.getDataRange();
+
+ // skip range set if there is no min and max date
+ if (range.min === null && range.max === null) {
+ return;
+ }
+
+ // apply a margin of 1% left and right of the data
+ var interval = range.max - range.min;
+ var min = new Date(range.min.valueOf() - interval * 0.01);
+ var max = new Date(range.max.valueOf() + interval * 0.01);
+ var animation = options && options.animation !== undefined ? options.animation : true;
+ this.range.setRange(min, max, animation);
+ };
+
+ /**
+ * Calculate the data range of the items start and end dates
+ * @returns {{min: Date | null, max: Date | null}}
+ * @protected
+ */
+ Core.prototype.getDataRange = function () {
+ // must be implemented by Timeline and Graph2d
+ throw new Error('Cannot invoke abstract method getDataRange');
+ };
+
+ /**
+ * Set the visible window. Both parameters are optional, you can change only
+ * start or only end. Syntax:
+ *
+ * TimeLine.setWindow(start, end)
+ * TimeLine.setWindow(start, end, options)
+ * TimeLine.setWindow(range)
+ *
+ * Where start and end can be a Date, number, or string, and range is an
+ * object with properties start and end.
+ *
+ * @param {Date | Number | String | Object} [start] Start date of visible window
+ * @param {Date | Number | String} [end] End date of visible window
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Core.prototype.setWindow = function (start, end, options) {
+ var animation;
+ if (arguments.length == 1) {
+ var range = arguments[0];
+ animation = range.animation !== undefined ? range.animation : true;
+ this.range.setRange(range.start, range.end, animation);
+ } else {
+ animation = options && options.animation !== undefined ? options.animation : true;
+ this.range.setRange(start, end, animation);
+ }
+ };
+
+ /**
+ * Move the window such that given time is centered on screen.
+ * @param {Date | Number | String} time
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Core.prototype.moveTo = function (time, options) {
+ var interval = this.range.end - this.range.start;
+ var t = util.convert(time, 'Date').valueOf();
+
+ var start = t - interval / 2;
+ var end = t + interval / 2;
+ var animation = options && options.animation !== undefined ? options.animation : true;
+
+ this.range.setRange(start, end, animation);
+ };
+
+ /**
+ * Get the visible window
+ * @return {{start: Date, end: Date}} Visible range
+ */
+ Core.prototype.getWindow = function () {
+ var range = this.range.getRange();
+ return {
+ start: new Date(range.start),
+ end: new Date(range.end)
+ };
+ };
+
+ /**
+ * Force a redraw. Can be overridden by implementations of Core
+ *
+ * Note: this function will be overridden on construction with a trottled version
+ */
+ Core.prototype.redraw = function () {
+ this._redraw();
+ };
+
+ /**
+ * Redraw for internal use. Redraws all components. See also the public
+ * method redraw.
+ * @protected
+ */
+ Core.prototype._redraw = function () {
+ this.redrawCount++;
+ var resized = false;
+ var options = this.options;
+ var props = this.props;
+ var dom = this.dom;
+
+ if (!dom || !dom.container || dom.root.offsetWidth == 0) return; // when destroyed, or invisible
+
+ DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);
+
+ // update class names
+ if (options.orientation == 'top') {
+ util.addClassName(dom.root, 'vis-top');
+ util.removeClassName(dom.root, 'vis-bottom');
+ } else {
+ util.removeClassName(dom.root, 'vis-top');
+ util.addClassName(dom.root, 'vis-bottom');
+ }
+
+ // update root width and height options
+ dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');
+ dom.root.style.minHeight = util.option.asSize(options.minHeight, '');
+ dom.root.style.width = util.option.asSize(options.width, '');
+
+ // calculate border widths
+ props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
+ props.border.right = props.border.left;
+ props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;
+ props.border.bottom = props.border.top;
+ var borderRootHeight = dom.root.offsetHeight - dom.root.clientHeight;
+ var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;
+
+ // workaround for a bug in IE: the clientWidth of an element with
+ // a height:0px and overflow:hidden is not calculated and always has value 0
+ if (dom.centerContainer.clientHeight === 0) {
+ props.border.left = props.border.top;
+ props.border.right = props.border.left;
+ }
+ if (dom.root.clientHeight === 0) {
+ borderRootWidth = borderRootHeight;
+ }
+
+ // calculate the heights. If any of the side panels is empty, we set the height to
+ // minus the border width, such that the border will be invisible
+ props.center.height = dom.center.offsetHeight;
+ props.left.height = dom.left.offsetHeight;
+ props.right.height = dom.right.offsetHeight;
+ props.top.height = dom.top.clientHeight || -props.border.top;
+ props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;
+
+ // TODO: compensate borders when any of the panels is empty.
+
+ // apply auto height
+ // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
+ var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);
+ var autoHeight = props.top.height + contentHeight + props.bottom.height + borderRootHeight + props.border.top + props.border.bottom;
+ dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');
+
+ // calculate heights of the content panels
+ props.root.height = dom.root.offsetHeight;
+ props.background.height = props.root.height - borderRootHeight;
+ var containerHeight = props.root.height - props.top.height - props.bottom.height - borderRootHeight;
+ props.centerContainer.height = containerHeight;
+ props.leftContainer.height = containerHeight;
+ props.rightContainer.height = props.leftContainer.height;
+
+ // calculate the widths of the panels
+ props.root.width = dom.root.offsetWidth;
+ props.background.width = props.root.width - borderRootWidth;
+ props.left.width = dom.leftContainer.clientWidth || -props.border.left;
+ props.leftContainer.width = props.left.width;
+ props.right.width = dom.rightContainer.clientWidth || -props.border.right;
+ props.rightContainer.width = props.right.width;
+ var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth;
+ props.center.width = centerWidth;
+ props.centerContainer.width = centerWidth;
+ props.top.width = centerWidth;
+ props.bottom.width = centerWidth;
+
+ // resize the panels
+ dom.background.style.height = props.background.height + 'px';
+ dom.backgroundVertical.style.height = props.background.height + 'px';
+ dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px';
+ dom.centerContainer.style.height = props.centerContainer.height + 'px';
+ dom.leftContainer.style.height = props.leftContainer.height + 'px';
+ dom.rightContainer.style.height = props.rightContainer.height + 'px';
+
+ dom.background.style.width = props.background.width + 'px';
+ dom.backgroundVertical.style.width = props.centerContainer.width + 'px';
+ dom.backgroundHorizontal.style.width = props.background.width + 'px';
+ dom.centerContainer.style.width = props.center.width + 'px';
+ dom.top.style.width = props.top.width + 'px';
+ dom.bottom.style.width = props.bottom.width + 'px';
+
+ // reposition the panels
+ dom.background.style.left = '0';
+ dom.background.style.top = '0';
+ dom.backgroundVertical.style.left = props.left.width + props.border.left + 'px';
+ dom.backgroundVertical.style.top = '0';
+ dom.backgroundHorizontal.style.left = '0';
+ dom.backgroundHorizontal.style.top = props.top.height + 'px';
+ dom.centerContainer.style.left = props.left.width + 'px';
+ dom.centerContainer.style.top = props.top.height + 'px';
+ dom.leftContainer.style.left = '0';
+ dom.leftContainer.style.top = props.top.height + 'px';
+ dom.rightContainer.style.left = props.left.width + props.center.width + 'px';
+ dom.rightContainer.style.top = props.top.height + 'px';
+ dom.top.style.left = props.left.width + 'px';
+ dom.top.style.top = '0';
+ dom.bottom.style.left = props.left.width + 'px';
+ dom.bottom.style.top = props.top.height + props.centerContainer.height + 'px';
+
+ // update the scrollTop, feasible range for the offset can be changed
+ // when the height of the Core or of the contents of the center changed
+ this._updateScrollTop();
+
+ // reposition the scrollable contents
+ var offset = this.props.scrollTop;
+ if (options.orientation.item != 'top') {
+ offset += Math.max(this.props.centerContainer.height - this.props.center.height - this.props.border.top - this.props.border.bottom, 0);
+ }
+ dom.center.style.left = '0';
+ dom.center.style.top = offset + 'px';
+ dom.left.style.left = '0';
+ dom.left.style.top = offset + 'px';
+ dom.right.style.left = '0';
+ dom.right.style.top = offset + 'px';
+
+ // show shadows when vertical scrolling is available
+ var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : '';
+ var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : '';
+ dom.shadowTop.style.visibility = visibilityTop;
+ dom.shadowBottom.style.visibility = visibilityBottom;
+ dom.shadowTopLeft.style.visibility = visibilityTop;
+ dom.shadowBottomLeft.style.visibility = visibilityBottom;
+ dom.shadowTopRight.style.visibility = visibilityTop;
+ dom.shadowBottomRight.style.visibility = visibilityBottom;
+
+ // enable/disable vertical panning
+ var contentsOverflow = this.props.center.height > this.props.centerContainer.height;
+ this.hammer.get('pan').set({
+ direction: contentsOverflow ? Hammer.DIRECTION_ALL : Hammer.DIRECTION_HORIZONTAL
+ });
+
+ // redraw all components
+ this.components.forEach(function (component) {
+ resized = component.redraw() || resized;
+ });
+ var MAX_REDRAW = 5;
+ if (resized) {
+ if (this.redrawCount < MAX_REDRAW) {
+ this.body.emitter.emit('_change');
+ return;
+ } else {
+ console.log('WARNING: infinite loop in redraw?');
+ }
+ } else {
+ this.redrawCount = 0;
+ }
+ this.initialDrawDone = true;
+
+ //Emit public 'changed' event for UI updates, see issue #1592
+ this.body.emitter.emit("changed");
+ };
+
+ // TODO: deprecated since version 1.1.0, remove some day
+ Core.prototype.repaint = function () {
+ throw new Error('Function repaint is deprecated. Use redraw instead.');
+ };
+
+ /**
+ * Set a current time. This can be used for example to ensure that a client's
+ * time is synchronized with a shared server time.
+ * Only applicable when option `showCurrentTime` is true.
+ * @param {Date | String | Number} time A Date, unix timestamp, or
+ * ISO date string.
+ */
+ Core.prototype.setCurrentTime = function (time) {
+ if (!this.currentTime) {
+ throw new Error('Option showCurrentTime must be true');
+ }
+
+ this.currentTime.setCurrentTime(time);
+ };
+
+ /**
+ * Get the current time.
+ * Only applicable when option `showCurrentTime` is true.
+ * @return {Date} Returns the current time.
+ */
+ Core.prototype.getCurrentTime = function () {
+ if (!this.currentTime) {
+ throw new Error('Option showCurrentTime must be true');
+ }
+
+ return this.currentTime.getCurrentTime();
+ };
+
+ /**
+ * Convert a position on screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toTime = function (x) {
+ return DateUtil.toTime(this, x, this.props.center.width);
+ };
+
+ /**
+ * Convert a position on the global screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toGlobalTime = function (x) {
+ return DateUtil.toTime(this, x, this.props.root.width);
+ //var conversion = this.range.conversion(this.props.root.width);
+ //return new Date(x / conversion.scale + conversion.offset);
+ };
+
+ /**
+ * Convert a datetime (Date object) into a position on the screen
+ * @param {Date} time A date
+ * @return {int} x The position on the screen in pixels which corresponds
+ * with the given date.
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toScreen = function (time) {
+ return DateUtil.toScreen(this, time, this.props.center.width);
+ };
+
+ /**
+ * Convert a datetime (Date object) into a position on the root
+ * This is used to get the pixel density estimate for the screen, not the center panel
+ * @param {Date} time A date
+ * @return {int} x The position on root in pixels which corresponds
+ * with the given date.
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toGlobalScreen = function (time) {
+ return DateUtil.toScreen(this, time, this.props.root.width);
+ //var conversion = this.range.conversion(this.props.root.width);
+ //return (time.valueOf() - conversion.offset) * conversion.scale;
+ };
+
+ /**
+ * Initialize watching when option autoResize is true
+ * @private
+ */
+ Core.prototype._initAutoResize = function () {
+ if (this.options.autoResize == true) {
+ this._startAutoResize();
+ } else {
+ this._stopAutoResize();
+ }
+ };
+
+ /**
+ * Watch for changes in the size of the container. On resize, the Panel will
+ * automatically redraw itself.
+ * @private
+ */
+ Core.prototype._startAutoResize = function () {
+ var me = this;
+
+ this._stopAutoResize();
+
+ this._onResize = function () {
+ if (me.options.autoResize != true) {
+ // stop watching when the option autoResize is changed to false
+ me._stopAutoResize();
+ return;
+ }
+
+ if (me.dom.root) {
+ // check whether the frame is resized
+ // Note: we compare offsetWidth here, not clientWidth. For some reason,
+ // IE does not restore the clientWidth from 0 to the actual width after
+ // changing the timeline's container display style from none to visible
+ if (me.dom.root.offsetWidth != me.props.lastWidth || me.dom.root.offsetHeight != me.props.lastHeight) {
+ me.props.lastWidth = me.dom.root.offsetWidth;
+ me.props.lastHeight = me.dom.root.offsetHeight;
+
+ me.body.emitter.emit('_change');
+ }
+ }
+ };
+
+ // add event listener to window resize
+ util.addEventListener(window, 'resize', this._onResize);
+
+ //Prevent initial unnecessary redraw
+ if (me.dom.root) {
+ me.props.lastWidth = me.dom.root.offsetWidth;
+ me.props.lastHeight = me.dom.root.offsetHeight;
+ }
+
+ this.watchTimer = setInterval(this._onResize, 1000);
+ };
+
+ /**
+ * Stop watching for a resize of the frame.
+ * @private
+ */
+ Core.prototype._stopAutoResize = function () {
+ if (this.watchTimer) {
+ clearInterval(this.watchTimer);
+ this.watchTimer = undefined;
+ }
+
+ // remove event listener on window.resize
+ if (this._onResize) {
+ util.removeEventListener(window, 'resize', this._onResize);
+ this._onResize = null;
+ }
+ };
+
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Core.prototype._onTouch = function (event) {
+ this.touch.allowDragging = true;
+ this.touch.initialScrollTop = this.props.scrollTop;
+ };
+
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Core.prototype._onPinch = function (event) {
+ this.touch.allowDragging = false;
+ };
+
+ /**
+ * Move the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Core.prototype._onDrag = function (event) {
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.touch.allowDragging) return;
+
+ var delta = event.deltaY;
+
+ var oldScrollTop = this._getScrollTop();
+ var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);
+
+ if (newScrollTop != oldScrollTop) {
+ this.emit("verticalDrag");
+ }
+ };
+
+ /**
+ * Apply a scrollTop
+ * @param {Number} scrollTop
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Core.prototype._setScrollTop = function (scrollTop) {
+ this.props.scrollTop = scrollTop;
+ this._updateScrollTop();
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Update the current scrollTop when the height of the containers has been changed
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Core.prototype._updateScrollTop = function () {
+ // recalculate the scrollTopMin
+ var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
+ if (scrollTopMin != this.props.scrollTopMin) {
+ // in case of bottom orientation, change the scrollTop such that the contents
+ // do not move relative to the time axis at the bottom
+ if (this.options.orientation.item != 'top') {
+ this.props.scrollTop += scrollTopMin - this.props.scrollTopMin;
+ }
+ this.props.scrollTopMin = scrollTopMin;
+ }
+
+ // limit the scrollTop to the feasible scroll range
+ if (this.props.scrollTop > 0) this.props.scrollTop = 0;
+ if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;
+
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Get the current scrollTop
+ * @returns {number} scrollTop
+ * @private
+ */
+ Core.prototype._getScrollTop = function () {
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Load a configurator
+ * @return {Object}
+ * @private
+ */
+ Core.prototype._createConfigurator = function () {
+ throw new Error('Cannot invoke abstract method _createConfigurator');
+ };
+
+ module.exports = Core;
+
+/***/ },
+/* 34 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var TimeStep = __webpack_require__(35);
+ var Component = __webpack_require__(31);
+ var Group = __webpack_require__(36);
+ var BackgroundGroup = __webpack_require__(40);
+ var BoxItem = __webpack_require__(41);
+ var PointItem = __webpack_require__(42);
+ var RangeItem = __webpack_require__(38);
+ var BackgroundItem = __webpack_require__(43);
+
+ var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items
+ var BACKGROUND = '__background__'; // reserved group id for background items without group
+
+ /**
+ * An ItemSet holds a set of items and ranges which can be displayed in a
+ * range. The width is determined by the parent of the ItemSet, and the height
+ * is determined by the size of the items.
+ * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body
+ * @param {Object} [options] See ItemSet.setOptions for the available options.
+ * @constructor ItemSet
+ * @extends Component
+ */
+ function ItemSet(body, options) {
+ this.body = body;
+ this.defaultOptions = {
+ rtl: false,
+ type: null, // 'box', 'point', 'range', 'background'
+ orientation: {
+ item: 'bottom' // item orientation: 'top' or 'bottom'
+ },
+ align: 'auto', // alignment of box items
+ stack: true,
+ groupOrderSwap: function groupOrderSwap(fromGroup, toGroup, groups) {
+ var targetOrder = toGroup.order;
+ toGroup.order = fromGroup.order;
+ fromGroup.order = targetOrder;
+ },
+ groupOrder: 'order',
+
+ selectable: true,
+ multiselect: false,
+ itemsAlwaysDraggable: false,
+
+ editable: {
+ updateTime: false,
+ updateGroup: false,
+ add: false,
+ remove: false
+ },
+
+ groupEditable: {
+ order: false,
+ add: false,
+ remove: false
+ },
+
+ snap: TimeStep.snap,
+
+ onAdd: function onAdd(item, callback) {
+ callback(item);
+ },
+ onUpdate: function onUpdate(item, callback) {
+ callback(item);
+ },
+ onMove: function onMove(item, callback) {
+ callback(item);
+ },
+ onRemove: function onRemove(item, callback) {
+ callback(item);
+ },
+ onMoving: function onMoving(item, callback) {
+ callback(item);
+ },
+ onAddGroup: function onAddGroup(item, callback) {
+ callback(item);
+ },
+ onMoveGroup: function onMoveGroup(item, callback) {
+ callback(item);
+ },
+ onRemoveGroup: function onRemoveGroup(item, callback) {
+ callback(item);
+ },
+
+ margin: {
+ item: {
+ horizontal: 10,
+ vertical: 10
+ },
+ axis: 20
+ }
+ };
+
+ // options is shared by this ItemSet and all its items
+ this.options = util.extend({}, this.defaultOptions);
+
+ // options for getting items from the DataSet with the correct type
+ this.itemOptions = {
+ type: { start: 'Date', end: 'Date' }
+ };
+
+ this.conversion = {
+ toScreen: body.util.toScreen,
+ toTime: body.util.toTime
+ };
+ this.dom = {};
+ this.props = {};
+ this.hammer = null;
+
+ var me = this;
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ // listeners for the DataSet of the items
+ this.itemListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAdd(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdate(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemove(params.items);
+ }
+ };
+
+ // listeners for the DataSet of the groups
+ this.groupListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAddGroups(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdateGroups(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemoveGroups(params.items);
+ }
+ };
+
+ this.items = {}; // object with an Item for every data item
+ this.groups = {}; // Group object for every group
+ this.groupIds = [];
+
+ this.selection = []; // list with the ids of all selected nodes
+ this.stackDirty = true; // if true, all items will be restacked on next redraw
+
+ this.touchParams = {}; // stores properties while dragging
+ this.groupTouchParams = {};
+ // create the HTML DOM
+
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ ItemSet.prototype = new Component();
+
+ // available item types will be registered here
+ ItemSet.types = {
+ background: BackgroundItem,
+ box: BoxItem,
+ range: RangeItem,
+ point: PointItem
+ };
+
+ /**
+ * Create the HTML DOM for the ItemSet
+ */
+ ItemSet.prototype._create = function () {
+ var frame = document.createElement('div');
+ frame.className = 'vis-itemset';
+ frame['timeline-itemset'] = this;
+ this.dom.frame = frame;
+
+ // create background panel
+ var background = document.createElement('div');
+ background.className = 'vis-background';
+ frame.appendChild(background);
+ this.dom.background = background;
+
+ // create foreground panel
+ var foreground = document.createElement('div');
+ foreground.className = 'vis-foreground';
+ frame.appendChild(foreground);
+ this.dom.foreground = foreground;
+
+ // create axis panel
+ var axis = document.createElement('div');
+ axis.className = 'vis-axis';
+ this.dom.axis = axis;
+
+ // create labelset
+ var labelSet = document.createElement('div');
+ labelSet.className = 'vis-labelset';
+ this.dom.labelSet = labelSet;
+
+ // create ungrouped Group
+ this._updateUngrouped();
+
+ // create background Group
+ var backgroundGroup = new BackgroundGroup(BACKGROUND, null, this);
+ backgroundGroup.show();
+ this.groups[BACKGROUND] = backgroundGroup;
+
+ // attach event listeners
+ // Note: we bind to the centerContainer for the case where the height
+ // of the center container is larger than of the ItemSet, so we
+ // can click in the empty area to create a new item or deselect an item.
+ this.hammer = new Hammer(this.body.dom.centerContainer);
+
+ // drag items when selected
+ this.hammer.on('hammer.input', function (event) {
+ if (event.isFirst) {
+ this._onTouch(event);
+ }
+ }.bind(this));
+ this.hammer.on('panstart', this._onDragStart.bind(this));
+ this.hammer.on('panmove', this._onDrag.bind(this));
+ this.hammer.on('panend', this._onDragEnd.bind(this));
+ this.hammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_HORIZONTAL });
+
+ // single select (or unselect) when tapping an item
+ this.hammer.on('tap', this._onSelectItem.bind(this));
+
+ // multi select when holding mouse/touch, or on ctrl+click
+ this.hammer.on('press', this._onMultiSelectItem.bind(this));
+
+ // add item on doubletap
+ this.hammer.on('doubletap', this._onAddItem.bind(this));
+ this.groupHammer = new Hammer(this.body.dom.leftContainer);
+
+ this.groupHammer.on('panstart', this._onGroupDragStart.bind(this));
+ this.groupHammer.on('panmove', this._onGroupDrag.bind(this));
+ this.groupHammer.on('panend', this._onGroupDragEnd.bind(this));
+ this.groupHammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_HORIZONTAL });
+
+ // attach to the DOM
+ this.show();
+ };
+
+ /**
+ * Set options for the ItemSet. Existing options will be extended/overwritten.
+ * @param {Object} [options] The following options are available:
+ * {String} type
+ * Default type for the items. Choose from 'box'
+ * (default), 'point', 'range', or 'background'.
+ * The default style can be overwritten by
+ * individual items.
+ * {String} align
+ * Alignment for the items, only applicable for
+ * BoxItem. Choose 'center' (default), 'left', or
+ * 'right'.
+ * {String} orientation.item
+ * Orientation of the item set. Choose 'top' or
+ * 'bottom' (default).
+ * {Function} groupOrder
+ * A sorting function for ordering groups
+ * {Boolean} stack
+ * If true (default), items will be stacked on
+ * top of each other.
+ * {Number} margin.axis
+ * Margin between the axis and the items in pixels.
+ * Default is 20.
+ * {Number} margin.item.horizontal
+ * Horizontal margin between items in pixels.
+ * Default is 10.
+ * {Number} margin.item.vertical
+ * Vertical Margin between items in pixels.
+ * Default is 10.
+ * {Number} margin.item
+ * Margin between items in pixels in both horizontal
+ * and vertical direction. Default is 10.
+ * {Number} margin
+ * Set margin for both axis and items in pixels.
+ * {Boolean} selectable
+ * If true (default), items can be selected.
+ * {Boolean} multiselect
+ * If true, multiple items can be selected.
+ * False by default.
+ * {Boolean} editable
+ * Set all editable options to true or false
+ * {Boolean} editable.updateTime
+ * Allow dragging an item to an other moment in time
+ * {Boolean} editable.updateGroup
+ * Allow dragging an item to an other group
+ * {Boolean} editable.add
+ * Allow creating new items on double tap
+ * {Boolean} editable.remove
+ * Allow removing items by clicking the delete button
+ * top right of a selected item.
+ * {Function(item: Item, callback: Function)} onAdd
+ * Callback function triggered when an item is about to be added:
+ * when the user double taps an empty space in the Timeline.
+ * {Function(item: Item, callback: Function)} onUpdate
+ * Callback function fired when an item is about to be updated.
+ * This function typically has to show a dialog where the user
+ * change the item. If not implemented, nothing happens.
+ * {Function(item: Item, callback: Function)} onMove
+ * Fired when an item has been moved. If not implemented,
+ * the move action will be accepted.
+ * {Function(item: Item, callback: Function)} onRemove
+ * Fired when an item is about to be deleted.
+ * If not implemented, the item will be always removed.
+ */
+ ItemSet.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ var fields = ['type', 'rtl', 'align', 'order', 'stack', 'selectable', 'multiselect', 'itemsAlwaysDraggable', 'multiselectPerGroup', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'hide', 'snap', 'groupOrderSwap'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if ('orientation' in options) {
+ if (typeof options.orientation === 'string') {
+ this.options.orientation.item = options.orientation === 'top' ? 'top' : 'bottom';
+ } else if (_typeof(options.orientation) === 'object' && 'item' in options.orientation) {
+ this.options.orientation.item = options.orientation.item;
+ }
+ }
+
+ if ('margin' in options) {
+ if (typeof options.margin === 'number') {
+ this.options.margin.axis = options.margin;
+ this.options.margin.item.horizontal = options.margin;
+ this.options.margin.item.vertical = options.margin;
+ } else if (_typeof(options.margin) === 'object') {
+ util.selectiveExtend(['axis'], this.options.margin, options.margin);
+ if ('item' in options.margin) {
+ if (typeof options.margin.item === 'number') {
+ this.options.margin.item.horizontal = options.margin.item;
+ this.options.margin.item.vertical = options.margin.item;
+ } else if (_typeof(options.margin.item) === 'object') {
+ util.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item);
+ }
+ }
+ }
+ }
+
+ if ('editable' in options) {
+ if (typeof options.editable === 'boolean') {
+ this.options.editable.updateTime = options.editable;
+ this.options.editable.updateGroup = options.editable;
+ this.options.editable.add = options.editable;
+ this.options.editable.remove = options.editable;
+ } else if (_typeof(options.editable) === 'object') {
+ util.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove'], this.options.editable, options.editable);
+ }
+ }
+
+ if ('groupEditable' in options) {
+ if (typeof options.groupEditable === 'boolean') {
+ this.options.groupEditable.order = options.groupEditable;
+ this.options.groupEditable.add = options.groupEditable;
+ this.options.groupEditable.remove = options.groupEditable;
+ } else if (_typeof(options.groupEditable) === 'object') {
+ util.selectiveExtend(['order', 'add', 'remove'], this.options.groupEditable, options.groupEditable);
+ }
+ }
+
+ // callback functions
+ var addCallback = function (name) {
+ var fn = options[name];
+ if (fn) {
+ if (!(fn instanceof Function)) {
+ throw new Error('option ' + name + ' must be a function ' + name + '(item, callback)');
+ }
+ this.options[name] = fn;
+ }
+ }.bind(this);
+ ['onAdd', 'onUpdate', 'onRemove', 'onMove', 'onMoving', 'onAddGroup', 'onMoveGroup', 'onRemoveGroup'].forEach(addCallback);
+
+ // force the itemSet to refresh: options like orientation and margins may be changed
+ this.markDirty();
+ }
+ };
+
+ /**
+ * Mark the ItemSet dirty so it will refresh everything with next redraw.
+ * Optionally, all items can be marked as dirty and be refreshed.
+ * @param {{refreshItems: boolean}} [options]
+ */
+ ItemSet.prototype.markDirty = function (options) {
+ this.groupIds = [];
+ this.stackDirty = true;
+
+ if (options && options.refreshItems) {
+ util.forEach(this.items, function (item) {
+ item.dirty = true;
+ if (item.displayed) item.redraw();
+ });
+ }
+ };
+
+ /**
+ * Destroy the ItemSet
+ */
+ ItemSet.prototype.destroy = function () {
+ this.hide();
+ this.setItems(null);
+ this.setGroups(null);
+
+ this.hammer = null;
+
+ this.body = null;
+ this.conversion = null;
+ };
+
+ /**
+ * Hide the component from the DOM
+ */
+ ItemSet.prototype.hide = function () {
+ // remove the frame containing the items
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+
+ // remove the axis with dots
+ if (this.dom.axis.parentNode) {
+ this.dom.axis.parentNode.removeChild(this.dom.axis);
+ }
+
+ // remove the labelset containing all group labels
+ if (this.dom.labelSet.parentNode) {
+ this.dom.labelSet.parentNode.removeChild(this.dom.labelSet);
+ }
+ };
+
+ /**
+ * Show the component in the DOM (when not already visible).
+ * @return {Boolean} changed
+ */
+ ItemSet.prototype.show = function () {
+ // show frame containing the items
+ if (!this.dom.frame.parentNode) {
+ this.body.dom.center.appendChild(this.dom.frame);
+ }
+
+ // show axis with dots
+ if (!this.dom.axis.parentNode) {
+ this.body.dom.backgroundVertical.appendChild(this.dom.axis);
+ }
+
+ // show labelset containing labels
+ if (!this.dom.labelSet.parentNode) {
+ this.body.dom.left.appendChild(this.dom.labelSet);
+ }
+ };
+
+ /**
+ * Set selected items by their id. Replaces the current selection
+ * Unknown id's are silently ignored.
+ * @param {string[] | string} [ids] An array with zero or more id's of the items to be
+ * selected, or a single item id. If ids is undefined
+ * or an empty array, all items will be unselected.
+ */
+ ItemSet.prototype.setSelection = function (ids) {
+ var i, ii, id, item;
+
+ if (ids == undefined) ids = [];
+ if (!Array.isArray(ids)) ids = [ids];
+
+ // unselect currently selected items
+ for (i = 0, ii = this.selection.length; i < ii; i++) {
+ id = this.selection[i];
+ item = this.items[id];
+ if (item) item.unselect();
+ }
+
+ // select items
+ this.selection = [];
+ for (i = 0, ii = ids.length; i < ii; i++) {
+ id = ids[i];
+ item = this.items[id];
+ if (item) {
+ this.selection.push(id);
+ item.select();
+ }
+ }
+ };
+
+ /**
+ * Get the selected items by their id
+ * @return {Array} ids The ids of the selected items
+ */
+ ItemSet.prototype.getSelection = function () {
+ return this.selection.concat([]);
+ };
+
+ /**
+ * Get the id's of the currently visible items.
+ * @returns {Array} The ids of the visible items
+ */
+ ItemSet.prototype.getVisibleItems = function () {
+ var range = this.body.range.getRange();
+
+ if (this.options.rtl) {
+ var right = this.body.util.toScreen(range.start);
+ var left = this.body.util.toScreen(range.end);
+ } else {
+ var left = this.body.util.toScreen(range.start);
+ var right = this.body.util.toScreen(range.end);
+ }
+
+ var ids = [];
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ var group = this.groups[groupId];
+ var rawVisibleItems = group.visibleItems;
+
+ // filter the "raw" set with visibleItems into a set which is really
+ // visible by pixels
+ for (var i = 0; i < rawVisibleItems.length; i++) {
+ var item = rawVisibleItems[i];
+ // TODO: also check whether visible vertically
+ if (this.options.rtl) {
+ if (item.right < left && item.right + item.width > right) {
+ ids.push(item.id);
+ }
+ } else {
+ if (item.left < right && item.left + item.width > left) {
+ ids.push(item.id);
+ }
+ }
+ }
+ }
+ }
+
+ return ids;
+ };
+
+ /**
+ * Deselect a selected item
+ * @param {String | Number} id
+ * @private
+ */
+ ItemSet.prototype._deselect = function (id) {
+ var selection = this.selection;
+ for (var i = 0, ii = selection.length; i < ii; i++) {
+ if (selection[i] == id) {
+ // non-strict comparison!
+ selection.splice(i, 1);
+ break;
+ }
+ }
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ ItemSet.prototype.redraw = function () {
+ var margin = this.options.margin,
+ range = this.body.range,
+ asSize = util.option.asSize,
+ options = this.options,
+ orientation = options.orientation.item,
+ resized = false,
+ frame = this.dom.frame;
+
+ // recalculate absolute position (before redrawing groups)
+ this.props.top = this.body.domProps.top.height + this.body.domProps.border.top;
+
+ if (this.options.rtl) {
+ this.props.right = this.body.domProps.right.width + this.body.domProps.border.right;
+ } else {
+ this.props.left = this.body.domProps.left.width + this.body.domProps.border.left;
+ }
+
+ // update class name
+ frame.className = 'vis-itemset';
+
+ // reorder the groups (if needed)
+ resized = this._orderGroups() || resized;
+
+ // check whether zoomed (in that case we need to re-stack everything)
+ // TODO: would be nicer to get this as a trigger from Range
+ var visibleInterval = range.end - range.start;
+ var zoomed = visibleInterval != this.lastVisibleInterval || this.props.width != this.props.lastWidth;
+ if (zoomed) this.stackDirty = true;
+ this.lastVisibleInterval = visibleInterval;
+ this.props.lastWidth = this.props.width;
+
+ var restack = this.stackDirty;
+ var firstGroup = this._firstGroup();
+ var firstMargin = {
+ item: margin.item,
+ axis: margin.axis
+ };
+ var nonFirstMargin = {
+ item: margin.item,
+ axis: margin.item.vertical / 2
+ };
+ var height = 0;
+ var minHeight = margin.axis + margin.item.vertical;
+
+ // redraw the background group
+ this.groups[BACKGROUND].redraw(range, nonFirstMargin, restack);
+
+ // redraw all regular groups
+ util.forEach(this.groups, function (group) {
+ var groupMargin = group == firstGroup ? firstMargin : nonFirstMargin;
+ var groupResized = group.redraw(range, groupMargin, restack);
+ resized = groupResized || resized;
+ height += group.height;
+ });
+ height = Math.max(height, minHeight);
+ this.stackDirty = false;
+
+ // update frame height
+ frame.style.height = asSize(height);
+
+ // calculate actual size
+ this.props.width = frame.offsetWidth;
+ this.props.height = height;
+
+ // reposition axis
+ this.dom.axis.style.top = asSize(orientation == 'top' ? this.body.domProps.top.height + this.body.domProps.border.top : this.body.domProps.top.height + this.body.domProps.centerContainer.height);
+ if (this.options.rtl) {
+ this.dom.axis.style.right = '0';
+ } else {
+ this.dom.axis.style.left = '0';
+ }
+
+ // check if this component is resized
+ resized = this._isResized() || resized;
+
+ return resized;
+ };
+
+ /**
+ * Get the first group, aligned with the axis
+ * @return {Group | null} firstGroup
+ * @private
+ */
+ ItemSet.prototype._firstGroup = function () {
+ var firstGroupIndex = this.options.orientation.item == 'top' ? 0 : this.groupIds.length - 1;
+ var firstGroupId = this.groupIds[firstGroupIndex];
+ var firstGroup = this.groups[firstGroupId] || this.groups[UNGROUPED];
+
+ return firstGroup || null;
+ };
+
+ /**
+ * Create or delete the group holding all ungrouped items. This group is used when
+ * there are no groups specified.
+ * @protected
+ */
+ ItemSet.prototype._updateUngrouped = function () {
+ var ungrouped = this.groups[UNGROUPED];
+ var background = this.groups[BACKGROUND];
+ var item, itemId;
+
+ if (this.groupsData) {
+ // remove the group holding all ungrouped items
+ if (ungrouped) {
+ ungrouped.hide();
+ delete this.groups[UNGROUPED];
+
+ for (itemId in this.items) {
+ if (this.items.hasOwnProperty(itemId)) {
+ item = this.items[itemId];
+ item.parent && item.parent.remove(item);
+ var groupId = this._getGroupId(item.data);
+ var group = this.groups[groupId];
+ group && group.add(item) || item.hide();
+ }
+ }
+ }
+ } else {
+ // create a group holding all (unfiltered) items
+ if (!ungrouped) {
+ var id = null;
+ var data = null;
+ ungrouped = new Group(id, data, this);
+ this.groups[UNGROUPED] = ungrouped;
+
+ for (itemId in this.items) {
+ if (this.items.hasOwnProperty(itemId)) {
+ item = this.items[itemId];
+ ungrouped.add(item);
+ }
+ }
+
+ ungrouped.show();
+ }
+ }
+ };
+
+ /**
+ * Get the element for the labelset
+ * @return {HTMLElement} labelSet
+ */
+ ItemSet.prototype.getLabelSet = function () {
+ return this.dom.labelSet;
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | null} items
+ */
+ ItemSet.prototype.setItems = function (items) {
+ var me = this,
+ ids,
+ oldItemsData = this.itemsData;
+
+ // replace the dataset
+ if (!items) {
+ this.itemsData = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ this.itemsData = items;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (oldItemsData) {
+ // unsubscribe from old dataset
+ util.forEach(this.itemListeners, function (callback, event) {
+ oldItemsData.off(event, callback);
+ });
+
+ // remove all drawn items
+ ids = oldItemsData.getIds();
+ this._onRemove(ids);
+ }
+
+ if (this.itemsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.itemListeners, function (callback, event) {
+ me.itemsData.on(event, callback, id);
+ });
+
+ // add all new items
+ ids = this.itemsData.getIds();
+ this._onAdd(ids);
+
+ // update the group holding all ungrouped items
+ this._updateUngrouped();
+ }
+
+ this.body.emitter.emit('_change', { queue: true });
+ };
+
+ /**
+ * Get the current items
+ * @returns {vis.DataSet | null}
+ */
+ ItemSet.prototype.getItems = function () {
+ return this.itemsData;
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet} groups
+ */
+ ItemSet.prototype.setGroups = function (groups) {
+ var me = this,
+ ids;
+
+ // unsubscribe from current dataset
+ if (this.groupsData) {
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.off(event, callback);
+ });
+
+ // remove all drawn groups
+ ids = this.groupsData.getIds();
+ this.groupsData = null;
+ this._onRemoveGroups(ids); // note: this will cause a redraw
+ }
+
+ // replace the dataset
+ if (!groups) {
+ this.groupsData = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ this.groupsData = groups;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (this.groupsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.on(event, callback, id);
+ });
+
+ // draw all ms
+ ids = this.groupsData.getIds();
+ this._onAddGroups(ids);
+ }
+
+ // update the group holding all ungrouped items
+ this._updateUngrouped();
+
+ // update the order of all items in each group
+ this._order();
+
+ this.body.emitter.emit('_change', { queue: true });
+ };
+
+ /**
+ * Get the current groups
+ * @returns {vis.DataSet | null} groups
+ */
+ ItemSet.prototype.getGroups = function () {
+ return this.groupsData;
+ };
+
+ /**
+ * Remove an item by its id
+ * @param {String | Number} id
+ */
+ ItemSet.prototype.removeItem = function (id) {
+ var item = this.itemsData.get(id),
+ dataset = this.itemsData.getDataSet();
+
+ if (item) {
+ // confirm deletion
+ this.options.onRemove(item, function (item) {
+ if (item) {
+ // remove by id here, it is possible that an item has no id defined
+ // itself, so better not delete by the item itself
+ dataset.remove(id);
+ }
+ });
+ }
+ };
+
+ /**
+ * Get the time of an item based on it's data and options.type
+ * @param {Object} itemData
+ * @returns {string} Returns the type
+ * @private
+ */
+ ItemSet.prototype._getType = function (itemData) {
+ return itemData.type || this.options.type || (itemData.end ? 'range' : 'box');
+ };
+
+ /**
+ * Get the group id for an item
+ * @param {Object} itemData
+ * @returns {string} Returns the groupId
+ * @private
+ */
+ ItemSet.prototype._getGroupId = function (itemData) {
+ var type = this._getType(itemData);
+ if (type == 'background' && itemData.group == undefined) {
+ return BACKGROUND;
+ } else {
+ return this.groupsData ? itemData.group : UNGROUPED;
+ }
+ };
+
+ /**
+ * Handle updated items
+ * @param {Number[]} ids
+ * @protected
+ */
+ ItemSet.prototype._onUpdate = function (ids) {
+ var me = this;
+
+ ids.forEach(function (id) {
+ var itemData = me.itemsData.get(id, me.itemOptions);
+ var item = me.items[id];
+ var type = me._getType(itemData);
+
+ var constructor = ItemSet.types[type];
+ var selected;
+
+ if (item) {
+ // update item
+ if (!constructor || !(item instanceof constructor)) {
+ // item type has changed, delete the item and recreate it
+ selected = item.selected; // preserve selection of this item
+ me._removeItem(item);
+ item = null;
+ } else {
+ me._updateItem(item, itemData);
+ }
+ }
+
+ if (!item) {
+ // create item
+ if (constructor) {
+ item = new constructor(itemData, me.conversion, me.options);
+ item.id = id; // TODO: not so nice setting id afterwards
+ me._addItem(item);
+ if (selected) {
+ this.selection.push(id);
+ item.select();
+ }
+ } else if (type == 'rangeoverflow') {
+ // TODO: deprecated since version 2.1.0 (or 3.0.0?). cleanup some day
+ throw new TypeError('Item type "rangeoverflow" is deprecated. Use css styling instead: ' + '.vis-item.vis-range .vis-item-content {overflow: visible;}');
+ } else {
+ throw new TypeError('Unknown item type "' + type + '"');
+ }
+ }
+ }.bind(this));
+
+ this._order();
+ this.stackDirty = true; // force re-stacking of all items next redraw
+ this.body.emitter.emit('_change', { queue: true });
+ };
+
+ /**
+ * Handle added items
+ * @param {Number[]} ids
+ * @protected
+ */
+ ItemSet.prototype._onAdd = ItemSet.prototype._onUpdate;
+
+ /**
+ * Handle removed items
+ * @param {Number[]} ids
+ * @protected
+ */
+ ItemSet.prototype._onRemove = function (ids) {
+ var count = 0;
+ var me = this;
+ ids.forEach(function (id) {
+ var item = me.items[id];
+ if (item) {
+ count++;
+ me._removeItem(item);
+ }
+ });
+
+ if (count) {
+ // update order
+ this._order();
+ this.stackDirty = true; // force re-stacking of all items next redraw
+ this.body.emitter.emit('_change', { queue: true });
+ }
+ };
+
+ /**
+ * Update the order of item in all groups
+ * @private
+ */
+ ItemSet.prototype._order = function () {
+ // reorder the items in all groups
+ // TODO: optimization: only reorder groups affected by the changed items
+ util.forEach(this.groups, function (group) {
+ group.order();
+ });
+ };
+
+ /**
+ * Handle updated groups
+ * @param {Number[]} ids
+ * @private
+ */
+ ItemSet.prototype._onUpdateGroups = function (ids) {
+ this._onAddGroups(ids);
+ };
+
+ /**
+ * Handle changed groups (added or updated)
+ * @param {Number[]} ids
+ * @private
+ */
+ ItemSet.prototype._onAddGroups = function (ids) {
+ var me = this;
+
+ ids.forEach(function (id) {
+ var groupData = me.groupsData.get(id);
+ var group = me.groups[id];
+
+ if (!group) {
+ // check for reserved ids
+ if (id == UNGROUPED || id == BACKGROUND) {
+ throw new Error('Illegal group id. ' + id + ' is a reserved id.');
+ }
+
+ var groupOptions = Object.create(me.options);
+ util.extend(groupOptions, {
+ height: null
+ });
+
+ group = new Group(id, groupData, me);
+ me.groups[id] = group;
+
+ // add items with this groupId to the new group
+ for (var itemId in me.items) {
+ if (me.items.hasOwnProperty(itemId)) {
+ var item = me.items[itemId];
+ if (item.data.group == id) {
+ group.add(item);
+ }
+ }
+ }
+
+ group.order();
+ group.show();
+ } else {
+ // update group
+ group.setData(groupData);
+ }
+ });
+
+ this.body.emitter.emit('_change', { queue: true });
+ };
+
+ /**
+ * Handle removed groups
+ * @param {Number[]} ids
+ * @private
+ */
+ ItemSet.prototype._onRemoveGroups = function (ids) {
+ var groups = this.groups;
+ ids.forEach(function (id) {
+ var group = groups[id];
+
+ if (group) {
+ group.hide();
+ delete groups[id];
+ }
+ });
+
+ this.markDirty();
+
+ this.body.emitter.emit('_change', { queue: true });
+ };
+
+ /**
+ * Reorder the groups if needed
+ * @return {boolean} changed
+ * @private
+ */
+ ItemSet.prototype._orderGroups = function () {
+ if (this.groupsData) {
+ // reorder the groups
+ var groupIds = this.groupsData.getIds({
+ order: this.options.groupOrder
+ });
+
+ var changed = !util.equalArray(groupIds, this.groupIds);
+ if (changed) {
+ // hide all groups, removes them from the DOM
+ var groups = this.groups;
+ groupIds.forEach(function (groupId) {
+ groups[groupId].hide();
+ });
+
+ // show the groups again, attach them to the DOM in correct order
+ groupIds.forEach(function (groupId) {
+ groups[groupId].show();
+ });
+
+ this.groupIds = groupIds;
+ }
+
+ return changed;
+ } else {
+ return false;
+ }
+ };
+
+ /**
+ * Add a new item
+ * @param {Item} item
+ * @private
+ */
+ ItemSet.prototype._addItem = function (item) {
+ this.items[item.id] = item;
+
+ // add to group
+ var groupId = this._getGroupId(item.data);
+ var group = this.groups[groupId];
+ if (group) group.add(item);
+ };
+
+ /**
+ * Update an existing item
+ * @param {Item} item
+ * @param {Object} itemData
+ * @private
+ */
+ ItemSet.prototype._updateItem = function (item, itemData) {
+ var oldGroupId = item.data.group;
+ var oldSubGroupId = item.data.subgroup;
+
+ // update the items data (will redraw the item when displayed)
+ item.setData(itemData);
+
+ // update group
+ if (oldGroupId != item.data.group || oldSubGroupId != item.data.subgroup) {
+ var oldGroup = this.groups[oldGroupId];
+ if (oldGroup) oldGroup.remove(item);
+
+ var groupId = this._getGroupId(item.data);
+ var group = this.groups[groupId];
+ if (group) group.add(item);
+ }
+ };
+
+ /**
+ * Delete an item from the ItemSet: remove it from the DOM, from the map
+ * with items, and from the map with visible items, and from the selection
+ * @param {Item} item
+ * @private
+ */
+ ItemSet.prototype._removeItem = function (item) {
+ // remove from DOM
+ item.hide();
+
+ // remove from items
+ delete this.items[item.id];
+
+ // remove from selection
+ var index = this.selection.indexOf(item.id);
+ if (index != -1) this.selection.splice(index, 1);
+
+ // remove from group
+ item.parent && item.parent.remove(item);
+ };
+
+ /**
+ * Create an array containing all items being a range (having an end date)
+ * @param array
+ * @returns {Array}
+ * @private
+ */
+ ItemSet.prototype._constructByEndArray = function (array) {
+ var endArray = [];
+
+ for (var i = 0; i < array.length; i++) {
+ if (array[i] instanceof RangeItem) {
+ endArray.push(array[i]);
+ }
+ }
+ return endArray;
+ };
+
+ /**
+ * Register the clicked item on touch, before dragStart is initiated.
+ *
+ * dragStart is initiated from a mousemove event, AFTER the mouse/touch is
+ * already moving. Therefore, the mouse/touch can sometimes be above an other
+ * DOM element than the item itself.
+ *
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onTouch = function (event) {
+ // store the touched item, used in _onDragStart
+ this.touchParams.item = this.itemFromTarget(event);
+ this.touchParams.dragLeftItem = event.target.dragLeftItem || false;
+ this.touchParams.dragRightItem = event.target.dragRightItem || false;
+ this.touchParams.itemProps = null;
+ };
+
+ /**
+ * Given an group id, returns the index it has.
+ *
+ * @param {Number} groupID
+ * @private
+ */
+ ItemSet.prototype._getGroupIndex = function (groupId) {
+ for (var i = 0; i < this.groupIds.length; i++) {
+ if (groupId == this.groupIds[i]) return i;
+ }
+ };
+
+ /**
+ * Start dragging the selected events
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDragStart = function (event) {
+ var item = this.touchParams.item || null;
+ var me = this;
+ var props;
+
+ if (item && (item.selected || this.options.itemsAlwaysDraggable)) {
+
+ if (!this.options.editable.updateTime && !this.options.editable.updateGroup && !item.editable) {
+ return;
+ }
+
+ // override options.editable
+ if (item.editable === false) {
+ return;
+ }
+
+ var dragLeftItem = this.touchParams.dragLeftItem;
+ var dragRightItem = this.touchParams.dragRightItem;
+
+ if (dragLeftItem) {
+ props = {
+ item: dragLeftItem,
+ initialX: event.center.x,
+ dragLeft: true,
+ data: this._cloneItemData(item.data)
+ };
+
+ this.touchParams.itemProps = [props];
+ } else if (dragRightItem) {
+ props = {
+ item: dragRightItem,
+ initialX: event.center.x,
+ dragRight: true,
+ data: this._cloneItemData(item.data)
+ };
+
+ this.touchParams.itemProps = [props];
+ } else {
+ this.touchParams.selectedItem = item;
+
+ var baseGroupIndex = this._getGroupIndex(item.data.group);
+
+ var itemsToDrag = this.options.itemsAlwaysDraggable && !item.selected ? [item.id] : this.getSelection();
+
+ this.touchParams.itemProps = itemsToDrag.map(function (id) {
+ var item = me.items[id];
+ var groupIndex = me._getGroupIndex(item.data.group);
+ return {
+ item: item,
+ initialX: event.center.x,
+ groupOffset: baseGroupIndex - groupIndex,
+ data: this._cloneItemData(item.data)
+ };
+ }.bind(this));
+ }
+
+ event.stopPropagation();
+ } else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {
+ // create a new range item when dragging with ctrl key down
+ this._onDragStartAddItem(event);
+ }
+ };
+
+ /**
+ * Start creating a new range item by dragging.
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDragStartAddItem = function (event) {
+ var snap = this.options.snap || null;
+
+ if (this.options.rtl) {
+ var xAbs = util.getAbsoluteRight(this.dom.frame);
+ var x = xAbs - event.center.x + 10; // plus 10 to compensate for the drag starting as soon as you've moved 10px
+ } else {
+ var xAbs = util.getAbsoluteLeft(this.dom.frame);
+ var x = event.center.x - xAbs - 10; // minus 10 to compensate for the drag starting as soon as you've moved 10px
+ }
+
+ var time = this.body.util.toTime(x);
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+ var start = snap ? snap(time, scale, step) : time;
+ var end = start;
+
+ var itemData = {
+ type: 'range',
+ start: start,
+ end: end,
+ content: 'new item'
+ };
+
+ var id = util.randomUUID();
+ itemData[this.itemsData._fieldId] = id;
+
+ var group = this.groupFromTarget(event);
+ if (group) {
+ itemData.group = group.groupId;
+ }
+ var newItem = new RangeItem(itemData, this.conversion, this.options);
+ newItem.id = id; // TODO: not so nice setting id afterwards
+ newItem.data = this._cloneItemData(itemData);
+ this._addItem(newItem);
+
+ var props = {
+ item: newItem,
+ initialX: event.center.x,
+ data: newItem.data
+ };
+
+ if (this.options.rtl) {
+ props.dragLeft = true;
+ } else {
+ props.dragRight = true;
+ }
+ this.touchParams.itemProps = [props];
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Drag selected items
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDrag = function (event) {
+ if (this.touchParams.itemProps) {
+ event.stopPropagation();
+
+ var me = this;
+ var snap = this.options.snap || null;
+
+ if (this.options.rtl) {
+ var xOffset = this.body.dom.root.offsetLeft + this.body.domProps.right.width;
+ } else {
+ var xOffset = this.body.dom.root.offsetLeft + this.body.domProps.left.width;
+ }
+
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+
+ //only calculate the new group for the item that's actually dragged
+ var selectedItem = this.touchParams.selectedItem;
+ var updateGroupAllowed = me.options.editable.updateGroup;
+ var newGroupBase = null;
+ if (updateGroupAllowed && selectedItem) {
+ if (selectedItem.data.group != undefined) {
+ // drag from one group to another
+ var group = me.groupFromTarget(event);
+ if (group) {
+ //we know the offset for all items, so the new group for all items
+ //will be relative to this one.
+ newGroupBase = this._getGroupIndex(group.groupId);
+ }
+ }
+ }
+
+ // move
+ this.touchParams.itemProps.forEach(function (props) {
+ var current = me.body.util.toTime(event.center.x - xOffset);
+ var initial = me.body.util.toTime(props.initialX - xOffset);
+
+ if (this.options.rtl) {
+ var offset = -(current - initial); // ms
+ } else {
+ var offset = current - initial; // ms
+ }
+
+ var itemData = this._cloneItemData(props.item.data); // clone the data
+ if (props.item.editable === false) {
+ return;
+ }
+
+ var updateTimeAllowed = me.options.editable.updateTime || props.item.editable === true;
+ if (updateTimeAllowed) {
+ if (props.dragLeft) {
+ // drag left side of a range item
+ if (this.options.rtl) {
+ if (itemData.end != undefined) {
+ var initialEnd = util.convert(props.data.end, 'Date');
+ var end = new Date(initialEnd.valueOf() + offset);
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.end = snap ? snap(end, scale, step) : end;
+ }
+ } else {
+ if (itemData.start != undefined) {
+ var initialStart = util.convert(props.data.start, 'Date');
+ var start = new Date(initialStart.valueOf() + offset);
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ }
+ }
+ } else if (props.dragRight) {
+ // drag right side of a range item
+ if (this.options.rtl) {
+ if (itemData.start != undefined) {
+ var initialStart = util.convert(props.data.start, 'Date');
+ var start = new Date(initialStart.valueOf() + offset);
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ }
+ } else {
+ if (itemData.end != undefined) {
+ var initialEnd = util.convert(props.data.end, 'Date');
+ var end = new Date(initialEnd.valueOf() + offset);
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.end = snap ? snap(end, scale, step) : end;
+ }
+ }
+ } else {
+ // drag both start and end
+ if (itemData.start != undefined) {
+
+ var initialStart = util.convert(props.data.start, 'Date').valueOf();
+ var start = new Date(initialStart + offset);
+
+ if (itemData.end != undefined) {
+ var initialEnd = util.convert(props.data.end, 'Date');
+ var duration = initialEnd.valueOf() - initialStart.valueOf();
+
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ itemData.end = new Date(itemData.start.valueOf() + duration);
+ } else {
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ }
+ }
+ }
+ }
+
+ var updateGroupAllowed = me.options.editable.updateGroup || props.item.editable === true;
+
+ if (updateGroupAllowed && !props.dragLeft && !props.dragRight && newGroupBase != null) {
+ if (itemData.group != undefined) {
+ var newOffset = newGroupBase - props.groupOffset;
+
+ //make sure we stay in bounds
+ newOffset = Math.max(0, newOffset);
+ newOffset = Math.min(me.groupIds.length - 1, newOffset);
+
+ itemData.group = me.groupIds[newOffset];
+ }
+ }
+
+ // confirm moving the item
+ itemData = this._cloneItemData(itemData); // convert start and end to the correct type
+ me.options.onMoving(itemData, function (itemData) {
+ if (itemData) {
+ props.item.setData(this._cloneItemData(itemData, 'Date'));
+ }
+ }.bind(this));
+ }.bind(this));
+
+ this.stackDirty = true; // force re-stacking of all items next redraw
+ this.body.emitter.emit('_change');
+ }
+ };
+
+ /**
+ * Move an item to another group
+ * @param {Item} item
+ * @param {String | Number} groupId
+ * @private
+ */
+ ItemSet.prototype._moveToGroup = function (item, groupId) {
+ var group = this.groups[groupId];
+ if (group && group.groupId != item.data.group) {
+ var oldGroup = item.parent;
+ oldGroup.remove(item);
+ oldGroup.order();
+ group.add(item);
+ group.order();
+
+ item.data.group = group.groupId;
+ }
+ };
+
+ /**
+ * End of dragging selected items
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDragEnd = function (event) {
+ if (this.touchParams.itemProps) {
+ event.stopPropagation();
+
+ var me = this;
+ var dataset = this.itemsData.getDataSet();
+ var itemProps = this.touchParams.itemProps;
+ this.touchParams.itemProps = null;
+
+ itemProps.forEach(function (props) {
+ var id = props.item.id;
+ var exists = me.itemsData.get(id, me.itemOptions) != null;
+
+ if (!exists) {
+ // add a new item
+ me.options.onAdd(props.item.data, function (itemData) {
+ me._removeItem(props.item); // remove temporary item
+ if (itemData) {
+ me.itemsData.getDataSet().add(itemData);
+ }
+
+ // force re-stacking of all items next redraw
+ me.stackDirty = true;
+ me.body.emitter.emit('_change');
+ });
+ } else {
+ // update existing item
+ var itemData = this._cloneItemData(props.item.data); // convert start and end to the correct type
+ me.options.onMove(itemData, function (itemData) {
+ if (itemData) {
+ // apply changes
+ itemData[dataset._fieldId] = id; // ensure the item contains its id (can be undefined)
+ dataset.update(itemData);
+ } else {
+ // restore original values
+ props.item.setData(props.data);
+
+ me.stackDirty = true; // force re-stacking of all items next redraw
+ me.body.emitter.emit('_change');
+ }
+ });
+ }
+ }.bind(this));
+ }
+ };
+
+ ItemSet.prototype._onGroupDragStart = function (event) {
+ if (this.options.groupEditable.order) {
+ this.groupTouchParams.group = this.groupFromTarget(event);
+
+ if (this.groupTouchParams.group) {
+ event.stopPropagation();
+
+ this.groupTouchParams.originalOrder = this.groupsData.getIds({
+ order: this.options.groupOrder
+ });
+ }
+ }
+ };
+
+ ItemSet.prototype._onGroupDrag = function (event) {
+ if (this.options.groupEditable.order && this.groupTouchParams.group) {
+ event.stopPropagation();
+
+ // drag from one group to another
+ var group = this.groupFromTarget(event);
+
+ // try to avoid toggling when groups differ in height
+ if (group && group.height != this.groupTouchParams.group.height) {
+ var movingUp = group.top < this.groupTouchParams.group.top;
+ var clientY = event.center ? event.center.y : event.clientY;
+ var targetGroupTop = util.getAbsoluteTop(group.dom.foreground);
+ var draggedGroupHeight = this.groupTouchParams.group.height;
+ if (movingUp) {
+ // skip swapping the groups when the dragged group is not below clientY afterwards
+ if (targetGroupTop + draggedGroupHeight < clientY) {
+ return;
+ }
+ } else {
+ var targetGroupHeight = group.height;
+ // skip swapping the groups when the dragged group is not below clientY afterwards
+ if (targetGroupTop + targetGroupHeight - draggedGroupHeight > clientY) {
+ return;
+ }
+ }
+ }
+
+ if (group && group != this.groupTouchParams.group) {
+ var groupsData = this.groupsData;
+ var targetGroup = groupsData.get(group.groupId);
+ var draggedGroup = groupsData.get(this.groupTouchParams.group.groupId);
+
+ // switch groups
+ if (draggedGroup && targetGroup) {
+ this.options.groupOrderSwap(draggedGroup, targetGroup, this.groupsData);
+ this.groupsData.update(draggedGroup);
+ this.groupsData.update(targetGroup);
+ }
+
+ // fetch current order of groups
+ var newOrder = this.groupsData.getIds({
+ order: this.options.groupOrder
+ });
+
+ // in case of changes since _onGroupDragStart
+ if (!util.equalArray(newOrder, this.groupTouchParams.originalOrder)) {
+ var groupsData = this.groupsData;
+ var origOrder = this.groupTouchParams.originalOrder;
+ var draggedId = this.groupTouchParams.group.groupId;
+ var numGroups = Math.min(origOrder.length, newOrder.length);
+ var curPos = 0;
+ var newOffset = 0;
+ var orgOffset = 0;
+ while (curPos < numGroups) {
+ // as long as the groups are where they should be step down along the groups order
+ while (curPos + newOffset < numGroups && curPos + orgOffset < numGroups && newOrder[curPos + newOffset] == origOrder[curPos + orgOffset]) {
+ curPos++;
+ }
+
+ // all ok
+ if (curPos + newOffset >= numGroups) {
+ break;
+ }
+
+ // not all ok
+ // if dragged group was move upwards everything below should have an offset
+ if (newOrder[curPos + newOffset] == draggedId) {
+ newOffset = 1;
+ continue;
+ }
+ // if dragged group was move downwards everything above should have an offset
+ else if (origOrder[curPos + orgOffset] == draggedId) {
+ orgOffset = 1;
+ continue;
+ }
+ // found a group (apart from dragged group) that has the wrong position -> switch with the
+ // group at the position where other one should be, fix index arrays and continue
+ else {
+ var slippedPosition = newOrder.indexOf(origOrder[curPos + orgOffset]);
+ var switchGroup = groupsData.get(newOrder[curPos + newOffset]);
+ var shouldBeGroup = groupsData.get(origOrder[curPos + orgOffset]);
+ this.options.groupOrderSwap(switchGroup, shouldBeGroup, groupsData);
+ groupsData.update(switchGroup);
+ groupsData.update(shouldBeGroup);
+
+ var switchGroupId = newOrder[curPos + newOffset];
+ newOrder[curPos + newOffset] = origOrder[curPos + orgOffset];
+ newOrder[slippedPosition] = switchGroupId;
+
+ curPos++;
+ }
+ }
+ }
+ }
+ }
+ };
+
+ ItemSet.prototype._onGroupDragEnd = function (event) {
+ if (this.options.groupEditable.order && this.groupTouchParams.group) {
+ event.stopPropagation();
+
+ // update existing group
+ var me = this;
+ var id = me.groupTouchParams.group.groupId;
+ var dataset = me.groupsData.getDataSet();
+ var groupData = util.extend({}, dataset.get(id)); // clone the data
+ me.options.onMoveGroup(groupData, function (groupData) {
+ if (groupData) {
+ // apply changes
+ groupData[dataset._fieldId] = id; // ensure the group contains its id (can be undefined)
+ dataset.update(groupData);
+ } else {
+
+ // fetch current order of groups
+ var newOrder = dataset.getIds({
+ order: me.options.groupOrder
+ });
+
+ // restore original order
+ if (!util.equalArray(newOrder, me.groupTouchParams.originalOrder)) {
+ var origOrder = me.groupTouchParams.originalOrder;
+ var numGroups = Math.min(origOrder.length, newOrder.length);
+ var curPos = 0;
+ while (curPos < numGroups) {
+ // as long as the groups are where they should be step down along the groups order
+ while (curPos < numGroups && newOrder[curPos] == origOrder[curPos]) {
+ curPos++;
+ }
+
+ // all ok
+ if (curPos >= numGroups) {
+ break;
+ }
+
+ // found a group that has the wrong position -> switch with the
+ // group at the position where other one should be, fix index arrays and continue
+ var slippedPosition = newOrder.indexOf(origOrder[curPos]);
+ var switchGroup = dataset.get(newOrder[curPos]);
+ var shouldBeGroup = dataset.get(origOrder[curPos]);
+ me.options.groupOrderSwap(switchGroup, shouldBeGroup, dataset);
+ groupsData.update(switchGroup);
+ groupsData.update(shouldBeGroup);
+
+ var switchGroupId = newOrder[curPos];
+ newOrder[curPos] = origOrder[curPos];
+ newOrder[slippedPosition] = switchGroupId;
+
+ curPos++;
+ }
+ }
+ }
+ });
+
+ me.body.emitter.emit('groupDragged', { groupId: id });
+ }
+ };
+
+ /**
+ * Handle selecting/deselecting an item when tapping it
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onSelectItem = function (event) {
+ if (!this.options.selectable) return;
+
+ var ctrlKey = event.srcEvent && (event.srcEvent.ctrlKey || event.srcEvent.metaKey);
+ var shiftKey = event.srcEvent && event.srcEvent.shiftKey;
+ if (ctrlKey || shiftKey) {
+ this._onMultiSelectItem(event);
+ return;
+ }
+
+ var oldSelection = this.getSelection();
+
+ var item = this.itemFromTarget(event);
+ var selection = item ? [item.id] : [];
+ this.setSelection(selection);
+
+ var newSelection = this.getSelection();
+
+ // emit a select event,
+ // except when old selection is empty and new selection is still empty
+ if (newSelection.length > 0 || oldSelection.length > 0) {
+ this.body.emitter.emit('select', {
+ items: newSelection,
+ event: event
+ });
+ }
+ };
+
+ /**
+ * Handle creation and updates of an item on double tap
+ * @param event
+ * @private
+ */
+ ItemSet.prototype._onAddItem = function (event) {
+ if (!this.options.selectable) return;
+ if (!this.options.editable.add) return;
+
+ var me = this;
+ var snap = this.options.snap || null;
+ var item = this.itemFromTarget(event);
+
+ if (item) {
+ // update item
+
+ // execute async handler to update the item (or cancel it)
+ var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset
+ this.options.onUpdate(itemData, function (itemData) {
+ if (itemData) {
+ me.itemsData.getDataSet().update(itemData);
+ }
+ });
+ } else {
+ // add item
+ if (this.options.rtl) {
+ var xAbs = util.getAbsoluteRight(this.dom.frame);
+ var x = xAbs - event.center.x;
+ } else {
+ var xAbs = util.getAbsoluteLeft(this.dom.frame);
+ var x = event.center.x - xAbs;
+ }
+ // var xAbs = util.getAbsoluteLeft(this.dom.frame);
+ // var x = event.center.x - xAbs;
+ var start = this.body.util.toTime(x);
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+
+ var newItemData = {
+ start: snap ? snap(start, scale, step) : start,
+ content: 'new item'
+ };
+
+ // when default type is a range, add a default end date to the new item
+ if (this.options.type === 'range') {
+ var end = this.body.util.toTime(x + this.props.width / 5);
+ newItemData.end = snap ? snap(end, scale, step) : end;
+ }
+
+ newItemData[this.itemsData._fieldId] = util.randomUUID();
+
+ var group = this.groupFromTarget(event);
+ if (group) {
+ newItemData.group = group.groupId;
+ }
+
+ // execute async handler to customize (or cancel) adding an item
+ newItemData = this._cloneItemData(newItemData); // convert start and end to the correct type
+ this.options.onAdd(newItemData, function (item) {
+ if (item) {
+ me.itemsData.getDataSet().add(item);
+ // TODO: need to trigger a redraw?
+ }
+ });
+ }
+ };
+
+ /**
+ * Handle selecting/deselecting multiple items when holding an item
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onMultiSelectItem = function (event) {
+ if (!this.options.selectable) return;
+
+ var item = this.itemFromTarget(event);
+
+ if (item) {
+ // multi select items (if allowed)
+
+ var selection = this.options.multiselect ? this.getSelection() // take current selection
+ : []; // deselect current selection
+
+ var shiftKey = event.srcEvent && event.srcEvent.shiftKey || false;
+
+ if (shiftKey && this.options.multiselect) {
+ // select all items between the old selection and the tapped item
+ var itemGroup = this.itemsData.get(item.id).group;
+
+ // when filtering get the group of the last selected item
+ var lastSelectedGroup = undefined;
+ if (this.options.multiselectPerGroup) {
+ if (selection.length > 0) {
+ lastSelectedGroup = this.itemsData.get(selection[0]).group;
+ }
+ }
+
+ // determine the selection range
+ if (!this.options.multiselectPerGroup || lastSelectedGroup == undefined || lastSelectedGroup == itemGroup) {
+ selection.push(item.id);
+ }
+ var range = ItemSet._getItemRange(this.itemsData.get(selection, this.itemOptions));
+
+ if (!this.options.multiselectPerGroup || lastSelectedGroup == itemGroup) {
+ // select all items within the selection range
+ selection = [];
+ for (var id in this.items) {
+ if (this.items.hasOwnProperty(id)) {
+ var _item = this.items[id];
+ var start = _item.data.start;
+ var end = _item.data.end !== undefined ? _item.data.end : start;
+
+ if (start >= range.min && end <= range.max && (!this.options.multiselectPerGroup || lastSelectedGroup == this.itemsData.get(_item.id).group) && !(_item instanceof BackgroundItem)) {
+ selection.push(_item.id); // do not use id but item.id, id itself is stringified
+ }
+ }
+ }
+ }
+ } else {
+ // add/remove this item from the current selection
+ var index = selection.indexOf(item.id);
+ if (index == -1) {
+ // item is not yet selected -> select it
+ selection.push(item.id);
+ } else {
+ // item is already selected -> deselect it
+ selection.splice(index, 1);
+ }
+ }
+
+ this.setSelection(selection);
+
+ this.body.emitter.emit('select', {
+ items: this.getSelection(),
+ event: event
+ });
+ }
+ };
+
+ /**
+ * Calculate the time range of a list of items
+ * @param {Array.<Object>} itemsData
+ * @return {{min: Date, max: Date}} Returns the range of the provided items
+ * @private
+ */
+ ItemSet._getItemRange = function (itemsData) {
+ var max = null;
+ var min = null;
+
+ itemsData.forEach(function (data) {
+ if (min == null || data.start < min) {
+ min = data.start;
+ }
+
+ if (data.end != undefined) {
+ if (max == null || data.end > max) {
+ max = data.end;
+ }
+ } else {
+ if (max == null || data.start > max) {
+ max = data.start;
+ }
+ }
+ });
+
+ return {
+ min: min,
+ max: max
+ };
+ };
+
+ /**
+ * Find an item from an event target:
+ * searches for the attribute 'timeline-item' in the event target's element tree
+ * @param {Event} event
+ * @return {Item | null} item
+ */
+ ItemSet.prototype.itemFromTarget = function (event) {
+ var target = event.target;
+ while (target) {
+ if (target.hasOwnProperty('timeline-item')) {
+ return target['timeline-item'];
+ }
+ target = target.parentNode;
+ }
+
+ return null;
+ };
+
+ /**
+ * Find the Group from an event target:
+ * searches for the attribute 'timeline-group' in the event target's element tree
+ * @param {Event} event
+ * @return {Group | null} group
+ */
+ ItemSet.prototype.groupFromTarget = function (event) {
+ var clientY = event.center ? event.center.y : event.clientY;
+ for (var i = 0; i < this.groupIds.length; i++) {
+ var groupId = this.groupIds[i];
+ var group = this.groups[groupId];
+ var foreground = group.dom.foreground;
+ var top = util.getAbsoluteTop(foreground);
+ if (clientY > top && clientY < top + foreground.offsetHeight) {
+ return group;
+ }
+
+ if (this.options.orientation.item === 'top') {
+ if (i === this.groupIds.length - 1 && clientY > top) {
+ return group;
+ }
+ } else {
+ if (i === 0 && clientY < top + foreground.offset) {
+ return group;
+ }
+ }
+ }
+
+ return null;
+ };
+
+ /**
+ * Find the ItemSet from an event target:
+ * searches for the attribute 'timeline-itemset' in the event target's element tree
+ * @param {Event} event
+ * @return {ItemSet | null} item
+ */
+ ItemSet.itemSetFromTarget = function (event) {
+ var target = event.target;
+ while (target) {
+ if (target.hasOwnProperty('timeline-itemset')) {
+ return target['timeline-itemset'];
+ }
+ target = target.parentNode;
+ }
+
+ return null;
+ };
+
+ /**
+ * Clone the data of an item, and "normalize" it: convert the start and end date
+ * to the type (Date, Moment, ...) configured in the DataSet. If not configured,
+ * start and end are converted to Date.
+ * @param {Object} itemData, typically `item.data`
+ * @param {string} [type] Optional Date type. If not provided, the type from the DataSet is taken
+ * @return {Object} The cloned object
+ * @private
+ */
+ ItemSet.prototype._cloneItemData = function (itemData, type) {
+ var clone = util.extend({}, itemData);
+
+ if (!type) {
+ // convert start and end date to the type (Date, Moment, ...) configured in the DataSet
+ type = this.itemsData.getDataSet()._options.type;
+ }
+
+ if (clone.start != undefined) {
+ clone.start = util.convert(clone.start, type && type.start || 'Date');
+ }
+ if (clone.end != undefined) {
+ clone.end = util.convert(clone.end, type && type.end || 'Date');
+ }
+
+ return clone;
+ };
+
+ module.exports = ItemSet;
+
+/***/ },
+/* 35 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var moment = __webpack_require__(2);
+ var DateUtil = __webpack_require__(32);
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor TimeStep
+ * The class TimeStep is an iterator for dates. You provide a start date and an
+ * end date. The class itself determines the best scale (step size) based on the
+ * provided start Date, end Date, and minimumStep.
+ *
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ *
+ * Alternatively, you can set a scale by hand.
+ * After creation, you can initialize the class by executing first(). Then you
+ * can iterate from the start date to the end date via next(). You can check if
+ * the end date is reached with the function hasNext(). After each step, you can
+ * retrieve the current date via getCurrent().
+ * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,
+ * days, to years.
+ *
+ * Version: 1.2
+ *
+ * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
+ * or new Date(2010, 9, 21, 23, 45, 00)
+ * @param {Date} [end] The end date
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
+ */
+ function TimeStep(start, end, minimumStep, hiddenDates) {
+ this.moment = moment;
+
+ // variables
+ this.current = this.moment();
+ this._start = this.moment();
+ this._end = this.moment();
+
+ this.autoScale = true;
+ this.scale = 'day';
+ this.step = 1;
+
+ // initialize the range
+ this.setRange(start, end, minimumStep);
+
+ // hidden Dates options
+ this.switchedDay = false;
+ this.switchedMonth = false;
+ this.switchedYear = false;
+ if (Array.isArray(hiddenDates)) {
+ this.hiddenDates = hiddenDates;
+ } else if (hiddenDates != undefined) {
+ this.hiddenDates = [hiddenDates];
+ } else {
+ this.hiddenDates = [];
+ }
+
+ this.format = TimeStep.FORMAT; // default formatting
+ }
+
+ // Time formatting
+ TimeStep.FORMAT = {
+ minorLabels: {
+ millisecond: 'SSS',
+ second: 's',
+ minute: 'HH:mm',
+ hour: 'HH:mm',
+ weekday: 'ddd D',
+ day: 'D',
+ month: 'MMM',
+ year: 'YYYY'
+ },
+ majorLabels: {
+ millisecond: 'HH:mm:ss',
+ second: 'D MMMM HH:mm',
+ minute: 'ddd D MMMM',
+ hour: 'ddd D MMMM',
+ weekday: 'MMMM YYYY',
+ day: 'MMMM YYYY',
+ month: 'YYYY',
+ year: ''
+ }
+ };
+
+ /**
+ * Set custom constructor function for moment. Can be used to set dates
+ * to UTC or to set a utcOffset.
+ * @param {function} moment
+ */
+ TimeStep.prototype.setMoment = function (moment) {
+ this.moment = moment;
+
+ // update the date properties, can have a new utcOffset
+ this.current = this.moment(this.current);
+ this._start = this.moment(this._start);
+ this._end = this.moment(this._end);
+ };
+
+ /**
+ * Set custom formatting for the minor an major labels of the TimeStep.
+ * Both `minorLabels` and `majorLabels` are an Object with properties:
+ * 'millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'.
+ * @param {{minorLabels: Object, majorLabels: Object}} format
+ */
+ TimeStep.prototype.setFormat = function (format) {
+ var defaultFormat = util.deepExtend({}, TimeStep.FORMAT);
+ this.format = util.deepExtend(defaultFormat, format);
+ };
+
+ /**
+ * Set a new range
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ * @param {Date} [start] The start date and time.
+ * @param {Date} [end] The end date and time.
+ * @param {int} [minimumStep] Optional. Minimum step size in milliseconds
+ */
+ TimeStep.prototype.setRange = function (start, end, minimumStep) {
+ if (!(start instanceof Date) || !(end instanceof Date)) {
+ throw "No legal start or end date in method setRange";
+ }
+
+ this._start = start != undefined ? this.moment(start.valueOf()) : new Date();
+ this._end = end != undefined ? this.moment(end.valueOf()) : new Date();
+
+ if (this.autoScale) {
+ this.setMinimumStep(minimumStep);
+ }
+ };
+
+ /**
+ * Set the range iterator to the start date.
+ */
+ TimeStep.prototype.start = function () {
+ this.current = this._start.clone();
+ this.roundToMinor();
+ };
+
+ /**
+ * Round the current date to the first minor date value
+ * This must be executed once when the current date is set to start Date
+ */
+ TimeStep.prototype.roundToMinor = function () {
+ // round to floor
+ // IMPORTANT: we have no breaks in this switch! (this is no bug)
+ // noinspection FallThroughInSwitchStatementJS
+ switch (this.scale) {
+ case 'year':
+ this.current.year(this.step * Math.floor(this.current.year() / this.step));
+ this.current.month(0);
+ case 'month':
+ this.current.date(1);
+ case 'day': // intentional fall through
+ case 'weekday':
+ this.current.hours(0);
+ case 'hour':
+ this.current.minutes(0);
+ case 'minute':
+ this.current.seconds(0);
+ case 'second':
+ this.current.milliseconds(0);
+ //case 'millisecond': // nothing to do for milliseconds
+ }
+
+ if (this.step != 1) {
+ // round down to the first minor value that is a multiple of the current step size
+ switch (this.scale) {
+ case 'millisecond':
+ this.current.subtract(this.current.milliseconds() % this.step, 'milliseconds');break;
+ case 'second':
+ this.current.subtract(this.current.seconds() % this.step, 'seconds');break;
+ case 'minute':
+ this.current.subtract(this.current.minutes() % this.step, 'minutes');break;
+ case 'hour':
+ this.current.subtract(this.current.hours() % this.step, 'hours');break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ this.current.subtract((this.current.date() - 1) % this.step, 'day');break;
+ case 'month':
+ this.current.subtract(this.current.month() % this.step, 'month');break;
+ case 'year':
+ this.current.subtract(this.current.year() % this.step, 'year');break;
+ default:
+ break;
+ }
+ }
+ };
+
+ /**
+ * Check if the there is a next step
+ * @return {boolean} true if the current date has not passed the end date
+ */
+ TimeStep.prototype.hasNext = function () {
+ return this.current.valueOf() <= this._end.valueOf();
+ };
+
+ /**
+ * Do the next step
+ */
+ TimeStep.prototype.next = function () {
+ var prev = this.current.valueOf();
+
+ // Two cases, needed to prevent issues with switching daylight savings
+ // (end of March and end of October)
+ if (this.current.month() < 6) {
+ switch (this.scale) {
+ case 'millisecond':
+ this.current.add(this.step, 'millisecond');break;
+ case 'second':
+ this.current.add(this.step, 'second');break;
+ case 'minute':
+ this.current.add(this.step, 'minute');break;
+ case 'hour':
+ this.current.add(this.step, 'hour');
+ // in case of skipping an hour for daylight savings, adjust the hour again (else you get: 0h 5h 9h ... instead of 0h 4h 8h ...)
+ // TODO: is this still needed now we use the function of moment.js?
+ this.current.subtract(this.current.hours() % this.step, 'hour');
+ break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ this.current.add(this.step, 'day');break;
+ case 'month':
+ this.current.add(this.step, 'month');break;
+ case 'year':
+ this.current.add(this.step, 'year');break;
+ default:
+ break;
+ }
+ } else {
+ switch (this.scale) {
+ case 'millisecond':
+ this.current.add(this.step, 'millisecond');break;
+ case 'second':
+ this.current.add(this.step, 'second');break;
+ case 'minute':
+ this.current.add(this.step, 'minute');break;
+ case 'hour':
+ this.current.add(this.step, 'hour');break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ this.current.add(this.step, 'day');break;
+ case 'month':
+ this.current.add(this.step, 'month');break;
+ case 'year':
+ this.current.add(this.step, 'year');break;
+ default:
+ break;
+ }
+ }
+
+ if (this.step != 1) {
+ // round down to the correct major value
+ switch (this.scale) {
+ case 'millisecond':
+ if (this.current.milliseconds() < this.step) this.current.milliseconds(0);break;
+ case 'second':
+ if (this.current.seconds() < this.step) this.current.seconds(0);break;
+ case 'minute':
+ if (this.current.minutes() < this.step) this.current.minutes(0);break;
+ case 'hour':
+ if (this.current.hours() < this.step) this.current.hours(0);break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ if (this.current.date() < this.step + 1) this.current.date(1);break;
+ case 'month':
+ if (this.current.month() < this.step) this.current.month(0);break;
+ case 'year':
+ break; // nothing to do for year
+ default:
+ break;
+ }
+ }
+
+ // safety mechanism: if current time is still unchanged, move to the end
+ if (this.current.valueOf() == prev) {
+ this.current = this._end.clone();
+ }
+
+ DateUtil.stepOverHiddenDates(this.moment, this, prev);
+ };
+
+ /**
+ * Get the current datetime
+ * @return {Moment} current The current date
+ */
+ TimeStep.prototype.getCurrent = function () {
+ return this.current;
+ };
+
+ /**
+ * Set a custom scale. Autoscaling will be disabled.
+ * For example setScale('minute', 5) will result
+ * in minor steps of 5 minutes, and major steps of an hour.
+ *
+ * @param {{scale: string, step: number}} params
+ * An object containing two properties:
+ * - A string 'scale'. Choose from 'millisecond', 'second',
+ * 'minute', 'hour', 'weekday', 'day', 'month', 'year'.
+ * - A number 'step'. A step size, by default 1.
+ * Choose for example 1, 2, 5, or 10.
+ */
+ TimeStep.prototype.setScale = function (params) {
+ if (params && typeof params.scale == 'string') {
+ this.scale = params.scale;
+ this.step = params.step > 0 ? params.step : 1;
+ this.autoScale = false;
+ }
+ };
+
+ /**
+ * Enable or disable autoscaling
+ * @param {boolean} enable If true, autoascaling is set true
+ */
+ TimeStep.prototype.setAutoScale = function (enable) {
+ this.autoScale = enable;
+ };
+
+ /**
+ * Automatically determine the scale that bests fits the provided minimum step
+ * @param {Number} [minimumStep] The minimum step size in milliseconds
+ */
+ TimeStep.prototype.setMinimumStep = function (minimumStep) {
+ if (minimumStep == undefined) {
+ return;
+ }
+
+ //var b = asc + ds;
+
+ var stepYear = 1000 * 60 * 60 * 24 * 30 * 12;
+ var stepMonth = 1000 * 60 * 60 * 24 * 30;
+ var stepDay = 1000 * 60 * 60 * 24;
+ var stepHour = 1000 * 60 * 60;
+ var stepMinute = 1000 * 60;
+ var stepSecond = 1000;
+ var stepMillisecond = 1;
+
+ // find the smallest step that is larger than the provided minimumStep
+ if (stepYear * 1000 > minimumStep) {
+ this.scale = 'year';this.step = 1000;
+ }
+ if (stepYear * 500 > minimumStep) {
+ this.scale = 'year';this.step = 500;
+ }
+ if (stepYear * 100 > minimumStep) {
+ this.scale = 'year';this.step = 100;
+ }
+ if (stepYear * 50 > minimumStep) {
+ this.scale = 'year';this.step = 50;
+ }
+ if (stepYear * 10 > minimumStep) {
+ this.scale = 'year';this.step = 10;
+ }
+ if (stepYear * 5 > minimumStep) {
+ this.scale = 'year';this.step = 5;
+ }
+ if (stepYear > minimumStep) {
+ this.scale = 'year';this.step = 1;
+ }
+ if (stepMonth * 3 > minimumStep) {
+ this.scale = 'month';this.step = 3;
+ }
+ if (stepMonth > minimumStep) {
+ this.scale = 'month';this.step = 1;
+ }
+ if (stepDay * 5 > minimumStep) {
+ this.scale = 'day';this.step = 5;
+ }
+ if (stepDay * 2 > minimumStep) {
+ this.scale = 'day';this.step = 2;
+ }
+ if (stepDay > minimumStep) {
+ this.scale = 'day';this.step = 1;
+ }
+ if (stepDay / 2 > minimumStep) {
+ this.scale = 'weekday';this.step = 1;
+ }
+ if (stepHour * 4 > minimumStep) {
+ this.scale = 'hour';this.step = 4;
+ }
+ if (stepHour > minimumStep) {
+ this.scale = 'hour';this.step = 1;
+ }
+ if (stepMinute * 15 > minimumStep) {
+ this.scale = 'minute';this.step = 15;
+ }
+ if (stepMinute * 10 > minimumStep) {
+ this.scale = 'minute';this.step = 10;
+ }
+ if (stepMinute * 5 > minimumStep) {
+ this.scale = 'minute';this.step = 5;
+ }
+ if (stepMinute > minimumStep) {
+ this.scale = 'minute';this.step = 1;
+ }
+ if (stepSecond * 15 > minimumStep) {
+ this.scale = 'second';this.step = 15;
+ }
+ if (stepSecond * 10 > minimumStep) {
+ this.scale = 'second';this.step = 10;
+ }
+ if (stepSecond * 5 > minimumStep) {
+ this.scale = 'second';this.step = 5;
+ }
+ if (stepSecond > minimumStep) {
+ this.scale = 'second';this.step = 1;
+ }
+ if (stepMillisecond * 200 > minimumStep) {
+ this.scale = 'millisecond';this.step = 200;
+ }
+ if (stepMillisecond * 100 > minimumStep) {
+ this.scale = 'millisecond';this.step = 100;
+ }
+ if (stepMillisecond * 50 > minimumStep) {
+ this.scale = 'millisecond';this.step = 50;
+ }
+ if (stepMillisecond * 10 > minimumStep) {
+ this.scale = 'millisecond';this.step = 10;
+ }
+ if (stepMillisecond * 5 > minimumStep) {
+ this.scale = 'millisecond';this.step = 5;
+ }
+ if (stepMillisecond > minimumStep) {
+ this.scale = 'millisecond';this.step = 1;
+ }
+ };
+
+ /**
+ * Snap a date to a rounded value.
+ * The snap intervals are dependent on the current scale and step.
+ * Static function
+ * @param {Date} date the date to be snapped.
+ * @param {string} scale Current scale, can be 'millisecond', 'second',
+ * 'minute', 'hour', 'weekday, 'day', 'month', 'year'.
+ * @param {number} step Current step (1, 2, 4, 5, ...
+ * @return {Date} snappedDate
+ */
+ TimeStep.snap = function (date, scale, step) {
+ var clone = moment(date);
+
+ if (scale == 'year') {
+ var year = clone.year() + Math.round(clone.month() / 12);
+ clone.year(Math.round(year / step) * step);
+ clone.month(0);
+ clone.date(0);
+ clone.hours(0);
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'month') {
+ if (clone.date() > 15) {
+ clone.date(1);
+ clone.add(1, 'month');
+ // important: first set Date to 1, after that change the month.
+ } else {
+ clone.date(1);
+ }
+
+ clone.hours(0);
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'day') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 5:
+ case 2:
+ clone.hours(Math.round(clone.hours() / 24) * 24);break;
+ default:
+ clone.hours(Math.round(clone.hours() / 12) * 12);break;
+ }
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'weekday') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 5:
+ case 2:
+ clone.hours(Math.round(clone.hours() / 12) * 12);break;
+ default:
+ clone.hours(Math.round(clone.hours() / 6) * 6);break;
+ }
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'hour') {
+ switch (step) {
+ case 4:
+ clone.minutes(Math.round(clone.minutes() / 60) * 60);break;
+ default:
+ clone.minutes(Math.round(clone.minutes() / 30) * 30);break;
+ }
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'minute') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 15:
+ case 10:
+ clone.minutes(Math.round(clone.minutes() / 5) * 5);
+ clone.seconds(0);
+ break;
+ case 5:
+ clone.seconds(Math.round(clone.seconds() / 60) * 60);break;
+ default:
+ clone.seconds(Math.round(clone.seconds() / 30) * 30);break;
+ }
+ clone.milliseconds(0);
+ } else if (scale == 'second') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 15:
+ case 10:
+ clone.seconds(Math.round(clone.seconds() / 5) * 5);
+ clone.milliseconds(0);
+ break;
+ case 5:
+ clone.milliseconds(Math.round(clone.milliseconds() / 1000) * 1000);break;
+ default:
+ clone.milliseconds(Math.round(clone.milliseconds() / 500) * 500);break;
+ }
+ } else if (scale == 'millisecond') {
+ var _step = step > 5 ? step / 2 : 1;
+ clone.milliseconds(Math.round(clone.milliseconds() / _step) * _step);
+ }
+
+ return clone;
+ };
+
+ /**
+ * Check if the current value is a major value (for example when the step
+ * is DAY, a major value is each first day of the MONTH)
+ * @return {boolean} true if current date is major, else false.
+ */
+ TimeStep.prototype.isMajor = function () {
+ if (this.switchedYear == true) {
+ this.switchedYear = false;
+ switch (this.scale) {
+ case 'year':
+ case 'month':
+ case 'weekday':
+ case 'day':
+ case 'hour':
+ case 'minute':
+ case 'second':
+ case 'millisecond':
+ return true;
+ default:
+ return false;
+ }
+ } else if (this.switchedMonth == true) {
+ this.switchedMonth = false;
+ switch (this.scale) {
+ case 'weekday':
+ case 'day':
+ case 'hour':
+ case 'minute':
+ case 'second':
+ case 'millisecond':
+ return true;
+ default:
+ return false;
+ }
+ } else if (this.switchedDay == true) {
+ this.switchedDay = false;
+ switch (this.scale) {
+ case 'millisecond':
+ case 'second':
+ case 'minute':
+ case 'hour':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ var date = this.moment(this.current);
+ switch (this.scale) {
+ case 'millisecond':
+ return date.milliseconds() == 0;
+ case 'second':
+ return date.seconds() == 0;
+ case 'minute':
+ return date.hours() == 0 && date.minutes() == 0;
+ case 'hour':
+ return date.hours() == 0;
+ case 'weekday': // intentional fall through
+ case 'day':
+ return date.date() == 1;
+ case 'month':
+ return date.month() == 0;
+ case 'year':
+ return false;
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * Returns formatted text for the minor axislabel, depending on the current
+ * date and the scale. For example when scale is MINUTE, the current time is
+ * formatted as "hh:mm".
+ * @param {Date} [date] custom date. if not provided, current date is taken
+ */
+ TimeStep.prototype.getLabelMinor = function (date) {
+ if (date == undefined) {
+ date = this.current;
+ }
+
+ var format = this.format.minorLabels[this.scale];
+ return format && format.length > 0 ? this.moment(date).format(format) : '';
+ };
+
+ /**
+ * Returns formatted text for the major axis label, depending on the current
+ * date and the scale. For example when scale is MINUTE, the major scale is
+ * hours, and the hour will be formatted as "hh".
+ * @param {Date} [date] custom date. if not provided, current date is taken
+ */
+ TimeStep.prototype.getLabelMajor = function (date) {
+ if (date == undefined) {
+ date = this.current;
+ }
+
+ var format = this.format.majorLabels[this.scale];
+ return format && format.length > 0 ? this.moment(date).format(format) : '';
+ };
+
+ TimeStep.prototype.getClassName = function () {
+ var _moment = this.moment;
+ var m = this.moment(this.current);
+ var current = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function
+ var step = this.step;
+
+ function even(value) {
+ return value / step % 2 == 0 ? ' vis-even' : ' vis-odd';
+ }
+
+ function today(date) {
+ if (date.isSame(new Date(), 'day')) {
+ return ' vis-today';
+ }
+ if (date.isSame(_moment().add(1, 'day'), 'day')) {
+ return ' vis-tomorrow';
+ }
+ if (date.isSame(_moment().add(-1, 'day'), 'day')) {
+ return ' vis-yesterday';
+ }
+ return '';
+ }
+
+ function currentWeek(date) {
+ return date.isSame(new Date(), 'week') ? ' vis-current-week' : '';
+ }
+
+ function currentMonth(date) {
+ return date.isSame(new Date(), 'month') ? ' vis-current-month' : '';
+ }
+
+ function currentYear(date) {
+ return date.isSame(new Date(), 'year') ? ' vis-current-year' : '';
+ }
+
+ switch (this.scale) {
+ case 'millisecond':
+ return even(current.milliseconds()).trim();
+
+ case 'second':
+ return even(current.seconds()).trim();
+
+ case 'minute':
+ return even(current.minutes()).trim();
+
+ case 'hour':
+ var hours = current.hours();
+ if (this.step == 4) {
+ hours = hours + '-h' + (hours + 4);
+ }
+ return 'vis-h' + hours + today(current) + even(current.hours());
+
+ case 'weekday':
+ return 'vis-' + current.format('dddd').toLowerCase() + today(current) + currentWeek(current) + even(current.date());
+
+ case 'day':
+ var day = current.date();
+ var month = current.format('MMMM').toLowerCase();
+ return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1);
+
+ case 'month':
+ return 'vis-' + current.format('MMMM').toLowerCase() + currentMonth(current) + even(current.month());
+
+ case 'year':
+ var year = current.year();
+ return 'vis-year' + year + currentYear(current) + even(year);
+
+ default:
+ return '';
+ }
+ };
+
+ module.exports = TimeStep;
+
+/***/ },
+/* 36 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var stack = __webpack_require__(37);
+ var RangeItem = __webpack_require__(38);
+
+ /**
+ * @constructor Group
+ * @param {Number | String} groupId
+ * @param {Object} data
+ * @param {ItemSet} itemSet
+ */
+ function Group(groupId, data, itemSet) {
+ this.groupId = groupId;
+ this.subgroups = {};
+ this.subgroupIndex = 0;
+ this.subgroupOrderer = data && data.subgroupOrder;
+ this.itemSet = itemSet;
+
+ this.dom = {};
+ this.props = {
+ label: {
+ width: 0,
+ height: 0
+ }
+ };
+ this.className = null;
+
+ this.items = {}; // items filtered by groupId of this group
+ this.visibleItems = []; // items currently visible in window
+ this.orderedItems = {
+ byStart: [],
+ byEnd: []
+ };
+ this.checkRangedItems = false; // needed to refresh the ranged items if the window is programatically changed with NO overlap.
+ var me = this;
+ this.itemSet.body.emitter.on("checkRangedItems", function () {
+ me.checkRangedItems = true;
+ });
+
+ this._create();
+
+ this.setData(data);
+ }
+
+ /**
+ * Create DOM elements for the group
+ * @private
+ */
+ Group.prototype._create = function () {
+ var label = document.createElement('div');
+ if (this.itemSet.options.groupEditable.order) {
+ label.className = 'vis-label draggable';
+ } else {
+ label.className = 'vis-label';
+ }
+ this.dom.label = label;
+
+ var inner = document.createElement('div');
+ inner.className = 'vis-inner';
+ label.appendChild(inner);
+ this.dom.inner = inner;
+
+ var foreground = document.createElement('div');
+ foreground.className = 'vis-group';
+ foreground['timeline-group'] = this;
+ this.dom.foreground = foreground;
+
+ this.dom.background = document.createElement('div');
+ this.dom.background.className = 'vis-group';
+
+ this.dom.axis = document.createElement('div');
+ this.dom.axis.className = 'vis-group';
+
+ // create a hidden marker to detect when the Timelines container is attached
+ // to the DOM, or the style of a parent of the Timeline is changed from
+ // display:none is changed to visible.
+ this.dom.marker = document.createElement('div');
+ this.dom.marker.style.visibility = 'hidden';
+ this.dom.marker.innerHTML = '?';
+ this.dom.background.appendChild(this.dom.marker);
+ };
+
+ /**
+ * Set the group data for this group
+ * @param {Object} data Group data, can contain properties content and className
+ */
+ Group.prototype.setData = function (data) {
+ // update contents
+ var content;
+ if (this.itemSet.options && this.itemSet.options.groupTemplate) {
+ content = this.itemSet.options.groupTemplate(data);
+ } else {
+ content = data && data.content;
+ }
+
+ if (content instanceof Element) {
+ this.dom.inner.appendChild(content);
+ while (this.dom.inner.firstChild) {
+ this.dom.inner.removeChild(this.dom.inner.firstChild);
+ }
+ this.dom.inner.appendChild(content);
+ } else if (content !== undefined && content !== null) {
+ this.dom.inner.innerHTML = content;
+ } else {
+ this.dom.inner.innerHTML = this.groupId || ''; // groupId can be null
+ }
+
+ // update title
+ this.dom.label.title = data && data.title || '';
+
+ if (!this.dom.inner.firstChild) {
+ util.addClassName(this.dom.inner, 'vis-hidden');
+ } else {
+ util.removeClassName(this.dom.inner, 'vis-hidden');
+ }
+
+ // update className
+ var className = data && data.className || null;
+ if (className != this.className) {
+ if (this.className) {
+ util.removeClassName(this.dom.label, this.className);
+ util.removeClassName(this.dom.foreground, this.className);
+ util.removeClassName(this.dom.background, this.className);
+ util.removeClassName(this.dom.axis, this.className);
+ }
+ util.addClassName(this.dom.label, className);
+ util.addClassName(this.dom.foreground, className);
+ util.addClassName(this.dom.background, className);
+ util.addClassName(this.dom.axis, className);
+ this.className = className;
+ }
+
+ // update style
+ if (this.style) {
+ util.removeCssText(this.dom.label, this.style);
+ this.style = null;
+ }
+ if (data && data.style) {
+ util.addCssText(this.dom.label, data.style);
+ this.style = data.style;
+ }
+ };
+
+ /**
+ * Get the width of the group label
+ * @return {number} width
+ */
+ Group.prototype.getLabelWidth = function () {
+ return this.props.label.width;
+ };
+
+ /**
+ * Repaint this group
+ * @param {{start: number, end: number}} range
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * @param {boolean} [restack=false] Force restacking of all items
+ * @return {boolean} Returns true if the group is resized
+ */
+ Group.prototype.redraw = function (range, margin, restack) {
+ var resized = false;
+
+ // force recalculation of the height of the items when the marker height changed
+ // (due to the Timeline being attached to the DOM or changed from display:none to visible)
+ var markerHeight = this.dom.marker.clientHeight;
+ if (markerHeight != this.lastMarkerHeight) {
+ this.lastMarkerHeight = markerHeight;
+
+ util.forEach(this.items, function (item) {
+ item.dirty = true;
+ if (item.displayed) item.redraw();
+ });
+
+ restack = true;
+ }
+
+ // recalculate the height of the subgroups
+ this._calculateSubGroupHeights();
+
+ // reposition visible items vertically
+ if (typeof this.itemSet.options.order === 'function') {
+ // a custom order function
+
+ if (restack) {
+ // brute force restack of all items
+
+ // show all items
+ var me = this;
+ var limitSize = false;
+ util.forEach(this.items, function (item) {
+ if (!item.displayed) {
+ item.redraw();
+ me.visibleItems.push(item);
+ }
+ item.repositionX(limitSize);
+ });
+
+ // order all items and force a restacking
+ var customOrderedItems = this.orderedItems.byStart.slice().sort(function (a, b) {
+ return me.itemSet.options.order(a.data, b.data);
+ });
+ stack.stack(customOrderedItems, margin, true /* restack=true */);
+ }
+
+ this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range);
+ } else {
+ // no custom order function, lazy stacking
+
+ this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range);
+ if (this.itemSet.options.stack) {
+ // TODO: ugly way to access options...
+ stack.stack(this.visibleItems, margin, restack);
+ } else {
+ // no stacking
+ stack.nostack(this.visibleItems, margin, this.subgroups);
+ }
+ }
+
+ // recalculate the height of the group
+ var height = this._calculateHeight(margin);
+
+ // calculate actual size and position
+ var foreground = this.dom.foreground;
+ this.top = foreground.offsetTop;
+ this.right = foreground.offsetLeft;
+ this.width = foreground.offsetWidth;
+ resized = util.updateProperty(this, 'height', height) || resized;
+ // recalculate size of label
+ resized = util.updateProperty(this.props.label, 'width', this.dom.inner.clientWidth) || resized;
+ resized = util.updateProperty(this.props.label, 'height', this.dom.inner.clientHeight) || resized;
+
+ // apply new height
+ this.dom.background.style.height = height + 'px';
+ this.dom.foreground.style.height = height + 'px';
+ this.dom.label.style.height = height + 'px';
+
+ // update vertical position of items after they are re-stacked and the height of the group is calculated
+ for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {
+ var item = this.visibleItems[i];
+ item.repositionY(margin);
+ }
+
+ return resized;
+ };
+
+ /**
+ * recalculate the height of the subgroups
+ * @private
+ */
+ Group.prototype._calculateSubGroupHeights = function () {
+ if (Object.keys(this.subgroups).length > 0) {
+ var me = this;
+
+ this.resetSubgroups();
+
+ util.forEach(this.visibleItems, function (item) {
+ if (item.data.subgroup !== undefined) {
+ me.subgroups[item.data.subgroup].height = Math.max(me.subgroups[item.data.subgroup].height, item.height);
+ me.subgroups[item.data.subgroup].visible = true;
+ }
+ });
+ }
+ };
+
+ /**
+ * recalculate the height of the group
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * @returns {number} Returns the height
+ * @private
+ */
+ Group.prototype._calculateHeight = function (margin) {
+ // recalculate the height of the group
+ var height;
+ var visibleItems = this.visibleItems;
+ if (visibleItems.length > 0) {
+ var min = visibleItems[0].top;
+ var max = visibleItems[0].top + visibleItems[0].height;
+ util.forEach(visibleItems, function (item) {
+ min = Math.min(min, item.top);
+ max = Math.max(max, item.top + item.height);
+ });
+ if (min > margin.axis) {
+ // there is an empty gap between the lowest item and the axis
+ var offset = min - margin.axis;
+ max -= offset;
+ util.forEach(visibleItems, function (item) {
+ item.top -= offset;
+ });
+ }
+ height = max + margin.item.vertical / 2;
+ } else {
+ height = 0;
+ }
+ height = Math.max(height, this.props.label.height);
+
+ return height;
+ };
+
+ /**
+ * Show this group: attach to the DOM
+ */
+ Group.prototype.show = function () {
+ if (!this.dom.label.parentNode) {
+ this.itemSet.dom.labelSet.appendChild(this.dom.label);
+ }
+
+ if (!this.dom.foreground.parentNode) {
+ this.itemSet.dom.foreground.appendChild(this.dom.foreground);
+ }
+
+ if (!this.dom.background.parentNode) {
+ this.itemSet.dom.background.appendChild(this.dom.background);
+ }
+
+ if (!this.dom.axis.parentNode) {
+ this.itemSet.dom.axis.appendChild(this.dom.axis);
+ }
+ };
+
+ /**
+ * Hide this group: remove from the DOM
+ */
+ Group.prototype.hide = function () {
+ var label = this.dom.label;
+ if (label.parentNode) {
+ label.parentNode.removeChild(label);
+ }
+
+ var foreground = this.dom.foreground;
+ if (foreground.parentNode) {
+ foreground.parentNode.removeChild(foreground);
+ }
+
+ var background = this.dom.background;
+ if (background.parentNode) {
+ background.parentNode.removeChild(background);
+ }
+
+ var axis = this.dom.axis;
+ if (axis.parentNode) {
+ axis.parentNode.removeChild(axis);
+ }
+ };
+
+ /**
+ * Add an item to the group
+ * @param {Item} item
+ */
+ Group.prototype.add = function (item) {
+ this.items[item.id] = item;
+ item.setParent(this);
+
+ // add to
+ if (item.data.subgroup !== undefined) {
+ if (this.subgroups[item.data.subgroup] === undefined) {
+ this.subgroups[item.data.subgroup] = { height: 0, visible: false, index: this.subgroupIndex, items: [] };
+ this.subgroupIndex++;
+ }
+ this.subgroups[item.data.subgroup].items.push(item);
+ }
+ this.orderSubgroups();
+
+ if (this.visibleItems.indexOf(item) == -1) {
+ var range = this.itemSet.body.range; // TODO: not nice accessing the range like this
+ this._checkIfVisible(item, this.visibleItems, range);
+ }
+ };
+
+ Group.prototype.orderSubgroups = function () {
+ if (this.subgroupOrderer !== undefined) {
+ var sortArray = [];
+ if (typeof this.subgroupOrderer == 'string') {
+ for (var subgroup in this.subgroups) {
+ sortArray.push({ subgroup: subgroup, sortField: this.subgroups[subgroup].items[0].data[this.subgroupOrderer] });
+ }
+ sortArray.sort(function (a, b) {
+ return a.sortField - b.sortField;
+ });
+ } else if (typeof this.subgroupOrderer == 'function') {
+ for (var subgroup in this.subgroups) {
+ sortArray.push(this.subgroups[subgroup].items[0].data);
+ }
+ sortArray.sort(this.subgroupOrderer);
+ }
+
+ if (sortArray.length > 0) {
+ for (var i = 0; i < sortArray.length; i++) {
+ this.subgroups[sortArray[i].subgroup].index = i;
+ }
+ }
+ }
+ };
+
+ Group.prototype.resetSubgroups = function () {
+ for (var subgroup in this.subgroups) {
+ if (this.subgroups.hasOwnProperty(subgroup)) {
+ this.subgroups[subgroup].visible = false;
+ }
+ }
+ };
+
+ /**
+ * Remove an item from the group
+ * @param {Item} item
+ */
+ Group.prototype.remove = function (item) {
+ delete this.items[item.id];
+ item.setParent(null);
+
+ // remove from visible items
+ var index = this.visibleItems.indexOf(item);
+ if (index != -1) this.visibleItems.splice(index, 1);
+
+ if (item.data.subgroup !== undefined) {
+ var subgroup = this.subgroups[item.data.subgroup];
+ if (subgroup) {
+ var itemIndex = subgroup.items.indexOf(item);
+ subgroup.items.splice(itemIndex, 1);
+ if (!subgroup.items.length) {
+ delete this.subgroups[item.data.subgroup];
+ this.subgroupIndex--;
+ }
+ this.orderSubgroups();
+ }
+ }
+ };
+
+ /**
+ * Remove an item from the corresponding DataSet
+ * @param {Item} item
+ */
+ Group.prototype.removeFromDataSet = function (item) {
+ this.itemSet.removeItem(item.id);
+ };
+
+ /**
+ * Reorder the items
+ */
+ Group.prototype.order = function () {
+ var array = util.toArray(this.items);
+ var startArray = [];
+ var endArray = [];
+
+ for (var i = 0; i < array.length; i++) {
+ if (array[i].data.end !== undefined) {
+ endArray.push(array[i]);
+ }
+ startArray.push(array[i]);
+ }
+ this.orderedItems = {
+ byStart: startArray,
+ byEnd: endArray
+ };
+
+ stack.orderByStart(this.orderedItems.byStart);
+ stack.orderByEnd(this.orderedItems.byEnd);
+ };
+
+ /**
+ * Update the visible items
+ * @param {{byStart: Item[], byEnd: Item[]}} orderedItems All items ordered by start date and by end date
+ * @param {Item[]} visibleItems The previously visible items.
+ * @param {{start: number, end: number}} range Visible range
+ * @return {Item[]} visibleItems The new visible items.
+ * @private
+ */
+ Group.prototype._updateVisibleItems = function (orderedItems, oldVisibleItems, range) {
+ var visibleItems = [];
+ var visibleItemsLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems
+ var interval = (range.end - range.start) / 4;
+ var lowerBound = range.start - interval;
+ var upperBound = range.end + interval;
+ var item, i;
+
+ // this function is used to do the binary search.
+ var searchFunction = function searchFunction(value) {
+ if (value < lowerBound) {
+ return -1;
+ } else if (value <= upperBound) {
+ return 0;
+ } else {
+ return 1;
+ }
+ };
+
+ // first check if the items that were in view previously are still in view.
+ // IMPORTANT: this handles the case for the items with startdate before the window and enddate after the window!
+ // also cleans up invisible items.
+ if (oldVisibleItems.length > 0) {
+ for (i = 0; i < oldVisibleItems.length; i++) {
+ this._checkIfVisibleWithReference(oldVisibleItems[i], visibleItems, visibleItemsLookup, range);
+ }
+ }
+
+ // we do a binary search for the items that have only start values.
+ var initialPosByStart = util.binarySearchCustom(orderedItems.byStart, searchFunction, 'data', 'start');
+
+ // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the start values.
+ this._traceVisible(initialPosByStart, orderedItems.byStart, visibleItems, visibleItemsLookup, function (item) {
+ return item.data.start < lowerBound || item.data.start > upperBound;
+ });
+
+ // if the window has changed programmatically without overlapping the old window, the ranged items with start < lowerBound and end > upperbound are not shown.
+ // We therefore have to brute force check all items in the byEnd list
+ if (this.checkRangedItems == true) {
+ this.checkRangedItems = false;
+ for (i = 0; i < orderedItems.byEnd.length; i++) {
+ this._checkIfVisibleWithReference(orderedItems.byEnd[i], visibleItems, visibleItemsLookup, range);
+ }
+ } else {
+ // we do a binary search for the items that have defined end times.
+ var initialPosByEnd = util.binarySearchCustom(orderedItems.byEnd, searchFunction, 'data', 'end');
+
+ // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the end values.
+ this._traceVisible(initialPosByEnd, orderedItems.byEnd, visibleItems, visibleItemsLookup, function (item) {
+ return item.data.end < lowerBound || item.data.end > upperBound;
+ });
+ }
+
+ // finally, we reposition all the visible items.
+ for (i = 0; i < visibleItems.length; i++) {
+ item = visibleItems[i];
+ if (!item.displayed) item.show();
+ // reposition item horizontally
+ item.repositionX();
+ }
+
+ // debug
+ //console.log("new line")
+ //if (this.groupId == null) {
+ // for (i = 0; i < orderedItems.byStart.length; i++) {
+ // item = orderedItems.byStart[i].data;
+ // console.log('start',i,initialPosByStart, item.start.valueOf(), item.content, item.start >= lowerBound && item.start <= upperBound,i == initialPosByStart ? "<------------------- HEREEEE" : "")
+ // }
+ // for (i = 0; i < orderedItems.byEnd.length; i++) {
+ // item = orderedItems.byEnd[i].data;
+ // console.log('rangeEnd',i,initialPosByEnd, item.end.valueOf(), item.content, item.end >= range.start && item.end <= range.end,i == initialPosByEnd ? "<------------------- HEREEEE" : "")
+ // }
+ //}
+
+ return visibleItems;
+ };
+
+ Group.prototype._traceVisible = function (initialPos, items, visibleItems, visibleItemsLookup, breakCondition) {
+ var item;
+ var i;
+
+ if (initialPos != -1) {
+ for (i = initialPos; i >= 0; i--) {
+ item = items[i];
+ if (breakCondition(item)) {
+ break;
+ } else {
+ if (visibleItemsLookup[item.id] === undefined) {
+ visibleItemsLookup[item.id] = true;
+ visibleItems.push(item);
+ }
+ }
+ }
+
+ for (i = initialPos + 1; i < items.length; i++) {
+ item = items[i];
+ if (breakCondition(item)) {
+ break;
+ } else {
+ if (visibleItemsLookup[item.id] === undefined) {
+ visibleItemsLookup[item.id] = true;
+ visibleItems.push(item);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * this function is very similar to the _checkIfInvisible() but it does not
+ * return booleans, hides the item if it should not be seen and always adds to
+ * the visibleItems.
+ * this one is for brute forcing and hiding.
+ *
+ * @param {Item} item
+ * @param {Array} visibleItems
+ * @param {{start:number, end:number}} range
+ * @private
+ */
+ Group.prototype._checkIfVisible = function (item, visibleItems, range) {
+ if (item.isVisible(range)) {
+ if (!item.displayed) item.show();
+ // reposition item horizontally
+ item.repositionX();
+ visibleItems.push(item);
+ } else {
+ if (item.displayed) item.hide();
+ }
+ };
+
+ /**
+ * this function is very similar to the _checkIfInvisible() but it does not
+ * return booleans, hides the item if it should not be seen and always adds to
+ * the visibleItems.
+ * this one is for brute forcing and hiding.
+ *
+ * @param {Item} item
+ * @param {Array} visibleItems
+ * @param {{start:number, end:number}} range
+ * @private
+ */
+ Group.prototype._checkIfVisibleWithReference = function (item, visibleItems, visibleItemsLookup, range) {
+ if (item.isVisible(range)) {
+ if (visibleItemsLookup[item.id] === undefined) {
+ visibleItemsLookup[item.id] = true;
+ visibleItems.push(item);
+ }
+ } else {
+ if (item.displayed) item.hide();
+ }
+ };
+
+ module.exports = Group;
+
+/***/ },
+/* 37 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ // Utility functions for ordering and stacking of items
+ var EPSILON = 0.001; // used when checking collisions, to prevent round-off errors
+
+ /**
+ * Order items by their start data
+ * @param {Item[]} items
+ */
+ exports.orderByStart = function (items) {
+ items.sort(function (a, b) {
+ return a.data.start - b.data.start;
+ });
+ };
+
+ /**
+ * Order items by their end date. If they have no end date, their start date
+ * is used.
+ * @param {Item[]} items
+ */
+ exports.orderByEnd = function (items) {
+ items.sort(function (a, b) {
+ var aTime = 'end' in a.data ? a.data.end : a.data.start,
+ bTime = 'end' in b.data ? b.data.end : b.data.start;
+
+ return aTime - bTime;
+ });
+ };
+
+ /**
+ * Adjust vertical positions of the items such that they don't overlap each
+ * other.
+ * @param {Item[]} items
+ * All visible items
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * Margins between items and between items and the axis.
+ * @param {boolean} [force=false]
+ * If true, all items will be repositioned. If false (default), only
+ * items having a top===null will be re-stacked
+ */
+ exports.stack = function (items, margin, force) {
+ var i, iMax;
+ if (force) {
+ // reset top position of all items
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ items[i].top = null;
+ }
+ }
+
+ // calculate new, non-overlapping positions
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ var item = items[i];
+ if (item.stack && item.top === null) {
+ // initialize top position
+ item.top = margin.axis;
+
+ do {
+ // TODO: optimize checking for overlap. when there is a gap without items,
+ // you only need to check for items from the next item on, not from zero
+ var collidingItem = null;
+ for (var j = 0, jj = items.length; j < jj; j++) {
+ var other = items[j];
+ if (other.top !== null && other !== item && other.stack && exports.collision(item, other, margin.item, other.options.rtl)) {
+ collidingItem = other;
+ break;
+ }
+ }
+
+ if (collidingItem != null) {
+ // There is a collision. Reposition the items above the colliding element
+ item.top = collidingItem.top + collidingItem.height + margin.item.vertical;
+ }
+ } while (collidingItem);
+ }
+ }
+ };
+
+ /**
+ * Adjust vertical positions of the items without stacking them
+ * @param {Item[]} items
+ * All visible items
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * Margins between items and between items and the axis.
+ */
+ exports.nostack = function (items, margin, subgroups) {
+ var i, iMax, newTop;
+
+ // reset top position of all items
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ if (items[i].data.subgroup !== undefined) {
+ newTop = margin.axis;
+ for (var subgroup in subgroups) {
+ if (subgroups.hasOwnProperty(subgroup)) {
+ if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroups[items[i].data.subgroup].index) {
+ newTop += subgroups[subgroup].height + margin.item.vertical;
+ }
+ }
+ }
+ items[i].top = newTop;
+ } else {
+ items[i].top = margin.axis;
+ }
+ }
+ };
+
+ /**
+ * Test if the two provided items collide
+ * The items must have parameters left, width, top, and height.
+ * @param {Item} a The first item
+ * @param {Item} b The second item
+ * @param {{horizontal: number, vertical: number}} margin
+ * An object containing a horizontal and vertical
+ * minimum required margin.
+ * @param {boolean} rtl
+ * @return {boolean} true if a and b collide, else false
+ */
+ exports.collision = function (a, b, margin, rtl) {
+ if (rtl) {
+ return a.right - margin.horizontal + EPSILON < b.right + b.width && a.right + a.width + margin.horizontal - EPSILON > b.right && a.top - margin.vertical + EPSILON < b.top + b.height && a.top + a.height + margin.vertical - EPSILON > b.top;
+ } else {
+ return a.left - margin.horizontal + EPSILON < b.left + b.width && a.left + a.width + margin.horizontal - EPSILON > b.left && a.top - margin.vertical + EPSILON < b.top + b.height && a.top + a.height + margin.vertical - EPSILON > b.top;
+ }
+ };
+
+/***/ },
+/* 38 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var Item = __webpack_require__(39);
+
+ /**
+ * @constructor RangeItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start, end
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe options
+ */
+ function RangeItem(data, conversion, options) {
+ this.props = {
+ content: {
+ width: 0
+ }
+ };
+ this.overflow = false; // if contents can overflow (css styling), this flag is set to true
+ this.options = options;
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data.id);
+ }
+ if (data.end == undefined) {
+ throw new Error('Property "end" missing in item ' + data.id);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ RangeItem.prototype = new Item(null, null, null);
+
+ RangeItem.prototype.baseClassName = 'vis-item vis-range';
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ RangeItem.prototype.isVisible = function (range) {
+ // determine visibility
+ return this.data.start < range.end && this.data.end > range.start;
+ };
+
+ /**
+ * Repaint the item
+ */
+ RangeItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // background box
+ dom.box = document.createElement('div');
+ // className is updated in redraw()
+
+ // frame box (to prevent the item contents from overflowing
+ dom.frame = document.createElement('div');
+ dom.frame.className = 'vis-item-overflow';
+ dom.box.appendChild(dom.frame);
+
+ // contents box
+ dom.content = document.createElement('div');
+ dom.content.className = 'vis-item-content';
+ dom.frame.appendChild(dom.content);
+
+ // attach this item as attribute
+ dom.box['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.box.parentNode) {
+ var foreground = this.parent.dom.foreground;
+ if (!foreground) {
+ throw new Error('Cannot redraw item: parent has no foreground container element');
+ }
+ foreground.appendChild(dom.box);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.box);
+ this._updateDataAttributes(this.dom.box);
+ this._updateStyle(this.dom.box);
+
+ var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false;
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly');
+ dom.box.className = this.baseClassName + className;
+
+ // determine from css whether this box has overflow
+ this.overflow = window.getComputedStyle(dom.frame).overflow !== 'hidden';
+
+ // recalculate size
+ // turn off max-width to be able to calculate the real width
+ // this causes an extra browser repaint/reflow, but so be it
+ this.dom.content.style.maxWidth = 'none';
+ this.props.content.width = this.dom.content.offsetWidth;
+ this.height = this.dom.box.offsetHeight;
+ this.dom.content.style.maxWidth = '';
+
+ this.dirty = false;
+ }
+ this._repaintDeleteButton(dom.box);
+ this._repaintDragLeft();
+ this._repaintDragRight();
+ };
+
+ /**
+ * Show the item in the DOM (when not already visible). The items DOM will
+ * be created when needed.
+ */
+ RangeItem.prototype.show = function () {
+ if (!this.displayed) {
+ this.redraw();
+ }
+ };
+
+ /**
+ * Hide the item from the DOM (when visible)
+ * @return {Boolean} changed
+ */
+ RangeItem.prototype.hide = function () {
+ if (this.displayed) {
+ var box = this.dom.box;
+
+ if (box.parentNode) {
+ box.parentNode.removeChild(box);
+ }
+
+ this.displayed = false;
+ }
+ };
+
+ /**
+ * Reposition the item horizontally
+ * @param {boolean} [limitSize=true] If true (default), the width of the range
+ * item will be limited, as the browser cannot
+ * display very wide divs. This means though
+ * that the applied left and width may
+ * not correspond to the ranges start and end
+ * @Override
+ */
+ RangeItem.prototype.repositionX = function (limitSize) {
+ var parentWidth = this.parent.width;
+ var start = this.conversion.toScreen(this.data.start);
+ var end = this.conversion.toScreen(this.data.end);
+ var contentStartPosition;
+ var contentWidth;
+
+ // limit the width of the range, as browsers cannot draw very wide divs
+ if (limitSize === undefined || limitSize === true) {
+ if (start < -parentWidth) {
+ start = -parentWidth;
+ }
+ if (end > 2 * parentWidth) {
+ end = 2 * parentWidth;
+ }
+ }
+ var boxWidth = Math.max(end - start, 1);
+
+ if (this.overflow) {
+ if (this.options.rtl) {
+ this.right = start;
+ } else {
+ this.left = start;
+ }
+ this.width = boxWidth + this.props.content.width;
+ contentWidth = this.props.content.width;
+
+ // Note: The calculation of width is an optimistic calculation, giving
+ // a width which will not change when moving the Timeline
+ // So no re-stacking needed, which is nicer for the eye;
+ } else {
+ if (this.options.rtl) {
+ this.right = start;
+ } else {
+ this.left = start;
+ }
+ this.width = boxWidth;
+ contentWidth = Math.min(end - start, this.props.content.width);
+ }
+
+ if (this.options.rtl) {
+ this.dom.box.style.right = this.right + 'px';
+ } else {
+ this.dom.box.style.left = this.left + 'px';
+ }
+ this.dom.box.style.width = boxWidth + 'px';
+
+ switch (this.options.align) {
+ case 'left':
+ if (this.options.rtl) {
+ this.dom.content.style.right = '0';
+ } else {
+ this.dom.content.style.left = '0';
+ }
+ break;
+
+ case 'right':
+ if (this.options.rtl) {
+ this.dom.content.style.right = Math.max(boxWidth - contentWidth, 0) + 'px';
+ } else {
+ this.dom.content.style.left = Math.max(boxWidth - contentWidth, 0) + 'px';
+ }
+ break;
+
+ case 'center':
+ if (this.options.rtl) {
+ this.dom.content.style.right = Math.max((boxWidth - contentWidth) / 2, 0) + 'px';
+ } else {
+ this.dom.content.style.left = Math.max((boxWidth - contentWidth) / 2, 0) + 'px';
+ }
+
+ break;
+
+ default:
+ // 'auto'
+ // when range exceeds left of the window, position the contents at the left of the visible area
+ if (this.overflow) {
+ if (end > 0) {
+ contentStartPosition = Math.max(-start, 0);
+ } else {
+ contentStartPosition = -contentWidth; // ensure it's not visible anymore
+ }
+ } else {
+ if (start < 0) {
+ contentStartPosition = -start;
+ } else {
+ contentStartPosition = 0;
+ }
+ }
+ if (this.options.rtl) {
+ this.dom.content.style.right = contentStartPosition + 'px';
+ } else {
+ this.dom.content.style.left = contentStartPosition + 'px';
+ }
+ }
+ };
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ RangeItem.prototype.repositionY = function () {
+ var orientation = this.options.orientation.item;
+ var box = this.dom.box;
+
+ if (orientation == 'top') {
+ box.style.top = this.top + 'px';
+ } else {
+ box.style.top = this.parent.height - this.top - this.height + 'px';
+ }
+ };
+
+ /**
+ * Repaint a drag area on the left side of the range when the range is selected
+ * @protected
+ */
+ RangeItem.prototype._repaintDragLeft = function () {
+ if (this.selected && this.options.editable.updateTime && !this.dom.dragLeft) {
+ // create and show drag area
+ var dragLeft = document.createElement('div');
+ dragLeft.className = 'vis-drag-left';
+ dragLeft.dragLeftItem = this;
+
+ this.dom.box.appendChild(dragLeft);
+ this.dom.dragLeft = dragLeft;
+ } else if (!this.selected && this.dom.dragLeft) {
+ // delete drag area
+ if (this.dom.dragLeft.parentNode) {
+ this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft);
+ }
+ this.dom.dragLeft = null;
+ }
+ };
+
+ /**
+ * Repaint a drag area on the right side of the range when the range is selected
+ * @protected
+ */
+ RangeItem.prototype._repaintDragRight = function () {
+ if (this.selected && this.options.editable.updateTime && !this.dom.dragRight) {
+ // create and show drag area
+ var dragRight = document.createElement('div');
+ dragRight.className = 'vis-drag-right';
+ dragRight.dragRightItem = this;
+
+ this.dom.box.appendChild(dragRight);
+ this.dom.dragRight = dragRight;
+ } else if (!this.selected && this.dom.dragRight) {
+ // delete drag area
+ if (this.dom.dragRight.parentNode) {
+ this.dom.dragRight.parentNode.removeChild(this.dom.dragRight);
+ }
+ this.dom.dragRight = null;
+ }
+ };
+
+ module.exports = RangeItem;
+
+/***/ },
+/* 39 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor Item
+ * @param {Object} data Object containing (optional) parameters type,
+ * start, end, content, group, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} options Configuration options
+ * // TODO: describe available options
+ */
+ function Item(data, conversion, options) {
+ this.id = null;
+ this.parent = null;
+ this.data = data;
+ this.dom = null;
+ this.conversion = conversion || {};
+ this.options = options || {};
+
+ this.selected = false;
+ this.displayed = false;
+ this.dirty = true;
+
+ this.top = null;
+ this.right = null;
+ this.left = null;
+ this.width = null;
+ this.height = null;
+
+ this.editable = null;
+ if (this.data && this.data.hasOwnProperty('editable') && typeof this.data.editable === 'boolean') {
+ this.editable = data.editable;
+ }
+ }
+
+ Item.prototype.stack = true;
+
+ /**
+ * Select current item
+ */
+ Item.prototype.select = function () {
+ this.selected = true;
+ this.dirty = true;
+ if (this.displayed) this.redraw();
+ };
+
+ /**
+ * Unselect current item
+ */
+ Item.prototype.unselect = function () {
+ this.selected = false;
+ this.dirty = true;
+ if (this.displayed) this.redraw();
+ };
+
+ /**
+ * Set data for the item. Existing data will be updated. The id should not
+ * be changed. When the item is displayed, it will be redrawn immediately.
+ * @param {Object} data
+ */
+ Item.prototype.setData = function (data) {
+ var groupChanged = data.group != undefined && this.data.group != data.group;
+ if (groupChanged) {
+ this.parent.itemSet._moveToGroup(this, data.group);
+ }
+
+ if (data.hasOwnProperty('editable') && typeof data.editable === 'boolean') {
+ this.editable = data.editable;
+ }
+
+ this.data = data;
+ this.dirty = true;
+ if (this.displayed) this.redraw();
+ };
+
+ /**
+ * Set a parent for the item
+ * @param {ItemSet | Group} parent
+ */
+ Item.prototype.setParent = function (parent) {
+ if (this.displayed) {
+ this.hide();
+ this.parent = parent;
+ if (this.parent) {
+ this.show();
+ }
+ } else {
+ this.parent = parent;
+ }
+ };
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ Item.prototype.isVisible = function (range) {
+ // Should be implemented by Item implementations
+ return false;
+ };
+
+ /**
+ * Show the Item in the DOM (when not already visible)
+ * @return {Boolean} changed
+ */
+ Item.prototype.show = function () {
+ return false;
+ };
+
+ /**
+ * Hide the Item from the DOM (when visible)
+ * @return {Boolean} changed
+ */
+ Item.prototype.hide = function () {
+ return false;
+ };
+
+ /**
+ * Repaint the item
+ */
+ Item.prototype.redraw = function () {
+ // should be implemented by the item
+ };
+
+ /**
+ * Reposition the Item horizontally
+ */
+ Item.prototype.repositionX = function () {
+ // should be implemented by the item
+ };
+
+ /**
+ * Reposition the Item vertically
+ */
+ Item.prototype.repositionY = function () {
+ // should be implemented by the item
+ };
+
+ /**
+ * Repaint a delete button on the top right of the item when the item is selected
+ * @param {HTMLElement} anchor
+ * @protected
+ */
+ Item.prototype._repaintDeleteButton = function (anchor) {
+ var editable = (this.options.editable.remove || this.data.editable === true) && this.data.editable !== false;
+
+ if (this.selected && editable && !this.dom.deleteButton) {
+ // create and show button
+ var me = this;
+
+ var deleteButton = document.createElement('div');
+
+ if (this.options.rtl) {
+ deleteButton.className = 'vis-delete-rtl';
+ } else {
+ deleteButton.className = 'vis-delete';
+ }
+ deleteButton.title = 'Delete this item';
+
+ // TODO: be able to destroy the delete button
+ new Hammer(deleteButton).on('tap', function (event) {
+ event.stopPropagation();
+ me.parent.removeFromDataSet(me);
+ });
+
+ anchor.appendChild(deleteButton);
+ this.dom.deleteButton = deleteButton;
+ } else if (!this.selected && this.dom.deleteButton) {
+ // remove button
+ if (this.dom.deleteButton.parentNode) {
+ this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton);
+ }
+ this.dom.deleteButton = null;
+ }
+ };
+
+ /**
+ * Set HTML contents for the item
+ * @param {Element} element HTML element to fill with the contents
+ * @private
+ */
+ Item.prototype._updateContents = function (element) {
+ var content;
+ if (this.options.template) {
+ var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset
+ content = this.options.template(itemData);
+ } else {
+ content = this.data.content;
+ }
+
+ var changed = this._contentToString(this.content) !== this._contentToString(content);
+ if (changed) {
+ // only replace the content when changed
+ if (content instanceof Element) {
+ element.innerHTML = '';
+ element.appendChild(content);
+ } else if (content != undefined) {
+ element.innerHTML = content;
+ } else {
+ if (!(this.data.type == 'background' && this.data.content === undefined)) {
+ throw new Error('Property "content" missing in item ' + this.id);
+ }
+ }
+
+ this.content = content;
+ }
+ };
+
+ /**
+ * Set HTML contents for the item
+ * @param {Element} element HTML element to fill with the contents
+ * @private
+ */
+ Item.prototype._updateTitle = function (element) {
+ if (this.data.title != null) {
+ element.title = this.data.title || '';
+ } else {
+ element.removeAttribute('vis-title');
+ }
+ };
+
+ /**
+ * Process dataAttributes timeline option and set as data- attributes on dom.content
+ * @param {Element} element HTML element to which the attributes will be attached
+ * @private
+ */
+ Item.prototype._updateDataAttributes = function (element) {
+ if (this.options.dataAttributes && this.options.dataAttributes.length > 0) {
+ var attributes = [];
+
+ if (Array.isArray(this.options.dataAttributes)) {
+ attributes = this.options.dataAttributes;
+ } else if (this.options.dataAttributes == 'all') {
+ attributes = Object.keys(this.data);
+ } else {
+ return;
+ }
+
+ for (var i = 0; i < attributes.length; i++) {
+ var name = attributes[i];
+ var value = this.data[name];
+
+ if (value != null) {
+ element.setAttribute('data-' + name, value);
+ } else {
+ element.removeAttribute('data-' + name);
+ }
+ }
+ }
+ };
+
+ /**
+ * Update custom styles of the element
+ * @param element
+ * @private
+ */
+ Item.prototype._updateStyle = function (element) {
+ // remove old styles
+ if (this.style) {
+ util.removeCssText(element, this.style);
+ this.style = null;
+ }
+
+ // append new styles
+ if (this.data.style) {
+ util.addCssText(element, this.data.style);
+ this.style = this.data.style;
+ }
+ };
+
+ /**
+ * Stringify the items contents
+ * @param {string | Element | undefined} content
+ * @returns {string | undefined}
+ * @private
+ */
+ Item.prototype._contentToString = function (content) {
+ if (typeof content === 'string') return content;
+ if (content && 'outerHTML' in content) return content.outerHTML;
+ return content;
+ };
+
+ /**
+ * Return the width of the item left from its start date
+ * @return {number}
+ */
+ Item.prototype.getWidthLeft = function () {
+ return 0;
+ };
+
+ /**
+ * Return the width of the item right from the max of its start and end date
+ * @return {number}
+ */
+ Item.prototype.getWidthRight = function () {
+ return 0;
+ };
+
+ module.exports = Item;
+
+/***/ },
+/* 40 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var Group = __webpack_require__(36);
+
+ /**
+ * @constructor BackgroundGroup
+ * @param {Number | String} groupId
+ * @param {Object} data
+ * @param {ItemSet} itemSet
+ */
+ function BackgroundGroup(groupId, data, itemSet) {
+ Group.call(this, groupId, data, itemSet);
+
+ this.width = 0;
+ this.height = 0;
+ this.top = 0;
+ this.left = 0;
+ }
+
+ BackgroundGroup.prototype = Object.create(Group.prototype);
+
+ /**
+ * Repaint this group
+ * @param {{start: number, end: number}} range
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * @param {boolean} [restack=false] Force restacking of all items
+ * @return {boolean} Returns true if the group is resized
+ */
+ BackgroundGroup.prototype.redraw = function (range, margin, restack) {
+ var resized = false;
+
+ this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range);
+
+ // calculate actual size
+ this.width = this.dom.background.offsetWidth;
+
+ // apply new height (just always zero for BackgroundGroup
+ this.dom.background.style.height = '0';
+
+ // update vertical position of items after they are re-stacked and the height of the group is calculated
+ for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {
+ var item = this.visibleItems[i];
+ item.repositionY(margin);
+ }
+
+ return resized;
+ };
+
+ /**
+ * Show this group: attach to the DOM
+ */
+ BackgroundGroup.prototype.show = function () {
+ if (!this.dom.background.parentNode) {
+ this.itemSet.dom.background.appendChild(this.dom.background);
+ }
+ };
+
+ module.exports = BackgroundGroup;
+
+/***/ },
+/* 41 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Item = __webpack_require__(39);
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor BoxItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe available options
+ */
+ function BoxItem(data, conversion, options) {
+ this.props = {
+ dot: {
+ width: 0,
+ height: 0
+ },
+ line: {
+ width: 0,
+ height: 0
+ }
+ };
+ this.options = options;
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ BoxItem.prototype = new Item(null, null, null);
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ BoxItem.prototype.isVisible = function (range) {
+ // determine visibility
+ // TODO: account for the real width of the item. Right now we just add 1/4 to the window
+ var interval = (range.end - range.start) / 4;
+ return this.data.start > range.start - interval && this.data.start < range.end + interval;
+ };
+
+ /**
+ * Repaint the item
+ */
+ BoxItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // create main box
+ dom.box = document.createElement('DIV');
+
+ // contents box (inside the background box). used for making margins
+ dom.content = document.createElement('DIV');
+ dom.content.className = 'vis-item-content';
+ dom.box.appendChild(dom.content);
+
+ // line to axis
+ dom.line = document.createElement('DIV');
+ dom.line.className = 'vis-line';
+
+ // dot on axis
+ dom.dot = document.createElement('DIV');
+ dom.dot.className = 'vis-dot';
+
+ // attach this item as attribute
+ dom.box['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.box.parentNode) {
+ var foreground = this.parent.dom.foreground;
+ if (!foreground) throw new Error('Cannot redraw item: parent has no foreground container element');
+ foreground.appendChild(dom.box);
+ }
+ if (!dom.line.parentNode) {
+ var background = this.parent.dom.background;
+ if (!background) throw new Error('Cannot redraw item: parent has no background container element');
+ background.appendChild(dom.line);
+ }
+ if (!dom.dot.parentNode) {
+ var axis = this.parent.dom.axis;
+ if (!background) throw new Error('Cannot redraw item: parent has no axis container element');
+ axis.appendChild(dom.dot);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.box);
+ this._updateDataAttributes(this.dom.box);
+ this._updateStyle(this.dom.box);
+
+ var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false;
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly');
+ dom.box.className = 'vis-item vis-box' + className;
+ dom.line.className = 'vis-item vis-line' + className;
+ dom.dot.className = 'vis-item vis-dot' + className;
+
+ // recalculate size
+ this.props.dot.height = dom.dot.offsetHeight;
+ this.props.dot.width = dom.dot.offsetWidth;
+ this.props.line.width = dom.line.offsetWidth;
+ this.width = dom.box.offsetWidth;
+ this.height = dom.box.offsetHeight;
+
+ this.dirty = false;
+ }
+
+ this._repaintDeleteButton(dom.box);
+ };
+
+ /**
+ * Show the item in the DOM (when not already displayed). The items DOM will
+ * be created when needed.
+ */
+ BoxItem.prototype.show = function () {
+ if (!this.displayed) {
+ this.redraw();
+ }
+ };
+
+ /**
+ * Hide the item from the DOM (when visible)
+ */
+ BoxItem.prototype.hide = function () {
+ if (this.displayed) {
+ var dom = this.dom;
+
+ if (dom.box.parentNode) dom.box.parentNode.removeChild(dom.box);
+ if (dom.line.parentNode) dom.line.parentNode.removeChild(dom.line);
+ if (dom.dot.parentNode) dom.dot.parentNode.removeChild(dom.dot);
+
+ this.displayed = false;
+ }
+ };
+
+ /**
+ * Reposition the item horizontally
+ * @Override
+ */
+ BoxItem.prototype.repositionX = function () {
+ var start = this.conversion.toScreen(this.data.start);
+ var align = this.options.align;
+
+ // calculate left position of the box
+ if (align == 'right') {
+ if (this.options.rtl) {
+ this.right = start - this.width;
+
+ // reposition box, line, and dot
+ this.dom.box.style.right = this.right + 'px';
+ this.dom.line.style.right = start - this.props.line.width + 'px';
+ this.dom.dot.style.right = start - this.props.line.width / 2 - this.props.dot.width / 2 + 'px';
+ } else {
+ this.left = start - this.width;
+
+ // reposition box, line, and dot
+ this.dom.box.style.left = this.left + 'px';
+ this.dom.line.style.left = start - this.props.line.width + 'px';
+ this.dom.dot.style.left = start - this.props.line.width / 2 - this.props.dot.width / 2 + 'px';
+ }
+ } else if (align == 'left') {
+ if (this.options.rtl) {
+ this.right = start;
+
+ // reposition box, line, and dot
+ this.dom.box.style.right = this.right + 'px';
+ this.dom.line.style.right = start + 'px';
+ this.dom.dot.style.right = start + this.props.line.width / 2 - this.props.dot.width / 2 + 'px';
+ } else {
+ this.left = start;
+
+ // reposition box, line, and dot
+ this.dom.box.style.left = this.left + 'px';
+ this.dom.line.style.left = start + 'px';
+ this.dom.dot.style.left = start + this.props.line.width / 2 - this.props.dot.width / 2 + 'px';
+ }
+ } else {
+ // default or 'center'
+ if (this.options.rtl) {
+ this.right = start - this.width / 2;
+
+ // reposition box, line, and dot
+ this.dom.box.style.right = this.right + 'px';
+ this.dom.line.style.right = start - this.props.line.width + 'px';
+ this.dom.dot.style.right = start - this.props.dot.width / 2 + 'px';
+ } else {
+ this.left = start - this.width / 2;
+
+ // reposition box, line, and dot
+ this.dom.box.style.left = this.left + 'px';
+ this.dom.line.style.left = start - this.props.line.width / 2 + 'px';
+ this.dom.dot.style.left = start - this.props.dot.width / 2 + 'px';
+ }
+ }
+ };
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ BoxItem.prototype.repositionY = function () {
+ var orientation = this.options.orientation.item;
+ var box = this.dom.box;
+ var line = this.dom.line;
+ var dot = this.dom.dot;
+
+ if (orientation == 'top') {
+ box.style.top = (this.top || 0) + 'px';
+
+ line.style.top = '0';
+ line.style.height = this.parent.top + this.top + 1 + 'px';
+ line.style.bottom = '';
+ } else {
+ // orientation 'bottom'
+ var itemSetHeight = this.parent.itemSet.props.height; // TODO: this is nasty
+ var lineHeight = itemSetHeight - this.parent.top - this.parent.height + this.top;
+
+ box.style.top = (this.parent.height - this.top - this.height || 0) + 'px';
+ line.style.top = itemSetHeight - lineHeight + 'px';
+ line.style.bottom = '0';
+ }
+
+ dot.style.top = -this.props.dot.height / 2 + 'px';
+ };
+
+ /**
+ * Return the width of the item left from its start date
+ * @return {number}
+ */
+ BoxItem.prototype.getWidthLeft = function () {
+ return this.width / 2;
+ };
+
+ /**
+ * Return the width of the item right from its start date
+ * @return {number}
+ */
+ BoxItem.prototype.getWidthRight = function () {
+ return this.width / 2;
+ };
+
+ module.exports = BoxItem;
+
+/***/ },
+/* 42 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Item = __webpack_require__(39);
+
+ /**
+ * @constructor PointItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe available options
+ */
+ function PointItem(data, conversion, options) {
+ this.props = {
+ dot: {
+ top: 0,
+ width: 0,
+ height: 0
+ },
+ content: {
+ height: 0,
+ marginLeft: 0,
+ marginRight: 0
+ }
+ };
+ this.options = options;
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ PointItem.prototype = new Item(null, null, null);
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ PointItem.prototype.isVisible = function (range) {
+ // determine visibility
+ // TODO: account for the real width of the item. Right now we just add 1/4 to the window
+ var interval = (range.end - range.start) / 4;
+ return this.data.start > range.start - interval && this.data.start < range.end + interval;
+ };
+
+ /**
+ * Repaint the item
+ */
+ PointItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // background box
+ dom.point = document.createElement('div');
+ // className is updated in redraw()
+
+ // contents box, right from the dot
+ dom.content = document.createElement('div');
+ dom.content.className = 'vis-item-content';
+ dom.point.appendChild(dom.content);
+
+ // dot at start
+ dom.dot = document.createElement('div');
+ dom.point.appendChild(dom.dot);
+
+ // attach this item as attribute
+ dom.point['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.point.parentNode) {
+ var foreground = this.parent.dom.foreground;
+ if (!foreground) {
+ throw new Error('Cannot redraw item: parent has no foreground container element');
+ }
+ foreground.appendChild(dom.point);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.point);
+ this._updateDataAttributes(this.dom.point);
+ this._updateStyle(this.dom.point);
+
+ var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false;
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly');
+ dom.point.className = 'vis-item vis-point' + className;
+ dom.dot.className = 'vis-item vis-dot' + className;
+
+ // recalculate size of dot and contents
+ this.props.dot.width = dom.dot.offsetWidth;
+ this.props.dot.height = dom.dot.offsetHeight;
+ this.props.content.height = dom.content.offsetHeight;
+
+ // resize contents
+ if (this.options.rtl) {
+ dom.content.style.marginRight = 2 * this.props.dot.width + 'px';
+ } else {
+ dom.content.style.marginLeft = 2 * this.props.dot.width + 'px';
+ }
+ //dom.content.style.marginRight = ... + 'px'; // TODO: margin right
+
+ // recalculate size
+ this.width = dom.point.offsetWidth;
+ this.height = dom.point.offsetHeight;
+
+ // reposition the dot
+ dom.dot.style.top = (this.height - this.props.dot.height) / 2 + 'px';
+ if (this.options.rtl) {
+ dom.dot.style.right = this.props.dot.width / 2 + 'px';
+ } else {
+ dom.dot.style.left = this.props.dot.width / 2 + 'px';
+ }
+
+ this.dirty = false;
+ }
+
+ this._repaintDeleteButton(dom.point);
+ };
+
+ /**
+ * Show the item in the DOM (when not already visible). The items DOM will
+ * be created when needed.
+ */
+ PointItem.prototype.show = function () {
+ if (!this.displayed) {
+ this.redraw();
+ }
+ };
+
+ /**
+ * Hide the item from the DOM (when visible)
+ */
+ PointItem.prototype.hide = function () {
+ if (this.displayed) {
+ if (this.dom.point.parentNode) {
+ this.dom.point.parentNode.removeChild(this.dom.point);
+ }
+
+ this.displayed = false;
+ }
+ };
+
+ /**
+ * Reposition the item horizontally
+ * @Override
+ */
+ PointItem.prototype.repositionX = function () {
+ var start = this.conversion.toScreen(this.data.start);
+
+ if (this.options.rtl) {
+ this.right = start - this.props.dot.width;
+
+ // reposition point
+ this.dom.point.style.right = this.right + 'px';
+ } else {
+ this.left = start - this.props.dot.width;
+
+ // reposition point
+ this.dom.point.style.left = this.left + 'px';
+ }
+ };
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ PointItem.prototype.repositionY = function () {
+ var orientation = this.options.orientation.item;
+ var point = this.dom.point;
+ if (orientation == 'top') {
+ point.style.top = this.top + 'px';
+ } else {
+ point.style.top = this.parent.height - this.top - this.height + 'px';
+ }
+ };
+
+ /**
+ * Return the width of the item left from its start date
+ * @return {number}
+ */
+ PointItem.prototype.getWidthLeft = function () {
+ return this.props.dot.width;
+ };
+
+ /**
+ * Return the width of the item right from its start date
+ * @return {number}
+ */
+ PointItem.prototype.getWidthRight = function () {
+ return this.props.dot.width;
+ };
+
+ module.exports = PointItem;
+
+/***/ },
+/* 43 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var Item = __webpack_require__(39);
+ var BackgroundGroup = __webpack_require__(40);
+ var RangeItem = __webpack_require__(38);
+
+ /**
+ * @constructor BackgroundItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start, end
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe options
+ */
+ // TODO: implement support for the BackgroundItem just having a start, then being displayed as a sort of an annotation
+ function BackgroundItem(data, conversion, options) {
+ this.props = {
+ content: {
+ width: 0
+ }
+ };
+ this.overflow = false; // if contents can overflow (css styling), this flag is set to true
+
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data.id);
+ }
+ if (data.end == undefined) {
+ throw new Error('Property "end" missing in item ' + data.id);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ BackgroundItem.prototype = new Item(null, null, null);
+
+ BackgroundItem.prototype.baseClassName = 'vis-item vis-background';
+ BackgroundItem.prototype.stack = false;
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ BackgroundItem.prototype.isVisible = function (range) {
+ // determine visibility
+ return this.data.start < range.end && this.data.end > range.start;
+ };
+
+ /**
+ * Repaint the item
+ */
+ BackgroundItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // background box
+ dom.box = document.createElement('div');
+ // className is updated in redraw()
+
+ // frame box (to prevent the item contents from overflowing
+ dom.frame = document.createElement('div');
+ dom.frame.className = 'vis-item-overflow';
+ dom.box.appendChild(dom.frame);
+
+ // contents box
+ dom.content = document.createElement('div');
+ dom.content.className = 'vis-item-content';
+ dom.frame.appendChild(dom.content);
+
+ // Note: we do NOT attach this item as attribute to the DOM,
+ // such that background items cannot be selected
+ //dom.box['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.box.parentNode) {
+ var background = this.parent.dom.background;
+ if (!background) {
+ throw new Error('Cannot redraw item: parent has no background container element');
+ }
+ background.appendChild(dom.box);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.content);
+ this._updateDataAttributes(this.dom.content);
+ this._updateStyle(this.dom.box);
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '');
+ dom.box.className = this.baseClassName + className;
+
+ // determine from css whether this box has overflow
+ this.overflow = window.getComputedStyle(dom.content).overflow !== 'hidden';
+
+ // recalculate size
+ this.props.content.width = this.dom.content.offsetWidth;
+ this.height = 0; // set height zero, so this item will be ignored when stacking items
+
+ this.dirty = false;
+ }
+ };
+
+ /**
+ * Show the item in the DOM (when not already visible). The items DOM will
+ * be created when needed.
+ */
+ BackgroundItem.prototype.show = RangeItem.prototype.show;
+
+ /**
+ * Hide the item from the DOM (when visible)
+ * @return {Boolean} changed
+ */
+ BackgroundItem.prototype.hide = RangeItem.prototype.hide;
+
+ /**
+ * Reposition the item horizontally
+ * @Override
+ */
+ BackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ BackgroundItem.prototype.repositionY = function (margin) {
+ var onTop = this.options.orientation.item === 'top';
+ this.dom.content.style.top = onTop ? '' : '0';
+ this.dom.content.style.bottom = onTop ? '0' : '';
+ var height;
+
+ // special positioning for subgroups
+ if (this.data.subgroup !== undefined) {
+ // TODO: instead of calculating the top position of the subgroups here for every BackgroundItem, calculate the top of the subgroup once in Itemset
+
+ var itemSubgroup = this.data.subgroup;
+ var subgroups = this.parent.subgroups;
+ var subgroupIndex = subgroups[itemSubgroup].index;
+ // if the orientation is top, we need to take the difference in height into account.
+ if (onTop == true) {
+ // the first subgroup will have to account for the distance from the top to the first item.
+ height = this.parent.subgroups[itemSubgroup].height + margin.item.vertical;
+ height += subgroupIndex == 0 ? margin.axis - 0.5 * margin.item.vertical : 0;
+ var newTop = this.parent.top;
+ for (var subgroup in subgroups) {
+ if (subgroups.hasOwnProperty(subgroup)) {
+ if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroupIndex) {
+ newTop += subgroups[subgroup].height + margin.item.vertical;
+ }
+ }
+ }
+
+ // the others will have to be offset downwards with this same distance.
+ newTop += subgroupIndex != 0 ? margin.axis - 0.5 * margin.item.vertical : 0;
+ this.dom.box.style.top = newTop + 'px';
+ this.dom.box.style.bottom = '';
+ }
+ // and when the orientation is bottom:
+ else {
+ var newTop = this.parent.top;
+ var totalHeight = 0;
+ for (var subgroup in subgroups) {
+ if (subgroups.hasOwnProperty(subgroup)) {
+ if (subgroups[subgroup].visible == true) {
+ var newHeight = subgroups[subgroup].height + margin.item.vertical;
+ totalHeight += newHeight;
+ if (subgroups[subgroup].index > subgroupIndex) {
+ newTop += newHeight;
+ }
+ }
+ }
+ }
+ height = this.parent.subgroups[itemSubgroup].height + margin.item.vertical;
+ this.dom.box.style.top = this.parent.height - totalHeight + newTop + 'px';
+ this.dom.box.style.bottom = '';
+ }
+ }
+ // and in the case of no subgroups:
+ else {
+ // we want backgrounds with groups to only show in groups.
+ if (this.parent instanceof BackgroundGroup) {
+ // if the item is not in a group:
+ height = Math.max(this.parent.height, this.parent.itemSet.body.domProps.center.height, this.parent.itemSet.body.domProps.centerContainer.height);
+ this.dom.box.style.top = onTop ? '0' : '';
+ this.dom.box.style.bottom = onTop ? '' : '0';
+ } else {
+ height = this.parent.height;
+ // same alignment for items when orientation is top or bottom
+ this.dom.box.style.top = this.parent.top + 'px';
+ this.dom.box.style.bottom = '';
+ }
+ }
+ this.dom.box.style.height = height + 'px';
+ };
+
+ module.exports = BackgroundItem;
+
+/***/ },
+/* 44 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var util = __webpack_require__(1);
+ var Component = __webpack_require__(31);
+ var TimeStep = __webpack_require__(35);
+ var DateUtil = __webpack_require__(32);
+ var moment = __webpack_require__(2);
+
+ /**
+ * A horizontal time axis
+ * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body
+ * @param {Object} [options] See TimeAxis.setOptions for the available
+ * options.
+ * @constructor TimeAxis
+ * @extends Component
+ */
+ function TimeAxis(body, options) {
+ this.dom = {
+ foreground: null,
+ lines: [],
+ majorTexts: [],
+ minorTexts: [],
+ redundant: {
+ lines: [],
+ majorTexts: [],
+ minorTexts: []
+ }
+ };
+ this.props = {
+ range: {
+ start: 0,
+ end: 0,
+ minimumStep: 0
+ },
+ lineTop: 0
+ };
+
+ this.defaultOptions = {
+ orientation: {
+ axis: 'bottom'
+ }, // axis orientation: 'top' or 'bottom'
+ showMinorLabels: true,
+ showMajorLabels: true,
+ maxMinorChars: 7,
+ format: TimeStep.FORMAT,
+ moment: moment,
+ timeAxis: null
+ };
+ this.options = util.extend({}, this.defaultOptions);
+
+ this.body = body;
+
+ // create the HTML DOM
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ TimeAxis.prototype = new Component();
+
+ /**
+ * Set options for the TimeAxis.
+ * Parameters will be merged in current options.
+ * @param {Object} options Available options:
+ * {string} [orientation.axis]
+ * {boolean} [showMinorLabels]
+ * {boolean} [showMajorLabels]
+ */
+ TimeAxis.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ util.selectiveExtend(['showMinorLabels', 'showMajorLabels', 'maxMinorChars', 'hiddenDates', 'timeAxis', 'moment', 'rtl'], this.options, options);
+
+ // deep copy the format options
+ util.selectiveDeepExtend(['format'], this.options, options);
+
+ if ('orientation' in options) {
+ if (typeof options.orientation === 'string') {
+ this.options.orientation.axis = options.orientation;
+ } else if (_typeof(options.orientation) === 'object' && 'axis' in options.orientation) {
+ this.options.orientation.axis = options.orientation.axis;
+ }
+ }
+
+ // apply locale to moment.js
+ // TODO: not so nice, this is applied globally to moment.js
+ if ('locale' in options) {
+ if (typeof moment.locale === 'function') {
+ // moment.js 2.8.1+
+ moment.locale(options.locale);
+ } else {
+ moment.lang(options.locale);
+ }
+ }
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the TimeAxis
+ */
+ TimeAxis.prototype._create = function () {
+ this.dom.foreground = document.createElement('div');
+ this.dom.background = document.createElement('div');
+
+ this.dom.foreground.className = 'vis-time-axis vis-foreground';
+ this.dom.background.className = 'vis-time-axis vis-background';
+ };
+
+ /**
+ * Destroy the TimeAxis
+ */
+ TimeAxis.prototype.destroy = function () {
+ // remove from DOM
+ if (this.dom.foreground.parentNode) {
+ this.dom.foreground.parentNode.removeChild(this.dom.foreground);
+ }
+ if (this.dom.background.parentNode) {
+ this.dom.background.parentNode.removeChild(this.dom.background);
+ }
+
+ this.body = null;
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ TimeAxis.prototype.redraw = function () {
+ var props = this.props;
+ var foreground = this.dom.foreground;
+ var background = this.dom.background;
+
+ // determine the correct parent DOM element (depending on option orientation)
+ var parent = this.options.orientation.axis == 'top' ? this.body.dom.top : this.body.dom.bottom;
+ var parentChanged = foreground.parentNode !== parent;
+
+ // calculate character width and height
+ this._calculateCharSize();
+
+ // TODO: recalculate sizes only needed when parent is resized or options is changed
+ var showMinorLabels = this.options.showMinorLabels && this.options.orientation.axis !== 'none';
+ var showMajorLabels = this.options.showMajorLabels && this.options.orientation.axis !== 'none';
+
+ // determine the width and height of the elemens for the axis
+ props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;
+ props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;
+ props.height = props.minorLabelHeight + props.majorLabelHeight;
+ props.width = foreground.offsetWidth;
+
+ props.minorLineHeight = this.body.domProps.root.height - props.majorLabelHeight - (this.options.orientation.axis == 'top' ? this.body.domProps.bottom.height : this.body.domProps.top.height);
+ props.minorLineWidth = 1; // TODO: really calculate width
+ props.majorLineHeight = props.minorLineHeight + props.majorLabelHeight;
+ props.majorLineWidth = 1; // TODO: really calculate width
+
+ // take foreground and background offline while updating (is almost twice as fast)
+ var foregroundNextSibling = foreground.nextSibling;
+ var backgroundNextSibling = background.nextSibling;
+ foreground.parentNode && foreground.parentNode.removeChild(foreground);
+ background.parentNode && background.parentNode.removeChild(background);
+
+ foreground.style.height = this.props.height + 'px';
+
+ this._repaintLabels();
+
+ // put DOM online again (at the same place)
+ if (foregroundNextSibling) {
+ parent.insertBefore(foreground, foregroundNextSibling);
+ } else {
+ parent.appendChild(foreground);
+ }
+ if (backgroundNextSibling) {
+ this.body.dom.backgroundVertical.insertBefore(background, backgroundNextSibling);
+ } else {
+ this.body.dom.backgroundVertical.appendChild(background);
+ }
+ return this._isResized() || parentChanged;
+ };
+
+ /**
+ * Repaint major and minor text labels and vertical grid lines
+ * @private
+ */
+ TimeAxis.prototype._repaintLabels = function () {
+ var orientation = this.options.orientation.axis;
+
+ // calculate range and step (step such that we have space for 7 characters per label)
+ var start = util.convert(this.body.range.start, 'Number');
+ var end = util.convert(this.body.range.end, 'Number');
+ var timeLabelsize = this.body.util.toTime((this.props.minorCharWidth || 10) * this.options.maxMinorChars).valueOf();
+ var minimumStep = timeLabelsize - DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this.body.range, timeLabelsize);
+ minimumStep -= this.body.util.toTime(0).valueOf();
+
+ var step = new TimeStep(new Date(start), new Date(end), minimumStep, this.body.hiddenDates);
+ step.setMoment(this.options.moment);
+ if (this.options.format) {
+ step.setFormat(this.options.format);
+ }
+ if (this.options.timeAxis) {
+ step.setScale(this.options.timeAxis);
+ }
+ this.step = step;
+
+ // Move all DOM elements to a "redundant" list, where they
+ // can be picked for re-use, and clear the lists with lines and texts.
+ // At the end of the function _repaintLabels, left over elements will be cleaned up
+ var dom = this.dom;
+ dom.redundant.lines = dom.lines;
+ dom.redundant.majorTexts = dom.majorTexts;
+ dom.redundant.minorTexts = dom.minorTexts;
+ dom.lines = [];
+ dom.majorTexts = [];
+ dom.minorTexts = [];
+
+ var current;
+ var next;
+ var x;
+ var xNext;
+ var isMajor, nextIsMajor;
+ var width = 0,
+ prevWidth;
+ var line;
+ var labelMinor;
+ var xFirstMajorLabel = undefined;
+ var count = 0;
+ var MAX = 1000;
+ var className;
+
+ step.start();
+ next = step.getCurrent();
+ xNext = this.body.util.toScreen(next);
+ while (step.hasNext() && count < MAX) {
+ count++;
+
+ isMajor = step.isMajor();
+ className = step.getClassName();
+ labelMinor = step.getLabelMinor();
+
+ current = next;
+ x = xNext;
+
+ step.next();
+ next = step.getCurrent();
+ nextIsMajor = step.isMajor();
+ xNext = this.body.util.toScreen(next);
+
+ prevWidth = width;
+ width = xNext - x;
+ var showMinorGrid = width >= prevWidth * 0.4; // prevent displaying of the 31th of the month on a scale of 5 days
+
+ if (this.options.showMinorLabels && showMinorGrid) {
+ var label = this._repaintMinorText(x, labelMinor, orientation, className);
+ label.style.width = width + 'px'; // set width to prevent overflow
+ }
+
+ if (isMajor && this.options.showMajorLabels) {
+ if (x > 0) {
+ if (xFirstMajorLabel == undefined) {
+ xFirstMajorLabel = x;
+ }
+ label = this._repaintMajorText(x, step.getLabelMajor(), orientation, className);
+ }
+ line = this._repaintMajorLine(x, width, orientation, className);
+ } else {
+ // minor line
+ if (showMinorGrid) {
+ line = this._repaintMinorLine(x, width, orientation, className);
+ } else {
+ if (line) {
+ // adjust the width of the previous grid
+ line.style.width = parseInt(line.style.width) + width + 'px';
+ }
+ }
+ }
+ }
+
+ if (count === MAX && !warnedForOverflow) {
+ console.warn('Something is wrong with the Timeline scale. Limited drawing of grid lines to ' + MAX + ' lines.');
+ warnedForOverflow = true;
+ }
+
+ // create a major label on the left when needed
+ if (this.options.showMajorLabels) {
+ var leftTime = this.body.util.toTime(0),
+ leftText = step.getLabelMajor(leftTime),
+ widthText = leftText.length * (this.props.majorCharWidth || 10) + 10; // upper bound estimation
+
+ if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) {
+ this._repaintMajorText(0, leftText, orientation, className);
+ }
+ }
+
+ // Cleanup leftover DOM elements from the redundant list
+ util.forEach(this.dom.redundant, function (arr) {
+ while (arr.length) {
+ var elem = arr.pop();
+ if (elem && elem.parentNode) {
+ elem.parentNode.removeChild(elem);
+ }
+ }
+ });
+ };
+
+ /**
+ * Create a minor label for the axis at position x
+ * @param {Number} x
+ * @param {String} text
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the HTML element of the created label
+ * @private
+ */
+ TimeAxis.prototype._repaintMinorText = function (x, text, orientation, className) {
+ // reuse redundant label
+ var label = this.dom.redundant.minorTexts.shift();
+
+ if (!label) {
+ // create new label
+ var content = document.createTextNode('');
+ label = document.createElement('div');
+ label.appendChild(content);
+ this.dom.foreground.appendChild(label);
+ }
+ this.dom.minorTexts.push(label);
+
+ label.childNodes[0].nodeValue = text;
+
+ label.style.top = orientation == 'top' ? this.props.majorLabelHeight + 'px' : '0';
+
+ if (this.options.rtl) {
+ label.style.left = "";
+ label.style.right = x + 'px';
+ } else {
+ label.style.left = x + 'px';
+ };
+ label.className = 'vis-text vis-minor ' + className;
+ //label.title = title; // TODO: this is a heavy operation
+
+ return label;
+ };
+
+ /**
+ * Create a Major label for the axis at position x
+ * @param {Number} x
+ * @param {String} text
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the HTML element of the created label
+ * @private
+ */
+ TimeAxis.prototype._repaintMajorText = function (x, text, orientation, className) {
+ // reuse redundant label
+ var label = this.dom.redundant.majorTexts.shift();
+
+ if (!label) {
+ // create label
+ var content = document.createTextNode(text);
+ label = document.createElement('div');
+ label.appendChild(content);
+ this.dom.foreground.appendChild(label);
+ }
+ this.dom.majorTexts.push(label);
+
+ label.childNodes[0].nodeValue = text;
+ label.className = 'vis-text vis-major ' + className;
+ //label.title = title; // TODO: this is a heavy operation
+
+ label.style.top = orientation == 'top' ? '0' : this.props.minorLabelHeight + 'px';
+ if (this.options.rtl) {
+ label.style.left = "";
+ label.style.right = x + 'px';
+ } else {
+ label.style.left = x + 'px';
+ };
+
+ return label;
+ };
+
+ /**
+ * Create a minor line for the axis at position x
+ * @param {Number} x
+ * @param {Number} width
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the created line
+ * @private
+ */
+ TimeAxis.prototype._repaintMinorLine = function (x, width, orientation, className) {
+ // reuse redundant line
+ var line = this.dom.redundant.lines.shift();
+ if (!line) {
+ // create vertical line
+ line = document.createElement('div');
+ this.dom.background.appendChild(line);
+ }
+ this.dom.lines.push(line);
+
+ var props = this.props;
+ if (orientation == 'top') {
+ line.style.top = props.majorLabelHeight + 'px';
+ } else {
+ line.style.top = this.body.domProps.top.height + 'px';
+ }
+ line.style.height = props.minorLineHeight + 'px';
+ if (this.options.rtl) {
+ line.style.left = "";
+ line.style.right = x - props.minorLineWidth / 2 + 'px';
+ line.className = 'vis-grid vis-vertical-rtl vis-minor ' + className;
+ } else {
+ line.style.left = x - props.minorLineWidth / 2 + 'px';
+ line.className = 'vis-grid vis-vertical vis-minor ' + className;
+ };
+ line.style.width = width + 'px';
+
+ return line;
+ };
+
+ /**
+ * Create a Major line for the axis at position x
+ * @param {Number} x
+ * @param {Number} width
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the created line
+ * @private
+ */
+ TimeAxis.prototype._repaintMajorLine = function (x, width, orientation, className) {
+ // reuse redundant line
+ var line = this.dom.redundant.lines.shift();
+ if (!line) {
+ // create vertical line
+ line = document.createElement('div');
+ this.dom.background.appendChild(line);
+ }
+ this.dom.lines.push(line);
+
+ var props = this.props;
+ if (orientation == 'top') {
+ line.style.top = '0';
+ } else {
+ line.style.top = this.body.domProps.top.height + 'px';
+ }
+
+ if (this.options.rtl) {
+ line.style.left = "";
+ line.style.right = x - props.majorLineWidth / 2 + 'px';
+ line.className = 'vis-grid vis-vertical-rtl vis-major ' + className;
+ } else {
+ line.style.left = x - props.majorLineWidth / 2 + 'px';
+ line.className = 'vis-grid vis-vertical vis-major ' + className;
+ }
+
+ line.style.height = props.majorLineHeight + 'px';
+ line.style.width = width + 'px';
+
+ return line;
+ };
+
+ /**
+ * Determine the size of text on the axis (both major and minor axis).
+ * The size is calculated only once and then cached in this.props.
+ * @private
+ */
+ TimeAxis.prototype._calculateCharSize = function () {
+ // Note: We calculate char size with every redraw. Size may change, for
+ // example when any of the timelines parents had display:none for example.
+
+ // determine the char width and height on the minor axis
+ if (!this.dom.measureCharMinor) {
+ this.dom.measureCharMinor = document.createElement('DIV');
+ this.dom.measureCharMinor.className = 'vis-text vis-minor vis-measure';
+ this.dom.measureCharMinor.style.position = 'absolute';
+
+ this.dom.measureCharMinor.appendChild(document.createTextNode('0'));
+ this.dom.foreground.appendChild(this.dom.measureCharMinor);
+ }
+ this.props.minorCharHeight = this.dom.measureCharMinor.clientHeight;
+ this.props.minorCharWidth = this.dom.measureCharMinor.clientWidth;
+
+ // determine the char width and height on the major axis
+ if (!this.dom.measureCharMajor) {
+ this.dom.measureCharMajor = document.createElement('DIV');
+ this.dom.measureCharMajor.className = 'vis-text vis-major vis-measure';
+ this.dom.measureCharMajor.style.position = 'absolute';
+
+ this.dom.measureCharMajor.appendChild(document.createTextNode('0'));
+ this.dom.foreground.appendChild(this.dom.measureCharMajor);
+ }
+ this.props.majorCharHeight = this.dom.measureCharMajor.clientHeight;
+ this.props.majorCharWidth = this.dom.measureCharMajor.clientWidth;
+ };
+
+ var warnedForOverflow = false;
+
+ module.exports = TimeAxis;
+
+/***/ },
+/* 45 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var keycharm = __webpack_require__(23);
+ var Emitter = __webpack_require__(13);
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+
+ /**
+ * Turn an element into an clickToUse element.
+ * When not active, the element has a transparent overlay. When the overlay is
+ * clicked, the mode is changed to active.
+ * When active, the element is displayed with a blue border around it, and
+ * the interactive contents of the element can be used. When clicked outside
+ * the element, the elements mode is changed to inactive.
+ * @param {Element} container
+ * @constructor
+ */
+ function Activator(container) {
+ this.active = false;
+
+ this.dom = {
+ container: container
+ };
+
+ this.dom.overlay = document.createElement('div');
+ this.dom.overlay.className = 'vis-overlay';
+
+ this.dom.container.appendChild(this.dom.overlay);
+
+ this.hammer = Hammer(this.dom.overlay);
+ this.hammer.on('tap', this._onTapOverlay.bind(this));
+
+ // block all touch events (except tap)
+ var me = this;
+ var events = ['tap', 'doubletap', 'press', 'pinch', 'pan', 'panstart', 'panmove', 'panend'];
+ events.forEach(function (event) {
+ me.hammer.on(event, function (event) {
+ event.stopPropagation();
+ });
+ });
+
+ // attach a click event to the window, in order to deactivate when clicking outside the timeline
+ if (document && document.body) {
+ this.onClick = function (event) {
+ if (!_hasParent(event.target, container)) {
+ me.deactivate();
+ }
+ };
+ document.body.addEventListener('click', this.onClick);
+ }
+
+ if (this.keycharm !== undefined) {
+ this.keycharm.destroy();
+ }
+ this.keycharm = keycharm();
+
+ // keycharm listener only bounded when active)
+ this.escListener = this.deactivate.bind(this);
+ }
+
+ // turn into an event emitter
+ Emitter(Activator.prototype);
+
+ // The currently active activator
+ Activator.current = null;
+
+ /**
+ * Destroy the activator. Cleans up all created DOM and event listeners
+ */
+ Activator.prototype.destroy = function () {
+ this.deactivate();
+
+ // remove dom
+ this.dom.overlay.parentNode.removeChild(this.dom.overlay);
+
+ // remove global event listener
+ if (this.onClick) {
+ document.body.removeEventListener('click', this.onClick);
+ }
+
+ // cleanup hammer instances
+ this.hammer.destroy();
+ this.hammer = null;
+ // FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory)
+ };
+
+ /**
+ * Activate the element
+ * Overlay is hidden, element is decorated with a blue shadow border
+ */
+ Activator.prototype.activate = function () {
+ // we allow only one active activator at a time
+ if (Activator.current) {
+ Activator.current.deactivate();
+ }
+ Activator.current = this;
+
+ this.active = true;
+ this.dom.overlay.style.display = 'none';
+ util.addClassName(this.dom.container, 'vis-active');
+
+ this.emit('change');
+ this.emit('activate');
+
+ // ugly hack: bind ESC after emitting the events, as the Network rebinds all
+ // keyboard events on a 'change' event
+ this.keycharm.bind('esc', this.escListener);
+ };
+
+ /**
+ * Deactivate the element
+ * Overlay is displayed on top of the element
+ */
+ Activator.prototype.deactivate = function () {
+ this.active = false;
+ this.dom.overlay.style.display = '';
+ util.removeClassName(this.dom.container, 'vis-active');
+ this.keycharm.unbind('esc', this.escListener);
+
+ this.emit('change');
+ this.emit('deactivate');
+ };
+
+ /**
+ * Handle a tap event: activate the container
+ * @param event
+ * @private
+ */
+ Activator.prototype._onTapOverlay = function (event) {
+ // activate the container
+ this.activate();
+ event.stopPropagation();
+ };
+
+ /**
+ * Test whether the element has the requested parent element somewhere in
+ * its chain of parent nodes.
+ * @param {HTMLElement} element
+ * @param {HTMLElement} parent
+ * @returns {boolean} Returns true when the parent is found somewhere in the
+ * chain of parent nodes.
+ * @private
+ */
+ function _hasParent(element, parent) {
+ while (element) {
+ if (element === parent) {
+ return true;
+ }
+ element = element.parentNode;
+ }
+ return false;
+ }
+
+ module.exports = Activator;
+
+/***/ },
+/* 46 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+ var Component = __webpack_require__(31);
+ var moment = __webpack_require__(2);
+ var locales = __webpack_require__(47);
+
+ /**
+ * A custom time bar
+ * @param {{range: Range, dom: Object}} body
+ * @param {Object} [options] Available parameters:
+ * {number | string} id
+ * {string} locales
+ * {string} locale
+ * @constructor CustomTime
+ * @extends Component
+ */
+
+ function CustomTime(body, options) {
+ this.body = body;
+
+ // default options
+ this.defaultOptions = {
+ moment: moment,
+ locales: locales,
+ locale: 'en',
+ id: undefined,
+ title: undefined
+ };
+ this.options = util.extend({}, this.defaultOptions);
+
+ if (options && options.time) {
+ this.customTime = options.time;
+ } else {
+ this.customTime = new Date();
+ }
+
+ this.eventParams = {}; // stores state parameters while dragging the bar
+
+ this.setOptions(options);
+
+ // create the DOM
+ this._create();
+ }
+
+ CustomTime.prototype = new Component();
+
+ /**
+ * Set options for the component. Options will be merged in current options.
+ * @param {Object} options Available parameters:
+ * {number | string} id
+ * {string} locales
+ * {string} locale
+ */
+ CustomTime.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ util.selectiveExtend(['moment', 'locale', 'locales', 'id'], this.options, options);
+ }
+ };
+
+ /**
+ * Create the DOM for the custom time
+ * @private
+ */
+ CustomTime.prototype._create = function () {
+ var bar = document.createElement('div');
+ bar['custom-time'] = this;
+ bar.className = 'vis-custom-time ' + (this.options.id || '');
+ bar.style.position = 'absolute';
+ bar.style.top = '0px';
+ bar.style.height = '100%';
+ this.bar = bar;
+
+ var drag = document.createElement('div');
+ drag.style.position = 'relative';
+ drag.style.top = '0px';
+ drag.style.left = '-10px';
+ drag.style.height = '100%';
+ drag.style.width = '20px';
+ bar.appendChild(drag);
+
+ // attach event listeners
+ this.hammer = new Hammer(drag);
+ this.hammer.on('panstart', this._onDragStart.bind(this));
+ this.hammer.on('panmove', this._onDrag.bind(this));
+ this.hammer.on('panend', this._onDragEnd.bind(this));
+ this.hammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_HORIZONTAL });
+ };
+
+ /**
+ * Destroy the CustomTime bar
+ */
+ CustomTime.prototype.destroy = function () {
+ this.hide();
+
+ this.hammer.destroy();
+ this.hammer = null;
+
+ this.body = null;
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ CustomTime.prototype.redraw = function () {
+ var parent = this.body.dom.backgroundVertical;
+ if (this.bar.parentNode != parent) {
+ // attach to the dom
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ parent.appendChild(this.bar);
+ }
+
+ var x = this.body.util.toScreen(this.customTime);
+
+ var locale = this.options.locales[this.options.locale];
+ if (!locale) {
+ if (!this.warned) {
+ console.log('WARNING: options.locales[\'' + this.options.locale + '\'] not found. See http://visjs.org/docs/timeline.html#Localization');
+ this.warned = true;
+ }
+ locale = this.options.locales['en']; // fall back on english when not available
+ }
+
+ var title = this.options.title;
+ // To hide the title completely use empty string ''.
+ if (title === undefined) {
+ title = locale.time + ': ' + this.options.moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss');
+ title = title.charAt(0).toUpperCase() + title.substring(1);
+ }
+
+ this.bar.style.left = x + 'px';
+ this.bar.title = title;
+
+ return false;
+ };
+
+ /**
+ * Remove the CustomTime from the DOM
+ */
+ CustomTime.prototype.hide = function () {
+ // remove the line from the DOM
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ };
+
+ /**
+ * Set custom time.
+ * @param {Date | number | string} time
+ */
+ CustomTime.prototype.setCustomTime = function (time) {
+ this.customTime = util.convert(time, 'Date');
+ this.redraw();
+ };
+
+ /**
+ * Retrieve the current custom time.
+ * @return {Date} customTime
+ */
+ CustomTime.prototype.getCustomTime = function () {
+ return new Date(this.customTime.valueOf());
+ };
+
+ /**
+ * Set custom title.
+ * @param {Date | number | string} title
+ */
+ CustomTime.prototype.setCustomTitle = function (title) {
+ this.options.title = title;
+ };
+
+ /**
+ * Start moving horizontally
+ * @param {Event} event
+ * @private
+ */
+ CustomTime.prototype._onDragStart = function (event) {
+ this.eventParams.dragging = true;
+ this.eventParams.customTime = this.customTime;
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Perform moving operating.
+ * @param {Event} event
+ * @private
+ */
+ CustomTime.prototype._onDrag = function (event) {
+ if (!this.eventParams.dragging) return;
+
+ var x = this.body.util.toScreen(this.eventParams.customTime) + event.deltaX;
+ var time = this.body.util.toTime(x);
+
+ this.setCustomTime(time);
+
+ // fire a timechange event
+ this.body.emitter.emit('timechange', {
+ id: this.options.id,
+ time: new Date(this.customTime.valueOf())
+ });
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Stop moving operating.
+ * @param {Event} event
+ * @private
+ */
+ CustomTime.prototype._onDragEnd = function (event) {
+ if (!this.eventParams.dragging) return;
+
+ // fire a timechanged event
+ this.body.emitter.emit('timechanged', {
+ id: this.options.id,
+ time: new Date(this.customTime.valueOf())
+ });
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Find a custom time from an event target:
+ * searches for the attribute 'custom-time' in the event target's element tree
+ * @param {Event} event
+ * @return {CustomTime | null} customTime
+ */
+ CustomTime.customTimeFromTarget = function (event) {
+ var target = event.target;
+ while (target) {
+ if (target.hasOwnProperty('custom-time')) {
+ return target['custom-time'];
+ }
+ target = target.parentNode;
+ }
+
+ return null;
+ };
+
+ module.exports = CustomTime;
+
+/***/ },
+/* 47 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ // English
+ exports['en'] = {
+ current: 'current',
+ time: 'time'
+ };
+ exports['en_EN'] = exports['en'];
+ exports['en_US'] = exports['en'];
+
+ // Dutch
+ exports['nl'] = {
+ current: 'huidige',
+ time: 'tijd'
+ };
+ exports['nl_NL'] = exports['nl'];
+ exports['nl_BE'] = exports['nl'];
+
+/***/ },
+/* 48 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var Component = __webpack_require__(31);
+ var moment = __webpack_require__(2);
+ var locales = __webpack_require__(47);
+
+ /**
+ * A current time bar
+ * @param {{range: Range, dom: Object, domProps: Object}} body
+ * @param {Object} [options] Available parameters:
+ * {Boolean} [showCurrentTime]
+ * @constructor CurrentTime
+ * @extends Component
+ */
+ function CurrentTime(body, options) {
+ this.body = body;
+
+ // default options
+ this.defaultOptions = {
+ rtl: false,
+ showCurrentTime: true,
+
+ moment: moment,
+ locales: locales,
+ locale: 'en'
+ };
+ this.options = util.extend({}, this.defaultOptions);
+ this.offset = 0;
+
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ CurrentTime.prototype = new Component();
+
+ /**
+ * Create the HTML DOM for the current time bar
+ * @private
+ */
+ CurrentTime.prototype._create = function () {
+ var bar = document.createElement('div');
+ bar.className = 'vis-current-time';
+ bar.style.position = 'absolute';
+ bar.style.top = '0px';
+ bar.style.height = '100%';
+
+ this.bar = bar;
+ };
+
+ /**
+ * Destroy the CurrentTime bar
+ */
+ CurrentTime.prototype.destroy = function () {
+ this.options.showCurrentTime = false;
+ this.redraw(); // will remove the bar from the DOM and stop refreshing
+
+ this.body = null;
+ };
+
+ /**
+ * Set options for the component. Options will be merged in current options.
+ * @param {Object} options Available parameters:
+ * {boolean} [showCurrentTime]
+ */
+ CurrentTime.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ util.selectiveExtend(['rtl', 'showCurrentTime', 'moment', 'locale', 'locales'], this.options, options);
+ }
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ CurrentTime.prototype.redraw = function () {
+ if (this.options.showCurrentTime) {
+ var parent = this.body.dom.backgroundVertical;
+ if (this.bar.parentNode != parent) {
+ // attach to the dom
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ parent.appendChild(this.bar);
+
+ this.start();
+ }
+
+ var now = this.options.moment(new Date().valueOf() + this.offset);
+ var x = this.body.util.toScreen(now);
+
+ var locale = this.options.locales[this.options.locale];
+ if (!locale) {
+ if (!this.warned) {
+ console.log('WARNING: options.locales[\'' + this.options.locale + '\'] not found. See http://visjs.org/docs/timeline/#Localization');
+ this.warned = true;
+ }
+ locale = this.options.locales['en']; // fall back on english when not available
+ }
+ var title = locale.current + ' ' + locale.time + ': ' + now.format('dddd, MMMM Do YYYY, H:mm:ss');
+ title = title.charAt(0).toUpperCase() + title.substring(1);
+
+ if (this.options.rtl) {
+ this.bar.style.right = x + 'px';
+ } else {
+ this.bar.style.left = x + 'px';
+ }
+ this.bar.title = title;
+ } else {
+ // remove the line from the DOM
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ this.stop();
+ }
+
+ return false;
+ };
+
+ /**
+ * Start auto refreshing the current time bar
+ */
+ CurrentTime.prototype.start = function () {
+ var me = this;
+
+ function update() {
+ me.stop();
+
+ // determine interval to refresh
+ var scale = me.body.range.conversion(me.body.domProps.center.width).scale;
+ var interval = 1 / scale / 10;
+ if (interval < 30) interval = 30;
+ if (interval > 1000) interval = 1000;
+
+ me.redraw();
+ me.body.emitter.emit('currentTimeTick');
+
+ // start a renderTimer to adjust for the new time
+ me.currentTimeTimer = setTimeout(update, interval);
+ }
+
+ update();
+ };
+
+ /**
+ * Stop auto refreshing the current time bar
+ */
+ CurrentTime.prototype.stop = function () {
+ if (this.currentTimeTimer !== undefined) {
+ clearTimeout(this.currentTimeTimer);
+ delete this.currentTimeTimer;
+ }
+ };
+
+ /**
+ * Set a current time. This can be used for example to ensure that a client's
+ * time is synchronized with a shared server time.
+ * @param {Date | String | Number} time A Date, unix timestamp, or
+ * ISO date string.
+ */
+ CurrentTime.prototype.setCurrentTime = function (time) {
+ var t = util.convert(time, 'Date').valueOf();
+ var now = new Date().valueOf();
+ this.offset = t - now;
+ this.redraw();
+ };
+
+ /**
+ * Get the current time.
+ * @return {Date} Returns the current time.
+ */
+ CurrentTime.prototype.getCurrentTime = function () {
+ return new Date(new Date().valueOf() + this.offset);
+ };
+
+ module.exports = CurrentTime;
+
+/***/ },
+/* 49 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ /**
+ * This object contains all possible options. It will check if the types are correct, if required if the option is one
+ * of the allowed values.
+ *
+ * __any__ means that the name of the property does not matter.
+ * __type__ is a required field for all objects and contains the allowed types of all objects
+ */
+ var string = 'string';
+ var boolean = 'boolean';
+ var number = 'number';
+ var array = 'array';
+ var date = 'date';
+ var object = 'object'; // should only be in a __type__ property
+ var dom = 'dom';
+ var moment = 'moment';
+ var any = 'any';
+
+ var allOptions = {
+ configure: {
+ enabled: { boolean: boolean },
+ filter: { boolean: boolean, 'function': 'function' },
+ container: { dom: dom },
+ __type__: { object: object, boolean: boolean, 'function': 'function' }
+ },
+
+ //globals :
+ align: { string: string },
+ rtl: { boolean: boolean, 'undefined': 'undefined' },
+ autoResize: { boolean: boolean },
+ throttleRedraw: { number: number },
+ clickToUse: { boolean: boolean },
+ dataAttributes: { string: string, array: array },
+ editable: {
+ add: { boolean: boolean, 'undefined': 'undefined' },
+ remove: { boolean: boolean, 'undefined': 'undefined' },
+ updateGroup: { boolean: boolean, 'undefined': 'undefined' },
+ updateTime: { boolean: boolean, 'undefined': 'undefined' },
+ __type__: { boolean: boolean, object: object }
+ },
+ end: { number: number, date: date, string: string, moment: moment },
+ format: {
+ minorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ majorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ __type__: { object: object }
+ },
+ moment: { 'function': 'function' },
+ groupOrder: { string: string, 'function': 'function' },
+ groupEditable: {
+ add: { boolean: boolean, 'undefined': 'undefined' },
+ remove: { boolean: boolean, 'undefined': 'undefined' },
+ order: { boolean: boolean, 'undefined': 'undefined' },
+ __type__: { boolean: boolean, object: object }
+ },
+ groupOrderSwap: { 'function': 'function' },
+ height: { string: string, number: number },
+ hiddenDates: {
+ start: { date: date, number: number, string: string, moment: moment },
+ end: { date: date, number: number, string: string, moment: moment },
+ repeat: { string: string },
+ __type__: { object: object, array: array }
+ },
+ itemsAlwaysDraggable: { boolean: boolean },
+ locale: { string: string },
+ locales: {
+ __any__: { any: any },
+ __type__: { object: object }
+ },
+ margin: {
+ axis: { number: number },
+ item: {
+ horizontal: { number: number, 'undefined': 'undefined' },
+ vertical: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object, number: number }
+ },
+ __type__: { object: object, number: number }
+ },
+ max: { date: date, number: number, string: string, moment: moment },
+ maxHeight: { number: number, string: string },
+ maxMinorChars: { number: number },
+ min: { date: date, number: number, string: string, moment: moment },
+ minHeight: { number: number, string: string },
+ moveable: { boolean: boolean },
+ multiselect: { boolean: boolean },
+ multiselectPerGroup: { boolean: boolean },
+ onAdd: { 'function': 'function' },
+ onUpdate: { 'function': 'function' },
+ onMove: { 'function': 'function' },
+ onMoving: { 'function': 'function' },
+ onRemove: { 'function': 'function' },
+ onAddGroup: { 'function': 'function' },
+ onMoveGroup: { 'function': 'function' },
+ onRemoveGroup: { 'function': 'function' },
+ order: { 'function': 'function' },
+ orientation: {
+ axis: { string: string, 'undefined': 'undefined' },
+ item: { string: string, 'undefined': 'undefined' },
+ __type__: { string: string, object: object }
+ },
+ selectable: { boolean: boolean },
+ showCurrentTime: { boolean: boolean },
+ showMajorLabels: { boolean: boolean },
+ showMinorLabels: { boolean: boolean },
+ stack: { boolean: boolean },
+ snap: { 'function': 'function', 'null': 'null' },
+ start: { date: date, number: number, string: string, moment: moment },
+ template: { 'function': 'function' },
+ groupTemplate: { 'function': 'function' },
+ timeAxis: {
+ scale: { string: string, 'undefined': 'undefined' },
+ step: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ type: { string: string },
+ width: { string: string, number: number },
+ zoomable: { boolean: boolean },
+ zoomKey: { string: ['ctrlKey', 'altKey', 'metaKey', ''] },
+ zoomMax: { number: number },
+ zoomMin: { number: number },
+
+ __type__: { object: object }
+ };
+
+ var configureOptions = {
+ global: {
+ align: ['center', 'left', 'right'],
+ direction: false,
+ autoResize: true,
+ throttleRedraw: [10, 0, 1000, 10],
+ clickToUse: false,
+ // dataAttributes: ['all'], // FIXME: can be 'all' or string[]
+ editable: {
+ add: false,
+ remove: false,
+ updateGroup: false,
+ updateTime: false
+ },
+ end: '',
+ format: {
+ minorLabels: {
+ millisecond: 'SSS',
+ second: 's',
+ minute: 'HH:mm',
+ hour: 'HH:mm',
+ weekday: 'ddd D',
+ day: 'D',
+ month: 'MMM',
+ year: 'YYYY'
+ },
+ majorLabels: {
+ millisecond: 'HH:mm:ss',
+ second: 'D MMMM HH:mm',
+ minute: 'ddd D MMMM',
+ hour: 'ddd D MMMM',
+ weekday: 'MMMM YYYY',
+ day: 'MMMM YYYY',
+ month: 'YYYY',
+ year: ''
+ }
+ },
+
+ //groupOrder: {string, 'function': 'function'},
+ groupsDraggable: false,
+ height: '',
+ //hiddenDates: {object, array},
+ locale: '',
+ margin: {
+ axis: [20, 0, 100, 1],
+ item: {
+ horizontal: [10, 0, 100, 1],
+ vertical: [10, 0, 100, 1]
+ }
+ },
+ max: '',
+ maxHeight: '',
+ maxMinorChars: [7, 0, 20, 1],
+ min: '',
+ minHeight: '',
+ moveable: false,
+ multiselect: false,
+ multiselectPerGroup: false,
+ //onAdd: {'function': 'function'},
+ //onUpdate: {'function': 'function'},
+ //onMove: {'function': 'function'},
+ //onMoving: {'function': 'function'},
+ //onRename: {'function': 'function'},
+ //order: {'function': 'function'},
+ orientation: {
+ axis: ['both', 'bottom', 'top'],
+ item: ['bottom', 'top']
+ },
+ selectable: true,
+ showCurrentTime: false,
+ showMajorLabels: true,
+ showMinorLabels: true,
+ stack: true,
+ //snap: {'function': 'function', nada},
+ start: '',
+ //template: {'function': 'function'},
+ //timeAxis: {
+ // scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'],
+ // step: [1, 1, 10, 1]
+ //},
+ type: ['box', 'point', 'range', 'background'],
+ width: '100%',
+ zoomable: true,
+ zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],
+ zoomMax: [315360000000000, 10, 315360000000000, 1],
+ zoomMin: [10, 10, 315360000000000, 1]
+ }
+ };
+
+ exports.allOptions = allOptions;
+ exports.configureOptions = configureOptions;
+
+/***/ },
+/* 50 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _Configurator = __webpack_require__(26);
+
+ var _Configurator2 = _interopRequireDefault(_Configurator);
+
+ var _Validator = __webpack_require__(29);
+
+ var _Validator2 = _interopRequireDefault(_Validator);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var Emitter = __webpack_require__(13);
+ var Hammer = __webpack_require__(20);
+ var moment = __webpack_require__(2);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var Range = __webpack_require__(30);
+ var Core = __webpack_require__(33);
+ var TimeAxis = __webpack_require__(44);
+ var CurrentTime = __webpack_require__(48);
+ var CustomTime = __webpack_require__(46);
+ var LineGraph = __webpack_require__(51);
+
+ var printStyle = __webpack_require__(29).printStyle;
+ var allOptions = __webpack_require__(59).allOptions;
+ var configureOptions = __webpack_require__(59).configureOptions;
+
+ /**
+ * Create a timeline visualization
+ * @param {HTMLElement} container
+ * @param {vis.DataSet | Array} [items]
+ * @param {Object} [options] See Graph2d.setOptions for the available options.
+ * @constructor
+ * @extends Core
+ */
+ function Graph2d(container, items, groups, options) {
+ // if the third element is options, the forth is groups (optionally);
+ if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {
+ var forthArgument = options;
+ options = groups;
+ groups = forthArgument;
+ }
+
+ var me = this;
+ this.defaultOptions = {
+ start: null,
+ end: null,
+
+ autoResize: true,
+
+ orientation: {
+ axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'
+ item: 'bottom' // not relevant for Graph2d
+ },
+
+ moment: moment,
+
+ width: null,
+ height: null,
+ maxHeight: null,
+ minHeight: null
+ };
+ this.options = util.deepExtend({}, this.defaultOptions);
+
+ // Create the DOM, props, and emitter
+ this._create(container);
+
+ // all components listed here will be repainted automatically
+ this.components = [];
+
+ this.body = {
+ dom: this.dom,
+ domProps: this.props,
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this)
+ },
+ hiddenDates: [],
+ util: {
+ toScreen: me._toScreen.bind(me),
+ toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
+ toTime: me._toTime.bind(me),
+ toGlobalTime: me._toGlobalTime.bind(me)
+ }
+ };
+
+ // range
+ this.range = new Range(this.body);
+ this.components.push(this.range);
+ this.body.range = this.range;
+
+ // time axis
+ this.timeAxis = new TimeAxis(this.body);
+ this.components.push(this.timeAxis);
+ //this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);
+
+ // current time bar
+ this.currentTime = new CurrentTime(this.body);
+ this.components.push(this.currentTime);
+
+ // item set
+ this.linegraph = new LineGraph(this.body);
+
+ this.components.push(this.linegraph);
+
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ this.on('tap', function (event) {
+ me.emit('click', me.getEventProperties(event));
+ });
+ this.on('doubletap', function (event) {
+ me.emit('doubleClick', me.getEventProperties(event));
+ });
+ this.dom.root.oncontextmenu = function (event) {
+ me.emit('contextmenu', me.getEventProperties(event));
+ };
+
+ // apply options
+ if (options) {
+ this.setOptions(options);
+ }
+
+ // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!
+ if (groups) {
+ this.setGroups(groups);
+ }
+
+ // create itemset
+ if (items) {
+ this.setItems(items);
+ }
+
+ // draw for the first time
+ this._redraw();
+ }
+
+ // Extend the functionality from Core
+ Graph2d.prototype = new Core();
+
+ Graph2d.prototype.setOptions = function (options) {
+ // validate options
+ var errorFound = _Validator2.default.validate(options, allOptions);
+ if (errorFound === true) {
+ console.log('%cErrors have been found in the supplied options object.', printStyle);
+ }
+
+ Core.prototype.setOptions.call(this, options);
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | Array | null} items
+ */
+ Graph2d.prototype.setItems = function (items) {
+ var initialLoad = this.itemsData == null;
+
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!items) {
+ newDataSet = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ newDataSet = items;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(items, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
+ }
+
+ // set items
+ this.itemsData = newDataSet;
+ this.linegraph && this.linegraph.setItems(newDataSet);
+
+ if (initialLoad) {
+ if (this.options.start != undefined || this.options.end != undefined) {
+ var start = this.options.start != undefined ? this.options.start : null;
+ var end = this.options.end != undefined ? this.options.end : null;
+ this.setWindow(start, end, { animation: false });
+ } else {
+ this.fit({ animation: false });
+ }
+ }
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet | Array} groups
+ */
+ Graph2d.prototype.setGroups = function (groups) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!groups) {
+ newDataSet = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ newDataSet = groups;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(groups);
+ }
+
+ this.groupsData = newDataSet;
+ this.linegraph.setGroups(newDataSet);
+ };
+
+ /**
+ * Returns an object containing an SVG element with the icon of the group (size determined by iconWidth and iconHeight), the label of the group (content) and the yAxisOrientation of the group (left or right).
+ * @param groupId
+ * @param width
+ * @param height
+ */
+ Graph2d.prototype.getLegend = function (groupId, width, height) {
+ if (width === undefined) {
+ width = 15;
+ }
+ if (height === undefined) {
+ height = 15;
+ }
+ if (this.linegraph.groups[groupId] !== undefined) {
+ return this.linegraph.groups[groupId].getLegend(width, height);
+ } else {
+ return "cannot find group:'" + groupId + "'";
+ }
+ };
+
+ /**
+ * This checks if the visible option of the supplied group (by ID) is true or false.
+ * @param groupId
+ * @returns {*}
+ */
+ Graph2d.prototype.isGroupVisible = function (groupId) {
+ if (this.linegraph.groups[groupId] !== undefined) {
+ return this.linegraph.groups[groupId].visible && (this.linegraph.options.groups.visibility[groupId] === undefined || this.linegraph.options.groups.visibility[groupId] == true);
+ } else {
+ return false;
+ }
+ };
+
+ /**
+ * Get the data range of the item set.
+ * @returns {{min: Date, max: Date}} range A range with a start and end Date.
+ * When no minimum is found, min==null
+ * When no maximum is found, max==null
+ */
+ Graph2d.prototype.getDataRange = function () {
+ var min = null;
+ var max = null;
+
+ // calculate min from start filed
+ for (var groupId in this.linegraph.groups) {
+ if (this.linegraph.groups.hasOwnProperty(groupId)) {
+ if (this.linegraph.groups[groupId].visible == true) {
+ for (var i = 0; i < this.linegraph.groups[groupId].itemsData.length; i++) {
+ var item = this.linegraph.groups[groupId].itemsData[i];
+ var value = util.convert(item.x, 'Date').valueOf();
+ min = min == null ? value : min > value ? value : min;
+ max = max == null ? value : max < value ? value : max;
+ }
+ }
+ }
+ }
+
+ return {
+ min: min != null ? new Date(min) : null,
+ max: max != null ? new Date(max) : null
+ };
+ };
+
+ /**
+ * Generate Timeline related information from an event
+ * @param {Event} event
+ * @return {Object} An object with related information, like on which area
+ * The event happened, whether clicked on an item, etc.
+ */
+ Graph2d.prototype.getEventProperties = function (event) {
+ var clientX = event.center ? event.center.x : event.clientX;
+ var clientY = event.center ? event.center.y : event.clientY;
+ var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);
+ var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);
+ var time = this._toTime(x);
+
+ var customTime = CustomTime.customTimeFromTarget(event);
+
+ var element = util.getTarget(event);
+ var what = null;
+ if (util.hasParent(element, this.timeAxis.dom.foreground)) {
+ what = 'axis';
+ } else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {
+ what = 'axis';
+ } else if (util.hasParent(element, this.linegraph.yAxisLeft.dom.frame)) {
+ what = 'data-axis';
+ } else if (util.hasParent(element, this.linegraph.yAxisRight.dom.frame)) {
+ what = 'data-axis';
+ } else if (util.hasParent(element, this.linegraph.legendLeft.dom.frame)) {
+ what = 'legend';
+ } else if (util.hasParent(element, this.linegraph.legendRight.dom.frame)) {
+ what = 'legend';
+ } else if (customTime != null) {
+ what = 'custom-time';
+ } else if (util.hasParent(element, this.currentTime.bar)) {
+ what = 'current-time';
+ } else if (util.hasParent(element, this.dom.center)) {
+ what = 'background';
+ }
+
+ var value = [];
+ var yAxisLeft = this.linegraph.yAxisLeft;
+ var yAxisRight = this.linegraph.yAxisRight;
+ if (!yAxisLeft.hidden) {
+ value.push(yAxisLeft.screenToValue(y));
+ }
+ if (!yAxisRight.hidden) {
+ value.push(yAxisRight.screenToValue(y));
+ }
+
+ return {
+ event: event,
+ what: what,
+ pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,
+ pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,
+ x: x,
+ y: y,
+ time: time,
+ value: value
+ };
+ };
+
+ /**
+ * Load a configurator
+ * @return {Object}
+ * @private
+ */
+ Graph2d.prototype._createConfigurator = function () {
+ return new _Configurator2.default(this, this.dom.container, configureOptions);
+ };
+
+ module.exports = Graph2d;
+
+/***/ },
+/* 51 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(8);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var Component = __webpack_require__(31);
+ var DataAxis = __webpack_require__(52);
+ var GraphGroup = __webpack_require__(54);
+ var Legend = __webpack_require__(58);
+ var Bars = __webpack_require__(55);
+ var Lines = __webpack_require__(57);
+ var Points = __webpack_require__(56);
+
+ var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items
+
+ /**
+ * This is the constructor of the LineGraph. It requires a Timeline body and options.
+ *
+ * @param body
+ * @param options
+ * @constructor
+ */
+ function LineGraph(body, options) {
+ this.id = util.randomUUID();
+ this.body = body;
+
+ this.defaultOptions = {
+ yAxisOrientation: 'left',
+ defaultGroup: 'default',
+ sort: true,
+ sampling: true,
+ stack: false,
+ graphHeight: '400px',
+ shaded: {
+ enabled: false,
+ orientation: 'bottom' // top, bottom, zero
+ },
+ style: 'line', // line, bar
+ barChart: {
+ width: 50,
+ sideBySide: false,
+ align: 'center' // left, center, right
+ },
+ interpolation: {
+ enabled: true,
+ parametrization: 'centripetal', // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
+ alpha: 0.5
+ },
+ drawPoints: {
+ enabled: true,
+ size: 6,
+ style: 'square' // square, circle
+ },
+ dataAxis: {}, //Defaults are done on DataAxis level
+ legend: {}, //Defaults are done on Legend level
+ groups: {
+ visibility: {}
+ }
+ };
+
+ // options is shared by this lineGraph and all its items
+ this.options = util.extend({}, this.defaultOptions);
+ this.dom = {};
+ this.props = {};
+ this.hammer = null;
+ this.groups = {};
+ this.abortedGraphUpdate = false;
+ this.updateSVGheight = false;
+ this.updateSVGheightOnResize = false;
+ this.forceGraphUpdate = true;
+
+ var me = this;
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ // listeners for the DataSet of the items
+ this.itemListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAdd(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdate(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemove(params.items);
+ }
+ };
+
+ // listeners for the DataSet of the groups
+ this.groupListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAddGroups(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdateGroups(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemoveGroups(params.items);
+ }
+ };
+
+ this.items = {}; // object with an Item for every data item
+ this.selection = []; // list with the ids of all selected nodes
+ this.lastStart = this.body.range.start;
+ this.touchParams = {}; // stores properties while dragging
+
+ this.svgElements = {};
+ this.setOptions(options);
+ this.groupsUsingDefaultStyles = [0];
+ this.body.emitter.on('rangechanged', function () {
+ me.lastStart = me.body.range.start;
+ me.svg.style.left = util.option.asSize(-me.props.width);
+
+ me.forceGraphUpdate = true;
+ //Is this local redraw necessary? (Core also does a change event!)
+ me.redraw.call(me);
+ });
+
+ // create the HTML DOM
+ this._create();
+ this.framework = { svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups };
+ }
+
+ LineGraph.prototype = new Component();
+
+ /**
+ * Create the HTML DOM for the ItemSet
+ */
+ LineGraph.prototype._create = function () {
+ var frame = document.createElement('div');
+ frame.className = 'vis-line-graph';
+ this.dom.frame = frame;
+
+ // create svg element for graph drawing.
+ this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ this.svg.style.position = 'relative';
+ this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';
+ this.svg.style.display = 'block';
+ frame.appendChild(this.svg);
+
+ // data axis
+ this.options.dataAxis.orientation = 'left';
+ this.yAxisLeft = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);
+
+ this.options.dataAxis.orientation = 'right';
+ this.yAxisRight = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);
+ delete this.options.dataAxis.orientation;
+
+ // legends
+ this.legendLeft = new Legend(this.body, this.options.legend, 'left', this.options.groups);
+ this.legendRight = new Legend(this.body, this.options.legend, 'right', this.options.groups);
+
+ this.show();
+ };
+
+ /**
+ * set the options of the LineGraph. the mergeOptions is used for subObjects that have an enabled element.
+ * @param {object} options
+ */
+ LineGraph.prototype.setOptions = function (options) {
+ if (options) {
+ var fields = ['sampling', 'defaultGroup', 'stack', 'height', 'graphHeight', 'yAxisOrientation', 'style', 'barChart', 'dataAxis', 'sort', 'groups'];
+ if (options.graphHeight === undefined && options.height !== undefined) {
+ this.updateSVGheight = true;
+ this.updateSVGheightOnResize = true;
+ } else if (this.body.domProps.centerContainer.height !== undefined && options.graphHeight !== undefined) {
+ if (parseInt((options.graphHeight + '').replace("px", '')) < this.body.domProps.centerContainer.height) {
+ this.updateSVGheight = true;
+ }
+ }
+ util.selectiveDeepExtend(fields, this.options, options);
+ util.mergeOptions(this.options, options, 'interpolation');
+ util.mergeOptions(this.options, options, 'drawPoints');
+ util.mergeOptions(this.options, options, 'shaded');
+ util.mergeOptions(this.options, options, 'legend');
+
+ if (options.interpolation) {
+ if (_typeof(options.interpolation) == 'object') {
+ if (options.interpolation.parametrization) {
+ if (options.interpolation.parametrization == 'uniform') {
+ this.options.interpolation.alpha = 0;
+ } else if (options.interpolation.parametrization == 'chordal') {
+ this.options.interpolation.alpha = 1.0;
+ } else {
+ this.options.interpolation.parametrization = 'centripetal';
+ this.options.interpolation.alpha = 0.5;
+ }
+ }
+ }
+ }
+
+ if (this.yAxisLeft) {
+ if (options.dataAxis !== undefined) {
+ this.yAxisLeft.setOptions(this.options.dataAxis);
+ this.yAxisRight.setOptions(this.options.dataAxis);
+ }
+ }
+
+ if (this.legendLeft) {
+ if (options.legend !== undefined) {
+ this.legendLeft.setOptions(this.options.legend);
+ this.legendRight.setOptions(this.options.legend);
+ }
+ }
+
+ if (this.groups.hasOwnProperty(UNGROUPED)) {
+ this.groups[UNGROUPED].setOptions(options);
+ }
+ }
+
+ // this is used to redraw the graph if the visibility of the groups is changed.
+ if (this.dom.frame) {
+ //not on initial run?
+ this.forceGraphUpdate = true;
+ this.body.emitter.emit("_change", { queue: true });
+ }
+ };
+
+ /**
+ * Hide the component from the DOM
+ */
+ LineGraph.prototype.hide = function () {
+ // remove the frame containing the items
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+ };
+
+ /**
+ * Show the component in the DOM (when not already visible).
+ * @return {Boolean} changed
+ */
+ LineGraph.prototype.show = function () {
+ // show frame containing the items
+ if (!this.dom.frame.parentNode) {
+ this.body.dom.center.appendChild(this.dom.frame);
+ }
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | null} items
+ */
+ LineGraph.prototype.setItems = function (items) {
+ var me = this,
+ ids,
+ oldItemsData = this.itemsData;
+
+ // replace the dataset
+ if (!items) {
+ this.itemsData = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ this.itemsData = items;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (oldItemsData) {
+ // unsubscribe from old dataset
+ util.forEach(this.itemListeners, function (callback, event) {
+ oldItemsData.off(event, callback);
+ });
+
+ // remove all drawn items
+ ids = oldItemsData.getIds();
+ this._onRemove(ids);
+ }
+
+ if (this.itemsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.itemListeners, function (callback, event) {
+ me.itemsData.on(event, callback, id);
+ });
+
+ // add all new items
+ ids = this.itemsData.getIds();
+ this._onAdd(ids);
+ }
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet} groups
+ */
+ LineGraph.prototype.setGroups = function (groups) {
+ var me = this;
+ var ids;
+
+ // unsubscribe from current dataset
+ if (this.groupsData) {
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.off(event, callback);
+ });
+
+ // remove all drawn groups
+ ids = this.groupsData.getIds();
+ this.groupsData = null;
+ for (var i = 0; i < ids.length; i++) {
+ this._removeGroup(ids[i]);
+ }
+ }
+
+ // replace the dataset
+ if (!groups) {
+ this.groupsData = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ this.groupsData = groups;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (this.groupsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.on(event, callback, id);
+ });
+
+ // draw all ms
+ ids = this.groupsData.getIds();
+ this._onAddGroups(ids);
+ }
+ };
+
+ LineGraph.prototype._onUpdate = function (ids) {
+ this._updateAllGroupData();
+ };
+ LineGraph.prototype._onAdd = function (ids) {
+ this._onUpdate(ids);
+ };
+ LineGraph.prototype._onRemove = function (ids) {
+ this._onUpdate(ids);
+ };
+ LineGraph.prototype._onUpdateGroups = function (groupIds) {
+ this._updateAllGroupData();
+ };
+ LineGraph.prototype._onAddGroups = function (groupIds) {
+ this._onUpdateGroups(groupIds);
+ };
+
+ /**
+ * this cleans the group out off the legends and the dataaxis, updates the ungrouped and updates the graph
+ * @param {Array} groupIds
+ * @private
+ */
+ LineGraph.prototype._onRemoveGroups = function (groupIds) {
+ for (var i = 0; i < groupIds.length; i++) {
+ this._removeGroup(groupIds[i]);
+ }
+ this.forceGraphUpdate = true;
+ this.body.emitter.emit("_change", { queue: true });
+ };
+
+ /**
+ * this cleans the group out off the legends and the dataaxis
+ * @param groupId
+ * @private
+ */
+ LineGraph.prototype._removeGroup = function (groupId) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ if (this.groups[groupId].options.yAxisOrientation == 'right') {
+ this.yAxisRight.removeGroup(groupId);
+ this.legendRight.removeGroup(groupId);
+ this.legendRight.redraw();
+ } else {
+ this.yAxisLeft.removeGroup(groupId);
+ this.legendLeft.removeGroup(groupId);
+ this.legendLeft.redraw();
+ }
+ delete this.groups[groupId];
+ }
+ };
+
+ /**
+ * update a group object with the group dataset entree
+ *
+ * @param group
+ * @param groupId
+ * @private
+ */
+ LineGraph.prototype._updateGroup = function (group, groupId) {
+ if (!this.groups.hasOwnProperty(groupId)) {
+ this.groups[groupId] = new GraphGroup(group, groupId, this.options, this.groupsUsingDefaultStyles);
+ if (this.groups[groupId].options.yAxisOrientation == 'right') {
+ this.yAxisRight.addGroup(groupId, this.groups[groupId]);
+ this.legendRight.addGroup(groupId, this.groups[groupId]);
+ } else {
+ this.yAxisLeft.addGroup(groupId, this.groups[groupId]);
+ this.legendLeft.addGroup(groupId, this.groups[groupId]);
+ }
+ } else {
+ this.groups[groupId].update(group);
+ if (this.groups[groupId].options.yAxisOrientation == 'right') {
+ this.yAxisRight.updateGroup(groupId, this.groups[groupId]);
+ this.legendRight.updateGroup(groupId, this.groups[groupId]);
+ //If yAxisOrientation changed, clean out the group from the other axis.
+ this.yAxisLeft.removeGroup(groupId);
+ this.legendLeft.removeGroup(groupId);
+ } else {
+ this.yAxisLeft.updateGroup(groupId, this.groups[groupId]);
+ this.legendLeft.updateGroup(groupId, this.groups[groupId]);
+ //If yAxisOrientation changed, clean out the group from the other axis.
+ this.yAxisRight.removeGroup(groupId);
+ this.legendRight.removeGroup(groupId);
+ }
+ }
+ this.legendLeft.redraw();
+ this.legendRight.redraw();
+ };
+
+ /**
+ * this updates all groups, it is used when there is an update the the itemset.
+ *
+ * @private
+ */
+ LineGraph.prototype._updateAllGroupData = function () {
+ if (this.itemsData != null) {
+ var groupsContent = {};
+ var items = this.itemsData.get();
+ //pre-Determine array sizes, for more efficient memory claim
+ var groupCounts = {};
+ for (var i = 0; i < items.length; i++) {
+ var item = items[i];
+ var groupId = item.group;
+ if (groupId === null || groupId === undefined) {
+ groupId = UNGROUPED;
+ }
+ groupCounts.hasOwnProperty(groupId) ? groupCounts[groupId]++ : groupCounts[groupId] = 1;
+ }
+ //Now insert data into the arrays.
+ for (var i = 0; i < items.length; i++) {
+ var item = items[i];
+ var groupId = item.group;
+ if (groupId === null || groupId === undefined) {
+ groupId = UNGROUPED;
+ }
+ if (!groupsContent.hasOwnProperty(groupId)) {
+ groupsContent[groupId] = new Array(groupCounts[groupId]);
+ }
+ //Copy data (because of unmodifiable DataView input.
+ var extended = util.bridgeObject(item);
+ extended.x = util.convert(item.x, 'Date');
+ extended.orginalY = item.y; //real Y
+ extended.y = Number(item.y);
+
+ var index = groupsContent[groupId].length - groupCounts[groupId]--;
+ groupsContent[groupId][index] = extended;
+ }
+
+ //Make sure all groups are present, to allow removal of old groups
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ if (!groupsContent.hasOwnProperty(groupId)) {
+ groupsContent[groupId] = new Array(0);
+ }
+ }
+ }
+
+ //Update legendas, style and axis
+ for (var groupId in groupsContent) {
+ if (groupsContent.hasOwnProperty(groupId)) {
+ if (groupsContent[groupId].length == 0) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ this._removeGroup(groupId);
+ }
+ } else {
+ var group = undefined;
+ if (this.groupsData != undefined) {
+ group = this.groupsData.get(groupId);
+ }
+ if (group == undefined) {
+ group = { id: groupId, content: this.options.defaultGroup + groupId };
+ }
+ this._updateGroup(group, groupId);
+ this.groups[groupId].setItems(groupsContent[groupId]);
+ }
+ }
+ }
+ this.forceGraphUpdate = true;
+ this.body.emitter.emit("_change", { queue: true });
+ }
+ };
+
+ /**
+ * Redraw the component, mandatory function
+ * @return {boolean} Returns true if the component is resized
+ */
+ LineGraph.prototype.redraw = function () {
+ var resized = false;
+
+ // calculate actual size and position
+ this.props.width = this.dom.frame.offsetWidth;
+ this.props.height = this.body.domProps.centerContainer.height - this.body.domProps.border.top - this.body.domProps.border.bottom;
+
+ // check if this component is resized
+ resized = this._isResized() || resized;
+
+ // check whether zoomed (in that case we need to re-stack everything)
+ var visibleInterval = this.body.range.end - this.body.range.start;
+ var zoomed = visibleInterval != this.lastVisibleInterval;
+ this.lastVisibleInterval = visibleInterval;
+
+ // the svg element is three times as big as the width, this allows for fully dragging left and right
+ // without reloading the graph. the controls for this are bound to events in the constructor
+ if (resized == true) {
+ this.svg.style.width = util.option.asSize(3 * this.props.width);
+ this.svg.style.left = util.option.asSize(-this.props.width);
+
+ // if the height of the graph is set as proportional, change the height of the svg
+ if ((this.options.height + '').indexOf("%") != -1 || this.updateSVGheightOnResize == true) {
+ this.updateSVGheight = true;
+ }
+ }
+
+ // update the height of the graph on each redraw of the graph.
+ if (this.updateSVGheight == true) {
+ if (this.options.graphHeight != this.props.height + 'px') {
+ this.options.graphHeight = this.props.height + 'px';
+ this.svg.style.height = this.props.height + 'px';
+ }
+ this.updateSVGheight = false;
+ } else {
+ this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';
+ }
+
+ // zoomed is here to ensure that animations are shown correctly.
+ if (resized == true || zoomed == true || this.abortedGraphUpdate == true || this.forceGraphUpdate == true) {
+ resized = this._updateGraph() || resized;
+ this.forceGraphUpdate = false;
+ } else {
+ // move the whole svg while dragging
+ if (this.lastStart != 0) {
+ var offset = this.body.range.start - this.lastStart;
+ var range = this.body.range.end - this.body.range.start;
+ if (this.props.width != 0) {
+ var rangePerPixelInv = this.props.width / range;
+ var xOffset = offset * rangePerPixelInv;
+ this.svg.style.left = -this.props.width - xOffset + 'px';
+ }
+ }
+ }
+ this.legendLeft.redraw();
+ this.legendRight.redraw();
+ return resized;
+ };
+
+ LineGraph.prototype._getSortedGroupIds = function () {
+ // getting group Ids
+ var grouplist = [];
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ var group = this.groups[groupId];
+ if (group.visible == true && (this.options.groups.visibility[groupId] === undefined || this.options.groups.visibility[groupId] == true)) {
+ grouplist.push({ id: groupId, zIndex: group.options.zIndex });
+ }
+ }
+ }
+ util.insertSort(grouplist, function (a, b) {
+ var az = a.zIndex;
+ var bz = b.zIndex;
+ if (az === undefined) az = 0;
+ if (bz === undefined) bz = 0;
+ return az == bz ? 0 : az < bz ? -1 : 1;
+ });
+ var groupIds = new Array(grouplist.length);
+ for (var i = 0; i < grouplist.length; i++) {
+ groupIds[i] = grouplist[i].id;
+ }
+ return groupIds;
+ };
+
+ /**
+ * Update and redraw the graph.
+ *
+ */
+ LineGraph.prototype._updateGraph = function () {
+ // reset the svg elements
+ DOMutil.prepareElements(this.svgElements);
+ if (this.props.width != 0 && this.itemsData != null) {
+ var group, i;
+ var groupRanges = {};
+ var changeCalled = false;
+ // this is the range of the SVG canvas
+ var minDate = this.body.util.toGlobalTime(-this.body.domProps.root.width);
+ var maxDate = this.body.util.toGlobalTime(2 * this.body.domProps.root.width);
+
+ // getting group Ids
+ var groupIds = this._getSortedGroupIds();
+ if (groupIds.length > 0) {
+ var groupsData = {};
+
+ // fill groups data, this only loads the data we require based on the timewindow
+ this._getRelevantData(groupIds, groupsData, minDate, maxDate);
+
+ // apply sampling, if disabled, it will pass through this function.
+ this._applySampling(groupIds, groupsData);
+
+ // we transform the X coordinates to detect collisions
+ for (i = 0; i < groupIds.length; i++) {
+ this._convertXcoordinates(groupsData[groupIds[i]]);
+ }
+
+ // now all needed data has been collected we start the processing.
+ this._getYRanges(groupIds, groupsData, groupRanges);
+
+ // update the Y axis first, we use this data to draw at the correct Y points
+ changeCalled = this._updateYAxis(groupIds, groupRanges);
+
+ // at changeCalled, abort this update cycle as the graph needs another update with new Width input from the Redraw container.
+ // Cleanup SVG elements on abort.
+ if (changeCalled == true) {
+ DOMutil.cleanupElements(this.svgElements);
+ this.abortedGraphUpdate = true;
+ return true;
+ }
+ this.abortedGraphUpdate = false;
+
+ // With the yAxis scaled correctly, use this to get the Y values of the points.
+ var below = undefined;
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ if (this.options.stack === true && this.options.style === 'line') {
+ if (group.options.excludeFromStacking == undefined || !group.options.excludeFromStacking) {
+ if (below != undefined) {
+ this._stack(groupsData[group.id], groupsData[below.id]);
+ if (group.options.shaded.enabled == true && group.options.shaded.orientation !== "group") {
+ if (group.options.shaded.orientation == "top" && below.options.shaded.orientation !== "group") {
+ below.options.shaded.orientation = "group";
+ below.options.shaded.groupId = group.id;
+ } else {
+ group.options.shaded.orientation = "group";
+ group.options.shaded.groupId = below.id;
+ }
+ }
+ }
+ below = group;
+ }
+ }
+ this._convertYcoordinates(groupsData[groupIds[i]], group);
+ }
+
+ //Precalculate paths and draw shading if appropriate. This will make sure the shading is always behind any lines.
+ var paths = {};
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ if (group.options.style === 'line' && group.options.shaded.enabled == true) {
+ var dataset = groupsData[groupIds[i]];
+ if (dataset == null || dataset.length == 0) {
+ continue;
+ }
+ if (!paths.hasOwnProperty(groupIds[i])) {
+ paths[groupIds[i]] = Lines.calcPath(dataset, group);
+ }
+ if (group.options.shaded.orientation === "group") {
+ var subGroupId = group.options.shaded.groupId;
+ if (groupIds.indexOf(subGroupId) === -1) {
+ console.log(group.id + ": Unknown shading group target given:" + subGroupId);
+ continue;
+ }
+ if (!paths.hasOwnProperty(subGroupId)) {
+ paths[subGroupId] = Lines.calcPath(groupsData[subGroupId], this.groups[subGroupId]);
+ }
+ Lines.drawShading(paths[groupIds[i]], group, paths[subGroupId], this.framework);
+ } else {
+ Lines.drawShading(paths[groupIds[i]], group, undefined, this.framework);
+ }
+ }
+ }
+
+ // draw the groups, calculating paths if still necessary.
+ Bars.draw(groupIds, groupsData, this.framework);
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ if (groupsData[groupIds[i]].length > 0) {
+ switch (group.options.style) {
+ case "line":
+ if (!paths.hasOwnProperty(groupIds[i])) {
+ paths[groupIds[i]] = Lines.calcPath(groupsData[groupIds[i]], group);
+ }
+ Lines.draw(paths[groupIds[i]], group, this.framework);
+ //explicit no break;
+ case "point":
+ //explicit no break;
+ case "points":
+ if (group.options.style == "point" || group.options.style == "points" || group.options.drawPoints.enabled == true) {
+ Points.draw(groupsData[groupIds[i]], group, this.framework);
+ }
+ break;
+ case "bar":
+ // bar needs to be drawn enmasse
+ //explicit no break
+ default:
+ //do nothing...
+ }
+ }
+ }
+ }
+ }
+
+ // cleanup unused svg elements
+ DOMutil.cleanupElements(this.svgElements);
+ return false;
+ };
+
+ LineGraph.prototype._stack = function (data, subData) {
+ var index, dx, dy, subPrevPoint, subNextPoint;
+ index = 0;
+ // for each data point we look for a matching on in the set below
+ for (var j = 0; j < data.length; j++) {
+ subPrevPoint = undefined;
+ subNextPoint = undefined;
+ // we look for time matches or a before-after point
+ for (var k = index; k < subData.length; k++) {
+ // if times match exactly
+ if (subData[k].x === data[j].x) {
+ subPrevPoint = subData[k];
+ subNextPoint = subData[k];
+ index = k;
+ break;
+ } else if (subData[k].x > data[j].x) {
+ // overshoot
+ subNextPoint = subData[k];
+ if (k == 0) {
+ subPrevPoint = subNextPoint;
+ } else {
+ subPrevPoint = subData[k - 1];
+ }
+ index = k;
+ break;
+ }
+ }
+ // in case the last data point has been used, we assume it stays like this.
+ if (subNextPoint === undefined) {
+ subPrevPoint = subData[subData.length - 1];
+ subNextPoint = subData[subData.length - 1];
+ }
+ // linear interpolation
+ dx = subNextPoint.x - subPrevPoint.x;
+ dy = subNextPoint.y - subPrevPoint.y;
+ if (dx == 0) {
+ data[j].y = data[j].orginalY + subNextPoint.y;
+ } else {
+ data[j].y = data[j].orginalY + dy / dx * (data[j].x - subPrevPoint.x) + subPrevPoint.y; // ax + b where b is data[j].y
+ }
+ }
+ };
+
+ /**
+ * first select and preprocess the data from the datasets.
+ * the groups have their preselection of data, we now loop over this data to see
+ * what data we need to draw. Sorted data is much faster.
+ * more optimization is possible by doing the sampling before and using the binary search
+ * to find the end date to determine the increment.
+ *
+ * @param {array} groupIds
+ * @param {object} groupsData
+ * @param {date} minDate
+ * @param {date} maxDate
+ * @private
+ */
+ LineGraph.prototype._getRelevantData = function (groupIds, groupsData, minDate, maxDate) {
+ var group, i, j, item;
+ if (groupIds.length > 0) {
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ var itemsData = group.getItems();
+ // optimization for sorted data
+ if (group.options.sort == true) {
+ var dateComparator = function dateComparator(a, b) {
+ return a.getTime() == b.getTime() ? 0 : a < b ? -1 : 1;
+ };
+ var first = Math.max(0, util.binarySearchValue(itemsData, minDate, 'x', 'before', dateComparator));
+ var last = Math.min(itemsData.length, util.binarySearchValue(itemsData, maxDate, 'x', 'after', dateComparator) + 1);
+ if (last <= 0) {
+ last = itemsData.length;
+ }
+ var dataContainer = new Array(last - first);
+ for (j = first; j < last; j++) {
+ item = group.itemsData[j];
+ dataContainer[j - first] = item;
+ }
+ groupsData[groupIds[i]] = dataContainer;
+ } else {
+ // If unsorted data, all data is relevant, just returning entire structure
+ groupsData[groupIds[i]] = group.itemsData;
+ }
+ }
+ }
+ };
+
+ /**
+ *
+ * @param groupIds
+ * @param groupsData
+ * @private
+ */
+ LineGraph.prototype._applySampling = function (groupIds, groupsData) {
+ var group;
+ if (groupIds.length > 0) {
+ for (var i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ if (group.options.sampling == true) {
+ var dataContainer = groupsData[groupIds[i]];
+ if (dataContainer.length > 0) {
+ var increment = 1;
+ var amountOfPoints = dataContainer.length;
+
+ // the global screen is used because changing the width of the yAxis may affect the increment, resulting in an endless loop
+ // of width changing of the yAxis.
+ var xDistance = this.body.util.toGlobalScreen(dataContainer[dataContainer.length - 1].x) - this.body.util.toGlobalScreen(dataContainer[0].x);
+ var pointsPerPixel = amountOfPoints / xDistance;
+ increment = Math.min(Math.ceil(0.2 * amountOfPoints), Math.max(1, Math.round(pointsPerPixel)));
+
+ var sampledData = new Array(amountOfPoints);
+ for (var j = 0; j < amountOfPoints; j += increment) {
+ var idx = Math.round(j / increment);
+ sampledData[idx] = dataContainer[j];
+ }
+ groupsData[groupIds[i]] = sampledData.splice(0, Math.round(amountOfPoints / increment));
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ *
+ *
+ * @param {array} groupIds
+ * @param {object} groupsData
+ * @param {object} groupRanges | this is being filled here
+ * @private
+ */
+ LineGraph.prototype._getYRanges = function (groupIds, groupsData, groupRanges) {
+ var groupData, group, i;
+ var combinedDataLeft = [];
+ var combinedDataRight = [];
+ var options;
+ if (groupIds.length > 0) {
+ for (i = 0; i < groupIds.length; i++) {
+ groupData = groupsData[groupIds[i]];
+ options = this.groups[groupIds[i]].options;
+ if (groupData.length > 0) {
+ group = this.groups[groupIds[i]];
+ // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.
+ if (options.stack === true && options.style === 'bar') {
+ if (options.yAxisOrientation === 'left') {
+ combinedDataLeft = combinedDataLeft.concat(group.getItems());
+ } else {
+ combinedDataRight = combinedDataRight.concat(group.getItems());
+ }
+ } else {
+ groupRanges[groupIds[i]] = group.getYRange(groupData, groupIds[i]);
+ }
+ }
+ }
+
+ // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.
+ Bars.getStackedYRange(combinedDataLeft, groupRanges, groupIds, '__barStackLeft', 'left');
+ Bars.getStackedYRange(combinedDataRight, groupRanges, groupIds, '__barStackRight', 'right');
+ }
+ };
+
+ /**
+ * this sets the Y ranges for the Y axis. It also determines which of the axis should be shown or hidden.
+ * @param {Array} groupIds
+ * @param {Object} groupRanges
+ * @private
+ */
+ LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
+ var resized = false;
+ var yAxisLeftUsed = false;
+ var yAxisRightUsed = false;
+ var minLeft = 1e9,
+ minRight = 1e9,
+ maxLeft = -1e9,
+ maxRight = -1e9,
+ minVal,
+ maxVal;
+ // if groups are present
+ if (groupIds.length > 0) {
+ // this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop.
+ for (var i = 0; i < groupIds.length; i++) {
+ var group = this.groups[groupIds[i]];
+ if (group && group.options.yAxisOrientation != 'right') {
+ yAxisLeftUsed = true;
+ minLeft = 1e9;
+ maxLeft = -1e9;
+ } else if (group && group.options.yAxisOrientation) {
+ yAxisRightUsed = true;
+ minRight = 1e9;
+ maxRight = -1e9;
+ }
+ }
+
+ // if there are items:
+ for (var i = 0; i < groupIds.length; i++) {
+ if (groupRanges.hasOwnProperty(groupIds[i])) {
+ if (groupRanges[groupIds[i]].ignore !== true) {
+ minVal = groupRanges[groupIds[i]].min;
+ maxVal = groupRanges[groupIds[i]].max;
+
+ if (groupRanges[groupIds[i]].yAxisOrientation != 'right') {
+ yAxisLeftUsed = true;
+ minLeft = minLeft > minVal ? minVal : minLeft;
+ maxLeft = maxLeft < maxVal ? maxVal : maxLeft;
+ } else {
+ yAxisRightUsed = true;
+ minRight = minRight > minVal ? minVal : minRight;
+ maxRight = maxRight < maxVal ? maxVal : maxRight;
+ }
+ }
+ }
+ }
+
+ if (yAxisLeftUsed == true) {
+ this.yAxisLeft.setRange(minLeft, maxLeft);
+ }
+ if (yAxisRightUsed == true) {
+ this.yAxisRight.setRange(minRight, maxRight);
+ }
+ }
+ resized = this._toggleAxisVisiblity(yAxisLeftUsed, this.yAxisLeft) || resized;
+ resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;
+
+ if (yAxisRightUsed == true && yAxisLeftUsed == true) {
+ this.yAxisLeft.drawIcons = true;
+ this.yAxisRight.drawIcons = true;
+ } else {
+ this.yAxisLeft.drawIcons = false;
+ this.yAxisRight.drawIcons = false;
+ }
+ this.yAxisRight.master = !yAxisLeftUsed;
+ this.yAxisRight.masterAxis = this.yAxisLeft;
+
+ if (this.yAxisRight.master == false) {
+ if (yAxisRightUsed == true) {
+ this.yAxisLeft.lineOffset = this.yAxisRight.width;
+ } else {
+ this.yAxisLeft.lineOffset = 0;
+ }
+
+ resized = this.yAxisLeft.redraw() || resized;
+ resized = this.yAxisRight.redraw() || resized;
+ } else {
+ resized = this.yAxisRight.redraw() || resized;
+ }
+
+ // clean the accumulated lists
+ var tempGroups = ['__barStackLeft', '__barStackRight', '__lineStackLeft', '__lineStackRight'];
+ for (var i = 0; i < tempGroups.length; i++) {
+ if (groupIds.indexOf(tempGroups[i]) != -1) {
+ groupIds.splice(groupIds.indexOf(tempGroups[i]), 1);
+ }
+ }
+
+ return resized;
+ };
+
+ /**
+ * This shows or hides the Y axis if needed. If there is a change, the changed event is emitted by the updateYAxis function
+ *
+ * @param {boolean} axisUsed
+ * @returns {boolean}
+ * @private
+ * @param axis
+ */
+ LineGraph.prototype._toggleAxisVisiblity = function (axisUsed, axis) {
+ var changed = false;
+ if (axisUsed == false) {
+ if (axis.dom.frame.parentNode && axis.hidden == false) {
+ axis.hide();
+ changed = true;
+ }
+ } else {
+ if (!axis.dom.frame.parentNode && axis.hidden == true) {
+ axis.show();
+ changed = true;
+ }
+ }
+ return changed;
+ };
+
+ /**
+ * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the
+ * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for
+ * the yAxis.
+ *
+ * @param datapoints
+ * @returns {Array}
+ * @private
+ */
+ LineGraph.prototype._convertXcoordinates = function (datapoints) {
+ var toScreen = this.body.util.toScreen;
+ for (var i = 0; i < datapoints.length; i++) {
+ datapoints[i].screen_x = toScreen(datapoints[i].x) + this.props.width;
+ datapoints[i].screen_y = datapoints[i].y; //starting point for range calculations
+ }
+ };
+
+ /**
+ * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the
+ * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for
+ * the yAxis.
+ *
+ * @param datapoints
+ * @param group
+ * @returns {Array}
+ * @private
+ */
+ LineGraph.prototype._convertYcoordinates = function (datapoints, group) {
+ var axis = this.yAxisLeft;
+ var svgHeight = Number(this.svg.style.height.replace('px', ''));
+ if (group.options.yAxisOrientation == 'right') {
+ axis = this.yAxisRight;
+ }
+ for (var i = 0; i < datapoints.length; i++) {
+ datapoints[i].screen_y = Math.round(axis.convertValue(datapoints[i].y));
+ }
+ group.setZeroPosition(Math.min(svgHeight, axis.convertValue(0)));
+ };
+
+ module.exports = LineGraph;
+
+/***/ },
+/* 52 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(8);
+ var Component = __webpack_require__(31);
+ var DataScale = __webpack_require__(53);
+ /**
+ * A horizontal time axis
+ * @param {Object} [options] See DataAxis.setOptions for the available
+ * options.
+ * @constructor DataAxis
+ * @extends Component
+ * @param body
+ */
+ function DataAxis(body, options, svg, linegraphOptions) {
+ this.id = util.randomUUID();
+ this.body = body;
+
+ this.defaultOptions = {
+ orientation: 'left', // supported: 'left', 'right'
+ showMinorLabels: true,
+ showMajorLabels: true,
+ icons: false,
+ majorLinesOffset: 7,
+ minorLinesOffset: 4,
+ labelOffsetX: 10,
+ labelOffsetY: 2,
+ iconWidth: 20,
+ width: '40px',
+ visible: true,
+ alignZeros: true,
+ left: {
+ range: { min: undefined, max: undefined },
+ format: function format(value) {
+ return '' + parseFloat(value.toPrecision(3));
+ },
+ title: { text: undefined, style: undefined }
+ },
+ right: {
+ range: { min: undefined, max: undefined },
+ format: function format(value) {
+ return '' + parseFloat(value.toPrecision(3));
+ },
+ title: { text: undefined, style: undefined }
+ }
+ };
+
+ this.linegraphOptions = linegraphOptions;
+ this.linegraphSVG = svg;
+ this.props = {};
+ this.DOMelements = { // dynamic elements
+ lines: {},
+ labels: {},
+ title: {}
+ };
+
+ this.dom = {};
+ this.scale = undefined;
+ this.range = { start: 0, end: 0 };
+
+ this.options = util.extend({}, this.defaultOptions);
+ this.conversionFactor = 1;
+
+ this.setOptions(options);
+ this.width = Number(('' + this.options.width).replace("px", ""));
+ this.minWidth = this.width;
+ this.height = this.linegraphSVG.getBoundingClientRect().height;
+ this.hidden = false;
+
+ this.stepPixels = 25;
+ this.zeroCrossing = -1;
+ this.amountOfSteps = -1;
+
+ this.lineOffset = 0;
+ this.master = true;
+ this.masterAxis = null;
+ this.svgElements = {};
+ this.iconsRemoved = false;
+
+ this.groups = {};
+ this.amountOfGroups = 0;
+
+ // create the HTML DOM
+ this._create();
+ this.framework = { svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups };
+
+ var me = this;
+ this.body.emitter.on("verticalDrag", function () {
+ me.dom.lineContainer.style.top = me.body.domProps.scrollTop + 'px';
+ });
+ }
+
+ DataAxis.prototype = new Component();
+
+ DataAxis.prototype.addGroup = function (label, graphOptions) {
+ if (!this.groups.hasOwnProperty(label)) {
+ this.groups[label] = graphOptions;
+ }
+ this.amountOfGroups += 1;
+ };
+
+ DataAxis.prototype.updateGroup = function (label, graphOptions) {
+ if (!this.groups.hasOwnProperty(label)) {
+ this.amountOfGroups += 1;
+ }
+ this.groups[label] = graphOptions;
+ };
+
+ DataAxis.prototype.removeGroup = function (label) {
+ if (this.groups.hasOwnProperty(label)) {
+ delete this.groups[label];
+ this.amountOfGroups -= 1;
+ }
+ };
+
+ DataAxis.prototype.setOptions = function (options) {
+ if (options) {
+ var redraw = false;
+ if (this.options.orientation != options.orientation && options.orientation !== undefined) {
+ redraw = true;
+ }
+ var fields = ['orientation', 'showMinorLabels', 'showMajorLabels', 'icons', 'majorLinesOffset', 'minorLinesOffset', 'labelOffsetX', 'labelOffsetY', 'iconWidth', 'width', 'visible', 'left', 'right', 'alignZeros'];
+ util.selectiveDeepExtend(fields, this.options, options);
+
+ this.minWidth = Number(('' + this.options.width).replace("px", ""));
+ if (redraw === true && this.dom.frame) {
+ this.hide();
+ this.show();
+ }
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the DataAxis
+ */
+ DataAxis.prototype._create = function () {
+ this.dom.frame = document.createElement('div');
+ this.dom.frame.style.width = this.options.width;
+ this.dom.frame.style.height = this.height;
+
+ this.dom.lineContainer = document.createElement('div');
+ this.dom.lineContainer.style.width = '100%';
+ this.dom.lineContainer.style.height = this.height;
+ this.dom.lineContainer.style.position = 'relative';
+
+ // create svg element for graph drawing.
+ this.svg = document.createElementNS('http://www.w3.org/2000/svg', "svg");
+ this.svg.style.position = "absolute";
+ this.svg.style.top = '0px';
+ this.svg.style.height = '100%';
+ this.svg.style.width = '100%';
+ this.svg.style.display = "block";
+ this.dom.frame.appendChild(this.svg);
+ };
+
+ DataAxis.prototype._redrawGroupIcons = function () {
+ DOMutil.prepareElements(this.svgElements);
+
+ var x;
+ var iconWidth = this.options.iconWidth;
+ var iconHeight = 15;
+ var iconOffset = 4;
+ var y = iconOffset + 0.5 * iconHeight;
+
+ if (this.options.orientation === 'left') {
+ x = iconOffset;
+ } else {
+ x = this.width - iconWidth - iconOffset;
+ }
+
+ var groupArray = Object.keys(this.groups);
+ groupArray.sort(function (a, b) {
+ return a < b ? -1 : 1;
+ });
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {
+ this.groups[groupId].getLegend(iconWidth, iconHeight, this.framework, x, y);
+ y += iconHeight + iconOffset;
+ }
+ }
+
+ DOMutil.cleanupElements(this.svgElements);
+ this.iconsRemoved = false;
+ };
+
+ DataAxis.prototype._cleanupIcons = function () {
+ if (this.iconsRemoved === false) {
+ DOMutil.prepareElements(this.svgElements);
+ DOMutil.cleanupElements(this.svgElements);
+ this.iconsRemoved = true;
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the DataAxis
+ */
+ DataAxis.prototype.show = function () {
+ this.hidden = false;
+ if (!this.dom.frame.parentNode) {
+ if (this.options.rtl) {
+ this.body.dom.left.appendChild(this.dom.frame);
+ } else {
+ this.body.dom.left.appendChild(this.dom.frame);
+ }
+ }
+
+ if (!this.dom.lineContainer.parentNode) {
+ this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer);
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the DataAxis
+ */
+ DataAxis.prototype.hide = function () {
+ this.hidden = true;
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+
+ if (this.dom.lineContainer.parentNode) {
+ this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer);
+ }
+ };
+
+ /**
+ * Set a range (start and end)
+ * @param end
+ * @param start
+ * @param end
+ */
+ DataAxis.prototype.setRange = function (start, end) {
+ this.range.start = start;
+ this.range.end = end;
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ DataAxis.prototype.redraw = function () {
+ var resized = false;
+ var activeGroups = 0;
+
+ // Make sure the line container adheres to the vertical scrolling.
+ this.dom.lineContainer.style.top = this.body.domProps.scrollTop + 'px';
+
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {
+ activeGroups++;
+ }
+ }
+ }
+ if (this.amountOfGroups === 0 || activeGroups === 0) {
+ this.hide();
+ } else {
+ this.show();
+ this.height = Number(this.linegraphSVG.style.height.replace("px", ""));
+
+ // svg offsetheight did not work in firefox and explorer...
+ this.dom.lineContainer.style.height = this.height + 'px';
+ this.width = this.options.visible === true ? Number(('' + this.options.width).replace("px", "")) : 0;
+
+ var props = this.props;
+ var frame = this.dom.frame;
+
+ // update classname
+ frame.className = 'vis-data-axis';
+
+ // calculate character width and height
+ this._calculateCharSize();
+
+ var orientation = this.options.orientation;
+ var showMinorLabels = this.options.showMinorLabels;
+ var showMajorLabels = this.options.showMajorLabels;
+
+ // determine the width and height of the elements for the axis
+ props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;
+ props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;
+
+ props.minorLineWidth = this.body.dom.backgroundHorizontal.offsetWidth - this.lineOffset - this.width + 2 * this.options.minorLinesOffset;
+ props.minorLineHeight = 1;
+ props.majorLineWidth = this.body.dom.backgroundHorizontal.offsetWidth - this.lineOffset - this.width + 2 * this.options.majorLinesOffset;
+ props.majorLineHeight = 1;
+
+ // take frame offline while updating (is almost twice as fast)
+ if (orientation === 'left') {
+ frame.style.top = '0';
+ frame.style.left = '0';
+ frame.style.bottom = '';
+ frame.style.width = this.width + 'px';
+ frame.style.height = this.height + "px";
+ this.props.width = this.body.domProps.left.width;
+ this.props.height = this.body.domProps.left.height;
+ } else {
+ // right
+ frame.style.top = '';
+ frame.style.bottom = '0';
+ frame.style.left = '0';
+ frame.style.width = this.width + 'px';
+ frame.style.height = this.height + "px";
+ this.props.width = this.body.domProps.right.width;
+ this.props.height = this.body.domProps.right.height;
+ }
+
+ resized = this._redrawLabels();
+ resized = this._isResized() || resized;
+
+ if (this.options.icons === true) {
+ this._redrawGroupIcons();
+ } else {
+ this._cleanupIcons();
+ }
+
+ this._redrawTitle(orientation);
+ }
+ return resized;
+ };
+
+ /**
+ * Repaint major and minor text labels and vertical grid lines
+ * @private
+ */
+ DataAxis.prototype._redrawLabels = function () {
+ var _this = this;
+
+ var resized = false;
+ DOMutil.prepareElements(this.DOMelements.lines);
+ DOMutil.prepareElements(this.DOMelements.labels);
+ var orientation = this.options['orientation'];
+ var customRange = this.options[orientation].range != undefined ? this.options[orientation].range : {};
+
+ //Override range with manual options:
+ var autoScaleEnd = true;
+ if (customRange.max != undefined) {
+ this.range.end = customRange.max;
+ autoScaleEnd = false;
+ }
+ var autoScaleStart = true;
+ if (customRange.min != undefined) {
+ this.range.start = customRange.min;
+ autoScaleStart = false;
+ }
+
+ this.scale = new DataScale(this.range.start, this.range.end, autoScaleStart, autoScaleEnd, this.dom.frame.offsetHeight, this.props.majorCharHeight, this.options.alignZeros, this.options[orientation].format);
+
+ if (this.master === false && this.masterAxis != undefined) {
+ this.scale.followScale(this.masterAxis.scale);
+ }
+
+ //Is updated in side-effect of _redrawLabel():
+ this.maxLabelSize = 0;
+
+ var lines = this.scale.getLines();
+ lines.forEach(function (line) {
+ var y = line.y;
+ var isMajor = line.major;
+ if (_this.options['showMinorLabels'] && isMajor === false) {
+ _this._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-minor', _this.props.minorCharHeight);
+ }
+ if (isMajor) {
+ if (y >= 0) {
+ _this._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-major', _this.props.majorCharHeight);
+ }
+ }
+ if (_this.master === true) {
+ if (isMajor) {
+ _this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-major', _this.options.majorLinesOffset, _this.props.majorLineWidth);
+ } else {
+ _this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-minor', _this.options.minorLinesOffset, _this.props.minorLineWidth);
+ }
+ }
+ });
+
+ // Note that title is rotated, so we're using the height, not width!
+ var titleWidth = 0;
+ if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {
+ titleWidth = this.props.titleCharHeight;
+ }
+ var offset = this.options.icons === true ? Math.max(this.options.iconWidth, titleWidth) + this.options.labelOffsetX + 15 : titleWidth + this.options.labelOffsetX + 15;
+
+ // this will resize the yAxis to accommodate the labels.
+ if (this.maxLabelSize > this.width - offset && this.options.visible === true) {
+ this.width = this.maxLabelSize + offset;
+ this.options.width = this.width + "px";
+ DOMutil.cleanupElements(this.DOMelements.lines);
+ DOMutil.cleanupElements(this.DOMelements.labels);
+ this.redraw();
+ resized = true;
+ }
+ // this will resize the yAxis if it is too big for the labels.
+ else if (this.maxLabelSize < this.width - offset && this.options.visible === true && this.width > this.minWidth) {
+ this.width = Math.max(this.minWidth, this.maxLabelSize + offset);
+ this.options.width = this.width + "px";
+ DOMutil.cleanupElements(this.DOMelements.lines);
+ DOMutil.cleanupElements(this.DOMelements.labels);
+ this.redraw();
+ resized = true;
+ } else {
+ DOMutil.cleanupElements(this.DOMelements.lines);
+ DOMutil.cleanupElements(this.DOMelements.labels);
+ resized = false;
+ }
+
+ return resized;
+ };
+
+ DataAxis.prototype.convertValue = function (value) {
+ return this.scale.convertValue(value);
+ };
+
+ DataAxis.prototype.screenToValue = function (x) {
+ return this.scale.screenToValue(x);
+ };
+
+ /**
+ * Create a label for the axis at position x
+ * @private
+ * @param y
+ * @param text
+ * @param orientation
+ * @param className
+ * @param characterHeight
+ */
+ DataAxis.prototype._redrawLabel = function (y, text, orientation, className, characterHeight) {
+ // reuse redundant label
+ var label = DOMutil.getDOMElement('div', this.DOMelements.labels, this.dom.frame); //this.dom.redundant.labels.shift();
+ label.className = className;
+ label.innerHTML = text;
+ if (orientation === 'left') {
+ label.style.left = '-' + this.options.labelOffsetX + 'px';
+ label.style.textAlign = "right";
+ } else {
+ label.style.right = '-' + this.options.labelOffsetX + 'px';
+ label.style.textAlign = "left";
+ }
+
+ label.style.top = y - 0.5 * characterHeight + this.options.labelOffsetY + 'px';
+
+ text += '';
+
+ var largestWidth = Math.max(this.props.majorCharWidth, this.props.minorCharWidth);
+ if (this.maxLabelSize < text.length * largestWidth) {
+ this.maxLabelSize = text.length * largestWidth;
+ }
+ };
+
+ /**
+ * Create a minor line for the axis at position y
+ * @param y
+ * @param orientation
+ * @param className
+ * @param offset
+ * @param width
+ */
+ DataAxis.prototype._redrawLine = function (y, orientation, className, offset, width) {
+ if (this.master === true) {
+ var line = DOMutil.getDOMElement('div', this.DOMelements.lines, this.dom.lineContainer); //this.dom.redundant.lines.shift();
+ line.className = className;
+ line.innerHTML = '';
+
+ if (orientation === 'left') {
+ line.style.left = this.width - offset + 'px';
+ } else {
+ line.style.right = this.width - offset + 'px';
+ }
+
+ line.style.width = width + 'px';
+ line.style.top = y + 'px';
+ }
+ };
+
+ /**
+ * Create a title for the axis
+ * @private
+ * @param orientation
+ */
+ DataAxis.prototype._redrawTitle = function (orientation) {
+ DOMutil.prepareElements(this.DOMelements.title);
+
+ // Check if the title is defined for this axes
+ if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {
+ var title = DOMutil.getDOMElement('div', this.DOMelements.title, this.dom.frame);
+ title.className = 'vis-y-axis vis-title vis-' + orientation;
+ title.innerHTML = this.options[orientation].title.text;
+
+ // Add style - if provided
+ if (this.options[orientation].title.style !== undefined) {
+ util.addCssText(title, this.options[orientation].title.style);
+ }
+
+ if (orientation === 'left') {
+ title.style.left = this.props.titleCharHeight + 'px';
+ } else {
+ title.style.right = this.props.titleCharHeight + 'px';
+ }
+
+ title.style.width = this.height + 'px';
+ }
+
+ // we need to clean up in case we did not use all elements.
+ DOMutil.cleanupElements(this.DOMelements.title);
+ };
+
+ /**
+ * Determine the size of text on the axis (both major and minor axis).
+ * The size is calculated only once and then cached in this.props.
+ * @private
+ */
+ DataAxis.prototype._calculateCharSize = function () {
+ // determine the char width and height on the minor axis
+ if (!('minorCharHeight' in this.props)) {
+ var textMinor = document.createTextNode('0');
+ var measureCharMinor = document.createElement('div');
+ measureCharMinor.className = 'vis-y-axis vis-minor vis-measure';
+ measureCharMinor.appendChild(textMinor);
+ this.dom.frame.appendChild(measureCharMinor);
+
+ this.props.minorCharHeight = measureCharMinor.clientHeight;
+ this.props.minorCharWidth = measureCharMinor.clientWidth;
+
+ this.dom.frame.removeChild(measureCharMinor);
+ }
+
+ if (!('majorCharHeight' in this.props)) {
+ var textMajor = document.createTextNode('0');
+ var measureCharMajor = document.createElement('div');
+ measureCharMajor.className = 'vis-y-axis vis-major vis-measure';
+ measureCharMajor.appendChild(textMajor);
+ this.dom.frame.appendChild(measureCharMajor);
+
+ this.props.majorCharHeight = measureCharMajor.clientHeight;
+ this.props.majorCharWidth = measureCharMajor.clientWidth;
+
+ this.dom.frame.removeChild(measureCharMajor);
+ }
+
+ if (!('titleCharHeight' in this.props)) {
+ var textTitle = document.createTextNode('0');
+ var measureCharTitle = document.createElement('div');
+ measureCharTitle.className = 'vis-y-axis vis-title vis-measure';
+ measureCharTitle.appendChild(textTitle);
+ this.dom.frame.appendChild(measureCharTitle);
+
+ this.props.titleCharHeight = measureCharTitle.clientHeight;
+ this.props.titleCharWidth = measureCharTitle.clientWidth;
+
+ this.dom.frame.removeChild(measureCharTitle);
+ }
+ };
+
+ module.exports = DataAxis;
+
+/***/ },
+/* 53 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ /**
+ * Created by ludo on 25-1-16.
+ */
+
+ function DataScale(start, end, autoScaleStart, autoScaleEnd, containerHeight, majorCharHeight) {
+ var zeroAlign = arguments.length <= 6 || arguments[6] === undefined ? false : arguments[6];
+ var formattingFunction = arguments.length <= 7 || arguments[7] === undefined ? false : arguments[7];
+
+ this.majorSteps = [1, 2, 5, 10];
+ this.minorSteps = [0.25, 0.5, 1, 2];
+ this.customLines = null;
+
+ this.containerHeight = containerHeight;
+ this.majorCharHeight = majorCharHeight;
+ this._start = start;
+ this._end = end;
+
+ this.scale = 1;
+ this.minorStepIdx = -1;
+ this.magnitudefactor = 1;
+ this.determineScale();
+
+ this.zeroAlign = zeroAlign;
+ this.autoScaleStart = autoScaleStart;
+ this.autoScaleEnd = autoScaleEnd;
+
+ this.formattingFunction = formattingFunction;
+
+ if (autoScaleStart || autoScaleEnd) {
+ var me = this;
+ var roundToMinor = function roundToMinor(value) {
+ var rounded = value - value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]);
+ if (value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]) > 0.5 * (me.magnitudefactor * me.minorSteps[me.minorStepIdx])) {
+ return rounded + me.magnitudefactor * me.minorSteps[me.minorStepIdx];
+ } else {
+ return rounded;
+ }
+ };
+ if (autoScaleStart) {
+ this._start -= this.magnitudefactor * 2 * this.minorSteps[this.minorStepIdx];
+ this._start = roundToMinor(this._start);
+ }
+
+ if (autoScaleEnd) {
+ this._end += this.magnitudefactor * this.minorSteps[this.minorStepIdx];
+ this._end = roundToMinor(this._end);
+ }
+ this.determineScale();
+ }
+ }
+
+ DataScale.prototype.setCharHeight = function (majorCharHeight) {
+ this.majorCharHeight = majorCharHeight;
+ };
+
+ DataScale.prototype.setHeight = function (containerHeight) {
+ this.containerHeight = containerHeight;
+ };
+
+ DataScale.prototype.determineScale = function () {
+ var range = this._end - this._start;
+ this.scale = this.containerHeight / range;
+ var minimumStepValue = this.majorCharHeight / this.scale;
+ var orderOfMagnitude = range > 0 ? Math.round(Math.log(range) / Math.LN10) : 0;
+
+ this.minorStepIdx = -1;
+ this.magnitudefactor = Math.pow(10, orderOfMagnitude);
+
+ var start = 0;
+ if (orderOfMagnitude < 0) {
+ start = orderOfMagnitude;
+ }
+
+ var solutionFound = false;
+ for (var l = start; Math.abs(l) <= Math.abs(orderOfMagnitude); l++) {
+ this.magnitudefactor = Math.pow(10, l);
+ for (var j = 0; j < this.minorSteps.length; j++) {
+ var stepSize = this.magnitudefactor * this.minorSteps[j];
+ if (stepSize >= minimumStepValue) {
+ solutionFound = true;
+ this.minorStepIdx = j;
+ break;
+ }
+ }
+ if (solutionFound === true) {
+ break;
+ }
+ }
+ };
+
+ DataScale.prototype.is_major = function (value) {
+ return value % (this.magnitudefactor * this.majorSteps[this.minorStepIdx]) === 0;
+ };
+
+ DataScale.prototype.getStep = function () {
+ return this.magnitudefactor * this.minorSteps[this.minorStepIdx];
+ };
+
+ DataScale.prototype.getFirstMajor = function () {
+ var majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];
+ return this.convertValue(this._start + (majorStep - this._start % majorStep) % majorStep);
+ };
+
+ DataScale.prototype.formatValue = function (current) {
+ var returnValue = current.toPrecision(5);
+ if (typeof this.formattingFunction === 'function') {
+ returnValue = this.formattingFunction(current);
+ }
+
+ if (typeof returnValue === 'number') {
+ return '' + returnValue;
+ } else if (typeof returnValue === 'string') {
+ return returnValue;
+ } else {
+ return current.toPrecision(5);
+ }
+ };
+
+ DataScale.prototype.getLines = function () {
+ var lines = [];
+ var step = this.getStep();
+ var bottomOffset = (step - this._start % step) % step;
+ for (var i = this._start + bottomOffset; this._end - i > 0.00001; i += step) {
+ if (i != this._start) {
+ //Skip the bottom line
+ lines.push({ major: this.is_major(i), y: this.convertValue(i), val: this.formatValue(i) });
+ }
+ }
+ return lines;
+ };
+
+ DataScale.prototype.followScale = function (other) {
+ var oldStepIdx = this.minorStepIdx;
+ var oldStart = this._start;
+ var oldEnd = this._end;
+
+ var me = this;
+ var increaseMagnitude = function increaseMagnitude() {
+ me.magnitudefactor *= 2;
+ };
+ var decreaseMagnitude = function decreaseMagnitude() {
+ me.magnitudefactor /= 2;
+ };
+
+ if (other.minorStepIdx <= 1 && this.minorStepIdx <= 1 || other.minorStepIdx > 1 && this.minorStepIdx > 1) {
+ //easy, no need to change stepIdx nor multiplication factor
+ } else if (other.minorStepIdx < this.minorStepIdx) {
+ //I'm 5, they are 4 per major.
+ this.minorStepIdx = 1;
+ if (oldStepIdx == 2) {
+ increaseMagnitude();
+ } else {
+ increaseMagnitude();
+ increaseMagnitude();
+ }
+ } else {
+ //I'm 4, they are 5 per major
+ this.minorStepIdx = 2;
+ if (oldStepIdx == 1) {
+ decreaseMagnitude();
+ } else {
+ decreaseMagnitude();
+ decreaseMagnitude();
+ }
+ }
+
+ //Get masters stats:
+ var lines = other.getLines();
+ var otherZero = other.convertValue(0);
+ var otherStep = other.getStep() * other.scale;
+
+ var done = false;
+ var count = 0;
+ //Loop until magnitude is correct for given constrains.
+ while (!done && count++ < 5) {
+
+ //Get my stats:
+ this.scale = otherStep / (this.minorSteps[this.minorStepIdx] * this.magnitudefactor);
+ var newRange = this.containerHeight / this.scale;
+
+ //For the case the magnitudefactor has changed:
+ this._start = oldStart;
+ this._end = this._start + newRange;
+
+ var myOriginalZero = this._end * this.scale;
+ var majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];
+ var majorOffset = this.getFirstMajor() - other.getFirstMajor();
+
+ if (this.zeroAlign) {
+ var zeroOffset = otherZero - myOriginalZero;
+ this._end += zeroOffset / this.scale;
+ this._start = this._end - newRange;
+ } else {
+ if (!this.autoScaleStart) {
+ this._start += majorStep - majorOffset / this.scale;
+ this._end = this._start + newRange;
+ } else {
+ this._start -= majorOffset / this.scale;
+ this._end = this._start + newRange;
+ }
+ }
+ if (!this.autoScaleEnd && this._end > oldEnd + 0.00001) {
+ //Need to decrease magnitude to prevent scale overshoot! (end)
+ decreaseMagnitude();
+ done = false;
+ continue;
+ }
+ if (!this.autoScaleStart && this._start < oldStart - 0.00001) {
+ if (this.zeroAlign && oldStart >= 0) {
+ console.warn("Can't adhere to given 'min' range, due to zeroalign");
+ } else {
+ //Need to decrease magnitude to prevent scale overshoot! (start)
+ decreaseMagnitude();
+ done = false;
+ continue;
+ }
+ }
+ if (this.autoScaleStart && this.autoScaleEnd && newRange < oldEnd - oldStart) {
+ increaseMagnitude();
+ done = false;
+ continue;
+ }
+ done = true;
+ }
+ };
+
+ DataScale.prototype.convertValue = function (value) {
+ return this.containerHeight - (value - this._start) * this.scale;
+ };
+
+ DataScale.prototype.screenToValue = function (pixels) {
+ return (this.containerHeight - pixels) / this.scale + this._start;
+ };
+
+ module.exports = DataScale;
+
+/***/ },
+/* 54 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(8);
+ var Bars = __webpack_require__(55);
+ var Lines = __webpack_require__(57);
+ var Points = __webpack_require__(56);
+
+ /**
+ * /**
+ * @param {object} group | the object of the group from the dataset
+ * @param {string} groupId | ID of the group
+ * @param {object} options | the default options
+ * @param {array} groupsUsingDefaultStyles | this array has one entree.
+ * It is passed as an array so it is passed by reference.
+ * It enumerates through the default styles
+ * @constructor
+ */
+ function GraphGroup(group, groupId, options, groupsUsingDefaultStyles) {
+ this.id = groupId;
+ var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'drawPoints', 'shaded', 'interpolation', 'zIndex', 'excludeFromStacking', 'excludeFromLegend'];
+ this.options = util.selectiveBridgeObject(fields, options);
+ this.usingDefaultStyle = group.className === undefined;
+ this.groupsUsingDefaultStyles = groupsUsingDefaultStyles;
+ this.zeroPosition = 0;
+ this.update(group);
+ if (this.usingDefaultStyle == true) {
+ this.groupsUsingDefaultStyles[0] += 1;
+ }
+ this.itemsData = [];
+ this.visible = group.visible === undefined ? true : group.visible;
+ }
+
+ /**
+ * this loads a reference to all items in this group into this group.
+ * @param {array} items
+ */
+ GraphGroup.prototype.setItems = function (items) {
+ if (items != null) {
+ this.itemsData = items;
+ if (this.options.sort == true) {
+ util.insertSort(this.itemsData, function (a, b) {
+ return a.x > b.x ? 1 : -1;
+ });
+ }
+ } else {
+ this.itemsData = [];
+ }
+ };
+
+ GraphGroup.prototype.getItems = function () {
+ return this.itemsData;
+ };
+
+ /**
+ * this is used for barcharts and shading, this way, we only have to calculate it once.
+ * @param pos
+ */
+ GraphGroup.prototype.setZeroPosition = function (pos) {
+ this.zeroPosition = pos;
+ };
+
+ /**
+ * set the options of the graph group over the default options.
+ * @param options
+ */
+ GraphGroup.prototype.setOptions = function (options) {
+ if (options !== undefined) {
+ var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'zIndex', 'excludeFromStacking', 'excludeFromLegend'];
+ util.selectiveDeepExtend(fields, this.options, options);
+
+ // if the group's drawPoints is a function delegate the callback to the onRender property
+ if (typeof options.drawPoints == 'function') {
+ options.drawPoints = {
+ onRender: options.drawPoints
+ };
+ }
+
+ util.mergeOptions(this.options, options, 'interpolation');
+ util.mergeOptions(this.options, options, 'drawPoints');
+ util.mergeOptions(this.options, options, 'shaded');
+
+ if (options.interpolation) {
+ if (_typeof(options.interpolation) == 'object') {
+ if (options.interpolation.parametrization) {
+ if (options.interpolation.parametrization == 'uniform') {
+ this.options.interpolation.alpha = 0;
+ } else if (options.interpolation.parametrization == 'chordal') {
+ this.options.interpolation.alpha = 1.0;
+ } else {
+ this.options.interpolation.parametrization = 'centripetal';
+ this.options.interpolation.alpha = 0.5;
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * this updates the current group class with the latest group dataset entree, used in _updateGroup in linegraph
+ * @param group
+ */
+ GraphGroup.prototype.update = function (group) {
+ this.group = group;
+ this.content = group.content || 'graph';
+ this.className = group.className || this.className || 'vis-graph-group' + this.groupsUsingDefaultStyles[0] % 10;
+ this.visible = group.visible === undefined ? true : group.visible;
+ this.style = group.style;
+ this.setOptions(group.options);
+ };
+
+ /**
+ * return the legend entree for this group.
+ *
+ * @param iconWidth
+ * @param iconHeight
+ * @returns {{icon: HTMLElement, label: (group.content|*|string), orientation: (.options.yAxisOrientation|*)}}
+ */
+ GraphGroup.prototype.getLegend = function (iconWidth, iconHeight, framework, x, y) {
+ if (framework == undefined || framework == null) {
+ var svg = document.createElementNS('http://www.w3.org/2000/svg', "svg");
+ framework = { svg: svg, svgElements: {}, options: this.options, groups: [this] };
+ }
+ if (x == undefined || x == null) {
+ x = 0;
+ }
+ if (y == undefined || y == null) {
+ y = 0.5 * iconHeight;
+ }
+ switch (this.options.style) {
+ case "line":
+ Lines.drawIcon(this, x, y, iconWidth, iconHeight, framework);
+ break;
+ case "points": //explicit no break
+ case "point":
+ Points.drawIcon(this, x, y, iconWidth, iconHeight, framework);
+ break;
+ case "bar":
+ Bars.drawIcon(this, x, y, iconWidth, iconHeight, framework);
+ break;
+ }
+ return { icon: framework.svg, label: this.content, orientation: this.options.yAxisOrientation };
+ };
+
+ GraphGroup.prototype.getYRange = function (groupData) {
+ var yMin = groupData[0].y;
+ var yMax = groupData[0].y;
+ for (var j = 0; j < groupData.length; j++) {
+ yMin = yMin > groupData[j].y ? groupData[j].y : yMin;
+ yMax = yMax < groupData[j].y ? groupData[j].y : yMax;
+ }
+ return { min: yMin, max: yMax, yAxisOrientation: this.options.yAxisOrientation };
+ };
+
+ module.exports = GraphGroup;
+
+/***/ },
+/* 55 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var DOMutil = __webpack_require__(8);
+ var Points = __webpack_require__(56);
+
+ function Bargraph(groupId, options) {}
+
+ Bargraph.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {
+ var fillHeight = iconHeight * 0.5;
+ var path, fillPath;
+
+ var outline = DOMutil.getSVGElement("rect", framework.svgElements, framework.svg);
+ outline.setAttributeNS(null, "x", x);
+ outline.setAttributeNS(null, "y", y - fillHeight);
+ outline.setAttributeNS(null, "width", iconWidth);
+ outline.setAttributeNS(null, "height", 2 * fillHeight);
+ outline.setAttributeNS(null, "class", "vis-outline");
+
+ var barWidth = Math.round(0.3 * iconWidth);
+ var originalWidth = group.options.barChart.width;
+ var scale = originalWidth / barWidth;
+ var bar1Height = Math.round(0.4 * iconHeight);
+ var bar2Height = Math.round(0.75 * iconHeight);
+
+ var offset = Math.round((iconWidth - 2 * barWidth) / 3);
+
+ DOMutil.drawBar(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, barWidth, bar1Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);
+ DOMutil.drawBar(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, barWidth, bar2Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);
+
+ if (group.options.drawPoints.enabled == true) {
+ var groupTemplate = {
+ style: group.options.drawPoints.style,
+ styles: group.options.drawPoints.styles,
+ size: group.options.drawPoints.size / scale,
+ className: group.className
+ };
+ DOMutil.drawPoint(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, groupTemplate, framework.svgElements, framework.svg);
+ DOMutil.drawPoint(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, groupTemplate, framework.svgElements, framework.svg);
+ }
+ };
+
+ /**
+ * draw a bar graph
+ *
+ * @param groupIds
+ * @param processedGroupData
+ */
+ Bargraph.draw = function (groupIds, processedGroupData, framework) {
+ var combinedData = [];
+ var intersections = {};
+ var coreDistance;
+ var key, drawData;
+ var group;
+ var i, j;
+ var barPoints = 0;
+
+ // combine all barchart data
+ for (i = 0; i < groupIds.length; i++) {
+ group = framework.groups[groupIds[i]];
+ if (group.options.style === 'bar') {
+ if (group.visible === true && (framework.options.groups.visibility[groupIds[i]] === undefined || framework.options.groups.visibility[groupIds[i]] === true)) {
+ for (j = 0; j < processedGroupData[groupIds[i]].length; j++) {
+ combinedData.push({
+ screen_x: processedGroupData[groupIds[i]][j].screen_x,
+ screen_y: processedGroupData[groupIds[i]][j].screen_y,
+ x: processedGroupData[groupIds[i]][j].x,
+ y: processedGroupData[groupIds[i]][j].y,
+ groupId: groupIds[i],
+ label: processedGroupData[groupIds[i]][j].label
+ });
+ barPoints += 1;
+ }
+ }
+ }
+ }
+
+ if (barPoints === 0) {
+ return;
+ }
+
+ // sort by time and by group
+ combinedData.sort(function (a, b) {
+ if (a.screen_x === b.screen_x) {
+ return a.groupId < b.groupId ? -1 : 1;
+ } else {
+ return a.screen_x - b.screen_x;
+ }
+ });
+
+ // get intersections
+ Bargraph._getDataIntersections(intersections, combinedData);
+
+ // plot barchart
+ for (i = 0; i < combinedData.length; i++) {
+ group = framework.groups[combinedData[i].groupId];
+ var minWidth = group.options.barChart.minWidth != undefined ? group.options.barChart.minWidth : 0.1 * group.options.barChart.width;
+
+ key = combinedData[i].screen_x;
+ var heightOffset = 0;
+ if (intersections[key] === undefined) {
+ if (i + 1 < combinedData.length) {
+ coreDistance = Math.abs(combinedData[i + 1].screen_x - key);
+ }
+ drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);
+ } else {
+ var nextKey = i + (intersections[key].amount - intersections[key].resolved);
+ var prevKey = i - (intersections[key].resolved + 1);
+ if (nextKey < combinedData.length) {
+ coreDistance = Math.abs(combinedData[nextKey].screen_x - key);
+ }
+ drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);
+ intersections[key].resolved += 1;
+
+ if (group.options.stack === true && group.options.excludeFromStacking !== true) {
+ if (combinedData[i].screen_y < group.zeroPosition) {
+ heightOffset = intersections[key].accumulatedNegative;
+ intersections[key].accumulatedNegative += group.zeroPosition - combinedData[i].screen_y;
+ } else {
+ heightOffset = intersections[key].accumulatedPositive;
+ intersections[key].accumulatedPositive += group.zeroPosition - combinedData[i].screen_y;
+ }
+ } else if (group.options.barChart.sideBySide === true) {
+ drawData.width = drawData.width / intersections[key].amount;
+ drawData.offset += intersections[key].resolved * drawData.width - 0.5 * drawData.width * (intersections[key].amount + 1);
+ }
+ }
+ DOMutil.drawBar(combinedData[i].screen_x + drawData.offset, combinedData[i].screen_y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].screen_y, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);
+ // draw points
+ if (group.options.drawPoints.enabled === true) {
+ var pointData = {
+ screen_x: combinedData[i].screen_x,
+ screen_y: combinedData[i].screen_y - heightOffset,
+ x: combinedData[i].x,
+ y: combinedData[i].y,
+ groupId: combinedData[i].groupId,
+ label: combinedData[i].label
+ };
+ Points.draw([pointData], group, framework, drawData.offset);
+ //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);
+ }
+ }
+ };
+
+ /**
+ * Fill the intersections object with counters of how many datapoints share the same x coordinates
+ * @param intersections
+ * @param combinedData
+ * @private
+ */
+ Bargraph._getDataIntersections = function (intersections, combinedData) {
+ // get intersections
+ var coreDistance;
+ for (var i = 0; i < combinedData.length; i++) {
+ if (i + 1 < combinedData.length) {
+ coreDistance = Math.abs(combinedData[i + 1].screen_x - combinedData[i].screen_x);
+ }
+ if (i > 0) {
+ coreDistance = Math.min(coreDistance, Math.abs(combinedData[i - 1].screen_x - combinedData[i].screen_x));
+ }
+ if (coreDistance === 0) {
+ if (intersections[combinedData[i].screen_x] === undefined) {
+ intersections[combinedData[i].screen_x] = {
+ amount: 0,
+ resolved: 0,
+ accumulatedPositive: 0,
+ accumulatedNegative: 0
+ };
+ }
+ intersections[combinedData[i].screen_x].amount += 1;
+ }
+ }
+ };
+
+ /**
+ * Get the width and offset for bargraphs based on the coredistance between datapoints
+ *
+ * @param coreDistance
+ * @param group
+ * @param minWidth
+ * @returns {{width: Number, offset: Number}}
+ * @private
+ */
+ Bargraph._getSafeDrawData = function (coreDistance, group, minWidth) {
+ var width, offset;
+ if (coreDistance < group.options.barChart.width && coreDistance > 0) {
+ width = coreDistance < minWidth ? minWidth : coreDistance;
+
+ offset = 0; // recalculate offset with the new width;
+ if (group.options.barChart.align === 'left') {
+ offset -= 0.5 * coreDistance;
+ } else if (group.options.barChart.align === 'right') {
+ offset += 0.5 * coreDistance;
+ }
+ } else {
+ // default settings
+ width = group.options.barChart.width;
+ offset = 0;
+ if (group.options.barChart.align === 'left') {
+ offset -= 0.5 * group.options.barChart.width;
+ } else if (group.options.barChart.align === 'right') {
+ offset += 0.5 * group.options.barChart.width;
+ }
+ }
+
+ return { width: width, offset: offset };
+ };
+
+ Bargraph.getStackedYRange = function (combinedData, groupRanges, groupIds, groupLabel, orientation) {
+ if (combinedData.length > 0) {
+ // sort by time and by group
+ combinedData.sort(function (a, b) {
+ if (a.screen_x === b.screen_x) {
+ return a.groupId < b.groupId ? -1 : 1;
+ } else {
+ return a.screen_x - b.screen_x;
+ }
+ });
+ var intersections = {};
+
+ Bargraph._getDataIntersections(intersections, combinedData);
+ groupRanges[groupLabel] = Bargraph._getStackedYRange(intersections, combinedData);
+ groupRanges[groupLabel].yAxisOrientation = orientation;
+ groupIds.push(groupLabel);
+ }
+ };
+
+ Bargraph._getStackedYRange = function (intersections, combinedData) {
+ var key;
+ var yMin = combinedData[0].screen_y;
+ var yMax = combinedData[0].screen_y;
+ for (var i = 0; i < combinedData.length; i++) {
+ key = combinedData[i].screen_x;
+ if (intersections[key] === undefined) {
+ yMin = yMin > combinedData[i].screen_y ? combinedData[i].screen_y : yMin;
+ yMax = yMax < combinedData[i].screen_y ? combinedData[i].screen_y : yMax;
+ } else {
+ if (combinedData[i].screen_y < 0) {
+ intersections[key].accumulatedNegative += combinedData[i].screen_y;
+ } else {
+ intersections[key].accumulatedPositive += combinedData[i].screen_y;
+ }
+ }
+ }
+ for (var xpos in intersections) {
+ if (intersections.hasOwnProperty(xpos)) {
+ yMin = yMin > intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMin;
+ yMin = yMin > intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMin;
+ yMax = yMax < intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMax;
+ yMax = yMax < intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMax;
+ }
+ }
+
+ return { min: yMin, max: yMax };
+ };
+
+ module.exports = Bargraph;
+
+/***/ },
+/* 56 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var DOMutil = __webpack_require__(8);
+
+ function Points(groupId, options) {}
+
+ /**
+ * draw the data points
+ *
+ * @param {Array} dataset
+ * @param {Object} JSONcontainer
+ * @param {Object} svg | SVG DOM element
+ * @param {GraphGroup} group
+ * @param {Number} [offset]
+ */
+ Points.draw = function (dataset, group, framework, offset) {
+ offset = offset || 0;
+ var callback = getCallback(framework, group);
+
+ for (var i = 0; i < dataset.length; i++) {
+ if (!callback) {
+ // draw the point the simple way.
+ DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group), framework.svgElements, framework.svg, dataset[i].label);
+ } else {
+ var callbackResult = callback(dataset[i], group); // result might be true, false or an object
+ if (callbackResult === true || (typeof callbackResult === 'undefined' ? 'undefined' : _typeof(callbackResult)) === 'object') {
+ DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group, callbackResult), framework.svgElements, framework.svg, dataset[i].label);
+ }
+ }
+ }
+ };
+
+ Points.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {
+ var fillHeight = iconHeight * 0.5;
+ var path, fillPath;
+
+ var outline = DOMutil.getSVGElement("rect", framework.svgElements, framework.svg);
+ outline.setAttributeNS(null, "x", x);
+ outline.setAttributeNS(null, "y", y - fillHeight);
+ outline.setAttributeNS(null, "width", iconWidth);
+ outline.setAttributeNS(null, "height", 2 * fillHeight);
+ outline.setAttributeNS(null, "class", "vis-outline");
+
+ //Don't call callback on icon
+ DOMutil.drawPoint(x + 0.5 * iconWidth, y, getGroupTemplate(group), framework.svgElements, framework.svg);
+ };
+
+ function getGroupTemplate(group, callbackResult) {
+ callbackResult = typeof callbackResult === 'undefined' ? {} : callbackResult;
+ return {
+ style: callbackResult.style || group.options.drawPoints.style,
+ styles: callbackResult.styles || group.options.drawPoints.styles,
+ size: callbackResult.size || group.options.drawPoints.size,
+ className: callbackResult.className || group.className
+ };
+ }
+
+ function getCallback(framework, group) {
+ var callback = undefined;
+ // check for the graph2d onRender
+ if (framework.options && framework.options.drawPoints && framework.options.drawPoints.onRender && typeof framework.options.drawPoints.onRender == 'function') {
+ callback = framework.options.drawPoints.onRender;
+ }
+
+ // override it with the group onRender if defined
+ if (group.group.options && group.group.options.drawPoints && group.group.options.drawPoints.onRender && typeof group.group.options.drawPoints.onRender == 'function') {
+ callback = group.group.options.drawPoints.onRender;
+ }
+ return callback;
+ }
+
+ module.exports = Points;
+
+/***/ },
+/* 57 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ var DOMutil = __webpack_require__(8);
+
+ function Line(groupId, options) {}
+
+ Line.calcPath = function (dataset, group) {
+ if (dataset != null) {
+ if (dataset.length > 0) {
+ var d = [];
+
+ // construct path from dataset
+ if (group.options.interpolation.enabled == true) {
+ d = Line._catmullRom(dataset, group);
+ } else {
+ d = Line._linear(dataset);
+ }
+ return d;
+ }
+ }
+ };
+
+ Line.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {
+ var fillHeight = iconHeight * 0.5;
+ var path, fillPath;
+
+ var outline = DOMutil.getSVGElement("rect", framework.svgElements, framework.svg);
+ outline.setAttributeNS(null, "x", x);
+ outline.setAttributeNS(null, "y", y - fillHeight);
+ outline.setAttributeNS(null, "width", iconWidth);
+ outline.setAttributeNS(null, "height", 2 * fillHeight);
+ outline.setAttributeNS(null, "class", "vis-outline");
+
+ path = DOMutil.getSVGElement("path", framework.svgElements, framework.svg);
+ path.setAttributeNS(null, "class", group.className);
+ if (group.style !== undefined) {
+ path.setAttributeNS(null, "style", group.style);
+ }
+
+ path.setAttributeNS(null, "d", "M" + x + "," + y + " L" + (x + iconWidth) + "," + y + "");
+ if (group.options.shaded.enabled == true) {
+ fillPath = DOMutil.getSVGElement("path", framework.svgElements, framework.svg);
+ if (group.options.shaded.orientation == 'top') {
+ fillPath.setAttributeNS(null, "d", "M" + x + ", " + (y - fillHeight) + "L" + x + "," + y + " L" + (x + iconWidth) + "," + y + " L" + (x + iconWidth) + "," + (y - fillHeight));
+ } else {
+ fillPath.setAttributeNS(null, "d", "M" + x + "," + y + " " + "L" + x + "," + (y + fillHeight) + " " + "L" + (x + iconWidth) + "," + (y + fillHeight) + "L" + (x + iconWidth) + "," + y);
+ }
+ fillPath.setAttributeNS(null, "class", group.className + " vis-icon-fill");
+ if (group.options.shaded.style !== undefined && group.options.shaded.style !== "") {
+ fillPath.setAttributeNS(null, "style", group.options.shaded.style);
+ }
+ }
+
+ if (group.options.drawPoints.enabled == true) {
+ var groupTemplate = {
+ style: group.options.drawPoints.style,
+ styles: group.options.drawPoints.styles,
+ size: group.options.drawPoints.size,
+ className: group.className
+ };
+ DOMutil.drawPoint(x + 0.5 * iconWidth, y, groupTemplate, framework.svgElements, framework.svg);
+ }
+ };
+
+ Line.drawShading = function (pathArray, group, subPathArray, framework) {
+ // append shading to the path
+ if (group.options.shaded.enabled == true) {
+ var svgHeight = Number(framework.svg.style.height.replace('px', ''));
+ var fillPath = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);
+ var type = "L";
+ if (group.options.interpolation.enabled == true) {
+ type = "C";
+ }
+ var dFill;
+ var zero = 0;
+ if (group.options.shaded.orientation == 'top') {
+ zero = 0;
+ } else if (group.options.shaded.orientation == 'bottom') {
+ zero = svgHeight;
+ } else {
+ zero = Math.min(Math.max(0, group.zeroPosition), svgHeight);
+ }
+ if (group.options.shaded.orientation == 'group' && subPathArray != null && subPathArray != undefined) {
+ dFill = 'M' + pathArray[0][0] + "," + pathArray[0][1] + " " + this.serializePath(pathArray, type, false) + ' L' + subPathArray[subPathArray.length - 1][0] + "," + subPathArray[subPathArray.length - 1][1] + " " + this.serializePath(subPathArray, type, true) + subPathArray[0][0] + "," + subPathArray[0][1] + " Z";
+ } else {
+ dFill = 'M' + pathArray[0][0] + "," + pathArray[0][1] + " " + this.serializePath(pathArray, type, false) + ' V' + zero + ' H' + pathArray[0][0] + " Z";
+ }
+
+ fillPath.setAttributeNS(null, 'class', group.className + ' vis-fill');
+ if (group.options.shaded.style !== undefined) {
+ fillPath.setAttributeNS(null, 'style', group.options.shaded.style);
+ }
+ fillPath.setAttributeNS(null, 'd', dFill);
+ }
+ };
+
+ /**
+ * draw a line graph
+ *
+ * @param dataset
+ * @param group
+ */
+ Line.draw = function (pathArray, group, framework) {
+ if (pathArray != null && pathArray != undefined) {
+ var path = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);
+ path.setAttributeNS(null, "class", group.className);
+ if (group.style !== undefined) {
+ path.setAttributeNS(null, "style", group.style);
+ }
+
+ var type = "L";
+ if (group.options.interpolation.enabled == true) {
+ type = "C";
+ }
+ // copy properties to path for drawing.
+ path.setAttributeNS(null, 'd', 'M' + pathArray[0][0] + "," + pathArray[0][1] + " " + this.serializePath(pathArray, type, false));
+ }
+ };
+
+ Line.serializePath = function (pathArray, type, inverse) {
+ if (pathArray.length < 2) {
+ //Too little data to create a path.
+ return "";
+ }
+ var d = type;
+ if (inverse) {
+ for (var i = pathArray.length - 2; i > 0; i--) {
+ d += pathArray[i][0] + "," + pathArray[i][1] + " ";
+ }
+ } else {
+ for (var i = 1; i < pathArray.length; i++) {
+ d += pathArray[i][0] + "," + pathArray[i][1] + " ";
+ }
+ }
+ return d;
+ };
+
+ /**
+ * This uses an uniform parametrization of the interpolation algorithm:
+ * 'On the Parameterization of Catmull-Rom Curves' by Cem Yuksel et al.
+ * @param data
+ * @returns {string}
+ * @private
+ */
+ Line._catmullRomUniform = function (data) {
+ // catmull rom
+ var p0, p1, p2, p3, bp1, bp2;
+ var d = [];
+ d.push([Math.round(data[0].screen_x), Math.round(data[0].screen_y)]);
+ var normalization = 1 / 6;
+ var length = data.length;
+ for (var i = 0; i < length - 1; i++) {
+
+ p0 = i == 0 ? data[0] : data[i - 1];
+ p1 = data[i];
+ p2 = data[i + 1];
+ p3 = i + 2 < length ? data[i + 2] : p2;
+
+ // Catmull-Rom to Cubic Bezier conversion matrix
+ // 0 1 0 0
+ // -1/6 1 1/6 0
+ // 0 1/6 1 -1/6
+ // 0 0 1 0
+
+ // bp0 = { x: p1.x, y: p1.y };
+ bp1 = {
+ screen_x: (-p0.screen_x + 6 * p1.screen_x + p2.screen_x) * normalization,
+ screen_y: (-p0.screen_y + 6 * p1.screen_y + p2.screen_y) * normalization
+ };
+ bp2 = {
+ screen_x: (p1.screen_x + 6 * p2.screen_x - p3.screen_x) * normalization,
+ screen_y: (p1.screen_y + 6 * p2.screen_y - p3.screen_y) * normalization
+ };
+ // bp0 = { x: p2.x, y: p2.y };
+
+ d.push([bp1.screen_x, bp1.screen_y]);
+ d.push([bp2.screen_x, bp2.screen_y]);
+ d.push([p2.screen_x, p2.screen_y]);
+ }
+
+ return d;
+ };
+
+ /**
+ * This uses either the chordal or centripetal parameterization of the catmull-rom algorithm.
+ * By default, the centripetal parameterization is used because this gives the nicest results.
+ * These parameterizations are relatively heavy because the distance between 4 points have to be calculated.
+ *
+ * One optimization can be used to reuse distances since this is a sliding window approach.
+ * @param data
+ * @param group
+ * @returns {string}
+ * @private
+ */
+ Line._catmullRom = function (data, group) {
+ var alpha = group.options.interpolation.alpha;
+ if (alpha == 0 || alpha === undefined) {
+ return this._catmullRomUniform(data);
+ } else {
+ var p0, p1, p2, p3, bp1, bp2, d1, d2, d3, A, B, N, M;
+ var d3powA, d2powA, d3pow2A, d2pow2A, d1pow2A, d1powA;
+ var d = [];
+ d.push([Math.round(data[0].screen_x), Math.round(data[0].screen_y)]);
+ var length = data.length;
+ for (var i = 0; i < length - 1; i++) {
+
+ p0 = i == 0 ? data[0] : data[i - 1];
+ p1 = data[i];
+ p2 = data[i + 1];
+ p3 = i + 2 < length ? data[i + 2] : p2;
+
+ d1 = Math.sqrt(Math.pow(p0.screen_x - p1.screen_x, 2) + Math.pow(p0.screen_y - p1.screen_y, 2));
+ d2 = Math.sqrt(Math.pow(p1.screen_x - p2.screen_x, 2) + Math.pow(p1.screen_y - p2.screen_y, 2));
+ d3 = Math.sqrt(Math.pow(p2.screen_x - p3.screen_x, 2) + Math.pow(p2.screen_y - p3.screen_y, 2));
+
+ // Catmull-Rom to Cubic Bezier conversion matrix
+
+ // A = 2d1^2a + 3d1^a * d2^a + d3^2a
+ // B = 2d3^2a + 3d3^a * d2^a + d2^2a
+
+ // [ 0 1 0 0 ]
+ // [ -d2^2a /N A/N d1^2a /N 0 ]
+ // [ 0 d3^2a /M B/M -d2^2a /M ]
+ // [ 0 0 1 0 ]
+
+ d3powA = Math.pow(d3, alpha);
+ d3pow2A = Math.pow(d3, 2 * alpha);
+ d2powA = Math.pow(d2, alpha);
+ d2pow2A = Math.pow(d2, 2 * alpha);
+ d1powA = Math.pow(d1, alpha);
+ d1pow2A = Math.pow(d1, 2 * alpha);
+
+ A = 2 * d1pow2A + 3 * d1powA * d2powA + d2pow2A;
+ B = 2 * d3pow2A + 3 * d3powA * d2powA + d2pow2A;
+ N = 3 * d1powA * (d1powA + d2powA);
+ if (N > 0) {
+ N = 1 / N;
+ }
+ M = 3 * d3powA * (d3powA + d2powA);
+ if (M > 0) {
+ M = 1 / M;
+ }
+
+ bp1 = {
+ screen_x: (-d2pow2A * p0.screen_x + A * p1.screen_x + d1pow2A * p2.screen_x) * N,
+ screen_y: (-d2pow2A * p0.screen_y + A * p1.screen_y + d1pow2A * p2.screen_y) * N
+ };
+
+ bp2 = {
+ screen_x: (d3pow2A * p1.screen_x + B * p2.screen_x - d2pow2A * p3.screen_x) * M,
+ screen_y: (d3pow2A * p1.screen_y + B * p2.screen_y - d2pow2A * p3.screen_y) * M
+ };
+
+ if (bp1.screen_x == 0 && bp1.screen_y == 0) {
+ bp1 = p1;
+ }
+ if (bp2.screen_x == 0 && bp2.screen_y == 0) {
+ bp2 = p2;
+ }
+ d.push([bp1.screen_x, bp1.screen_y]);
+ d.push([bp2.screen_x, bp2.screen_y]);
+ d.push([p2.screen_x, p2.screen_y]);
+ }
+
+ return d;
+ }
+ };
+
+ /**
+ * this generates the SVG path for a linear drawing between datapoints.
+ * @param data
+ * @returns {string}
+ * @private
+ */
+ Line._linear = function (data) {
+ // linear
+ var d = [];
+ for (var i = 0; i < data.length; i++) {
+ d.push([data[i].screen_x, data[i].screen_y]);
+ }
+ return d;
+ };
+
+ module.exports = Line;
+
+/***/ },
+/* 58 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(8);
+ var Component = __webpack_require__(31);
+
+ /**
+ * Legend for Graph2d
+ */
+ function Legend(body, options, side, linegraphOptions) {
+ this.body = body;
+ this.defaultOptions = {
+ enabled: false,
+ icons: true,
+ iconSize: 20,
+ iconSpacing: 6,
+ left: {
+ visible: true,
+ position: 'top-left' // top/bottom - left,center,right
+ },
+ right: {
+ visible: true,
+ position: 'top-right' // top/bottom - left,center,right
+ }
+ };
+
+ this.side = side;
+ this.options = util.extend({}, this.defaultOptions);
+ this.linegraphOptions = linegraphOptions;
+
+ this.svgElements = {};
+ this.dom = {};
+ this.groups = {};
+ this.amountOfGroups = 0;
+ this._create();
+ this.framework = { svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups };
+
+ this.setOptions(options);
+ }
+
+ Legend.prototype = new Component();
+
+ Legend.prototype.clear = function () {
+ this.groups = {};
+ this.amountOfGroups = 0;
+ };
+
+ Legend.prototype.addGroup = function (label, graphOptions) {
+
+ // Include a group only if the group option 'excludeFromLegend: false' is not set.
+ if (graphOptions.options.excludeFromLegend != true) {
+ if (!this.groups.hasOwnProperty(label)) {
+ this.groups[label] = graphOptions;
+ }
+ this.amountOfGroups += 1;
+ }
+ };
+
+ Legend.prototype.updateGroup = function (label, graphOptions) {
+ this.groups[label] = graphOptions;
+ };
+
+ Legend.prototype.removeGroup = function (label) {
+ if (this.groups.hasOwnProperty(label)) {
+ delete this.groups[label];
+ this.amountOfGroups -= 1;
+ }
+ };
+
+ Legend.prototype._create = function () {
+ this.dom.frame = document.createElement('div');
+ this.dom.frame.className = 'vis-legend';
+ this.dom.frame.style.position = "absolute";
+ this.dom.frame.style.top = "10px";
+ this.dom.frame.style.display = "block";
+
+ this.dom.textArea = document.createElement('div');
+ this.dom.textArea.className = 'vis-legend-text';
+ this.dom.textArea.style.position = "relative";
+ this.dom.textArea.style.top = "0px";
+
+ this.svg = document.createElementNS('http://www.w3.org/2000/svg', "svg");
+ this.svg.style.position = 'absolute';
+ this.svg.style.top = 0 + 'px';
+ this.svg.style.width = this.options.iconSize + 5 + 'px';
+ this.svg.style.height = '100%';
+
+ this.dom.frame.appendChild(this.svg);
+ this.dom.frame.appendChild(this.dom.textArea);
+ };
+
+ /**
+ * Hide the component from the DOM
+ */
+ Legend.prototype.hide = function () {
+ // remove the frame containing the items
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+ };
+
+ /**
+ * Show the component in the DOM (when not already visible).
+ * @return {Boolean} changed
+ */
+ Legend.prototype.show = function () {
+ // show frame containing the items
+ if (!this.dom.frame.parentNode) {
+ this.body.dom.center.appendChild(this.dom.frame);
+ }
+ };
+
+ Legend.prototype.setOptions = function (options) {
+ var fields = ['enabled', 'orientation', 'icons', 'left', 'right'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ };
+
+ Legend.prototype.redraw = function () {
+ var activeGroups = 0;
+ var groupArray = Object.keys(this.groups);
+ groupArray.sort(function (a, b) {
+ return a < b ? -1 : 1;
+ });
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {
+ activeGroups++;
+ }
+ }
+
+ if (this.options[this.side].visible == false || this.amountOfGroups == 0 || this.options.enabled == false || activeGroups == 0) {
+ this.hide();
+ } else {
+ this.show();
+ if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'bottom-left') {
+ this.dom.frame.style.left = '4px';
+ this.dom.frame.style.textAlign = "left";
+ this.dom.textArea.style.textAlign = "left";
+ this.dom.textArea.style.left = this.options.iconSize + 15 + 'px';
+ this.dom.textArea.style.right = '';
+ this.svg.style.left = 0 + 'px';
+ this.svg.style.right = '';
+ } else {
+ this.dom.frame.style.right = '4px';
+ this.dom.frame.style.textAlign = "right";
+ this.dom.textArea.style.textAlign = "right";
+ this.dom.textArea.style.right = this.options.iconSize + 15 + 'px';
+ this.dom.textArea.style.left = '';
+ this.svg.style.right = 0 + 'px';
+ this.svg.style.left = '';
+ }
+
+ if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'top-right') {
+ this.dom.frame.style.top = 4 - Number(this.body.dom.center.style.top.replace("px", "")) + 'px';
+ this.dom.frame.style.bottom = '';
+ } else {
+ var scrollableHeight = this.body.domProps.center.height - this.body.domProps.centerContainer.height;
+ this.dom.frame.style.bottom = 4 + scrollableHeight + Number(this.body.dom.center.style.top.replace("px", "")) + 'px';
+ this.dom.frame.style.top = '';
+ }
+
+ if (this.options.icons == false) {
+ this.dom.frame.style.width = this.dom.textArea.offsetWidth + 10 + 'px';
+ this.dom.textArea.style.right = '';
+ this.dom.textArea.style.left = '';
+ this.svg.style.width = '0px';
+ } else {
+ this.dom.frame.style.width = this.options.iconSize + 15 + this.dom.textArea.offsetWidth + 10 + 'px';
+ this.drawLegendIcons();
+ }
+
+ var content = '';
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {
+ content += this.groups[groupId].content + '<br />';
+ }
+ }
+ this.dom.textArea.innerHTML = content;
+ this.dom.textArea.style.lineHeight = 0.75 * this.options.iconSize + this.options.iconSpacing + 'px';
+ }
+ };
+
+ Legend.prototype.drawLegendIcons = function () {
+ if (this.dom.frame.parentNode) {
+ var groupArray = Object.keys(this.groups);
+ groupArray.sort(function (a, b) {
+ return a < b ? -1 : 1;
+ });
+
+ // this resets the elements so the order is maintained
+ DOMutil.resetElements(this.svgElements);
+
+ var padding = window.getComputedStyle(this.dom.frame).paddingTop;
+ var iconOffset = Number(padding.replace('px', ''));
+ var x = iconOffset;
+ var iconWidth = this.options.iconSize;
+ var iconHeight = 0.75 * this.options.iconSize;
+ var y = iconOffset + 0.5 * iconHeight + 3;
+
+ this.svg.style.width = iconWidth + 5 + iconOffset + 'px';
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {
+ this.groups[groupId].getLegend(iconWidth, iconHeight, this.framework, x, y);
+ y += iconHeight + this.options.iconSpacing;
+ }
+ }
+ }
+ };
+
+ module.exports = Legend;
+
+/***/ },
+/* 59 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ /**
+ * This object contains all possible options. It will check if the types are correct, if required if the option is one
+ * of the allowed values.
+ *
+ * __any__ means that the name of the property does not matter.
+ * __type__ is a required field for all objects and contains the allowed types of all objects
+ */
+ var string = 'string';
+ var boolean = 'boolean';
+ var number = 'number';
+ var array = 'array';
+ var date = 'date';
+ var object = 'object'; // should only be in a __type__ property
+ var dom = 'dom';
+ var moment = 'moment';
+ var any = 'any';
+
+ var allOptions = {
+ configure: {
+ enabled: { boolean: boolean },
+ filter: { boolean: boolean, 'function': 'function' },
+ container: { dom: dom },
+ __type__: { object: object, boolean: boolean, 'function': 'function' }
+ },
+
+ //globals :
+ yAxisOrientation: { string: ['left', 'right'] },
+ defaultGroup: { string: string },
+ sort: { boolean: boolean },
+ sampling: { boolean: boolean },
+ stack: { boolean: boolean },
+ graphHeight: { string: string, number: number },
+ shaded: {
+ enabled: { boolean: boolean },
+ orientation: { string: ['bottom', 'top', 'zero', 'group'] }, // top, bottom, zero, group
+ groupId: { object: object },
+ __type__: { boolean: boolean, object: object }
+ },
+ style: { string: ['line', 'bar', 'points'] }, // line, bar
+ barChart: {
+ width: { number: number },
+ minWidth: { number: number },
+ sideBySide: { boolean: boolean },
+ align: { string: ['left', 'center', 'right'] },
+ __type__: { object: object }
+ },
+ interpolation: {
+ enabled: { boolean: boolean },
+ parametrization: { string: ['centripetal', 'chordal', 'uniform'] }, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
+ alpha: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ drawPoints: {
+ enabled: { boolean: boolean },
+ onRender: { 'function': 'function' },
+ size: { number: number },
+ style: { string: ['square', 'circle'] }, // square, circle
+ __type__: { object: object, boolean: boolean, 'function': 'function' }
+ },
+ dataAxis: {
+ showMinorLabels: { boolean: boolean },
+ showMajorLabels: { boolean: boolean },
+ icons: { boolean: boolean },
+ width: { string: string, number: number },
+ visible: { boolean: boolean },
+ alignZeros: { boolean: boolean },
+ left: {
+ range: { min: { number: number }, max: { number: number }, __type__: { object: object } },
+ format: { 'function': 'function' },
+ title: { text: { string: string, number: number }, style: { string: string }, __type__: { object: object } },
+ __type__: { object: object }
+ },
+ right: {
+ range: { min: { number: number }, max: { number: number }, __type__: { object: object } },
+ format: { 'function': 'function' },
+ title: { text: { string: string, number: number }, style: { string: string }, __type__: { object: object } },
+ __type__: { object: object }
+ },
+ __type__: { object: object }
+ },
+ legend: {
+ enabled: { boolean: boolean },
+ icons: { boolean: boolean },
+ left: {
+ visible: { boolean: boolean },
+ position: { string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] },
+ __type__: { object: object }
+ },
+ right: {
+ visible: { boolean: boolean },
+ position: { string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] },
+ __type__: { object: object }
+ },
+ __type__: { object: object, boolean: boolean }
+ },
+ groups: {
+ visibility: { any: any },
+ __type__: { object: object }
+ },
+
+ autoResize: { boolean: boolean },
+ throttleRedraw: { number: number },
+ clickToUse: { boolean: boolean },
+ end: { number: number, date: date, string: string, moment: moment },
+ format: {
+ minorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ majorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ __type__: { object: object }
+ },
+ moment: { 'function': 'function' },
+ height: { string: string, number: number },
+ hiddenDates: {
+ start: { date: date, number: number, string: string, moment: moment },
+ end: { date: date, number: number, string: string, moment: moment },
+ repeat: { string: string },
+ __type__: { object: object, array: array }
+ },
+ locale: { string: string },
+ locales: {
+ __any__: { any: any },
+ __type__: { object: object }
+ },
+ max: { date: date, number: number, string: string, moment: moment },
+ maxHeight: { number: number, string: string },
+ maxMinorChars: { number: number },
+ min: { date: date, number: number, string: string, moment: moment },
+ minHeight: { number: number, string: string },
+ moveable: { boolean: boolean },
+ multiselect: { boolean: boolean },
+ orientation: { string: string },
+ showCurrentTime: { boolean: boolean },
+ showMajorLabels: { boolean: boolean },
+ showMinorLabels: { boolean: boolean },
+ start: { date: date, number: number, string: string, moment: moment },
+ timeAxis: {
+ scale: { string: string, 'undefined': 'undefined' },
+ step: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ width: { string: string, number: number },
+ zoomable: { boolean: boolean },
+ zoomKey: { string: ['ctrlKey', 'altKey', 'metaKey', ''] },
+ zoomMax: { number: number },
+ zoomMin: { number: number },
+ zIndex: { number: number },
+ __type__: { object: object }
+ };
+
+ var configureOptions = {
+ global: {
+ //yAxisOrientation: ['left','right'], // TDOO: enable as soon as Grahp2d doesn't crash when changing this on the fly
+ sort: true,
+ sampling: true,
+ stack: false,
+ shaded: {
+ enabled: false,
+ orientation: ['zero', 'top', 'bottom', 'group'] // zero, top, bottom
+ },
+ style: ['line', 'bar', 'points'], // line, bar
+ barChart: {
+ width: [50, 5, 100, 5],
+ minWidth: [50, 5, 100, 5],
+ sideBySide: false,
+ align: ['left', 'center', 'right'] // left, center, right
+ },
+ interpolation: {
+ enabled: true,
+ parametrization: ['centripetal', 'chordal', 'uniform'] // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
+ },
+ drawPoints: {
+ enabled: true,
+ size: [6, 2, 30, 1],
+ style: ['square', 'circle'] // square, circle
+ },
+ dataAxis: {
+ showMinorLabels: true,
+ showMajorLabels: true,
+ icons: false,
+ width: [40, 0, 200, 1],
+ visible: true,
+ alignZeros: true,
+ left: {
+ //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},
+ //format: function (value) {return value;},
+ title: { text: '', style: '' }
+ },
+ right: {
+ //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},
+ //format: function (value) {return value;},
+ title: { text: '', style: '' }
+ }
+ },
+ legend: {
+ enabled: false,
+ icons: true,
+ left: {
+ visible: true,
+ position: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] // top/bottom - left,right
+ },
+ right: {
+ visible: true,
+ position: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] // top/bottom - left,right
+ }
+ },
+
+ autoResize: true,
+ throttleRedraw: [10, 0, 1000, 10],
+ clickToUse: false,
+ end: '',
+ format: {
+ minorLabels: {
+ millisecond: 'SSS',
+ second: 's',
+ minute: 'HH:mm',
+ hour: 'HH:mm',
+ weekday: 'ddd D',
+ day: 'D',
+ month: 'MMM',
+ year: 'YYYY'
+ },
+ majorLabels: {
+ millisecond: 'HH:mm:ss',
+ second: 'D MMMM HH:mm',
+ minute: 'ddd D MMMM',
+ hour: 'ddd D MMMM',
+ weekday: 'MMMM YYYY',
+ day: 'MMMM YYYY',
+ month: 'YYYY',
+ year: ''
+ }
+ },
+
+ height: '',
+ locale: '',
+ max: '',
+ maxHeight: '',
+ maxMinorChars: [7, 0, 20, 1],
+ min: '',
+ minHeight: '',
+ moveable: true,
+ orientation: ['both', 'bottom', 'top'],
+ showCurrentTime: false,
+ showMajorLabels: true,
+ showMinorLabels: true,
+ start: '',
+ width: '100%',
+ zoomable: true,
+ zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],
+ zoomMax: [315360000000000, 10, 315360000000000, 1],
+ zoomMin: [10, 10, 315360000000000, 1],
+ zIndex: 0
+ }
+ };
+
+ exports.allOptions = allOptions;
+ exports.configureOptions = configureOptions;
+
+/***/ },
+/* 60 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ // utils
+ exports.util = __webpack_require__(1);
+ exports.DOMutil = __webpack_require__(8);
+
+ // data
+ exports.DataSet = __webpack_require__(9);
+ exports.DataView = __webpack_require__(11);
+ exports.Queue = __webpack_require__(10);
+
+ // Network
+ exports.Network = __webpack_require__(61);
+ exports.network = {
+ Images: __webpack_require__(62),
+ dotparser: __webpack_require__(118),
+ gephiParser: __webpack_require__(119),
+ allOptions: __webpack_require__(114)
+ };
+ exports.network.convertDot = function (input) {
+ return exports.network.dotparser.DOTToGraph(input);
+ };
+ exports.network.convertGephi = function (input, options) {
+ return exports.network.gephiParser.parseGephi(input, options);
+ };
+
+ // bundled external libraries
+ exports.moment = __webpack_require__(2);
+ exports.Hammer = __webpack_require__(20);
+ exports.keycharm = __webpack_require__(23);
+
+/***/ },
+/* 61 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _Images = __webpack_require__(62);
+
+ var _Images2 = _interopRequireDefault(_Images);
+
+ var _Groups = __webpack_require__(63);
+
+ var _Groups2 = _interopRequireDefault(_Groups);
+
+ var _NodesHandler = __webpack_require__(64);
+
+ var _NodesHandler2 = _interopRequireDefault(_NodesHandler);
+
+ var _EdgesHandler = __webpack_require__(84);
+
+ var _EdgesHandler2 = _interopRequireDefault(_EdgesHandler);
+
+ var _PhysicsEngine = __webpack_require__(93);
+
+ var _PhysicsEngine2 = _interopRequireDefault(_PhysicsEngine);
+
+ var _Clustering = __webpack_require__(102);
+
+ var _Clustering2 = _interopRequireDefault(_Clustering);
+
+ var _CanvasRenderer = __webpack_require__(105);
+
+ var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
+
+ var _Canvas = __webpack_require__(106);
+
+ var _Canvas2 = _interopRequireDefault(_Canvas);
+
+ var _View = __webpack_require__(107);
+
+ var _View2 = _interopRequireDefault(_View);
+
+ var _InteractionHandler = __webpack_require__(108);
+
+ var _InteractionHandler2 = _interopRequireDefault(_InteractionHandler);
+
+ var _SelectionHandler = __webpack_require__(111);
+
+ var _SelectionHandler2 = _interopRequireDefault(_SelectionHandler);
+
+ var _LayoutEngine = __webpack_require__(112);
+
+ var _LayoutEngine2 = _interopRequireDefault(_LayoutEngine);
+
+ var _ManipulationSystem = __webpack_require__(113);
+
+ var _ManipulationSystem2 = _interopRequireDefault(_ManipulationSystem);
+
+ var _Configurator = __webpack_require__(26);
+
+ var _Configurator2 = _interopRequireDefault(_Configurator);
+
+ var _Validator = __webpack_require__(29);
+
+ var _Validator2 = _interopRequireDefault(_Validator);
+
+ var _options = __webpack_require__(114);
+
+ var _KamadaKawai = __webpack_require__(115);
+
+ var _KamadaKawai2 = _interopRequireDefault(_KamadaKawai);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ // Load custom shapes into CanvasRenderingContext2D
+ __webpack_require__(117);
+
+ var Emitter = __webpack_require__(13);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+ var dotparser = __webpack_require__(118);
+ var gephiParser = __webpack_require__(119);
+ var Activator = __webpack_require__(45);
+ var locales = __webpack_require__(120);
+
+ /**
+ * @constructor Network
+ * Create a network visualization, displaying nodes and edges.
+ *
+ * @param {Element} container The DOM element in which the Network will
+ * be created. Normally a div element.
+ * @param {Object} data An object containing parameters
+ * {Array} nodes
+ * {Array} edges
+ * @param {Object} options Options
+ */
+ function Network(container, data, options) {
+ var _this = this;
+
+ if (!(this instanceof Network)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ // set constant values
+ this.options = {};
+ this.defaultOptions = {
+ locale: 'en',
+ locales: locales,
+ clickToUse: false
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ // containers for nodes and edges
+ this.body = {
+ container: container,
+ 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 onTap() {},
+ onTouch: function onTouch() {},
+ onDoubleTap: function onDoubleTap() {},
+ onHold: function onHold() {},
+ onDragStart: function onDragStart() {},
+ onDrag: function onDrag() {},
+ onDragEnd: function onDragEnd() {},
+ onMouseWheel: function onMouseWheel() {},
+ onPinch: function onPinch() {},
+ onMouseMove: function onMouseMove() {},
+ onRelease: function onRelease() {},
+ onContext: function onContext() {}
+ },
+ data: {
+ nodes: null, // A DataSet or DataView
+ edges: null // A DataSet or DataView
+ },
+ functions: {
+ createNode: function createNode() {},
+ createEdge: function createEdge() {},
+ getPointer: function getPointer() {}
+ },
+ modules: {},
+ view: {
+ scale: 1,
+ translation: { x: 0, y: 0 }
+ }
+ };
+
+ // bind the event listeners
+ this.bindEventListeners();
+
+ // setting up all modules
+ this.images = new _Images2.default(function () {
+ return _this.body.emitter.emit("_requestRedraw");
+ }); // object with images
+ this.groups = new _Groups2.default(); // object with groups
+ this.canvas = new _Canvas2.default(this.body); // DOM handler
+ this.selectionHandler = new _SelectionHandler2.default(this.body, this.canvas); // Selection handler
+ this.interactionHandler = new _InteractionHandler2.default(this.body, this.canvas, this.selectionHandler); // Interaction handler handles all the hammer bindings (that are bound by canvas), key
+ this.view = new _View2.default(this.body, this.canvas); // camera handler, does animations and zooms
+ this.renderer = new _CanvasRenderer2.default(this.body, this.canvas); // renderer, starts renderloop, has events that modules can hook into
+ this.physics = new _PhysicsEngine2.default(this.body); // physics engine, does all the simulations
+ this.layoutEngine = new _LayoutEngine2.default(this.body); // layout engine for inital layout and hierarchical layout
+ this.clustering = new _Clustering2.default(this.body); // clustering api
+ this.manipulation = new _ManipulationSystem2.default(this.body, this.canvas, this.selectionHandler); // data manipulation system
+
+ this.nodesHandler = new _NodesHandler2.default(this.body, this.images, this.groups, this.layoutEngine); // Handle adding, deleting and updating of nodes as well as global options
+ this.edgesHandler = new _EdgesHandler2.default(this.body, this.images, this.groups); // Handle adding, deleting and updating of edges as well as global options
+
+ this.body.modules["kamadaKawai"] = new _KamadaKawai2.default(this.body, 150, 0.05); // Layouting algorithm.
+ this.body.modules["clustering"] = this.clustering;
+
+ // create the DOM elements
+ this.canvas._create();
+
+ // apply options
+ this.setOptions(options);
+
+ // load data (the disable start variable will be the same as the enabled clustering)
+ this.setData(data);
+ }
+
+ // Extend Network with an Emitter mixin
+ Emitter(Network.prototype);
+
+ /**
+ * Set options
+ * @param {Object} options
+ */
+ Network.prototype.setOptions = function (options) {
+ var _this2 = this;
+
+ if (options !== undefined) {
+ var errorFound = _Validator2.default.validate(options, _options.allOptions);
+ if (errorFound === true) {
+ console.log('%cErrors have been found in the supplied options object.', _Validator.printStyle);
+ }
+
+ // copy the global fields over
+ var fields = ['locale', 'locales', 'clickToUse'];
+ util.selectiveDeepExtend(fields, this.options, options);
+
+ // the hierarchical system can adapt the edges and the physics to it's own options because not all combinations work with the hierarichical system.
+ options = this.layoutEngine.setOptions(options.layout, options);
+
+ this.canvas.setOptions(options); // options for canvas are in globals
+
+ // pass the options to the modules
+ this.groups.setOptions(options.groups);
+ this.nodesHandler.setOptions(options.nodes);
+ this.edgesHandler.setOptions(options.edges);
+ this.physics.setOptions(options.physics);
+ this.manipulation.setOptions(options.manipulation, options, this.options); // manipulation uses the locales in the globals
+
+ this.interactionHandler.setOptions(options.interaction);
+ this.renderer.setOptions(options.interaction); // options for rendering are in interaction
+ this.selectionHandler.setOptions(options.interaction); // options for selection are in interaction
+
+ // reload the settings of the nodes to apply changes in groups that are not referenced by pointer.
+ if (options.groups !== undefined) {
+ this.body.emitter.emit("refreshNodes");
+ }
+ // these two do not have options at the moment, here for completeness
+ //this.view.setOptions(options.view);
+ //this.clustering.setOptions(options.clustering);
+
+ if ('configure' in options) {
+ if (!this.configurator) {
+ this.configurator = new _Configurator2.default(this, this.body.container, _options.configureOptions, this.canvas.pixelRatio);
+ }
+
+ this.configurator.setOptions(options.configure);
+ }
+
+ // if the configuration system is enabled, copy all options and put them into the config system
+ if (this.configurator && this.configurator.options.enabled === true) {
+ var networkOptions = { nodes: {}, edges: {}, layout: {}, interaction: {}, manipulation: {}, physics: {}, global: {} };
+ util.deepExtend(networkOptions.nodes, this.nodesHandler.options);
+ util.deepExtend(networkOptions.edges, this.edgesHandler.options);
+ util.deepExtend(networkOptions.layout, this.layoutEngine.options);
+ // load the selectionHandler and render default options in to the interaction group
+ util.deepExtend(networkOptions.interaction, this.selectionHandler.options);
+ util.deepExtend(networkOptions.interaction, this.renderer.options);
+
+ util.deepExtend(networkOptions.interaction, this.interactionHandler.options);
+ util.deepExtend(networkOptions.manipulation, this.manipulation.options);
+ util.deepExtend(networkOptions.physics, this.physics.options);
+
+ // load globals into the global object
+ util.deepExtend(networkOptions.global, this.canvas.options);
+ util.deepExtend(networkOptions.global, this.options);
+
+ this.configurator.setModuleOptions(networkOptions);
+ }
+
+ // handle network global options
+ if (options.clickToUse !== undefined) {
+ if (options.clickToUse === true) {
+ if (this.activator === undefined) {
+ this.activator = new Activator(this.canvas.frame);
+ this.activator.on('change', function () {
+ _this2.body.emitter.emit("activate");
+ });
+ }
+ } else {
+ if (this.activator !== undefined) {
+ this.activator.destroy();
+ delete this.activator;
+ }
+ this.body.emitter.emit("activate");
+ }
+ } else {
+ this.body.emitter.emit("activate");
+ }
+
+ this.canvas.setSize();
+ // start the physics simulation. Can be safely called multiple times.
+ this.body.emitter.emit("startSimulation");
+ }
+ };
+
+ /**
+ * Update the this.body.nodeIndices with the most recent node index list
+ * @private
+ */
+ Network.prototype._updateVisibleIndices = function () {
+ var nodes = this.body.nodes;
+ var edges = this.body.edges;
+ this.body.nodeIndices = [];
+ this.body.edgeIndices = [];
+
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ if (nodes[nodeId].options.hidden === false) {
+ this.body.nodeIndices.push(nodes[nodeId].id);
+ }
+ }
+ }
+
+ for (var edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ if (edges[edgeId].options.hidden === false) {
+ this.body.edgeIndices.push(edges[edgeId].id);
+ }
+ }
+ }
+ };
+
+ /**
+ * Bind all events
+ */
+ Network.prototype.bindEventListeners = function () {
+ var _this3 = this;
+
+ // this event will trigger a rebuilding of the cache everything. Used when nodes or edges have been added or removed.
+ this.body.emitter.on("_dataChanged", function () {
+ // update shortcut lists
+ _this3._updateVisibleIndices();
+ _this3.body.emitter.emit("_requestRedraw");
+ // call the dataUpdated event because the only difference between the two is the updating of the indices
+ _this3.body.emitter.emit("_dataUpdated");
+ });
+
+ // this is called when options of EXISTING nodes or edges have changed.
+ this.body.emitter.on("_dataUpdated", function () {
+ // update values
+ _this3._updateValueRange(_this3.body.nodes);
+ _this3._updateValueRange(_this3.body.edges);
+ // start simulation (can be called safely, even if already running)
+ _this3.body.emitter.emit("startSimulation");
+ _this3.body.emitter.emit("_requestRedraw");
+ });
+ };
+
+ /**
+ * Set nodes and edges, and optionally options as well.
+ *
+ * @param {Object} data Object containing parameters:
+ * {Array | DataSet | DataView} [nodes] Array with nodes
+ * {Array | DataSet | DataView} [edges] Array with edges
+ * {String} [dot] String containing data in DOT format
+ * {String} [gephi] String containing data in gephi JSON format
+ * {Options} [options] Object with options
+ */
+ Network.prototype.setData = function (data) {
+ // reset the physics engine.
+ this.body.emitter.emit("resetPhysics");
+ this.body.emitter.emit("_resetData");
+
+ // unselect all to ensure no selections from old data are carried over.
+ this.selectionHandler.unselectAll();
+
+ if (data && data.dot && (data.nodes || data.edges)) {
+ throw new SyntaxError('Data must contain either parameter "dot" or ' + ' parameter pair "nodes" and "edges", but not both.');
+ }
+
+ // set options
+ this.setOptions(data && data.options);
+ // set all data
+ if (data && data.dot) {
+ console.log('The dot property has been depricated. 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);');
+ // parse DOT file
+ var dotData = dotparser.DOTToGraph(data.dot);
+ this.setData(dotData);
+ return;
+ } else if (data && data.gephi) {
+ // parse DOT file
+ console.log('The gephi property has been depricated. 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 gephiData = gephiParser.parseGephi(data.gephi);
+ this.setData(gephiData);
+ return;
+ } else {
+ this.nodesHandler.setData(data && data.nodes, true);
+ this.edgesHandler.setData(data && data.edges, true);
+ }
+
+ // emit change in data
+ this.body.emitter.emit("_dataChanged");
+
+ // emit data loaded
+ this.body.emitter.emit("_dataLoaded");
+
+ // find a stable position or start animating to a stable position
+ this.body.emitter.emit("initPhysics");
+ };
+
+ /**
+ * Cleans up all bindings of the network, removing it fully from the memory IF the variable is set to null after calling this function.
+ * var network = new vis.Network(..);
+ * network.destroy();
+ * network = null;
+ */
+ Network.prototype.destroy = function () {
+ this.body.emitter.emit("destroy");
+ // clear events
+ this.body.emitter.off();
+ this.off();
+
+ // delete modules
+ 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;
+
+ for (var nodeId in this.body.nodes) {
+ delete this.body.nodes[nodeId];
+ }
+ for (var edgeId in this.body.edges) {
+ delete this.body.edges[edgeId];
+ }
+
+ // remove the container and everything inside it recursively
+ util.recursiveDOMDelete(this.body.container);
+ };
+
+ /**
+ * Update the values of all object in the given array according to the current
+ * value range of the objects in the array.
+ * @param {Object} obj An object containing a set of Edges or Nodes
+ * The objects must have a method getValue() and
+ * setValueRange(min, max).
+ * @private
+ */
+ Network.prototype._updateValueRange = function (obj) {
+ var id;
+
+ // determine the range of the objects
+ var valueMin = undefined;
+ var valueMax = undefined;
+ var valueTotal = 0;
+ for (id in obj) {
+ if (obj.hasOwnProperty(id)) {
+ var value = obj[id].getValue();
+ if (value !== undefined) {
+ valueMin = valueMin === undefined ? value : Math.min(value, valueMin);
+ valueMax = valueMax === undefined ? value : Math.max(value, valueMax);
+ valueTotal += value;
+ }
+ }
+ }
+
+ // adjust the range of all objects
+ if (valueMin !== undefined && valueMax !== undefined) {
+ for (id in obj) {
+ if (obj.hasOwnProperty(id)) {
+ obj[id].setValueRange(valueMin, valueMax, valueTotal);
+ }
+ }
+ }
+ };
+
+ /**
+ * Returns true when the Network is active.
+ * @returns {boolean}
+ */
+ Network.prototype.isActive = function () {
+ return !this.activator || this.activator.active;
+ };
+
+ Network.prototype.setSize = function () {
+ return this.canvas.setSize.apply(this.canvas, arguments);
+ };
+ Network.prototype.canvasToDOM = function () {
+ return this.canvas.canvasToDOM.apply(this.canvas, arguments);
+ };
+ Network.prototype.DOMtoCanvas = function () {
+ return this.canvas.DOMtoCanvas.apply(this.canvas, arguments);
+ };
+ Network.prototype.findNode = function () {
+ return this.clustering.findNode.apply(this.clustering, arguments);
+ };
+ Network.prototype.isCluster = function () {
+ return this.clustering.isCluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.openCluster = function () {
+ return this.clustering.openCluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.cluster = function () {
+ return this.clustering.cluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.getNodesInCluster = function () {
+ return this.clustering.getNodesInCluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.clusterByConnection = function () {
+ return this.clustering.clusterByConnection.apply(this.clustering, arguments);
+ };
+ Network.prototype.clusterByHubsize = function () {
+ return this.clustering.clusterByHubsize.apply(this.clustering, arguments);
+ };
+ Network.prototype.clusterOutliers = function () {
+ return this.clustering.clusterOutliers.apply(this.clustering, arguments);
+ };
+ Network.prototype.getSeed = function () {
+ return this.layoutEngine.getSeed.apply(this.layoutEngine, arguments);
+ };
+ Network.prototype.enableEditMode = function () {
+ return this.manipulation.enableEditMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.disableEditMode = function () {
+ return this.manipulation.disableEditMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.addNodeMode = function () {
+ return this.manipulation.addNodeMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.editNode = function () {
+ return this.manipulation.editNode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.editNodeMode = function () {
+ console.log("Deprecated: Please use editNode instead of editNodeMode.");return this.manipulation.editNode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.addEdgeMode = function () {
+ return this.manipulation.addEdgeMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.editEdgeMode = function () {
+ return this.manipulation.editEdgeMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.deleteSelected = function () {
+ return this.manipulation.deleteSelected.apply(this.manipulation, arguments);
+ };
+ Network.prototype.getPositions = function () {
+ return this.nodesHandler.getPositions.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.storePositions = function () {
+ return this.nodesHandler.storePositions.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.moveNode = function () {
+ return this.nodesHandler.moveNode.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.getBoundingBox = function () {
+ return this.nodesHandler.getBoundingBox.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.getConnectedNodes = function (objectId) {
+ if (this.body.nodes[objectId] !== undefined) {
+ return this.nodesHandler.getConnectedNodes.apply(this.nodesHandler, arguments);
+ } else {
+ return this.edgesHandler.getConnectedNodes.apply(this.edgesHandler, arguments);
+ }
+ };
+ Network.prototype.getConnectedEdges = function () {
+ return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.startSimulation = function () {
+ return this.physics.startSimulation.apply(this.physics, arguments);
+ };
+ Network.prototype.stopSimulation = function () {
+ return this.physics.stopSimulation.apply(this.physics, arguments);
+ };
+ Network.prototype.stabilize = function () {
+ return this.physics.stabilize.apply(this.physics, arguments);
+ };
+ Network.prototype.getSelection = function () {
+ return this.selectionHandler.getSelection.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.setSelection = function () {
+ return this.selectionHandler.setSelection.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.getSelectedNodes = function () {
+ return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.getSelectedEdges = function () {
+ return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.getNodeAt = function () {
+ var node = this.selectionHandler.getNodeAt.apply(this.selectionHandler, arguments);
+ if (node !== undefined && node.id !== undefined) {
+ return node.id;
+ }
+ return node;
+ };
+ Network.prototype.getEdgeAt = function () {
+ var edge = this.selectionHandler.getEdgeAt.apply(this.selectionHandler, arguments);
+ if (edge !== undefined && edge.id !== undefined) {
+ return edge.id;
+ }
+ return edge;
+ };
+ Network.prototype.selectNodes = function () {
+ return this.selectionHandler.selectNodes.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.selectEdges = function () {
+ return this.selectionHandler.selectEdges.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.unselectAll = function () {
+ this.selectionHandler.unselectAll.apply(this.selectionHandler, arguments);
+ this.redraw();
+ };
+ Network.prototype.redraw = function () {
+ return this.renderer.redraw.apply(this.renderer, arguments);
+ };
+ Network.prototype.getScale = function () {
+ return this.view.getScale.apply(this.view, arguments);
+ };
+ Network.prototype.getViewPosition = function () {
+ return this.view.getViewPosition.apply(this.view, arguments);
+ };
+ Network.prototype.fit = function () {
+ return this.view.fit.apply(this.view, arguments);
+ };
+ Network.prototype.moveTo = function () {
+ return this.view.moveTo.apply(this.view, arguments);
+ };
+ Network.prototype.focus = function () {
+ return this.view.focus.apply(this.view, arguments);
+ };
+ Network.prototype.releaseNode = function () {
+ return this.view.releaseNode.apply(this.view, arguments);
+ };
+ Network.prototype.getOptionsFromConfigurator = function () {
+ var options = {};
+ if (this.configurator) {
+ options = this.configurator.getOptions.apply(this.configurator);
+ }
+ return options;
+ };
+
+ module.exports = Network;
+
+/***/ },
+/* 62 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ /**
+ * @class Images
+ * This class loads images and keeps them stored.
+ */
+
+ var Images = function () {
+ function Images(callback) {
+ _classCallCheck(this, Images);
+
+ this.images = {};
+ this.imageBroken = {};
+ this.callback = callback;
+ }
+
+ /**
+ * @param {string} url The Url to cache the image as
+ * @return {Image} imageToLoadBrokenUrlOn The image object
+ */
+
+
+ _createClass(Images, [{
+ key: "_addImageToCache",
+ value: function _addImageToCache(url, imageToCache) {
+ // IE11 fix -- thanks dponch!
+ if (imageToCache.width === 0) {
+ document.body.appendChild(imageToCache);
+ imageToCache.width = imageToCache.offsetWidth;
+ imageToCache.height = imageToCache.offsetHeight;
+ document.body.removeChild(imageToCache);
+ }
+
+ this.images[url] = imageToCache;
+ }
+
+ /**
+ * @param {string} url The original Url that failed to load, if the broken image is successfully loaded it will be added to the cache using this Url as the key so that subsequent requests for this Url will return the broken image
+ * @param {string} brokenUrl Url the broken image to try and load
+ * @return {Image} imageToLoadBrokenUrlOn The image object
+ */
+
+ }, {
+ key: "_tryloadBrokenUrl",
+ value: function _tryloadBrokenUrl(url, brokenUrl, imageToLoadBrokenUrlOn) {
+ var _this = this;
+
+ //If any of the parameters aren't specified then exit the function because nothing constructive can be done
+ if (url === undefined || brokenUrl === undefined || imageToLoadBrokenUrlOn === undefined) return;
+
+ //Clear the old subscription to the error event and put a new in place that only handle errors in loading the brokenImageUrl
+ imageToLoadBrokenUrlOn.onerror = function () {
+ console.error("Could not load brokenImage:", brokenUrl);
+ //Add an empty image to the cache so that when subsequent load calls are made for the url we don't try load the image and broken image again
+ _this._addImageToCache(url, new Image());
+ };
+
+ //Set the source of the image to the brokenUrl, this is actually what kicks off the loading of the broken image
+ imageToLoadBrokenUrlOn.src = brokenUrl;
+ }
+
+ /**
+ * @return {Image} imageToRedrawWith The images that will be passed to the callback when it is invoked
+ */
+
+ }, {
+ key: "_redrawWithImage",
+ value: function _redrawWithImage(imageToRedrawWith) {
+ if (this.callback) {
+ this.callback(imageToRedrawWith);
+ }
+ }
+
+ /**
+ * @param {string} url Url of the image
+ * @param {string} brokenUrl Url of an image to use if the url image is not found
+ * @return {Image} img The image object
+ */
+
+ }, {
+ key: "load",
+ value: function load(url, brokenUrl, id) {
+ var _this2 = this;
+
+ //Try and get the image from the cache, if successful then return the cached image
+ var cachedImage = this.images[url];
+ if (cachedImage) return cachedImage;
+
+ //Create a new image
+ var img = new Image();
+
+ //Subscribe to the event that is raised if the image loads successfully
+ img.onload = function () {
+ //Add the image to the cache and then request a redraw
+ _this2._addImageToCache(url, img);
+ _this2._redrawWithImage(img);
+ };
+
+ //Subscribe to the event that is raised if the image fails to load
+ img.onerror = function () {
+ console.error("Could not load image:", url);
+ //Try and load the image specified by the brokenUrl using
+ _this2._tryloadBrokenUrl(url, brokenUrl, img);
+ };
+
+ //Set the source of the image to the url, this is actuall what kicks off the loading of the image
+ img.src = url;
+
+ //Return the new image
+ return img;
+ }
+ }]);
+
+ return Images;
+ }();
+
+ exports.default = Images;
+
+/***/ },
+/* 63 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @class Groups
+ * This class can store groups and options specific for groups.
+ */
+
+ var Groups = function () {
+ function Groups() {
+ _classCallCheck(this, Groups);
+
+ 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" } }, // 0: blue
+ { border: "#FFA500", background: "#FFFF00", highlight: { border: "#FFA500", background: "#FFFFA3" }, hover: { border: "#FFA500", background: "#FFFFA3" } }, // 1: yellow
+ { border: "#FA0A10", background: "#FB7E81", highlight: { border: "#FA0A10", background: "#FFAFB1" }, hover: { border: "#FA0A10", background: "#FFAFB1" } }, // 2: red
+ { border: "#41A906", background: "#7BE141", highlight: { border: "#41A906", background: "#A1EC76" }, hover: { border: "#41A906", background: "#A1EC76" } }, // 3: green
+ { border: "#E129F0", background: "#EB7DF4", highlight: { border: "#E129F0", background: "#F0B3F5" }, hover: { border: "#E129F0", background: "#F0B3F5" } }, // 4: magenta
+ { border: "#7C29F0", background: "#AD85E4", highlight: { border: "#7C29F0", background: "#D3BDF0" }, hover: { border: "#7C29F0", background: "#D3BDF0" } }, // 5: purple
+ { border: "#C37F00", background: "#FFA807", highlight: { border: "#C37F00", background: "#FFCA66" }, hover: { border: "#C37F00", background: "#FFCA66" } }, // 6: orange
+ { border: "#4220FB", background: "#6E6EFD", highlight: { border: "#4220FB", background: "#9B9BFD" }, hover: { border: "#4220FB", background: "#9B9BFD" } }, // 7: darkblue
+ { border: "#FD5A77", background: "#FFC0CB", highlight: { border: "#FD5A77", background: "#FFD1D9" }, hover: { border: "#FD5A77", background: "#FFD1D9" } }, // 8: pink
+ { border: "#4AD63A", background: "#C2FABC", highlight: { border: "#4AD63A", background: "#E6FFE3" }, hover: { border: "#4AD63A", background: "#E6FFE3" } }, // 9: mint
+
+ { border: "#990000", background: "#EE0000", highlight: { border: "#BB0000", background: "#FF3333" }, hover: { border: "#BB0000", background: "#FF3333" } }, // 10:bright red
+
+ { border: "#FF6000", background: "#FF6000", highlight: { border: "#FF6000", background: "#FF6000" }, hover: { border: "#FF6000", background: "#FF6000" } }, // 12: real orange
+ { border: "#97C2FC", background: "#2B7CE9", highlight: { border: "#D2E5FF", background: "#2B7CE9" }, hover: { border: "#D2E5FF", background: "#2B7CE9" } }, // 13: blue
+ { border: "#399605", background: "#255C03", highlight: { border: "#399605", background: "#255C03" }, hover: { border: "#399605", background: "#255C03" } }, // 14: green
+ { border: "#B70054", background: "#FF007E", highlight: { border: "#B70054", background: "#FF007E" }, hover: { border: "#B70054", background: "#FF007E" } }, // 15: magenta
+ { border: "#AD85E4", background: "#7C29F0", highlight: { border: "#D3BDF0", background: "#7C29F0" }, hover: { border: "#D3BDF0", background: "#7C29F0" } }, // 16: purple
+ { border: "#4557FA", background: "#000EA1", highlight: { border: "#6E6EFD", background: "#000EA1" }, hover: { border: "#6E6EFD", background: "#000EA1" } }, // 17: darkblue
+ { border: "#FFC0CB", background: "#FD5A77", highlight: { border: "#FFD1D9", background: "#FD5A77" }, hover: { border: "#FFD1D9", background: "#FD5A77" } }, // 18: pink
+ { border: "#C2FABC", background: "#74D66A", highlight: { border: "#E6FFE3", background: "#74D66A" }, hover: { border: "#E6FFE3", background: "#74D66A" } }, // 19: mint
+
+ { border: "#EE0000", background: "#990000", highlight: { border: "#FF3333", background: "#BB0000" }, hover: { border: "#FF3333", background: "#BB0000" } } // 20:bright red
+ ];
+
+ this.options = {};
+ this.defaultOptions = {
+ useDefaultGroups: true
+ };
+ util.extend(this.options, this.defaultOptions);
+ }
+
+ _createClass(Groups, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ var optionFields = ['useDefaultGroups'];
+
+ if (options !== undefined) {
+ for (var groupName in options) {
+ if (options.hasOwnProperty(groupName)) {
+ if (optionFields.indexOf(groupName) === -1) {
+ var group = options[groupName];
+ this.add(groupName, group);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Clear all groups
+ */
+
+ }, {
+ key: "clear",
+ value: function clear() {
+ this.groups = {};
+ this.groupsArray = [];
+ }
+
+ /**
+ * get group options of a groupname. If groupname is not found, a new group
+ * is added.
+ * @param {*} groupname Can be a number, string, Date, etc.
+ * @return {Object} group The created group, containing all group options
+ */
+
+ }, {
+ key: "get",
+ value: function get(groupname) {
+ var group = this.groups[groupname];
+ if (group === undefined) {
+ if (this.options.useDefaultGroups === false && this.groupsArray.length > 0) {
+ // create new group
+ var index = this.groupIndex % this.groupsArray.length;
+ this.groupIndex++;
+ group = {};
+ group.color = this.groups[this.groupsArray[index]];
+ this.groups[groupname] = group;
+ } else {
+ // create new group
+ var _index = this.defaultIndex % this.defaultGroups.length;
+ this.defaultIndex++;
+ group = {};
+ group.color = this.defaultGroups[_index];
+ this.groups[groupname] = group;
+ }
+ }
+
+ return group;
+ }
+
+ /**
+ * Add a custom group style
+ * @param {String} groupName
+ * @param {Object} style An object containing borderColor,
+ * backgroundColor, etc.
+ * @return {Object} group The created group object
+ */
+
+ }, {
+ key: "add",
+ value: function add(groupName, style) {
+ this.groups[groupName] = style;
+ this.groupsArray.push(groupName);
+ return style;
+ }
+ }]);
+
+ return Groups;
+ }();
+
+ exports.default = Groups;
+
+/***/ },
+/* 64 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _Node = __webpack_require__(65);
+
+ var _Node2 = _interopRequireDefault(_Node);
+
+ var _Label = __webpack_require__(66);
+
+ var _Label2 = _interopRequireDefault(_Label);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+
+ var NodesHandler = function () {
+ function NodesHandler(body, images, groups, layoutEngine) {
+ var _this = this;
+
+ _classCallCheck(this, NodesHandler);
+
+ this.body = body;
+ this.images = images;
+ this.groups = groups;
+ this.layoutEngine = layoutEngine;
+
+ // create the node API in the body container
+ this.body.functions.createNode = this.create.bind(this);
+
+ this.nodesListeners = {
+ add: function add(event, params) {
+ _this.add(params.items);
+ },
+ update: function update(event, params) {
+ _this.update(params.items, params.data);
+ },
+ remove: function remove(event, params) {
+ _this.remove(params.items);
+ }
+ };
+
+ this.options = {};
+ this.defaultOptions = {
+ borderWidth: 1,
+ borderWidthSelected: 2,
+ brokenImage: undefined,
+ color: {
+ border: '#2B7CE9',
+ background: '#97C2FC',
+ highlight: {
+ border: '#2B7CE9',
+ background: '#D2E5FF'
+ },
+ hover: {
+ border: '#2B7CE9',
+ background: '#D2E5FF'
+ }
+ },
+ fixed: {
+ x: false,
+ y: false
+ },
+ font: {
+ color: '#343434',
+ size: 14, // px
+ face: 'arial',
+ background: 'none',
+ strokeWidth: 0, // px
+ strokeColor: '#ffffff',
+ align: 'center'
+ },
+ group: undefined,
+ hidden: false,
+ icon: {
+ face: 'FontAwesome', //'FontAwesome',
+ code: undefined, //'\uf007',
+ size: 50, //50,
+ color: '#2B7CE9' //'#aa00ff'
+ },
+ image: undefined, // --> URL
+ label: undefined,
+ labelHighlightBold: true,
+ level: undefined,
+ mass: 1,
+ physics: true,
+ scaling: {
+ min: 10,
+ max: 30,
+ label: {
+ enabled: false,
+ min: 14,
+ max: 30,
+ maxVisible: 30,
+ drawThreshold: 5
+ },
+ customScalingFunction: function customScalingFunction(min, max, total, value) {
+ if (max === min) {
+ return 0.5;
+ } else {
+ var scale = 1 / (max - min);
+ return Math.max(0, (value - min) * scale);
+ }
+ }
+ },
+ shadow: {
+ enabled: false,
+ color: 'rgba(0,0,0,0.5)',
+ size: 10,
+ x: 5,
+ y: 5
+ },
+ shape: 'ellipse',
+ shapeProperties: {
+ borderDashes: false, // only for borders
+ borderRadius: 6, // only for box shape
+ interpolation: true, // only for image and circularImage shapes
+ useImageSize: false, // only for image and circularImage shapes
+ useBorderWithImage: false // only for image shape
+ },
+ size: 25,
+ title: undefined,
+ value: undefined,
+ x: undefined,
+ y: undefined
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(NodesHandler, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this2 = this;
+
+ // refresh the nodes. Used when reverting from hierarchical layout
+ this.body.emitter.on('refreshNodes', this.refresh.bind(this));
+ this.body.emitter.on('refresh', this.refresh.bind(this));
+ this.body.emitter.on('destroy', function () {
+ util.forEach(_this2.nodesListeners, function (callback, event) {
+ if (_this2.body.data.nodes) _this2.body.data.nodes.off(event, callback);
+ });
+ delete _this2.body.functions.createNode;
+ delete _this2.nodesListeners.add;
+ delete _this2.nodesListeners.update;
+ delete _this2.nodesListeners.remove;
+ delete _this2.nodesListeners;
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ _Node2.default.parseOptions(this.options, options);
+
+ // update the shape in all nodes
+ if (options.shape !== undefined) {
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ this.body.nodes[nodeId].updateShape();
+ }
+ }
+ }
+
+ // update the font in all nodes
+ if (options.font !== undefined) {
+ _Label2.default.parseOptions(this.options.font, options);
+ for (var _nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(_nodeId)) {
+ this.body.nodes[_nodeId].updateLabelModule();
+ this.body.nodes[_nodeId]._reset();
+ }
+ }
+ }
+
+ // update the shape size in all nodes
+ if (options.size !== undefined) {
+ for (var _nodeId2 in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(_nodeId2)) {
+ this.body.nodes[_nodeId2]._reset();
+ }
+ }
+ }
+
+ // update the state of the letiables if needed
+ if (options.hidden !== undefined || options.physics !== undefined) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }
+
+ /**
+ * Set a data set with nodes for the network
+ * @param {Array | DataSet | DataView} nodes The data containing the nodes.
+ * @private
+ */
+
+ }, {
+ key: 'setData',
+ value: function setData(nodes) {
+ var _this3 = this;
+
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var oldNodesData = this.body.data.nodes;
+
+ if (nodes instanceof DataSet || nodes instanceof DataView) {
+ this.body.data.nodes = nodes;
+ } else if (Array.isArray(nodes)) {
+ this.body.data.nodes = new DataSet();
+ this.body.data.nodes.add(nodes);
+ } else if (!nodes) {
+ this.body.data.nodes = new DataSet();
+ } else {
+ throw new TypeError('Array or DataSet expected');
+ }
+
+ if (oldNodesData) {
+ // unsubscribe from old dataset
+ util.forEach(this.nodesListeners, function (callback, event) {
+ oldNodesData.off(event, callback);
+ });
+ }
+
+ // remove drawn nodes
+ this.body.nodes = {};
+
+ if (this.body.data.nodes) {
+ (function () {
+ // subscribe to new dataset
+ var me = _this3;
+ util.forEach(_this3.nodesListeners, function (callback, event) {
+ me.body.data.nodes.on(event, callback);
+ });
+
+ // draw all new nodes
+ var ids = _this3.body.data.nodes.getIds();
+ _this3.add(ids, true);
+ })();
+ }
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit("_dataChanged");
+ }
+ }
+
+ /**
+ * Add nodes
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+
+ }, {
+ key: 'add',
+ value: function add(ids) {
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var id = void 0;
+ var newNodes = [];
+ for (var i = 0; i < ids.length; i++) {
+ id = ids[i];
+ var properties = this.body.data.nodes.get(id);
+ var node = this.create(properties);
+ newNodes.push(node);
+ this.body.nodes[id] = node; // note: this may replace an existing node
+ }
+
+ this.layoutEngine.positionInitially(newNodes);
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit("_dataChanged");
+ }
+ }
+
+ /**
+ * Update existing nodes, or create them when not yet existing
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+
+ }, {
+ key: 'update',
+ value: function update(ids, changedData) {
+ var nodes = this.body.nodes;
+ var dataChanged = false;
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var node = nodes[id];
+ var data = changedData[i];
+ if (node !== undefined) {
+ // update node
+ dataChanged = node.setOptions(data);
+ } else {
+ dataChanged = true;
+ // create node
+ node = this.create(data);
+ nodes[id] = node;
+ }
+ }
+ if (dataChanged === true) {
+ this.body.emitter.emit("_dataChanged");
+ } else {
+ this.body.emitter.emit("_dataUpdated");
+ }
+ }
+
+ /**
+ * Remove existing nodes. If nodes do not exist, the method will just ignore it.
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+
+ }, {
+ key: 'remove',
+ value: function remove(ids) {
+ var nodes = this.body.nodes;
+
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ delete nodes[id];
+ }
+
+ this.body.emitter.emit("_dataChanged");
+ }
+
+ /**
+ * create a node
+ * @param properties
+ * @param constructorClass
+ */
+
+ }, {
+ key: 'create',
+ value: function create(properties) {
+ var constructorClass = arguments.length <= 1 || arguments[1] === undefined ? _Node2.default : arguments[1];
+
+ return new constructorClass(properties, this.body, this.images, this.groups, this.options);
+ }
+ }, {
+ key: 'refresh',
+ value: function refresh() {
+ var clearPositions = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
+
+ var nodes = this.body.nodes;
+ for (var nodeId in nodes) {
+ var node = undefined;
+ if (nodes.hasOwnProperty(nodeId)) {
+ node = nodes[nodeId];
+ }
+ var data = this.body.data.nodes._data[nodeId];
+ if (node !== undefined && data !== undefined) {
+ if (clearPositions === true) {
+ node.setOptions({ x: null, y: null });
+ }
+ node.setOptions({ fixed: false });
+ node.setOptions(data);
+ }
+ }
+ }
+
+ /**
+ * Returns the positions of the nodes.
+ * @param ids --> optional, can be array of nodeIds, can be string
+ * @returns {{}}
+ */
+
+ }, {
+ key: 'getPositions',
+ value: function getPositions(ids) {
+ var dataArray = {};
+ if (ids !== undefined) {
+ if (Array.isArray(ids) === true) {
+ for (var i = 0; i < ids.length; i++) {
+ if (this.body.nodes[ids[i]] !== undefined) {
+ var node = this.body.nodes[ids[i]];
+ dataArray[ids[i]] = { x: Math.round(node.x), y: Math.round(node.y) };
+ }
+ }
+ } else {
+ if (this.body.nodes[ids] !== undefined) {
+ var _node = this.body.nodes[ids];
+ dataArray[ids] = { x: Math.round(_node.x), y: Math.round(_node.y) };
+ }
+ }
+ } else {
+ for (var _i = 0; _i < this.body.nodeIndices.length; _i++) {
+ var _node2 = this.body.nodes[this.body.nodeIndices[_i]];
+ dataArray[this.body.nodeIndices[_i]] = { x: Math.round(_node2.x), y: Math.round(_node2.y) };
+ }
+ }
+ return dataArray;
+ }
+
+ /**
+ * Load the XY positions of the nodes into the dataset.
+ */
+
+ }, {
+ key: 'storePositions',
+ value: function storePositions() {
+ // todo: add support for clusters and hierarchical.
+ var dataArray = [];
+ var dataset = this.body.data.nodes.getDataSet();
+
+ for (var nodeId in dataset._data) {
+ if (dataset._data.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (dataset._data[nodeId].x != Math.round(node.x) || dataset._data[nodeId].y != Math.round(node.y)) {
+ dataArray.push({ id: node.id, x: Math.round(node.x), y: Math.round(node.y) });
+ }
+ }
+ }
+ dataset.update(dataArray);
+ }
+
+ /**
+ * get the bounding box of a node.
+ * @param nodeId
+ * @returns {j|*}
+ */
+
+ }, {
+ key: 'getBoundingBox',
+ value: function getBoundingBox(nodeId) {
+ if (this.body.nodes[nodeId] !== undefined) {
+ return this.body.nodes[nodeId].shape.boundingBox;
+ }
+ }
+
+ /**
+ * Get the Ids of nodes connected to this node.
+ * @param nodeId
+ * @returns {Array}
+ */
+
+ }, {
+ key: 'getConnectedNodes',
+ value: function getConnectedNodes(nodeId) {
+ var nodeList = [];
+ if (this.body.nodes[nodeId] !== undefined) {
+ var node = this.body.nodes[nodeId];
+ var nodeObj = {}; // used to quickly check if node already exists
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ if (edge.toId == node.id) {
+ // these are double equals since ids can be numeric or string
+ if (nodeObj[edge.fromId] === undefined) {
+ nodeList.push(edge.fromId);
+ nodeObj[edge.fromId] = true;
+ }
+ } else if (edge.fromId == node.id) {
+ // these are double equals since ids can be numeric or string
+ if (nodeObj[edge.toId] === undefined) {
+ nodeList.push(edge.toId);
+ nodeObj[edge.toId] = true;
+ }
+ }
+ }
+ }
+ return nodeList;
+ }
+
+ /**
+ * Get the ids of the edges connected to this node.
+ * @param nodeId
+ * @returns {*}
+ */
+
+ }, {
+ key: 'getConnectedEdges',
+ value: function getConnectedEdges(nodeId) {
+ var edgeList = [];
+ if (this.body.nodes[nodeId] !== undefined) {
+ var node = this.body.nodes[nodeId];
+ for (var i = 0; i < node.edges.length; i++) {
+ edgeList.push(node.edges[i].id);
+ }
+ } else {
+ console.log("NodeId provided for getConnectedEdges does not exist. Provided: ", nodeId);
+ }
+ return edgeList;
+ }
+
+ /**
+ * Move a node.
+ * @param String nodeId
+ * @param Number x
+ * @param Number y
+ */
+
+ }, {
+ key: 'moveNode',
+ value: function moveNode(nodeId, x, y) {
+ var _this4 = this;
+
+ if (this.body.nodes[nodeId] !== undefined) {
+ this.body.nodes[nodeId].x = Number(x);
+ this.body.nodes[nodeId].y = Number(y);
+ setTimeout(function () {
+ _this4.body.emitter.emit("startSimulation");
+ }, 0);
+ } else {
+ console.log("Node id supplied to moveNode does not exist. Provided: ", nodeId);
+ }
+ }
+ }]);
+
+ return NodesHandler;
+ }();
+
+ exports.default = NodesHandler;
+
+/***/ },
+/* 65 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _Label = __webpack_require__(66);
+
+ var _Label2 = _interopRequireDefault(_Label);
+
+ var _Box = __webpack_require__(67);
+
+ var _Box2 = _interopRequireDefault(_Box);
+
+ var _Circle = __webpack_require__(69);
+
+ var _Circle2 = _interopRequireDefault(_Circle);
+
+ var _CircularImage = __webpack_require__(71);
+
+ var _CircularImage2 = _interopRequireDefault(_CircularImage);
+
+ var _Database = __webpack_require__(72);
+
+ var _Database2 = _interopRequireDefault(_Database);
+
+ var _Diamond = __webpack_require__(73);
+
+ var _Diamond2 = _interopRequireDefault(_Diamond);
+
+ var _Dot = __webpack_require__(75);
+
+ var _Dot2 = _interopRequireDefault(_Dot);
+
+ var _Ellipse = __webpack_require__(76);
+
+ var _Ellipse2 = _interopRequireDefault(_Ellipse);
+
+ var _Icon = __webpack_require__(77);
+
+ var _Icon2 = _interopRequireDefault(_Icon);
+
+ var _Image = __webpack_require__(78);
+
+ var _Image2 = _interopRequireDefault(_Image);
+
+ var _Square = __webpack_require__(79);
+
+ var _Square2 = _interopRequireDefault(_Square);
+
+ var _Star = __webpack_require__(80);
+
+ var _Star2 = _interopRequireDefault(_Star);
+
+ var _Text = __webpack_require__(81);
+
+ var _Text2 = _interopRequireDefault(_Text);
+
+ var _Triangle = __webpack_require__(82);
+
+ var _Triangle2 = _interopRequireDefault(_Triangle);
+
+ var _TriangleDown = __webpack_require__(83);
+
+ var _TriangleDown2 = _interopRequireDefault(_TriangleDown);
+
+ var _Validator = __webpack_require__(29);
+
+ var _Validator2 = _interopRequireDefault(_Validator);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @class Node
+ * A node. A node can be connected to other nodes via one or multiple edges.
+ * @param {object} options An object containing options for the node. All
+ * options are optional, except for the id.
+ * {number} id Id of the node. Required
+ * {string} label Text label for the node
+ * {number} x Horizontal position of the node
+ * {number} y Vertical position of the node
+ * {string} shape Node shape, available:
+ * "database", "circle", "ellipse",
+ * "box", "image", "text", "dot",
+ * "star", "triangle", "triangleDown",
+ * "square", "icon"
+ * {string} image An image url
+ * {string} title An title text, can be HTML
+ * {anytype} group A group name or number
+ * @param {Network.Images} imagelist A list with images. Only needed
+ * when the node has an image
+ * @param {Network.Groups} grouplist A list with groups. Needed for
+ * retrieving group options
+ * @param {Object} constants An object with default values for
+ * example for the color
+ *
+ */
+
+ var Node = function () {
+ function Node(options, body, imagelist, grouplist, globalOptions) {
+ _classCallCheck(this, Node);
+
+ this.options = util.bridgeObject(globalOptions);
+ this.globalOptions = globalOptions;
+ this.body = body;
+
+ this.edges = []; // all edges connected to this node
+
+ // set defaults for the options
+ this.id = undefined;
+ this.imagelist = imagelist;
+ this.grouplist = grouplist;
+
+ // state options
+ this.x = undefined;
+ this.y = undefined;
+ this.baseSize = this.options.size;
+ this.baseFontSize = this.options.font.size;
+ this.predefinedPosition = false; // used to check if initial fit should just take the range or approximate
+ this.selected = false;
+ this.hover = false;
+
+ this.labelModule = new _Label2.default(this.body, this.options, false /* Not edge label */);
+ this.setOptions(options);
+ }
+
+ /**
+ * Attach a edge to the node
+ * @param {Edge} edge
+ */
+
+
+ _createClass(Node, [{
+ key: 'attachEdge',
+ value: function attachEdge(edge) {
+ if (this.edges.indexOf(edge) === -1) {
+ this.edges.push(edge);
+ }
+ }
+
+ /**
+ * Detach a edge from the node
+ * @param {Edge} edge
+ */
+
+ }, {
+ key: 'detachEdge',
+ value: function detachEdge(edge) {
+ var index = this.edges.indexOf(edge);
+ if (index != -1) {
+ this.edges.splice(index, 1);
+ }
+ }
+
+ /**
+ * Set or overwrite options for the node
+ * @param {Object} options an object with options
+ * @param {Object} constants and object with default, global options
+ */
+
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ var currentShape = this.options.shape;
+ if (!options) {
+ return;
+ }
+ // basic options
+ if (options.id !== undefined) {
+ this.id = options.id;
+ }
+
+ if (this.id === undefined) {
+ throw "Node must have an id";
+ }
+
+ // set these options locally
+ // clear x and y positions
+ if (options.x !== undefined) {
+ if (options.x === null) {
+ this.x = undefined;this.predefinedPosition = false;
+ } else {
+ this.x = parseInt(options.x);this.predefinedPosition = true;
+ }
+ }
+ if (options.y !== undefined) {
+ if (options.y === null) {
+ this.y = undefined;this.predefinedPosition = false;
+ } else {
+ this.y = parseInt(options.y);this.predefinedPosition = true;
+ }
+ }
+ if (options.size !== undefined) {
+ this.baseSize = options.size;
+ }
+ if (options.value !== undefined) {
+ options.value = parseFloat(options.value);
+ }
+
+ // copy group options
+ if (typeof options.group === 'number' || typeof options.group === 'string' && options.group != '') {
+ var groupObj = this.grouplist.get(options.group);
+ util.deepExtend(this.options, groupObj);
+ // the color object needs to be completely defined. Since groups can partially overwrite the colors, we parse it again, just in case.
+ this.options.color = util.parseColor(this.options.color);
+ }
+
+ // this transforms all shorthands into fully defined options
+ Node.parseOptions(this.options, options, true, this.globalOptions);
+
+ // load the images
+ if (this.options.image !== undefined) {
+ if (this.imagelist) {
+ this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id);
+ } else {
+ throw "No imagelist provided";
+ }
+ }
+
+ this.updateLabelModule();
+ this.updateShape(currentShape);
+
+ if (options.hidden !== undefined || options.physics !== undefined) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * This process all possible shorthands in the new options and makes sure that the parentOptions are fully defined.
+ * Static so it can also be used by the handler.
+ * @param parentOptions
+ * @param newOptions
+ * @param allowDeletion
+ * @param globalOptions
+ */
+
+ }, {
+ key: 'updateLabelModule',
+ value: function updateLabelModule() {
+ if (this.options.label === undefined || this.options.label === null) {
+ this.options.label = '';
+ }
+ this.labelModule.setOptions(this.options, true);
+ if (this.labelModule.baseSize !== undefined) {
+ this.baseFontSize = this.labelModule.baseSize;
+ }
+ }
+ }, {
+ key: 'updateShape',
+ value: function updateShape(currentShape) {
+ if (currentShape === this.options.shape && this.shape) {
+ this.shape.setOptions(this.options, this.imageObj);
+ } else {
+ // choose draw method depending on the shape
+ switch (this.options.shape) {
+ case 'box':
+ this.shape = new _Box2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'circle':
+ this.shape = new _Circle2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'circularImage':
+ this.shape = new _CircularImage2.default(this.options, this.body, this.labelModule, this.imageObj);
+ break;
+ case 'database':
+ this.shape = new _Database2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'diamond':
+ this.shape = new _Diamond2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'dot':
+ this.shape = new _Dot2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'ellipse':
+ this.shape = new _Ellipse2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'icon':
+ this.shape = new _Icon2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'image':
+ this.shape = new _Image2.default(this.options, this.body, this.labelModule, this.imageObj);
+ break;
+ case 'square':
+ this.shape = new _Square2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'star':
+ this.shape = new _Star2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'text':
+ this.shape = new _Text2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'triangle':
+ this.shape = new _Triangle2.default(this.options, this.body, this.labelModule);
+ break;
+ case 'triangleDown':
+ this.shape = new _TriangleDown2.default(this.options, this.body, this.labelModule);
+ break;
+ default:
+ this.shape = new _Ellipse2.default(this.options, this.body, this.labelModule);
+ break;
+ }
+ }
+ this._reset();
+ }
+
+ /**
+ * select this node
+ */
+
+ }, {
+ key: 'select',
+ value: function select() {
+ this.selected = true;
+ this._reset();
+ }
+
+ /**
+ * unselect this node
+ */
+
+ }, {
+ key: 'unselect',
+ value: function unselect() {
+ this.selected = false;
+ this._reset();
+ }
+
+ /**
+ * Reset the calculated size of the node, forces it to recalculate its size
+ * @private
+ */
+
+ }, {
+ key: '_reset',
+ value: function _reset() {
+ this.shape.width = undefined;
+ this.shape.height = undefined;
+ }
+
+ /**
+ * get the title of this node.
+ * @return {string} title The title of the node, or undefined when no title
+ * has been set.
+ */
+
+ }, {
+ key: 'getTitle',
+ value: function getTitle() {
+ return this.options.title;
+ }
+
+ /**
+ * Calculate the distance to the border of the Node
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Number} angle Angle in radians
+ * @returns {number} distance Distance to the border in pixels
+ */
+
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this.shape.distanceToBorder(ctx, angle);
+ }
+
+ /**
+ * Check if this node has a fixed x and y position
+ * @return {boolean} true if fixed, false if not
+ */
+
+ }, {
+ key: 'isFixed',
+ value: function isFixed() {
+ return this.options.fixed.x && this.options.fixed.y;
+ }
+
+ /**
+ * check if this node is selecte
+ * @return {boolean} selected True if node is selected, else false
+ */
+
+ }, {
+ key: 'isSelected',
+ value: function isSelected() {
+ return this.selected;
+ }
+
+ /**
+ * Retrieve the value of the node. Can be undefined
+ * @return {Number} value
+ */
+
+ }, {
+ key: 'getValue',
+ value: function getValue() {
+ return this.options.value;
+ }
+
+ /**
+ * Adjust the value range of the node. The node will adjust it's size
+ * based on its value.
+ * @param {Number} min
+ * @param {Number} max
+ */
+
+ }, {
+ key: 'setValueRange',
+ value: function setValueRange(min, max, total) {
+ if (this.options.value !== undefined) {
+ var scale = this.options.scaling.customScalingFunction(min, max, total, this.options.value);
+ var sizeDiff = this.options.scaling.max - this.options.scaling.min;
+ if (this.options.scaling.label.enabled === true) {
+ var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;
+ this.options.font.size = this.options.scaling.label.min + scale * fontDiff;
+ }
+ this.options.size = this.options.scaling.min + scale * sizeDiff;
+ } else {
+ this.options.size = this.baseSize;
+ this.options.font.size = this.baseFontSize;
+ }
+
+ this.updateLabelModule();
+ }
+
+ /**
+ * Draw this node in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+
+ }, {
+ key: 'draw',
+ value: function draw(ctx) {
+ this.shape.draw(ctx, this.x, this.y, this.selected, this.hover);
+ }
+
+ /**
+ * Update the bounding box of the shape
+ */
+
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(ctx) {
+ this.shape.updateBoundingBox(this.x, this.y, ctx);
+ }
+
+ /**
+ * Recalculate the size of this node in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+
+ }, {
+ key: 'resize',
+ value: function resize(ctx) {
+ this.shape.resize(ctx, this.selected);
+ }
+
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top, right, bottom
+ * @return {boolean} True if location is located on node
+ */
+
+ }, {
+ key: 'isOverlappingWith',
+ value: function isOverlappingWith(obj) {
+ return this.shape.left < obj.right && this.shape.left + this.shape.width > obj.left && this.shape.top < obj.bottom && this.shape.top + this.shape.height > obj.top;
+ }
+
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top, right, bottom
+ * @return {boolean} True if location is located on node
+ */
+
+ }, {
+ key: 'isBoundingBoxOverlappingWith',
+ value: function isBoundingBoxOverlappingWith(obj) {
+ return this.shape.boundingBox.left < obj.right && this.shape.boundingBox.right > obj.left && this.shape.boundingBox.top < obj.bottom && this.shape.boundingBox.bottom > obj.top;
+ }
+ }], [{
+ key: 'parseOptions',
+ value: function parseOptions(parentOptions, newOptions) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+ var globalOptions = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
+
+ var fields = ['color', 'font', 'fixed', 'shadow'];
+ util.selectiveNotDeepExtend(fields, parentOptions, newOptions, allowDeletion);
+
+ // merge the shadow options into the parent.
+ util.mergeOptions(parentOptions, newOptions, 'shadow', allowDeletion, globalOptions);
+
+ // individual shape newOptions
+ if (newOptions.color !== undefined && newOptions.color !== null) {
+ var parsedColor = util.parseColor(newOptions.color);
+ util.fillIfDefined(parentOptions.color, parsedColor);
+ } else if (allowDeletion === true && newOptions.color === null) {
+ parentOptions.color = util.bridgeObject(globalOptions.color); // set the object back to the global options
+ }
+
+ // handle the fixed options
+ if (newOptions.fixed !== undefined && newOptions.fixed !== null) {
+ if (typeof newOptions.fixed === 'boolean') {
+ parentOptions.fixed.x = newOptions.fixed;
+ parentOptions.fixed.y = newOptions.fixed;
+ } else {
+ if (newOptions.fixed.x !== undefined && typeof newOptions.fixed.x === 'boolean') {
+ parentOptions.fixed.x = newOptions.fixed.x;
+ }
+ if (newOptions.fixed.y !== undefined && typeof newOptions.fixed.y === 'boolean') {
+ parentOptions.fixed.y = newOptions.fixed.y;
+ }
+ }
+ }
+
+ // handle the font options
+ if (newOptions.font !== undefined && newOptions.font !== null) {
+ _Label2.default.parseOptions(parentOptions.font, newOptions);
+ } else if (allowDeletion === true && newOptions.font === null) {
+ parentOptions.font = util.bridgeObject(globalOptions.font); // set the object back to the global options
+ }
+
+ // handle the scaling options, specifically the label part
+ if (newOptions.scaling !== undefined) {
+ util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling);
+ }
+ }
+ }]);
+
+ return Node;
+ }();
+
+ exports.default = Node;
+
+/***/ },
+/* 66 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var Label = function () {
+ function Label(body, options) {
+ var edgelabel = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ _classCallCheck(this, Label);
+
+ this.body = body;
+
+ this.pointToSelf = false;
+ this.baseSize = undefined;
+ this.fontOptions = {};
+ this.setOptions(options);
+ this.size = { top: 0, left: 0, width: 0, height: 0, yLine: 0 }; // could be cached
+ this.isEdgeLabel = edgelabel;
+ }
+
+ _createClass(Label, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ var allowDeletion = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ this.nodeOptions = options;
+
+ // We want to keep the font options seperated from the node options.
+ // The node options have to mirror the globals when they are not overruled.
+ this.fontOptions = util.deepExtend({}, options.font, true);
+
+ if (options.label !== undefined) {
+ this.labelDirty = true;
+ }
+
+ if (options.font !== undefined) {
+ Label.parseOptions(this.fontOptions, options, allowDeletion);
+ if (typeof options.font === 'string') {
+ this.baseSize = this.fontOptions.size;
+ } else if (_typeof(options.font) === 'object') {
+ if (options.font.size !== undefined) {
+ this.baseSize = options.font.size;
+ }
+ }
+ }
+ }
+ }, {
+ key: 'draw',
+
+
+ /**
+ * Main function. This is called from anything that wants to draw a label.
+ * @param ctx
+ * @param x
+ * @param y
+ * @param selected
+ * @param baseline
+ */
+ value: function draw(ctx, x, y, selected) {
+ var baseline = arguments.length <= 4 || arguments[4] === undefined ? 'middle' : arguments[4];
+
+ // if no label, return
+ if (this.nodeOptions.label === undefined) return;
+
+ // check if we have to render the label
+ var viewFontSize = this.fontOptions.size * this.body.view.scale;
+ if (this.nodeOptions.label && viewFontSize < this.nodeOptions.scaling.label.drawThreshold - 1) return;
+
+ // update the size cache if required
+ this.calculateLabelSize(ctx, selected, x, y, baseline);
+
+ // create the fontfill background
+ this._drawBackground(ctx);
+ // draw text
+ this._drawText(ctx, selected, x, y, baseline);
+ }
+
+ /**
+ * Draws the label background
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+ }, {
+ key: '_drawBackground',
+ value: function _drawBackground(ctx) {
+ if (this.fontOptions.background !== undefined && this.fontOptions.background !== "none") {
+ ctx.fillStyle = this.fontOptions.background;
+
+ var lineMargin = 2;
+
+ if (this.isEdgeLabel) {
+ switch (this.fontOptions.align) {
+ case 'middle':
+ ctx.fillRect(-this.size.width * 0.5, -this.size.height * 0.5, this.size.width, this.size.height);
+ break;
+ case 'top':
+ ctx.fillRect(-this.size.width * 0.5, -(this.size.height + lineMargin), this.size.width, this.size.height);
+ break;
+ case 'bottom':
+ ctx.fillRect(-this.size.width * 0.5, lineMargin, this.size.width, this.size.height);
+ break;
+ default:
+ ctx.fillRect(this.size.left, this.size.top - 0.5 * lineMargin, this.size.width, this.size.height);
+ break;
+ }
+ } else {
+ ctx.fillRect(this.size.left, this.size.top - 0.5 * lineMargin, this.size.width, this.size.height);
+ }
+ }
+ }
+
+ /**
+ *
+ * @param ctx
+ * @param x
+ * @param baseline
+ * @private
+ */
+
+ }, {
+ key: '_drawText',
+ value: function _drawText(ctx, selected, x, y) {
+ var baseline = arguments.length <= 4 || arguments[4] === undefined ? 'middle' : arguments[4];
+
+ var fontSize = this.fontOptions.size;
+ var viewFontSize = fontSize * this.body.view.scale;
+ // this ensures that there will not be HUGE letters on screen by setting an upper limit on the visible text size (regardless of zoomLevel)
+ if (viewFontSize >= this.nodeOptions.scaling.label.maxVisible) {
+ fontSize = Number(this.nodeOptions.scaling.label.maxVisible) / this.body.view.scale;
+ }
+
+ var yLine = this.size.yLine;
+
+ var _getColor2 = this._getColor(viewFontSize);
+
+ var _getColor3 = _slicedToArray(_getColor2, 2);
+
+ var fontColor = _getColor3[0];
+ var strokeColor = _getColor3[1];
+
+
+ // configure context for drawing the text
+
+ var _setAlignment2 = this._setAlignment(ctx, x, yLine, baseline);
+
+ var _setAlignment3 = _slicedToArray(_setAlignment2, 2);
+
+ x = _setAlignment3[0];
+ yLine = _setAlignment3[1];
+ ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + fontSize + "px " + this.fontOptions.face;
+ ctx.fillStyle = fontColor;
+ // When the textAlign property is 'left', make label left-justified
+ if (!this.isEdgeLabel && this.fontOptions.align === 'left') {
+ ctx.textAlign = this.fontOptions.align;
+ x = x - 0.5 * this.size.width; // Shift label 1/2-distance to the left
+ } else {
+ ctx.textAlign = 'center';
+ }
+
+ // set the strokeWidth
+ if (this.fontOptions.strokeWidth > 0) {
+ ctx.lineWidth = this.fontOptions.strokeWidth;
+ ctx.strokeStyle = strokeColor;
+ ctx.lineJoin = 'round';
+ }
+
+ // draw the text
+ for (var i = 0; i < this.lineCount; i++) {
+ if (this.fontOptions.strokeWidth > 0) {
+ ctx.strokeText(this.lines[i], x, yLine);
+ }
+ ctx.fillText(this.lines[i], x, yLine);
+ yLine += fontSize;
+ }
+ }
+ }, {
+ key: '_setAlignment',
+ value: function _setAlignment(ctx, x, yLine, baseline) {
+ // check for label alignment (for edges)
+ // TODO: make alignment for nodes
+ if (this.isEdgeLabel && this.fontOptions.align !== 'horizontal' && this.pointToSelf === false) {
+ x = 0;
+ yLine = 0;
+
+ var lineMargin = 2;
+ if (this.fontOptions.align === 'top') {
+ ctx.textBaseline = 'alphabetic';
+ yLine -= 2 * lineMargin; // distance from edge, required because we use alphabetic. Alphabetic has less difference between browsers
+ } else if (this.fontOptions.align === 'bottom') {
+ ctx.textBaseline = 'hanging';
+ yLine += 2 * lineMargin; // distance from edge, required because we use hanging. Hanging has less difference between browsers
+ } else {
+ ctx.textBaseline = 'middle';
+ }
+ } else {
+ ctx.textBaseline = baseline;
+ }
+
+ return [x, yLine];
+ }
+
+ /**
+ * fade in when relative scale is between threshold and threshold - 1.
+ * If the relative scale would be smaller than threshold -1 the draw function would have returned before coming here.
+ *
+ * @param viewFontSize
+ * @returns {*[]}
+ * @private
+ */
+
+ }, {
+ key: '_getColor',
+ value: function _getColor(viewFontSize) {
+ var fontColor = this.fontOptions.color || '#000000';
+ var strokeColor = this.fontOptions.strokeColor || '#ffffff';
+ if (viewFontSize <= this.nodeOptions.scaling.label.drawThreshold) {
+ var opacity = Math.max(0, Math.min(1, 1 - (this.nodeOptions.scaling.label.drawThreshold - viewFontSize)));
+ fontColor = util.overrideOpacity(fontColor, opacity);
+ strokeColor = util.overrideOpacity(strokeColor, opacity);
+ }
+ return [fontColor, strokeColor];
+ }
+
+ /**
+ *
+ * @param ctx
+ * @param selected
+ * @returns {{width: number, height: number}}
+ */
+
+ }, {
+ key: 'getTextSize',
+ value: function getTextSize(ctx) {
+ var selected = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var size = {
+ width: this._processLabel(ctx, selected),
+ height: this.fontOptions.size * this.lineCount,
+ lineCount: this.lineCount
+ };
+ return size;
+ }
+
+ /**
+ *
+ * @param ctx
+ * @param selected
+ * @param x
+ * @param y
+ * @param baseline
+ */
+
+ }, {
+ key: 'calculateLabelSize',
+ value: function calculateLabelSize(ctx, selected) {
+ var x = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
+ var y = arguments.length <= 3 || arguments[3] === undefined ? 0 : arguments[3];
+ var baseline = arguments.length <= 4 || arguments[4] === undefined ? 'middle' : arguments[4];
+
+ if (this.labelDirty === true) {
+ this.size.width = this._processLabel(ctx, selected);
+ }
+ this.size.height = this.fontOptions.size * this.lineCount;
+ this.size.left = x - this.size.width * 0.5;
+ this.size.top = y - this.size.height * 0.5;
+ this.size.yLine = y + (1 - this.lineCount) * 0.5 * this.fontOptions.size;
+ if (baseline === "hanging") {
+ this.size.top += 0.5 * this.fontOptions.size;
+ this.size.top += 4; // distance from node, required because we use hanging. Hanging has less difference between browsers
+ this.size.yLine += 4; // distance from node
+ }
+
+ this.labelDirty = false;
+ }
+
+ /**
+ * This calculates the width as well as explodes the label string and calculates the amount of lines.
+ * @param ctx
+ * @param selected
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_processLabel',
+ value: function _processLabel(ctx, selected) {
+ var width = 0;
+ var lines = [''];
+ var lineCount = 0;
+ if (this.nodeOptions.label !== undefined) {
+ lines = String(this.nodeOptions.label).split('\n');
+ lineCount = lines.length;
+ ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + this.fontOptions.size + "px " + this.fontOptions.face;
+ width = ctx.measureText(lines[0]).width;
+ for (var i = 1; i < lineCount; i++) {
+ var lineWidth = ctx.measureText(lines[i]).width;
+ width = lineWidth > width ? lineWidth : width;
+ }
+ }
+ this.lines = lines;
+ this.lineCount = lineCount;
+
+ return width;
+ }
+ }], [{
+ key: 'parseOptions',
+ value: function parseOptions(parentOptions, newOptions) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ if (typeof newOptions.font === 'string') {
+ var newOptionsArray = newOptions.font.split(" ");
+ parentOptions.size = newOptionsArray[0].replace("px", '');
+ parentOptions.face = newOptionsArray[1];
+ parentOptions.color = newOptionsArray[2];
+ } else if (_typeof(newOptions.font) === 'object') {
+ util.fillIfDefined(parentOptions, newOptions.font, allowDeletion);
+ }
+ parentOptions.size = Number(parentOptions.size);
+ }
+ }]);
+
+ return Label;
+ }();
+
+ exports.default = Label;
+
+/***/ },
+/* 67 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Box = function (_NodeBase) {
+ _inherits(Box, _NodeBase);
+
+ function Box(options, body, labelModule) {
+ _classCallCheck(this, Box);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Box).call(this, options, body, labelModule));
+ }
+
+ _createClass(Box, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ this.width = textSize.width + 2 * margin;
+ this.height = textSize.height + 2 * margin;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var borderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.lineWidth = selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth /= this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+
+ var borderRadius = this.options.shapeProperties.borderRadius; // only effective for box
+ ctx.roundRect(this.left, this.top, this.width, this.height, borderRadius);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ // if borders are zero width, they will be drawn with width 1 by default. This prevents that
+ if (borderWidth > 0) {
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ }
+ ctx.restore();
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected);
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ var borderRadius = this.options.shapeProperties.borderRadius; // only effective for box
+ this.boundingBox.left = this.left - borderRadius;
+ this.boundingBox.top = this.top - borderRadius;
+ this.boundingBox.bottom = this.top + this.height + borderRadius;
+ this.boundingBox.right = this.left + this.width + borderRadius;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var borderWidth = this.options.borderWidth;
+
+ return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
+ }
+ }]);
+
+ return Box;
+ }(_NodeBase3.default);
+
+ exports.default = Box;
+
+/***/ },
+/* 68 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var NodeBase = function () {
+ function NodeBase(options, body, labelModule) {
+ _classCallCheck(this, NodeBase);
+
+ this.body = body;
+ this.labelModule = labelModule;
+ this.setOptions(options);
+ this.top = undefined;
+ this.left = undefined;
+ this.height = undefined;
+ this.width = undefined;
+ this.radius = undefined;
+ this.boundingBox = { top: 0, left: 0, right: 0, bottom: 0 };
+ }
+
+ _createClass(NodeBase, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "_distanceToBorder",
+ value: function _distanceToBorder(ctx, angle) {
+ var borderWidth = this.options.borderWidth;
+ this.resize(ctx);
+ return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
+ }
+ }, {
+ key: "enableShadow",
+ value: function enableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = this.options.shadow.color;
+ ctx.shadowBlur = this.options.shadow.size;
+ ctx.shadowOffsetX = this.options.shadow.x;
+ ctx.shadowOffsetY = this.options.shadow.y;
+ }
+ }
+ }, {
+ key: "disableShadow",
+ value: function disableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = 'rgba(0,0,0,0)';
+ ctx.shadowBlur = 0;
+ ctx.shadowOffsetX = 0;
+ ctx.shadowOffsetY = 0;
+ }
+ }
+ }, {
+ key: "enableBorderDashes",
+ value: function enableBorderDashes(ctx) {
+ if (this.options.shapeProperties.borderDashes !== false) {
+ if (ctx.setLineDash !== undefined) {
+ var dashes = this.options.shapeProperties.borderDashes;
+ if (dashes === true) {
+ dashes = [5, 15];
+ }
+ ctx.setLineDash(dashes);
+ } else {
+ console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used.");
+ this.options.shapeProperties.borderDashes = false;
+ }
+ }
+ }
+ }, {
+ key: "disableBorderDashes",
+ value: function disableBorderDashes(ctx) {
+ if (this.options.shapeProperties.borderDashes !== false) {
+ if (ctx.setLineDash !== undefined) {
+ ctx.setLineDash([0]);
+ } else {
+ console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used.");
+ this.options.shapeProperties.borderDashes = false;
+ }
+ }
+ }
+ }]);
+
+ return NodeBase;
+ }();
+
+ exports.default = NodeBase;
+
+/***/ },
+/* 69 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _CircleImageBase2 = __webpack_require__(70);
+
+ var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Circle = function (_CircleImageBase) {
+ _inherits(Circle, _CircleImageBase);
+
+ function Circle(options, body, labelModule) {
+ _classCallCheck(this, Circle);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Circle).call(this, options, body, labelModule));
+ }
+
+ _createClass(Circle, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ var diameter = Math.max(textSize.width, textSize.height) + 2 * margin;
+ this.options.size = diameter / 2;
+
+ this.width = diameter;
+ this.height = diameter;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ this._drawRawCircle(ctx, x, y, selected, hover, this.options.size);
+
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+
+ this.updateBoundingBox(x, y);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ return this.width * 0.5;
+ }
+ }]);
+
+ return Circle;
+ }(_CircleImageBase3.default);
+
+ exports.default = Circle;
+
+/***/ },
+/* 70 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var CircleImageBase = function (_NodeBase) {
+ _inherits(CircleImageBase, _NodeBase);
+
+ function CircleImageBase(options, body, labelModule) {
+ _classCallCheck(this, CircleImageBase);
+
+ var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(CircleImageBase).call(this, options, body, labelModule));
+
+ _this.labelOffset = 0;
+ _this.imageLoaded = false;
+ return _this;
+ }
+
+ _createClass(CircleImageBase, [{
+ key: 'setOptions',
+ value: function setOptions(options, imageObj) {
+ this.options = options;
+ if (imageObj) {
+ this.imageObj = imageObj;
+ }
+ }
+
+ /**
+ * This function resizes the image by the options size when the image has not yet loaded. If the image has loaded, we
+ * force the update of the size again.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_resizeImage',
+ value: function _resizeImage() {
+ var force = false;
+ if (!this.imageObj.width || !this.imageObj.height) {
+ // undefined or 0
+ this.imageLoaded = false;
+ } else if (this.imageLoaded === false) {
+ this.imageLoaded = true;
+ force = true;
+ }
+
+ if (!this.width || !this.height || force === true) {
+ // undefined or 0
+ var width, height, ratio;
+ if (this.imageObj.width && this.imageObj.height) {
+ // not undefined or 0
+ width = 0;
+ height = 0;
+ }
+ if (this.options.shapeProperties.useImageSize === false) {
+ if (this.imageObj.width > this.imageObj.height) {
+ ratio = this.imageObj.width / this.imageObj.height;
+ width = this.options.size * 2 * ratio || this.imageObj.width;
+ height = this.options.size * 2 || this.imageObj.height;
+ } else {
+ if (this.imageObj.width && this.imageObj.height) {
+ // not undefined or 0
+ ratio = this.imageObj.height / this.imageObj.width;
+ } else {
+ ratio = 1;
+ }
+ width = this.options.size * 2;
+ height = this.options.size * 2 * ratio;
+ }
+ } else {
+ // when not using the size property, we use the image size
+ width = this.imageObj.width;
+ height = this.imageObj.height;
+ }
+ this.width = width;
+ this.height = height;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: '_drawRawCircle',
+ value: function _drawRawCircle(ctx, x, y, selected, hover, size) {
+ var neutralborderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+ var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, borderWidth);
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx.circle(x, y, size);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ // if borders are zero width, they will be drawn with width 1 by default. This prevents that
+ if (borderWidth > 0) {
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ }
+ ctx.restore();
+ }
+ }, {
+ key: '_drawImageAtPosition',
+ value: function _drawImageAtPosition(ctx) {
+ if (this.imageObj.width != 0) {
+ // draw the image
+ ctx.globalAlpha = 1.0;
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+
+ var factor = this.imageObj.width / this.width / this.body.view.scale;
+ if (factor > 2 && this.options.shapeProperties.interpolation === true) {
+ var w = this.imageObj.width;
+ var h = this.imageObj.height;
+ var can2 = document.createElement('canvas');
+ can2.width = w;
+ can2.height = w;
+ var ctx2 = can2.getContext('2d');
+
+ factor *= 0.5;
+ w *= 0.5;
+ h *= 0.5;
+ ctx2.drawImage(this.imageObj, 0, 0, w, h);
+
+ var distance = 0;
+ var iterations = 1;
+ while (factor > 2 && iterations < 4) {
+ ctx2.drawImage(can2, distance, 0, w, h, distance + w, 0, w / 2, h / 2);
+ distance += w;
+ factor *= 0.5;
+ w *= 0.5;
+ h *= 0.5;
+ iterations += 1;
+ }
+ ctx.drawImage(can2, distance, 0, w, h, this.left, this.top, this.width, this.height);
+ } else {
+ // draw image
+ ctx.drawImage(this.imageObj, this.left, this.top, this.width, this.height);
+ }
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+ }
+ }, {
+ key: '_drawImageLabel',
+ value: function _drawImageLabel(ctx, x, y, selected) {
+ var yLabel;
+ var offset = 0;
+
+ if (this.height !== undefined) {
+ offset = this.height * 0.5;
+ var labelDimensions = this.labelModule.getTextSize(ctx);
+ if (labelDimensions.lineCount >= 1) {
+ offset += labelDimensions.height / 2;
+ }
+ }
+
+ yLabel = y + offset;
+
+ if (this.options.label) {
+ this.labelOffset = offset;
+ }
+ this.labelModule.draw(ctx, x, yLabel, selected, 'hanging');
+ }
+ }]);
+
+ return CircleImageBase;
+ }(_NodeBase3.default);
+
+ exports.default = CircleImageBase;
+
+/***/ },
+/* 71 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _CircleImageBase2 = __webpack_require__(70);
+
+ var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var CircularImage = function (_CircleImageBase) {
+ _inherits(CircularImage, _CircleImageBase);
+
+ function CircularImage(options, body, labelModule, imageObj) {
+ _classCallCheck(this, CircularImage);
+
+ var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(CircularImage).call(this, options, body, labelModule));
+
+ _this.imageObj = imageObj;
+ _this._swapToImageResizeWhenImageLoaded = true;
+ return _this;
+ }
+
+ _createClass(CircularImage, [{
+ key: 'resize',
+ value: function resize() {
+ if (this.imageObj.src === undefined || this.imageObj.width === undefined || this.imageObj.height === undefined) {
+ if (!this.width) {
+ var diameter = this.options.size * 2;
+ this.width = diameter;
+ this.height = diameter;
+ this._swapToImageResizeWhenImageLoaded = true;
+ this.radius = 0.5 * this.width;
+ }
+ } else {
+ if (this._swapToImageResizeWhenImageLoaded) {
+ this.width = undefined;
+ this.height = undefined;
+ this._swapToImageResizeWhenImageLoaded = false;
+ }
+ this._resizeImage();
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize();
+
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var size = Math.min(0.5 * this.height, 0.5 * this.width);
+
+ // draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below.
+ this._drawRawCircle(ctx, x, y, selected, hover, size);
+
+ // now we draw in the circle, we save so we can revert the clip operation after drawing.
+ ctx.save();
+ // clip is used to use the stroke in drawRawCircle as an area that we can draw in.
+ ctx.clip();
+ // draw the image
+ this._drawImageAtPosition(ctx);
+ // restore so we can again draw on the full canvas
+ ctx.restore();
+
+ this._drawImageLabel(ctx, x, y, selected);
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + 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 distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ return this.width * 0.5;
+ }
+ }]);
+
+ return CircularImage;
+ }(_CircleImageBase3.default);
+
+ exports.default = CircularImage;
+
+/***/ },
+/* 72 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Database = function (_NodeBase) {
+ _inherits(Database, _NodeBase);
+
+ function Database(options, body, labelModule) {
+ _classCallCheck(this, Database);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Database).call(this, options, body, labelModule));
+ }
+
+ _createClass(Database, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ var size = textSize.width + 2 * margin;
+ this.width = size;
+ this.height = size;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var neutralborderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+ var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, borderWidth);
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx.database(x - this.width / 2, y - this.height * 0.5, this.width, this.height);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ // if borders are zero width, they will be drawn with width 1 by default. This prevents that
+ if (borderWidth > 0) {
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ }
+ ctx.restore();
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected);
+
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ 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: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Database;
+ }(_NodeBase3.default);
+
+ exports.default = Database;
+
+/***/ },
+/* 73 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ShapeBase2 = __webpack_require__(74);
+
+ var _ShapeBase3 = _interopRequireDefault(_ShapeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Diamond = function (_ShapeBase) {
+ _inherits(Diamond, _ShapeBase);
+
+ function Diamond(options, body, labelModule) {
+ _classCallCheck(this, Diamond);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Diamond).call(this, options, body, labelModule));
+ }
+
+ _createClass(Diamond, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'diamond', 4, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Diamond;
+ }(_ShapeBase3.default);
+
+ exports.default = Diamond;
+
+/***/ },
+/* 74 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var ShapeBase = function (_NodeBase) {
+ _inherits(ShapeBase, _NodeBase);
+
+ function ShapeBase(options, body, labelModule) {
+ _classCallCheck(this, ShapeBase);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(ShapeBase).call(this, options, body, labelModule));
+ }
+
+ _createClass(ShapeBase, [{
+ key: '_resizeShape',
+ value: function _resizeShape() {
+ if (this.width === undefined) {
+ var size = 2 * this.options.size;
+ this.width = size;
+ this.height = size;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: '_drawShape',
+ value: function _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover) {
+ this._resizeShape();
+
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var neutralborderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+ var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, borderWidth);
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx[shape](x, y, this.options.size);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ // if borders are zero width, they will be drawn with width 1 by default. This prevents that
+ if (borderWidth > 0) {
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ }
+ ctx.restore();
+
+ if (this.options.label !== undefined) {
+ var yLabel = y + 0.5 * this.height + 3; // the + 3 is to offset it a bit below the node.
+ this.labelModule.draw(ctx, x, yLabel, selected, 'hanging');
+ }
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+
+ if (this.options.label !== undefined && 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 + 3);
+ }
+ }
+ }]);
+
+ return ShapeBase;
+ }(_NodeBase3.default);
+
+ exports.default = ShapeBase;
+
+/***/ },
+/* 75 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ShapeBase2 = __webpack_require__(74);
+
+ var _ShapeBase3 = _interopRequireDefault(_ShapeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Dot = function (_ShapeBase) {
+ _inherits(Dot, _ShapeBase);
+
+ function Dot(options, body, labelModule) {
+ _classCallCheck(this, Dot);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Dot).call(this, options, body, labelModule));
+ }
+
+ _createClass(Dot, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'circle', 2, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ return this.options.size;
+ }
+ }]);
+
+ return Dot;
+ }(_ShapeBase3.default);
+
+ exports.default = Dot;
+
+/***/ },
+/* 76 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Ellipse = function (_NodeBase) {
+ _inherits(Ellipse, _NodeBase);
+
+ function Ellipse(options, body, labelModule) {
+ _classCallCheck(this, Ellipse);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Ellipse).call(this, options, body, labelModule));
+ }
+
+ _createClass(Ellipse, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+
+ this.width = textSize.width * 1.5;
+ this.height = textSize.height * 2;
+ if (this.width < this.height) {
+ this.width = this.height;
+ }
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ var neutralborderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+ var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, borderWidth);
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx.ellipse(this.left, this.top, this.width, this.height);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+
+ // if borders are zero width, they will be drawn with width 1 by default. This prevents that
+ if (borderWidth > 0) {
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ }
+
+ ctx.restore();
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected); // just in case
+
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ 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: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var a = this.width * 0.5;
+ var b = this.height * 0.5;
+ var w = Math.sin(angle) * a;
+ var h = Math.cos(angle) * b;
+ return a * b / Math.sqrt(w * w + h * h);
+ }
+ }]);
+
+ return Ellipse;
+ }(_NodeBase3.default);
+
+ exports.default = Ellipse;
+
+/***/ },
+/* 77 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Icon = function (_NodeBase) {
+ _inherits(Icon, _NodeBase);
+
+ function Icon(options, body, labelModule) {
+ _classCallCheck(this, Icon);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options, body, labelModule));
+ }
+
+ _createClass(Icon, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var iconSize = {
+ width: Number(this.options.icon.size),
+ height: Number(this.options.icon.size)
+ };
+ this.width = iconSize.width + 2 * margin;
+ this.height = iconSize.height + 2 * margin;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx);
+ this.options.icon.size = this.options.icon.size || 50;
+
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+ this._icon(ctx, x, y, selected);
+
+ if (this.options.label !== undefined) {
+ var iconTextSpacing = 5;
+ this.labelModule.draw(ctx, x, y + this.height * 0.5 + iconTextSpacing, selected);
+ }
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.icon.size * 0.5;
+ this.boundingBox.left = x - this.options.icon.size * 0.5;
+ this.boundingBox.right = x + this.options.icon.size * 0.5;
+ this.boundingBox.bottom = y + this.options.icon.size * 0.5;
+
+ if (this.options.label !== undefined && this.labelModule.size.width > 0) {
+ var iconTextSpacing = 5;
+ 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 + iconTextSpacing);
+ }
+ }
+ }, {
+ key: '_icon',
+ value: function _icon(ctx, x, y, selected) {
+ var iconSize = Number(this.options.icon.size);
+
+ if (this.options.icon.code !== undefined) {
+ ctx.font = (selected ? "bold " : "") + iconSize + "px " + this.options.icon.face;
+
+ // draw icon
+ ctx.fillStyle = this.options.icon.color || "black";
+ ctx.textAlign = "center";
+ ctx.textBaseline = "middle";
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.fillText(this.options.icon.code, x, y);
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ } else {
+ 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 distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Icon;
+ }(_NodeBase3.default);
+
+ exports.default = Icon;
+
+/***/ },
+/* 78 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _CircleImageBase2 = __webpack_require__(70);
+
+ var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Image = function (_CircleImageBase) {
+ _inherits(Image, _CircleImageBase);
+
+ function Image(options, body, labelModule, imageObj) {
+ _classCallCheck(this, Image);
+
+ var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Image).call(this, options, body, labelModule));
+
+ _this.imageObj = imageObj;
+ return _this;
+ }
+
+ _createClass(Image, [{
+ key: 'resize',
+ value: function resize() {
+ this._resizeImage();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize();
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ if (this.options.shapeProperties.useBorderWithImage === true) {
+ var neutralborderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+ var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, borderWidth);
+
+ ctx.beginPath();
+
+ // setup the line properties.
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+
+ // set a fillstyle
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+
+ // draw a rectangle to form the border around. This rectangle is filled so the opacity of a picture (in future vis releases?) can be used to tint the image
+ ctx.rect(this.left - 0.5 * ctx.lineWidth, this.top - 0.5 * ctx.lineWidth, this.width + ctx.lineWidth, this.height + ctx.lineWidth);
+ ctx.fill();
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ // if borders are zero width, they will be drawn with width 1 by default. This prevents that
+ if (borderWidth > 0) {
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ }
+ ctx.restore();
+
+ ctx.closePath();
+ }
+
+ this._drawImageAtPosition(ctx);
+
+ this._drawImageLabel(ctx, x, y, selected || hover);
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.resize();
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ this.boundingBox.top = this.top;
+ this.boundingBox.left = this.left;
+ this.boundingBox.right = this.left + this.width;
+ this.boundingBox.bottom = this.top + this.height;
+
+ if (this.options.label !== undefined && 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 distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Image;
+ }(_CircleImageBase3.default);
+
+ exports.default = Image;
+
+/***/ },
+/* 79 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ShapeBase2 = __webpack_require__(74);
+
+ var _ShapeBase3 = _interopRequireDefault(_ShapeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Square = function (_ShapeBase) {
+ _inherits(Square, _ShapeBase);
+
+ function Square(options, body, labelModule) {
+ _classCallCheck(this, Square);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Square).call(this, options, body, labelModule));
+ }
+
+ _createClass(Square, [{
+ key: 'resize',
+ value: function resize() {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'square', 2, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Square;
+ }(_ShapeBase3.default);
+
+ exports.default = Square;
+
+/***/ },
+/* 80 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ShapeBase2 = __webpack_require__(74);
+
+ var _ShapeBase3 = _interopRequireDefault(_ShapeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Star = function (_ShapeBase) {
+ _inherits(Star, _ShapeBase);
+
+ function Star(options, body, labelModule) {
+ _classCallCheck(this, Star);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Star).call(this, options, body, labelModule));
+ }
+
+ _createClass(Star, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'star', 4, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Star;
+ }(_ShapeBase3.default);
+
+ exports.default = Star;
+
+/***/ },
+/* 81 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NodeBase2 = __webpack_require__(68);
+
+ var _NodeBase3 = _interopRequireDefault(_NodeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Text = function (_NodeBase) {
+ _inherits(Text, _NodeBase);
+
+ function Text(options, body, labelModule) {
+ _classCallCheck(this, Text);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Text).call(this, options, body, labelModule));
+ }
+
+ _createClass(Text, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ this.width = textSize.width + 2 * margin;
+ this.height = textSize.height + 2 * margin;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected || hover);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ this.labelModule.draw(ctx, x, y, selected || hover);
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected);
+
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ this.boundingBox.top = this.top;
+ this.boundingBox.left = this.left;
+ this.boundingBox.right = this.left + this.width;
+ this.boundingBox.bottom = this.top + this.height;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Text;
+ }(_NodeBase3.default);
+
+ exports.default = Text;
+
+/***/ },
+/* 82 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ShapeBase2 = __webpack_require__(74);
+
+ var _ShapeBase3 = _interopRequireDefault(_ShapeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var Triangle = function (_ShapeBase) {
+ _inherits(Triangle, _ShapeBase);
+
+ function Triangle(options, body, labelModule) {
+ _classCallCheck(this, Triangle);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(Triangle).call(this, options, body, labelModule));
+ }
+
+ _createClass(Triangle, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'triangle', 3, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Triangle;
+ }(_ShapeBase3.default);
+
+ exports.default = Triangle;
+
+/***/ },
+/* 83 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _ShapeBase2 = __webpack_require__(74);
+
+ var _ShapeBase3 = _interopRequireDefault(_ShapeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var TriangleDown = function (_ShapeBase) {
+ _inherits(TriangleDown, _ShapeBase);
+
+ function TriangleDown(options, body, labelModule) {
+ _classCallCheck(this, TriangleDown);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(TriangleDown).call(this, options, body, labelModule));
+ }
+
+ _createClass(TriangleDown, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'triangleDown', 3, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return TriangleDown;
+ }(_ShapeBase3.default);
+
+ exports.default = TriangleDown;
+
+/***/ },
+/* 84 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _Edge = __webpack_require__(85);
+
+ var _Edge2 = _interopRequireDefault(_Edge);
+
+ var _Label = __webpack_require__(66);
+
+ var _Label2 = _interopRequireDefault(_Label);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(9);
+ var DataView = __webpack_require__(11);
+
+ var EdgesHandler = function () {
+ function EdgesHandler(body, images, groups) {
+ var _this = this;
+
+ _classCallCheck(this, EdgesHandler);
+
+ this.body = body;
+ this.images = images;
+ this.groups = groups;
+
+ // create the edge API in the body container
+ this.body.functions.createEdge = this.create.bind(this);
+
+ this.edgesListeners = {
+ add: function add(event, params) {
+ _this.add(params.items);
+ },
+ update: function update(event, params) {
+ _this.update(params.items);
+ },
+ remove: function remove(event, params) {
+ _this.remove(params.items);
+ }
+ };
+
+ this.options = {};
+ this.defaultOptions = {
+ arrows: {
+ to: { enabled: false, scaleFactor: 1 }, // boolean / {arrowScaleFactor:1} / {enabled: false, arrowScaleFactor:1}
+ middle: { enabled: false, scaleFactor: 1 },
+ from: { enabled: false, scaleFactor: 1 }
+ },
+ arrowStrikethrough: true,
+ color: {
+ color: '#848484',
+ highlight: '#848484',
+ hover: '#848484',
+ inherit: 'from',
+ opacity: 1.0
+ },
+ dashes: false,
+ font: {
+ color: '#343434',
+ size: 14, // px
+ face: 'arial',
+ background: 'none',
+ strokeWidth: 2, // px
+ strokeColor: '#ffffff',
+ align: 'horizontal'
+ },
+ hidden: false,
+ hoverWidth: 1.5,
+ label: undefined,
+ labelHighlightBold: true,
+ length: undefined,
+ physics: true,
+ scaling: {
+ min: 1,
+ max: 15,
+ label: {
+ enabled: true,
+ min: 14,
+ max: 30,
+ maxVisible: 30,
+ drawThreshold: 5
+ },
+ customScalingFunction: function customScalingFunction(min, max, total, value) {
+ if (max === min) {
+ return 0.5;
+ } else {
+ var scale = 1 / (max - min);
+ return Math.max(0, (value - min) * scale);
+ }
+ }
+ },
+ selectionWidth: 1.5,
+ selfReferenceSize: 20,
+ shadow: {
+ enabled: false,
+ color: 'rgba(0,0,0,0.5)',
+ size: 10,
+ x: 5,
+ y: 5
+ },
+ smooth: {
+ enabled: true,
+ type: "dynamic",
+ forceDirection: 'none',
+ roundness: 0.5
+ },
+ title: undefined,
+ width: 1,
+ value: undefined
+ };
+
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(EdgesHandler, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this2 = this;
+
+ // this allows external modules to force all dynamic curves to turn static.
+ this.body.emitter.on("_forceDisableDynamicCurves", function (type) {
+ if (type === 'dynamic') {
+ type = 'continuous';
+ }
+ var emitChange = false;
+ for (var edgeId in _this2.body.edges) {
+ if (_this2.body.edges.hasOwnProperty(edgeId)) {
+ var edge = _this2.body.edges[edgeId];
+ var edgeData = _this2.body.data.edges._data[edgeId];
+
+ // only forcibly remove the smooth curve if the data has been set of the edge has the smooth curves defined.
+ // this is because a change in the global would not affect these curves.
+ if (edgeData !== undefined) {
+ var edgeOptions = edgeData.smooth;
+ if (edgeOptions !== undefined) {
+ if (edgeOptions.enabled === true && edgeOptions.type === 'dynamic') {
+ if (type === undefined) {
+ edge.setOptions({ smooth: false });
+ } else {
+ edge.setOptions({ smooth: { type: type } });
+ }
+ emitChange = true;
+ }
+ }
+ }
+ }
+ }
+ if (emitChange === true) {
+ _this2.body.emitter.emit("_dataChanged");
+ }
+ });
+
+ // this is called when options of EXISTING nodes or edges have changed.
+ this.body.emitter.on("_dataUpdated", function () {
+ _this2.reconnectEdges();
+ _this2.markAllEdgesAsDirty();
+ });
+
+ // refresh the edges. Used when reverting from hierarchical layout
+ this.body.emitter.on("refreshEdges", this.refresh.bind(this));
+ this.body.emitter.on("refresh", this.refresh.bind(this));
+ this.body.emitter.on("destroy", function () {
+ util.forEach(_this2.edgesListeners, function (callback, event) {
+ if (_this2.body.data.edges) _this2.body.data.edges.off(event, callback);
+ });
+ delete _this2.body.functions.createEdge;
+ delete _this2.edgesListeners.add;
+ delete _this2.edgesListeners.update;
+ delete _this2.edgesListeners.remove;
+ delete _this2.edgesListeners;
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ // use the parser from the Edge class to fill in all shorthand notations
+ _Edge2.default.parseOptions(this.options, options);
+
+ // handle multiple input cases for color
+ if (options.color !== undefined) {
+ this.markAllEdgesAsDirty();
+ }
+
+ // update smooth settings in all edges
+ var dataChanged = false;
+ if (options.smooth !== undefined) {
+ for (var edgeId in this.body.edges) {
+ if (this.body.edges.hasOwnProperty(edgeId)) {
+ dataChanged = this.body.edges[edgeId].updateEdgeType() || dataChanged;
+ }
+ }
+ }
+
+ // update fonts in all edges
+ if (options.font !== undefined) {
+ // use the parser from the Label class to fill in all shorthand notations
+ _Label2.default.parseOptions(this.options.font, options);
+ for (var _edgeId in this.body.edges) {
+ if (this.body.edges.hasOwnProperty(_edgeId)) {
+ this.body.edges[_edgeId].updateLabelModule();
+ }
+ }
+ }
+
+ // update the state of the variables if needed
+ if (options.hidden !== undefined || options.physics !== undefined || dataChanged === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }
+
+ /**
+ * Load edges by reading the data table
+ * @param {Array | DataSet | DataView} edges The data containing the edges.
+ * @private
+ * @private
+ */
+
+ }, {
+ key: 'setData',
+ value: function setData(edges) {
+ var _this3 = this;
+
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var oldEdgesData = this.body.data.edges;
+
+ if (edges instanceof DataSet || edges instanceof DataView) {
+ this.body.data.edges = edges;
+ } else if (Array.isArray(edges)) {
+ this.body.data.edges = new DataSet();
+ this.body.data.edges.add(edges);
+ } else if (!edges) {
+ this.body.data.edges = new DataSet();
+ } else {
+ throw new TypeError('Array or DataSet expected');
+ }
+
+ // TODO: is this null or undefined or false?
+ if (oldEdgesData) {
+ // unsubscribe from old dataset
+ util.forEach(this.edgesListeners, function (callback, event) {
+ oldEdgesData.off(event, callback);
+ });
+ }
+
+ // remove drawn edges
+ this.body.edges = {};
+
+ // TODO: is this null or undefined or false?
+ if (this.body.data.edges) {
+ // subscribe to new dataset
+ util.forEach(this.edgesListeners, function (callback, event) {
+ _this3.body.data.edges.on(event, callback);
+ });
+
+ // draw all new nodes
+ var ids = this.body.data.edges.getIds();
+ this.add(ids, true);
+ }
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit("_dataChanged");
+ }
+ }
+
+ /**
+ * Add edges
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+
+ }, {
+ key: 'add',
+ value: function add(ids) {
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var edges = this.body.edges;
+ var edgesData = this.body.data.edges;
+
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+
+ var oldEdge = edges[id];
+ if (oldEdge) {
+ oldEdge.disconnect();
+ }
+
+ var data = edgesData.get(id, { "showInternalIds": true });
+ edges[id] = this.create(data);
+ }
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit("_dataChanged");
+ }
+ }
+
+ /**
+ * Update existing edges, or create them when not yet existing
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+
+ }, {
+ key: 'update',
+ value: function update(ids) {
+ var edges = this.body.edges;
+ var edgesData = this.body.data.edges;
+ var dataChanged = false;
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var data = edgesData.get(id);
+ var edge = edges[id];
+ if (edge !== undefined) {
+ // update edge
+ edge.disconnect();
+ dataChanged = edge.setOptions(data) || dataChanged; // if a support node is added, data can be changed.
+ edge.connect();
+ } else {
+ // create edge
+ this.body.edges[id] = this.create(data);
+ dataChanged = true;
+ }
+ }
+
+ if (dataChanged === true) {
+ this.body.emitter.emit("_dataChanged");
+ } else {
+ this.body.emitter.emit("_dataUpdated");
+ }
+ }
+
+ /**
+ * Remove existing edges. Non existing ids will be ignored
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+
+ }, {
+ key: 'remove',
+ value: function remove(ids) {
+ var edges = this.body.edges;
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var edge = edges[id];
+ if (edge !== undefined) {
+ edge.cleanup();
+ edge.disconnect();
+ delete edges[id];
+ }
+ }
+
+ this.body.emitter.emit("_dataChanged");
+ }
+ }, {
+ key: 'refresh',
+ value: function refresh() {
+ var edges = this.body.edges;
+ for (var edgeId in edges) {
+ var edge = undefined;
+ if (edges.hasOwnProperty(edgeId)) {
+ edge = edges[edgeId];
+ }
+ var data = this.body.data.edges._data[edgeId];
+ if (edge !== undefined && data !== undefined) {
+ edge.setOptions(data);
+ }
+ }
+ }
+ }, {
+ key: 'create',
+ value: function create(properties) {
+ return new _Edge2.default(properties, this.body, this.options);
+ }
+ }, {
+ key: 'markAllEdgesAsDirty',
+ value: function markAllEdgesAsDirty() {
+ for (var edgeId in this.body.edges) {
+ this.body.edges[edgeId].edgeType.colorDirty = true;
+ }
+ }
+
+ /**
+ * Reconnect all edges
+ * @private
+ */
+
+ }, {
+ key: 'reconnectEdges',
+ value: function reconnectEdges() {
+ var id;
+ var nodes = this.body.nodes;
+ var edges = this.body.edges;
+
+ for (id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ nodes[id].edges = [];
+ }
+ }
+
+ for (id in edges) {
+ if (edges.hasOwnProperty(id)) {
+ var edge = edges[id];
+ edge.from = null;
+ edge.to = null;
+ edge.connect();
+ }
+ }
+ }
+ }, {
+ key: 'getConnectedNodes',
+ value: function getConnectedNodes(edgeId) {
+ var nodeList = [];
+ if (this.body.edges[edgeId] !== undefined) {
+ var edge = this.body.edges[edgeId];
+ if (edge.fromId) {
+ nodeList.push(edge.fromId);
+ }
+ if (edge.toId) {
+ nodeList.push(edge.toId);
+ }
+ }
+ return nodeList;
+ }
+ }]);
+
+ return EdgesHandler;
+ }();
+
+ exports.default = EdgesHandler;
+
+/***/ },
+/* 85 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _Label = __webpack_require__(66);
+
+ var _Label2 = _interopRequireDefault(_Label);
+
+ var _CubicBezierEdge = __webpack_require__(86);
+
+ var _CubicBezierEdge2 = _interopRequireDefault(_CubicBezierEdge);
+
+ var _BezierEdgeDynamic = __webpack_require__(90);
+
+ var _BezierEdgeDynamic2 = _interopRequireDefault(_BezierEdgeDynamic);
+
+ var _BezierEdgeStatic = __webpack_require__(91);
+
+ var _BezierEdgeStatic2 = _interopRequireDefault(_BezierEdgeStatic);
+
+ var _StraightEdge = __webpack_require__(92);
+
+ var _StraightEdge2 = _interopRequireDefault(_StraightEdge);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @class Edge
+ *
+ * A edge connects two nodes
+ * @param {Object} properties Object with options. Must contain
+ * At least options from and to.
+ * Available options: from (number),
+ * to (number), label (string, color (string),
+ * width (number), style (string),
+ * length (number), title (string)
+ * @param {Network} network A Network object, used to find and edge to
+ * nodes.
+ * @param {Object} constants An object with default values for
+ * example for the color
+ */
+
+ var Edge = function () {
+ function Edge(options, body, globalOptions) {
+ _classCallCheck(this, Edge);
+
+ if (body === undefined) {
+ throw "No body provided";
+ }
+ this.options = util.bridgeObject(globalOptions);
+ this.globalOptions = globalOptions;
+ this.body = body;
+
+ // initialize variables
+ this.id = undefined;
+ this.fromId = undefined;
+ this.toId = undefined;
+ this.selected = false;
+ this.hover = false;
+ this.labelDirty = true;
+ this.colorDirty = true;
+
+ this.baseWidth = this.options.width;
+ this.baseFontSize = this.options.font.size;
+
+ this.from = undefined; // a node
+ this.to = undefined; // a node
+
+ this.edgeType = undefined;
+
+ this.connected = false;
+
+ this.labelModule = new _Label2.default(this.body, this.options, true /* It's an edge label */);
+
+ this.setOptions(options);
+ }
+
+ /**
+ * Set or overwrite options for the edge
+ * @param {Object} options an object with options
+ * @param doNotEmit
+ */
+
+
+ _createClass(Edge, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (!options) {
+ return;
+ }
+ this.colorDirty = true;
+
+ Edge.parseOptions(this.options, options, true, this.globalOptions);
+
+ if (options.id !== undefined) {
+ this.id = options.id;
+ }
+ if (options.from !== undefined) {
+ this.fromId = options.from;
+ }
+ if (options.to !== undefined) {
+ this.toId = options.to;
+ }
+ if (options.title !== undefined) {
+ this.title = options.title;
+ }
+ if (options.value !== undefined) {
+ options.value = parseFloat(options.value);
+ }
+
+ // update label Module
+ this.updateLabelModule();
+
+ var dataChanged = this.updateEdgeType();
+
+ // if anything has been updates, reset the selection width and the hover width
+ this._setInteractionWidths();
+
+ // A node is connected when it has a from and to node that both exist in the network.body.nodes.
+ this.connect();
+
+ if (options.hidden !== undefined || options.physics !== undefined) {
+ dataChanged = true;
+ }
+
+ return dataChanged;
+ }
+ }, {
+ key: 'updateLabelModule',
+ // set the object back to the global options
+
+
+ /**
+ * update the options in the label module
+ */
+ value: function updateLabelModule() {
+ this.labelModule.setOptions(this.options, true);
+ if (this.labelModule.baseSize !== undefined) {
+ this.baseFontSize = this.labelModule.baseSize;
+ }
+ }
+
+ /**
+ * update the edge type, set the options
+ * @returns {boolean}
+ */
+
+ }, {
+ key: 'updateEdgeType',
+ value: function updateEdgeType() {
+ var dataChanged = false;
+ var changeInType = true;
+ var smooth = this.options.smooth;
+ if (this.edgeType !== undefined) {
+ if (this.edgeType instanceof _BezierEdgeDynamic2.default && smooth.enabled === true && smooth.type === 'dynamic') {
+ changeInType = false;
+ }
+ if (this.edgeType instanceof _CubicBezierEdge2.default && smooth.enabled === true && smooth.type === 'cubicBezier') {
+ changeInType = false;
+ }
+ if (this.edgeType instanceof _BezierEdgeStatic2.default && smooth.enabled === true && smooth.type !== 'dynamic' && smooth.type !== 'cubicBezier') {
+ changeInType = false;
+ }
+ if (this.edgeType instanceof _StraightEdge2.default && smooth.enabled === false) {
+ changeInType = false;
+ }
+
+ if (changeInType === true) {
+ dataChanged = this.cleanup();
+ }
+ }
+
+ if (changeInType === true) {
+ if (this.options.smooth.enabled === true) {
+ if (this.options.smooth.type === 'dynamic') {
+ dataChanged = true;
+ this.edgeType = new _BezierEdgeDynamic2.default(this.options, this.body, this.labelModule);
+ } else if (this.options.smooth.type === 'cubicBezier') {
+ this.edgeType = new _CubicBezierEdge2.default(this.options, this.body, this.labelModule);
+ } else {
+ this.edgeType = new _BezierEdgeStatic2.default(this.options, this.body, this.labelModule);
+ }
+ } else {
+ this.edgeType = new _StraightEdge2.default(this.options, this.body, this.labelModule);
+ }
+ } else {
+ // if nothing changes, we just set the options.
+ this.edgeType.setOptions(this.options);
+ }
+
+ return dataChanged;
+ }
+
+ /**
+ * Connect an edge to its nodes
+ */
+
+ }, {
+ key: 'connect',
+ value: function connect() {
+ this.disconnect();
+
+ this.from = this.body.nodes[this.fromId] || undefined;
+ this.to = this.body.nodes[this.toId] || undefined;
+ this.connected = this.from !== undefined && this.to !== undefined;
+
+ if (this.connected === true) {
+ this.from.attachEdge(this);
+ this.to.attachEdge(this);
+ } else {
+ if (this.from) {
+ this.from.detachEdge(this);
+ }
+ if (this.to) {
+ this.to.detachEdge(this);
+ }
+ }
+
+ this.edgeType.connect();
+ }
+
+ /**
+ * Disconnect an edge from its nodes
+ */
+
+ }, {
+ key: 'disconnect',
+ value: function disconnect() {
+ if (this.from) {
+ this.from.detachEdge(this);
+ this.from = undefined;
+ }
+ if (this.to) {
+ this.to.detachEdge(this);
+ this.to = undefined;
+ }
+
+ this.connected = false;
+ }
+
+ /**
+ * get the title of this edge.
+ * @return {string} title The title of the edge, or undefined when no title
+ * has been set.
+ */
+
+ }, {
+ key: 'getTitle',
+ value: function getTitle() {
+ return this.title;
+ }
+
+ /**
+ * check if this node is selecte
+ * @return {boolean} selected True if node is selected, else false
+ */
+
+ }, {
+ key: 'isSelected',
+ value: function isSelected() {
+ return this.selected;
+ }
+
+ /**
+ * Retrieve the value of the edge. Can be undefined
+ * @return {Number} value
+ */
+
+ }, {
+ key: 'getValue',
+ value: function getValue() {
+ return this.options.value;
+ }
+
+ /**
+ * Adjust the value range of the edge. The edge will adjust it's width
+ * based on its value.
+ * @param {Number} min
+ * @param {Number} max
+ * @param total
+ */
+
+ }, {
+ key: 'setValueRange',
+ value: function setValueRange(min, max, total) {
+ if (this.options.value !== undefined) {
+ var scale = this.options.scaling.customScalingFunction(min, max, total, this.options.value);
+ var widthDiff = this.options.scaling.max - this.options.scaling.min;
+ if (this.options.scaling.label.enabled === true) {
+ var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;
+ this.options.font.size = this.options.scaling.label.min + scale * fontDiff;
+ }
+ this.options.width = this.options.scaling.min + scale * widthDiff;
+ } else {
+ this.options.width = this.baseWidth;
+ this.options.font.size = this.baseFontSize;
+ }
+
+ this._setInteractionWidths();
+ this.updateLabelModule();
+ }
+ }, {
+ key: '_setInteractionWidths',
+ value: function _setInteractionWidths() {
+ if (typeof this.options.hoverWidth === 'function') {
+ this.edgeType.hoverWidth = this.options.hoverWidth(this.options.width);
+ } else {
+ this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width;
+ }
+
+ if (typeof this.options.selectionWidth === 'function') {
+ this.edgeType.selectionWidth = this.options.selectionWidth(this.options.width);
+ } else {
+ this.edgeType.selectionWidth = this.options.selectionWidth + this.options.width;
+ }
+ }
+
+ /**
+ * Redraw a edge
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+
+ }, {
+ key: 'draw',
+ value: function draw(ctx) {
+ // get the via node from the edge type
+ var viaNode = this.edgeType.getViaNode();
+ var arrowData = {};
+
+ // restore edge targets to defaults
+ this.edgeType.fromPoint = this.edgeType.from;
+ this.edgeType.toPoint = this.edgeType.to;
+
+ // from and to arrows give a different end point for edges. we set them here
+ if (this.options.arrows.from.enabled === true) {
+ arrowData.from = this.edgeType.getArrowData(ctx, 'from', viaNode, this.selected, this.hover);
+ if (this.options.arrowStrikethrough === false) this.edgeType.fromPoint = arrowData.from.core;
+ }
+ if (this.options.arrows.to.enabled === true) {
+ arrowData.to = this.edgeType.getArrowData(ctx, 'to', viaNode, this.selected, this.hover);
+ if (this.options.arrowStrikethrough === false) this.edgeType.toPoint = arrowData.to.core;
+ }
+
+ // the middle arrow depends on the line, which can depend on the to and from arrows so we do this one lastly.
+ if (this.options.arrows.middle.enabled === true) {
+ arrowData.middle = this.edgeType.getArrowData(ctx, 'middle', viaNode, this.selected, this.hover);
+ }
+
+ // draw everything
+ this.edgeType.drawLine(ctx, this.selected, this.hover, viaNode);
+ this.drawArrows(ctx, arrowData);
+ this.drawLabel(ctx, viaNode);
+ }
+ }, {
+ key: 'drawArrows',
+ value: function drawArrows(ctx, arrowData) {
+ if (this.options.arrows.from.enabled === true) {
+ this.edgeType.drawArrowHead(ctx, this.selected, this.hover, arrowData.from);
+ }
+ if (this.options.arrows.middle.enabled === true) {
+ this.edgeType.drawArrowHead(ctx, this.selected, this.hover, arrowData.middle);
+ }
+ if (this.options.arrows.to.enabled === true) {
+ this.edgeType.drawArrowHead(ctx, this.selected, this.hover, arrowData.to);
+ }
+ }
+ }, {
+ key: 'drawLabel',
+ value: function drawLabel(ctx, viaNode) {
+ if (this.options.label !== undefined) {
+ // set style
+ var node1 = this.from;
+ var node2 = this.to;
+ var selected = this.from.selected || this.to.selected || this.selected;
+ if (node1.id != node2.id) {
+ this.labelModule.pointToSelf = false;
+ var point = this.edgeType.getPoint(0.5, viaNode);
+ ctx.save();
+
+ // if the label has to be rotated:
+ if (this.options.font.align !== "horizontal") {
+ this.labelModule.calculateLabelSize(ctx, selected, point.x, point.y);
+ ctx.translate(point.x, this.labelModule.size.yLine);
+ this._rotateForLabelAlignment(ctx);
+ }
+
+ // draw the label
+ this.labelModule.draw(ctx, point.x, point.y, selected);
+ ctx.restore();
+ } else {
+ // Ignore the orientations.
+ this.labelModule.pointToSelf = true;
+ var x, y;
+ var radius = this.options.selfReferenceSize;
+ if (node1.shape.width > node1.shape.height) {
+ x = node1.x + node1.shape.width * 0.5;
+ y = node1.y - radius;
+ } else {
+ x = node1.x + radius;
+ y = node1.y - node1.shape.height * 0.5;
+ }
+ point = this._pointOnCircle(x, y, radius, 0.125);
+ this.labelModule.draw(ctx, point.x, point.y, selected);
+ }
+ }
+ }
+
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top
+ * @return {boolean} True if location is located on the edge
+ */
+
+ }, {
+ key: 'isOverlappingWith',
+ value: function isOverlappingWith(obj) {
+ if (this.connected) {
+ var distMax = 10;
+ var xFrom = this.from.x;
+ var yFrom = this.from.y;
+ var xTo = this.to.x;
+ var yTo = this.to.y;
+ var xObj = obj.left;
+ var yObj = obj.top;
+
+ var dist = this.edgeType.getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj);
+
+ return dist < distMax;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Rotates the canvas so the text is most readable
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+ }, {
+ key: '_rotateForLabelAlignment',
+ value: function _rotateForLabelAlignment(ctx) {
+ var dy = this.from.y - this.to.y;
+ var dx = this.from.x - this.to.x;
+ var angleInDegrees = Math.atan2(dy, dx);
+
+ // rotate so label it is readable
+ if (angleInDegrees < -1 && dx < 0 || angleInDegrees > 0 && dx < 0) {
+ angleInDegrees = angleInDegrees + Math.PI;
+ }
+
+ ctx.rotate(angleInDegrees);
+ }
+
+ /**
+ * Get a point on a circle
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
+ * @return {Object} point
+ * @private
+ */
+
+ }, {
+ key: '_pointOnCircle',
+ value: function _pointOnCircle(x, y, radius, percentage) {
+ var angle = percentage * 2 * Math.PI;
+ return {
+ x: x + radius * Math.cos(angle),
+ y: y - radius * Math.sin(angle)
+ };
+ }
+ }, {
+ key: 'select',
+ value: function select() {
+ this.selected = true;
+ }
+ }, {
+ key: 'unselect',
+ value: function unselect() {
+ this.selected = false;
+ }
+
+ /**
+ * cleans all required things on delete
+ * @returns {*}
+ */
+
+ }, {
+ key: 'cleanup',
+ value: function cleanup() {
+ return this.edgeType.cleanup();
+ }
+ }], [{
+ key: 'parseOptions',
+ value: function parseOptions(parentOptions, newOptions) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+ var globalOptions = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
+
+ var fields = ['arrowStrikethrough', 'id', 'from', 'hidden', 'hoverWidth', 'label', 'labelHighlightBold', 'length', 'line', 'opacity', 'physics', 'scaling', 'selectionWidth', 'selfReferenceSize', 'to', 'title', 'value', 'width'];
+
+ // only deep extend the items in the field array. These do not have shorthand.
+ util.selectiveDeepExtend(fields, parentOptions, newOptions, allowDeletion);
+
+ util.mergeOptions(parentOptions, newOptions, 'smooth', allowDeletion, globalOptions);
+ util.mergeOptions(parentOptions, newOptions, 'shadow', allowDeletion, globalOptions);
+
+ if (newOptions.dashes !== undefined && newOptions.dashes !== null) {
+ parentOptions.dashes = newOptions.dashes;
+ } else if (allowDeletion === true && newOptions.dashes === null) {
+ parentOptions.dashes = Object.create(globalOptions.dashes); // this sets the pointer of the option back to the global option.
+ }
+
+ // set the scaling newOptions
+ if (newOptions.scaling !== undefined && newOptions.scaling !== null) {
+ if (newOptions.scaling.min !== undefined) {
+ parentOptions.scaling.min = newOptions.scaling.min;
+ }
+ if (newOptions.scaling.max !== undefined) {
+ parentOptions.scaling.max = newOptions.scaling.max;
+ }
+ util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling);
+ } else if (allowDeletion === true && newOptions.scaling === null) {
+ parentOptions.scaling = Object.create(globalOptions.scaling); // this sets the pointer of the option back to the global option.
+ }
+
+ // handle multiple input cases for arrows
+ if (newOptions.arrows !== undefined && newOptions.arrows !== null) {
+ if (typeof newOptions.arrows === 'string') {
+ var arrows = newOptions.arrows.toLowerCase();
+ parentOptions.arrows.to.enabled = arrows.indexOf("to") != -1;
+ parentOptions.arrows.middle.enabled = arrows.indexOf("middle") != -1;
+ parentOptions.arrows.from.enabled = arrows.indexOf("from") != -1;
+ } else if (_typeof(newOptions.arrows) === 'object') {
+ util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'to', allowDeletion, globalOptions.arrows);
+ util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'middle', allowDeletion, globalOptions.arrows);
+ util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'from', allowDeletion, globalOptions.arrows);
+ } else {
+ throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:" + JSON.stringify(newOptions.arrows));
+ }
+ } else if (allowDeletion === true && newOptions.arrows === null) {
+ parentOptions.arrows = Object.create(globalOptions.arrows); // this sets the pointer of the option back to the global option.
+ }
+
+ // handle multiple input cases for color
+ if (newOptions.color !== undefined && newOptions.color !== null) {
+ // make a copy of the parent object in case this is referring to the global one (due to object create once, then update)
+ parentOptions.color = util.deepExtend({}, parentOptions.color, true);
+ if (util.isString(newOptions.color)) {
+ parentOptions.color.color = newOptions.color;
+ parentOptions.color.highlight = newOptions.color;
+ parentOptions.color.hover = newOptions.color;
+ parentOptions.color.inherit = false;
+ } else {
+ var colorsDefined = false;
+ if (newOptions.color.color !== undefined) {
+ parentOptions.color.color = newOptions.color.color;colorsDefined = true;
+ }
+ if (newOptions.color.highlight !== undefined) {
+ parentOptions.color.highlight = newOptions.color.highlight;colorsDefined = true;
+ }
+ if (newOptions.color.hover !== undefined) {
+ parentOptions.color.hover = newOptions.color.hover;colorsDefined = true;
+ }
+ if (newOptions.color.inherit !== undefined) {
+ parentOptions.color.inherit = newOptions.color.inherit;
+ }
+ if (newOptions.color.opacity !== undefined) {
+ parentOptions.color.opacity = Math.min(1, Math.max(0, newOptions.color.opacity));
+ }
+
+ if (newOptions.color.inherit === undefined && colorsDefined === true) {
+ parentOptions.color.inherit = false;
+ }
+ }
+ } else if (allowDeletion === true && newOptions.color === null) {
+ parentOptions.color = util.bridgeObject(globalOptions.color); // set the object back to the global options
+ }
+
+ // handle the font settings
+ if (newOptions.font !== undefined && newOptions.font !== null) {
+ _Label2.default.parseOptions(parentOptions.font, newOptions);
+ } else if (allowDeletion === true && newOptions.font === null) {
+ parentOptions.font = util.bridgeObject(globalOptions.font);
+ }
+ }
+ }]);
+
+ return Edge;
+ }();
+
+ exports.default = Edge;
+
+/***/ },
+/* 86 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _CubicBezierEdgeBase2 = __webpack_require__(87);
+
+ var _CubicBezierEdgeBase3 = _interopRequireDefault(_CubicBezierEdgeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var CubicBezierEdge = function (_CubicBezierEdgeBase) {
+ _inherits(CubicBezierEdge, _CubicBezierEdgeBase);
+
+ function CubicBezierEdge(options, body, labelModule) {
+ _classCallCheck(this, CubicBezierEdge);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(CubicBezierEdge).call(this, options, body, labelModule));
+ }
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+
+ _createClass(CubicBezierEdge, [{
+ key: '_line',
+ value: function _line(ctx, viaNodes) {
+ // get the coordinates of the support points.
+ var via1 = viaNodes[0];
+ var via2 = viaNodes[1];
+
+ // start drawing the line.
+ ctx.beginPath();
+ ctx.moveTo(this.fromPoint.x, this.fromPoint.y);
+
+ // fallback to normal straight edges
+ if (viaNodes === undefined || via1.x === undefined) {
+ ctx.lineTo(this.toPoint.x, this.toPoint.y);
+ } else {
+ ctx.bezierCurveTo(via1.x, via1.y, via2.x, via2.y, this.toPoint.x, this.toPoint.y);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ }
+ }, {
+ key: '_getViaCoordinates',
+ value: function _getViaCoordinates() {
+ var dx = this.from.x - this.to.x;
+ var dy = this.from.y - this.to.y;
+
+ var x1 = void 0,
+ y1 = void 0,
+ x2 = void 0,
+ y2 = void 0;
+ var roundness = this.options.smooth.roundness;
+
+ // horizontal if x > y or if direction is forced or if direction is horizontal
+ if ((Math.abs(dx) > Math.abs(dy) || this.options.smooth.forceDirection === true || this.options.smooth.forceDirection === 'horizontal') && this.options.smooth.forceDirection !== 'vertical') {
+ y1 = this.from.y;
+ y2 = this.to.y;
+ x1 = this.from.x - roundness * dx;
+ x2 = this.to.x + roundness * dx;
+ } else {
+ y1 = this.from.y - roundness * dy;
+ y2 = this.to.y + roundness * dy;
+ x1 = this.from.x;
+ x2 = this.to.x;
+ }
+
+ return [{ x: x1, y: y1 }, { x: x2, y: y2 }];
+ }
+ }, {
+ key: 'getViaNode',
+ value: function getViaNode() {
+ return this._getViaCoordinates();
+ }
+ }, {
+ key: '_findBorderPosition',
+ value: function _findBorderPosition(nearNode, ctx) {
+ return this._findBorderPositionBezier(nearNode, ctx);
+ }
+ }, {
+ key: '_getDistanceToEdge',
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ var _ref = arguments.length <= 6 || arguments[6] === undefined ? this._getViaCoordinates() : arguments[6];
+
+ var _ref2 = _slicedToArray(_ref, 2);
+
+ var via1 = _ref2[0];
+ var via2 = _ref2[1];
+ // x3,y3 is the point
+ return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2);
+ }
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param via
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+
+ }, {
+ key: 'getPoint',
+ value: function getPoint(percentage) {
+ var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? this._getViaCoordinates() : arguments[1];
+
+ var _ref4 = _slicedToArray(_ref3, 2);
+
+ var via1 = _ref4[0];
+ var via2 = _ref4[1];
+
+ var t = percentage;
+ var vec = [];
+ vec[0] = Math.pow(1 - t, 3);
+ vec[1] = 3 * t * Math.pow(1 - t, 2);
+ vec[2] = 3 * Math.pow(t, 2) * (1 - t);
+ vec[3] = Math.pow(t, 3);
+ var x = vec[0] * this.fromPoint.x + vec[1] * via1.x + vec[2] * via2.x + vec[3] * this.toPoint.x;
+ var y = vec[0] * this.fromPoint.y + vec[1] * via1.y + vec[2] * via2.y + vec[3] * this.toPoint.y;
+
+ return { x: x, y: y };
+ }
+ }]);
+
+ return CubicBezierEdge;
+ }(_CubicBezierEdgeBase3.default);
+
+ exports.default = CubicBezierEdge;
+
+/***/ },
+/* 87 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _BezierEdgeBase2 = __webpack_require__(88);
+
+ var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var CubicBezierEdgeBase = function (_BezierEdgeBase) {
+ _inherits(CubicBezierEdgeBase, _BezierEdgeBase);
+
+ function CubicBezierEdgeBase(options, body, labelModule) {
+ _classCallCheck(this, CubicBezierEdgeBase);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(CubicBezierEdgeBase).call(this, options, body, labelModule));
+ }
+
+ /**
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * https://en.wikipedia.org/wiki/B%C3%A9zier_curve
+ * @param {number} x1 from x
+ * @param {number} y1 from y
+ * @param {number} x2 to x
+ * @param {number} y2 to y
+ * @param {number} x3 point to check x
+ * @param {number} y3 point to check y
+ * @private
+ */
+
+
+ _createClass(CubicBezierEdgeBase, [{
+ key: '_getDistanceToBezierEdge',
+ value: function _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2) {
+ // x3,y3 is the point
+ var minDistance = 1e9;
+ var distance = void 0;
+ var i = void 0,
+ t = void 0,
+ x = void 0,
+ y = void 0;
+ var lastX = x1;
+ var lastY = y1;
+ var vec = [0, 0, 0, 0];
+ for (i = 1; i < 10; i++) {
+ t = 0.1 * i;
+ vec[0] = Math.pow(1 - t, 3);
+ vec[1] = 3 * t * Math.pow(1 - t, 2);
+ vec[2] = 3 * Math.pow(t, 2) * (1 - t);
+ vec[3] = Math.pow(t, 3);
+ x = vec[0] * x1 + vec[1] * via1.x + vec[2] * via2.x + vec[3] * x2;
+ y = vec[0] * y1 + vec[1] * via1.y + vec[2] * via2.y + vec[3] * y2;
+ if (i > 0) {
+ distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);
+ minDistance = distance < minDistance ? distance : minDistance;
+ }
+ lastX = x;
+ lastY = y;
+ }
+
+ return minDistance;
+ }
+ }]);
+
+ return CubicBezierEdgeBase;
+ }(_BezierEdgeBase3.default);
+
+ exports.default = CubicBezierEdgeBase;
+
+/***/ },
+/* 88 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _EdgeBase2 = __webpack_require__(89);
+
+ var _EdgeBase3 = _interopRequireDefault(_EdgeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var BezierEdgeBase = function (_EdgeBase) {
+ _inherits(BezierEdgeBase, _EdgeBase);
+
+ function BezierEdgeBase(options, body, labelModule) {
+ _classCallCheck(this, BezierEdgeBase);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeBase).call(this, options, body, labelModule));
+ }
+
+ /**
+ * This function uses binary search to look for the point where the bezier curve crosses the border of the node.
+ *
+ * @param nearNode
+ * @param ctx
+ * @param viaNode
+ * @param nearNode
+ * @param ctx
+ * @param viaNode
+ * @param nearNode
+ * @param ctx
+ * @param viaNode
+ */
+
+
+ _createClass(BezierEdgeBase, [{
+ key: '_findBorderPositionBezier',
+ value: function _findBorderPositionBezier(nearNode, ctx) {
+ var viaNode = arguments.length <= 2 || arguments[2] === undefined ? this._getViaCoordinates() : arguments[2];
+
+ var maxIterations = 10;
+ var iteration = 0;
+ var low = 0;
+ var high = 1;
+ var pos, angle, distanceToBorder, distanceToPoint, difference;
+ var threshold = 0.2;
+ var node = this.to;
+ var from = false;
+ if (nearNode.id === this.from.id) {
+ node = this.from;
+ from = true;
+ }
+
+ while (low <= high && iteration < maxIterations) {
+ var middle = (low + high) * 0.5;
+
+ pos = this.getPoint(middle, viaNode);
+ angle = Math.atan2(node.y - pos.y, node.x - pos.x);
+ distanceToBorder = node.distanceToBorder(ctx, angle);
+ distanceToPoint = Math.sqrt(Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2));
+ difference = distanceToBorder - distanceToPoint;
+ if (Math.abs(difference) < threshold) {
+ break; // found
+ } else if (difference < 0) {
+ // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.
+ if (from === false) {
+ low = middle;
+ } else {
+ high = middle;
+ }
+ } else {
+ if (from === false) {
+ high = middle;
+ } else {
+ low = middle;
+ }
+ }
+
+ iteration++;
+ }
+ pos.t = middle;
+
+ return pos;
+ }
+
+ /**
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * @param {number} x1 from x
+ * @param {number} y1 from y
+ * @param {number} x2 to x
+ * @param {number} y2 to y
+ * @param {number} x3 point to check x
+ * @param {number} y3 point to check y
+ * @private
+ */
+
+ }, {
+ key: '_getDistanceToBezierEdge',
+ value: function _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via) {
+ // x3,y3 is the point
+ var minDistance = 1e9;
+ var distance = void 0;
+ var i = void 0,
+ t = void 0,
+ x = void 0,
+ y = void 0;
+ var lastX = x1;
+ var lastY = y1;
+ for (i = 1; i < 10; i++) {
+ t = 0.1 * i;
+ x = Math.pow(1 - t, 2) * x1 + 2 * t * (1 - t) * via.x + Math.pow(t, 2) * x2;
+ y = Math.pow(1 - t, 2) * y1 + 2 * t * (1 - t) * via.y + Math.pow(t, 2) * y2;
+ if (i > 0) {
+ distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);
+ minDistance = distance < minDistance ? distance : minDistance;
+ }
+ lastX = x;
+ lastY = y;
+ }
+
+ return minDistance;
+ }
+ }]);
+
+ return BezierEdgeBase;
+ }(_EdgeBase3.default);
+
+ exports.default = BezierEdgeBase;
+
+/***/ },
+/* 89 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var EdgeBase = function () {
+ function EdgeBase(options, body, labelModule) {
+ _classCallCheck(this, EdgeBase);
+
+ this.body = body;
+ this.labelModule = labelModule;
+ this.options = {};
+ this.setOptions(options);
+ this.colorDirty = true;
+ this.color = {};
+ this.selectionWidth = 2;
+ this.hoverWidth = 1.5;
+ this.fromPoint = this.from;
+ this.toPoint = this.to;
+ }
+
+ _createClass(EdgeBase, [{
+ key: 'connect',
+ value: function connect() {
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+ }
+ }, {
+ key: 'cleanup',
+ value: function cleanup() {
+ return false;
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ this.options = options;
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+ this.id = this.options.id;
+ }
+
+ /**
+ * Redraw a edge as a line
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+ }, {
+ key: 'drawLine',
+ value: function drawLine(ctx, selected, hover, viaNode) {
+ // set style
+ ctx.strokeStyle = this.getColor(ctx, selected, hover);
+ ctx.lineWidth = this.getLineWidth(selected, hover);
+
+ if (this.options.dashes !== false) {
+ this._drawDashedLine(ctx, viaNode);
+ } else {
+ this._drawLine(ctx, viaNode);
+ }
+ }
+ }, {
+ key: '_drawLine',
+ value: function _drawLine(ctx, viaNode, fromPoint, toPoint) {
+ if (this.from != this.to) {
+ // draw line
+ this._line(ctx, viaNode, fromPoint, toPoint);
+ } else {
+ var _getCircleData2 = this._getCircleData(ctx);
+
+ var _getCircleData3 = _slicedToArray(_getCircleData2, 3);
+
+ var x = _getCircleData3[0];
+ var y = _getCircleData3[1];
+ var radius = _getCircleData3[2];
+
+ this._circle(ctx, x, y, radius);
+ }
+ }
+ }, {
+ key: '_drawDashedLine',
+ value: function _drawDashedLine(ctx, viaNode, fromPoint, toPoint) {
+ ctx.lineCap = 'round';
+ var pattern = [5, 5];
+ if (Array.isArray(this.options.dashes) === true) {
+ pattern = this.options.dashes;
+ }
+
+ // only firefox and chrome support this method, else we use the legacy one.
+ if (ctx.setLineDash !== undefined) {
+ ctx.save();
+
+ // set dash settings for chrome or firefox
+ ctx.setLineDash(pattern);
+ ctx.lineDashOffset = 0;
+
+ // draw the line
+ if (this.from != this.to) {
+ // draw line
+ this._line(ctx, viaNode);
+ } else {
+ var _getCircleData4 = this._getCircleData(ctx);
+
+ var _getCircleData5 = _slicedToArray(_getCircleData4, 3);
+
+ var x = _getCircleData5[0];
+ var y = _getCircleData5[1];
+ var radius = _getCircleData5[2];
+
+ this._circle(ctx, x, y, radius);
+ }
+
+ // restore the dash settings.
+ ctx.setLineDash([0]);
+ ctx.lineDashOffset = 0;
+ ctx.restore();
+ } else {
+ // unsupporting smooth lines
+ if (this.from != this.to) {
+ // draw line
+ ctx.dashedLine(this.from.x, this.from.y, this.to.x, this.to.y, pattern);
+ } else {
+ var _getCircleData6 = this._getCircleData(ctx);
+
+ var _getCircleData7 = _slicedToArray(_getCircleData6, 3);
+
+ var _x = _getCircleData7[0];
+ var _y = _getCircleData7[1];
+ var _radius = _getCircleData7[2];
+
+ this._circle(ctx, _x, _y, _radius);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+
+ ctx.stroke();
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+ }
+ }, {
+ key: 'findBorderPosition',
+ value: function findBorderPosition(nearNode, ctx, options) {
+ if (this.from != this.to) {
+ return this._findBorderPosition(nearNode, ctx, options);
+ } else {
+ return this._findBorderPositionCircle(nearNode, ctx, options);
+ }
+ }
+ }, {
+ key: 'findBorderPositions',
+ value: function findBorderPositions(ctx) {
+ var from = {};
+ var to = {};
+ if (this.from != this.to) {
+ from = this._findBorderPosition(this.from, ctx);
+ to = this._findBorderPosition(this.to, ctx);
+ } else {
+ var _getCircleData8 = this._getCircleData(ctx);
+
+ var _getCircleData9 = _slicedToArray(_getCircleData8, 3);
+
+ var x = _getCircleData9[0];
+ var y = _getCircleData9[1];
+ var radius = _getCircleData9[2];
+
+
+ from = this._findBorderPositionCircle(this.from, ctx, { x: x, y: y, low: 0.25, high: 0.6, direction: -1 });
+ to = this._findBorderPositionCircle(this.from, ctx, { x: x, y: y, low: 0.6, high: 0.8, direction: 1 });
+ }
+ return { from: from, to: to };
+ }
+ }, {
+ key: '_getCircleData',
+ value: function _getCircleData(ctx) {
+ var x = void 0,
+ y = void 0;
+ var node = this.from;
+ var radius = this.options.selfReferenceSize;
+
+ if (ctx !== undefined) {
+ if (node.shape.width === undefined) {
+ node.shape.resize(ctx);
+ }
+ }
+
+ // get circle coordinates
+ if (node.shape.width > node.shape.height) {
+ x = node.x + node.shape.width * 0.5;
+ y = node.y - radius;
+ } else {
+ x = node.x + radius;
+ y = node.y - node.shape.height * 0.5;
+ }
+ return [x, y, radius];
+ }
+
+ /**
+ * Get a point on a circle
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
+ * @return {Object} point
+ * @private
+ */
+
+ }, {
+ key: '_pointOnCircle',
+ value: function _pointOnCircle(x, y, radius, percentage) {
+ var angle = percentage * 2 * Math.PI;
+ return {
+ x: x + radius * Math.cos(angle),
+ y: y - radius * Math.sin(angle)
+ };
+ }
+
+ /**
+ * This function uses binary search to look for the point where the circle crosses the border of the node.
+ * @param node
+ * @param ctx
+ * @param options
+ * @returns {*}
+ * @private
+ */
+
+ }, {
+ key: '_findBorderPositionCircle',
+ value: function _findBorderPositionCircle(node, ctx, options) {
+ var x = options.x;
+ var y = options.y;
+ var low = options.low;
+ var high = options.high;
+ var direction = options.direction;
+
+ var maxIterations = 10;
+ var iteration = 0;
+ var radius = this.options.selfReferenceSize;
+ var pos = void 0,
+ angle = void 0,
+ distanceToBorder = void 0,
+ distanceToPoint = void 0,
+ difference = void 0;
+ var threshold = 0.05;
+ var middle = (low + high) * 0.5;
+
+ while (low <= high && iteration < maxIterations) {
+ middle = (low + high) * 0.5;
+
+ pos = this._pointOnCircle(x, y, radius, middle);
+ angle = Math.atan2(node.y - pos.y, node.x - pos.x);
+ distanceToBorder = node.distanceToBorder(ctx, angle);
+ distanceToPoint = Math.sqrt(Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2));
+ difference = distanceToBorder - distanceToPoint;
+ if (Math.abs(difference) < threshold) {
+ break; // found
+ } else if (difference > 0) {
+ // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.
+ if (direction > 0) {
+ low = middle;
+ } else {
+ high = middle;
+ }
+ } else {
+ if (direction > 0) {
+ high = middle;
+ } else {
+ low = middle;
+ }
+ }
+ iteration++;
+ }
+ pos.t = middle;
+
+ return pos;
+ }
+
+ /**
+ * Get the line width of the edge. Depends on width and whether one of the
+ * connected nodes is selected.
+ * @return {Number} width
+ * @private
+ */
+
+ }, {
+ key: 'getLineWidth',
+ value: function getLineWidth(selected, hover) {
+ if (selected === true) {
+ return Math.max(this.selectionWidth, 0.3 / this.body.view.scale);
+ } else {
+ if (hover === true) {
+ return Math.max(this.hoverWidth, 0.3 / this.body.view.scale);
+ } else {
+ return Math.max(this.options.width, 0.3 / this.body.view.scale);
+ }
+ }
+ }
+ }, {
+ key: 'getColor',
+ value: function getColor(ctx, selected, hover) {
+ var colorOptions = this.options.color;
+ if (colorOptions.inherit !== false) {
+ // when this is a loop edge, just use the 'from' method
+ if (colorOptions.inherit === 'both' && this.from.id !== this.to.id) {
+ var grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);
+ var fromColor = void 0,
+ toColor = void 0;
+ fromColor = this.from.options.color.highlight.border;
+ toColor = this.to.options.color.highlight.border;
+
+ if (this.from.selected === false && this.to.selected === false) {
+ fromColor = util.overrideOpacity(this.from.options.color.border, this.options.color.opacity);
+ toColor = util.overrideOpacity(this.to.options.color.border, this.options.color.opacity);
+ } else if (this.from.selected === true && this.to.selected === false) {
+ toColor = this.to.options.color.border;
+ } else if (this.from.selected === false && this.to.selected === true) {
+ fromColor = this.from.options.color.border;
+ }
+ grd.addColorStop(0, fromColor);
+ grd.addColorStop(1, toColor);
+
+ // -------------------- this returns -------------------- //
+ return grd;
+ }
+
+ if (this.colorDirty === true) {
+ if (colorOptions.inherit === "to") {
+ this.color.highlight = this.to.options.color.highlight.border;
+ this.color.hover = this.to.options.color.hover.border;
+ this.color.color = util.overrideOpacity(this.to.options.color.border, colorOptions.opacity);
+ } else {
+ // (this.options.color.inherit.source === "from") {
+ this.color.highlight = this.from.options.color.highlight.border;
+ this.color.hover = this.from.options.color.hover.border;
+ this.color.color = util.overrideOpacity(this.from.options.color.border, colorOptions.opacity);
+ }
+ }
+ } else if (this.colorDirty === true) {
+ this.color.highlight = colorOptions.highlight;
+ this.color.hover = colorOptions.hover;
+ this.color.color = util.overrideOpacity(colorOptions.color, colorOptions.opacity);
+ }
+
+ // if color inherit is on and gradients are used, the function has already returned by now.
+ this.colorDirty = false;
+
+ if (selected === true) {
+ return this.color.highlight;
+ } else if (hover === true) {
+ return this.color.hover;
+ } else {
+ return this.color.color;
+ }
+ }
+
+ /**
+ * Draw a line from a node to itself, a circle
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @private
+ */
+
+ }, {
+ key: '_circle',
+ value: function _circle(ctx, x, y, radius) {
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+
+ // draw a circle
+ ctx.beginPath();
+ ctx.arc(x, y, radius, 0, 2 * Math.PI, false);
+ ctx.stroke();
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+
+ /**
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * @param {number} x1
+ * @param {number} y1
+ * @param {number} x2
+ * @param {number} y2
+ * @param {number} x3
+ * @param {number} y3
+ * @private
+ */
+
+ }, {
+ key: 'getDistanceToEdge',
+ value: function getDistanceToEdge(x1, y1, x2, y2, x3, y3, via) {
+ // x3,y3 is the point
+ var returnValue = 0;
+ if (this.from != this.to) {
+ returnValue = this._getDistanceToEdge(x1, y1, x2, y2, x3, y3, via);
+ } else {
+ var _getCircleData10 = this._getCircleData();
+
+ var _getCircleData11 = _slicedToArray(_getCircleData10, 3);
+
+ var x = _getCircleData11[0];
+ var y = _getCircleData11[1];
+ var radius = _getCircleData11[2];
+
+ var dx = x - x3;
+ var dy = y - y3;
+ returnValue = Math.abs(Math.sqrt(dx * dx + dy * dy) - radius);
+ }
+
+ if (this.labelModule.size.left < x3 && this.labelModule.size.left + this.labelModule.size.width > x3 && this.labelModule.size.top < y3 && this.labelModule.size.top + this.labelModule.size.height > y3) {
+ return 0;
+ } else {
+ return returnValue;
+ }
+ }
+ }, {
+ key: '_getDistanceToLine',
+ value: function _getDistanceToLine(x1, y1, x2, y2, x3, y3) {
+ var px = x2 - x1;
+ var py = y2 - y1;
+ var something = px * px + py * py;
+ var u = ((x3 - x1) * px + (y3 - y1) * py) / something;
+
+ if (u > 1) {
+ u = 1;
+ } else if (u < 0) {
+ u = 0;
+ }
+
+ var x = x1 + u * px;
+ var y = y1 + u * py;
+ var dx = x - x3;
+ var dy = y - y3;
+
+ //# Note: If the actual distance does not matter,
+ //# if you only want to compare what this function
+ //# returns to other results of this function, you
+ //# can just return the squared distance instead
+ //# (i.e. remove the sqrt) to gain a little performance
+
+ return Math.sqrt(dx * dx + dy * dy);
+ }
+
+ /**
+ *
+ * @param ctx
+ * @param position
+ * @param viaNode
+ */
+
+ }, {
+ key: 'getArrowData',
+ value: function getArrowData(ctx, position, viaNode, selected, hover) {
+ // set lets
+ var angle = void 0;
+ var arrowPoint = void 0;
+ var node1 = void 0;
+ var node2 = void 0;
+ var guideOffset = void 0;
+ var scaleFactor = void 0;
+ var lineWidth = this.getLineWidth(selected, hover);
+
+ if (position === 'from') {
+ node1 = this.from;
+ node2 = this.to;
+ guideOffset = 0.1;
+ scaleFactor = this.options.arrows.from.scaleFactor;
+ } else if (position === 'to') {
+ node1 = this.to;
+ node2 = this.from;
+ guideOffset = -0.1;
+ scaleFactor = this.options.arrows.to.scaleFactor;
+ } else {
+ node1 = this.to;
+ node2 = this.from;
+ scaleFactor = this.options.arrows.middle.scaleFactor;
+ }
+
+ // if not connected to itself
+ if (node1 != node2) {
+ if (position !== 'middle') {
+ // draw arrow head
+ if (this.options.smooth.enabled === true) {
+ arrowPoint = this.findBorderPosition(node1, ctx, { via: viaNode });
+ var guidePos = this.getPoint(Math.max(0.0, Math.min(1.0, arrowPoint.t + guideOffset)), viaNode);
+ angle = Math.atan2(arrowPoint.y - guidePos.y, arrowPoint.x - guidePos.x);
+ } else {
+ angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
+ arrowPoint = this.findBorderPosition(node1, ctx);
+ }
+ } else {
+ angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
+ arrowPoint = this.getPoint(0.5, viaNode); // this is 0.6 to account for the size of the arrow.
+ }
+ } else {
+ // draw circle
+
+ var _getCircleData12 = this._getCircleData(ctx);
+
+ var _getCircleData13 = _slicedToArray(_getCircleData12, 3);
+
+ var x = _getCircleData13[0];
+ var y = _getCircleData13[1];
+ var radius = _getCircleData13[2];
+
+
+ if (position === 'from') {
+ arrowPoint = this.findBorderPosition(this.from, ctx, { x: x, y: y, low: 0.25, high: 0.6, direction: -1 });
+ angle = arrowPoint.t * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;
+ } else if (position === 'to') {
+ arrowPoint = this.findBorderPosition(this.from, ctx, { x: x, y: y, low: 0.6, high: 1.0, direction: 1 });
+ angle = arrowPoint.t * -2 * Math.PI + 1.5 * Math.PI - 1.1 * Math.PI;
+ } else {
+ arrowPoint = this._pointOnCircle(x, y, radius, 0.175);
+ angle = 3.9269908169872414; // === 0.175 * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;
+ }
+ }
+
+ var length = 15 * scaleFactor + 3 * lineWidth; // 3* lineWidth is the width of the edge.
+
+ var xi = arrowPoint.x - length * 0.9 * Math.cos(angle);
+ var yi = arrowPoint.y - length * 0.9 * Math.sin(angle);
+ var arrowCore = { x: xi, y: yi };
+
+ return { point: arrowPoint, core: arrowCore, angle: angle, length: length };
+ }
+
+ /**
+ *
+ * @param ctx
+ * @param selected
+ * @param hover
+ * @param arrowData
+ */
+
+ }, {
+ key: 'drawArrowHead',
+ value: function drawArrowHead(ctx, selected, hover, arrowData) {
+ // set style
+ ctx.strokeStyle = this.getColor(ctx, selected, hover);
+ ctx.fillStyle = ctx.strokeStyle;
+ ctx.lineWidth = this.getLineWidth(selected, hover);
+
+ // draw arrow at the end of the line
+ ctx.arrow(arrowData.point.x, arrowData.point.y, arrowData.angle, arrowData.length);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+ }, {
+ key: 'enableShadow',
+ value: function enableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = this.options.shadow.color;
+ ctx.shadowBlur = this.options.shadow.size;
+ ctx.shadowOffsetX = this.options.shadow.x;
+ ctx.shadowOffsetY = this.options.shadow.y;
+ }
+ }
+ }, {
+ key: 'disableShadow',
+ value: function disableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = 'rgba(0,0,0,0)';
+ ctx.shadowBlur = 0;
+ ctx.shadowOffsetX = 0;
+ ctx.shadowOffsetY = 0;
+ }
+ }
+ }]);
+
+ return EdgeBase;
+ }();
+
+ exports.default = EdgeBase;
+
+/***/ },
+/* 90 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _BezierEdgeBase2 = __webpack_require__(88);
+
+ var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var BezierEdgeDynamic = function (_BezierEdgeBase) {
+ _inherits(BezierEdgeDynamic, _BezierEdgeBase);
+
+ function BezierEdgeDynamic(options, body, labelModule) {
+ _classCallCheck(this, BezierEdgeDynamic);
+
+ // --> this calls the setOptions below
+
+ var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeDynamic).call(this, options, body, labelModule));
+ //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked.
+
+
+ _this._boundFunction = function () {
+ _this.positionBezierNode();
+ };
+ _this.body.emitter.on("_repositionBezierNodes", _this._boundFunction);
+ return _this;
+ }
+
+ _createClass(BezierEdgeDynamic, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ // check if the physics has changed.
+ var physicsChange = false;
+ if (this.options.physics !== options.physics) {
+ physicsChange = true;
+ }
+
+ // set the options and the to and from nodes
+ this.options = options;
+ this.id = this.options.id;
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+
+ // setup the support node and connect
+ this.setupSupportNode();
+ this.connect();
+
+ // when we change the physics state of the edge, we reposition the support node.
+ if (physicsChange === true) {
+ this.via.setOptions({ physics: this.options.physics });
+ this.positionBezierNode();
+ }
+ }
+ }, {
+ key: "connect",
+ value: function connect() {
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+ if (this.from === undefined || this.to === undefined || this.options.physics === false) {
+ this.via.setOptions({ physics: false });
+ } else {
+ // fix weird behaviour where a self referencing node has physics enabled
+ if (this.from.id === this.to.id) {
+ this.via.setOptions({ physics: false });
+ } else {
+ this.via.setOptions({ physics: true });
+ }
+ }
+ }
+
+ /**
+ * remove the support nodes
+ * @returns {boolean}
+ */
+
+ }, {
+ key: "cleanup",
+ value: function cleanup() {
+ this.body.emitter.off("_repositionBezierNodes", this._boundFunction);
+ if (this.via !== undefined) {
+ delete this.body.nodes[this.via.id];
+ this.via = undefined;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Bezier curves require an anchor point to calculate the smooth flow. These points are nodes. These nodes are invisible but
+ * are used for the force calculation.
+ *
+ * The changed data is not called, if needed, it is returned by the main edge constructor.
+ * @private
+ */
+
+ }, {
+ key: "setupSupportNode",
+ value: function setupSupportNode() {
+ if (this.via === undefined) {
+ var nodeId = "edgeId:" + this.id;
+ var node = this.body.functions.createNode({
+ id: nodeId,
+ shape: 'circle',
+ physics: true,
+ hidden: true
+ });
+ this.body.nodes[nodeId] = node;
+ this.via = node;
+ this.via.parentEdgeId = this.id;
+ this.positionBezierNode();
+ }
+ }
+ }, {
+ key: "positionBezierNode",
+ value: function positionBezierNode() {
+ if (this.via !== undefined && this.from !== undefined && this.to !== undefined) {
+ this.via.x = 0.5 * (this.from.x + this.to.x);
+ this.via.y = 0.5 * (this.from.y + this.to.y);
+ } else if (this.via !== undefined) {
+ this.via.x = 0;
+ this.via.y = 0;
+ }
+ }
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+ }, {
+ key: "_line",
+ value: function _line(ctx, viaNode) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.fromPoint.x, this.fromPoint.y);
+ // fallback to normal straight edges
+ if (viaNode.x === undefined) {
+ ctx.lineTo(this.toPoint.x, this.toPoint.y);
+ } else {
+ ctx.quadraticCurveTo(viaNode.x, viaNode.y, this.toPoint.x, this.toPoint.y);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ }
+ }, {
+ key: "getViaNode",
+ value: function getViaNode() {
+ return this.via;
+ }
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param viaNode
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+
+ }, {
+ key: "getPoint",
+ value: function getPoint(percentage) {
+ var viaNode = arguments.length <= 1 || arguments[1] === undefined ? this.via : arguments[1];
+
+ var t = percentage;
+ var x = Math.pow(1 - t, 2) * this.fromPoint.x + 2 * t * (1 - t) * viaNode.x + Math.pow(t, 2) * this.toPoint.x;
+ var y = Math.pow(1 - t, 2) * this.fromPoint.y + 2 * t * (1 - t) * viaNode.y + Math.pow(t, 2) * this.toPoint.y;
+
+ return { x: x, y: y };
+ }
+ }, {
+ key: "_findBorderPosition",
+ value: function _findBorderPosition(nearNode, ctx) {
+ return this._findBorderPositionBezier(nearNode, ctx, this.via);
+ }
+ }, {
+ key: "_getDistanceToEdge",
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ // x3,y3 is the point
+ return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, this.via);
+ }
+ }]);
+
+ return BezierEdgeDynamic;
+ }(_BezierEdgeBase3.default);
+
+ exports.default = BezierEdgeDynamic;
+
+/***/ },
+/* 91 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _BezierEdgeBase2 = __webpack_require__(88);
+
+ var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var BezierEdgeStatic = function (_BezierEdgeBase) {
+ _inherits(BezierEdgeStatic, _BezierEdgeBase);
+
+ function BezierEdgeStatic(options, body, labelModule) {
+ _classCallCheck(this, BezierEdgeStatic);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeStatic).call(this, options, body, labelModule));
+ }
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+
+ _createClass(BezierEdgeStatic, [{
+ key: '_line',
+ value: function _line(ctx, viaNode) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.fromPoint.x, this.fromPoint.y);
+
+ // fallback to normal straight edges
+ if (viaNode.x === undefined) {
+ ctx.lineTo(this.toPoint.x, this.toPoint.y);
+ } else {
+ ctx.quadraticCurveTo(viaNode.x, viaNode.y, this.toPoint.x, this.toPoint.y);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ }
+ }, {
+ key: 'getViaNode',
+ value: function getViaNode() {
+ return this._getViaCoordinates();
+ }
+
+ /**
+ * We do not use the to and fromPoints here to make the via nodes the same as edges without arrows.
+ * @returns {{x: undefined, y: undefined}}
+ * @private
+ */
+
+ }, {
+ key: '_getViaCoordinates',
+ value: function _getViaCoordinates() {
+ var xVia = undefined;
+ var yVia = undefined;
+ var factor = this.options.smooth.roundness;
+ var type = this.options.smooth.type;
+ var dx = Math.abs(this.from.x - this.to.x);
+ var dy = Math.abs(this.from.y - this.to.y);
+ if (type === 'discrete' || type === 'diagonalCross') {
+ if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y - factor * dy;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y - factor * dy;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y + factor * dy;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y + factor * dy;
+ }
+ }
+ if (type === "discrete") {
+ xVia = dx < factor * dy ? this.from.x : xVia;
+ }
+ } else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y - factor * dx;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y - factor * dx;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y + factor * dx;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y + factor * dx;
+ }
+ }
+ if (type === "discrete") {
+ yVia = dy < factor * dx ? this.from.y : yVia;
+ }
+ }
+ } else if (type === "straightCross") {
+ if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {
+ // up - down
+ xVia = this.from.x;
+ if (this.from.y < this.to.y) {
+ yVia = this.to.y - (1 - factor) * dy;
+ } else {
+ yVia = this.to.y + (1 - factor) * dy;
+ }
+ } else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ // left - right
+ if (this.from.x < this.to.x) {
+ xVia = this.to.x - (1 - factor) * dx;
+ } else {
+ xVia = this.to.x + (1 - factor) * dx;
+ }
+ yVia = this.from.y;
+ }
+ } else if (type === 'horizontal') {
+ if (this.from.x < this.to.x) {
+ xVia = this.to.x - (1 - factor) * dx;
+ } else {
+ xVia = this.to.x + (1 - factor) * dx;
+ }
+ yVia = this.from.y;
+ } else if (type === 'vertical') {
+ xVia = this.from.x;
+ if (this.from.y < this.to.y) {
+ yVia = this.to.y - (1 - factor) * dy;
+ } else {
+ yVia = this.to.y + (1 - factor) * dy;
+ }
+ } else if (type === 'curvedCW') {
+ dx = this.to.x - this.from.x;
+ dy = this.from.y - this.to.y;
+ var radius = Math.sqrt(dx * dx + dy * dy);
+ var pi = Math.PI;
+
+ var originalAngle = Math.atan2(dy, dx);
+ var myAngle = (originalAngle + (factor * 0.5 + 0.5) * pi) % (2 * pi);
+
+ xVia = this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle);
+ yVia = this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle);
+ } else if (type === 'curvedCCW') {
+ dx = this.to.x - this.from.x;
+ dy = this.from.y - this.to.y;
+ var _radius = Math.sqrt(dx * dx + dy * dy);
+ var _pi = Math.PI;
+
+ var _originalAngle = Math.atan2(dy, dx);
+ var _myAngle = (_originalAngle + (-factor * 0.5 + 0.5) * _pi) % (2 * _pi);
+
+ xVia = this.from.x + (factor * 0.5 + 0.5) * _radius * Math.sin(_myAngle);
+ yVia = this.from.y + (factor * 0.5 + 0.5) * _radius * Math.cos(_myAngle);
+ } else {
+ // continuous
+ if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y - factor * dy;
+ xVia = this.to.x < xVia ? this.to.x : xVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y - factor * dy;
+ xVia = this.to.x > xVia ? this.to.x : xVia;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y + factor * dy;
+ xVia = this.to.x < xVia ? this.to.x : xVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y + factor * dy;
+ xVia = this.to.x > xVia ? this.to.x : xVia;
+ }
+ }
+ } else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y - factor * dx;
+ yVia = this.to.y > yVia ? this.to.y : yVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y - factor * dx;
+ yVia = this.to.y > yVia ? this.to.y : yVia;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y + factor * dx;
+ yVia = this.to.y < yVia ? this.to.y : yVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y + factor * dx;
+ yVia = this.to.y < yVia ? this.to.y : yVia;
+ }
+ }
+ }
+ }
+ return { x: xVia, y: yVia };
+ }
+ }, {
+ key: '_findBorderPosition',
+ value: function _findBorderPosition(nearNode, ctx) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+ return this._findBorderPositionBezier(nearNode, ctx, options.via);
+ }
+ }, {
+ key: '_getDistanceToEdge',
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ var viaNode = arguments.length <= 6 || arguments[6] === undefined ? this._getViaCoordinates() : arguments[6];
+ // x3,y3 is the point
+ return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, viaNode);
+ }
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param viaNode
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+
+ }, {
+ key: 'getPoint',
+ value: function getPoint(percentage) {
+ var viaNode = arguments.length <= 1 || arguments[1] === undefined ? this._getViaCoordinates() : arguments[1];
+
+ var t = percentage;
+ var x = Math.pow(1 - t, 2) * this.fromPoint.x + 2 * t * (1 - t) * viaNode.x + Math.pow(t, 2) * this.toPoint.x;
+ var y = Math.pow(1 - t, 2) * this.fromPoint.y + 2 * t * (1 - t) * viaNode.y + Math.pow(t, 2) * this.toPoint.y;
+
+ return { x: x, y: y };
+ }
+ }]);
+
+ return BezierEdgeStatic;
+ }(_BezierEdgeBase3.default);
+
+ exports.default = BezierEdgeStatic;
+
+/***/ },
+/* 92 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _EdgeBase2 = __webpack_require__(89);
+
+ var _EdgeBase3 = _interopRequireDefault(_EdgeBase2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var StraightEdge = function (_EdgeBase) {
+ _inherits(StraightEdge, _EdgeBase);
+
+ function StraightEdge(options, body, labelModule) {
+ _classCallCheck(this, StraightEdge);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(StraightEdge).call(this, options, body, labelModule));
+ }
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+
+ _createClass(StraightEdge, [{
+ key: '_line',
+ value: function _line(ctx) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.fromPoint.x, this.fromPoint.y);
+ ctx.lineTo(this.toPoint.x, this.toPoint.y);
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ }
+ }, {
+ key: 'getViaNode',
+ value: function getViaNode() {
+ return undefined;
+ }
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param via
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+
+ }, {
+ key: 'getPoint',
+ value: function getPoint(percentage) {
+ return {
+ x: (1 - percentage) * this.fromPoint.x + percentage * this.toPoint.x,
+ y: (1 - percentage) * this.fromPoint.y + percentage * this.toPoint.y
+ };
+ }
+ }, {
+ key: '_findBorderPosition',
+ value: function _findBorderPosition(nearNode, ctx) {
+ var node1 = this.to;
+ var node2 = this.from;
+ if (nearNode.id === this.from.id) {
+ node1 = this.from;
+ node2 = this.to;
+ }
+
+ var angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
+ var dx = node1.x - node2.x;
+ var dy = node1.y - node2.y;
+ var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
+ var toBorderDist = nearNode.distanceToBorder(ctx, angle);
+ var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
+
+ var borderPos = {};
+ borderPos.x = (1 - toBorderPoint) * node2.x + toBorderPoint * node1.x;
+ borderPos.y = (1 - toBorderPoint) * node2.y + toBorderPoint * node1.y;
+
+ return borderPos;
+ }
+ }, {
+ key: '_getDistanceToEdge',
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ // x3,y3 is the point
+ return this._getDistanceToLine(x1, y1, x2, y2, x3, y3);
+ }
+ }]);
+
+ return StraightEdge;
+ }(_EdgeBase3.default);
+
+ exports.default = StraightEdge;
+
+/***/ },
+/* 93 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _BarnesHutSolver = __webpack_require__(94);
+
+ var _BarnesHutSolver2 = _interopRequireDefault(_BarnesHutSolver);
+
+ var _RepulsionSolver = __webpack_require__(95);
+
+ var _RepulsionSolver2 = _interopRequireDefault(_RepulsionSolver);
+
+ var _HierarchicalRepulsionSolver = __webpack_require__(96);
+
+ var _HierarchicalRepulsionSolver2 = _interopRequireDefault(_HierarchicalRepulsionSolver);
+
+ var _SpringSolver = __webpack_require__(97);
+
+ var _SpringSolver2 = _interopRequireDefault(_SpringSolver);
+
+ var _HierarchicalSpringSolver = __webpack_require__(98);
+
+ var _HierarchicalSpringSolver2 = _interopRequireDefault(_HierarchicalSpringSolver);
+
+ var _CentralGravitySolver = __webpack_require__(99);
+
+ var _CentralGravitySolver2 = _interopRequireDefault(_CentralGravitySolver);
+
+ var _FA2BasedRepulsionSolver = __webpack_require__(100);
+
+ var _FA2BasedRepulsionSolver2 = _interopRequireDefault(_FA2BasedRepulsionSolver);
+
+ var _FA2BasedCentralGravitySolver = __webpack_require__(101);
+
+ var _FA2BasedCentralGravitySolver2 = _interopRequireDefault(_FA2BasedCentralGravitySolver);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var PhysicsEngine = function () {
+ function PhysicsEngine(body) {
+ _classCallCheck(this, PhysicsEngine);
+
+ this.body = body;
+ this.physicsBody = { physicsNodeIndices: [], physicsEdgeIndices: [], forces: {}, velocities: {} };
+
+ this.physicsEnabled = true;
+ this.simulationInterval = 1000 / 60;
+ this.requiresTimeout = true;
+ this.previousStates = {};
+ this.referenceState = {};
+ this.freezeCache = {};
+ this.renderTimer = undefined;
+
+ // parameters for the adaptive timestep
+ this.adaptiveTimestep = false;
+ this.adaptiveTimestepEnabled = false;
+ this.adaptiveCounter = 0;
+ this.adaptiveInterval = 3;
+
+ this.stabilized = false;
+ this.startedStabilization = false;
+ this.stabilizationIterations = 0;
+ this.ready = false; // will be set to true if the stabilize
+
+ // default options
+ this.options = {};
+ this.defaultOptions = {
+ enabled: true,
+ barnesHut: {
+ theta: 0.5,
+ gravitationalConstant: -2000,
+ centralGravity: 0.3,
+ springLength: 95,
+ springConstant: 0.04,
+ damping: 0.09,
+ avoidOverlap: 0
+ },
+ forceAtlas2Based: {
+ theta: 0.5,
+ gravitationalConstant: -50,
+ centralGravity: 0.01,
+ springConstant: 0.08,
+ springLength: 100,
+ damping: 0.4,
+ avoidOverlap: 0
+ },
+ repulsion: {
+ centralGravity: 0.2,
+ springLength: 200,
+ springConstant: 0.05,
+ nodeDistance: 100,
+ damping: 0.09,
+ avoidOverlap: 0
+ },
+ hierarchicalRepulsion: {
+ centralGravity: 0.0,
+ springLength: 100,
+ springConstant: 0.01,
+ nodeDistance: 120,
+ damping: 0.09
+ },
+ maxVelocity: 50,
+ minVelocity: 0.75, // px/s
+ solver: 'barnesHut',
+ stabilization: {
+ enabled: true,
+ iterations: 1000, // maximum number of iteration to stabilize
+ updateInterval: 50,
+ onlyDynamicEdges: false,
+ fit: true
+ },
+ timestep: 0.5,
+ adaptiveTimestep: true
+ };
+ util.extend(this.options, this.defaultOptions);
+ this.timestep = 0.5;
+ this.layoutFailed = false;
+
+ this.bindEventListeners();
+ }
+
+ _createClass(PhysicsEngine, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('initPhysics', function () {
+ _this.initPhysics();
+ });
+ this.body.emitter.on('_layoutFailed', function () {
+ _this.layoutFailed = true;
+ });
+ this.body.emitter.on('resetPhysics', function () {
+ _this.stopSimulation();_this.ready = false;
+ });
+ this.body.emitter.on('disablePhysics', function () {
+ _this.physicsEnabled = false;_this.stopSimulation();
+ });
+ this.body.emitter.on('restorePhysics', function () {
+ _this.setOptions(_this.options);
+ if (_this.ready === true) {
+ _this.startSimulation();
+ }
+ });
+ this.body.emitter.on('startSimulation', function () {
+ if (_this.ready === true) {
+ _this.startSimulation();
+ }
+ });
+ this.body.emitter.on('stopSimulation', function () {
+ _this.stopSimulation();
+ });
+ this.body.emitter.on('destroy', function () {
+ _this.stopSimulation(false);
+ _this.body.emitter.off();
+ });
+ // this event will trigger a rebuilding of the cache everything. Used when nodes or edges have been added or removed.
+ this.body.emitter.on("_dataChanged", function () {
+ // update shortcut lists
+ _this.updatePhysicsData();
+ });
+
+ // debug: show forces
+ // this.body.emitter.on("afterDrawing", (ctx) => {this._drawForces(ctx);});
+ }
+
+ /**
+ * set the physics options
+ * @param options
+ */
+
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ if (options === false) {
+ this.options.enabled = false;
+ this.physicsEnabled = false;
+ this.stopSimulation();
+ } else {
+ this.physicsEnabled = true;
+ util.selectiveNotDeepExtend(['stabilization'], this.options, options);
+ util.mergeOptions(this.options, options, 'stabilization');
+
+ if (options.enabled === undefined) {
+ this.options.enabled = true;
+ }
+
+ if (this.options.enabled === false) {
+ this.physicsEnabled = false;
+ this.stopSimulation();
+ }
+
+ // set the timestep
+ this.timestep = this.options.timestep;
+ }
+ }
+ this.init();
+ }
+
+ /**
+ * configure the engine.
+ */
+
+ }, {
+ key: 'init',
+ value: function init() {
+ var options;
+ if (this.options.solver === 'forceAtlas2Based') {
+ options = this.options.forceAtlas2Based;
+ this.nodesSolver = new _FA2BasedRepulsionSolver2.default(this.body, this.physicsBody, options);
+ this.edgesSolver = new _SpringSolver2.default(this.body, this.physicsBody, options);
+ this.gravitySolver = new _FA2BasedCentralGravitySolver2.default(this.body, this.physicsBody, options);
+ } else if (this.options.solver === 'repulsion') {
+ options = this.options.repulsion;
+ this.nodesSolver = new _RepulsionSolver2.default(this.body, this.physicsBody, options);
+ this.edgesSolver = new _SpringSolver2.default(this.body, this.physicsBody, options);
+ this.gravitySolver = new _CentralGravitySolver2.default(this.body, this.physicsBody, options);
+ } else if (this.options.solver === 'hierarchicalRepulsion') {
+ options = this.options.hierarchicalRepulsion;
+ this.nodesSolver = new _HierarchicalRepulsionSolver2.default(this.body, this.physicsBody, options);
+ this.edgesSolver = new _HierarchicalSpringSolver2.default(this.body, this.physicsBody, options);
+ this.gravitySolver = new _CentralGravitySolver2.default(this.body, this.physicsBody, options);
+ } else {
+ // barnesHut
+ options = this.options.barnesHut;
+ this.nodesSolver = new _BarnesHutSolver2.default(this.body, this.physicsBody, options);
+ this.edgesSolver = new _SpringSolver2.default(this.body, this.physicsBody, options);
+ this.gravitySolver = new _CentralGravitySolver2.default(this.body, this.physicsBody, options);
+ }
+
+ this.modelOptions = options;
+ }
+
+ /**
+ * initialize the engine
+ */
+
+ }, {
+ key: 'initPhysics',
+ value: function initPhysics() {
+ if (this.physicsEnabled === true && this.options.enabled === true) {
+ if (this.options.stabilization.enabled === true) {
+ this.stabilize();
+ } else {
+ this.stabilized = false;
+ this.ready = true;
+ this.body.emitter.emit('fit', {}, this.layoutFailed); // if the layout failed, we use the approximation for the zoom
+ this.startSimulation();
+ }
+ } else {
+ this.ready = true;
+ this.body.emitter.emit('fit');
+ }
+ }
+
+ /**
+ * Start the simulation
+ */
+
+ }, {
+ key: 'startSimulation',
+ value: function startSimulation() {
+ if (this.physicsEnabled === true && this.options.enabled === true) {
+ this.stabilized = false;
+
+ // when visible, adaptivity is disabled.
+ this.adaptiveTimestep = false;
+
+ // this sets the width of all nodes initially which could be required for the avoidOverlap
+ this.body.emitter.emit("_resizeNodes");
+ if (this.viewFunction === undefined) {
+ this.viewFunction = this.simulationStep.bind(this);
+ this.body.emitter.on('initRedraw', this.viewFunction);
+ this.body.emitter.emit('_startRendering');
+ }
+ } else {
+ this.body.emitter.emit('_redraw');
+ }
+ }
+
+ /**
+ * Stop the simulation, force stabilization.
+ */
+
+ }, {
+ key: 'stopSimulation',
+ value: function stopSimulation() {
+ var emit = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
+
+ this.stabilized = true;
+ if (emit === true) {
+ this._emitStabilized();
+ }
+ if (this.viewFunction !== undefined) {
+ this.body.emitter.off('initRedraw', this.viewFunction);
+ this.viewFunction = undefined;
+ if (emit === true) {
+ this.body.emitter.emit('_stopRendering');
+ }
+ }
+ }
+
+ /**
+ * The viewFunction inserts this step into each render loop. It calls the physics tick and handles the cleanup at stabilized.
+ *
+ */
+
+ }, {
+ key: 'simulationStep',
+ value: function simulationStep() {
+ // check if the physics have settled
+ var startTime = Date.now();
+ this.physicsTick();
+ var physicsTime = Date.now() - startTime;
+
+ // run double speed if it is a little graph
+ if ((physicsTime < 0.4 * this.simulationInterval || this.runDoubleSpeed === true) && this.stabilized === false) {
+ this.physicsTick();
+
+ // this makes sure there is no jitter. The decision is taken once to run it at double speed.
+ this.runDoubleSpeed = true;
+ }
+
+ if (this.stabilized === true) {
+ this.stopSimulation();
+ }
+ }
+
+ /**
+ * trigger the stabilized event.
+ * @private
+ */
+
+ }, {
+ key: '_emitStabilized',
+ value: function _emitStabilized() {
+ var _this2 = this;
+
+ var amountOfIterations = arguments.length <= 0 || arguments[0] === undefined ? this.stabilizationIterations : arguments[0];
+
+ if (this.stabilizationIterations > 1 || this.startedStabilization === true) {
+ setTimeout(function () {
+ _this2.body.emitter.emit('stabilized', { iterations: amountOfIterations });
+ _this2.startedStabilization = false;
+ _this2.stabilizationIterations = 0;
+ }, 0);
+ }
+ }
+
+ /**
+ * A single simulation step (or 'tick') in the physics simulation
+ *
+ * @private
+ */
+
+ }, {
+ key: 'physicsTick',
+ value: function physicsTick() {
+ // this is here to ensure that there is no start event when the network is already stable.
+ if (this.startedStabilization === false) {
+ this.body.emitter.emit('startStabilizing');
+ this.startedStabilization = true;
+ }
+
+ if (this.stabilized === false) {
+ // adaptivity means the timestep adapts to the situation, only applicable for stabilization
+ if (this.adaptiveTimestep === true && this.adaptiveTimestepEnabled === true) {
+ // this is the factor for increasing the timestep on success.
+ var factor = 1.2;
+
+ // we assume the adaptive interval is
+ if (this.adaptiveCounter % this.adaptiveInterval === 0) {
+ // we leave the timestep stable for "interval" iterations.
+ // first the big step and revert. Revert saves the reference state.
+ this.timestep = 2 * this.timestep;
+ this.calculateForces();
+ this.moveNodes();
+ this.revert();
+
+ // now the normal step. Since this is the last step, it is the more stable one and we will take this.
+ this.timestep = 0.5 * this.timestep;
+
+ // since it's half the step, we do it twice.
+ this.calculateForces();
+ this.moveNodes();
+ this.calculateForces();
+ this.moveNodes();
+
+ // we compare the two steps. if it is acceptable we double the step.
+ if (this._evaluateStepQuality() === true) {
+ this.timestep = factor * this.timestep;
+ } else {
+ // if not, we decrease the step to a minimum of the options timestep.
+ // if the decreased timestep is smaller than the options step, we do not reset the counter
+ // we assume that the options timestep is stable enough.
+ if (this.timestep / factor < this.options.timestep) {
+ this.timestep = this.options.timestep;
+ } else {
+ // if the timestep was larger than 2 times the option one we check the adaptivity again to ensure
+ // that large instabilities do not form.
+ this.adaptiveCounter = -1; // check again next iteration
+ this.timestep = Math.max(this.options.timestep, this.timestep / factor);
+ }
+ }
+ } else {
+ // normal step, keeping timestep constant
+ this.calculateForces();
+ this.moveNodes();
+ }
+
+ // increment the counter
+ this.adaptiveCounter += 1;
+ } else {
+ // case for the static timestep, we reset it to the one in options and take a normal step.
+ this.timestep = this.options.timestep;
+ this.calculateForces();
+ this.moveNodes();
+ }
+
+ // determine if the network has stabilzied
+ if (this.stabilized === true) {
+ this.revert();
+ }
+
+ this.stabilizationIterations++;
+ }
+ }
+
+ /**
+ * Nodes and edges can have the physics toggles on or off. A collection of indices is created here so we can skip the check all the time.
+ *
+ * @private
+ */
+
+ }, {
+ key: 'updatePhysicsData',
+ value: function updatePhysicsData() {
+ this.physicsBody.forces = {};
+ this.physicsBody.physicsNodeIndices = [];
+ this.physicsBody.physicsEdgeIndices = [];
+ var nodes = this.body.nodes;
+ var edges = this.body.edges;
+
+ // get node indices for physics
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ if (nodes[nodeId].options.physics === true) {
+ this.physicsBody.physicsNodeIndices.push(nodes[nodeId].id);
+ }
+ }
+ }
+
+ // get edge indices for physics
+ for (var edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ if (edges[edgeId].options.physics === true) {
+ this.physicsBody.physicsEdgeIndices.push(edges[edgeId].id);
+ }
+ }
+ }
+
+ // get the velocity and the forces vector
+ for (var i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {
+ var _nodeId = this.physicsBody.physicsNodeIndices[i];
+ this.physicsBody.forces[_nodeId] = { x: 0, y: 0 };
+
+ // forces can be reset because they are recalculated. Velocities have to persist.
+ if (this.physicsBody.velocities[_nodeId] === undefined) {
+ this.physicsBody.velocities[_nodeId] = { x: 0, y: 0 };
+ }
+ }
+
+ // clean deleted nodes from the velocity vector
+ for (var _nodeId2 in this.physicsBody.velocities) {
+ if (nodes[_nodeId2] === undefined) {
+ delete this.physicsBody.velocities[_nodeId2];
+ }
+ }
+ }
+
+ /**
+ * Revert the simulation one step. This is done so after stabilization, every new start of the simulation will also say stabilized.
+ */
+
+ }, {
+ key: 'revert',
+ value: function revert() {
+ var nodeIds = Object.keys(this.previousStates);
+ var nodes = this.body.nodes;
+ var velocities = this.physicsBody.velocities;
+ this.referenceState = {};
+
+ for (var i = 0; i < nodeIds.length; i++) {
+ var nodeId = nodeIds[i];
+ if (nodes[nodeId] !== undefined) {
+ if (nodes[nodeId].options.physics === true) {
+ this.referenceState[nodeId] = {
+ positions: { x: nodes[nodeId].x, y: nodes[nodeId].y }
+ };
+ velocities[nodeId].x = this.previousStates[nodeId].vx;
+ velocities[nodeId].y = this.previousStates[nodeId].vy;
+ nodes[nodeId].x = this.previousStates[nodeId].x;
+ nodes[nodeId].y = this.previousStates[nodeId].y;
+ }
+ } else {
+ delete this.previousStates[nodeId];
+ }
+ }
+ }
+
+ /**
+ * This compares the reference state to the current state
+ */
+
+ }, {
+ key: '_evaluateStepQuality',
+ value: function _evaluateStepQuality() {
+ var dx = void 0,
+ dy = void 0,
+ dpos = void 0;
+ var nodes = this.body.nodes;
+ var reference = this.referenceState;
+ var posThreshold = 0.3;
+
+ for (var nodeId in this.referenceState) {
+ if (this.referenceState.hasOwnProperty(nodeId) && nodes[nodeId] !== undefined) {
+ dx = nodes[nodeId].x - reference[nodeId].positions.x;
+ dy = nodes[nodeId].y - reference[nodeId].positions.y;
+
+ dpos = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
+
+ if (dpos > posThreshold) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * move the nodes one timestep and check if they are stabilized
+ * @returns {boolean}
+ */
+
+ }, {
+ key: 'moveNodes',
+ value: function moveNodes() {
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var maxVelocity = this.options.maxVelocity ? this.options.maxVelocity : 1e9;
+ var maxNodeVelocity = 0;
+ var averageNodeVelocity = 0;
+
+ // the velocity threshold (energy in the system) for the adaptivity toggle
+ var velocityAdaptiveThreshold = 5;
+
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ var nodeVelocity = this._performStep(nodeId, maxVelocity);
+ // stabilized is true if stabilized is true and velocity is smaller than vmin --> all nodes must be stabilized
+ maxNodeVelocity = Math.max(maxNodeVelocity, nodeVelocity);
+ averageNodeVelocity += nodeVelocity;
+ }
+
+ // evaluating the stabilized and adaptiveTimestepEnabled conditions
+ this.adaptiveTimestepEnabled = averageNodeVelocity / nodeIndices.length < velocityAdaptiveThreshold;
+ this.stabilized = maxNodeVelocity < this.options.minVelocity;
+ }
+
+ /**
+ * Perform the actual step
+ *
+ * @param nodeId
+ * @param maxVelocity
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_performStep',
+ value: function _performStep(nodeId, maxVelocity) {
+ var node = this.body.nodes[nodeId];
+ var timestep = this.timestep;
+ var forces = this.physicsBody.forces;
+ var velocities = this.physicsBody.velocities;
+
+ // store the state so we can revert
+ this.previousStates[nodeId] = { x: node.x, y: node.y, vx: velocities[nodeId].x, vy: velocities[nodeId].y };
+
+ if (node.options.fixed.x === false) {
+ var dx = this.modelOptions.damping * velocities[nodeId].x; // damping force
+ var ax = (forces[nodeId].x - dx) / node.options.mass; // acceleration
+ velocities[nodeId].x += ax * timestep; // velocity
+ velocities[nodeId].x = Math.abs(velocities[nodeId].x) > maxVelocity ? velocities[nodeId].x > 0 ? maxVelocity : -maxVelocity : velocities[nodeId].x;
+ node.x += velocities[nodeId].x * timestep; // position
+ } else {
+ forces[nodeId].x = 0;
+ velocities[nodeId].x = 0;
+ }
+
+ if (node.options.fixed.y === false) {
+ var dy = this.modelOptions.damping * velocities[nodeId].y; // damping force
+ var ay = (forces[nodeId].y - dy) / node.options.mass; // acceleration
+ velocities[nodeId].y += ay * timestep; // velocity
+ velocities[nodeId].y = Math.abs(velocities[nodeId].y) > maxVelocity ? velocities[nodeId].y > 0 ? maxVelocity : -maxVelocity : velocities[nodeId].y;
+ node.y += velocities[nodeId].y * timestep; // position
+ } else {
+ forces[nodeId].y = 0;
+ velocities[nodeId].y = 0;
+ }
+
+ var totalVelocity = Math.sqrt(Math.pow(velocities[nodeId].x, 2) + Math.pow(velocities[nodeId].y, 2));
+ return totalVelocity;
+ }
+
+ /**
+ * calculate the forces for one physics iteration.
+ */
+
+ }, {
+ key: 'calculateForces',
+ value: function calculateForces() {
+ this.gravitySolver.solve();
+ this.nodesSolver.solve();
+ this.edgesSolver.solve();
+ }
+
+ /**
+ * When initializing and stabilizing, we can freeze nodes with a predefined position. This greatly speeds up stabilization
+ * because only the supportnodes for the smoothCurves have to settle.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_freezeNodes',
+ value: function _freezeNodes() {
+ var nodes = this.body.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ if (nodes[id].x && nodes[id].y) {
+ this.freezeCache[id] = { x: nodes[id].options.fixed.x, y: nodes[id].options.fixed.y };
+ nodes[id].options.fixed.x = true;
+ nodes[id].options.fixed.y = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * Unfreezes the nodes that have been frozen by _freezeDefinedNodes.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_restoreFrozenNodes',
+ value: function _restoreFrozenNodes() {
+ var nodes = this.body.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ if (this.freezeCache[id] !== undefined) {
+ nodes[id].options.fixed.x = this.freezeCache[id].x;
+ nodes[id].options.fixed.y = this.freezeCache[id].y;
+ }
+ }
+ }
+ this.freezeCache = {};
+ }
+
+ /**
+ * Find a stable position for all nodes
+ */
+
+ }, {
+ key: 'stabilize',
+ value: function stabilize() {
+ var _this3 = this;
+
+ var iterations = arguments.length <= 0 || arguments[0] === undefined ? this.options.stabilization.iterations : arguments[0];
+
+ if (typeof iterations !== 'number') {
+ console.log('The stabilize method needs a numeric amount of iterations. Switching to default: ', this.options.stabilization.iterations);
+ iterations = this.options.stabilization.iterations;
+ }
+
+ if (this.physicsBody.physicsNodeIndices.length === 0) {
+ this.ready = true;
+ return;
+ }
+
+ // enable adaptive timesteps
+ this.adaptiveTimestep = true && this.options.adaptiveTimestep;
+
+ // this sets the width of all nodes initially which could be required for the avoidOverlap
+ this.body.emitter.emit("_resizeNodes");
+
+ // stop the render loop
+ this.stopSimulation();
+
+ // set stabilze to false
+ this.stabilized = false;
+
+ // block redraw requests
+ this.body.emitter.emit('_blockRedraw');
+ this.targetIterations = iterations;
+
+ // start the stabilization
+ if (this.options.stabilization.onlyDynamicEdges === true) {
+ this._freezeNodes();
+ }
+ this.stabilizationIterations = 0;
+
+ setTimeout(function () {
+ return _this3._stabilizationBatch();
+ }, 0);
+ }
+
+ /**
+ * One batch of stabilization
+ * @private
+ */
+
+ }, {
+ key: '_stabilizationBatch',
+ value: function _stabilizationBatch() {
+ // this is here to ensure that there is at least one start event.
+ if (this.startedStabilization === false) {
+ this.body.emitter.emit('startStabilizing');
+ this.startedStabilization = true;
+ }
+
+ var count = 0;
+ while (this.stabilized === false && count < this.options.stabilization.updateInterval && this.stabilizationIterations < this.targetIterations) {
+ this.physicsTick();
+ count++;
+ }
+
+ if (this.stabilized === false && this.stabilizationIterations < this.targetIterations) {
+ this.body.emitter.emit('stabilizationProgress', { iterations: this.stabilizationIterations, total: this.targetIterations });
+ setTimeout(this._stabilizationBatch.bind(this), 0);
+ } else {
+ this._finalizeStabilization();
+ }
+ }
+
+ /**
+ * Wrap up the stabilization, fit and emit the events.
+ * @private
+ */
+
+ }, {
+ key: '_finalizeStabilization',
+ value: function _finalizeStabilization() {
+ this.body.emitter.emit('_allowRedraw');
+ if (this.options.stabilization.fit === true) {
+ this.body.emitter.emit('fit');
+ }
+
+ if (this.options.stabilization.onlyDynamicEdges === true) {
+ this._restoreFrozenNodes();
+ }
+
+ this.body.emitter.emit('stabilizationIterationsDone');
+ this.body.emitter.emit('_requestRedraw');
+
+ if (this.stabilized === true) {
+ this._emitStabilized();
+ } else {
+ this.startSimulation();
+ }
+
+ this.ready = true;
+ }
+ }, {
+ key: '_drawForces',
+ value: function _drawForces(ctx) {
+ for (var i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {
+ var node = this.body.nodes[this.physicsBody.physicsNodeIndices[i]];
+ var force = this.physicsBody.forces[this.physicsBody.physicsNodeIndices[i]];
+ var factor = 20;
+ var colorFactor = 0.03;
+ var forceSize = Math.sqrt(Math.pow(force.x, 2) + Math.pow(force.x, 2));
+
+ var size = Math.min(Math.max(5, forceSize), 15);
+ var arrowSize = 3 * size;
+
+ var color = util.HSVToHex((180 - Math.min(1, Math.max(0, colorFactor * forceSize)) * 180) / 360, 1, 1);
+
+ ctx.lineWidth = size;
+ ctx.strokeStyle = color;
+ ctx.beginPath();
+ ctx.moveTo(node.x, node.y);
+ ctx.lineTo(node.x + factor * force.x, node.y + factor * force.y);
+ ctx.stroke();
+
+ var angle = Math.atan2(force.y, force.x);
+ ctx.fillStyle = color;
+ ctx.arrow(node.x + factor * force.x + Math.cos(angle) * arrowSize, node.y + factor * force.y + Math.sin(angle) * arrowSize, angle, arrowSize);
+ ctx.fill();
+ }
+ }
+ }]);
+
+ return PhysicsEngine;
+ }();
+
+ exports.default = PhysicsEngine;
+
+/***/ },
+/* 94 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var BarnesHutSolver = function () {
+ function BarnesHutSolver(body, physicsBody, options) {
+ _classCallCheck(this, BarnesHutSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.barnesHutTree;
+ this.setOptions(options);
+ this.randomSeed = 5;
+
+ // debug: show grid
+ //this.body.emitter.on("afterDrawing", (ctx) => {this._debug(ctx,'#ff0000')})
+ }
+
+ _createClass(BarnesHutSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ this.thetaInversed = 1 / this.options.theta;
+ this.overlapAvoidanceFactor = 1 - Math.max(0, Math.min(1, this.options.avoidOverlap)); // if 1 then min distance = 0.5, if 0.5 then min distance = 0.5 + 0.5*node.shape.radius
+ }
+ }, {
+ key: "seededRandom",
+ value: function seededRandom() {
+ var x = Math.sin(this.randomSeed++) * 10000;
+ return x - Math.floor(x);
+ }
+
+ /**
+ * This function calculates the forces the nodes apply on each other based on a gravitational model.
+ * The Barnes Hut method is used to speed up this N-body simulation.
+ *
+ * @private
+ */
+
+ }, {
+ key: "solve",
+ value: function solve() {
+ if (this.options.gravitationalConstant !== 0 && this.physicsBody.physicsNodeIndices.length > 0) {
+ var node = void 0;
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var nodeCount = nodeIndices.length;
+
+ // create the tree
+ var barnesHutTree = this._formBarnesHutTree(nodes, nodeIndices);
+
+ // for debugging
+ this.barnesHutTree = barnesHutTree;
+
+ // place the nodes one by one recursively
+ for (var i = 0; i < nodeCount; i++) {
+ node = nodes[nodeIndices[i]];
+ if (node.options.mass > 0) {
+ // starting with root is irrelevant, it never passes the BarnesHutSolver condition
+ this._getForceContribution(barnesHutTree.root.children.NW, node);
+ this._getForceContribution(barnesHutTree.root.children.NE, node);
+ this._getForceContribution(barnesHutTree.root.children.SW, node);
+ this._getForceContribution(barnesHutTree.root.children.SE, node);
+ }
+ }
+ }
+ }
+
+ /**
+ * This function traverses the barnesHutTree. It checks when it can approximate distant nodes with their center of mass.
+ * If a region contains a single node, we check if it is not itself, then we apply the force.
+ *
+ * @param parentBranch
+ * @param node
+ * @private
+ */
+
+ }, {
+ key: "_getForceContribution",
+ value: function _getForceContribution(parentBranch, node) {
+ // we get no force contribution from an empty region
+ if (parentBranch.childrenCount > 0) {
+ var dx = void 0,
+ dy = void 0,
+ distance = void 0;
+
+ // get the distance from the center of mass to the node.
+ dx = parentBranch.centerOfMass.x - node.x;
+ dy = parentBranch.centerOfMass.y - node.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ // BarnesHutSolver condition
+ // original condition : s/d < theta = passed === d/s > 1/theta = passed
+ // calcSize = 1/s --> d * 1/s > 1/theta = passed
+ if (distance * parentBranch.calcSize > this.thetaInversed) {
+ this._calculateForces(distance, dx, dy, node, parentBranch);
+ } else {
+ // Did not pass the condition, go into children if available
+ if (parentBranch.childrenCount === 4) {
+ this._getForceContribution(parentBranch.children.NW, node);
+ this._getForceContribution(parentBranch.children.NE, node);
+ this._getForceContribution(parentBranch.children.SW, node);
+ this._getForceContribution(parentBranch.children.SE, node);
+ } else {
+ // parentBranch must have only one node, if it was empty we wouldnt be here
+ if (parentBranch.children.data.id != node.id) {
+ // if it is not self
+ this._calculateForces(distance, dx, dy, node, parentBranch);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Calculate the forces based on the distance.
+ *
+ * @param distance
+ * @param dx
+ * @param dy
+ * @param node
+ * @param parentBranch
+ * @private
+ */
+
+ }, {
+ key: "_calculateForces",
+ value: function _calculateForces(distance, dx, dy, node, parentBranch) {
+ if (distance === 0) {
+ distance = 0.1;
+ dx = distance;
+ }
+
+ if (this.overlapAvoidanceFactor < 1) {
+ distance = Math.max(0.1 + this.overlapAvoidanceFactor * node.shape.radius, distance - node.shape.radius);
+ }
+
+ // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines
+ // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce
+ var gravityForce = this.options.gravitationalConstant * parentBranch.mass * node.options.mass / Math.pow(distance, 3);
+ var fx = dx * gravityForce;
+ var fy = dy * gravityForce;
+
+ this.physicsBody.forces[node.id].x += fx;
+ this.physicsBody.forces[node.id].y += fy;
+ }
+
+ /**
+ * This function constructs the barnesHut tree recursively. It creates the root, splits it and starts placing the nodes.
+ *
+ * @param nodes
+ * @param nodeIndices
+ * @private
+ */
+
+ }, {
+ key: "_formBarnesHutTree",
+ value: function _formBarnesHutTree(nodes, nodeIndices) {
+ var node = void 0;
+ var nodeCount = nodeIndices.length;
+
+ var minX = nodes[nodeIndices[0]].x;
+ var minY = nodes[nodeIndices[0]].y;
+ var maxX = nodes[nodeIndices[0]].x;
+ var maxY = nodes[nodeIndices[0]].y;
+
+ // get the range of the nodes
+ for (var i = 1; i < nodeCount; i++) {
+ var x = nodes[nodeIndices[i]].x;
+ var y = nodes[nodeIndices[i]].y;
+ if (nodes[nodeIndices[i]].options.mass > 0) {
+ if (x < minX) {
+ minX = x;
+ }
+ if (x > maxX) {
+ maxX = x;
+ }
+ if (y < minY) {
+ minY = y;
+ }
+ if (y > maxY) {
+ maxY = y;
+ }
+ }
+ }
+ // make the range a square
+ var sizeDiff = Math.abs(maxX - minX) - Math.abs(maxY - minY); // difference between X and Y
+ if (sizeDiff > 0) {
+ minY -= 0.5 * sizeDiff;
+ maxY += 0.5 * sizeDiff;
+ } // xSize > ySize
+ else {
+ minX += 0.5 * sizeDiff;
+ maxX -= 0.5 * sizeDiff;
+ } // xSize < ySize
+
+ var minimumTreeSize = 1e-5;
+ var rootSize = Math.max(minimumTreeSize, Math.abs(maxX - minX));
+ var halfRootSize = 0.5 * rootSize;
+ var centerX = 0.5 * (minX + maxX),
+ centerY = 0.5 * (minY + maxY);
+
+ // construct the barnesHutTree
+ var barnesHutTree = {
+ root: {
+ centerOfMass: { x: 0, y: 0 },
+ mass: 0,
+ range: {
+ minX: centerX - halfRootSize, maxX: centerX + halfRootSize,
+ minY: centerY - halfRootSize, maxY: centerY + halfRootSize
+ },
+ size: rootSize,
+ calcSize: 1 / rootSize,
+ children: { data: null },
+ maxWidth: 0,
+ level: 0,
+ childrenCount: 4
+ }
+ };
+ this._splitBranch(barnesHutTree.root);
+
+ // place the nodes one by one recursively
+ for (var _i = 0; _i < nodeCount; _i++) {
+ node = nodes[nodeIndices[_i]];
+ if (node.options.mass > 0) {
+ this._placeInTree(barnesHutTree.root, node);
+ }
+ }
+
+ // make global
+ return barnesHutTree;
+ }
+
+ /**
+ * this updates the mass of a branch. this is increased by adding a node.
+ *
+ * @param parentBranch
+ * @param node
+ * @private
+ */
+
+ }, {
+ key: "_updateBranchMass",
+ value: function _updateBranchMass(parentBranch, node) {
+ var totalMass = parentBranch.mass + node.options.mass;
+ var totalMassInv = 1 / totalMass;
+
+ parentBranch.centerOfMass.x = parentBranch.centerOfMass.x * parentBranch.mass + node.x * node.options.mass;
+ parentBranch.centerOfMass.x *= totalMassInv;
+
+ parentBranch.centerOfMass.y = parentBranch.centerOfMass.y * parentBranch.mass + node.y * node.options.mass;
+ parentBranch.centerOfMass.y *= totalMassInv;
+
+ parentBranch.mass = totalMass;
+ var biggestSize = Math.max(Math.max(node.height, node.radius), node.width);
+ parentBranch.maxWidth = parentBranch.maxWidth < biggestSize ? biggestSize : parentBranch.maxWidth;
+ }
+
+ /**
+ * determine in which branch the node will be placed.
+ *
+ * @param parentBranch
+ * @param node
+ * @param skipMassUpdate
+ * @private
+ */
+
+ }, {
+ key: "_placeInTree",
+ value: function _placeInTree(parentBranch, node, skipMassUpdate) {
+ if (skipMassUpdate != true || skipMassUpdate === undefined) {
+ // update the mass of the branch.
+ this._updateBranchMass(parentBranch, node);
+ }
+
+ if (parentBranch.children.NW.range.maxX > node.x) {
+ // in NW or SW
+ if (parentBranch.children.NW.range.maxY > node.y) {
+ // in NW
+ this._placeInRegion(parentBranch, node, "NW");
+ } else {
+ // in SW
+ this._placeInRegion(parentBranch, node, "SW");
+ }
+ } else {
+ // in NE or SE
+ if (parentBranch.children.NW.range.maxY > node.y) {
+ // in NE
+ this._placeInRegion(parentBranch, node, "NE");
+ } else {
+ // in SE
+ this._placeInRegion(parentBranch, node, "SE");
+ }
+ }
+ }
+
+ /**
+ * actually place the node in a region (or branch)
+ *
+ * @param parentBranch
+ * @param node
+ * @param region
+ * @private
+ */
+
+ }, {
+ key: "_placeInRegion",
+ value: function _placeInRegion(parentBranch, node, region) {
+ switch (parentBranch.children[region].childrenCount) {
+ case 0:
+ // place node here
+ parentBranch.children[region].children.data = node;
+ parentBranch.children[region].childrenCount = 1;
+ this._updateBranchMass(parentBranch.children[region], node);
+ break;
+ case 1:
+ // convert into children
+ // if there are two nodes exactly overlapping (on init, on opening of cluster etc.)
+ // we move one node a little bit and we do not put it in the tree.
+ if (parentBranch.children[region].children.data.x === node.x && parentBranch.children[region].children.data.y === node.y) {
+ node.x += this.seededRandom();
+ node.y += this.seededRandom();
+ } else {
+ this._splitBranch(parentBranch.children[region]);
+ this._placeInTree(parentBranch.children[region], node);
+ }
+ break;
+ case 4:
+ // place in branch
+ this._placeInTree(parentBranch.children[region], node);
+ break;
+ }
+ }
+
+ /**
+ * this function splits a branch into 4 sub branches. If the branch contained a node, we place it in the subbranch
+ * after the split is complete.
+ *
+ * @param parentBranch
+ * @private
+ */
+
+ }, {
+ key: "_splitBranch",
+ value: function _splitBranch(parentBranch) {
+ // if the branch is shaded with a node, replace the node in the new subset.
+ var containedNode = null;
+ if (parentBranch.childrenCount === 1) {
+ containedNode = parentBranch.children.data;
+ parentBranch.mass = 0;
+ parentBranch.centerOfMass.x = 0;
+ parentBranch.centerOfMass.y = 0;
+ }
+ parentBranch.childrenCount = 4;
+ parentBranch.children.data = null;
+ this._insertRegion(parentBranch, "NW");
+ this._insertRegion(parentBranch, "NE");
+ this._insertRegion(parentBranch, "SW");
+ this._insertRegion(parentBranch, "SE");
+
+ if (containedNode != null) {
+ this._placeInTree(parentBranch, containedNode);
+ }
+ }
+
+ /**
+ * This function subdivides the region into four new segments.
+ * Specifically, this inserts a single new segment.
+ * It fills the children section of the parentBranch
+ *
+ * @param parentBranch
+ * @param region
+ * @param parentRange
+ * @private
+ */
+
+ }, {
+ key: "_insertRegion",
+ value: function _insertRegion(parentBranch, region) {
+ var minX = void 0,
+ maxX = void 0,
+ minY = void 0,
+ maxY = void 0;
+ var childSize = 0.5 * parentBranch.size;
+ switch (region) {
+ case "NW":
+ minX = parentBranch.range.minX;
+ maxX = parentBranch.range.minX + childSize;
+ minY = parentBranch.range.minY;
+ maxY = parentBranch.range.minY + childSize;
+ break;
+ case "NE":
+ minX = parentBranch.range.minX + childSize;
+ maxX = parentBranch.range.maxX;
+ minY = parentBranch.range.minY;
+ maxY = parentBranch.range.minY + childSize;
+ break;
+ case "SW":
+ minX = parentBranch.range.minX;
+ maxX = parentBranch.range.minX + childSize;
+ minY = parentBranch.range.minY + childSize;
+ maxY = parentBranch.range.maxY;
+ break;
+ case "SE":
+ minX = parentBranch.range.minX + childSize;
+ maxX = parentBranch.range.maxX;
+ minY = parentBranch.range.minY + childSize;
+ maxY = parentBranch.range.maxY;
+ break;
+ }
+
+ parentBranch.children[region] = {
+ centerOfMass: { x: 0, y: 0 },
+ mass: 0,
+ range: { minX: minX, maxX: maxX, minY: minY, maxY: maxY },
+ size: 0.5 * parentBranch.size,
+ calcSize: 2 * parentBranch.calcSize,
+ children: { data: null },
+ maxWidth: 0,
+ level: parentBranch.level + 1,
+ childrenCount: 0
+ };
+ }
+
+ //--------------------------- DEBUGGING BELOW ---------------------------//
+
+ /**
+ * This function is for debugging purposed, it draws the tree.
+ *
+ * @param ctx
+ * @param color
+ * @private
+ */
+
+ }, {
+ key: "_debug",
+ value: function _debug(ctx, color) {
+ if (this.barnesHutTree !== undefined) {
+
+ ctx.lineWidth = 1;
+
+ this._drawBranch(this.barnesHutTree.root, ctx, color);
+ }
+ }
+
+ /**
+ * This function is for debugging purposes. It draws the branches recursively.
+ *
+ * @param branch
+ * @param ctx
+ * @param color
+ * @private
+ */
+
+ }, {
+ key: "_drawBranch",
+ value: function _drawBranch(branch, ctx, color) {
+ if (color === undefined) {
+ color = "#FF0000";
+ }
+
+ if (branch.childrenCount === 4) {
+ this._drawBranch(branch.children.NW, ctx);
+ this._drawBranch(branch.children.NE, ctx);
+ this._drawBranch(branch.children.SE, ctx);
+ this._drawBranch(branch.children.SW, ctx);
+ }
+ ctx.strokeStyle = color;
+ ctx.beginPath();
+ ctx.moveTo(branch.range.minX, branch.range.minY);
+ ctx.lineTo(branch.range.maxX, branch.range.minY);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.moveTo(branch.range.maxX, branch.range.minY);
+ ctx.lineTo(branch.range.maxX, branch.range.maxY);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.moveTo(branch.range.maxX, branch.range.maxY);
+ ctx.lineTo(branch.range.minX, branch.range.maxY);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.moveTo(branch.range.minX, branch.range.maxY);
+ ctx.lineTo(branch.range.minX, branch.range.minY);
+ ctx.stroke();
+
+ /*
+ if (branch.mass > 0) {
+ ctx.circle(branch.centerOfMass.x, branch.centerOfMass.y, 3*branch.mass);
+ ctx.stroke();
+ }
+ */
+ }
+ }]);
+
+ return BarnesHutSolver;
+ }();
+
+ exports.default = BarnesHutSolver;
+
+/***/ },
+/* 95 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var RepulsionSolver = function () {
+ function RepulsionSolver(body, physicsBody, options) {
+ _classCallCheck(this, RepulsionSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(RepulsionSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ /**
+ * Calculate the forces the nodes apply on each other based on a repulsion field.
+ * This field is linearly approximated.
+ *
+ * @private
+ */
+
+ }, {
+ key: "solve",
+ value: function solve() {
+ var dx, dy, distance, fx, fy, repulsingForce, node1, node2;
+
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ // repulsing forces between nodes
+ var nodeDistance = this.options.nodeDistance;
+
+ // approximation constants
+ var a = -2 / 3 / nodeDistance;
+ var b = 4 / 3;
+
+ // we loop from i over all but the last entree in the array
+ // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j
+ for (var i = 0; i < nodeIndices.length - 1; i++) {
+ node1 = nodes[nodeIndices[i]];
+ for (var j = i + 1; j < nodeIndices.length; j++) {
+ node2 = nodes[nodeIndices[j]];
+
+ dx = node2.x - node1.x;
+ dy = node2.y - node1.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ // same condition as BarnesHutSolver, making sure nodes are never 100% overlapping.
+ if (distance === 0) {
+ distance = 0.1 * Math.random();
+ dx = distance;
+ }
+
+ if (distance < 2 * nodeDistance) {
+ if (distance < 0.5 * nodeDistance) {
+ repulsingForce = 1.0;
+ } else {
+ repulsingForce = a * distance + b; // linear approx of 1 / (1 + Math.exp((distance / nodeDistance - 1) * steepness))
+ }
+ repulsingForce = repulsingForce / distance;
+
+ fx = dx * repulsingForce;
+ fy = dy * repulsingForce;
+
+ forces[node1.id].x -= fx;
+ forces[node1.id].y -= fy;
+ forces[node2.id].x += fx;
+ forces[node2.id].y += fy;
+ }
+ }
+ }
+ }
+ }]);
+
+ return RepulsionSolver;
+ }();
+
+ exports.default = RepulsionSolver;
+
+/***/ },
+/* 96 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var HierarchicalRepulsionSolver = function () {
+ function HierarchicalRepulsionSolver(body, physicsBody, options) {
+ _classCallCheck(this, HierarchicalRepulsionSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(HierarchicalRepulsionSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+
+ /**
+ * Calculate the forces the nodes apply on each other based on a repulsion field.
+ * This field is linearly approximated.
+ *
+ * @private
+ */
+
+ }, {
+ key: "solve",
+ value: function solve() {
+ var dx, dy, distance, fx, fy, repulsingForce, node1, node2, i, j;
+
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ // repulsing forces between nodes
+ var nodeDistance = this.options.nodeDistance;
+
+ // we loop from i over all but the last entree in the array
+ // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j
+ for (i = 0; i < nodeIndices.length - 1; i++) {
+ node1 = nodes[nodeIndices[i]];
+ for (j = i + 1; j < nodeIndices.length; j++) {
+ node2 = nodes[nodeIndices[j]];
+
+ // nodes only affect nodes on their level
+ if (node1.level === node2.level) {
+ dx = node2.x - node1.x;
+ dy = node2.y - node1.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ var steepness = 0.05;
+ if (distance < nodeDistance) {
+ repulsingForce = -Math.pow(steepness * distance, 2) + Math.pow(steepness * nodeDistance, 2);
+ } else {
+ repulsingForce = 0;
+ }
+ // normalize force with
+ if (distance === 0) {
+ distance = 0.01;
+ } else {
+ repulsingForce = repulsingForce / distance;
+ }
+ fx = dx * repulsingForce;
+ fy = dy * repulsingForce;
+
+ forces[node1.id].x -= fx;
+ forces[node1.id].y -= fy;
+ forces[node2.id].x += fx;
+ forces[node2.id].y += fy;
+ }
+ }
+ }
+ }
+ }]);
+
+ return HierarchicalRepulsionSolver;
+ }();
+
+ exports.default = HierarchicalRepulsionSolver;
+
+/***/ },
+/* 97 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var SpringSolver = function () {
+ function SpringSolver(body, physicsBody, options) {
+ _classCallCheck(this, SpringSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(SpringSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+
+ /**
+ * This function calculates the springforces on the nodes, accounting for the support nodes.
+ *
+ * @private
+ */
+
+ }, {
+ key: "solve",
+ value: function solve() {
+ var edgeLength = void 0,
+ edge = void 0;
+ var edgeIndices = this.physicsBody.physicsEdgeIndices;
+ var edges = this.body.edges;
+ var node1 = void 0,
+ node2 = void 0,
+ node3 = void 0;
+
+ // forces caused by the edges, modelled as springs
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ if (edge.connected === true && edge.toId !== edge.fromId) {
+ // only calculate forces if nodes are in the same sector
+ if (this.body.nodes[edge.toId] !== undefined && this.body.nodes[edge.fromId] !== undefined) {
+ if (edge.edgeType.via !== undefined) {
+ edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length;
+ node1 = edge.to;
+ node2 = edge.edgeType.via;
+ node3 = edge.from;
+
+ this._calculateSpringForce(node1, node2, 0.5 * edgeLength);
+ this._calculateSpringForce(node2, node3, 0.5 * edgeLength);
+ } else {
+ // the * 1.5 is here so the edge looks as large as a smooth edge. It does not initially because the smooth edges use
+ // the support nodes which exert a repulsive force on the to and from nodes, making the edge appear larger.
+ edgeLength = edge.options.length === undefined ? this.options.springLength * 1.5 : edge.options.length;
+ this._calculateSpringForce(edge.from, edge.to, edgeLength);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is the code actually performing the calculation for the function above.
+ *
+ * @param node1
+ * @param node2
+ * @param edgeLength
+ * @private
+ */
+
+ }, {
+ key: "_calculateSpringForce",
+ value: function _calculateSpringForce(node1, node2, edgeLength) {
+ var dx = node1.x - node2.x;
+ var dy = node1.y - node2.y;
+ var distance = Math.max(Math.sqrt(dx * dx + dy * dy), 0.01);
+
+ // the 1/distance is so the fx and fy can be calculated without sine or cosine.
+ var springForce = this.options.springConstant * (edgeLength - distance) / distance;
+
+ var fx = dx * springForce;
+ var fy = dy * springForce;
+
+ // handle the case where one node is not part of the physcis
+ if (this.physicsBody.forces[node1.id] !== undefined) {
+ this.physicsBody.forces[node1.id].x += fx;
+ this.physicsBody.forces[node1.id].y += fy;
+ }
+
+ if (this.physicsBody.forces[node2.id] !== undefined) {
+ this.physicsBody.forces[node2.id].x -= fx;
+ this.physicsBody.forces[node2.id].y -= fy;
+ }
+ }
+ }]);
+
+ return SpringSolver;
+ }();
+
+ exports.default = SpringSolver;
+
+/***/ },
+/* 98 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var HierarchicalSpringSolver = function () {
+ function HierarchicalSpringSolver(body, physicsBody, options) {
+ _classCallCheck(this, HierarchicalSpringSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(HierarchicalSpringSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+
+ /**
+ * This function calculates the springforces on the nodes, accounting for the support nodes.
+ *
+ * @private
+ */
+
+ }, {
+ key: "solve",
+ value: function solve() {
+ var edgeLength, edge;
+ var dx, dy, fx, fy, springForce, distance;
+ var edges = this.body.edges;
+ var factor = 0.5;
+
+ var edgeIndices = this.physicsBody.physicsEdgeIndices;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ // initialize the spring force counters
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ forces[nodeId].springFx = 0;
+ forces[nodeId].springFy = 0;
+ }
+
+ // forces caused by the edges, modelled as springs
+ for (var _i = 0; _i < edgeIndices.length; _i++) {
+ edge = edges[edgeIndices[_i]];
+ if (edge.connected === true) {
+ edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length;
+
+ dx = edge.from.x - edge.to.x;
+ dy = edge.from.y - edge.to.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+ distance = distance === 0 ? 0.01 : distance;
+
+ // the 1/distance is so the fx and fy can be calculated without sine or cosine.
+ springForce = this.options.springConstant * (edgeLength - distance) / distance;
+
+ fx = dx * springForce;
+ fy = dy * springForce;
+
+ if (edge.to.level != edge.from.level) {
+ if (forces[edge.toId] !== undefined) {
+ forces[edge.toId].springFx -= fx;
+ forces[edge.toId].springFy -= fy;
+ }
+ if (forces[edge.fromId] !== undefined) {
+ forces[edge.fromId].springFx += fx;
+ forces[edge.fromId].springFy += fy;
+ }
+ } else {
+ if (forces[edge.toId] !== undefined) {
+ forces[edge.toId].x -= factor * fx;
+ forces[edge.toId].y -= factor * fy;
+ }
+ if (forces[edge.fromId] !== undefined) {
+ forces[edge.fromId].x += factor * fx;
+ forces[edge.fromId].y += factor * fy;
+ }
+ }
+ }
+ }
+
+ // normalize spring forces
+ var springForce = 1;
+ var springFx, springFy;
+ for (var _i2 = 0; _i2 < nodeIndices.length; _i2++) {
+ var _nodeId = nodeIndices[_i2];
+ springFx = Math.min(springForce, Math.max(-springForce, forces[_nodeId].springFx));
+ springFy = Math.min(springForce, Math.max(-springForce, forces[_nodeId].springFy));
+
+ forces[_nodeId].x += springFx;
+ forces[_nodeId].y += springFy;
+ }
+
+ // retain energy balance
+ var totalFx = 0;
+ var totalFy = 0;
+ for (var _i3 = 0; _i3 < nodeIndices.length; _i3++) {
+ var _nodeId2 = nodeIndices[_i3];
+ totalFx += forces[_nodeId2].x;
+ totalFy += forces[_nodeId2].y;
+ }
+ var correctionFx = totalFx / nodeIndices.length;
+ var correctionFy = totalFy / nodeIndices.length;
+
+ for (var _i4 = 0; _i4 < nodeIndices.length; _i4++) {
+ var _nodeId3 = nodeIndices[_i4];
+ forces[_nodeId3].x -= correctionFx;
+ forces[_nodeId3].y -= correctionFy;
+ }
+ }
+ }]);
+
+ return HierarchicalSpringSolver;
+ }();
+
+ exports.default = HierarchicalSpringSolver;
+
+/***/ },
+/* 99 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var CentralGravitySolver = function () {
+ function CentralGravitySolver(body, physicsBody, options) {
+ _classCallCheck(this, CentralGravitySolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(CentralGravitySolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "solve",
+ value: function solve() {
+ var dx = void 0,
+ dy = void 0,
+ distance = void 0,
+ node = void 0;
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ node = nodes[nodeId];
+ dx = -node.x;
+ dy = -node.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ this._calculateForces(distance, dx, dy, forces, node);
+ }
+ }
+
+ /**
+ * Calculate the forces based on the distance.
+ * @private
+ */
+
+ }, {
+ key: "_calculateForces",
+ value: function _calculateForces(distance, dx, dy, forces, node) {
+ var gravityForce = distance === 0 ? 0 : this.options.centralGravity / distance;
+ forces[node.id].x = dx * gravityForce;
+ forces[node.id].y = dy * gravityForce;
+ }
+ }]);
+
+ return CentralGravitySolver;
+ }();
+
+ exports.default = CentralGravitySolver;
+
+/***/ },
+/* 100 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _BarnesHutSolver2 = __webpack_require__(94);
+
+ var _BarnesHutSolver3 = _interopRequireDefault(_BarnesHutSolver2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var ForceAtlas2BasedRepulsionSolver = function (_BarnesHutSolver) {
+ _inherits(ForceAtlas2BasedRepulsionSolver, _BarnesHutSolver);
+
+ function ForceAtlas2BasedRepulsionSolver(body, physicsBody, options) {
+ _classCallCheck(this, ForceAtlas2BasedRepulsionSolver);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(ForceAtlas2BasedRepulsionSolver).call(this, body, physicsBody, options));
+ }
+
+ /**
+ * Calculate the forces based on the distance.
+ *
+ * @param distance
+ * @param dx
+ * @param dy
+ * @param node
+ * @param parentBranch
+ * @private
+ */
+
+
+ _createClass(ForceAtlas2BasedRepulsionSolver, [{
+ key: "_calculateForces",
+ value: function _calculateForces(distance, dx, dy, node, parentBranch) {
+ if (distance === 0) {
+ distance = 0.1 * Math.random();
+ dx = distance;
+ }
+
+ if (this.overlapAvoidanceFactor < 1) {
+ distance = Math.max(0.1 + this.overlapAvoidanceFactor * node.shape.radius, distance - node.shape.radius);
+ }
+
+ var degree = node.edges.length + 1;
+ // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines
+ // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce
+ var gravityForce = this.options.gravitationalConstant * parentBranch.mass * node.options.mass * degree / Math.pow(distance, 2);
+ var fx = dx * gravityForce;
+ var fy = dy * gravityForce;
+
+ this.physicsBody.forces[node.id].x += fx;
+ this.physicsBody.forces[node.id].y += fy;
+ }
+ }]);
+
+ return ForceAtlas2BasedRepulsionSolver;
+ }(_BarnesHutSolver3.default);
+
+ exports.default = ForceAtlas2BasedRepulsionSolver;
+
+/***/ },
+/* 101 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _CentralGravitySolver2 = __webpack_require__(99);
+
+ var _CentralGravitySolver3 = _interopRequireDefault(_CentralGravitySolver2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var ForceAtlas2BasedCentralGravitySolver = function (_CentralGravitySolver) {
+ _inherits(ForceAtlas2BasedCentralGravitySolver, _CentralGravitySolver);
+
+ function ForceAtlas2BasedCentralGravitySolver(body, physicsBody, options) {
+ _classCallCheck(this, ForceAtlas2BasedCentralGravitySolver);
+
+ return _possibleConstructorReturn(this, Object.getPrototypeOf(ForceAtlas2BasedCentralGravitySolver).call(this, body, physicsBody, options));
+ }
+
+ /**
+ * Calculate the forces based on the distance.
+ * @private
+ */
+
+
+ _createClass(ForceAtlas2BasedCentralGravitySolver, [{
+ key: "_calculateForces",
+ value: function _calculateForces(distance, dx, dy, forces, node) {
+ if (distance > 0) {
+ var degree = node.edges.length + 1;
+ var gravityForce = this.options.centralGravity * degree * node.options.mass;
+ forces[node.id].x = dx * gravityForce;
+ forces[node.id].y = dy * gravityForce;
+ }
+ }
+ }]);
+
+ return ForceAtlas2BasedCentralGravitySolver;
+ }(_CentralGravitySolver3.default);
+
+ exports.default = ForceAtlas2BasedCentralGravitySolver;
+
+/***/ },
+/* 102 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NetworkUtil = __webpack_require__(103);
+
+ var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil);
+
+ var _Cluster = __webpack_require__(104);
+
+ var _Cluster2 = _interopRequireDefault(_Cluster);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var ClusterEngine = function () {
+ function ClusterEngine(body) {
+ var _this = this;
+
+ _classCallCheck(this, ClusterEngine);
+
+ this.body = body;
+ this.clusteredNodes = {};
+ this.clusteredEdges = {};
+
+ this.options = {};
+ this.defaultOptions = {};
+ util.extend(this.options, this.defaultOptions);
+
+ this.body.emitter.on('_resetData', function () {
+ _this.clusteredNodes = {};_this.clusteredEdges = {};
+ });
+ }
+
+ _createClass(ClusterEngine, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {}
+ }
+
+ /**
+ *
+ * @param hubsize
+ * @param options
+ */
+
+ }, {
+ key: 'clusterByHubsize',
+ value: function clusterByHubsize(hubsize, options) {
+ if (hubsize === undefined) {
+ hubsize = this._getHubSize();
+ } else if ((typeof hubsize === 'undefined' ? 'undefined' : _typeof(hubsize)) === "object") {
+ options = this._checkOptions(hubsize);
+ hubsize = this._getHubSize();
+ }
+
+ var nodesToCluster = [];
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (node.edges.length >= hubsize) {
+ nodesToCluster.push(node.id);
+ }
+ }
+
+ for (var _i = 0; _i < nodesToCluster.length; _i++) {
+ this.clusterByConnection(nodesToCluster[_i], options, true);
+ }
+
+ this.body.emitter.emit('_dataChanged');
+ }
+
+ /**
+ * loop over all nodes, check if they adhere to the condition and cluster if needed.
+ * @param options
+ * @param refreshData
+ */
+
+ }, {
+ key: 'cluster',
+ value: function cluster() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+ var refreshData = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ if (options.joinCondition === undefined) {
+ throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");
+ }
+
+ // check if the options object is fine, append if needed
+ options = this._checkOptions(options);
+
+ var childNodesObj = {};
+ var childEdgesObj = {};
+
+ // collect the nodes that will be in the cluster
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var nodeId = this.body.nodeIndices[i];
+ var node = this.body.nodes[nodeId];
+ var clonedOptions = _NetworkUtil2.default.cloneOptions(node);
+ if (options.joinCondition(clonedOptions) === true) {
+ childNodesObj[nodeId] = this.body.nodes[nodeId];
+
+ // collect the nodes that will be in the cluster
+ for (var _i2 = 0; _i2 < node.edges.length; _i2++) {
+ var edge = node.edges[_i2];
+ if (this.clusteredEdges[edge.id] === undefined) {
+ childEdgesObj[edge.id] = edge;
+ }
+ }
+ }
+ }
+
+ this._cluster(childNodesObj, childEdgesObj, options, refreshData);
+ }
+
+ /**
+ * Cluster all nodes in the network that have only X edges
+ * @param edgeCount
+ * @param options
+ * @param refreshData
+ */
+
+ }, {
+ key: 'clusterByEdgeCount',
+ value: function clusterByEdgeCount(edgeCount, options) {
+ var refreshData = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
+
+ options = this._checkOptions(options);
+ var clusters = [];
+ var usedNodes = {};
+ var edge = void 0,
+ edges = void 0,
+ node = void 0,
+ nodeId = void 0,
+ relevantEdgeCount = void 0;
+ // collect the nodes that will be in the cluster
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var childNodesObj = {};
+ var childEdgesObj = {};
+ nodeId = this.body.nodeIndices[i];
+
+ // if this node is already used in another cluster this session, we do not have to re-evaluate it.
+ if (usedNodes[nodeId] === undefined) {
+ relevantEdgeCount = 0;
+ node = this.body.nodes[nodeId];
+ edges = [];
+ for (var j = 0; j < node.edges.length; j++) {
+ edge = node.edges[j];
+ if (this.clusteredEdges[edge.id] === undefined) {
+ if (edge.toId !== edge.fromId) {
+ relevantEdgeCount++;
+ }
+ edges.push(edge);
+ }
+ }
+
+ // this node qualifies, we collect its neighbours to start the clustering process.
+ if (relevantEdgeCount === edgeCount) {
+ var gatheringSuccessful = true;
+ for (var _j = 0; _j < edges.length; _j++) {
+ edge = edges[_j];
+ var childNodeId = this._getConnectedId(edge, nodeId);
+ // add the nodes to the list by the join condition.
+ if (options.joinCondition === undefined) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[nodeId] = this.body.nodes[nodeId];
+ childNodesObj[childNodeId] = this.body.nodes[childNodeId];
+ usedNodes[nodeId] = true;
+ } else {
+ var clonedOptions = _NetworkUtil2.default.cloneOptions(this.body.nodes[nodeId]);
+ if (options.joinCondition(clonedOptions) === true) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[nodeId] = this.body.nodes[nodeId];
+ usedNodes[nodeId] = true;
+ } else {
+ // this node does not qualify after all.
+ gatheringSuccessful = false;
+ break;
+ }
+ }
+ }
+
+ // add to the cluster queue
+ if (Object.keys(childNodesObj).length > 0 && Object.keys(childEdgesObj).length > 0 && gatheringSuccessful === true) {
+ clusters.push({ nodes: childNodesObj, edges: childEdgesObj });
+ }
+ }
+ }
+ }
+
+ for (var _i3 = 0; _i3 < clusters.length; _i3++) {
+ this._cluster(clusters[_i3].nodes, clusters[_i3].edges, options, false);
+ }
+
+ if (refreshData === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+
+ /**
+ * Cluster all nodes in the network that have only 1 edge
+ * @param options
+ * @param refreshData
+ */
+
+ }, {
+ key: 'clusterOutliers',
+ value: function clusterOutliers(options) {
+ var refreshData = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ this.clusterByEdgeCount(1, options, refreshData);
+ }
+
+ /**
+ * Cluster all nodes in the network that have only 2 edge
+ * @param options
+ * @param refreshData
+ */
+
+ }, {
+ key: 'clusterBridges',
+ value: function clusterBridges(options) {
+ var refreshData = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ this.clusterByEdgeCount(2, options, refreshData);
+ }
+
+ /**
+ * suck all connected nodes of a node into the node.
+ * @param nodeId
+ * @param options
+ * @param refreshData
+ */
+
+ }, {
+ key: 'clusterByConnection',
+ value: function clusterByConnection(nodeId, options) {
+ var refreshData = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
+
+ // kill conditions
+ if (nodeId === undefined) {
+ throw new Error("No nodeId supplied to clusterByConnection!");
+ }
+ if (this.body.nodes[nodeId] === undefined) {
+ throw new Error("The nodeId given to clusterByConnection does not exist!");
+ }
+
+ var node = this.body.nodes[nodeId];
+ options = this._checkOptions(options, node);
+ if (options.clusterNodeProperties.x === undefined) {
+ options.clusterNodeProperties.x = node.x;
+ }
+ if (options.clusterNodeProperties.y === undefined) {
+ options.clusterNodeProperties.y = node.y;
+ }
+ if (options.clusterNodeProperties.fixed === undefined) {
+ options.clusterNodeProperties.fixed = {};
+ options.clusterNodeProperties.fixed.x = node.options.fixed.x;
+ options.clusterNodeProperties.fixed.y = node.options.fixed.y;
+ }
+
+ var childNodesObj = {};
+ var childEdgesObj = {};
+ var parentNodeId = node.id;
+ var parentClonedOptions = _NetworkUtil2.default.cloneOptions(node);
+ childNodesObj[parentNodeId] = node;
+
+ // collect the nodes that will be in the cluster
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ if (this.clusteredEdges[edge.id] === undefined) {
+ var childNodeId = this._getConnectedId(edge, parentNodeId);
+
+ // if the child node is not in a cluster
+ if (this.clusteredNodes[childNodeId] === undefined) {
+ if (childNodeId !== parentNodeId) {
+ if (options.joinCondition === undefined) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[childNodeId] = this.body.nodes[childNodeId];
+ } else {
+ // clone the options and insert some additional parameters that could be interesting.
+ var childClonedOptions = _NetworkUtil2.default.cloneOptions(this.body.nodes[childNodeId]);
+ if (options.joinCondition(parentClonedOptions, childClonedOptions) === true) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[childNodeId] = this.body.nodes[childNodeId];
+ }
+ }
+ } else {
+ // swallow the edge if it is self-referencing.
+ childEdgesObj[edge.id] = edge;
+ }
+ }
+ }
+ }
+
+ this._cluster(childNodesObj, childEdgesObj, options, refreshData);
+ }
+
+ /**
+ * This function creates the edges that will be attached to the cluster
+ * It looks for edges that are connected to the nodes from the "outside' of the cluster.
+ *
+ * @param childNodesObj
+ * @param childEdgesObj
+ * @param clusterNodeProperties
+ * @param clusterEdgeProperties
+ * @private
+ */
+
+ }, {
+ key: '_createClusterEdges',
+ value: function _createClusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, clusterEdgeProperties) {
+ var edge = void 0,
+ childNodeId = void 0,
+ childNode = void 0,
+ toId = void 0,
+ fromId = void 0,
+ otherNodeId = void 0;
+
+ // loop over all child nodes and their edges to find edges going out of the cluster
+ // these edges will be replaced by clusterEdges.
+ var childKeys = Object.keys(childNodesObj);
+ var createEdges = [];
+ for (var i = 0; i < childKeys.length; i++) {
+ childNodeId = childKeys[i];
+ childNode = childNodesObj[childNodeId];
+
+ // construct new edges from the cluster to others
+ for (var j = 0; j < childNode.edges.length; j++) {
+ edge = childNode.edges[j];
+ // we only handle edges that are visible to the system, not the disabled ones from the clustering process.
+ if (this.clusteredEdges[edge.id] === undefined) {
+ // self-referencing edges will be added to the "hidden" list
+ if (edge.toId == edge.fromId) {
+ childEdgesObj[edge.id] = edge;
+ } else {
+ // set up the from and to.
+ if (edge.toId == childNodeId) {
+ // this is a double equals because ints and strings can be interchanged here.
+ toId = clusterNodeProperties.id;
+ fromId = edge.fromId;
+ otherNodeId = fromId;
+ } else {
+ toId = edge.toId;
+ fromId = clusterNodeProperties.id;
+ otherNodeId = toId;
+ }
+ }
+
+ // Only edges from the cluster outwards are being replaced.
+ if (childNodesObj[otherNodeId] === undefined) {
+ createEdges.push({ edge: edge, fromId: fromId, toId: toId });
+ }
+ }
+ }
+ }
+
+ // here we actually create the replacement edges. We could not do this in the loop above as the creation process
+ // would add an edge to the edges array we are iterating over.
+ for (var _j2 = 0; _j2 < createEdges.length; _j2++) {
+ var _edge = createEdges[_j2].edge;
+ // copy the options of the edge we will replace
+ var clonedOptions = _NetworkUtil2.default.cloneOptions(_edge, 'edge');
+ // make sure the properties of clusterEdges are superimposed on it
+ util.deepExtend(clonedOptions, clusterEdgeProperties);
+
+ // set up the edge
+ clonedOptions.from = createEdges[_j2].fromId;
+ clonedOptions.to = createEdges[_j2].toId;
+ clonedOptions.id = 'clusterEdge:' + util.randomUUID();
+ //clonedOptions.id = '(cf: ' + createEdges[j].fromId + " to: " + createEdges[j].toId + ")" + Math.random();
+
+ // create the edge and give a reference to the one it replaced.
+ var newEdge = this.body.functions.createEdge(clonedOptions);
+ newEdge.clusteringEdgeReplacingId = _edge.id;
+
+ // connect the edge.
+ this.body.edges[newEdge.id] = newEdge;
+ newEdge.connect();
+
+ // hide the replaced edge
+ this._backupEdgeOptions(_edge);
+ _edge.setOptions({ physics: false, hidden: true });
+ }
+ }
+
+ /**
+ * This function checks the options that can be supplied to the different cluster functions
+ * for certain fields and inserts defaults if needed
+ * @param options
+ * @returns {*}
+ * @private
+ */
+
+ }, {
+ key: '_checkOptions',
+ value: function _checkOptions() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+ if (options.clusterEdgeProperties === undefined) {
+ options.clusterEdgeProperties = {};
+ }
+ if (options.clusterNodeProperties === undefined) {
+ options.clusterNodeProperties = {};
+ }
+
+ return options;
+ }
+
+ /**
+ *
+ * @param {Object} childNodesObj | object with node objects, id as keys, same as childNodes except it also contains a source node
+ * @param {Object} childEdgesObj | object with edge objects, id as keys
+ * @param {Array} options | object with {clusterNodeProperties, clusterEdgeProperties, processProperties}
+ * @param {Boolean} refreshData | when true, do not wrap up
+ * @private
+ */
+
+ }, {
+ key: '_cluster',
+ value: function _cluster(childNodesObj, childEdgesObj, options) {
+ var refreshData = arguments.length <= 3 || arguments[3] === undefined ? true : arguments[3];
+
+ // kill condition: no children so can't cluster or only one node in the cluster, don't bother
+ if (Object.keys(childNodesObj).length < 2) {
+ return;
+ }
+
+ // check if this cluster call is not trying to cluster anything that is in another cluster.
+ for (var nodeId in childNodesObj) {
+ if (childNodesObj.hasOwnProperty(nodeId)) {
+ if (this.clusteredNodes[nodeId] !== undefined) {
+ return;
+ }
+ }
+ }
+
+ var clusterNodeProperties = util.deepExtend({}, options.clusterNodeProperties);
+
+ // construct the clusterNodeProperties
+ if (options.processProperties !== undefined) {
+ // get the childNode options
+ var childNodesOptions = [];
+ for (var _nodeId in childNodesObj) {
+ if (childNodesObj.hasOwnProperty(_nodeId)) {
+ var clonedOptions = _NetworkUtil2.default.cloneOptions(childNodesObj[_nodeId]);
+ childNodesOptions.push(clonedOptions);
+ }
+ }
+
+ // get cluster properties based on childNodes
+ var childEdgesOptions = [];
+ for (var edgeId in childEdgesObj) {
+ if (childEdgesObj.hasOwnProperty(edgeId)) {
+ // these cluster edges will be removed on creation of the cluster.
+ if (edgeId.substr(0, 12) !== "clusterEdge:") {
+ var _clonedOptions = _NetworkUtil2.default.cloneOptions(childEdgesObj[edgeId], 'edge');
+ childEdgesOptions.push(_clonedOptions);
+ }
+ }
+ }
+
+ clusterNodeProperties = options.processProperties(clusterNodeProperties, childNodesOptions, childEdgesOptions);
+ if (!clusterNodeProperties) {
+ throw new Error("The processProperties function does not return properties!");
+ }
+ }
+
+ // check if we have an unique id;
+ if (clusterNodeProperties.id === undefined) {
+ clusterNodeProperties.id = 'cluster:' + util.randomUUID();
+ }
+ var clusterId = clusterNodeProperties.id;
+
+ if (clusterNodeProperties.label === undefined) {
+ clusterNodeProperties.label = 'cluster';
+ }
+
+ // give the clusterNode a position if it does not have one.
+ var pos = undefined;
+ if (clusterNodeProperties.x === undefined) {
+ pos = this._getClusterPosition(childNodesObj);
+ clusterNodeProperties.x = pos.x;
+ }
+ if (clusterNodeProperties.y === undefined) {
+ if (pos === undefined) {
+ pos = this._getClusterPosition(childNodesObj);
+ }
+ clusterNodeProperties.y = pos.y;
+ }
+
+ // force the ID to remain the same
+ clusterNodeProperties.id = clusterId;
+
+ // create the clusterNode
+ var clusterNode = this.body.functions.createNode(clusterNodeProperties, _Cluster2.default);
+ clusterNode.isCluster = true;
+ clusterNode.containedNodes = childNodesObj;
+ clusterNode.containedEdges = childEdgesObj;
+ // cache a copy from the cluster edge properties if we have to reconnect others later on
+ clusterNode.clusterEdgeProperties = options.clusterEdgeProperties;
+
+ // finally put the cluster node into global
+ this.body.nodes[clusterNodeProperties.id] = clusterNode;
+
+ // create the new edges that will connect to the cluster, all self-referencing edges will be added to childEdgesObject here.
+ this._createClusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, options.clusterEdgeProperties);
+
+ // disable the childEdges
+ for (var _edgeId in childEdgesObj) {
+ if (childEdgesObj.hasOwnProperty(_edgeId)) {
+ if (this.body.edges[_edgeId] !== undefined) {
+ var edge = this.body.edges[_edgeId];
+ // cache the options before changing
+ this._backupEdgeOptions(edge);
+ // disable physics and hide the edge
+ edge.setOptions({ physics: false, hidden: true });
+ }
+ }
+ }
+
+ // disable the childNodes
+ for (var _nodeId2 in childNodesObj) {
+ if (childNodesObj.hasOwnProperty(_nodeId2)) {
+ this.clusteredNodes[_nodeId2] = { clusterId: clusterNodeProperties.id, node: this.body.nodes[_nodeId2] };
+ this.body.nodes[_nodeId2].setOptions({ hidden: true, physics: false });
+ }
+ }
+
+ // set ID to undefined so no duplicates arise
+ clusterNodeProperties.id = undefined;
+
+ // wrap up
+ if (refreshData === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: '_backupEdgeOptions',
+ value: function _backupEdgeOptions(edge) {
+ if (this.clusteredEdges[edge.id] === undefined) {
+ this.clusteredEdges[edge.id] = { physics: edge.options.physics, hidden: edge.options.hidden };
+ }
+ }
+ }, {
+ key: '_restoreEdge',
+ value: function _restoreEdge(edge) {
+ var originalOptions = this.clusteredEdges[edge.id];
+ if (originalOptions !== undefined) {
+ edge.setOptions({ physics: originalOptions.physics, hidden: originalOptions.hidden });
+ delete this.clusteredEdges[edge.id];
+ }
+ }
+
+ /**
+ * Check if a node is a cluster.
+ * @param nodeId
+ * @returns {*}
+ */
+
+ }, {
+ key: 'isCluster',
+ value: function isCluster(nodeId) {
+ if (this.body.nodes[nodeId] !== undefined) {
+ return this.body.nodes[nodeId].isCluster === true;
+ } else {
+ console.log("Node does not exist.");
+ return false;
+ }
+ }
+
+ /**
+ * get the position of the cluster node based on what's inside
+ * @param {object} childNodesObj | object with node objects, id as keys
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+
+ }, {
+ key: '_getClusterPosition',
+ value: function _getClusterPosition(childNodesObj) {
+ var childKeys = Object.keys(childNodesObj);
+ var minX = childNodesObj[childKeys[0]].x;
+ var maxX = childNodesObj[childKeys[0]].x;
+ var minY = childNodesObj[childKeys[0]].y;
+ var maxY = childNodesObj[childKeys[0]].y;
+ var node = void 0;
+ for (var i = 1; i < childKeys.length; i++) {
+ node = childNodesObj[childKeys[i]];
+ minX = node.x < minX ? node.x : minX;
+ maxX = node.x > maxX ? node.x : maxX;
+ minY = node.y < minY ? node.y : minY;
+ maxY = node.y > maxY ? node.y : maxY;
+ }
+
+ return { x: 0.5 * (minX + maxX), y: 0.5 * (minY + maxY) };
+ }
+
+ /**
+ * Open a cluster by calling this function.
+ * @param {String} clusterNodeId | the ID of the cluster node
+ * @param {Boolean} refreshData | wrap up afterwards if not true
+ */
+
+ }, {
+ key: 'openCluster',
+ value: function openCluster(clusterNodeId, options) {
+ var refreshData = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
+
+ // kill conditions
+ if (clusterNodeId === undefined) {
+ throw new Error("No clusterNodeId supplied to openCluster.");
+ }
+ if (this.body.nodes[clusterNodeId] === undefined) {
+ throw new Error("The clusterNodeId supplied to openCluster does not exist.");
+ }
+ if (this.body.nodes[clusterNodeId].containedNodes === undefined) {
+ console.log("The node:" + clusterNodeId + " is not a cluster.");
+ return;
+ }
+ var clusterNode = this.body.nodes[clusterNodeId];
+ var containedNodes = clusterNode.containedNodes;
+ var containedEdges = clusterNode.containedEdges;
+
+ // allow the user to position the nodes after release.
+ if (options !== undefined && options.releaseFunction !== undefined && typeof options.releaseFunction === 'function') {
+ var positions = {};
+ var clusterPosition = { x: clusterNode.x, y: clusterNode.y };
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ var containedNode = this.body.nodes[nodeId];
+ positions[nodeId] = { x: containedNode.x, y: containedNode.y };
+ }
+ }
+ var newPositions = options.releaseFunction(clusterPosition, positions);
+
+ for (var _nodeId3 in containedNodes) {
+ if (containedNodes.hasOwnProperty(_nodeId3)) {
+ var _containedNode = this.body.nodes[_nodeId3];
+ if (newPositions[_nodeId3] !== undefined) {
+ _containedNode.x = newPositions[_nodeId3].x === undefined ? clusterNode.x : newPositions[_nodeId3].x;
+ _containedNode.y = newPositions[_nodeId3].y === undefined ? clusterNode.y : newPositions[_nodeId3].y;
+ }
+ }
+ }
+ } else {
+ // copy the position from the cluster
+ for (var _nodeId4 in containedNodes) {
+ if (containedNodes.hasOwnProperty(_nodeId4)) {
+ var _containedNode2 = this.body.nodes[_nodeId4];
+ _containedNode2 = containedNodes[_nodeId4];
+ // inherit position
+ if (_containedNode2.options.fixed.x === false) {
+ _containedNode2.x = clusterNode.x;
+ }
+ if (_containedNode2.options.fixed.y === false) {
+ _containedNode2.y = clusterNode.y;
+ }
+ }
+ }
+ }
+
+ // release nodes
+ for (var _nodeId5 in containedNodes) {
+ if (containedNodes.hasOwnProperty(_nodeId5)) {
+ var _containedNode3 = this.body.nodes[_nodeId5];
+
+ // inherit speed
+ _containedNode3.vx = clusterNode.vx;
+ _containedNode3.vy = clusterNode.vy;
+
+ // we use these methods to avoid re-instantiating the shape, which happens with setOptions.
+ _containedNode3.setOptions({ hidden: false, physics: true });
+
+ delete this.clusteredNodes[_nodeId5];
+ }
+ }
+
+ // copy the clusterNode edges because we cannot iterate over an object that we add or remove from.
+ var edgesToBeDeleted = [];
+ for (var i = 0; i < clusterNode.edges.length; i++) {
+ edgesToBeDeleted.push(clusterNode.edges[i]);
+ }
+
+ // actually handling the deleting.
+ for (var _i4 = 0; _i4 < edgesToBeDeleted.length; _i4++) {
+ var edge = edgesToBeDeleted[_i4];
+
+ var otherNodeId = this._getConnectedId(edge, clusterNodeId);
+ // if the other node is in another cluster, we transfer ownership of this edge to the other cluster
+ if (this.clusteredNodes[otherNodeId] !== undefined) {
+ // transfer ownership:
+ var otherCluster = this.body.nodes[this.clusteredNodes[otherNodeId].clusterId];
+ var transferEdge = this.body.edges[edge.clusteringEdgeReplacingId];
+ if (transferEdge !== undefined) {
+ otherCluster.containedEdges[transferEdge.id] = transferEdge;
+
+ // delete local reference
+ delete containedEdges[transferEdge.id];
+
+ // create new cluster edge from the otherCluster:
+ // get to and from
+ var fromId = transferEdge.fromId;
+ var toId = transferEdge.toId;
+ if (transferEdge.toId == otherNodeId) {
+ toId = this.clusteredNodes[otherNodeId].clusterId;
+ } else {
+ fromId = this.clusteredNodes[otherNodeId].clusterId;
+ }
+
+ // clone the options and apply the cluster options to them
+ var clonedOptions = _NetworkUtil2.default.cloneOptions(transferEdge, 'edge');
+ util.deepExtend(clonedOptions, otherCluster.clusterEdgeProperties);
+
+ // apply the edge specific options to it.
+ var id = 'clusterEdge:' + util.randomUUID();
+ util.deepExtend(clonedOptions, { from: fromId, to: toId, hidden: false, physics: true, id: id });
+
+ // create it
+ var newEdge = this.body.functions.createEdge(clonedOptions);
+ newEdge.clusteringEdgeReplacingId = transferEdge.id;
+ this.body.edges[id] = newEdge;
+ this.body.edges[id].connect();
+ }
+ } else {
+ var replacedEdge = this.body.edges[edge.clusteringEdgeReplacingId];
+ if (replacedEdge !== undefined) {
+ this._restoreEdge(replacedEdge);
+ }
+ }
+ edge.cleanup();
+ // this removes the edge from node.edges, which is why edgeIds is formed
+ edge.disconnect();
+ delete this.body.edges[edge.id];
+ }
+
+ // handle the releasing of the edges
+ for (var edgeId in containedEdges) {
+ if (containedEdges.hasOwnProperty(edgeId)) {
+ this._restoreEdge(containedEdges[edgeId]);
+ }
+ }
+
+ // remove clusterNode
+ delete this.body.nodes[clusterNodeId];
+
+ if (refreshData === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'getNodesInCluster',
+ value: function getNodesInCluster(clusterId) {
+ var nodesArray = [];
+ if (this.isCluster(clusterId) === true) {
+ var containedNodes = this.body.nodes[clusterId].containedNodes;
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ nodesArray.push(this.body.nodes[nodeId].id);
+ }
+ }
+ }
+
+ return nodesArray;
+ }
+
+ /**
+ * Get the stack clusterId's that a certain node resides in. cluster A -> cluster B -> cluster C -> node
+ * @param nodeId
+ * @returns {Array}
+ */
+
+ }, {
+ key: 'findNode',
+ value: function findNode(nodeId) {
+ var stack = [];
+ var max = 100;
+ var counter = 0;
+
+ while (this.clusteredNodes[nodeId] !== undefined && counter < max) {
+ stack.push(this.body.nodes[nodeId].id);
+ nodeId = this.clusteredNodes[nodeId].clusterId;
+ counter++;
+ }
+ stack.push(this.body.nodes[nodeId].id);
+ stack.reverse();
+
+ return stack;
+ }
+
+ /**
+ * Get the Id the node is connected to
+ * @param edge
+ * @param nodeId
+ * @returns {*}
+ * @private
+ */
+
+ }, {
+ key: '_getConnectedId',
+ value: function _getConnectedId(edge, nodeId) {
+ if (edge.toId != nodeId) {
+ return edge.toId;
+ } else if (edge.fromId != nodeId) {
+ return edge.fromId;
+ } else {
+ return edge.fromId;
+ }
+ }
+
+ /**
+ * We determine how many connections denote an important hub.
+ * We take the mean + 2*std as the important hub size. (Assuming a normal distribution of data, ~2.2%)
+ *
+ * @private
+ */
+
+ }, {
+ key: '_getHubSize',
+ value: function _getHubSize() {
+ var average = 0;
+ var averageSquared = 0;
+ var hubCounter = 0;
+ var largestHub = 0;
+
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (node.edges.length > largestHub) {
+ largestHub = node.edges.length;
+ }
+ average += node.edges.length;
+ averageSquared += Math.pow(node.edges.length, 2);
+ hubCounter += 1;
+ }
+ average = average / hubCounter;
+ averageSquared = averageSquared / hubCounter;
+
+ var variance = averageSquared - Math.pow(average, 2);
+ var standardDeviation = Math.sqrt(variance);
+
+ var hubThreshold = Math.floor(average + 2 * standardDeviation);
+
+ // always have at least one to cluster
+ if (hubThreshold > largestHub) {
+ hubThreshold = largestHub;
+ }
+
+ return hubThreshold;
+ }
+ }]);
+
+ return ClusterEngine;
+ }();
+
+ exports.default = ClusterEngine;
+
+/***/ },
+/* 103 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var NetworkUtil = function () {
+ function NetworkUtil() {
+ _classCallCheck(this, NetworkUtil);
+ }
+
+ /**
+ * Find the center position of the network considering the bounding boxes
+ */
+
+
+ _createClass(NetworkUtil, null, [{
+ key: "getRange",
+ value: function getRange(allNodes) {
+ var specificNodes = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+
+ var minY = 1e9,
+ maxY = -1e9,
+ minX = 1e9,
+ maxX = -1e9,
+ node;
+ if (specificNodes.length > 0) {
+ for (var i = 0; i < specificNodes.length; i++) {
+ node = allNodes[specificNodes[i]];
+ if (minX > node.shape.boundingBox.left) {
+ minX = node.shape.boundingBox.left;
+ }
+ if (maxX < node.shape.boundingBox.right) {
+ maxX = node.shape.boundingBox.right;
+ }
+ if (minY > node.shape.boundingBox.top) {
+ minY = node.shape.boundingBox.top;
+ } // top is negative, bottom is positive
+ if (maxY < node.shape.boundingBox.bottom) {
+ maxY = node.shape.boundingBox.bottom;
+ } // top is negative, bottom is positive
+ }
+ }
+
+ if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {
+ minY = 0, maxY = 0, minX = 0, maxX = 0;
+ }
+ return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };
+ }
+
+ /**
+ * Find the center position of the network
+ */
+
+ }, {
+ key: "getRangeCore",
+ value: function getRangeCore(allNodes) {
+ var specificNodes = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+
+ var minY = 1e9,
+ maxY = -1e9,
+ minX = 1e9,
+ maxX = -1e9,
+ node;
+ if (specificNodes.length > 0) {
+ for (var i = 0; i < specificNodes.length; i++) {
+ node = allNodes[specificNodes[i]];
+ if (minX > node.x) {
+ minX = node.x;
+ }
+ if (maxX < node.x) {
+ maxX = node.x;
+ }
+ if (minY > node.y) {
+ minY = node.y;
+ } // top is negative, bottom is positive
+ if (maxY < node.y) {
+ maxY = node.y;
+ } // top is negative, bottom is positive
+ }
+ }
+
+ if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {
+ minY = 0, maxY = 0, minX = 0, maxX = 0;
+ }
+ return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };
+ }
+
+ /**
+ * @param {object} range = {minX: minX, maxX: maxX, minY: minY, maxY: maxY};
+ * @returns {{x: number, y: number}}
+ */
+
+ }, {
+ key: "findCenter",
+ value: function findCenter(range) {
+ return { x: 0.5 * (range.maxX + range.minX),
+ y: 0.5 * (range.maxY + range.minY) };
+ }
+
+ /**
+ * This returns a clone of the options or options of the edge or node to be used for construction of new edges or check functions for new nodes.
+ * @param item
+ * @param type
+ * @returns {{}}
+ */
+
+ }, {
+ key: "cloneOptions",
+ value: function cloneOptions(item, type) {
+ var clonedOptions = {};
+ if (type === undefined || type === 'node') {
+ util.deepExtend(clonedOptions, item.options, true);
+ clonedOptions.x = item.x;
+ clonedOptions.y = item.y;
+ clonedOptions.amountOfConnections = item.edges.length;
+ } else {
+ util.deepExtend(clonedOptions, item.options, true);
+ }
+ return clonedOptions;
+ }
+ }]);
+
+ return NetworkUtil;
+ }();
+
+ exports.default = NetworkUtil;
+
+/***/ },
+/* 104 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _Node2 = __webpack_require__(65);
+
+ var _Node3 = _interopRequireDefault(_Node2);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ /**
+ *
+ */
+
+ var Cluster = function (_Node) {
+ _inherits(Cluster, _Node);
+
+ function Cluster(options, body, imagelist, grouplist, globalOptions) {
+ _classCallCheck(this, Cluster);
+
+ var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Cluster).call(this, options, body, imagelist, grouplist, globalOptions));
+
+ _this.isCluster = true;
+ _this.containedNodes = {};
+ _this.containedEdges = {};
+ return _this;
+ }
+
+ return Cluster;
+ }(_Node3.default);
+
+ exports.default = Cluster;
+
+/***/ },
+/* 105 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ if (typeof window !== 'undefined') {
+ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+ }
+
+ var util = __webpack_require__(1);
+
+ var CanvasRenderer = function () {
+ function CanvasRenderer(body, canvas) {
+ _classCallCheck(this, CanvasRenderer);
+
+ this.body = body;
+ this.canvas = canvas;
+
+ this.redrawRequested = false;
+ this.renderTimer = undefined;
+ this.requiresTimeout = true;
+ this.renderingActive = false;
+ this.renderRequests = 0;
+ this.pixelRatio = undefined;
+ this.allowRedraw = true;
+
+ this.dragging = false;
+ this.options = {};
+ this.defaultOptions = {
+ hideEdgesOnDrag: false,
+ hideNodesOnDrag: false
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this._determineBrowserMethod();
+ this.bindEventListeners();
+ }
+
+ _createClass(CanvasRenderer, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on("dragStart", function () {
+ _this.dragging = true;
+ });
+ this.body.emitter.on("dragEnd", function () {
+ return _this.dragging = false;
+ });
+ this.body.emitter.on("_resizeNodes", function () {
+ return _this._resizeNodes();
+ });
+ this.body.emitter.on("_redraw", function () {
+ if (_this.renderingActive === false) {
+ _this._redraw();
+ }
+ });
+ this.body.emitter.on("_blockRedraw", function () {
+ _this.allowRedraw = false;
+ });
+ this.body.emitter.on("_allowRedraw", function () {
+ _this.allowRedraw = true;_this.redrawRequested = false;
+ });
+ this.body.emitter.on("_requestRedraw", this._requestRedraw.bind(this));
+ this.body.emitter.on("_startRendering", function () {
+ _this.renderRequests += 1;
+ _this.renderingActive = true;
+ _this._startRendering();
+ });
+ this.body.emitter.on("_stopRendering", function () {
+ _this.renderRequests -= 1;
+ _this.renderingActive = _this.renderRequests > 0;
+ _this.renderTimer = undefined;
+ });
+ this.body.emitter.on('destroy', function () {
+ _this.renderRequests = 0;
+ _this.allowRedraw = false;
+ _this.renderingActive = false;
+ if (_this.requiresTimeout === true) {
+ clearTimeout(_this.renderTimer);
+ } else {
+ cancelAnimationFrame(_this.renderTimer);
+ }
+ _this.body.emitter.off();
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ var fields = ['hideEdgesOnDrag', 'hideNodesOnDrag'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ }
+ }
+ }, {
+ key: '_startRendering',
+ value: function _startRendering() {
+ if (this.renderingActive === true) {
+ if (this.renderTimer === undefined) {
+ if (this.requiresTimeout === true) {
+ this.renderTimer = window.setTimeout(this._renderStep.bind(this), this.simulationInterval); // wait this.renderTimeStep milliseconds and perform the animation step function
+ } else {
+ this.renderTimer = window.requestAnimationFrame(this._renderStep.bind(this)); // wait this.renderTimeStep milliseconds and perform the animation step function
+ }
+ }
+ }
+ }
+ }, {
+ key: '_renderStep',
+ value: function _renderStep() {
+ if (this.renderingActive === true) {
+ // reset the renderTimer so a new scheduled animation step can be set
+ this.renderTimer = undefined;
+
+ if (this.requiresTimeout === true) {
+ // this schedules a new simulation step
+ this._startRendering();
+ }
+
+ this._redraw();
+
+ if (this.requiresTimeout === false) {
+ // this schedules a new simulation step
+ this._startRendering();
+ }
+ }
+ }
+
+ /**
+ * Redraw the network with the current data
+ * chart will be resized too.
+ */
+
+ }, {
+ key: 'redraw',
+ value: function redraw() {
+ this.body.emitter.emit('setSize');
+ this._redraw();
+ }
+
+ /**
+ * Redraw the network with the current data
+ * @param hidden | used to get the first estimate of the node sizes. only the nodes are drawn after which they are quickly drawn over.
+ * @private
+ */
+
+ }, {
+ key: '_requestRedraw',
+ value: function _requestRedraw() {
+ var _this2 = this;
+
+ if (this.redrawRequested !== true && this.renderingActive === false && this.allowRedraw === true) {
+ this.redrawRequested = true;
+ if (this.requiresTimeout === true) {
+ window.setTimeout(function () {
+ _this2._redraw(false);
+ }, 0);
+ } else {
+ window.requestAnimationFrame(function () {
+ _this2._redraw(false);
+ });
+ }
+ }
+ }
+ }, {
+ key: '_redraw',
+ value: function _redraw() {
+ var hidden = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
+
+ if (this.allowRedraw === true) {
+ this.body.emitter.emit("initRedraw");
+
+ this.redrawRequested = false;
+ var ctx = this.canvas.frame.canvas.getContext('2d');
+
+ // when the container div was hidden, this fixes it back up!
+ if (this.canvas.frame.canvas.width === 0 || this.canvas.frame.canvas.height === 0) {
+ this.canvas.setSize();
+ }
+
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+
+ // clear the canvas
+ var w = this.canvas.frame.canvas.clientWidth;
+ var h = this.canvas.frame.canvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ // if the div is hidden, we stop the redraw here for performance.
+ if (this.canvas.frame.clientWidth === 0) {
+ return;
+ }
+
+ // set scaling and translation
+ ctx.save();
+ ctx.translate(this.body.view.translation.x, this.body.view.translation.y);
+ ctx.scale(this.body.view.scale, this.body.view.scale);
+
+ ctx.beginPath();
+ this.body.emitter.emit("beforeDrawing", ctx);
+ ctx.closePath();
+
+ if (hidden === false) {
+ if (this.dragging === false || this.dragging === true && this.options.hideEdgesOnDrag === false) {
+ this._drawEdges(ctx);
+ }
+ }
+
+ if (this.dragging === false || this.dragging === true && this.options.hideNodesOnDrag === false) {
+ this._drawNodes(ctx, hidden);
+ }
+
+ ctx.beginPath();
+ this.body.emitter.emit("afterDrawing", ctx);
+ ctx.closePath();
+
+ // restore original scaling and translation
+ ctx.restore();
+ if (hidden === true) {
+ ctx.clearRect(0, 0, w, h);
+ }
+ }
+ }
+
+ /**
+ * Redraw all nodes
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Boolean} [alwaysShow]
+ * @private
+ */
+
+ }, {
+ key: '_resizeNodes',
+ value: function _resizeNodes() {
+ var ctx = this.canvas.frame.canvas.getContext('2d');
+ if (this.pixelRatio === undefined) {
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+ }
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+ ctx.save();
+ ctx.translate(this.body.view.translation.x, this.body.view.translation.y);
+ ctx.scale(this.body.view.scale, this.body.view.scale);
+
+ var nodes = this.body.nodes;
+ var node = void 0;
+
+ // resize all nodes
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ node = nodes[nodeId];
+ node.resize(ctx);
+ node.updateBoundingBox(ctx, node.selected);
+ }
+ }
+
+ // restore original scaling and translation
+ ctx.restore();
+ }
+
+ /**
+ * Redraw all nodes
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Boolean} [alwaysShow]
+ * @private
+ */
+
+ }, {
+ key: '_drawNodes',
+ value: function _drawNodes(ctx) {
+ var alwaysShow = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var nodes = this.body.nodes;
+ var nodeIndices = this.body.nodeIndices;
+ var node = void 0;
+ var selected = [];
+ var margin = 20;
+ var topLeft = this.canvas.DOMtoCanvas({ x: -margin, y: -margin });
+ var bottomRight = this.canvas.DOMtoCanvas({
+ x: this.canvas.frame.canvas.clientWidth + margin,
+ y: this.canvas.frame.canvas.clientHeight + margin
+ });
+ var viewableArea = { top: topLeft.y, left: topLeft.x, bottom: bottomRight.y, right: bottomRight.x };
+
+ // draw unselected nodes;
+ for (var i = 0; i < nodeIndices.length; i++) {
+ node = nodes[nodeIndices[i]];
+ // set selected nodes aside
+ if (node.isSelected()) {
+ selected.push(nodeIndices[i]);
+ } else {
+ if (alwaysShow === true) {
+ node.draw(ctx);
+ } else if (node.isBoundingBoxOverlappingWith(viewableArea) === true) {
+ node.draw(ctx);
+ } else {
+ node.updateBoundingBox(ctx, node.selected);
+ }
+ }
+ }
+
+ // draw the selected nodes on top
+ for (var _i = 0; _i < selected.length; _i++) {
+ node = nodes[selected[_i]];
+ node.draw(ctx);
+ }
+ }
+
+ /**
+ * Redraw all edges
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+
+ }, {
+ key: '_drawEdges',
+ value: function _drawEdges(ctx) {
+ var edges = this.body.edges;
+ var edgeIndices = this.body.edgeIndices;
+ var edge = void 0;
+
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ if (edge.connected === true) {
+ edge.draw(ctx);
+ }
+ }
+ }
+
+ /**
+ * Determine if the browser requires a setTimeout or a requestAnimationFrame. This was required because
+ * some implementations (safari and IE9) did not support requestAnimationFrame
+ * @private
+ */
+
+ }, {
+ key: '_determineBrowserMethod',
+ value: function _determineBrowserMethod() {
+ if (typeof window !== 'undefined') {
+ var browserType = navigator.userAgent.toLowerCase();
+ this.requiresTimeout = false;
+ if (browserType.indexOf('msie 9.0') != -1) {
+ // IE 9
+ this.requiresTimeout = true;
+ } else if (browserType.indexOf('safari') != -1) {
+ // safari
+ if (browserType.indexOf('chrome') <= -1) {
+ this.requiresTimeout = true;
+ }
+ }
+ } else {
+ this.requiresTimeout = true;
+ }
+ }
+ }]);
+
+ return CanvasRenderer;
+ }();
+
+ exports.default = CanvasRenderer;
+
+/***/ },
+/* 106 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(28);
+
+ var util = __webpack_require__(1);
+
+ /**
+ * Create the main frame for the Network.
+ * This function is executed once when a Network object is created. The frame
+ * contains a canvas, and this canvas contains all objects like the axis and
+ * nodes.
+ * @private
+ */
+
+ var Canvas = function () {
+ function Canvas(body) {
+ _classCallCheck(this, Canvas);
+
+ this.body = body;
+ this.pixelRatio = 1;
+ this.resizeTimer = undefined;
+ this.resizeFunction = this._onResize.bind(this);
+ this.cameraState = {};
+ this.initialized = false;
+
+ this.options = {};
+ this.defaultOptions = {
+ autoResize: true,
+ height: '100%',
+ width: '100%'
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(Canvas, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ // bind the events
+ this.body.emitter.once("resize", function (obj) {
+ if (obj.width !== 0) {
+ _this.body.view.translation.x = obj.width * 0.5;
+ }
+ if (obj.height !== 0) {
+ _this.body.view.translation.y = obj.height * 0.5;
+ }
+ });
+ this.body.emitter.on("setSize", this.setSize.bind(this));
+ this.body.emitter.on("destroy", function () {
+ _this.hammerFrame.destroy();
+ _this.hammer.destroy();
+ _this._cleanUp();
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ var _this2 = this;
+
+ if (options !== undefined) {
+ var fields = ['width', 'height', 'autoResize'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ }
+
+ if (this.options.autoResize === true) {
+ // automatically adapt to a changing size of the browser.
+ this._cleanUp();
+ this.resizeTimer = setInterval(function () {
+ var changed = _this2.setSize();
+ if (changed === true) {
+ _this2.body.emitter.emit("_requestRedraw");
+ }
+ }, 1000);
+ this.resizeFunction = this._onResize.bind(this);
+ util.addEventListener(window, 'resize', this.resizeFunction);
+ }
+ }
+ }, {
+ key: '_cleanUp',
+ value: function _cleanUp() {
+ // automatically adapt to a changing size of the browser.
+ if (this.resizeTimer !== undefined) {
+ clearInterval(this.resizeTimer);
+ }
+ util.removeEventListener(window, 'resize', this.resizeFunction);
+ this.resizeFunction = undefined;
+ }
+ }, {
+ key: '_onResize',
+ value: function _onResize() {
+ this.setSize();
+ this.body.emitter.emit("_redraw");
+ }
+
+ /**
+ * Get and store the cameraState
+ * @private
+ */
+
+ }, {
+ key: '_getCameraState',
+ value: function _getCameraState() {
+ var pixelRatio = arguments.length <= 0 || arguments[0] === undefined ? this.pixelRatio : arguments[0];
+
+ if (this.initialized === true) {
+ this.cameraState.previousWidth = this.frame.canvas.width / pixelRatio;
+ this.cameraState.previousHeight = this.frame.canvas.height / pixelRatio;
+ this.cameraState.scale = this.body.view.scale;
+ this.cameraState.position = this.DOMtoCanvas({
+ x: 0.5 * this.frame.canvas.width / pixelRatio,
+ y: 0.5 * this.frame.canvas.height / pixelRatio
+ });
+ }
+ }
+
+ /**
+ * Set the cameraState
+ * @private
+ */
+
+ }, {
+ key: '_setCameraState',
+ value: function _setCameraState() {
+ if (this.cameraState.scale !== undefined && this.frame.canvas.clientWidth !== 0 && this.frame.canvas.clientHeight !== 0 && this.pixelRatio !== 0 && this.cameraState.previousWidth > 0) {
+
+ var widthRatio = this.frame.canvas.width / this.pixelRatio / this.cameraState.previousWidth;
+ var heightRatio = this.frame.canvas.height / this.pixelRatio / this.cameraState.previousHeight;
+ var newScale = this.cameraState.scale;
+
+ if (widthRatio != 1 && heightRatio != 1) {
+ newScale = this.cameraState.scale * 0.5 * (widthRatio + heightRatio);
+ } else if (widthRatio != 1) {
+ newScale = this.cameraState.scale * widthRatio;
+ } else if (heightRatio != 1) {
+ newScale = this.cameraState.scale * heightRatio;
+ }
+
+ this.body.view.scale = newScale;
+ // this comes from the view module.
+ var currentViewCenter = this.DOMtoCanvas({
+ x: 0.5 * this.frame.canvas.clientWidth,
+ y: 0.5 * this.frame.canvas.clientHeight
+ });
+
+ var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
+ x: currentViewCenter.x - this.cameraState.position.x,
+ y: currentViewCenter.y - this.cameraState.position.y
+ };
+ this.body.view.translation.x += distanceFromCenter.x * this.body.view.scale;
+ this.body.view.translation.y += distanceFromCenter.y * this.body.view.scale;
+ }
+ }
+ }, {
+ key: '_prepareValue',
+ value: function _prepareValue(value) {
+ if (typeof value === 'number') {
+ return value + 'px';
+ } else if (typeof value === 'string') {
+ if (value.indexOf('%') !== -1 || value.indexOf('px') !== -1) {
+ return value;
+ } else if (value.indexOf('%') === -1) {
+ return value + 'px';
+ }
+ }
+ throw new Error('Could not use the value supplied for width or height:' + value);
+ }
+
+ /**
+ * Create the HTML
+ */
+
+ }, {
+ key: '_create',
+ value: function _create() {
+ // remove all elements from the container element.
+ while (this.body.container.hasChildNodes()) {
+ this.body.container.removeChild(this.body.container.firstChild);
+ }
+
+ this.frame = document.createElement('div');
+ this.frame.className = 'vis-network';
+ this.frame.style.position = 'relative';
+ this.frame.style.overflow = 'hidden';
+ this.frame.tabIndex = 900; // tab index is required for keycharm to bind keystrokes to the div instead of the window
+
+ //////////////////////////////////////////////////////////////////
+
+ this.frame.canvas = document.createElement("canvas");
+ this.frame.canvas.style.position = 'relative';
+ this.frame.appendChild(this.frame.canvas);
+
+ if (!this.frame.canvas.getContext) {
+ var noCanvas = document.createElement('DIV');
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold';
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.frame.canvas.appendChild(noCanvas);
+ } else {
+ var ctx = this.frame.canvas.getContext("2d");
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ this.frame.canvas.getContext("2d").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+ }
+
+ // add the frame to the container element
+ this.body.container.appendChild(this.frame);
+
+ this.body.view.scale = 1;
+ this.body.view.translation = { x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight };
+
+ this._bindHammer();
+ }
+
+ /**
+ * This function binds hammer, it can be repeated over and over due to the uniqueness check.
+ * @private
+ */
+
+ }, {
+ key: '_bindHammer',
+ value: function _bindHammer() {
+ var _this3 = this;
+
+ if (this.hammer !== undefined) {
+ this.hammer.destroy();
+ }
+ this.drag = {};
+ this.pinch = {};
+
+ // init hammer
+ this.hammer = new Hammer(this.frame.canvas);
+ this.hammer.get('pinch').set({ enable: true });
+ // enable to get better response, todo: test on mobile.
+ this.hammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_ALL });
+
+ hammerUtil.onTouch(this.hammer, function (event) {
+ _this3.body.eventListeners.onTouch(event);
+ });
+ this.hammer.on('tap', function (event) {
+ _this3.body.eventListeners.onTap(event);
+ });
+ this.hammer.on('doubletap', function (event) {
+ _this3.body.eventListeners.onDoubleTap(event);
+ });
+ this.hammer.on('press', function (event) {
+ _this3.body.eventListeners.onHold(event);
+ });
+ this.hammer.on('panstart', function (event) {
+ _this3.body.eventListeners.onDragStart(event);
+ });
+ this.hammer.on('panmove', function (event) {
+ _this3.body.eventListeners.onDrag(event);
+ });
+ this.hammer.on('panend', function (event) {
+ _this3.body.eventListeners.onDragEnd(event);
+ });
+ this.hammer.on('pinch', function (event) {
+ _this3.body.eventListeners.onPinch(event);
+ });
+
+ // TODO: neatly cleanup these handlers when re-creating the Canvas, IF these are done with hammer, event.stopPropagation will not work?
+ this.frame.canvas.addEventListener('mousewheel', function (event) {
+ _this3.body.eventListeners.onMouseWheel(event);
+ });
+ this.frame.canvas.addEventListener('DOMMouseScroll', function (event) {
+ _this3.body.eventListeners.onMouseWheel(event);
+ });
+
+ this.frame.canvas.addEventListener('mousemove', function (event) {
+ _this3.body.eventListeners.onMouseMove(event);
+ });
+ this.frame.canvas.addEventListener('contextmenu', function (event) {
+ _this3.body.eventListeners.onContext(event);
+ });
+
+ this.hammerFrame = new Hammer(this.frame);
+ hammerUtil.onRelease(this.hammerFrame, function (event) {
+ _this3.body.eventListeners.onRelease(event);
+ });
+ }
+
+ /**
+ * Set a new size for the network
+ * @param {string} width Width in pixels or percentage (for example '800px'
+ * or '50%')
+ * @param {string} height Height in pixels or percentage (for example '400px'
+ * or '30%')
+ */
+
+ }, {
+ key: 'setSize',
+ value: function setSize() {
+ var width = arguments.length <= 0 || arguments[0] === undefined ? this.options.width : arguments[0];
+ var height = arguments.length <= 1 || arguments[1] === undefined ? this.options.height : arguments[1];
+
+ width = this._prepareValue(width);
+ height = this._prepareValue(height);
+
+ var emitEvent = false;
+ var oldWidth = this.frame.canvas.width;
+ var oldHeight = this.frame.canvas.height;
+
+ // update the pixel ratio
+ var ctx = this.frame.canvas.getContext("2d");
+ var previousRatio = this.pixelRatio; // we cache this because the camera state storage needs the old value
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ if (width != this.options.width || height != this.options.height || this.frame.style.width != width || this.frame.style.height != height) {
+ this._getCameraState(previousRatio);
+
+ this.frame.style.width = width;
+ this.frame.style.height = height;
+
+ 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 = width;
+ this.options.height = height;
+
+ emitEvent = true;
+ } else {
+ // this would adapt the width of the canvas to the width from 100% if and only if
+ // there is a change.
+
+ // store the camera if there is a change in size.
+ if (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._getCameraState(previousRatio);
+ }
+
+ if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio)) {
+ this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);
+ emitEvent = true;
+ }
+ if (this.frame.canvas.height != Math.round(this.frame.canvas.clientHeight * this.pixelRatio)) {
+ this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);
+ emitEvent = true;
+ }
+ }
+
+ if (emitEvent === true) {
+ 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(oldWidth / this.pixelRatio),
+ oldHeight: Math.round(oldHeight / this.pixelRatio)
+ });
+
+ // restore the camera on change.
+ this._setCameraState();
+ }
+
+ // set initialized so the get and set camera will work from now on.
+ this.initialized = true;
+ return emitEvent;
+ }
+ }, {
+ key: '_XconvertDOMtoCanvas',
+
+
+ /**
+ * Convert the X coordinate in DOM-space (coordinate point in browser relative to the container div) to
+ * the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon)
+ * @param {number} x
+ * @returns {number}
+ * @private
+ */
+ value: function _XconvertDOMtoCanvas(x) {
+ return (x - this.body.view.translation.x) / this.body.view.scale;
+ }
+
+ /**
+ * Convert the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to
+ * the X coordinate in DOM-space (coordinate point in browser relative to the container div)
+ * @param {number} x
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_XconvertCanvasToDOM',
+ value: function _XconvertCanvasToDOM(x) {
+ return x * this.body.view.scale + this.body.view.translation.x;
+ }
+
+ /**
+ * Convert the Y coordinate in DOM-space (coordinate point in browser relative to the container div) to
+ * the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon)
+ * @param {number} y
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_YconvertDOMtoCanvas',
+ value: function _YconvertDOMtoCanvas(y) {
+ return (y - this.body.view.translation.y) / this.body.view.scale;
+ }
+
+ /**
+ * Convert the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to
+ * the Y coordinate in DOM-space (coordinate point in browser relative to the container div)
+ * @param {number} y
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_YconvertCanvasToDOM',
+ value: function _YconvertCanvasToDOM(y) {
+ return y * this.body.view.scale + this.body.view.translation.y;
+ }
+
+ /**
+ *
+ * @param {object} pos = {x: number, y: number}
+ * @returns {{x: number, y: number}}
+ * @constructor
+ */
+
+ }, {
+ key: 'canvasToDOM',
+ value: function canvasToDOM(pos) {
+ return { x: this._XconvertCanvasToDOM(pos.x), y: this._YconvertCanvasToDOM(pos.y) };
+ }
+
+ /**
+ *
+ * @param {object} pos = {x: number, y: number}
+ * @returns {{x: number, y: number}}
+ * @constructor
+ */
+
+ }, {
+ key: 'DOMtoCanvas',
+ value: function DOMtoCanvas(pos) {
+ return { x: this._XconvertDOMtoCanvas(pos.x), y: this._YconvertDOMtoCanvas(pos.y) };
+ }
+ }]);
+
+ return Canvas;
+ }();
+
+ exports.default = Canvas;
+
+/***/ },
+/* 107 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NetworkUtil = __webpack_require__(103);
+
+ var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var View = function () {
+ function View(body, canvas) {
+ var _this = this;
+
+ _classCallCheck(this, View);
+
+ this.body = body;
+ this.canvas = canvas;
+
+ 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 = undefined;
+ this.lockedOnNodeOffset = undefined;
+ this.touchTime = 0;
+
+ this.viewFunction = undefined;
+
+ this.body.emitter.on("fit", this.fit.bind(this));
+ this.body.emitter.on("animationFinished", function () {
+ _this.body.emitter.emit("_stopRendering");
+ });
+ this.body.emitter.on("unlockNode", this.releaseNode.bind(this));
+ }
+
+ _createClass(View, [{
+ key: 'setOptions',
+ value: function setOptions() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+ this.options = options;
+ }
+
+ /**
+ * This function zooms out to fit all data on screen based on amount of nodes
+ * @param {Object} Options
+ * @param {Boolean} [initialZoom] | zoom based on fitted formula or range, true = fitted, default = false;
+ */
+
+ }, {
+ key: 'fit',
+ value: function fit() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? { nodes: [] } : arguments[0];
+ var initialZoom = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var range = void 0;
+ var zoomLevel = void 0;
+ if (options.nodes === undefined || options.nodes.length === 0) {
+ options.nodes = this.body.nodeIndices;
+ }
+
+ if (initialZoom === true) {
+ // check if more than half of the nodes have a predefined position. If so, we use the range, not the approximation.
+ var positionDefined = 0;
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (node.predefinedPosition === true) {
+ positionDefined += 1;
+ }
+ }
+ }
+ if (positionDefined > 0.5 * this.body.nodeIndices.length) {
+ this.fit(options, false);
+ return;
+ }
+
+ range = _NetworkUtil2.default.getRange(this.body.nodes, options.nodes);
+
+ var numberOfNodes = this.body.nodeIndices.length;
+ zoomLevel = 12.662 / (numberOfNodes + 7.4147) + 0.0964822; // this is obtained from fitting a dataset from 5 points with scale levels that looked good.
+
+ // correct for larger canvasses.
+ var factor = Math.min(this.canvas.frame.canvas.clientWidth / 600, this.canvas.frame.canvas.clientHeight / 600);
+ zoomLevel *= factor;
+ } else {
+ this.body.emitter.emit("_resizeNodes");
+ range = _NetworkUtil2.default.getRange(this.body.nodes, options.nodes);
+
+ var xDistance = Math.abs(range.maxX - range.minX) * 1.1;
+ var yDistance = Math.abs(range.maxY - range.minY) * 1.1;
+
+ var xZoomLevel = this.canvas.frame.canvas.clientWidth / xDistance;
+ var yZoomLevel = this.canvas.frame.canvas.clientHeight / yDistance;
+
+ zoomLevel = xZoomLevel <= yZoomLevel ? xZoomLevel : yZoomLevel;
+ }
+
+ if (zoomLevel > 1.0) {
+ zoomLevel = 1.0;
+ } else if (zoomLevel === 0) {
+ zoomLevel = 1.0;
+ }
+
+ var center = _NetworkUtil2.default.findCenter(range);
+ var animationOptions = { position: center, scale: zoomLevel, animation: options.animation };
+ this.moveTo(animationOptions);
+ }
+
+ // animation
+
+ /**
+ * Center a node in view.
+ *
+ * @param {Number} nodeId
+ * @param {Number} [options]
+ */
+
+ }, {
+ key: 'focus',
+ value: function focus(nodeId) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ if (this.body.nodes[nodeId] !== undefined) {
+ var nodePosition = { x: this.body.nodes[nodeId].x, y: this.body.nodes[nodeId].y };
+ options.position = nodePosition;
+ options.lockedOnNode = nodeId;
+
+ this.moveTo(options);
+ } else {
+ console.log("Node: " + nodeId + " cannot be found.");
+ }
+ }
+
+ /**
+ *
+ * @param {Object} options | options.offset = {x:Number, y:Number} // offset from the center in DOM pixels
+ * | options.scale = Number // scale to move to
+ * | options.position = {x:Number, y:Number} // position to move to
+ * | options.animation = {duration:Number, easingFunction:String} || Boolean // position to move to
+ */
+
+ }, {
+ key: 'moveTo',
+ value: function moveTo(options) {
+ if (options === undefined) {
+ options = {};
+ return;
+ }
+ if (options.offset === undefined) {
+ options.offset = { x: 0, y: 0 };
+ }
+ if (options.offset.x === undefined) {
+ options.offset.x = 0;
+ }
+ if (options.offset.y === undefined) {
+ options.offset.y = 0;
+ }
+ if (options.scale === undefined) {
+ options.scale = this.body.view.scale;
+ }
+ if (options.position === undefined) {
+ options.position = this.getViewPosition();
+ }
+ if (options.animation === undefined) {
+ options.animation = { duration: 0 };
+ }
+ if (options.animation === false) {
+ options.animation = { duration: 0 };
+ }
+ if (options.animation === true) {
+ options.animation = {};
+ }
+ if (options.animation.duration === undefined) {
+ options.animation.duration = 1000;
+ } // default duration
+ if (options.animation.easingFunction === undefined) {
+ options.animation.easingFunction = "easeInOutQuad";
+ } // default easing function
+
+ this.animateView(options);
+ }
+
+ /**
+ *
+ * @param {Object} options | options.offset = {x:Number, y:Number} // offset from the center in DOM pixels
+ * | options.time = Number // animation time in milliseconds
+ * | options.scale = Number // scale to animate to
+ * | options.position = {x:Number, y:Number} // position to animate to
+ * | options.easingFunction = String // linear, easeInQuad, easeOutQuad, easeInOutQuad,
+ * // easeInCubic, easeOutCubic, easeInOutCubic,
+ * // easeInQuart, easeOutQuart, easeInOutQuart,
+ * // easeInQuint, easeOutQuint, easeInOutQuint
+ */
+
+ }, {
+ key: 'animateView',
+ value: function animateView(options) {
+ if (options === undefined) {
+ return;
+ }
+ this.animationEasingFunction = options.animation.easingFunction;
+ // release if something focussed on the node
+ this.releaseNode();
+ if (options.locked === true) {
+ this.lockedOnNodeId = options.lockedOnNode;
+ this.lockedOnNodeOffset = options.offset;
+ }
+
+ // forcefully complete the old animation if it was still running
+ if (this.easingTime != 0) {
+ this._transitionRedraw(true); // by setting easingtime to 1, we finish the animation.
+ }
+
+ this.sourceScale = this.body.view.scale;
+ this.sourceTranslation = this.body.view.translation;
+ this.targetScale = options.scale;
+
+ // set the scale so the viewCenter is based on the correct zoom level. This is overridden in the transitionRedraw
+ // but at least then we'll have the target transition
+ this.body.view.scale = this.targetScale;
+ var viewCenter = this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
+
+ var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
+ x: viewCenter.x - options.position.x,
+ y: viewCenter.y - options.position.y
+ };
+ this.targetTranslation = {
+ x: this.sourceTranslation.x + distanceFromCenter.x * this.targetScale + options.offset.x,
+ y: this.sourceTranslation.y + distanceFromCenter.y * this.targetScale + options.offset.y
+ };
+
+ // if the time is set to 0, don't do an animation
+ if (options.animation.duration === 0) {
+ if (this.lockedOnNodeId != undefined) {
+ this.viewFunction = this._lockedRedraw.bind(this);
+ this.body.emitter.on("initRedraw", this.viewFunction);
+ } else {
+ this.body.view.scale = this.targetScale;
+ this.body.view.translation = this.targetTranslation;
+ this.body.emitter.emit("_requestRedraw");
+ }
+ } else {
+ this.animationSpeed = 1 / (60 * options.animation.duration * 0.001) || 1 / 60; // 60 for 60 seconds, 0.001 for milli's
+ this.animationEasingFunction = options.animation.easingFunction;
+
+ this.viewFunction = this._transitionRedraw.bind(this);
+ this.body.emitter.on("initRedraw", this.viewFunction);
+ this.body.emitter.emit("_startRendering");
+ }
+ }
+
+ /**
+ * used to animate smoothly by hijacking the redraw function.
+ * @private
+ */
+
+ }, {
+ key: '_lockedRedraw',
+ value: function _lockedRedraw() {
+ var nodePosition = { x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y };
+ var viewCenter = this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
+ var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
+ x: viewCenter.x - nodePosition.x,
+ y: viewCenter.y - nodePosition.y
+ };
+ var sourceTranslation = this.body.view.translation;
+ var targetTranslation = {
+ x: sourceTranslation.x + distanceFromCenter.x * this.body.view.scale + this.lockedOnNodeOffset.x,
+ y: sourceTranslation.y + distanceFromCenter.y * this.body.view.scale + this.lockedOnNodeOffset.y
+ };
+
+ this.body.view.translation = targetTranslation;
+ }
+ }, {
+ key: 'releaseNode',
+ value: function releaseNode() {
+ if (this.lockedOnNodeId !== undefined && this.viewFunction !== undefined) {
+ this.body.emitter.off("initRedraw", this.viewFunction);
+ this.lockedOnNodeId = undefined;
+ this.lockedOnNodeOffset = undefined;
+ }
+ }
+
+ /**
+ *
+ * @param easingTime
+ * @private
+ */
+
+ }, {
+ key: '_transitionRedraw',
+ value: function _transitionRedraw() {
+ var finished = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
+
+ this.easingTime += this.animationSpeed;
+ this.easingTime = finished === true ? 1.0 : this.easingTime;
+
+ var progress = util.easingFunctions[this.animationEasingFunction](this.easingTime);
+
+ this.body.view.scale = this.sourceScale + (this.targetScale - this.sourceScale) * progress;
+ this.body.view.translation = {
+ x: this.sourceTranslation.x + (this.targetTranslation.x - this.sourceTranslation.x) * progress,
+ y: this.sourceTranslation.y + (this.targetTranslation.y - this.sourceTranslation.y) * progress
+ };
+
+ // cleanup
+ if (this.easingTime >= 1.0) {
+ this.body.emitter.off("initRedraw", this.viewFunction);
+ this.easingTime = 0;
+ if (this.lockedOnNodeId != undefined) {
+ this.viewFunction = this._lockedRedraw.bind(this);
+ this.body.emitter.on("initRedraw", this.viewFunction);
+ }
+ this.body.emitter.emit("animationFinished");
+ }
+ }
+ }, {
+ key: 'getScale',
+ value: function getScale() {
+ return this.body.view.scale;
+ }
+ }, {
+ key: 'getViewPosition',
+ value: function getViewPosition() {
+ return this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
+ }
+ }]);
+
+ return View;
+ }();
+
+ exports.default = View;
+
+/***/ },
+/* 108 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NavigationHandler = __webpack_require__(109);
+
+ var _NavigationHandler2 = _interopRequireDefault(_NavigationHandler);
+
+ var _Popup = __webpack_require__(110);
+
+ var _Popup2 = _interopRequireDefault(_Popup);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var InteractionHandler = function () {
+ function InteractionHandler(body, canvas, selectionHandler) {
+ _classCallCheck(this, InteractionHandler);
+
+ this.body = body;
+ this.canvas = canvas;
+ this.selectionHandler = selectionHandler;
+ this.navigationHandler = new _NavigationHandler2.default(body, canvas);
+
+ // bind the events from hammer to functions in this object
+ 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 = undefined;
+ this.popupObj = undefined;
+ this.popupTimer = undefined;
+
+ this.body.functions.getPointer = this.getPointer.bind(this);
+
+ this.options = {};
+ this.defaultOptions = {
+ dragNodes: true,
+ dragView: true,
+ hover: false,
+ keyboard: {
+ enabled: false,
+ speed: { x: 10, y: 10, zoom: 0.02 },
+ bindToWindow: true
+ },
+ navigationButtons: false,
+ tooltipDelay: 300,
+ zoomView: true
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(InteractionHandler, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('destroy', function () {
+ clearTimeout(_this.popupTimer);
+ delete _this.body.functions.getPointer;
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ // extend all but the values in fields
+ var fields = ['hideEdgesOnDrag', 'hideNodesOnDrag', 'keyboard', 'multiselect', 'selectable', 'selectConnectedEdges'];
+ util.selectiveNotDeepExtend(fields, this.options, options);
+
+ // merge the keyboard options in.
+ util.mergeOptions(this.options, options, 'keyboard');
+
+ if (options.tooltip) {
+ util.extend(this.options.tooltip, options.tooltip);
+ if (options.tooltip.color) {
+ this.options.tooltip.color = util.parseColor(options.tooltip.color);
+ }
+ }
+ }
+
+ this.navigationHandler.setOptions(this.options);
+ }
+
+ /**
+ * Get the pointer location from a touch location
+ * @param {{x: Number, y: Number}} touch
+ * @return {{x: Number, y: Number}} pointer
+ * @private
+ */
+
+ }, {
+ key: 'getPointer',
+ value: function getPointer(touch) {
+ return {
+ x: touch.x - util.getAbsoluteLeft(this.canvas.frame.canvas),
+ y: touch.y - util.getAbsoluteTop(this.canvas.frame.canvas)
+ };
+ }
+
+ /**
+ * On start of a touch gesture, store the pointer
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: 'onTouch',
+ value: function onTouch(event) {
+ if (new Date().valueOf() - this.touchTime > 50) {
+ this.drag.pointer = this.getPointer(event.center);
+ this.drag.pinched = false;
+ this.pinch.scale = this.body.view.scale;
+ // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)
+ this.touchTime = new Date().valueOf();
+ }
+ }
+
+ /**
+ * handle tap/click event: select/unselect a node
+ * @private
+ */
+
+ }, {
+ key: 'onTap',
+ value: function onTap(event) {
+ var pointer = this.getPointer(event.center);
+ var multiselect = this.selectionHandler.options.multiselect && (event.changedPointers[0].ctrlKey || event.changedPointers[0].metaKey);
+
+ this.checkSelectionChanges(pointer, event, multiselect);
+ this.selectionHandler._generateClickEvent('click', event, pointer);
+ }
+
+ /**
+ * handle doubletap event
+ * @private
+ */
+
+ }, {
+ key: 'onDoubleTap',
+ value: function onDoubleTap(event) {
+ var pointer = this.getPointer(event.center);
+ this.selectionHandler._generateClickEvent('doubleClick', event, pointer);
+ }
+
+ /**
+ * handle long tap event: multi select nodes
+ * @private
+ */
+
+ }, {
+ key: 'onHold',
+ value: function onHold(event) {
+ var pointer = this.getPointer(event.center);
+ var multiselect = this.selectionHandler.options.multiselect;
+
+ this.checkSelectionChanges(pointer, event, multiselect);
+
+ this.selectionHandler._generateClickEvent('click', event, pointer);
+ this.selectionHandler._generateClickEvent('hold', event, pointer);
+ }
+
+ /**
+ * handle the release of the screen
+ *
+ * @private
+ */
+
+ }, {
+ key: 'onRelease',
+ value: function onRelease(event) {
+ if (new Date().valueOf() - this.touchTime > 10) {
+ var pointer = this.getPointer(event.center);
+ this.selectionHandler._generateClickEvent('release', event, pointer);
+ // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)
+ this.touchTime = new Date().valueOf();
+ }
+ }
+ }, {
+ key: 'onContext',
+ value: function onContext(event) {
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY });
+ this.selectionHandler._generateClickEvent('oncontext', event, pointer);
+ }
+
+ /**
+ *
+ * @param pointer
+ * @param add
+ */
+
+ }, {
+ key: 'checkSelectionChanges',
+ value: function checkSelectionChanges(pointer, event) {
+ var add = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ var previouslySelectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();
+ var previouslySelectedNodeCount = this.selectionHandler._getSelectedNodeCount();
+ var previousSelection = this.selectionHandler.getSelection();
+ var selected = void 0;
+ if (add === true) {
+ selected = this.selectionHandler.selectAdditionalOnPoint(pointer);
+ } else {
+ selected = this.selectionHandler.selectOnPoint(pointer);
+ }
+ var selectedEdgesCount = this.selectionHandler._getSelectedEdgeCount();
+ var selectedNodesCount = this.selectionHandler._getSelectedNodeCount();
+ var currentSelection = this.selectionHandler.getSelection();
+
+ var _determineIfDifferent2 = this._determineIfDifferent(previousSelection, currentSelection);
+
+ var nodesChanged = _determineIfDifferent2.nodesChanged;
+ var edgesChanged = _determineIfDifferent2.edgesChanged;
+
+ var nodeSelected = false;
+
+ if (selectedNodesCount - previouslySelectedNodeCount > 0) {
+ // node was selected
+ this.selectionHandler._generateClickEvent('selectNode', event, pointer);
+ selected = true;
+ nodeSelected = true;
+ } else if (nodesChanged === true && selectedNodesCount > 0) {
+ this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
+ this.selectionHandler._generateClickEvent('selectNode', event, pointer);
+ nodeSelected = true;
+ selected = true;
+ } else if (selectedNodesCount - previouslySelectedNodeCount < 0) {
+ // node was deselected
+ this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
+ selected = true;
+ }
+
+ // handle the selected edges
+ if (selectedEdgesCount - previouslySelectedEdgeCount > 0 && nodeSelected === false) {
+ // edge was selected
+ this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
+ selected = true;
+ } else if (selectedEdgesCount > 0 && edgesChanged === true) {
+ this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
+ this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
+ selected = true;
+ } else if (selectedEdgesCount - previouslySelectedEdgeCount < 0) {
+ // edge was deselected
+ this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
+ selected = true;
+ }
+
+ // fire the select event if anything has been selected or deselected
+ if (selected === true) {
+ // select or unselect
+ this.selectionHandler._generateClickEvent('select', event, pointer);
+ }
+ }
+
+ /**
+ * This function checks if the nodes and edges previously selected have changed.
+ * @param previousSelection
+ * @param currentSelection
+ * @returns {{nodesChanged: boolean, edgesChanged: boolean}}
+ * @private
+ */
+
+ }, {
+ key: '_determineIfDifferent',
+ value: function _determineIfDifferent(previousSelection, currentSelection) {
+ var nodesChanged = false;
+ var edgesChanged = false;
+
+ for (var i = 0; i < previousSelection.nodes.length; i++) {
+ if (currentSelection.nodes.indexOf(previousSelection.nodes[i]) === -1) {
+ nodesChanged = true;
+ }
+ }
+ for (var _i = 0; _i < currentSelection.nodes.length; _i++) {
+ if (previousSelection.nodes.indexOf(previousSelection.nodes[_i]) === -1) {
+ nodesChanged = true;
+ }
+ }
+ for (var _i2 = 0; _i2 < previousSelection.edges.length; _i2++) {
+ if (currentSelection.edges.indexOf(previousSelection.edges[_i2]) === -1) {
+ edgesChanged = true;
+ }
+ }
+ for (var _i3 = 0; _i3 < currentSelection.edges.length; _i3++) {
+ if (previousSelection.edges.indexOf(previousSelection.edges[_i3]) === -1) {
+ edgesChanged = true;
+ }
+ }
+
+ return { nodesChanged: nodesChanged, edgesChanged: edgesChanged };
+ }
+
+ /**
+ * This function is called by onDragStart.
+ * It is separated out because we can then overload it for the datamanipulation system.
+ *
+ * @private
+ */
+
+ }, {
+ key: 'onDragStart',
+ value: function onDragStart(event) {
+ //in case the touch event was triggered on an external div, do the initial touch now.
+ if (this.drag.pointer === undefined) {
+ this.onTouch(event);
+ }
+
+ // note: drag.pointer is set in onTouch to get the initial touch location
+ var node = this.selectionHandler.getNodeAt(this.drag.pointer);
+
+ this.drag.dragging = true;
+ this.drag.selection = [];
+ this.drag.translation = util.extend({}, this.body.view.translation); // copy the object
+ this.drag.nodeId = undefined;
+
+ if (node !== undefined && this.options.dragNodes === true) {
+ this.drag.nodeId = node.id;
+ // select the clicked node if not yet selected
+ if (node.isSelected() === false) {
+ this.selectionHandler.unselectAll();
+ this.selectionHandler.selectObject(node);
+ }
+
+ // after select to contain the node
+ this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer);
+
+ var selection = this.selectionHandler.selectionObj.nodes;
+ // create an array with the selected nodes and their original location and status
+ for (var nodeId in selection) {
+ if (selection.hasOwnProperty(nodeId)) {
+ var object = selection[nodeId];
+ var s = {
+ id: object.id,
+ node: object,
+
+ // store original x, y, xFixed and yFixed, make the node temporarily Fixed
+ x: object.x,
+ y: object.y,
+ xFixed: object.options.fixed.x,
+ yFixed: object.options.fixed.y
+ };
+
+ object.options.fixed.x = true;
+ object.options.fixed.y = true;
+
+ this.drag.selection.push(s);
+ }
+ }
+ } else {
+ // fallback if no node is selected and thus the view is dragged.
+ this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer, undefined, true);
+ }
+ }
+
+ /**
+ * handle drag event
+ * @private
+ */
+
+ }, {
+ key: 'onDrag',
+ value: function onDrag(event) {
+ var _this2 = this;
+
+ if (this.drag.pinched === true) {
+ return;
+ }
+
+ // remove the focus on node if it is focussed on by the focusOnNode
+ this.body.emitter.emit('unlockNode');
+
+ var pointer = this.getPointer(event.center);
+
+ var selection = this.drag.selection;
+ if (selection && selection.length && this.options.dragNodes === true) {
+ (function () {
+ _this2.selectionHandler._generateClickEvent('dragging', event, pointer);
+
+ // calculate delta's and new location
+ var deltaX = pointer.x - _this2.drag.pointer.x;
+ var deltaY = pointer.y - _this2.drag.pointer.y;
+
+ // update position of all selected nodes
+ selection.forEach(function (selection) {
+ var node = selection.node;
+ // only move the node if it was not fixed initially
+ if (selection.xFixed === false) {
+ node.x = _this2.canvas._XconvertDOMtoCanvas(_this2.canvas._XconvertCanvasToDOM(selection.x) + deltaX);
+ }
+ // only move the node if it was not fixed initially
+ if (selection.yFixed === false) {
+ node.y = _this2.canvas._YconvertDOMtoCanvas(_this2.canvas._YconvertCanvasToDOM(selection.y) + deltaY);
+ }
+ });
+
+ // start the simulation of the physics
+ _this2.body.emitter.emit('startSimulation');
+ })();
+ } else {
+ // move the network
+ if (this.options.dragView === true) {
+ this.selectionHandler._generateClickEvent('dragging', event, pointer, undefined, true);
+
+ // if the drag was not started properly because the click started outside the network div, start it now.
+ if (this.drag.pointer === undefined) {
+ this.onDragStart(event);
+ return;
+ }
+ var diffX = pointer.x - this.drag.pointer.x;
+ var diffY = pointer.y - this.drag.pointer.y;
+
+ this.body.view.translation = { x: this.drag.translation.x + diffX, y: this.drag.translation.y + diffY };
+ this.body.emitter.emit('_redraw');
+ }
+ }
+ }
+
+ /**
+ * handle drag start event
+ * @private
+ */
+
+ }, {
+ key: 'onDragEnd',
+ value: function onDragEnd(event) {
+ this.drag.dragging = false;
+ var selection = this.drag.selection;
+ if (selection && selection.length) {
+ selection.forEach(function (s) {
+ // restore original xFixed and yFixed
+ s.node.options.fixed.x = s.xFixed;
+ s.node.options.fixed.y = s.yFixed;
+ });
+ this.selectionHandler._generateClickEvent('dragEnd', event, this.getPointer(event.center));
+ this.body.emitter.emit('startSimulation');
+ } else {
+ this.selectionHandler._generateClickEvent('dragEnd', event, this.getPointer(event.center), undefined, true);
+ this.body.emitter.emit('_requestRedraw');
+ }
+ }
+
+ /**
+ * Handle pinch event
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: 'onPinch',
+ value: function onPinch(event) {
+ var pointer = this.getPointer(event.center);
+
+ this.drag.pinched = true;
+ if (this.pinch['scale'] === undefined) {
+ this.pinch.scale = 1;
+ }
+
+ // TODO: enabled moving while pinching?
+ var scale = this.pinch.scale * event.scale;
+ this.zoom(scale, pointer);
+ }
+
+ /**
+ * Zoom the network in or out
+ * @param {Number} scale a number around 1, and between 0.01 and 10
+ * @param {{x: Number, y: Number}} pointer Position on screen
+ * @return {Number} appliedScale scale is limited within the boundaries
+ * @private
+ */
+
+ }, {
+ key: 'zoom',
+ value: function zoom(scale, pointer) {
+ if (this.options.zoomView === true) {
+ var scaleOld = this.body.view.scale;
+ if (scale < 0.00001) {
+ scale = 0.00001;
+ }
+ if (scale > 10) {
+ scale = 10;
+ }
+
+ var preScaleDragPointer = undefined;
+ if (this.drag !== undefined) {
+ if (this.drag.dragging === true) {
+ preScaleDragPointer = this.canvas.DOMtoCanvas(this.drag.pointer);
+ }
+ }
+ // + this.canvas.frame.canvas.clientHeight / 2
+ var translation = this.body.view.translation;
+
+ var scaleFrac = scale / scaleOld;
+ var tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac;
+ var ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac;
+
+ this.body.view.scale = scale;
+ this.body.view.translation = { x: tx, y: ty };
+
+ if (preScaleDragPointer != undefined) {
+ var postScaleDragPointer = this.canvas.canvasToDOM(preScaleDragPointer);
+ this.drag.pointer.x = postScaleDragPointer.x;
+ this.drag.pointer.y = postScaleDragPointer.y;
+ }
+
+ this.body.emitter.emit('_requestRedraw');
+
+ if (scaleOld < scale) {
+ this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale });
+ } else {
+ this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale });
+ }
+ }
+ }
+
+ /**
+ * Event handler for mouse wheel event, used to zoom the timeline
+ * See http://adomas.org/javascript-mouse-wheel/
+ * https://github.com/EightMedia/hammer.js/issues/256
+ * @param {MouseEvent} event
+ * @private
+ */
+
+ }, {
+ key: 'onMouseWheel',
+ value: function onMouseWheel(event) {
+ if (this.options.zoomView === true) {
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) {
+ /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) {
+ /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta !== 0) {
+
+ // calculate the new scale
+ var scale = this.body.view.scale;
+ var zoom = delta / 10;
+ if (delta < 0) {
+ zoom = zoom / (1 - zoom);
+ }
+ scale *= 1 + zoom;
+
+ // calculate the pointer location
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY });
+
+ // apply the new scale
+ this.zoom(scale, pointer);
+ }
+
+ // Prevent default actions caused by mouse wheel.
+ event.preventDefault();
+ }
+ }
+
+ /**
+ * Mouse move handler for checking whether the title moves over a node with a title.
+ * @param {Event} event
+ * @private
+ */
+
+ }, {
+ key: 'onMouseMove',
+ value: function onMouseMove(event) {
+ var _this3 = this;
+
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY });
+ var popupVisible = false;
+
+ // check if the previously selected node is still selected
+ if (this.popup !== undefined) {
+ if (this.popup.hidden === false) {
+ this._checkHidePopup(pointer);
+ }
+
+ // if the popup was not hidden above
+ if (this.popup.hidden === false) {
+ popupVisible = true;
+ this.popup.setPosition(pointer.x + 3, pointer.y - 5);
+ this.popup.show();
+ }
+ }
+
+ // if we bind the keyboard to the div, we have to highlight it to use it. This highlights it on mouse over.
+ if (this.options.keyboard.bindToWindow === false && this.options.keyboard.enabled === true) {
+ this.canvas.frame.focus();
+ }
+
+ // start a timeout that will check if the mouse is positioned above an element
+ if (popupVisible === false) {
+ if (this.popupTimer !== undefined) {
+ clearInterval(this.popupTimer); // stop any running calculationTimer
+ this.popupTimer = undefined;
+ }
+ if (!this.drag.dragging) {
+ this.popupTimer = setTimeout(function () {
+ return _this3._checkShowPopup(pointer);
+ }, this.options.tooltipDelay);
+ }
+ }
+
+ /**
+ * Adding hover highlights
+ */
+ if (this.options.hover === true) {
+ // adding hover highlights
+ var obj = this.selectionHandler.getNodeAt(pointer);
+ if (obj === undefined) {
+ obj = this.selectionHandler.getEdgeAt(pointer);
+ }
+ this.selectionHandler.hoverObject(obj);
+ }
+ }
+
+ /**
+ * Check if there is an element on the given position in the network
+ * (a node or edge). If so, and if this element has a title,
+ * show a popup window with its title.
+ *
+ * @param {{x:Number, y:Number}} pointer
+ * @private
+ */
+
+ }, {
+ key: '_checkShowPopup',
+ value: function _checkShowPopup(pointer) {
+ var x = this.canvas._XconvertDOMtoCanvas(pointer.x);
+ var y = this.canvas._YconvertDOMtoCanvas(pointer.y);
+ var pointerObj = {
+ left: x,
+ top: y,
+ right: x,
+ bottom: y
+ };
+
+ var previousPopupObjId = this.popupObj === undefined ? undefined : this.popupObj.id;
+ var nodeUnderCursor = false;
+ var popupType = 'node';
+
+ // check if a node is under the cursor.
+ if (this.popupObj === undefined) {
+ // search the nodes for overlap, select the top one in case of multiple nodes
+ var nodeIndices = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+ var node = void 0;
+ var overlappingNodes = [];
+ for (var i = 0; i < nodeIndices.length; i++) {
+ node = nodes[nodeIndices[i]];
+ if (node.isOverlappingWith(pointerObj) === true) {
+ if (node.getTitle() !== undefined) {
+ overlappingNodes.push(nodeIndices[i]);
+ }
+ }
+ }
+
+ if (overlappingNodes.length > 0) {
+ // if there are overlapping nodes, select the last one, this is the one which is drawn on top of the others
+ this.popupObj = nodes[overlappingNodes[overlappingNodes.length - 1]];
+ // if you hover over a node, the title of the edge is not supposed to be shown.
+ nodeUnderCursor = true;
+ }
+ }
+
+ if (this.popupObj === undefined && nodeUnderCursor === false) {
+ // search the edges for overlap
+ var edgeIndices = this.body.edgeIndices;
+ var edges = this.body.edges;
+ var edge = void 0;
+ var overlappingEdges = [];
+ for (var _i4 = 0; _i4 < edgeIndices.length; _i4++) {
+ edge = edges[edgeIndices[_i4]];
+ if (edge.isOverlappingWith(pointerObj) === true) {
+ if (edge.connected === true && edge.getTitle() !== undefined) {
+ overlappingEdges.push(edgeIndices[_i4]);
+ }
+ }
+ }
+
+ if (overlappingEdges.length > 0) {
+ this.popupObj = edges[overlappingEdges[overlappingEdges.length - 1]];
+ popupType = 'edge';
+ }
+ }
+
+ if (this.popupObj !== undefined) {
+ // show popup message window
+ if (this.popupObj.id !== previousPopupObjId) {
+ if (this.popup === undefined) {
+ this.popup = new _Popup2.default(this.canvas.frame);
+ }
+
+ this.popup.popupTargetType = popupType;
+ this.popup.popupTargetId = this.popupObj.id;
+
+ // adjust a small offset such that the mouse cursor is located in the
+ // bottom left location of the popup, and you can easily move over the
+ // popup area
+ this.popup.setPosition(pointer.x + 3, pointer.y - 5);
+ this.popup.setText(this.popupObj.getTitle());
+ this.popup.show();
+ this.body.emitter.emit('showPopup', this.popupObj.id);
+ }
+ } else {
+ if (this.popup !== undefined) {
+ this.popup.hide();
+ this.body.emitter.emit('hidePopup');
+ }
+ }
+ }
+
+ /**
+ * Check if the popup must be hidden, which is the case when the mouse is no
+ * longer hovering on the object
+ * @param {{x:Number, y:Number}} pointer
+ * @private
+ */
+
+ }, {
+ key: '_checkHidePopup',
+ value: function _checkHidePopup(pointer) {
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+
+ var stillOnObj = false;
+ if (this.popup.popupTargetType === 'node') {
+ if (this.body.nodes[this.popup.popupTargetId] !== undefined) {
+ stillOnObj = this.body.nodes[this.popup.popupTargetId].isOverlappingWith(pointerObj);
+
+ // if the mouse is still one the node, we have to check if it is not also on one that is drawn on top of it.
+ // we initially only check stillOnObj because this is much faster.
+ if (stillOnObj === true) {
+ var overNode = this.selectionHandler.getNodeAt(pointer);
+ stillOnObj = overNode.id === this.popup.popupTargetId;
+ }
+ }
+ } else {
+ if (this.selectionHandler.getNodeAt(pointer) === undefined) {
+ if (this.body.edges[this.popup.popupTargetId] !== undefined) {
+ stillOnObj = this.body.edges[this.popup.popupTargetId].isOverlappingWith(pointerObj);
+ }
+ }
+ }
+
+ if (stillOnObj === false) {
+ this.popupObj = undefined;
+ this.popup.hide();
+ this.body.emitter.emit('hidePopup');
+ }
+ }
+ }]);
+
+ return InteractionHandler;
+ }();
+
+ exports.default = InteractionHandler;
+
+/***/ },
+/* 109 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(28);
+ var keycharm = __webpack_require__(23);
+
+ var NavigationHandler = function () {
+ function NavigationHandler(body, canvas) {
+ var _this = this;
+
+ _classCallCheck(this, NavigationHandler);
+
+ this.body = body;
+ this.canvas = canvas;
+
+ this.iconsCreated = false;
+ this.navigationHammers = [];
+ this.boundFunctions = {};
+ this.touchTime = 0;
+ this.activated = false;
+
+ this.body.emitter.on("activate", function () {
+ _this.activated = true;_this.configureKeyboardBindings();
+ });
+ this.body.emitter.on("deactivate", function () {
+ _this.activated = false;_this.configureKeyboardBindings();
+ });
+ this.body.emitter.on("destroy", function () {
+ if (_this.keycharm !== undefined) {
+ _this.keycharm.destroy();
+ }
+ });
+
+ this.options = {};
+ }
+
+ _createClass(NavigationHandler, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ this.options = options;
+ this.create();
+ }
+ }
+ }, {
+ key: 'create',
+ value: function create() {
+ if (this.options.navigationButtons === true) {
+ if (this.iconsCreated === false) {
+ this.loadNavigationElements();
+ }
+ } else if (this.iconsCreated === true) {
+ this.cleanNavigation();
+ }
+
+ this.configureKeyboardBindings();
+ }
+ }, {
+ key: 'cleanNavigation',
+ value: function cleanNavigation() {
+ // clean hammer bindings
+ if (this.navigationHammers.length != 0) {
+ for (var i = 0; i < this.navigationHammers.length; i++) {
+ this.navigationHammers[i].destroy();
+ }
+ this.navigationHammers = [];
+ }
+
+ // clean up previous navigation items
+ if (this.navigationDOM && this.navigationDOM['wrapper'] && this.navigationDOM['wrapper'].parentNode) {
+ this.navigationDOM['wrapper'].parentNode.removeChild(this.navigationDOM['wrapper']);
+ }
+
+ this.iconsCreated = false;
+ }
+
+ /**
+ * Creation of the navigation controls nodes. They are drawn over the rest of the nodes and are not affected by scale and translation
+ * they have a triggerFunction which is called on click. If the position of the navigation controls is dependent
+ * on this.frame.canvas.clientWidth or this.frame.canvas.clientHeight, we flag horizontalAlignLeft and verticalAlignTop false.
+ * This means that the location will be corrected by the _relocateNavigation function on a size change of the canvas.
+ *
+ * @private
+ */
+
+ }, {
+ key: 'loadNavigationElements',
+ value: function loadNavigationElements() {
+ var _this2 = this;
+
+ this.cleanNavigation();
+
+ this.navigationDOM = {};
+ var navigationDivs = ['up', 'down', 'left', 'right', 'zoomIn', 'zoomOut', 'zoomExtends'];
+ var navigationDivActions = ['_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 i = 0; i < navigationDivs.length; i++) {
+ this.navigationDOM[navigationDivs[i]] = document.createElement('div');
+ this.navigationDOM[navigationDivs[i]].className = 'vis-button vis-' + navigationDivs[i];
+ this.navigationDOM['wrapper'].appendChild(this.navigationDOM[navigationDivs[i]]);
+
+ var hammer = new Hammer(this.navigationDOM[navigationDivs[i]]);
+ if (navigationDivActions[i] === "_fit") {
+ hammerUtil.onTouch(hammer, this._fit.bind(this));
+ } else {
+ hammerUtil.onTouch(hammer, this.bindToRedraw.bind(this, navigationDivActions[i]));
+ }
+
+ this.navigationHammers.push(hammer);
+ }
+
+ // use a hammer for the release so we do not require the one used in the rest of the network
+ // the one the rest uses can be overloaded by the manipulation system.
+ var hammerFrame = new Hammer(this.canvas.frame);
+ hammerUtil.onRelease(hammerFrame, function () {
+ _this2._stopMovement();
+ });
+ this.navigationHammers.push(hammerFrame);
+
+ this.iconsCreated = true;
+ }
+ }, {
+ key: 'bindToRedraw',
+ value: function bindToRedraw(action) {
+ if (this.boundFunctions[action] === undefined) {
+ this.boundFunctions[action] = this[action].bind(this);
+ this.body.emitter.on("initRedraw", this.boundFunctions[action]);
+ this.body.emitter.emit("_startRendering");
+ }
+ }
+ }, {
+ key: 'unbindFromRedraw',
+ value: function unbindFromRedraw(action) {
+ if (this.boundFunctions[action] !== undefined) {
+ this.body.emitter.off("initRedraw", this.boundFunctions[action]);
+ this.body.emitter.emit("_stopRendering");
+ delete this.boundFunctions[action];
+ }
+ }
+
+ /**
+ * this stops all movement induced by the navigation buttons
+ *
+ * @private
+ */
+
+ }, {
+ key: '_fit',
+ value: function _fit() {
+ if (new Date().valueOf() - this.touchTime > 700) {
+ // TODO: fix ugly hack to avoid hammer's double fireing of event (because we use release?)
+ this.body.emitter.emit("fit", { duration: 700 });
+ this.touchTime = new Date().valueOf();
+ }
+ }
+
+ /**
+ * this stops all movement induced by the navigation buttons
+ *
+ * @private
+ */
+
+ }, {
+ key: '_stopMovement',
+ value: function _stopMovement() {
+ for (var boundAction in this.boundFunctions) {
+ if (this.boundFunctions.hasOwnProperty(boundAction)) {
+ this.body.emitter.off("initRedraw", this.boundFunctions[boundAction]);
+ this.body.emitter.emit("_stopRendering");
+ }
+ }
+ this.boundFunctions = {};
+ }
+ }, {
+ key: '_moveUp',
+ value: function _moveUp() {
+ this.body.view.translation.y += this.options.keyboard.speed.y;
+ }
+ }, {
+ key: '_moveDown',
+ value: function _moveDown() {
+ this.body.view.translation.y -= this.options.keyboard.speed.y;
+ }
+ }, {
+ key: '_moveLeft',
+ value: function _moveLeft() {
+ this.body.view.translation.x += this.options.keyboard.speed.x;
+ }
+ }, {
+ key: '_moveRight',
+ value: function _moveRight() {
+ this.body.view.translation.x -= this.options.keyboard.speed.x;
+ }
+ }, {
+ key: '_zoomIn',
+ value: function _zoomIn() {
+ this.body.view.scale *= 1 + this.options.keyboard.speed.zoom;
+ this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale });
+ }
+ }, {
+ key: '_zoomOut',
+ value: function _zoomOut() {
+ this.body.view.scale /= 1 + this.options.keyboard.speed.zoom;
+ this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale });
+ }
+
+ /**
+ * bind all keys using keycharm.
+ */
+
+ }, {
+ key: 'configureKeyboardBindings',
+ value: function configureKeyboardBindings() {
+ var _this3 = this;
+
+ if (this.keycharm !== undefined) {
+ this.keycharm.destroy();
+ }
+
+ if (this.options.keyboard.enabled === true) {
+ if (this.options.keyboard.bindToWindow === true) {
+ this.keycharm = keycharm({ container: window, preventDefault: true });
+ } else {
+ this.keycharm = keycharm({ container: this.canvas.frame, preventDefault: true });
+ }
+
+ this.keycharm.reset();
+
+ if (this.activated === true) {
+ this.keycharm.bind("up", function () {
+ _this3.bindToRedraw("_moveUp");
+ }, "keydown");
+ this.keycharm.bind("down", function () {
+ _this3.bindToRedraw("_moveDown");
+ }, "keydown");
+ this.keycharm.bind("left", function () {
+ _this3.bindToRedraw("_moveLeft");
+ }, "keydown");
+ this.keycharm.bind("right", function () {
+ _this3.bindToRedraw("_moveRight");
+ }, "keydown");
+ this.keycharm.bind("=", function () {
+ _this3.bindToRedraw("_zoomIn");
+ }, "keydown");
+ this.keycharm.bind("num+", function () {
+ _this3.bindToRedraw("_zoomIn");
+ }, "keydown");
+ this.keycharm.bind("num-", function () {
+ _this3.bindToRedraw("_zoomOut");
+ }, "keydown");
+ this.keycharm.bind("-", function () {
+ _this3.bindToRedraw("_zoomOut");
+ }, "keydown");
+ this.keycharm.bind("[", function () {
+ _this3.bindToRedraw("_zoomOut");
+ }, "keydown");
+ this.keycharm.bind("]", function () {
+ _this3.bindToRedraw("_zoomIn");
+ }, "keydown");
+ this.keycharm.bind("pageup", function () {
+ _this3.bindToRedraw("_zoomIn");
+ }, "keydown");
+ this.keycharm.bind("pagedown", function () {
+ _this3.bindToRedraw("_zoomOut");
+ }, "keydown");
+
+ this.keycharm.bind("up", function () {
+ _this3.unbindFromRedraw("_moveUp");
+ }, "keyup");
+ this.keycharm.bind("down", function () {
+ _this3.unbindFromRedraw("_moveDown");
+ }, "keyup");
+ this.keycharm.bind("left", function () {
+ _this3.unbindFromRedraw("_moveLeft");
+ }, "keyup");
+ this.keycharm.bind("right", function () {
+ _this3.unbindFromRedraw("_moveRight");
+ }, "keyup");
+ this.keycharm.bind("=", function () {
+ _this3.unbindFromRedraw("_zoomIn");
+ }, "keyup");
+ this.keycharm.bind("num+", function () {
+ _this3.unbindFromRedraw("_zoomIn");
+ }, "keyup");
+ this.keycharm.bind("num-", function () {
+ _this3.unbindFromRedraw("_zoomOut");
+ }, "keyup");
+ this.keycharm.bind("-", function () {
+ _this3.unbindFromRedraw("_zoomOut");
+ }, "keyup");
+ this.keycharm.bind("[", function () {
+ _this3.unbindFromRedraw("_zoomOut");
+ }, "keyup");
+ this.keycharm.bind("]", function () {
+ _this3.unbindFromRedraw("_zoomIn");
+ }, "keyup");
+ this.keycharm.bind("pageup", function () {
+ _this3.unbindFromRedraw("_zoomIn");
+ }, "keyup");
+ this.keycharm.bind("pagedown", function () {
+ _this3.unbindFromRedraw("_zoomOut");
+ }, "keyup");
+ }
+ }
+ }
+ }]);
+
+ return NavigationHandler;
+ }();
+
+ exports.default = NavigationHandler;
+
+/***/ },
+/* 110 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ /**
+ * Popup is a class to create a popup window with some text
+ * @param {Element} container The container object.
+ * @param {Number} [x]
+ * @param {Number} [y]
+ * @param {String} [text]
+ * @param {Object} [style] An object containing borderColor,
+ * backgroundColor, etc.
+ */
+
+ var Popup = function () {
+ function Popup(container) {
+ _classCallCheck(this, Popup);
+
+ this.container = container;
+
+ this.x = 0;
+ this.y = 0;
+ this.padding = 5;
+ this.hidden = false;
+
+ // create the frame
+ this.frame = document.createElement('div');
+ this.frame.className = 'vis-network-tooltip';
+ this.container.appendChild(this.frame);
+ }
+
+ /**
+ * @param {number} x Horizontal position of the popup window
+ * @param {number} y Vertical position of the popup window
+ */
+
+
+ _createClass(Popup, [{
+ key: 'setPosition',
+ value: function setPosition(x, y) {
+ this.x = parseInt(x);
+ this.y = parseInt(y);
+ }
+
+ /**
+ * Set the content for the popup window. This can be HTML code or text.
+ * @param {string | Element} content
+ */
+
+ }, {
+ key: 'setText',
+ value: function setText(content) {
+ if (content instanceof Element) {
+ this.frame.innerHTML = '';
+ this.frame.appendChild(content);
+ } else {
+ this.frame.innerHTML = content; // string containing text or HTML
+ }
+ }
+
+ /**
+ * Show the popup window
+ * @param {boolean} [doShow] Show or hide the window
+ */
+
+ }, {
+ key: 'show',
+ value: function show(doShow) {
+ if (doShow === undefined) {
+ doShow = true;
+ }
+
+ if (doShow === true) {
+ var height = this.frame.clientHeight;
+ var width = this.frame.clientWidth;
+ var maxHeight = this.frame.parentNode.clientHeight;
+ var maxWidth = this.frame.parentNode.clientWidth;
+
+ var top = this.y - height;
+ if (top + height + this.padding > maxHeight) {
+ top = maxHeight - height - this.padding;
+ }
+ if (top < this.padding) {
+ top = this.padding;
+ }
+
+ var left = this.x;
+ if (left + width + this.padding > maxWidth) {
+ left = maxWidth - width - this.padding;
+ }
+ if (left < this.padding) {
+ left = this.padding;
+ }
+
+ this.frame.style.left = left + "px";
+ this.frame.style.top = top + "px";
+ this.frame.style.visibility = "visible";
+ this.hidden = false;
+ } else {
+ this.hide();
+ }
+ }
+
+ /**
+ * Hide the popup window
+ */
+
+ }, {
+ key: 'hide',
+ value: function hide() {
+ this.hidden = true;
+ this.frame.style.visibility = "hidden";
+ }
+ }]);
+
+ return Popup;
+ }();
+
+ exports.default = Popup;
+
+/***/ },
+/* 111 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _Node = __webpack_require__(65);
+
+ var _Node2 = _interopRequireDefault(_Node);
+
+ var _Edge = __webpack_require__(85);
+
+ var _Edge2 = _interopRequireDefault(_Edge);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var SelectionHandler = function () {
+ function SelectionHandler(body, canvas) {
+ var _this = this;
+
+ _classCallCheck(this, SelectionHandler);
+
+ this.body = body;
+ this.canvas = canvas;
+ this.selectionObj = { nodes: [], edges: [] };
+ this.hoverObj = { nodes: {}, edges: {} };
+
+ this.options = {};
+ this.defaultOptions = {
+ multiselect: false,
+ selectable: true,
+ selectConnectedEdges: true,
+ hoverConnectedEdges: true
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.body.emitter.on("_dataChanged", function () {
+ _this.updateSelection();
+ });
+ }
+
+ _createClass(SelectionHandler, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ var fields = ['multiselect', 'hoverConnectedEdges', 'selectable', 'selectConnectedEdges'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ }
+ }
+
+ /**
+ * handles the selection part of the tap;
+ *
+ * @param {Object} pointer
+ * @private
+ */
+
+ }, {
+ key: 'selectOnPoint',
+ value: function selectOnPoint(pointer) {
+ var selected = false;
+ if (this.options.selectable === true) {
+ var obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);
+
+ // unselect after getting the objects in order to restore width and height.
+ this.unselectAll();
+
+ if (obj !== undefined) {
+ selected = this.selectObject(obj);
+ }
+ this.body.emitter.emit("_requestRedraw");
+ }
+ return selected;
+ }
+ }, {
+ key: 'selectAdditionalOnPoint',
+ value: function selectAdditionalOnPoint(pointer) {
+ var selectionChanged = false;
+ if (this.options.selectable === true) {
+ var obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);
+
+ if (obj !== undefined) {
+ selectionChanged = true;
+ if (obj.isSelected() === true) {
+ this.deselectObject(obj);
+ } else {
+ this.selectObject(obj);
+ }
+
+ this.body.emitter.emit("_requestRedraw");
+ }
+ }
+ return selectionChanged;
+ }
+ }, {
+ key: '_generateClickEvent',
+ value: function _generateClickEvent(eventType, event, pointer, oldSelection) {
+ var emptySelection = arguments.length <= 4 || arguments[4] === undefined ? false : arguments[4];
+
+ var properties = void 0;
+ if (emptySelection === true) {
+ properties = { nodes: [], edges: [] };
+ } else {
+ properties = this.getSelection();
+ }
+ properties['pointer'] = {
+ DOM: { x: pointer.x, y: pointer.y },
+ canvas: this.canvas.DOMtoCanvas(pointer)
+ };
+ properties['event'] = event;
+
+ if (oldSelection !== undefined) {
+ properties['previousSelection'] = oldSelection;
+ }
+ this.body.emitter.emit(eventType, properties);
+ }
+ }, {
+ key: 'selectObject',
+ value: function selectObject(obj) {
+ var highlightEdges = arguments.length <= 1 || arguments[1] === undefined ? this.options.selectConnectedEdges : arguments[1];
+
+ if (obj !== undefined) {
+ if (obj instanceof _Node2.default) {
+ if (highlightEdges === true) {
+ this._selectConnectedEdges(obj);
+ }
+ }
+ obj.select();
+ this._addToSelection(obj);
+ return true;
+ }
+ return false;
+ }
+ }, {
+ key: 'deselectObject',
+ value: function deselectObject(obj) {
+ if (obj.isSelected() === true) {
+ obj.selected = false;
+ this._removeFromSelection(obj);
+ }
+ }
+
+ /**
+ * retrieve all nodes overlapping with given object
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
+ * @private
+ */
+
+ }, {
+ key: '_getAllNodesOverlappingWith',
+ value: function _getAllNodesOverlappingWith(object) {
+ var overlappingNodes = [];
+ var nodes = this.body.nodes;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var nodeId = this.body.nodeIndices[i];
+ if (nodes[nodeId].isOverlappingWith(object)) {
+ overlappingNodes.push(nodeId);
+ }
+ }
+ return overlappingNodes;
+ }
+
+ /**
+ * Return a position object in canvasspace from a single point in screenspace
+ *
+ * @param pointer
+ * @returns {{left: number, top: number, right: number, bottom: number}}
+ * @private
+ */
+
+ }, {
+ key: '_pointerToPositionObject',
+ value: function _pointerToPositionObject(pointer) {
+ var canvasPos = this.canvas.DOMtoCanvas(pointer);
+ return {
+ left: canvasPos.x - 1,
+ top: canvasPos.y + 1,
+ right: canvasPos.x + 1,
+ bottom: canvasPos.y - 1
+ };
+ }
+
+ /**
+ * Get the top node at the a specific point (like a click)
+ *
+ * @param {{x: Number, y: Number}} pointer
+ * @return {Node | undefined} node
+ */
+
+ }, {
+ key: 'getNodeAt',
+ value: function getNodeAt(pointer) {
+ var returnNode = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ // we first check if this is an navigation controls element
+ var positionObject = this._pointerToPositionObject(pointer);
+ var overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
+ // if there are overlapping nodes, select the last one, this is the
+ // one which is drawn on top of the others
+ if (overlappingNodes.length > 0) {
+ if (returnNode === true) {
+ return this.body.nodes[overlappingNodes[overlappingNodes.length - 1]];
+ } else {
+ return overlappingNodes[overlappingNodes.length - 1];
+ }
+ } else {
+ return undefined;
+ }
+ }
+
+ /**
+ * retrieve all edges overlapping with given object, selector is around center
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
+ * @private
+ */
+
+ }, {
+ key: '_getEdgesOverlappingWith',
+ value: function _getEdgesOverlappingWith(object, overlappingEdges) {
+ var edges = this.body.edges;
+ for (var i = 0; i < this.body.edgeIndices.length; i++) {
+ var edgeId = this.body.edgeIndices[i];
+ if (edges[edgeId].isOverlappingWith(object)) {
+ overlappingEdges.push(edgeId);
+ }
+ }
+ }
+
+ /**
+ * retrieve all nodes overlapping with given object
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
+ * @private
+ */
+
+ }, {
+ key: '_getAllEdgesOverlappingWith',
+ value: function _getAllEdgesOverlappingWith(object) {
+ var overlappingEdges = [];
+ this._getEdgesOverlappingWith(object, overlappingEdges);
+ return overlappingEdges;
+ }
+
+ /**
+ * Place holder. To implement change the getNodeAt to a _getObjectAt. Have the _getObjectAt call
+ * getNodeAt and _getEdgesAt, then priortize the selection to user preferences.
+ *
+ * @param pointer
+ * @returns {undefined}
+ */
+
+ }, {
+ key: 'getEdgeAt',
+ value: function getEdgeAt(pointer) {
+ var returnEdge = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ var positionObject = this._pointerToPositionObject(pointer);
+ var overlappingEdges = this._getAllEdgesOverlappingWith(positionObject);
+
+ if (overlappingEdges.length > 0) {
+ if (returnEdge === true) {
+ return this.body.edges[overlappingEdges[overlappingEdges.length - 1]];
+ } else {
+ return overlappingEdges[overlappingEdges.length - 1];
+ }
+ } else {
+ return undefined;
+ }
+ }
+
+ /**
+ * Add object to the selection array.
+ *
+ * @param obj
+ * @private
+ */
+
+ }, {
+ key: '_addToSelection',
+ value: function _addToSelection(obj) {
+ if (obj instanceof _Node2.default) {
+ this.selectionObj.nodes[obj.id] = obj;
+ } else {
+ this.selectionObj.edges[obj.id] = obj;
+ }
+ }
+
+ /**
+ * Add object to the selection array.
+ *
+ * @param obj
+ * @private
+ */
+
+ }, {
+ key: '_addToHover',
+ value: function _addToHover(obj) {
+ if (obj instanceof _Node2.default) {
+ this.hoverObj.nodes[obj.id] = obj;
+ } else {
+ this.hoverObj.edges[obj.id] = obj;
+ }
+ }
+
+ /**
+ * Remove a single option from selection.
+ *
+ * @param {Object} obj
+ * @private
+ */
+
+ }, {
+ key: '_removeFromSelection',
+ value: function _removeFromSelection(obj) {
+ if (obj instanceof _Node2.default) {
+ delete this.selectionObj.nodes[obj.id];
+ this._unselectConnectedEdges(obj);
+ } else {
+ delete this.selectionObj.edges[obj.id];
+ }
+ }
+
+ /**
+ * Unselect all. The selectionObj is useful for this.
+ */
+
+ }, {
+ key: 'unselectAll',
+ value: function unselectAll() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ this.selectionObj.nodes[nodeId].unselect();
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ this.selectionObj.edges[edgeId].unselect();
+ }
+ }
+
+ this.selectionObj = { nodes: {}, edges: {} };
+ }
+
+ /**
+ * return the number of selected nodes
+ *
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_getSelectedNodeCount',
+ value: function _getSelectedNodeCount() {
+ var count = 0;
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ }
+
+ /**
+ * return the selected node
+ *
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_getSelectedNode',
+ value: function _getSelectedNode() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ return this.selectionObj.nodes[nodeId];
+ }
+ }
+ return undefined;
+ }
+
+ /**
+ * return the selected edge
+ *
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_getSelectedEdge',
+ value: function _getSelectedEdge() {
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ return this.selectionObj.edges[edgeId];
+ }
+ }
+ return undefined;
+ }
+
+ /**
+ * return the number of selected edges
+ *
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_getSelectedEdgeCount',
+ value: function _getSelectedEdgeCount() {
+ var count = 0;
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ }
+
+ /**
+ * return the number of selected objects.
+ *
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_getSelectedObjectCount',
+ value: function _getSelectedObjectCount() {
+ var count = 0;
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ count += 1;
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ }
+
+ /**
+ * Check if anything is selected
+ *
+ * @returns {boolean}
+ * @private
+ */
+
+ }, {
+ key: '_selectionIsEmpty',
+ value: function _selectionIsEmpty() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ return false;
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * check if one of the selected nodes is a cluster.
+ *
+ * @returns {boolean}
+ * @private
+ */
+
+ }, {
+ key: '_clusterInSelection',
+ value: function _clusterInSelection() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * select the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+
+ }, {
+ key: '_selectConnectedEdges',
+ value: function _selectConnectedEdges(node) {
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ edge.select();
+ this._addToSelection(edge);
+ }
+ }
+
+ /**
+ * select the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+
+ }, {
+ key: '_hoverConnectedEdges',
+ value: function _hoverConnectedEdges(node) {
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ edge.hover = true;
+ this._addToHover(edge);
+ }
+ }
+
+ /**
+ * unselect the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+
+ }, {
+ key: '_unselectConnectedEdges',
+ value: function _unselectConnectedEdges(node) {
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ edge.unselect();
+ this._removeFromSelection(edge);
+ }
+ }
+
+ /**
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
+ *
+ * @param {Node || Edge} object
+ * @private
+ */
+
+ }, {
+ key: 'blurObject',
+ value: function blurObject(object) {
+ if (object.hover === true) {
+ object.hover = false;
+ if (object instanceof _Node2.default) {
+ this.body.emitter.emit("blurNode", { node: object.id });
+ } else {
+ this.body.emitter.emit("blurEdge", { edge: object.id });
+ }
+ }
+ }
+
+ /**
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
+ *
+ * @param {Node || Edge} object
+ * @private
+ */
+
+ }, {
+ key: 'hoverObject',
+ value: function hoverObject(object) {
+ var hoverChanged = false;
+ // remove all node hover highlights
+ for (var nodeId in this.hoverObj.nodes) {
+ if (this.hoverObj.nodes.hasOwnProperty(nodeId)) {
+ if (object === undefined || object instanceof _Node2.default && object.id != nodeId || object instanceof _Edge2.default) {
+ this.blurObject(this.hoverObj.nodes[nodeId]);
+ delete this.hoverObj.nodes[nodeId];
+ hoverChanged = true;
+ }
+ }
+ }
+
+ // removing all edge hover highlights
+ for (var edgeId in this.hoverObj.edges) {
+ if (this.hoverObj.edges.hasOwnProperty(edgeId)) {
+ // if the hover has been changed here it means that the node has been hovered over or off
+ // we then do not use the blurObject method here.
+ if (hoverChanged === true) {
+ this.hoverObj.edges[edgeId].hover = false;
+ delete this.hoverObj.edges[edgeId];
+ }
+ // if the blur remains the same and the object is undefined (mouse off), we blur the edge
+ else if (object === undefined) {
+ this.blurObject(this.hoverObj.edges[edgeId]);
+ delete this.hoverObj.edges[edgeId];
+ hoverChanged = true;
+ }
+ }
+ }
+
+ if (object !== undefined) {
+ if (object.hover === false) {
+ object.hover = true;
+ this._addToHover(object);
+ hoverChanged = true;
+ if (object instanceof _Node2.default) {
+ this.body.emitter.emit("hoverNode", { node: object.id });
+ } else {
+ this.body.emitter.emit("hoverEdge", { edge: object.id });
+ }
+ }
+ if (object instanceof _Node2.default && this.options.hoverConnectedEdges === true) {
+ this._hoverConnectedEdges(object);
+ }
+ }
+
+ if (hoverChanged === true) {
+ this.body.emitter.emit('_requestRedraw');
+ }
+ }
+
+ /**
+ *
+ * retrieve the currently selected objects
+ * @return {{nodes: Array.<String>, edges: Array.<String>}} selection
+ */
+
+ }, {
+ key: 'getSelection',
+ value: function getSelection() {
+ var nodeIds = this.getSelectedNodes();
+ var edgeIds = this.getSelectedEdges();
+ return { nodes: nodeIds, edges: edgeIds };
+ }
+
+ /**
+ *
+ * retrieve the currently selected nodes
+ * @return {String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+
+ }, {
+ key: 'getSelectedNodes',
+ value: function getSelectedNodes() {
+ var idArray = [];
+ if (this.options.selectable === true) {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ idArray.push(this.selectionObj.nodes[nodeId].id);
+ }
+ }
+ }
+ return idArray;
+ }
+
+ /**
+ *
+ * retrieve the currently selected edges
+ * @return {Array} selection An array with the ids of the
+ * selected nodes.
+ */
+
+ }, {
+ key: 'getSelectedEdges',
+ value: function getSelectedEdges() {
+ var idArray = [];
+ if (this.options.selectable === true) {
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ idArray.push(this.selectionObj.edges[edgeId].id);
+ }
+ }
+ }
+ return idArray;
+ }
+
+ /**
+ * Updates the current selection
+ * @param {{nodes: Array.<String>, edges: Array.<String>}} Selection
+ * @param {Object} options Options
+ */
+
+ }, {
+ key: 'setSelection',
+ value: function setSelection(selection) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ var i = void 0,
+ id = void 0;
+
+ if (!selection || !selection.nodes && !selection.edges) throw 'Selection must be an object with nodes and/or edges properties';
+ // first unselect any selected node, if option is true or undefined
+ if (options.unselectAll || options.unselectAll === undefined) {
+ this.unselectAll();
+ }
+ if (selection.nodes) {
+ for (i = 0; i < selection.nodes.length; i++) {
+ id = selection.nodes[i];
+
+ var node = this.body.nodes[id];
+ if (!node) {
+ throw new RangeError('Node with id "' + id + '" not found');
+ }
+ // don't select edges with it
+ this.selectObject(node, options.highlightEdges);
+ }
+ }
+
+ if (selection.edges) {
+ for (i = 0; i < selection.edges.length; i++) {
+ id = selection.edges[i];
+
+ var edge = this.body.edges[id];
+ if (!edge) {
+ throw new RangeError('Edge with id "' + id + '" not found');
+ }
+ this.selectObject(edge);
+ }
+ }
+ this.body.emitter.emit('_requestRedraw');
+ }
+
+ /**
+ * select zero or more nodes with the option to highlight edges
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ * @param {boolean} [highlightEdges]
+ */
+
+ }, {
+ key: 'selectNodes',
+ value: function selectNodes(selection) {
+ var highlightEdges = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ if (!selection || selection.length === undefined) throw 'Selection must be an array with ids';
+
+ this.setSelection({ nodes: selection }, { highlightEdges: highlightEdges });
+ }
+
+ /**
+ * select zero or more edges
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+
+ }, {
+ key: 'selectEdges',
+ value: function selectEdges(selection) {
+ if (!selection || selection.length === undefined) throw 'Selection must be an array with ids';
+
+ this.setSelection({ edges: selection });
+ }
+
+ /**
+ * Validate the selection: remove ids of nodes which no longer exist
+ * @private
+ */
+
+ }, {
+ key: 'updateSelection',
+ value: function updateSelection() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (!this.body.nodes.hasOwnProperty(nodeId)) {
+ delete this.selectionObj.nodes[nodeId];
+ }
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ if (!this.body.edges.hasOwnProperty(edgeId)) {
+ delete this.selectionObj.edges[edgeId];
+ }
+ }
+ }
+ }
+ }]);
+
+ return SelectionHandler;
+ }();
+
+ exports.default = SelectionHandler;
+
+/***/ },
+/* 112 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _NetworkUtil = __webpack_require__(103);
+
+ var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ var LayoutEngine = function () {
+ function LayoutEngine(body) {
+ _classCallCheck(this, LayoutEngine);
+
+ this.body = body;
+
+ this.initialRandomSeed = Math.round(Math.random() * 1000000);
+ this.randomSeed = this.initialRandomSeed;
+ this.setPhysics = false;
+ this.options = {};
+ this.optionsBackup = { physics: {} };
+
+ this.defaultOptions = {
+ randomSeed: undefined,
+ improvedLayout: true,
+ hierarchical: {
+ enabled: false,
+ levelSeparation: 150,
+ nodeSpacing: 100,
+ treeSpacing: 200,
+ blockShifting: true,
+ edgeMinimization: true,
+ parentCentralization: true,
+ direction: 'UD', // UD, DU, LR, RL
+ sortMethod: 'hubsize' // hubsize, directed
+ }
+ };
+ util.extend(this.options, this.defaultOptions);
+ this.bindEventListeners();
+ }
+
+ _createClass(LayoutEngine, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('_dataChanged', function () {
+ _this.setupHierarchicalLayout();
+ });
+ this.body.emitter.on('_dataLoaded', function () {
+ _this.layoutNetwork();
+ });
+ this.body.emitter.on('_resetHierarchicalLayout', function () {
+ _this.setupHierarchicalLayout();
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options, allOptions) {
+ if (options !== undefined) {
+ var prevHierarchicalState = this.options.hierarchical.enabled;
+ util.selectiveDeepExtend(["randomSeed", "improvedLayout"], this.options, options);
+ util.mergeOptions(this.options, options, 'hierarchical');
+ if (options.randomSeed !== undefined) {
+ this.initialRandomSeed = options.randomSeed;
+ }
+
+ if (this.options.hierarchical.enabled === true) {
+ if (prevHierarchicalState === true) {
+ // refresh the overridden options for nodes and edges.
+ this.body.emitter.emit('refresh', true);
+ }
+
+ // make sure the level separation is the right way up
+ if (this.options.hierarchical.direction === 'RL' || this.options.hierarchical.direction === 'DU') {
+ if (this.options.hierarchical.levelSeparation > 0) {
+ this.options.hierarchical.levelSeparation *= -1;
+ }
+ } else {
+ if (this.options.hierarchical.levelSeparation < 0) {
+ this.options.hierarchical.levelSeparation *= -1;
+ }
+ }
+
+ this.body.emitter.emit('_resetHierarchicalLayout');
+ // because the hierarchical system needs it's own physics and smooth curve settings, we adapt the other options if needed.
+ return this.adaptAllOptionsForHierarchicalLayout(allOptions);
+ } else {
+ if (prevHierarchicalState === true) {
+ // refresh the overridden options for nodes and edges.
+ this.body.emitter.emit('refresh');
+ return util.deepExtend(allOptions, this.optionsBackup);
+ }
+ }
+ }
+ return allOptions;
+ }
+ }, {
+ key: 'adaptAllOptionsForHierarchicalLayout',
+ value: function adaptAllOptionsForHierarchicalLayout(allOptions) {
+ if (this.options.hierarchical.enabled === true) {
+ // set the physics
+ if (allOptions.physics === undefined || allOptions.physics === true) {
+ allOptions.physics = {
+ enabled: this.optionsBackup.physics.enabled === undefined ? true : this.optionsBackup.physics.enabled,
+ solver: 'hierarchicalRepulsion'
+ };
+ this.optionsBackup.physics.enabled = this.optionsBackup.physics.enabled === undefined ? true : this.optionsBackup.physics.enabled;
+ this.optionsBackup.physics.solver = this.optionsBackup.physics.solver || 'barnesHut';
+ } else if (_typeof(allOptions.physics) === 'object') {
+ this.optionsBackup.physics.enabled = allOptions.physics.enabled === undefined ? true : allOptions.physics.enabled;
+ this.optionsBackup.physics.solver = allOptions.physics.solver || 'barnesHut';
+ allOptions.physics.solver = 'hierarchicalRepulsion';
+ } else if (allOptions.physics !== false) {
+ this.optionsBackup.physics.solver = 'barnesHut';
+ allOptions.physics = { solver: 'hierarchicalRepulsion' };
+ }
+
+ // get the type of static smooth curve in case it is required
+ var type = 'horizontal';
+ if (this.options.hierarchical.direction === 'RL' || this.options.hierarchical.direction === 'LR') {
+ type = 'vertical';
+ }
+
+ // disable smooth curves if nothing is defined. If smooth curves have been turned on, turn them into static smooth curves.
+ if (allOptions.edges === undefined) {
+ this.optionsBackup.edges = { smooth: { enabled: true, type: 'dynamic' } };
+ allOptions.edges = { smooth: false };
+ } else if (allOptions.edges.smooth === undefined) {
+ this.optionsBackup.edges = { smooth: { enabled: true, type: 'dynamic' } };
+ allOptions.edges.smooth = false;
+ } else {
+ if (typeof allOptions.edges.smooth === 'boolean') {
+ this.optionsBackup.edges = { smooth: allOptions.edges.smooth };
+ allOptions.edges.smooth = { enabled: allOptions.edges.smooth, type: type };
+ } else {
+ // allow custom types except for dynamic
+ if (allOptions.edges.smooth.type !== undefined && allOptions.edges.smooth.type !== 'dynamic') {
+ type = allOptions.edges.smooth.type;
+ }
+
+ this.optionsBackup.edges = {
+ smooth: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,
+ type: allOptions.edges.smooth.type === undefined ? 'dynamic' : allOptions.edges.smooth.type,
+ roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness,
+ forceDirection: allOptions.edges.smooth.forceDirection === undefined ? false : allOptions.edges.smooth.forceDirection
+ };
+ allOptions.edges.smooth = {
+ enabled: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,
+ type: type,
+ roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness,
+ forceDirection: allOptions.edges.smooth.forceDirection === undefined ? false : allOptions.edges.smooth.forceDirection
+ };
+ }
+ }
+
+ // force all edges into static smooth curves. Only applies to edges that do not use the global options for smooth.
+ this.body.emitter.emit('_forceDisableDynamicCurves', type);
+ }
+
+ return allOptions;
+ }
+ }, {
+ key: 'seededRandom',
+ value: function seededRandom() {
+ var x = Math.sin(this.randomSeed++) * 10000;
+ return x - Math.floor(x);
+ }
+ }, {
+ key: 'positionInitially',
+ value: function positionInitially(nodesArray) {
+ if (this.options.hierarchical.enabled !== true) {
+ this.randomSeed = this.initialRandomSeed;
+ for (var i = 0; i < nodesArray.length; i++) {
+ var node = nodesArray[i];
+ var radius = 10 * 0.1 * nodesArray.length + 10;
+ var angle = 2 * Math.PI * this.seededRandom();
+ if (node.x === undefined) {
+ node.x = radius * Math.cos(angle);
+ }
+ if (node.y === undefined) {
+ node.y = radius * Math.sin(angle);
+ }
+ }
+ }
+ }
+
+ /**
+ * Use Kamada Kawai to position nodes. This is quite a heavy algorithm so if there are a lot of nodes we
+ * cluster them first to reduce the amount.
+ */
+
+ }, {
+ key: 'layoutNetwork',
+ value: function layoutNetwork() {
+ if (this.options.hierarchical.enabled !== true && this.options.improvedLayout === true) {
+ // first check if we should Kamada Kawai to layout. The threshold is if less than half of the visible
+ // nodes have predefined positions we use this.
+ var positionDefined = 0;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (node.predefinedPosition === true) {
+ positionDefined += 1;
+ }
+ }
+
+ // if less than half of the nodes have a predefined position we continue
+ if (positionDefined < 0.5 * this.body.nodeIndices.length) {
+ var MAX_LEVELS = 10;
+ var level = 0;
+ var clusterThreshold = 100;
+ // if there are a lot of nodes, we cluster before we run the algorithm.
+ if (this.body.nodeIndices.length > clusterThreshold) {
+ var startLength = this.body.nodeIndices.length;
+ while (this.body.nodeIndices.length > clusterThreshold) {
+ //console.time("clustering")
+ level += 1;
+ var before = this.body.nodeIndices.length;
+ // if there are many nodes we do a hubsize cluster
+ if (level % 3 === 0) {
+ this.body.modules.clustering.clusterBridges();
+ } else {
+ this.body.modules.clustering.clusterOutliers();
+ }
+ var after = this.body.nodeIndices.length;
+ if (before == after && level % 3 !== 0 || level > MAX_LEVELS) {
+ this._declusterAll();
+ this.body.emitter.emit("_layoutFailed");
+ console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");
+ return;
+ }
+ //console.timeEnd("clustering")
+ //console.log(level,after)
+ }
+ // increase the size of the edges
+ this.body.modules.kamadaKawai.setOptions({ springLength: Math.max(150, 2 * startLength) });
+ }
+
+ // position the system for these nodes and edges
+ this.body.modules.kamadaKawai.solve(this.body.nodeIndices, this.body.edgeIndices, true);
+
+ // shift to center point
+ this._shiftToCenter();
+
+ // perturb the nodes a little bit to force the physics to kick in
+ var offset = 70;
+ for (var _i = 0; _i < this.body.nodeIndices.length; _i++) {
+ this.body.nodes[this.body.nodeIndices[_i]].x += (0.5 - this.seededRandom()) * offset;
+ this.body.nodes[this.body.nodeIndices[_i]].y += (0.5 - this.seededRandom()) * offset;
+ }
+
+ // uncluster all clusters
+ this._declusterAll();
+
+ // reposition all bezier nodes.
+ this.body.emitter.emit("_repositionBezierNodes");
+ }
+ }
+ }
+
+ /**
+ * Move all the nodes towards to the center so gravitational pull wil not move the nodes away from view
+ * @private
+ */
+
+ }, {
+ key: '_shiftToCenter',
+ value: function _shiftToCenter() {
+ var range = _NetworkUtil2.default.getRangeCore(this.body.nodes, this.body.nodeIndices);
+ var center = _NetworkUtil2.default.findCenter(range);
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ this.body.nodes[this.body.nodeIndices[i]].x -= center.x;
+ this.body.nodes[this.body.nodeIndices[i]].y -= center.y;
+ }
+ }
+ }, {
+ key: '_declusterAll',
+ value: function _declusterAll() {
+ var clustersPresent = true;
+ while (clustersPresent === true) {
+ clustersPresent = false;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ if (this.body.nodes[this.body.nodeIndices[i]].isCluster === true) {
+ clustersPresent = true;
+ this.body.modules.clustering.openCluster(this.body.nodeIndices[i], {}, false);
+ }
+ }
+ if (clustersPresent === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }
+ }, {
+ key: 'getSeed',
+ value: function getSeed() {
+ return this.initialRandomSeed;
+ }
+
+ /**
+ * This is the main function to layout the nodes in a hierarchical way.
+ * It checks if the node details are supplied correctly
+ *
+ * @private
+ */
+
+ }, {
+ key: 'setupHierarchicalLayout',
+ value: function setupHierarchicalLayout() {
+ if (this.options.hierarchical.enabled === true && this.body.nodeIndices.length > 0) {
+ // get the size of the largest hubs and check if the user has defined a level for a node.
+ var node = void 0,
+ nodeId = void 0;
+ var definedLevel = false;
+ var definedPositions = true;
+ var undefinedLevel = false;
+ this.hierarchicalLevels = {};
+ this.lastNodeOnLevel = {};
+ this.hierarchicalChildrenReference = {};
+ this.hierarchicalParentReference = {};
+ this.hierarchicalTrees = {};
+ this.treeIndex = -1;
+
+ this.distributionOrdering = {};
+ this.distributionIndex = {};
+ this.distributionOrderingPresence = {};
+
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ node = this.body.nodes[nodeId];
+ if (node.options.x === undefined && node.options.y === undefined) {
+ definedPositions = false;
+ }
+ if (node.options.level !== undefined) {
+ definedLevel = true;
+ this.hierarchicalLevels[nodeId] = node.options.level;
+ } else {
+ undefinedLevel = true;
+ }
+ }
+ }
+
+ // if the user defined some levels but not all, alert and run without hierarchical layout
+ if (undefinedLevel === true && definedLevel === true) {
+ throw new Error('To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.');
+ return;
+ } else {
+ // define levels if undefined by the users. Based on hubsize.
+ if (undefinedLevel === true) {
+ if (this.options.hierarchical.sortMethod === 'hubsize') {
+ this._determineLevelsByHubsize();
+ } else if (this.options.hierarchical.sortMethod === 'directed') {
+ this._determineLevelsDirected();
+ } else if (this.options.hierarchical.sortMethod === 'custom') {
+ this._determineLevelsCustomCallback();
+ }
+ }
+
+ // fallback for cases where there are nodes but no edges
+ for (var _nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(_nodeId)) {
+ if (this.hierarchicalLevels[_nodeId] === undefined) {
+ this.hierarchicalLevels[_nodeId] = 0;
+ }
+ }
+ }
+ // check the distribution of the nodes per level.
+ var distribution = this._getDistribution();
+
+ // get the parent children relations.
+ this._generateMap();
+
+ // place the nodes on the canvas.
+ this._placeNodesByHierarchy(distribution);
+
+ // condense the whitespace.
+ this._condenseHierarchy();
+
+ // shift to center so gravity does not have to do much
+ this._shiftToCenter();
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+
+ }, {
+ key: '_condenseHierarchy',
+ value: function _condenseHierarchy() {
+ var _this2 = this;
+
+ // Global var in this scope to define when the movement has stopped.
+ var stillShifting = false;
+ var branches = {};
+ // first we have some methods to help shifting trees around.
+ // the main method to shift the trees
+ var shiftTrees = function shiftTrees() {
+ var treeSizes = getTreeSizes();
+ for (var i = 0; i < treeSizes.length - 1; i++) {
+ var diff = treeSizes[i].max - treeSizes[i + 1].min;
+ shiftTree(i + 1, diff + _this2.options.hierarchical.treeSpacing);
+ }
+ };
+
+ // shift a single tree by an offset
+ var shiftTree = function shiftTree(index, offset) {
+ for (var nodeId in _this2.hierarchicalTrees) {
+ if (_this2.hierarchicalTrees.hasOwnProperty(nodeId)) {
+ if (_this2.hierarchicalTrees[nodeId] === index) {
+ var node = _this2.body.nodes[nodeId];
+ var pos = _this2._getPositionForHierarchy(node);
+ _this2._setPositionForHierarchy(node, pos + offset, undefined, true);
+ }
+ }
+ }
+ };
+
+ // get the width of a tree
+ var getTreeSize = function getTreeSize(index) {
+ var min = 1e9;
+ var max = -1e9;
+ for (var nodeId in _this2.hierarchicalTrees) {
+ if (_this2.hierarchicalTrees.hasOwnProperty(nodeId)) {
+ if (_this2.hierarchicalTrees[nodeId] === index) {
+ var pos = _this2._getPositionForHierarchy(_this2.body.nodes[nodeId]);
+ min = Math.min(pos, min);
+ max = Math.max(pos, max);
+ }
+ }
+ }
+ return { min: min, max: max };
+ };
+
+ // get the width of all trees
+ var getTreeSizes = function getTreeSizes() {
+ var treeWidths = [];
+ for (var i = 0; i <= _this2.treeIndex; i++) {
+ treeWidths.push(getTreeSize(i));
+ }
+ return treeWidths;
+ };
+
+ // get a map of all nodes in this branch
+ var getBranchNodes = function getBranchNodes(source, map) {
+ map[source.id] = true;
+ if (_this2.hierarchicalChildrenReference[source.id]) {
+ var children = _this2.hierarchicalChildrenReference[source.id];
+ if (children.length > 0) {
+ for (var i = 0; i < children.length; i++) {
+ getBranchNodes(_this2.body.nodes[children[i]], map);
+ }
+ }
+ }
+ };
+
+ // get a min max width as well as the maximum movement space it has on either sides
+ // we use min max terminology because width and height can interchange depending on the direction of the layout
+ var getBranchBoundary = function getBranchBoundary(branchMap) {
+ var maxLevel = arguments.length <= 1 || arguments[1] === undefined ? 1e9 : arguments[1];
+
+ var minSpace = 1e9;
+ var maxSpace = 1e9;
+ var min = 1e9;
+ var max = -1e9;
+ for (var branchNode in branchMap) {
+ if (branchMap.hasOwnProperty(branchNode)) {
+ var node = _this2.body.nodes[branchNode];
+ var level = _this2.hierarchicalLevels[node.id];
+ var position = _this2._getPositionForHierarchy(node);
+
+ // get the space around the node.
+
+ var _getSpaceAroundNode2 = _this2._getSpaceAroundNode(node, branchMap);
+
+ var _getSpaceAroundNode3 = _slicedToArray(_getSpaceAroundNode2, 2);
+
+ var minSpaceNode = _getSpaceAroundNode3[0];
+ var maxSpaceNode = _getSpaceAroundNode3[1];
+
+ minSpace = Math.min(minSpaceNode, minSpace);
+ maxSpace = Math.min(maxSpaceNode, maxSpace);
+
+ // the width is only relevant for the levels two nodes have in common. This is why we filter on this.
+ if (level <= maxLevel) {
+ min = Math.min(position, min);
+ max = Math.max(position, max);
+ }
+ }
+ }
+
+ return [min, max, minSpace, maxSpace];
+ };
+
+ // get the maximum level of a branch.
+ var getMaxLevel = function getMaxLevel(nodeId) {
+ var level = _this2.hierarchicalLevels[nodeId];
+ if (_this2.hierarchicalChildrenReference[nodeId]) {
+ var children = _this2.hierarchicalChildrenReference[nodeId];
+ if (children.length > 0) {
+ for (var i = 0; i < children.length; i++) {
+ level = Math.max(level, getMaxLevel(children[i]));
+ }
+ }
+ }
+ return level;
+ };
+
+ // check what the maximum level is these nodes have in common.
+ var getCollisionLevel = function getCollisionLevel(node1, node2) {
+ var maxLevel1 = getMaxLevel(node1.id);
+ var maxLevel2 = getMaxLevel(node2.id);
+ return Math.min(maxLevel1, maxLevel2);
+ };
+
+ // check if two nodes have the same parent(s)
+ var hasSameParent = function hasSameParent(node1, node2) {
+ var parents1 = _this2.hierarchicalParentReference[node1.id];
+ var parents2 = _this2.hierarchicalParentReference[node2.id];
+ if (parents1 === undefined || parents2 === undefined) {
+ return false;
+ }
+
+ for (var i = 0; i < parents1.length; i++) {
+ for (var j = 0; j < parents2.length; j++) {
+ if (parents1[i] == parents2[j]) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ // condense elements. These can be nodes or branches depending on the callback.
+ var shiftElementsCloser = function shiftElementsCloser(callback, levels, centerParents) {
+ for (var i = 0; i < levels.length; i++) {
+ var level = levels[i];
+ var levelNodes = _this2.distributionOrdering[level];
+ if (levelNodes.length > 1) {
+ for (var j = 0; j < levelNodes.length - 1; j++) {
+ if (hasSameParent(levelNodes[j], levelNodes[j + 1]) === true) {
+ if (_this2.hierarchicalTrees[levelNodes[j].id] === _this2.hierarchicalTrees[levelNodes[j + 1].id]) {
+ callback(levelNodes[j], levelNodes[j + 1], centerParents);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ // callback for shifting branches
+ var branchShiftCallback = function branchShiftCallback(node1, node2) {
+ var centerParent = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ //window.CALLBACKS.push(() => {
+ var pos1 = _this2._getPositionForHierarchy(node1);
+ var pos2 = _this2._getPositionForHierarchy(node2);
+ var diffAbs = Math.abs(pos2 - pos1);
+ //console.log("NOW CHEcKING:", node1.id, node2.id, diffAbs);
+ if (diffAbs > _this2.options.hierarchical.nodeSpacing) {
+ var branchNodes1 = {};branchNodes1[node1.id] = true;
+ var branchNodes2 = {};branchNodes2[node2.id] = true;
+
+ getBranchNodes(node1, branchNodes1);
+ getBranchNodes(node2, branchNodes2);
+
+ // check the largest distance between the branches
+ var maxLevel = getCollisionLevel(node1, node2);
+
+ var _getBranchBoundary = getBranchBoundary(branchNodes1, maxLevel);
+
+ var _getBranchBoundary2 = _slicedToArray(_getBranchBoundary, 4);
+
+ var min1 = _getBranchBoundary2[0];
+ var max1 = _getBranchBoundary2[1];
+ var minSpace1 = _getBranchBoundary2[2];
+ var maxSpace1 = _getBranchBoundary2[3];
+
+ var _getBranchBoundary3 = getBranchBoundary(branchNodes2, maxLevel);
+
+ var _getBranchBoundary4 = _slicedToArray(_getBranchBoundary3, 4);
+
+ var min2 = _getBranchBoundary4[0];
+ var max2 = _getBranchBoundary4[1];
+ var minSpace2 = _getBranchBoundary4[2];
+ var maxSpace2 = _getBranchBoundary4[3];
+
+ //console.log(node1.id, getBranchBoundary(branchNodes1, maxLevel), node2.id, getBranchBoundary(branchNodes2, maxLevel), maxLevel);
+
+ var diffBranch = Math.abs(max1 - min2);
+ if (diffBranch > _this2.options.hierarchical.nodeSpacing) {
+ var offset = max1 - min2 + _this2.options.hierarchical.nodeSpacing;
+ if (offset < -minSpace2 + _this2.options.hierarchical.nodeSpacing) {
+ offset = -minSpace2 + _this2.options.hierarchical.nodeSpacing;
+ //console.log("RESETTING OFFSET", max1 - min2 + this.options.hierarchical.nodeSpacing, -minSpace2, offset);
+ }
+ if (offset < 0) {
+ //console.log("SHIFTING", node2.id, offset);
+ _this2._shiftBlock(node2.id, offset);
+ stillShifting = true;
+
+ if (centerParent === true) _this2._centerParent(node2);
+ }
+ }
+ }
+ //this.body.emitter.emit("_redraw");})
+ };
+
+ var minimizeEdgeLength = function minimizeEdgeLength(iterations, node) {
+ //window.CALLBACKS.push(() => {
+ // console.log("ts",node.id);
+ var nodeId = node.id;
+ var allEdges = node.edges;
+ var nodeLevel = _this2.hierarchicalLevels[node.id];
+
+ // gather constants
+ var C2 = _this2.options.hierarchical.levelSeparation * _this2.options.hierarchical.levelSeparation;
+ var referenceNodes = {};
+ var aboveEdges = [];
+ for (var i = 0; i < allEdges.length; i++) {
+ var edge = allEdges[i];
+ if (edge.toId != edge.fromId) {
+ var otherNode = edge.toId == nodeId ? edge.from : edge.to;
+ referenceNodes[allEdges[i].id] = otherNode;
+ if (_this2.hierarchicalLevels[otherNode.id] < nodeLevel) {
+ aboveEdges.push(edge);
+ }
+ }
+ }
+
+ // differentiated sum of lengths based on only moving one node over one axis
+ var getFx = function getFx(point, edges) {
+ var sum = 0;
+ for (var _i2 = 0; _i2 < edges.length; _i2++) {
+ if (referenceNodes[edges[_i2].id] !== undefined) {
+ var a = _this2._getPositionForHierarchy(referenceNodes[edges[_i2].id]) - point;
+ sum += a / Math.sqrt(a * a + C2);
+ }
+ }
+ return sum;
+ };
+
+ // doubly differentiated sum of lengths based on only moving one node over one axis
+ var getDFx = function getDFx(point, edges) {
+ var sum = 0;
+ for (var _i3 = 0; _i3 < edges.length; _i3++) {
+ if (referenceNodes[edges[_i3].id] !== undefined) {
+ var a = _this2._getPositionForHierarchy(referenceNodes[edges[_i3].id]) - point;
+ sum -= C2 * Math.pow(a * a + C2, -1.5);
+ }
+ }
+ return sum;
+ };
+
+ var getGuess = function getGuess(iterations, edges) {
+ var guess = _this2._getPositionForHierarchy(node);
+ // Newton's method for optimization
+ var guessMap = {};
+ for (var _i4 = 0; _i4 < iterations; _i4++) {
+ var fx = getFx(guess, edges);
+ var dfx = getDFx(guess, edges);
+
+ // we limit the movement to avoid instability.
+ var limit = 40;
+ var ratio = Math.max(-limit, Math.min(limit, Math.round(fx / dfx)));
+ guess = guess - ratio;
+ // reduce duplicates
+ if (guessMap[guess] !== undefined) {
+ break;
+ }
+ guessMap[guess] = _i4;
+ }
+ return guess;
+ };
+
+ var moveBranch = function moveBranch(guess) {
+ // position node if there is space
+ var nodePosition = _this2._getPositionForHierarchy(node);
+
+ // check movable area of the branch
+ if (branches[node.id] === undefined) {
+ var branchNodes = {};
+ branchNodes[node.id] = true;
+ getBranchNodes(node, branchNodes);
+ branches[node.id] = branchNodes;
+ }
+
+ var _getBranchBoundary5 = getBranchBoundary(branches[node.id]);
+
+ var _getBranchBoundary6 = _slicedToArray(_getBranchBoundary5, 4);
+
+ var minBranch = _getBranchBoundary6[0];
+ var maxBranch = _getBranchBoundary6[1];
+ var minSpaceBranch = _getBranchBoundary6[2];
+ var maxSpaceBranch = _getBranchBoundary6[3];
+
+
+ var diff = guess - nodePosition;
+
+ // check if we are allowed to move the node:
+ var branchOffset = 0;
+ if (diff > 0) {
+ branchOffset = Math.min(diff, maxSpaceBranch - _this2.options.hierarchical.nodeSpacing);
+ } else if (diff < 0) {
+ branchOffset = -Math.min(-diff, minSpaceBranch - _this2.options.hierarchical.nodeSpacing);
+ }
+
+ if (branchOffset != 0) {
+ //console.log("moving branch:",branchOffset, maxSpaceBranch, minSpaceBranch)
+ _this2._shiftBlock(node.id, branchOffset);
+ //this.body.emitter.emit("_redraw");
+ stillShifting = true;
+ }
+ };
+
+ var moveNode = function moveNode(guess) {
+ var nodePosition = _this2._getPositionForHierarchy(node);
+
+ // position node if there is space
+
+ var _getSpaceAroundNode4 = _this2._getSpaceAroundNode(node);
+
+ var _getSpaceAroundNode5 = _slicedToArray(_getSpaceAroundNode4, 2);
+
+ var minSpace = _getSpaceAroundNode5[0];
+ var maxSpace = _getSpaceAroundNode5[1];
+
+ var diff = guess - nodePosition;
+ // check if we are allowed to move the node:
+ var newPosition = nodePosition;
+ if (diff > 0) {
+ newPosition = Math.min(nodePosition + (maxSpace - _this2.options.hierarchical.nodeSpacing), guess);
+ } else if (diff < 0) {
+ newPosition = Math.max(nodePosition - (minSpace - _this2.options.hierarchical.nodeSpacing), guess);
+ }
+
+ if (newPosition !== nodePosition) {
+ //console.log("moving Node:",diff, minSpace, maxSpace);
+ _this2._setPositionForHierarchy(node, newPosition, undefined, true);
+ //this.body.emitter.emit("_redraw");
+ stillShifting = true;
+ }
+ };
+
+ var guess = getGuess(iterations, aboveEdges);
+ moveBranch(guess);
+ guess = getGuess(iterations, allEdges);
+ moveNode(guess);
+ //})
+ };
+
+ // method to remove whitespace between branches. Because we do bottom up, we can center the parents.
+ var minimizeEdgeLengthBottomUp = function minimizeEdgeLengthBottomUp(iterations) {
+ var levels = Object.keys(_this2.distributionOrdering);
+ levels = levels.reverse();
+ for (var i = 0; i < iterations; i++) {
+ stillShifting = false;
+ for (var j = 0; j < levels.length; j++) {
+ var level = levels[j];
+ var levelNodes = _this2.distributionOrdering[level];
+ for (var k = 0; k < levelNodes.length; k++) {
+ minimizeEdgeLength(1000, levelNodes[k]);
+ }
+ }
+ if (stillShifting !== true) {
+ //console.log("FINISHED minimizeEdgeLengthBottomUp IN " + i);
+ break;
+ }
+ }
+ };
+
+ // method to remove whitespace between branches. Because we do bottom up, we can center the parents.
+ var shiftBranchesCloserBottomUp = function shiftBranchesCloserBottomUp(iterations) {
+ var levels = Object.keys(_this2.distributionOrdering);
+ levels = levels.reverse();
+ for (var i = 0; i < iterations; i++) {
+ stillShifting = false;
+ shiftElementsCloser(branchShiftCallback, levels, true);
+ if (stillShifting !== true) {
+ //console.log("FINISHED shiftBranchesCloserBottomUp IN " + (i+1));
+ break;
+ }
+ }
+ };
+
+ // center all parents
+ var centerAllParents = function centerAllParents() {
+ for (var nodeId in _this2.body.nodes) {
+ if (_this2.body.nodes.hasOwnProperty(nodeId)) _this2._centerParent(_this2.body.nodes[nodeId]);
+ }
+ };
+
+ // center all parents
+ var centerAllParentsBottomUp = function centerAllParentsBottomUp() {
+ var levels = Object.keys(_this2.distributionOrdering);
+ levels = levels.reverse();
+ for (var i = 0; i < levels.length; i++) {
+ var level = levels[i];
+ var levelNodes = _this2.distributionOrdering[level];
+ for (var j = 0; j < levelNodes.length; j++) {
+ _this2._centerParent(levelNodes[j]);
+ }
+ }
+ };
+
+ // the actual work is done here.
+ if (this.options.hierarchical.blockShifting === true) {
+ shiftBranchesCloserBottomUp(5);
+ centerAllParents();
+ }
+
+ // minimize edge length
+ if (this.options.hierarchical.edgeMinimization === true) {
+ minimizeEdgeLengthBottomUp(20);
+ }
+
+ if (this.options.hierarchical.parentCentralization === true) {
+ centerAllParentsBottomUp();
+ }
+
+ shiftTrees();
+ }
+
+ /**
+ * This gives the space around the node. IF a map is supplied, it will only check against nodes NOT in the map.
+ * This is used to only get the distances to nodes outside of a branch.
+ * @param node
+ * @param map
+ * @returns {*[]}
+ * @private
+ */
+
+ }, {
+ key: '_getSpaceAroundNode',
+ value: function _getSpaceAroundNode(node, map) {
+ var useMap = true;
+ if (map === undefined) {
+ useMap = false;
+ }
+ var level = this.hierarchicalLevels[node.id];
+ if (level !== undefined) {
+ var index = this.distributionIndex[node.id];
+ var position = this._getPositionForHierarchy(node);
+ var minSpace = 1e9;
+ var maxSpace = 1e9;
+ if (index !== 0) {
+ var prevNode = this.distributionOrdering[level][index - 1];
+ if (useMap === true && map[prevNode.id] === undefined || useMap === false) {
+ var prevPos = this._getPositionForHierarchy(prevNode);
+ minSpace = position - prevPos;
+ }
+ }
+
+ if (index != this.distributionOrdering[level].length - 1) {
+ var nextNode = this.distributionOrdering[level][index + 1];
+ if (useMap === true && map[nextNode.id] === undefined || useMap === false) {
+ var nextPos = this._getPositionForHierarchy(nextNode);
+ maxSpace = Math.min(maxSpace, nextPos - position);
+ }
+ }
+
+ return [minSpace, maxSpace];
+ } else {
+ return [0, 0];
+ }
+ }
+
+ /**
+ * We use this method to center a parent node and check if it does not cross other nodes when it does.
+ * @param node
+ * @private
+ */
+
+ }, {
+ key: '_centerParent',
+ value: function _centerParent(node) {
+ if (this.hierarchicalParentReference[node.id]) {
+ var parents = this.hierarchicalParentReference[node.id];
+ for (var i = 0; i < parents.length; i++) {
+ var parentId = parents[i];
+ var parentNode = this.body.nodes[parentId];
+ if (this.hierarchicalChildrenReference[parentId]) {
+ // get the range of the children
+ var minPos = 1e9;
+ var maxPos = -1e9;
+ var children = this.hierarchicalChildrenReference[parentId];
+ if (children.length > 0) {
+ for (var _i5 = 0; _i5 < children.length; _i5++) {
+ var childNode = this.body.nodes[children[_i5]];
+ minPos = Math.min(minPos, this._getPositionForHierarchy(childNode));
+ maxPos = Math.max(maxPos, this._getPositionForHierarchy(childNode));
+ }
+ }
+
+ var position = this._getPositionForHierarchy(parentNode);
+
+ var _getSpaceAroundNode6 = this._getSpaceAroundNode(parentNode);
+
+ var _getSpaceAroundNode7 = _slicedToArray(_getSpaceAroundNode6, 2);
+
+ var minSpace = _getSpaceAroundNode7[0];
+ var maxSpace = _getSpaceAroundNode7[1];
+
+ var newPosition = 0.5 * (minPos + maxPos);
+ var diff = position - newPosition;
+ if (diff < 0 && Math.abs(diff) < maxSpace - this.options.hierarchical.nodeSpacing || diff > 0 && Math.abs(diff) < minSpace - this.options.hierarchical.nodeSpacing) {
+ this._setPositionForHierarchy(parentNode, newPosition, undefined, true);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This function places the nodes on the canvas based on the hierarchial distribution.
+ *
+ * @param {Object} distribution | obtained by the function this._getDistribution()
+ * @private
+ */
+
+ }, {
+ key: '_placeNodesByHierarchy',
+ value: function _placeNodesByHierarchy(distribution) {
+ this.positionedNodes = {};
+ // start placing all the level 0 nodes first. Then recursively position their branches.
+ for (var level in distribution) {
+ if (distribution.hasOwnProperty(level)) {
+ // sort nodes in level by position:
+ var nodeArray = Object.keys(distribution[level]);
+ nodeArray = this._indexArrayToNodes(nodeArray);
+ this._sortNodeArray(nodeArray);
+ var handledNodeCount = 0;
+
+ for (var i = 0; i < nodeArray.length; i++) {
+ var node = nodeArray[i];
+ if (this.positionedNodes[node.id] === undefined) {
+ var pos = this.options.hierarchical.nodeSpacing * handledNodeCount;
+ // we get the X or Y values we need and store them in pos and previousPos. The get and set make sure we get X or Y
+ if (handledNodeCount > 0) {
+ pos = this._getPositionForHierarchy(nodeArray[i - 1]) + this.options.hierarchical.nodeSpacing;
+ }
+ this._setPositionForHierarchy(node, pos, level);
+ this._validataPositionAndContinue(node, level, pos);
+
+ handledNodeCount++;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes
+ * on a X position that ensures there will be no overlap.
+ *
+ * @param parentId
+ * @param parentLevel
+ * @private
+ */
+
+ }, {
+ key: '_placeBranchNodes',
+ value: function _placeBranchNodes(parentId, parentLevel) {
+ // if this is not a parent, cancel the placing. This can happen with multiple parents to one child.
+ if (this.hierarchicalChildrenReference[parentId] === undefined) {
+ return;
+ }
+
+ // get a list of childNodes
+ var childNodes = [];
+ for (var i = 0; i < this.hierarchicalChildrenReference[parentId].length; i++) {
+ childNodes.push(this.body.nodes[this.hierarchicalChildrenReference[parentId][i]]);
+ }
+
+ // use the positions to order the nodes.
+ this._sortNodeArray(childNodes);
+
+ // position the childNodes
+ for (var _i6 = 0; _i6 < childNodes.length; _i6++) {
+ var childNode = childNodes[_i6];
+ var childNodeLevel = this.hierarchicalLevels[childNode.id];
+ // check if the child node is below the parent node and if it has already been positioned.
+ if (childNodeLevel > parentLevel && this.positionedNodes[childNode.id] === undefined) {
+ // get the amount of space required for this node. If parent the width is based on the amount of children.
+ var pos = void 0;
+
+ // we get the X or Y values we need and store them in pos and previousPos. The get and set make sure we get X or Y
+ if (_i6 === 0) {
+ pos = this._getPositionForHierarchy(this.body.nodes[parentId]);
+ } else {
+ pos = this._getPositionForHierarchy(childNodes[_i6 - 1]) + this.options.hierarchical.nodeSpacing;
+ }
+ this._setPositionForHierarchy(childNode, pos, childNodeLevel);
+ this._validataPositionAndContinue(childNode, childNodeLevel, pos);
+ } else {
+ return;
+ }
+ }
+
+ // center the parent nodes.
+ var minPos = 1e9;
+ var maxPos = -1e9;
+ for (var _i7 = 0; _i7 < childNodes.length; _i7++) {
+ var childNodeId = childNodes[_i7].id;
+ minPos = Math.min(minPos, this._getPositionForHierarchy(this.body.nodes[childNodeId]));
+ maxPos = Math.max(maxPos, this._getPositionForHierarchy(this.body.nodes[childNodeId]));
+ }
+ this._setPositionForHierarchy(this.body.nodes[parentId], 0.5 * (minPos + maxPos), parentLevel);
+ }
+
+ /**
+ * This method checks for overlap and if required shifts the branch. It also keeps records of positioned nodes.
+ * Finally it will call _placeBranchNodes to place the branch nodes.
+ * @param node
+ * @param level
+ * @param pos
+ * @private
+ */
+
+ }, {
+ key: '_validataPositionAndContinue',
+ value: function _validataPositionAndContinue(node, level, pos) {
+ // if overlap has been detected, we shift the branch
+ if (this.lastNodeOnLevel[level] !== undefined) {
+ var previousPos = this._getPositionForHierarchy(this.body.nodes[this.lastNodeOnLevel[level]]);
+ if (pos - previousPos < this.options.hierarchical.nodeSpacing) {
+ var diff = previousPos + this.options.hierarchical.nodeSpacing - pos;
+ var sharedParent = this._findCommonParent(this.lastNodeOnLevel[level], node.id);
+ this._shiftBlock(sharedParent.withChild, diff);
+ }
+ }
+
+ // store change in position.
+ this.lastNodeOnLevel[level] = node.id;
+
+ this.positionedNodes[node.id] = true;
+
+ this._placeBranchNodes(node.id, level);
+ }
+
+ /**
+ * Receives an array with node indices and returns an array with the actual node references. Used for sorting based on
+ * node properties.
+ * @param idArray
+ */
+
+ }, {
+ key: '_indexArrayToNodes',
+ value: function _indexArrayToNodes(idArray) {
+ var array = [];
+ for (var i = 0; i < idArray.length; i++) {
+ array.push(this.body.nodes[idArray[i]]);
+ }
+ return array;
+ }
+
+ /**
+ * This function get the distribution of levels based on hubsize
+ *
+ * @returns {Object}
+ * @private
+ */
+
+ }, {
+ key: '_getDistribution',
+ value: function _getDistribution() {
+ var distribution = {};
+ var nodeId = void 0,
+ node = void 0;
+
+ // we fix Y because the hierarchy is vertical, we fix X so we do not give a node an x position for a second time.
+ // the fix of X is removed after the x value has been set.
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ node = this.body.nodes[nodeId];
+ var level = this.hierarchicalLevels[nodeId] === undefined ? 0 : this.hierarchicalLevels[nodeId];
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ node.y = this.options.hierarchical.levelSeparation * level;
+ node.options.fixed.y = true;
+ } else {
+ node.x = this.options.hierarchical.levelSeparation * level;
+ node.options.fixed.x = true;
+ }
+ if (distribution[level] === undefined) {
+ distribution[level] = {};
+ }
+ distribution[level][nodeId] = node;
+ }
+ }
+ return distribution;
+ }
+
+ /**
+ * Get the hubsize from all remaining unlevelled nodes.
+ *
+ * @returns {number}
+ * @private
+ */
+
+ }, {
+ key: '_getHubSize',
+ value: function _getHubSize() {
+ var hubSize = 0;
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (this.hierarchicalLevels[nodeId] === undefined) {
+ hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;
+ }
+ }
+ }
+ return hubSize;
+ }
+
+ /**
+ * this function allocates nodes in levels based on the recursive branching from the largest hubs.
+ *
+ * @param hubsize
+ * @private
+ */
+
+ }, {
+ key: '_determineLevelsByHubsize',
+ value: function _determineLevelsByHubsize() {
+ var _this3 = this;
+
+ var hubSize = 1;
+
+ var levelDownstream = function levelDownstream(nodeA, nodeB) {
+ if (_this3.hierarchicalLevels[nodeB.id] === undefined) {
+ // set initial level
+ if (_this3.hierarchicalLevels[nodeA.id] === undefined) {
+ _this3.hierarchicalLevels[nodeA.id] = 0;
+ }
+ // set level
+ _this3.hierarchicalLevels[nodeB.id] = _this3.hierarchicalLevels[nodeA.id] + 1;
+ }
+ };
+
+ while (hubSize > 0) {
+ // determine hubs
+ hubSize = this._getHubSize();
+ if (hubSize === 0) break;
+
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (node.edges.length === hubSize) {
+ this._crawlNetwork(levelDownstream, nodeId);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * TODO: release feature
+ * @private
+ */
+
+ }, {
+ key: '_determineLevelsCustomCallback',
+ value: function _determineLevelsCustomCallback() {
+ var _this4 = this;
+
+ var minLevel = 100000;
+
+ // TODO: this should come from options.
+ var customCallback = function customCallback(nodeA, nodeB, edge) {};
+
+ var levelByDirection = function levelByDirection(nodeA, nodeB, edge) {
+ var levelA = _this4.hierarchicalLevels[nodeA.id];
+ // set initial level
+ if (levelA === undefined) {
+ _this4.hierarchicalLevels[nodeA.id] = minLevel;
+ }
+
+ var diff = customCallback(_NetworkUtil2.default.cloneOptions(nodeA, 'node'), _NetworkUtil2.default.cloneOptions(nodeB, 'node'), _NetworkUtil2.default.cloneOptions(edge, 'edge'));
+
+ _this4.hierarchicalLevels[nodeB.id] = _this4.hierarchicalLevels[nodeA.id] + diff;
+ };
+
+ this._crawlNetwork(levelByDirection);
+ this._setMinLevelToZero();
+ }
+
+ /**
+ * this function allocates nodes in levels based on the direction of the edges
+ *
+ * @param hubsize
+ * @private
+ */
+
+ }, {
+ key: '_determineLevelsDirected',
+ value: function _determineLevelsDirected() {
+ var _this5 = this;
+
+ var minLevel = 10000;
+ var levelByDirection = function levelByDirection(nodeA, nodeB, edge) {
+ var levelA = _this5.hierarchicalLevels[nodeA.id];
+ // set initial level
+ if (levelA === undefined) {
+ _this5.hierarchicalLevels[nodeA.id] = minLevel;
+ }
+ if (edge.toId == nodeB.id) {
+ _this5.hierarchicalLevels[nodeB.id] = _this5.hierarchicalLevels[nodeA.id] + 1;
+ } else {
+ _this5.hierarchicalLevels[nodeB.id] = _this5.hierarchicalLevels[nodeA.id] - 1;
+ }
+ };
+ this._crawlNetwork(levelByDirection);
+ this._setMinLevelToZero();
+ }
+
+ /**
+ * Small util method to set the minimum levels of the nodes to zero.
+ * @private
+ */
+
+ }, {
+ key: '_setMinLevelToZero',
+ value: function _setMinLevelToZero() {
+ var minLevel = 1e9;
+ // get the minimum level
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ if (this.hierarchicalLevels[nodeId] !== undefined) {
+ minLevel = Math.min(this.hierarchicalLevels[nodeId], minLevel);
+ }
+ }
+ }
+
+ // subtract the minimum from the set so we have a range starting from 0
+ for (var _nodeId2 in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(_nodeId2)) {
+ if (this.hierarchicalLevels[_nodeId2] !== undefined) {
+ this.hierarchicalLevels[_nodeId2] -= minLevel;
+ }
+ }
+ }
+ }
+
+ /**
+ * Update the bookkeeping of parent and child.
+ * @private
+ */
+
+ }, {
+ key: '_generateMap',
+ value: function _generateMap() {
+ var _this6 = this;
+
+ var fillInRelations = function fillInRelations(parentNode, childNode) {
+ if (_this6.hierarchicalLevels[childNode.id] > _this6.hierarchicalLevels[parentNode.id]) {
+ var parentNodeId = parentNode.id;
+ var childNodeId = childNode.id;
+ if (_this6.hierarchicalChildrenReference[parentNodeId] === undefined) {
+ _this6.hierarchicalChildrenReference[parentNodeId] = [];
+ }
+ _this6.hierarchicalChildrenReference[parentNodeId].push(childNodeId);
+ if (_this6.hierarchicalParentReference[childNodeId] === undefined) {
+ _this6.hierarchicalParentReference[childNodeId] = [];
+ }
+ _this6.hierarchicalParentReference[childNodeId].push(parentNodeId);
+ }
+ };
+
+ this._crawlNetwork(fillInRelations);
+ }
+
+ /**
+ * Crawl over the entire network and use a callback on each node couple that is connected to each other.
+ * @param callback | will receive nodeA nodeB and the connecting edge. A and B are unique.
+ * @param startingNodeId
+ * @private
+ */
+
+ }, {
+ key: '_crawlNetwork',
+ value: function _crawlNetwork() {
+ var _this7 = this;
+
+ var callback = arguments.length <= 0 || arguments[0] === undefined ? function () {} : arguments[0];
+ var startingNodeId = arguments[1];
+
+ var progress = {};
+ var treeIndex = 0;
+
+ var crawler = function crawler(node, tree) {
+ if (progress[node.id] === undefined) {
+
+ if (_this7.hierarchicalTrees[node.id] === undefined) {
+ _this7.hierarchicalTrees[node.id] = tree;
+ _this7.treeIndex = Math.max(tree, _this7.treeIndex);
+ }
+
+ progress[node.id] = true;
+ var childNode = void 0;
+ for (var i = 0; i < node.edges.length; i++) {
+ if (node.edges[i].connected === true) {
+ if (node.edges[i].toId === node.id) {
+ childNode = node.edges[i].from;
+ } else {
+ childNode = node.edges[i].to;
+ }
+
+ if (node.id !== childNode.id) {
+ callback(node, childNode, node.edges[i]);
+ crawler(childNode, tree);
+ }
+ }
+ }
+ }
+ };
+
+ // we can crawl from a specific node or over all nodes.
+ if (startingNodeId === undefined) {
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (progress[node.id] === undefined) {
+ crawler(node, treeIndex);
+ treeIndex += 1;
+ }
+ }
+ } else {
+ var _node = this.body.nodes[startingNodeId];
+ if (_node === undefined) {
+ console.error("Node not found:", startingNodeId);
+ return;
+ }
+ crawler(_node);
+ }
+ }
+
+ /**
+ * Shift a branch a certain distance
+ * @param parentId
+ * @param diff
+ * @private
+ */
+
+ }, {
+ key: '_shiftBlock',
+ value: function _shiftBlock(parentId, diff) {
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ this.body.nodes[parentId].x += diff;
+ } else {
+ this.body.nodes[parentId].y += diff;
+ }
+ if (this.hierarchicalChildrenReference[parentId] !== undefined) {
+ for (var i = 0; i < this.hierarchicalChildrenReference[parentId].length; i++) {
+ this._shiftBlock(this.hierarchicalChildrenReference[parentId][i], diff);
+ }
+ }
+ }
+
+ /**
+ * Find a common parent between branches.
+ * @param childA
+ * @param childB
+ * @returns {{foundParent, withChild}}
+ * @private
+ */
+
+ }, {
+ key: '_findCommonParent',
+ value: function _findCommonParent(childA, childB) {
+ var _this8 = this;
+
+ var parents = {};
+ var iterateParents = function iterateParents(parents, child) {
+ if (_this8.hierarchicalParentReference[child] !== undefined) {
+ for (var i = 0; i < _this8.hierarchicalParentReference[child].length; i++) {
+ var parent = _this8.hierarchicalParentReference[child][i];
+ parents[parent] = true;
+ iterateParents(parents, parent);
+ }
+ }
+ };
+ var findParent = function findParent(parents, child) {
+ if (_this8.hierarchicalParentReference[child] !== undefined) {
+ for (var i = 0; i < _this8.hierarchicalParentReference[child].length; i++) {
+ var parent = _this8.hierarchicalParentReference[child][i];
+ if (parents[parent] !== undefined) {
+ return { foundParent: parent, withChild: child };
+ }
+ var branch = findParent(parents, parent);
+ if (branch.foundParent !== null) {
+ return branch;
+ }
+ }
+ }
+ return { foundParent: null, withChild: child };
+ };
+
+ iterateParents(parents, childA);
+ return findParent(parents, childB);
+ }
+
+ /**
+ * Abstract the getting of the position so we won't have to repeat the check for direction all the time
+ * @param node
+ * @param position
+ * @param level
+ * @private
+ */
+
+ }, {
+ key: '_setPositionForHierarchy',
+ value: function _setPositionForHierarchy(node, position, level) {
+ var doNotUpdate = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ //console.log('_setPositionForHierarchy',node.id, position)
+ if (doNotUpdate !== true) {
+ if (this.distributionOrdering[level] === undefined) {
+ this.distributionOrdering[level] = [];
+ this.distributionOrderingPresence[level] = {};
+ }
+
+ if (this.distributionOrderingPresence[level][node.id] === undefined) {
+ this.distributionOrdering[level].push(node);
+ this.distributionIndex[node.id] = this.distributionOrdering[level].length - 1;
+ }
+ this.distributionOrderingPresence[level][node.id] = true;
+ }
+
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ node.x = position;
+ } else {
+ node.y = position;
+ }
+ }
+
+ /**
+ * Abstract the getting of the position of a node so we do not have to repeat the direction check all the time.
+ * @param node
+ * @returns {number|*}
+ * @private
+ */
+
+ }, {
+ key: '_getPositionForHierarchy',
+ value: function _getPositionForHierarchy(node) {
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ return node.x;
+ } else {
+ return node.y;
+ }
+ }
+
+ /**
+ * Use the x or y value to sort the array, allowing users to specify order.
+ * @param nodeArray
+ * @private
+ */
+
+ }, {
+ key: '_sortNodeArray',
+ value: function _sortNodeArray(nodeArray) {
+ if (nodeArray.length > 1) {
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ nodeArray.sort(function (a, b) {
+ return a.x - b.x;
+ });
+ } else {
+ nodeArray.sort(function (a, b) {
+ return a.y - b.y;
+ });
+ }
+ }
+ }
+ }]);
+
+ return LayoutEngine;
+ }();
+
+ exports.default = LayoutEngine;
+
+/***/ },
+/* 113 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(28);
+
+ /**
+ * clears the toolbar div element of children
+ *
+ * @private
+ */
+
+ var ManipulationSystem = function () {
+ function ManipulationSystem(body, canvas, selectionHandler) {
+ var _this = this;
+
+ _classCallCheck(this, ManipulationSystem);
+
+ this.body = body;
+ this.canvas = canvas;
+ this.selectionHandler = selectionHandler;
+
+ this.editMode = false;
+ this.manipulationDiv = undefined;
+ this.editModeDiv = undefined;
+ this.closeDiv = undefined;
+
+ this.manipulationHammers = [];
+ this.temporaryUIFunctions = {};
+ this.temporaryEventFunctions = [];
+
+ this.touchTime = 0;
+ this.temporaryIds = { nodes: [], edges: [] };
+ this.guiEnabled = false;
+ this.inMode = false;
+ this.selectedControlNode = undefined;
+
+ this.options = {};
+ this.defaultOptions = {
+ enabled: false,
+ initiallyActive: false,
+ addNode: true,
+ addEdge: true,
+ editNode: undefined,
+ editEdge: true,
+ deleteNode: true,
+ deleteEdge: true,
+ controlNodeStyle: {
+ shape: 'dot',
+ size: 6,
+ color: { background: '#ff0000', border: '#3c3c3c', highlight: { background: '#07f968', border: '#3c3c3c' } },
+ borderWidth: 2,
+ borderWidthSelected: 2
+ }
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.body.emitter.on('destroy', function () {
+ _this._clean();
+ });
+ this.body.emitter.on('_dataChanged', this._restore.bind(this));
+ this.body.emitter.on('_resetData', this._restore.bind(this));
+ }
+
+ /**
+ * If something changes in the data during editing, switch back to the initial datamanipulation state and close all edit modes.
+ * @private
+ */
+
+
+ _createClass(ManipulationSystem, [{
+ key: '_restore',
+ value: function _restore() {
+ if (this.inMode !== false) {
+ if (this.options.initiallyActive === true) {
+ this.enableEditMode();
+ } else {
+ this.disableEditMode();
+ }
+ }
+ }
+
+ /**
+ * Set the Options
+ * @param options
+ */
+
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options, allOptions, globalOptions) {
+ if (allOptions !== undefined) {
+ if (allOptions.locale !== undefined) {
+ this.options.locale = allOptions.locale;
+ } else {
+ this.options.locale = globalOptions.locale;
+ }
+ if (allOptions.locales !== undefined) {
+ this.options.locales = allOptions.locales;
+ } else {
+ this.options.locales = globalOptions.locales;
+ }
+ }
+
+ if (options !== undefined) {
+ if (typeof options === 'boolean') {
+ this.options.enabled = options;
+ } else {
+ this.options.enabled = true;
+ util.deepExtend(this.options, options);
+ }
+ if (this.options.initiallyActive === true) {
+ this.editMode = true;
+ }
+ this._setup();
+ }
+ }
+
+ /**
+ * Enable or disable edit-mode. Draws the DOM required and cleans up after itself.
+ *
+ * @private
+ */
+
+ }, {
+ key: 'toggleEditMode',
+ value: function toggleEditMode() {
+ if (this.editMode === true) {
+ this.disableEditMode();
+ } else {
+ this.enableEditMode();
+ }
+ }
+ }, {
+ key: 'enableEditMode',
+ value: function enableEditMode() {
+ this.editMode = true;
+
+ this._clean();
+ if (this.guiEnabled === true) {
+ this.manipulationDiv.style.display = 'block';
+ this.closeDiv.style.display = 'block';
+ this.editModeDiv.style.display = 'none';
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: 'disableEditMode',
+ value: function disableEditMode() {
+ this.editMode = false;
+
+ this._clean();
+ if (this.guiEnabled === true) {
+ this.manipulationDiv.style.display = 'none';
+ this.closeDiv.style.display = 'none';
+ this.editModeDiv.style.display = 'block';
+ this._createEditButton();
+ }
+ }
+
+ /**
+ * Creates the main toolbar. Removes functions bound to the select event. Binds all the buttons of the toolbar.
+ *
+ * @private
+ */
+
+ }, {
+ key: 'showManipulatorToolbar',
+ value: function showManipulatorToolbar() {
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ // reset global variables
+ this.manipulationDOM = {};
+
+ // if the gui is enabled, draw all elements.
+ if (this.guiEnabled === true) {
+ // a _restore will hide these menus
+ this.editMode = true;
+ this.manipulationDiv.style.display = 'block';
+ this.closeDiv.style.display = 'block';
+
+ var selectedNodeCount = this.selectionHandler._getSelectedNodeCount();
+ var selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();
+ var selectedTotalCount = selectedNodeCount + selectedEdgeCount;
+ var locale = this.options.locales[this.options.locale];
+ var needSeperator = false;
+
+ if (this.options.addNode !== false) {
+ this._createAddNodeButton(locale);
+ needSeperator = true;
+ }
+ if (this.options.addEdge !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(1);
+ } else {
+ needSeperator = true;
+ }
+ this._createAddEdgeButton(locale);
+ }
+
+ if (selectedNodeCount === 1 && typeof this.options.editNode === 'function') {
+ if (needSeperator === true) {
+ this._createSeperator(2);
+ } else {
+ needSeperator = true;
+ }
+ this._createEditNodeButton(locale);
+ } else if (selectedEdgeCount === 1 && selectedNodeCount === 0 && this.options.editEdge !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(3);
+ } else {
+ needSeperator = true;
+ }
+ this._createEditEdgeButton(locale);
+ }
+
+ // remove buttons
+ if (selectedTotalCount !== 0) {
+ if (selectedNodeCount > 0 && this.options.deleteNode !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(4);
+ }
+ this._createDeleteButton(locale);
+ } else if (selectedNodeCount === 0 && this.options.deleteEdge !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(4);
+ }
+ this._createDeleteButton(locale);
+ }
+ }
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+
+ // refresh this bar based on what has been selected
+ this._temporaryBindEvent('select', this.showManipulatorToolbar.bind(this));
+ }
+
+ // redraw to show any possible changes
+ this.body.emitter.emit('_redraw');
+ }
+
+ /**
+ * Create the toolbar for adding Nodes
+ */
+
+ }, {
+ key: 'addNodeMode',
+ value: function addNodeMode() {
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'addNode';
+ if (this.guiEnabled === true) {
+ var locale = this.options.locales[this.options.locale];
+ this.manipulationDOM = {};
+ this._createBackButton(locale);
+ this._createSeperator();
+ this._createDescription(locale['addDescription'] || this.options.locales['en']['addDescription']);
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+ }
+
+ this._temporaryBindEvent('click', this._performAddNode.bind(this));
+ }
+
+ /**
+ * call the bound function to handle the editing of the node. The node has to be selected.
+ */
+
+ }, {
+ key: 'editNode',
+ value: function editNode() {
+ var _this2 = this;
+
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+ var node = this.selectionHandler._getSelectedNode();
+ if (node !== undefined) {
+ this.inMode = 'editNode';
+ if (typeof this.options.editNode === 'function') {
+ if (node.isCluster !== true) {
+ var data = util.deepExtend({}, node.options, false);
+ data.x = node.x;
+ data.y = node.y;
+
+ if (this.options.editNode.length === 2) {
+ this.options.editNode(data, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this2.inMode === 'editNode') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {
+ _this2.body.data.nodes.getDataSet().update(finalizedData);
+ }
+ _this2.showManipulatorToolbar();
+ });
+ } else {
+ throw new Error('The function for edit does not support two arguments (data, callback)');
+ }
+ } else {
+ alert(this.options.locales[this.options.locale]['editClusterError'] || this.options.locales['en']['editClusterError']);
+ }
+ } else {
+ throw new Error('No function has been configured to handle the editing of nodes.');
+ }
+ } else {
+ this.showManipulatorToolbar();
+ }
+ }
+
+ /**
+ * create the toolbar to connect nodes
+ */
+
+ }, {
+ key: 'addEdgeMode',
+ value: function addEdgeMode() {
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'addEdge';
+ if (this.guiEnabled === true) {
+ var locale = this.options.locales[this.options.locale];
+ this.manipulationDOM = {};
+ this._createBackButton(locale);
+ this._createSeperator();
+ this._createDescription(locale['edgeDescription'] || this.options.locales['en']['edgeDescription']);
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+ }
+
+ // temporarily overload functions
+ 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', function () {});
+ this._temporaryBindUI('onHold', function () {});
+ }
+
+ /**
+ * create the toolbar to edit edges
+ */
+
+ }, {
+ key: 'editEdgeMode',
+ value: function editEdgeMode() {
+ var _this3 = this;
+
+ // when using the gui, enable edit mode if it wasn't already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'editEdge';
+ if (this.guiEnabled === true) {
+ var locale = this.options.locales[this.options.locale];
+ this.manipulationDOM = {};
+ this._createBackButton(locale);
+ this._createSeperator();
+ this._createDescription(locale['editEdgeDescription'] || this.options.locales['en']['editEdgeDescription']);
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+ }
+
+ this.edgeBeingEditedId = this.selectionHandler.getSelectedEdges()[0];
+ if (this.edgeBeingEditedId !== undefined) {
+ (function () {
+ var edge = _this3.body.edges[_this3.edgeBeingEditedId];
+
+ // create control nodes
+ var controlNodeFrom = _this3._getNewTargetNode(edge.from.x, edge.from.y);
+ var controlNodeTo = _this3._getNewTargetNode(edge.to.x, edge.to.y);
+
+ _this3.temporaryIds.nodes.push(controlNodeFrom.id);
+ _this3.temporaryIds.nodes.push(controlNodeTo.id);
+
+ _this3.body.nodes[controlNodeFrom.id] = controlNodeFrom;
+ _this3.body.nodeIndices.push(controlNodeFrom.id);
+ _this3.body.nodes[controlNodeTo.id] = controlNodeTo;
+ _this3.body.nodeIndices.push(controlNodeTo.id);
+
+ // temporarily overload UI functions, cleaned up automatically because of _temporaryBindUI
+ _this3._temporaryBindUI('onTouch', _this3._controlNodeTouch.bind(_this3)); // used to get the position
+ _this3._temporaryBindUI('onTap', function () {}); // disabled
+ _this3._temporaryBindUI('onHold', function () {}); // disabled
+ _this3._temporaryBindUI('onDragStart', _this3._controlNodeDragStart.bind(_this3)); // used to select control node
+ _this3._temporaryBindUI('onDrag', _this3._controlNodeDrag.bind(_this3)); // used to drag control node
+ _this3._temporaryBindUI('onDragEnd', _this3._controlNodeDragEnd.bind(_this3)); // used to connect or revert control nodes
+ _this3._temporaryBindUI('onMouseMove', function () {}); // disabled
+
+ // create function to position control nodes correctly on movement
+ // automatically cleaned up because we use the temporary bind
+ _this3._temporaryBindEvent('beforeDrawing', function (ctx) {
+ var positions = edge.edgeType.findBorderPositions(ctx);
+ if (controlNodeFrom.selected === false) {
+ controlNodeFrom.x = positions.from.x;
+ controlNodeFrom.y = positions.from.y;
+ }
+ if (controlNodeTo.selected === false) {
+ controlNodeTo.x = positions.to.x;
+ controlNodeTo.y = positions.to.y;
+ }
+ });
+
+ _this3.body.emitter.emit('_redraw');
+ })();
+ } else {
+ this.showManipulatorToolbar();
+ }
+ }
+
+ /**
+ * delete everything in the selection
+ */
+
+ }, {
+ key: 'deleteSelected',
+ value: function deleteSelected() {
+ var _this4 = this;
+
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'delete';
+ var selectedNodes = this.selectionHandler.getSelectedNodes();
+ var selectedEdges = this.selectionHandler.getSelectedEdges();
+ var deleteFunction = undefined;
+ if (selectedNodes.length > 0) {
+ for (var i = 0; i < selectedNodes.length; i++) {
+ if (this.body.nodes[selectedNodes[i]].isCluster === true) {
+ alert(this.options.locales[this.options.locale]['deleteClusterError'] || this.options.locales['en']['deleteClusterError']);
+ return;
+ }
+ }
+
+ if (typeof this.options.deleteNode === 'function') {
+ deleteFunction = this.options.deleteNode;
+ }
+ } else if (selectedEdges.length > 0) {
+ if (typeof this.options.deleteEdge === 'function') {
+ deleteFunction = this.options.deleteEdge;
+ }
+ }
+
+ if (typeof deleteFunction === 'function') {
+ var data = { nodes: selectedNodes, edges: selectedEdges };
+ if (deleteFunction.length === 2) {
+ deleteFunction(data, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this4.inMode === 'delete') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {
+ _this4.body.data.edges.getDataSet().remove(finalizedData.edges);
+ _this4.body.data.nodes.getDataSet().remove(finalizedData.nodes);
+ _this4.body.emitter.emit('startSimulation');
+ _this4.showManipulatorToolbar();
+ } else {
+ _this4.body.emitter.emit('startSimulation');
+ _this4.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for delete does not support two arguments (data, callback)');
+ }
+ } else {
+ this.body.data.edges.getDataSet().remove(selectedEdges);
+ this.body.data.nodes.getDataSet().remove(selectedNodes);
+ this.body.emitter.emit('startSimulation');
+ this.showManipulatorToolbar();
+ }
+ }
+
+ //********************************************** PRIVATE ***************************************//
+
+ /**
+ * draw or remove the DOM
+ * @private
+ */
+
+ }, {
+ key: '_setup',
+ value: function _setup() {
+ if (this.options.enabled === true) {
+ // Enable the GUI
+ this.guiEnabled = true;
+
+ this._createWrappers();
+ if (this.editMode === false) {
+ this._createEditButton();
+ } else {
+ this.showManipulatorToolbar();
+ }
+ } else {
+ this._removeManipulationDOM();
+
+ // disable the gui
+ this.guiEnabled = false;
+ }
+ }
+
+ /**
+ * create the div overlays that contain the DOM
+ * @private
+ */
+
+ }, {
+ key: '_createWrappers',
+ value: function _createWrappers() {
+ // load the manipulator HTML elements. All styling done in css.
+ if (this.manipulationDiv === undefined) {
+ this.manipulationDiv = document.createElement('div');
+ this.manipulationDiv.className = 'vis-manipulation';
+ if (this.editMode === true) {
+ this.manipulationDiv.style.display = 'block';
+ } else {
+ this.manipulationDiv.style.display = 'none';
+ }
+ this.canvas.frame.appendChild(this.manipulationDiv);
+ }
+
+ // container for the edit button.
+ if (this.editModeDiv === undefined) {
+ this.editModeDiv = document.createElement('div');
+ this.editModeDiv.className = 'vis-edit-mode';
+ if (this.editMode === true) {
+ this.editModeDiv.style.display = 'none';
+ } else {
+ this.editModeDiv.style.display = 'block';
+ }
+ this.canvas.frame.appendChild(this.editModeDiv);
+ }
+
+ // container for the close div button
+ if (this.closeDiv === undefined) {
+ this.closeDiv = document.createElement('div');
+ this.closeDiv.className = 'vis-close';
+ this.closeDiv.style.display = this.manipulationDiv.style.display;
+ this.canvas.frame.appendChild(this.closeDiv);
+ }
+ }
+
+ /**
+ * generate a new target node. Used for creating new edges and editing edges
+ * @param x
+ * @param y
+ * @returns {*}
+ * @private
+ */
+
+ }, {
+ key: '_getNewTargetNode',
+ value: function _getNewTargetNode(x, y) {
+ var controlNodeStyle = util.deepExtend({}, this.options.controlNodeStyle);
+
+ controlNodeStyle.id = 'targetNode' + util.randomUUID();
+ controlNodeStyle.hidden = false;
+ controlNodeStyle.physics = false;
+ controlNodeStyle.x = x;
+ controlNodeStyle.y = y;
+
+ // we have to define the bounding box in order for the nodes to be drawn immediately
+ var node = this.body.functions.createNode(controlNodeStyle);
+ node.shape.boundingBox = { left: x, right: x, top: y, bottom: y };
+
+ return node;
+ }
+
+ /**
+ * Create the edit button
+ */
+
+ }, {
+ key: '_createEditButton',
+ value: function _createEditButton() {
+ // restore everything to it's original state (if applicable)
+ this._clean();
+
+ // reset the manipulationDOM
+ this.manipulationDOM = {};
+
+ // empty the editModeDiv
+ util.recursiveDOMDelete(this.editModeDiv);
+
+ // create the contents for the editMode button
+ var locale = this.options.locales[this.options.locale];
+ var button = this._createButton('editMode', 'vis-button vis-edit vis-edit-mode', locale['edit'] || this.options.locales['en']['edit']);
+ this.editModeDiv.appendChild(button);
+
+ // bind a hammer listener to the button, calling the function toggleEditMode.
+ this._bindHammerToDiv(button, this.toggleEditMode.bind(this));
+ }
+
+ /**
+ * this function cleans up after everything this module does. Temporary elements, functions and events are removed, physics restored, hammers removed.
+ * @private
+ */
+
+ }, {
+ key: '_clean',
+ value: function _clean() {
+ // not in mode
+ this.inMode = false;
+
+ // _clean the divs
+ if (this.guiEnabled === true) {
+ util.recursiveDOMDelete(this.editModeDiv);
+ util.recursiveDOMDelete(this.manipulationDiv);
+
+ // removes all the bindings and overloads
+ this._cleanManipulatorHammers();
+ }
+
+ // remove temporary nodes and edges
+ this._cleanupTemporaryNodesAndEdges();
+
+ // restore overloaded UI functions
+ this._unbindTemporaryUIs();
+
+ // remove the temporaryEventFunctions
+ this._unbindTemporaryEvents();
+
+ // restore the physics if required
+ this.body.emitter.emit('restorePhysics');
+ }
+
+ /**
+ * Each dom element has it's own hammer. They are stored in this.manipulationHammers. This cleans them up.
+ * @private
+ */
+
+ }, {
+ key: '_cleanManipulatorHammers',
+ value: function _cleanManipulatorHammers() {
+ // _clean hammer bindings
+ if (this.manipulationHammers.length != 0) {
+ for (var i = 0; i < this.manipulationHammers.length; i++) {
+ this.manipulationHammers[i].destroy();
+ }
+ this.manipulationHammers = [];
+ }
+ }
+
+ /**
+ * Remove all DOM elements created by this module.
+ * @private
+ */
+
+ }, {
+ key: '_removeManipulationDOM',
+ value: function _removeManipulationDOM() {
+ // removes all the bindings and overloads
+ this._clean();
+
+ // empty the manipulation divs
+ util.recursiveDOMDelete(this.manipulationDiv);
+ util.recursiveDOMDelete(this.editModeDiv);
+ util.recursiveDOMDelete(this.closeDiv);
+
+ // remove the manipulation divs
+ if (this.manipulationDiv) {
+ this.canvas.frame.removeChild(this.manipulationDiv);
+ }
+ if (this.editModeDiv) {
+ this.canvas.frame.removeChild(this.editModeDiv);
+ }
+ if (this.closeDiv) {
+ this.canvas.frame.removeChild(this.closeDiv);
+ }
+
+ // set the references to undefined
+ this.manipulationDiv = undefined;
+ this.editModeDiv = undefined;
+ this.closeDiv = undefined;
+ }
+
+ /**
+ * create a seperator line. the index is to differentiate in the manipulation dom
+ * @param index
+ * @private
+ */
+
+ }, {
+ key: '_createSeperator',
+ value: function _createSeperator() {
+ var index = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];
+
+ this.manipulationDOM['seperatorLineDiv' + index] = document.createElement('div');
+ this.manipulationDOM['seperatorLineDiv' + index].className = 'vis-separator-line';
+ this.manipulationDiv.appendChild(this.manipulationDOM['seperatorLineDiv' + index]);
+ }
+
+ // ---------------------- DOM functions for buttons --------------------------//
+
+ }, {
+ key: '_createAddNodeButton',
+ value: function _createAddNodeButton(locale) {
+ var button = this._createButton('addNode', 'vis-button vis-add', locale['addNode'] || this.options.locales['en']['addNode']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.addNodeMode.bind(this));
+ }
+ }, {
+ key: '_createAddEdgeButton',
+ value: function _createAddEdgeButton(locale) {
+ var button = this._createButton('addEdge', 'vis-button vis-connect', locale['addEdge'] || this.options.locales['en']['addEdge']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.addEdgeMode.bind(this));
+ }
+ }, {
+ key: '_createEditNodeButton',
+ value: function _createEditNodeButton(locale) {
+ var button = this._createButton('editNode', 'vis-button vis-edit', locale['editNode'] || this.options.locales['en']['editNode']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.editNode.bind(this));
+ }
+ }, {
+ key: '_createEditEdgeButton',
+ value: function _createEditEdgeButton(locale) {
+ var button = this._createButton('editEdge', 'vis-button vis-edit', locale['editEdge'] || this.options.locales['en']['editEdge']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.editEdgeMode.bind(this));
+ }
+ }, {
+ key: '_createDeleteButton',
+ value: function _createDeleteButton(locale) {
+ if (this.options.rtl) {
+ var deleteBtnClass = 'vis-button vis-delete-rtl';
+ } else {
+ var deleteBtnClass = 'vis-button vis-delete';
+ }
+ var button = this._createButton('delete', deleteBtnClass, locale['del'] || this.options.locales['en']['del']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.deleteSelected.bind(this));
+ }
+ }, {
+ key: '_createBackButton',
+ value: function _createBackButton(locale) {
+ var button = this._createButton('back', 'vis-button vis-back', locale['back'] || this.options.locales['en']['back']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.showManipulatorToolbar.bind(this));
+ }
+ }, {
+ key: '_createButton',
+ value: function _createButton(id, className, label) {
+ var labelClassName = arguments.length <= 3 || arguments[3] === undefined ? 'vis-label' : arguments[3];
+
+
+ this.manipulationDOM[id + 'Div'] = document.createElement('div');
+ this.manipulationDOM[id + 'Div'].className = className;
+ this.manipulationDOM[id + 'Label'] = document.createElement('div');
+ this.manipulationDOM[id + 'Label'].className = labelClassName;
+ this.manipulationDOM[id + 'Label'].innerHTML = label;
+ this.manipulationDOM[id + 'Div'].appendChild(this.manipulationDOM[id + 'Label']);
+ return this.manipulationDOM[id + 'Div'];
+ }
+ }, {
+ key: '_createDescription',
+ value: function _createDescription(label) {
+ this.manipulationDiv.appendChild(this._createButton('description', 'vis-button vis-none', label));
+ }
+
+ // -------------------------- End of DOM functions for buttons ------------------------------//
+
+ /**
+ * this binds an event until cleanup by the clean functions.
+ * @param event
+ * @param newFunction
+ * @private
+ */
+
+ }, {
+ key: '_temporaryBindEvent',
+ value: function _temporaryBindEvent(event, newFunction) {
+ this.temporaryEventFunctions.push({ event: event, boundFunction: newFunction });
+ this.body.emitter.on(event, newFunction);
+ }
+
+ /**
+ * this overrides an UI function until cleanup by the clean function
+ * @param UIfunctionName
+ * @param newFunction
+ * @private
+ */
+
+ }, {
+ key: '_temporaryBindUI',
+ value: function _temporaryBindUI(UIfunctionName, newFunction) {
+ if (this.body.eventListeners[UIfunctionName] !== undefined) {
+ this.temporaryUIFunctions[UIfunctionName] = this.body.eventListeners[UIfunctionName];
+ this.body.eventListeners[UIfunctionName] = newFunction;
+ } else {
+ throw new Error('This UI function does not exist. Typo? You tried: ' + UIfunctionName + ' possible are: ' + JSON.stringify(Object.keys(this.body.eventListeners)));
+ }
+ }
+
+ /**
+ * Restore the overridden UI functions to their original state.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_unbindTemporaryUIs',
+ value: function _unbindTemporaryUIs() {
+ for (var functionName in this.temporaryUIFunctions) {
+ if (this.temporaryUIFunctions.hasOwnProperty(functionName)) {
+ this.body.eventListeners[functionName] = this.temporaryUIFunctions[functionName];
+ delete this.temporaryUIFunctions[functionName];
+ }
+ }
+ this.temporaryUIFunctions = {};
+ }
+
+ /**
+ * Unbind the events created by _temporaryBindEvent
+ * @private
+ */
+
+ }, {
+ key: '_unbindTemporaryEvents',
+ value: function _unbindTemporaryEvents() {
+ for (var i = 0; i < this.temporaryEventFunctions.length; i++) {
+ var eventName = this.temporaryEventFunctions[i].event;
+ var boundFunction = this.temporaryEventFunctions[i].boundFunction;
+ this.body.emitter.off(eventName, boundFunction);
+ }
+ this.temporaryEventFunctions = [];
+ }
+
+ /**
+ * Bind an hammer instance to a DOM element.
+ * @param domElement
+ * @param funct
+ */
+
+ }, {
+ key: '_bindHammerToDiv',
+ value: function _bindHammerToDiv(domElement, boundFunction) {
+ var hammer = new Hammer(domElement, {});
+ hammerUtil.onTouch(hammer, boundFunction);
+ this.manipulationHammers.push(hammer);
+ }
+
+ /**
+ * Neatly clean up temporary edges and nodes
+ * @private
+ */
+
+ }, {
+ key: '_cleanupTemporaryNodesAndEdges',
+ value: function _cleanupTemporaryNodesAndEdges() {
+ // _clean temporary edges
+ for (var i = 0; i < this.temporaryIds.edges.length; i++) {
+ this.body.edges[this.temporaryIds.edges[i]].disconnect();
+ delete this.body.edges[this.temporaryIds.edges[i]];
+ var indexTempEdge = this.body.edgeIndices.indexOf(this.temporaryIds.edges[i]);
+ if (indexTempEdge !== -1) {
+ this.body.edgeIndices.splice(indexTempEdge, 1);
+ }
+ }
+
+ // _clean temporary nodes
+ for (var _i = 0; _i < this.temporaryIds.nodes.length; _i++) {
+ delete this.body.nodes[this.temporaryIds.nodes[_i]];
+ var indexTempNode = this.body.nodeIndices.indexOf(this.temporaryIds.nodes[_i]);
+ if (indexTempNode !== -1) {
+ this.body.nodeIndices.splice(indexTempNode, 1);
+ }
+ }
+
+ this.temporaryIds = { nodes: [], edges: [] };
+ }
+
+ // ------------------------------------------ EDIT EDGE FUNCTIONS -----------------------------------------//
+
+ /**
+ * the touch is used to get the position of the initial click
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: '_controlNodeTouch',
+ value: function _controlNodeTouch(event) {
+ this.selectionHandler.unselectAll();
+ this.lastTouch = this.body.functions.getPointer(event.center);
+ this.lastTouch.translation = util.extend({}, this.body.view.translation); // copy the object
+ }
+
+ /**
+ * the drag start is used to mark one of the control nodes as selected.
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: '_controlNodeDragStart',
+ value: function _controlNodeDragStart(event) {
+ var pointer = this.lastTouch;
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+ var from = this.body.nodes[this.temporaryIds.nodes[0]];
+ var to = this.body.nodes[this.temporaryIds.nodes[1]];
+ var edge = this.body.edges[this.edgeBeingEditedId];
+ this.selectedControlNode = undefined;
+
+ var fromSelect = from.isOverlappingWith(pointerObj);
+ var toSelect = to.isOverlappingWith(pointerObj);
+
+ if (fromSelect === true) {
+ this.selectedControlNode = from;
+ edge.edgeType.from = from;
+ } else if (toSelect === true) {
+ this.selectedControlNode = to;
+ edge.edgeType.to = to;
+ }
+
+ // we use the selection to find the node that is being dragged. We explicitly select it here.
+ if (this.selectedControlNode !== undefined) {
+ this.selectionHandler.selectObject(this.selectedControlNode);
+ }
+
+ this.body.emitter.emit('_redraw');
+ }
+
+ /**
+ * dragging the control nodes or the canvas
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: '_controlNodeDrag',
+ value: function _controlNodeDrag(event) {
+ this.body.emitter.emit('disablePhysics');
+ var pointer = this.body.functions.getPointer(event.center);
+ var pos = this.canvas.DOMtoCanvas(pointer);
+ if (this.selectedControlNode !== undefined) {
+ this.selectedControlNode.x = pos.x;
+ this.selectedControlNode.y = pos.y;
+ } else {
+ // if the drag was not started properly because the click started outside the network div, start it now.
+ var diffX = pointer.x - this.lastTouch.x;
+ var diffY = pointer.y - this.lastTouch.y;
+ this.body.view.translation = { x: this.lastTouch.translation.x + diffX, y: this.lastTouch.translation.y + diffY };
+ }
+ this.body.emitter.emit('_redraw');
+ }
+
+ /**
+ * connecting or restoring the control nodes.
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: '_controlNodeDragEnd',
+ value: function _controlNodeDragEnd(event) {
+ var pointer = this.body.functions.getPointer(event.center);
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+ var edge = this.body.edges[this.edgeBeingEditedId];
+ // if the node that was dragged is not a control node, return
+ if (this.selectedControlNode === undefined) {
+ return;
+ }
+
+ // we use the selection to find the node that is being dragged. We explicitly DEselect the control node here.
+ this.selectionHandler.unselectAll();
+ var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
+ var node = undefined;
+ for (var i = overlappingNodeIds.length - 1; i >= 0; i--) {
+ if (overlappingNodeIds[i] !== this.selectedControlNode.id) {
+ node = this.body.nodes[overlappingNodeIds[i]];
+ break;
+ }
+ }
+ // perform the connection
+ if (node !== undefined && this.selectedControlNode !== undefined) {
+ if (node.isCluster === true) {
+ alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);
+ } else {
+ var from = this.body.nodes[this.temporaryIds.nodes[0]];
+ if (this.selectedControlNode.id === from.id) {
+ this._performEditEdge(node.id, edge.to.id);
+ } else {
+ this._performEditEdge(edge.from.id, node.id);
+ }
+ }
+ } else {
+ edge.updateEdgeType();
+ this.body.emitter.emit('restorePhysics');
+ }
+ this.body.emitter.emit('_redraw');
+ }
+
+ // ------------------------------------ END OF EDIT EDGE FUNCTIONS -----------------------------------------//
+
+ // ------------------------------------------- ADD EDGE FUNCTIONS -----------------------------------------//
+ /**
+ * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
+ * to walk the user through the process.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_handleConnect',
+ value: function _handleConnect(event) {
+ // check to avoid double fireing of this function.
+ if (new Date().valueOf() - this.touchTime > 100) {
+ this.lastTouch = this.body.functions.getPointer(event.center);
+ this.lastTouch.translation = util.extend({}, this.body.view.translation); // copy the object
+
+ var pointer = this.lastTouch;
+ var node = this.selectionHandler.getNodeAt(pointer);
+
+ if (node !== undefined) {
+ if (node.isCluster === true) {
+ alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);
+ } else {
+ // create a node the temporary line can look at
+ var targetNode = this._getNewTargetNode(node.x, node.y);
+ this.body.nodes[targetNode.id] = targetNode;
+ this.body.nodeIndices.push(targetNode.id);
+
+ // create a temporary edge
+ var connectionEdge = this.body.functions.createEdge({
+ id: 'connectionEdge' + util.randomUUID(),
+ from: node.id,
+ to: targetNode.id,
+ physics: false,
+ smooth: {
+ enabled: true,
+ type: 'continuous',
+ roundness: 0.5
+ }
+ });
+ this.body.edges[connectionEdge.id] = connectionEdge;
+ this.body.edgeIndices.push(connectionEdge.id);
+
+ this.temporaryIds.nodes.push(targetNode.id);
+ this.temporaryIds.edges.push(connectionEdge.id);
+ }
+ }
+ this.touchTime = new Date().valueOf();
+ }
+ }
+ }, {
+ key: '_dragControlNode',
+ value: function _dragControlNode(event) {
+ var pointer = this.body.functions.getPointer(event.center);
+ if (this.temporaryIds.nodes[0] !== undefined) {
+ var targetNode = this.body.nodes[this.temporaryIds.nodes[0]]; // there is only one temp node in the add edge mode.
+ targetNode.x = this.canvas._XconvertDOMtoCanvas(pointer.x);
+ targetNode.y = this.canvas._YconvertDOMtoCanvas(pointer.y);
+ this.body.emitter.emit('_redraw');
+ } else {
+ var diffX = pointer.x - this.lastTouch.x;
+ var diffY = pointer.y - this.lastTouch.y;
+ this.body.view.translation = { x: this.lastTouch.translation.x + diffX, y: this.lastTouch.translation.y + diffY };
+ }
+ }
+
+ /**
+ * Connect the new edge to the target if one exists, otherwise remove temp line
+ * @param event
+ * @private
+ */
+
+ }, {
+ key: '_finishConnect',
+ value: function _finishConnect(event) {
+ var pointer = this.body.functions.getPointer(event.center);
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+
+ // remember the edge id
+ var connectFromId = undefined;
+ if (this.temporaryIds.edges[0] !== undefined) {
+ connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;
+ }
+
+ // get the overlapping node but NOT the temporary node;
+ var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
+ var node = undefined;
+ for (var i = overlappingNodeIds.length - 1; i >= 0; i--) {
+ // if the node id is NOT a temporary node, accept the node.
+ if (this.temporaryIds.nodes.indexOf(overlappingNodeIds[i]) === -1) {
+ node = this.body.nodes[overlappingNodeIds[i]];
+ break;
+ }
+ }
+
+ // clean temporary nodes and edges.
+ this._cleanupTemporaryNodesAndEdges();
+
+ // perform the connection
+ if (node !== undefined) {
+ if (node.isCluster === true) {
+ alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);
+ } else {
+ if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) {
+ this._performAddEdge(connectFromId, node.id);
+ }
+ }
+ }
+ this.body.emitter.emit('_redraw');
+ }
+
+ // --------------------------------------- END OF ADD EDGE FUNCTIONS -------------------------------------//
+
+ // ------------------------------ Performing all the actual data manipulation ------------------------//
+
+ /**
+ * Adds a node on the specified location
+ */
+
+ }, {
+ key: '_performAddNode',
+ value: function _performAddNode(clickData) {
+ var _this5 = this;
+
+ var defaultData = {
+ id: util.randomUUID(),
+ x: clickData.pointer.canvas.x,
+ y: clickData.pointer.canvas.y,
+ label: 'new'
+ };
+
+ if (typeof this.options.addNode === 'function') {
+ if (this.options.addNode.length === 2) {
+ this.options.addNode(defaultData, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this5.inMode === 'addNode') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback
+ _this5.body.data.nodes.getDataSet().add(finalizedData);
+ _this5.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for add does not support two arguments (data,callback)');
+ this.showManipulatorToolbar();
+ }
+ } else {
+ this.body.data.nodes.getDataSet().add(defaultData);
+ this.showManipulatorToolbar();
+ }
+ }
+
+ /**
+ * connect two nodes with a new edge.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_performAddEdge',
+ value: function _performAddEdge(sourceNodeId, targetNodeId) {
+ var _this6 = this;
+
+ var defaultData = { from: sourceNodeId, to: targetNodeId };
+ if (typeof this.options.addEdge === 'function') {
+ if (this.options.addEdge.length === 2) {
+ this.options.addEdge(defaultData, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this6.inMode === 'addEdge') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback
+ _this6.body.data.edges.getDataSet().add(finalizedData);
+ _this6.selectionHandler.unselectAll();
+ _this6.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for connect does not support two arguments (data,callback)');
+ }
+ } else {
+ this.body.data.edges.getDataSet().add(defaultData);
+ this.selectionHandler.unselectAll();
+ this.showManipulatorToolbar();
+ }
+ }
+
+ /**
+ * connect two nodes with a new edge.
+ *
+ * @private
+ */
+
+ }, {
+ key: '_performEditEdge',
+ value: function _performEditEdge(sourceNodeId, targetNodeId) {
+ var _this7 = this;
+
+ var defaultData = { id: this.edgeBeingEditedId, from: sourceNodeId, to: targetNodeId };
+ if (typeof this.options.editEdge === 'function') {
+ if (this.options.editEdge.length === 2) {
+ this.options.editEdge(defaultData, function (finalizedData) {
+ if (finalizedData === null || finalizedData === undefined || _this7.inMode !== 'editEdge') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {
+ _this7.body.edges[defaultData.id].updateEdgeType();
+ _this7.body.emitter.emit('_redraw');
+ } else {
+ _this7.body.data.edges.getDataSet().update(finalizedData);
+ _this7.selectionHandler.unselectAll();
+ _this7.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for edit does not support two arguments (data, callback)');
+ }
+ } else {
+ this.body.data.edges.getDataSet().update(defaultData);
+ this.selectionHandler.unselectAll();
+ this.showManipulatorToolbar();
+ }
+ }
+ }]);
+
+ return ManipulationSystem;
+ }();
+
+ exports.default = ManipulationSystem;
+
+/***/ },
+/* 114 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ /**
+ * This object contains all possible options. It will check if the types are correct, if required if the option is one
+ * of the allowed values.
+ *
+ * __any__ means that the name of the property does not matter.
+ * __type__ is a required field for all objects and contains the allowed types of all objects
+ */
+ var string = 'string';
+ var boolean = 'boolean';
+ var number = 'number';
+ var array = 'array';
+ var object = 'object'; // should only be in a __type__ property
+ var dom = 'dom';
+ var any = 'any';
+
+ var allOptions = {
+ configure: {
+ enabled: { boolean: boolean },
+ filter: { boolean: boolean, string: string, array: array, 'function': 'function' },
+ container: { dom: dom },
+ showButton: { boolean: boolean },
+ __type__: { object: object, boolean: boolean, string: string, array: array, 'function': 'function' }
+ },
+ edges: {
+ arrows: {
+ to: { enabled: { boolean: boolean }, scaleFactor: { number: number }, __type__: { object: object, boolean: boolean } },
+ middle: { enabled: { boolean: boolean }, scaleFactor: { number: number }, __type__: { object: object, boolean: boolean } },
+ from: { enabled: { boolean: boolean }, scaleFactor: { number: number }, __type__: { object: object, boolean: boolean } },
+ __type__: { string: ['from', 'to', 'middle'], object: object }
+ },
+ arrowStrikethrough: { boolean: boolean },
+ color: {
+ color: { string: string },
+ highlight: { string: string },
+ hover: { string: string },
+ inherit: { string: ['from', 'to', 'both'], boolean: boolean },
+ opacity: { number: number },
+ __type__: { object: object, string: string }
+ },
+ dashes: { boolean: boolean, array: array },
+ font: {
+ color: { string: string },
+ size: { number: number }, // px
+ face: { string: string },
+ background: { string: string },
+ strokeWidth: { number: number }, // px
+ strokeColor: { string: string },
+ align: { string: ['horizontal', 'top', 'middle', 'bottom'] },
+ __type__: { object: object, string: string }
+ },
+ hidden: { boolean: boolean },
+ hoverWidth: { 'function': 'function', number: number },
+ label: { string: string, 'undefined': 'undefined' },
+ labelHighlightBold: { boolean: boolean },
+ length: { number: number, 'undefined': 'undefined' },
+ physics: { boolean: boolean },
+ scaling: {
+ min: { number: number },
+ max: { number: number },
+ label: {
+ enabled: { boolean: boolean },
+ min: { number: number },
+ max: { number: number },
+ maxVisible: { number: number },
+ drawThreshold: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ customScalingFunction: { 'function': 'function' },
+ __type__: { object: object }
+ },
+ selectionWidth: { 'function': 'function', number: number },
+ selfReferenceSize: { number: number },
+ shadow: {
+ enabled: { boolean: boolean },
+ color: { string: string },
+ size: { number: number },
+ x: { number: number },
+ y: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ smooth: {
+ enabled: { boolean: boolean },
+ type: { string: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'] },
+ roundness: { number: number },
+ forceDirection: { string: ['horizontal', 'vertical', 'none'], boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ title: { string: string, 'undefined': 'undefined' },
+ width: { number: number },
+ value: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ groups: {
+ useDefaultGroups: { boolean: boolean },
+ __any__: 'get from nodes, will be overwritten below',
+ __type__: { object: object }
+ },
+ interaction: {
+ dragNodes: { boolean: boolean },
+ dragView: { boolean: boolean },
+ hideEdgesOnDrag: { boolean: boolean },
+ hideNodesOnDrag: { boolean: boolean },
+ hover: { boolean: boolean },
+ keyboard: {
+ enabled: { boolean: boolean },
+ speed: { x: { number: number }, y: { number: number }, zoom: { number: number }, __type__: { object: object } },
+ bindToWindow: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ multiselect: { boolean: boolean },
+ navigationButtons: { boolean: boolean },
+ selectable: { boolean: boolean },
+ selectConnectedEdges: { boolean: boolean },
+ hoverConnectedEdges: { boolean: boolean },
+ tooltipDelay: { number: number },
+ zoomView: { boolean: boolean },
+ __type__: { object: object }
+ },
+ layout: {
+ randomSeed: { 'undefined': 'undefined', number: number },
+ improvedLayout: { boolean: boolean },
+ hierarchical: {
+ enabled: { boolean: boolean },
+ levelSeparation: { number: number },
+ nodeSpacing: { number: number },
+ treeSpacing: { number: number },
+ blockShifting: { boolean: boolean },
+ edgeMinimization: { boolean: boolean },
+ parentCentralization: { boolean: boolean },
+ direction: { string: ['UD', 'DU', 'LR', 'RL'] }, // UD, DU, LR, RL
+ sortMethod: { string: ['hubsize', 'directed'] }, // hubsize, directed
+ __type__: { object: object, boolean: boolean }
+ },
+ __type__: { object: object }
+ },
+ manipulation: {
+ enabled: { boolean: boolean },
+ initiallyActive: { boolean: boolean },
+ addNode: { boolean: boolean, 'function': 'function' },
+ addEdge: { boolean: boolean, 'function': 'function' },
+ editNode: { 'function': 'function' },
+ editEdge: { boolean: boolean, 'function': 'function' },
+ deleteNode: { boolean: boolean, 'function': 'function' },
+ deleteEdge: { boolean: boolean, 'function': 'function' },
+ controlNodeStyle: 'get from nodes, will be overwritten below',
+ __type__: { object: object, boolean: boolean }
+ },
+ nodes: {
+ borderWidth: { number: number },
+ borderWidthSelected: { number: number, 'undefined': 'undefined' },
+ brokenImage: { string: string, 'undefined': 'undefined' },
+ color: {
+ border: { string: string },
+ background: { string: string },
+ highlight: {
+ border: { string: string },
+ background: { string: string },
+ __type__: { object: object, string: string }
+ },
+ hover: {
+ border: { string: string },
+ background: { string: string },
+ __type__: { object: object, string: string }
+ },
+ __type__: { object: object, string: string }
+ },
+ fixed: {
+ x: { boolean: boolean },
+ y: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ font: {
+ align: { string: string },
+ color: { string: string },
+ size: { number: number }, // px
+ face: { string: string },
+ background: { string: string },
+ strokeWidth: { number: number }, // px
+ strokeColor: { string: string },
+ __type__: { object: object, string: string }
+ },
+ group: { string: string, number: number, 'undefined': 'undefined' },
+ hidden: { boolean: boolean },
+ icon: {
+ face: { string: string },
+ code: { string: string }, //'\uf007',
+ size: { number: number }, //50,
+ color: { string: string },
+ __type__: { object: object }
+ },
+ id: { string: string, number: number },
+ image: { string: string, 'undefined': 'undefined' }, // --> URL
+ label: { string: string, 'undefined': 'undefined' },
+ labelHighlightBold: { boolean: boolean },
+ level: { number: number, 'undefined': 'undefined' },
+ mass: { number: number },
+ physics: { boolean: boolean },
+ scaling: {
+ min: { number: number },
+ max: { number: number },
+ label: {
+ enabled: { boolean: boolean },
+ min: { number: number },
+ max: { number: number },
+ maxVisible: { number: number },
+ drawThreshold: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ customScalingFunction: { 'function': 'function' },
+ __type__: { object: object }
+ },
+ shadow: {
+ enabled: { boolean: boolean },
+ color: { string: string },
+ size: { number: number },
+ x: { number: number },
+ y: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ shape: { string: ['ellipse', 'circle', 'database', 'box', 'text', 'image', 'circularImage', 'diamond', 'dot', 'star', 'triangle', 'triangleDown', 'square', 'icon'] },
+ shapeProperties: {
+ borderDashes: { boolean: boolean, array: array },
+ borderRadius: { number: number },
+ interpolation: { boolean: boolean },
+ useImageSize: { boolean: boolean },
+ useBorderWithImage: { boolean: boolean },
+ __type__: { object: object }
+ },
+ size: { number: number },
+ title: { string: string, 'undefined': 'undefined' },
+ value: { number: number, 'undefined': 'undefined' },
+ x: { number: number },
+ y: { number: number },
+ __type__: { object: object }
+ },
+ physics: {
+ enabled: { boolean: boolean },
+ barnesHut: {
+ gravitationalConstant: { number: number },
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ damping: { number: number },
+ avoidOverlap: { number: number },
+ __type__: { object: object }
+ },
+ forceAtlas2Based: {
+ gravitationalConstant: { number: number },
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ damping: { number: number },
+ avoidOverlap: { number: number },
+ __type__: { object: object }
+ },
+ repulsion: {
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ nodeDistance: { number: number },
+ damping: { number: number },
+ __type__: { object: object }
+ },
+ hierarchicalRepulsion: {
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ nodeDistance: { number: number },
+ damping: { number: number },
+ __type__: { object: object }
+ },
+ maxVelocity: { number: number },
+ minVelocity: { number: number }, // px/s
+ solver: { string: ['barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'] },
+ stabilization: {
+ enabled: { boolean: boolean },
+ iterations: { number: number }, // maximum number of iteration to stabilize
+ updateInterval: { number: number },
+ onlyDynamicEdges: { boolean: boolean },
+ fit: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ timestep: { number: number },
+ adaptiveTimestep: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+
+ //globals :
+ autoResize: { boolean: boolean },
+ clickToUse: { boolean: boolean },
+ locale: { string: string },
+ locales: {
+ __any__: { any: any },
+ __type__: { object: object }
+ },
+ height: { string: string },
+ width: { string: string },
+ __type__: { object: object }
+ };
+
+ allOptions.groups.__any__ = allOptions.nodes;
+ allOptions.manipulation.controlNodeStyle = allOptions.nodes;
+
+ var configureOptions = {
+ 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: false,
+ y: false
+ },
+ font: {
+ color: ['color', '#343434'],
+ size: [14, 0, 100, 1], // px
+ face: ['arial', 'verdana', 'tahoma'],
+ background: ['color', 'none'],
+ strokeWidth: [0, 0, 50, 1], // px
+ strokeColor: ['color', '#ffffff']
+ },
+ //group: 'string',
+ hidden: false,
+ labelHighlightBold: true,
+ //icon: {
+ // face: 'string', //'FontAwesome',
+ // code: 'string', //'\uf007',
+ // size: [50, 0, 200, 1], //50,
+ // color: ['color','#2B7CE9'] //'#aa00ff'
+ //},
+ //image: 'string', // --> URL
+ physics: true,
+ scaling: {
+ min: [10, 0, 200, 1],
+ max: [30, 0, 200, 1],
+ label: {
+ enabled: false,
+ min: [14, 0, 200, 1],
+ max: [30, 0, 200, 1],
+ maxVisible: [30, 0, 200, 1],
+ drawThreshold: [5, 0, 20, 1]
+ }
+ },
+ shadow: {
+ enabled: false,
+ 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'],
+ shapeProperties: {
+ borderDashes: false,
+ borderRadius: [6, 0, 20, 1],
+ interpolation: true,
+ useImageSize: false
+ },
+ size: [25, 0, 200, 1]
+ },
+ edges: {
+ arrows: {
+ to: { enabled: false, scaleFactor: [1, 0, 3, 0.05] }, // boolean / {arrowScaleFactor:1} / {enabled: false, arrowScaleFactor:1}
+ middle: { enabled: false, scaleFactor: [1, 0, 3, 0.05] },
+ from: { enabled: false, scaleFactor: [1, 0, 3, 0.05] }
+ },
+ arrowStrikethrough: true,
+ color: {
+ color: ['color', '#848484'],
+ highlight: ['color', '#848484'],
+ hover: ['color', '#848484'],
+ inherit: ['from', 'to', 'both', true, false],
+ opacity: [1, 0, 1, 0.05]
+ },
+ dashes: false,
+ font: {
+ color: ['color', '#343434'],
+ size: [14, 0, 100, 1], // px
+ face: ['arial', 'verdana', 'tahoma'],
+ background: ['color', 'none'],
+ strokeWidth: [2, 0, 50, 1], // px
+ strokeColor: ['color', '#ffffff'],
+ align: ['horizontal', 'top', 'middle', 'bottom']
+ },
+ hidden: false,
+ hoverWidth: [1.5, 0, 5, 0.1],
+ labelHighlightBold: true,
+ physics: true,
+ scaling: {
+ min: [1, 0, 100, 1],
+ max: [15, 0, 100, 1],
+ label: {
+ enabled: true,
+ 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, 0.1],
+ selfReferenceSize: [20, 0, 200, 1],
+ shadow: {
+ enabled: false,
+ color: 'rgba(0,0,0,0.5)',
+ size: [10, 0, 20, 1],
+ x: [5, -30, 30, 1],
+ y: [5, -30, 30, 1]
+ },
+ smooth: {
+ enabled: true,
+ type: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'],
+ forceDirection: ['horizontal', 'vertical', 'none'],
+ roundness: [0.5, 0, 1, 0.05]
+ },
+ width: [1, 0, 30, 1]
+ },
+ layout: {
+ //randomSeed: [0, 0, 500, 1],
+ //improvedLayout: true,
+ hierarchical: {
+ enabled: false,
+ levelSeparation: [150, 20, 500, 5],
+ nodeSpacing: [100, 20, 500, 5],
+ treeSpacing: [200, 20, 500, 5],
+ blockShifting: true,
+ edgeMinimization: true,
+ parentCentralization: true,
+ direction: ['UD', 'DU', 'LR', 'RL'], // UD, DU, LR, RL
+ sortMethod: ['hubsize', 'directed'] // hubsize, directed
+ }
+ },
+ interaction: {
+ dragNodes: true,
+ dragView: true,
+ hideEdgesOnDrag: false,
+ hideNodesOnDrag: false,
+ hover: false,
+ keyboard: {
+ enabled: false,
+ speed: { x: [10, 0, 40, 1], y: [10, 0, 40, 1], zoom: [0.02, 0, 0.1, 0.005] },
+ bindToWindow: true
+ },
+ multiselect: false,
+ navigationButtons: false,
+ selectable: true,
+ selectConnectedEdges: true,
+ hoverConnectedEdges: true,
+ tooltipDelay: [300, 0, 1000, 25],
+ zoomView: true
+ },
+ manipulation: {
+ enabled: false,
+ initiallyActive: false
+ },
+ physics: {
+ enabled: true,
+ barnesHut: {
+ //theta: [0.5, 0.1, 1, 0.05],
+ gravitationalConstant: [-2000, -30000, 0, 50],
+ centralGravity: [0.3, 0, 10, 0.05],
+ springLength: [95, 0, 500, 5],
+ springConstant: [0.04, 0, 1.2, 0.005],
+ damping: [0.09, 0, 1, 0.01],
+ avoidOverlap: [0, 0, 1, 0.01]
+ },
+ forceAtlas2Based: {
+ //theta: [0.5, 0.1, 1, 0.05],
+ gravitationalConstant: [-50, -500, 0, 1],
+ centralGravity: [0.01, 0, 1, 0.005],
+ springLength: [95, 0, 500, 5],
+ springConstant: [0.08, 0, 1.2, 0.005],
+ damping: [0.4, 0, 1, 0.01],
+ avoidOverlap: [0, 0, 1, 0.01]
+ },
+ repulsion: {
+ centralGravity: [0.2, 0, 10, 0.05],
+ springLength: [200, 0, 500, 5],
+ springConstant: [0.05, 0, 1.2, 0.005],
+ nodeDistance: [100, 0, 500, 5],
+ damping: [0.09, 0, 1, 0.01]
+ },
+ hierarchicalRepulsion: {
+ centralGravity: [0.2, 0, 10, 0.05],
+ springLength: [100, 0, 500, 5],
+ springConstant: [0.01, 0, 1.2, 0.005],
+ nodeDistance: [120, 0, 500, 5],
+ damping: [0.09, 0, 1, 0.01]
+ },
+ maxVelocity: [50, 0, 150, 1],
+ minVelocity: [0.1, 0.01, 0.5, 0.01],
+ solver: ['barnesHut', 'forceAtlas2Based', 'repulsion', 'hierarchicalRepulsion'],
+ timestep: [0.5, 0.01, 1, 0.01]
+ },
+ //adaptiveTimestep: true
+ global: {
+ locale: ['en', 'nl']
+ }
+ };
+
+ exports.allOptions = allOptions;
+ exports.configureOptions = configureOptions;
+
+/***/ },
+/* 115 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // distance finding algorithm
+
+
+ var _FloydWarshall = __webpack_require__(116);
+
+ var _FloydWarshall2 = _interopRequireDefault(_FloydWarshall);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ /**
+ * KamadaKawai positions the nodes initially based on
+ *
+ * "AN ALGORITHM FOR DRAWING GENERAL UNDIRECTED GRAPHS"
+ * -- Tomihisa KAMADA and Satoru KAWAI in 1989
+ *
+ * Possible optimizations in the distance calculation can be implemented.
+ */
+
+ var KamadaKawai = function () {
+ function KamadaKawai(body, edgeLength, edgeStrength) {
+ _classCallCheck(this, KamadaKawai);
+
+ this.body = body;
+ this.springLength = edgeLength;
+ this.springConstant = edgeStrength;
+ this.distanceSolver = new _FloydWarshall2.default();
+ }
+
+ /**
+ * Not sure if needed but can be used to update the spring length and spring constant
+ * @param options
+ */
+
+
+ _createClass(KamadaKawai, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ if (options) {
+ if (options.springLength) {
+ this.springLength = options.springLength;
+ }
+ if (options.springConstant) {
+ this.springConstant = options.springConstant;
+ }
+ }
+ }
+
+ /**
+ * Position the system
+ * @param nodesArray
+ * @param edgesArray
+ */
+
+ }, {
+ key: "solve",
+ value: function solve(nodesArray, edgesArray) {
+ var ignoreClusters = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ // get distance matrix
+ var D_matrix = this.distanceSolver.getDistances(this.body, nodesArray, edgesArray); // distance matrix
+
+ // get the L Matrix
+ this._createL_matrix(D_matrix);
+
+ // get the K Matrix
+ this._createK_matrix(D_matrix);
+
+ // calculate positions
+ var threshold = 0.01;
+ var innerThreshold = 1;
+ var iterations = 0;
+ var maxIterations = Math.max(1000, Math.min(10 * this.body.nodeIndices.length, 6000));
+ var maxInnerIterations = 5;
+
+ var maxEnergy = 1e9;
+ var highE_nodeId = 0,
+ dE_dx = 0,
+ dE_dy = 0,
+ delta_m = 0,
+ subIterations = 0;
+
+ while (maxEnergy > threshold && iterations < maxIterations) {
+ iterations += 1;
+
+ var _getHighestEnergyNode2 = this._getHighestEnergyNode(ignoreClusters);
+
+ var _getHighestEnergyNode3 = _slicedToArray(_getHighestEnergyNode2, 4);
+
+ highE_nodeId = _getHighestEnergyNode3[0];
+ maxEnergy = _getHighestEnergyNode3[1];
+ dE_dx = _getHighestEnergyNode3[2];
+ dE_dy = _getHighestEnergyNode3[3];
+
+ delta_m = maxEnergy;
+ subIterations = 0;
+ while (delta_m > innerThreshold && subIterations < maxInnerIterations) {
+ subIterations += 1;
+ this._moveNode(highE_nodeId, dE_dx, dE_dy);
+
+ var _getEnergy2 = this._getEnergy(highE_nodeId);
+
+ var _getEnergy3 = _slicedToArray(_getEnergy2, 3);
+
+ delta_m = _getEnergy3[0];
+ dE_dx = _getEnergy3[1];
+ dE_dy = _getEnergy3[2];
+ }
+ }
+ }
+
+ /**
+ * get the node with the highest energy
+ * @returns {*[]}
+ * @private
+ */
+
+ }, {
+ key: "_getHighestEnergyNode",
+ value: function _getHighestEnergyNode(ignoreClusters) {
+ var nodesArray = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+ var maxEnergy = 0;
+ var maxEnergyNodeId = nodesArray[0];
+ var dE_dx_max = 0,
+ dE_dy_max = 0;
+
+ for (var nodeIdx = 0; nodeIdx < nodesArray.length; nodeIdx++) {
+ var m = nodesArray[nodeIdx];
+ // by not evaluating nodes with predefined positions we should only move nodes that have no positions.
+ if (nodes[m].predefinedPosition === false || nodes[m].isCluster === true && ignoreClusters === true || nodes[m].options.fixed.x === true || nodes[m].options.fixed.y === true) {
+ var _getEnergy4 = this._getEnergy(m);
+
+ var _getEnergy5 = _slicedToArray(_getEnergy4, 3);
+
+ var delta_m = _getEnergy5[0];
+ var dE_dx = _getEnergy5[1];
+ var dE_dy = _getEnergy5[2];
+
+ if (maxEnergy < delta_m) {
+ maxEnergy = delta_m;
+ maxEnergyNodeId = m;
+ dE_dx_max = dE_dx;
+ dE_dy_max = dE_dy;
+ }
+ }
+ }
+
+ return [maxEnergyNodeId, maxEnergy, dE_dx_max, dE_dy_max];
+ }
+
+ /**
+ * calculate the energy of a single node
+ * @param m
+ * @returns {*[]}
+ * @private
+ */
+
+ }, {
+ key: "_getEnergy",
+ value: function _getEnergy(m) {
+ var nodesArray = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+
+ var x_m = nodes[m].x;
+ var y_m = nodes[m].y;
+ var dE_dx = 0;
+ var dE_dy = 0;
+ for (var iIdx = 0; iIdx < nodesArray.length; iIdx++) {
+ var i = nodesArray[iIdx];
+ if (i !== m) {
+ var x_i = nodes[i].x;
+ var y_i = nodes[i].y;
+ var denominator = 1.0 / Math.sqrt(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2));
+ dE_dx += this.K_matrix[m][i] * (x_m - x_i - this.L_matrix[m][i] * (x_m - x_i) * denominator);
+ dE_dy += this.K_matrix[m][i] * (y_m - y_i - this.L_matrix[m][i] * (y_m - y_i) * denominator);
+ }
+ }
+
+ var delta_m = Math.sqrt(Math.pow(dE_dx, 2) + Math.pow(dE_dy, 2));
+ return [delta_m, dE_dx, dE_dy];
+ }
+
+ /**
+ * move the node based on it's energy
+ * the dx and dy are calculated from the linear system proposed by Kamada and Kawai
+ * @param m
+ * @param dE_dx
+ * @param dE_dy
+ * @private
+ */
+
+ }, {
+ key: "_moveNode",
+ value: function _moveNode(m, dE_dx, dE_dy) {
+ var nodesArray = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+ var d2E_dx2 = 0;
+ var d2E_dxdy = 0;
+ var d2E_dy2 = 0;
+
+ var x_m = nodes[m].x;
+ var y_m = nodes[m].y;
+ for (var iIdx = 0; iIdx < nodesArray.length; iIdx++) {
+ var i = nodesArray[iIdx];
+ if (i !== m) {
+ var x_i = nodes[i].x;
+ var y_i = nodes[i].y;
+ var denominator = 1.0 / Math.pow(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2), 1.5);
+ d2E_dx2 += this.K_matrix[m][i] * (1 - this.L_matrix[m][i] * Math.pow(y_m - y_i, 2) * denominator);
+ d2E_dxdy += this.K_matrix[m][i] * (this.L_matrix[m][i] * (x_m - x_i) * (y_m - y_i) * denominator);
+ d2E_dy2 += this.K_matrix[m][i] * (1 - this.L_matrix[m][i] * Math.pow(x_m - x_i, 2) * denominator);
+ }
+ }
+ // make the variable names easier to make the solving of the linear system easier to read
+ var A = d2E_dx2,
+ B = d2E_dxdy,
+ C = dE_dx,
+ D = d2E_dy2,
+ E = dE_dy;
+
+ // solve the linear system for dx and dy
+ var dy = (C / A + E / B) / (B / A - D / B);
+ var dx = -(B * dy + C) / A;
+
+ // move the node
+ nodes[m].x += dx;
+ nodes[m].y += dy;
+ }
+
+ /**
+ * Create the L matrix: edge length times shortest path
+ * @param D_matrix
+ * @private
+ */
+
+ }, {
+ key: "_createL_matrix",
+ value: function _createL_matrix(D_matrix) {
+ var nodesArray = this.body.nodeIndices;
+ var edgeLength = this.springLength;
+
+ this.L_matrix = [];
+ for (var i = 0; i < nodesArray.length; i++) {
+ this.L_matrix[nodesArray[i]] = {};
+ for (var j = 0; j < nodesArray.length; j++) {
+ this.L_matrix[nodesArray[i]][nodesArray[j]] = edgeLength * D_matrix[nodesArray[i]][nodesArray[j]];
+ }
+ }
+ }
+
+ /**
+ * Create the K matrix: spring constants times shortest path
+ * @param D_matrix
+ * @private
+ */
+
+ }, {
+ key: "_createK_matrix",
+ value: function _createK_matrix(D_matrix) {
+ var nodesArray = this.body.nodeIndices;
+ var edgeStrength = this.springConstant;
+
+ this.K_matrix = [];
+ for (var i = 0; i < nodesArray.length; i++) {
+ this.K_matrix[nodesArray[i]] = {};
+ for (var j = 0; j < nodesArray.length; j++) {
+ this.K_matrix[nodesArray[i]][nodesArray[j]] = edgeStrength * Math.pow(D_matrix[nodesArray[i]][nodesArray[j]], -2);
+ }
+ }
+ }
+ }]);
+
+ return KamadaKawai;
+ }();
+
+ exports.default = KamadaKawai;
+
+/***/ },
+/* 116 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ /**
+ * Created by Alex on 10-Aug-15.
+ */
+
+ var FloydWarshall = function () {
+ function FloydWarshall() {
+ _classCallCheck(this, FloydWarshall);
+ }
+
+ _createClass(FloydWarshall, [{
+ key: "getDistances",
+ value: function getDistances(body, nodesArray, edgesArray) {
+ var D_matrix = {};
+ var edges = body.edges;
+
+ // prepare matrix with large numbers
+ for (var i = 0; i < nodesArray.length; i++) {
+ D_matrix[nodesArray[i]] = {};
+ D_matrix[nodesArray[i]] = {};
+ for (var j = 0; j < nodesArray.length; j++) {
+ D_matrix[nodesArray[i]][nodesArray[j]] = i == j ? 0 : 1e9;
+ D_matrix[nodesArray[i]][nodesArray[j]] = i == j ? 0 : 1e9;
+ }
+ }
+
+ // put the weights for the edges in. This assumes unidirectionality.
+ for (var _i = 0; _i < edgesArray.length; _i++) {
+ var edge = edges[edgesArray[_i]];
+ // edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix
+ if (edge.connected === true && D_matrix[edge.fromId] !== undefined && D_matrix[edge.toId] !== undefined) {
+ D_matrix[edge.fromId][edge.toId] = 1;
+ D_matrix[edge.toId][edge.fromId] = 1;
+ }
+ }
+
+ var nodeCount = nodesArray.length;
+
+ // Adapted FloydWarshall based on unidirectionality to greatly reduce complexity.
+ for (var k = 0; k < nodeCount; k++) {
+ for (var _i2 = 0; _i2 < nodeCount - 1; _i2++) {
+ for (var _j = _i2 + 1; _j < nodeCount; _j++) {
+ D_matrix[nodesArray[_i2]][nodesArray[_j]] = Math.min(D_matrix[nodesArray[_i2]][nodesArray[_j]], D_matrix[nodesArray[_i2]][nodesArray[k]] + D_matrix[nodesArray[k]][nodesArray[_j]]);
+ D_matrix[nodesArray[_j]][nodesArray[_i2]] = D_matrix[nodesArray[_i2]][nodesArray[_j]];
+ }
+ }
+ }
+
+ return D_matrix;
+ }
+ }]);
+
+ return FloydWarshall;
+ }();
+
+ exports.default = FloydWarshall;
+
+/***/ },
+/* 117 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ /**
+ * Canvas shapes used by Network
+ */
+ if (typeof CanvasRenderingContext2D !== 'undefined') {
+
+ /**
+ * Draw a circle shape
+ */
+ CanvasRenderingContext2D.prototype.circle = function (x, y, r) {
+ this.beginPath();
+ this.arc(x, y, r, 0, 2 * Math.PI, false);
+ this.closePath();
+ };
+
+ /**
+ * Draw a square shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r size, width and height of the square
+ */
+ CanvasRenderingContext2D.prototype.square = function (x, y, r) {
+ this.beginPath();
+ this.rect(x - r, y - r, r * 2, r * 2);
+ this.closePath();
+ };
+
+ /**
+ * Draw a triangle shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.triangle = function (x, y, r) {
+ // http://en.wikipedia.org/wiki/Equilateral_triangle
+ this.beginPath();
+
+ // the change in radius and the offset is here to center the shape
+ r *= 1.15;
+ y += 0.275 * r;
+
+ var s = r * 2;
+ var s2 = s / 2;
+ var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
+ var h = Math.sqrt(s * s - s2 * s2); // height
+
+ this.moveTo(x, y - (h - ir));
+ this.lineTo(x + s2, y + ir);
+ this.lineTo(x - s2, y + ir);
+ this.lineTo(x, y - (h - ir));
+ this.closePath();
+ };
+
+ /**
+ * Draw a triangle shape in downward orientation
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius
+ */
+ CanvasRenderingContext2D.prototype.triangleDown = function (x, y, r) {
+ // http://en.wikipedia.org/wiki/Equilateral_triangle
+ this.beginPath();
+
+ // the change in radius and the offset is here to center the shape
+ r *= 1.15;
+ y -= 0.275 * r;
+
+ var s = r * 2;
+ var s2 = s / 2;
+ var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
+ var h = Math.sqrt(s * s - s2 * s2); // height
+
+ this.moveTo(x, y + (h - ir));
+ this.lineTo(x + s2, y - ir);
+ this.lineTo(x - s2, y - ir);
+ this.lineTo(x, y + (h - ir));
+ this.closePath();
+ };
+
+ /**
+ * Draw a star shape, a star with 5 points
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.star = function (x, y, r) {
+ // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
+ this.beginPath();
+
+ // the change in radius and the offset is here to center the shape
+ r *= 0.82;
+ y += 0.1 * r;
+
+ for (var n = 0; n < 10; n++) {
+ var radius = n % 2 === 0 ? r * 1.3 : r * 0.5;
+ this.lineTo(x + radius * Math.sin(n * 2 * Math.PI / 10), y - radius * Math.cos(n * 2 * Math.PI / 10));
+ }
+
+ this.closePath();
+ };
+
+ /**
+ * Draw a Diamond shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.diamond = function (x, y, r) {
+ // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
+ this.beginPath();
+
+ this.lineTo(x, y + r);
+ this.lineTo(x + r, y);
+ this.lineTo(x, y - r);
+ this.lineTo(x - r, y);
+
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas
+ */
+ CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {
+ var r2d = Math.PI / 180;
+ if (w - 2 * r < 0) {
+ r = w / 2;
+ } //ensure that the radius isn't too large for x
+ if (h - 2 * r < 0) {
+ r = h / 2;
+ } //ensure that the radius isn't too large for y
+ this.beginPath();
+ this.moveTo(x + r, y);
+ this.lineTo(x + w - r, y);
+ this.arc(x + w - r, y + r, r, r2d * 270, r2d * 360, false);
+ this.lineTo(x + w, y + h - r);
+ this.arc(x + w - r, y + h - r, r, 0, r2d * 90, false);
+ this.lineTo(x + r, y + h);
+ this.arc(x + r, y + h - r, r, r2d * 90, r2d * 180, false);
+ this.lineTo(x, y + r);
+ this.arc(x + r, y + r, r, r2d * 180, r2d * 270, false);
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
+ */
+ CanvasRenderingContext2D.prototype.ellipse = function (x, y, w, h) {
+ var kappa = .5522848,
+ ox = w / 2 * kappa,
+ // control point offset horizontal
+ oy = h / 2 * kappa,
+ // control point offset vertical
+ xe = x + w,
+ // x-end
+ ye = y + h,
+ // y-end
+ xm = x + w / 2,
+ // x-middle
+ ym = y + h / 2; // y-middle
+
+ this.beginPath();
+ this.moveTo(x, ym);
+ this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
+ this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
+ this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
+ this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
+ */
+ CanvasRenderingContext2D.prototype.database = function (x, y, w, h) {
+ var f = 1 / 3;
+ var wEllipse = w;
+ var hEllipse = h * f;
+
+ var kappa = .5522848,
+ ox = wEllipse / 2 * kappa,
+ // control point offset horizontal
+ oy = hEllipse / 2 * kappa,
+ // control point offset vertical
+ xe = x + wEllipse,
+ // x-end
+ ye = y + hEllipse,
+ // y-end
+ xm = x + wEllipse / 2,
+ // x-middle
+ ym = y + hEllipse / 2,
+ // y-middle
+ ymb = y + (h - hEllipse / 2),
+ // y-midlle, bottom ellipse
+ yeb = y + h; // y-end, bottom ellipse
+
+ this.beginPath();
+ this.moveTo(xe, ym);
+
+ this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
+ this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
+
+ this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
+ this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
+
+ this.lineTo(xe, ymb);
+
+ this.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);
+ this.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);
+
+ this.lineTo(x, ym);
+ };
+
+ /**
+ * Draw an arrow point (no line)
+ */
+ CanvasRenderingContext2D.prototype.arrow = function (x, y, angle, length) {
+ // tail
+ var xt = x - length * Math.cos(angle);
+ var yt = y - length * Math.sin(angle);
+
+ // inner tail
+ var xi = x - length * 0.9 * Math.cos(angle);
+ var yi = y - length * 0.9 * Math.sin(angle);
+
+ // left
+ var xl = xt + length / 3 * Math.cos(angle + 0.5 * Math.PI);
+ var yl = yt + length / 3 * Math.sin(angle + 0.5 * Math.PI);
+
+ // right
+ var xr = xt + length / 3 * Math.cos(angle - 0.5 * Math.PI);
+ var yr = yt + length / 3 * Math.sin(angle - 0.5 * Math.PI);
+
+ this.beginPath();
+ this.moveTo(x, y);
+ this.lineTo(xl, yl);
+ this.lineTo(xi, yi);
+ this.lineTo(xr, yr);
+ this.closePath();
+ };
+
+ /**
+ * Sets up the dashedLine functionality for drawing
+ * Original code came from http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
+ * @author David Jordan
+ * @date 2012-08-08
+ */
+ CanvasRenderingContext2D.prototype.dashedLine = function (x, y, x2, y2, pattern) {
+ this.beginPath();
+ this.moveTo(x, y);
+
+ var patternLength = pattern.length;
+ var dx = x2 - x;
+ var dy = y2 - y;
+ var slope = dy / dx;
+ var distRemaining = Math.sqrt(dx * dx + dy * dy);
+ var patternIndex = 0;
+ var draw = true;
+ var xStep = 0;
+ var dashLength = pattern[0];
+
+ while (distRemaining >= 0.1) {
+ dashLength = pattern[patternIndex++ % patternLength];
+ if (dashLength > distRemaining) {
+ dashLength = distRemaining;
+ }
+
+ xStep = Math.sqrt(dashLength * dashLength / (1 + slope * slope));
+ xStep = dx < 0 ? -xStep : xStep;
+ x += xStep;
+ y += slope * xStep;
+
+ if (draw === true) {
+ this.lineTo(x, y);
+ } else {
+ this.moveTo(x, y);
+ }
+
+ distRemaining -= dashLength;
+ draw = !draw;
+ }
+ };
+ }
+
+/***/ },
+/* 118 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ /**
+ * Parse a text source containing data in DOT language into a JSON object.
+ * The object contains two lists: one with nodes and one with edges.
+ *
+ * DOT language reference: http://www.graphviz.org/doc/info/lang.html
+ *
+ * DOT language attributes: http://graphviz.org/content/attrs
+ *
+ * @param {String} data Text containing a graph in DOT-notation
+ * @return {Object} graph An object containing two parameters:
+ * {Object[]} nodes
+ * {Object[]} edges
+ */
+ function parseDOT(data) {
+ dot = data;
+ return parseGraph();
+ }
+
+ // mapping of attributes from DOT (the keys) to vis.js (the values)
+ var NODE_ATTR_MAPPING = {
+ 'fontsize': 'font.size',
+ 'fontcolor': 'font.color',
+ 'labelfontcolor': 'font.color',
+ 'fontname': 'font.face',
+ 'color': ['color.border', 'color.background'],
+ 'fillcolor': 'color.background',
+ 'tooltip': 'title',
+ 'labeltooltip': 'title'
+ };
+ var EDGE_ATTR_MAPPING = Object.create(NODE_ATTR_MAPPING);
+ EDGE_ATTR_MAPPING.color = 'color.color';
+
+ // token types enumeration
+ var TOKENTYPE = {
+ NULL: 0,
+ DELIMITER: 1,
+ IDENTIFIER: 2,
+ UNKNOWN: 3
+ };
+
+ // map with all delimiters
+ var DELIMITERS = {
+ '{': true,
+ '}': true,
+ '[': true,
+ ']': true,
+ ';': true,
+ '=': true,
+ ',': true,
+
+ '->': true,
+ '--': true
+ };
+
+ var dot = ''; // current dot file
+ var index = 0; // current index in dot file
+ var c = ''; // current token character in expr
+ var token = ''; // current token
+ var tokenType = TOKENTYPE.NULL; // type of the token
+
+ /**
+ * Get the first character from the dot file.
+ * The character is stored into the char c. If the end of the dot file is
+ * reached, the function puts an empty string in c.
+ */
+ function first() {
+ index = 0;
+ c = dot.charAt(0);
+ }
+
+ /**
+ * Get the next character from the dot file.
+ * The character is stored into the char c. If the end of the dot file is
+ * reached, the function puts an empty string in c.
+ */
+ function next() {
+ index++;
+ c = dot.charAt(index);
+ }
+
+ /**
+ * Preview the next character from the dot file.
+ * @return {String} cNext
+ */
+ function nextPreview() {
+ return dot.charAt(index + 1);
+ }
+
+ /**
+ * Test whether given character is alphabetic or numeric
+ * @param {String} c
+ * @return {Boolean} isAlphaNumeric
+ */
+ var regexAlphaNumeric = /[a-zA-Z_0-9.:#]/;
+ function isAlphaNumeric(c) {
+ return regexAlphaNumeric.test(c);
+ }
+
+ /**
+ * Merge all options of object b into object b
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ function merge(a, b) {
+ if (!a) {
+ a = {};
+ }
+
+ if (b) {
+ for (var name in b) {
+ if (b.hasOwnProperty(name)) {
+ a[name] = b[name];
+ }
+ }
+ }
+ return a;
+ }
+
+ /**
+ * Set a value in an object, where the provided parameter name can be a
+ * path with nested parameters. For example:
+ *
+ * var obj = {a: 2};
+ * setValue(obj, 'b.c', 3); // obj = {a: 2, b: {c: 3}}
+ *
+ * @param {Object} obj
+ * @param {String} path A parameter name or dot-separated parameter path,
+ * like "color.highlight.border".
+ * @param {*} value
+ */
+ function setValue(obj, path, value) {
+ var keys = path.split('.');
+ var o = obj;
+ while (keys.length) {
+ var key = keys.shift();
+ if (keys.length) {
+ // this isn't the end point
+ if (!o[key]) {
+ o[key] = {};
+ }
+ o = o[key];
+ } else {
+ // this is the end point
+ o[key] = value;
+ }
+ }
+ }
+
+ /**
+ * Add a node to a graph object. If there is already a node with
+ * the same id, their attributes will be merged.
+ * @param {Object} graph
+ * @param {Object} node
+ */
+ function addNode(graph, node) {
+ var i, len;
+ var current = null;
+
+ // find root graph (in case of subgraph)
+ var graphs = [graph]; // list with all graphs from current graph to root graph
+ var root = graph;
+ while (root.parent) {
+ graphs.push(root.parent);
+ root = root.parent;
+ }
+
+ // find existing node (at root level) by its id
+ if (root.nodes) {
+ for (i = 0, len = root.nodes.length; i < len; i++) {
+ if (node.id === root.nodes[i].id) {
+ current = root.nodes[i];
+ break;
+ }
+ }
+ }
+
+ if (!current) {
+ // this is a new node
+ current = {
+ id: node.id
+ };
+ if (graph.node) {
+ // clone default attributes
+ current.attr = merge(current.attr, graph.node);
+ }
+ }
+
+ // add node to this (sub)graph and all its parent graphs
+ for (i = graphs.length - 1; i >= 0; i--) {
+ var g = graphs[i];
+
+ if (!g.nodes) {
+ g.nodes = [];
+ }
+ if (g.nodes.indexOf(current) === -1) {
+ g.nodes.push(current);
+ }
+ }
+
+ // merge attributes
+ if (node.attr) {
+ current.attr = merge(current.attr, node.attr);
+ }
+ }
+
+ /**
+ * Add an edge to a graph object
+ * @param {Object} graph
+ * @param {Object} edge
+ */
+ function addEdge(graph, edge) {
+ if (!graph.edges) {
+ graph.edges = [];
+ }
+ graph.edges.push(edge);
+ if (graph.edge) {
+ var attr = merge({}, graph.edge); // clone default attributes
+ edge.attr = merge(attr, edge.attr); // merge attributes
+ }
+ }
+
+ /**
+ * Create an edge to a graph object
+ * @param {Object} graph
+ * @param {String | Number | Object} from
+ * @param {String | Number | Object} to
+ * @param {String} type
+ * @param {Object | null} attr
+ * @return {Object} edge
+ */
+ function createEdge(graph, from, to, type, attr) {
+ var edge = {
+ from: from,
+ to: to,
+ type: type
+ };
+
+ if (graph.edge) {
+ edge.attr = merge({}, graph.edge); // clone default attributes
+ }
+ edge.attr = merge(edge.attr || {}, attr); // merge attributes
+
+ return edge;
+ }
+
+ /**
+ * Get next token in the current dot file.
+ * The token and token type are available as token and tokenType
+ */
+ function getToken() {
+ tokenType = TOKENTYPE.NULL;
+ token = '';
+
+ // skip over whitespaces
+ while (c === ' ' || c === '\t' || c === '\n' || c === '\r') {
+ // space, tab, enter
+ next();
+ }
+
+ do {
+ var isComment = false;
+
+ // skip comment
+ if (c === '#') {
+ // find the previous non-space character
+ var i = index - 1;
+ while (dot.charAt(i) === ' ' || dot.charAt(i) === '\t') {
+ i--;
+ }
+ if (dot.charAt(i) === '\n' || dot.charAt(i) === '') {
+ // the # is at the start of a line, this is indeed a line comment
+ while (c != '' && c != '\n') {
+ next();
+ }
+ isComment = true;
+ }
+ }
+ if (c === '/' && nextPreview() === '/') {
+ // skip line comment
+ while (c != '' && c != '\n') {
+ next();
+ }
+ isComment = true;
+ }
+ if (c === '/' && nextPreview() === '*') {
+ // skip block comment
+ while (c != '') {
+ if (c === '*' && nextPreview() === '/') {
+ // end of block comment found. skip these last two characters
+ next();
+ next();
+ break;
+ } else {
+ next();
+ }
+ }
+ isComment = true;
+ }
+
+ // skip over whitespaces
+ while (c === ' ' || c === '\t' || c === '\n' || c === '\r') {
+ // space, tab, enter
+ next();
+ }
+ } while (isComment);
+
+ // check for end of dot file
+ if (c === '') {
+ // token is still empty
+ tokenType = TOKENTYPE.DELIMITER;
+ return;
+ }
+
+ // check for delimiters consisting of 2 characters
+ var c2 = c + nextPreview();
+ if (DELIMITERS[c2]) {
+ tokenType = TOKENTYPE.DELIMITER;
+ token = c2;
+ next();
+ next();
+ return;
+ }
+
+ // check for delimiters consisting of 1 character
+ if (DELIMITERS[c]) {
+ tokenType = TOKENTYPE.DELIMITER;
+ token = c;
+ next();
+ return;
+ }
+
+ // check for an identifier (number or string)
+ // TODO: more precise parsing of numbers/strings (and the port separator ':')
+ if (isAlphaNumeric(c) || c === '-') {
+ token += c;
+ next();
+
+ while (isAlphaNumeric(c)) {
+ token += c;
+ next();
+ }
+ if (token === 'false') {
+ token = false; // convert to boolean
+ } else if (token === 'true') {
+ token = true; // convert to boolean
+ } else if (!isNaN(Number(token))) {
+ token = Number(token); // convert to number
+ }
+ tokenType = TOKENTYPE.IDENTIFIER;
+ return;
+ }
+
+ // check for a string enclosed by double quotes
+ if (c === '"') {
+ next();
+ while (c != '' && (c != '"' || c === '"' && nextPreview() === '"')) {
+ token += c;
+ if (c === '"') {
+ // skip the escape character
+ next();
+ }
+ next();
+ }
+ if (c != '"') {
+ throw newSyntaxError('End of string " expected');
+ }
+ next();
+ tokenType = TOKENTYPE.IDENTIFIER;
+ return;
+ }
+
+ // something unknown is found, wrong characters, a syntax error
+ tokenType = TOKENTYPE.UNKNOWN;
+ while (c != '') {
+ token += c;
+ next();
+ }
+ throw new SyntaxError('Syntax error in part "' + chop(token, 30) + '"');
+ }
+
+ /**
+ * Parse a graph.
+ * @returns {Object} graph
+ */
+ function parseGraph() {
+ var graph = {};
+
+ first();
+ getToken();
+
+ // optional strict keyword
+ if (token === 'strict') {
+ graph.strict = true;
+ getToken();
+ }
+
+ // graph or digraph keyword
+ if (token === 'graph' || token === 'digraph') {
+ graph.type = token;
+ getToken();
+ }
+
+ // optional graph id
+ if (tokenType === TOKENTYPE.IDENTIFIER) {
+ graph.id = token;
+ getToken();
+ }
+
+ // open angle bracket
+ if (token != '{') {
+ throw newSyntaxError('Angle bracket { expected');
+ }
+ getToken();
+
+ // statements
+ parseStatements(graph);
+
+ // close angle bracket
+ if (token != '}') {
+ throw newSyntaxError('Angle bracket } expected');
+ }
+ getToken();
+
+ // end of file
+ if (token !== '') {
+ throw newSyntaxError('End of file expected');
+ }
+ getToken();
+
+ // remove temporary default options
+ delete graph.node;
+ delete graph.edge;
+ delete graph.graph;
+
+ return graph;
+ }
+
+ /**
+ * Parse a list with statements.
+ * @param {Object} graph
+ */
+ function parseStatements(graph) {
+ while (token !== '' && token != '}') {
+ parseStatement(graph);
+ if (token === ';') {
+ getToken();
+ }
+ }
+ }
+
+ /**
+ * Parse a single statement. Can be a an attribute statement, node
+ * statement, a series of node statements and edge statements, or a
+ * parameter.
+ * @param {Object} graph
+ */
+ function parseStatement(graph) {
+ // parse subgraph
+ var subgraph = parseSubgraph(graph);
+ if (subgraph) {
+ // edge statements
+ parseEdge(graph, subgraph);
+
+ return;
+ }
+
+ // parse an attribute statement
+ var attr = parseAttributeStatement(graph);
+ if (attr) {
+ return;
+ }
+
+ // parse node
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier expected');
+ }
+ var id = token; // id can be a string or a number
+ getToken();
+
+ if (token === '=') {
+ // id statement
+ getToken();
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier expected');
+ }
+ graph[id] = token;
+ getToken();
+ // TODO: implement comma separated list with "a_list: ID=ID [','] [a_list] "
+ } else {
+ parseNodeStatement(graph, id);
+ }
+ }
+
+ /**
+ * Parse a subgraph
+ * @param {Object} graph parent graph object
+ * @return {Object | null} subgraph
+ */
+ function parseSubgraph(graph) {
+ var subgraph = null;
+
+ // optional subgraph keyword
+ if (token === 'subgraph') {
+ subgraph = {};
+ subgraph.type = 'subgraph';
+ getToken();
+
+ // optional graph id
+ if (tokenType === TOKENTYPE.IDENTIFIER) {
+ subgraph.id = token;
+ getToken();
+ }
+ }
+
+ // open angle bracket
+ if (token === '{') {
+ getToken();
+
+ if (!subgraph) {
+ subgraph = {};
+ }
+ subgraph.parent = graph;
+ subgraph.node = graph.node;
+ subgraph.edge = graph.edge;
+ subgraph.graph = graph.graph;
+
+ // statements
+ parseStatements(subgraph);
+
+ // close angle bracket
+ if (token != '}') {
+ throw newSyntaxError('Angle bracket } expected');
+ }
+ getToken();
+
+ // remove temporary default options
+ delete subgraph.node;
+ delete subgraph.edge;
+ delete subgraph.graph;
+ delete subgraph.parent;
+
+ // register at the parent graph
+ if (!graph.subgraphs) {
+ graph.subgraphs = [];
+ }
+ graph.subgraphs.push(subgraph);
+ }
+
+ return subgraph;
+ }
+
+ /**
+ * parse an attribute statement like "node [shape=circle fontSize=16]".
+ * Available keywords are 'node', 'edge', 'graph'.
+ * The previous list with default attributes will be replaced
+ * @param {Object} graph
+ * @returns {String | null} keyword Returns the name of the parsed attribute
+ * (node, edge, graph), or null if nothing
+ * is parsed.
+ */
+ function parseAttributeStatement(graph) {
+ // attribute statements
+ if (token === 'node') {
+ getToken();
+
+ // node attributes
+ graph.node = parseAttributeList();
+ return 'node';
+ } else if (token === 'edge') {
+ getToken();
+
+ // edge attributes
+ graph.edge = parseAttributeList();
+ return 'edge';
+ } else if (token === 'graph') {
+ getToken();
+
+ // graph attributes
+ graph.graph = parseAttributeList();
+ return 'graph';
+ }
+
+ return null;
+ }
+
+ /**
+ * parse a node statement
+ * @param {Object} graph
+ * @param {String | Number} id
+ */
+ function parseNodeStatement(graph, id) {
+ // node statement
+ var node = {
+ id: id
+ };
+ var attr = parseAttributeList();
+ if (attr) {
+ node.attr = attr;
+ }
+ addNode(graph, node);
+
+ // edge statements
+ parseEdge(graph, id);
+ }
+
+ /**
+ * Parse an edge or a series of edges
+ * @param {Object} graph
+ * @param {String | Number} from Id of the from node
+ */
+ function parseEdge(graph, from) {
+ while (token === '->' || token === '--') {
+ var to;
+ var type = token;
+ getToken();
+
+ var subgraph = parseSubgraph(graph);
+ if (subgraph) {
+ to = subgraph;
+ } else {
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier or subgraph expected');
+ }
+ to = token;
+ addNode(graph, {
+ id: to
+ });
+ getToken();
+ }
+
+ // parse edge attributes
+ var attr = parseAttributeList();
+
+ // create edge
+ var edge = createEdge(graph, from, to, type, attr);
+ addEdge(graph, edge);
+
+ from = to;
+ }
+ }
+
+ /**
+ * Parse a set with attributes,
+ * for example [label="1.000", shape=solid]
+ * @return {Object | null} attr
+ */
+ function parseAttributeList() {
+ var attr = null;
+
+ while (token === '[') {
+ getToken();
+ attr = {};
+ while (token !== '' && token != ']') {
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Attribute name expected');
+ }
+ var name = token;
+
+ getToken();
+ if (token != '=') {
+ throw newSyntaxError('Equal sign = expected');
+ }
+ getToken();
+
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Attribute value expected');
+ }
+ var value = token;
+ setValue(attr, name, value); // name can be a path
+
+ getToken();
+ if (token == ',') {
+ getToken();
+ }
+ }
+
+ if (token != ']') {
+ throw newSyntaxError('Bracket ] expected');
+ }
+ getToken();
+ }
+
+ return attr;
+ }
+
+ /**
+ * Create a syntax error with extra information on current token and index.
+ * @param {String} message
+ * @returns {SyntaxError} err
+ */
+ function newSyntaxError(message) {
+ return new SyntaxError(message + ', got "' + chop(token, 30) + '" (char ' + index + ')');
+ }
+
+ /**
+ * Chop off text after a maximum length
+ * @param {String} text
+ * @param {Number} maxLength
+ * @returns {String}
+ */
+ function chop(text, maxLength) {
+ return text.length <= maxLength ? text : text.substr(0, 27) + '...';
+ }
+
+ /**
+ * Execute a function fn for each pair of elements in two arrays
+ * @param {Array | *} array1
+ * @param {Array | *} array2
+ * @param {function} fn
+ */
+ function forEach2(array1, array2, fn) {
+ if (Array.isArray(array1)) {
+ array1.forEach(function (elem1) {
+ if (Array.isArray(array2)) {
+ array2.forEach(function (elem2) {
+ fn(elem1, elem2);
+ });
+ } else {
+ fn(elem1, array2);
+ }
+ });
+ } else {
+ if (Array.isArray(array2)) {
+ array2.forEach(function (elem2) {
+ fn(array1, elem2);
+ });
+ } else {
+ fn(array1, array2);
+ }
+ }
+ }
+
+ /**
+ * Set a nested property on an object
+ * When nested objects are missing, they will be created.
+ * For example setProp({}, 'font.color', 'red') will return {font: {color: 'red'}}
+ * @param {Object} object
+ * @param {string} path A dot separated string like 'font.color'
+ * @param {*} value Value for the property
+ * @return {Object} Returns the original object, allows for chaining.
+ */
+ function setProp(object, path, value) {
+ var names = path.split('.');
+ var prop = names.pop();
+
+ // traverse over the nested objects
+ var obj = object;
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ if (!(name in obj)) {
+ obj[name] = {};
+ }
+ obj = obj[name];
+ }
+
+ // set the property value
+ obj[prop] = value;
+
+ return object;
+ }
+
+ /**
+ * Convert an object with DOT attributes to their vis.js equivalents.
+ * @param {Object} attr Object with DOT attributes
+ * @param {Object} mapping
+ * @return {Object} Returns an object with vis.js attributes
+ */
+ function convertAttr(attr, mapping) {
+ var converted = {};
+
+ for (var prop in attr) {
+ if (attr.hasOwnProperty(prop)) {
+ var visProp = mapping[prop];
+ if (Array.isArray(visProp)) {
+ visProp.forEach(function (visPropI) {
+ setProp(converted, visPropI, attr[prop]);
+ });
+ } else if (typeof visProp === 'string') {
+ setProp(converted, visProp, attr[prop]);
+ } else {
+ setProp(converted, prop, attr[prop]);
+ }
+ }
+ }
+
+ return converted;
+ }
+
+ /**
+ * Convert a string containing a graph in DOT language into a map containing
+ * with nodes and edges in the format of graph.
+ * @param {String} data Text containing a graph in DOT-notation
+ * @return {Object} graphData
+ */
+ function DOTToGraph(data) {
+ // parse the DOT file
+ var dotData = parseDOT(data);
+ var graphData = {
+ nodes: [],
+ edges: [],
+ options: {}
+ };
+
+ // copy the nodes
+ if (dotData.nodes) {
+ dotData.nodes.forEach(function (dotNode) {
+ var graphNode = {
+ id: dotNode.id,
+ label: String(dotNode.label || dotNode.id)
+ };
+ merge(graphNode, convertAttr(dotNode.attr, NODE_ATTR_MAPPING));
+ if (graphNode.image) {
+ graphNode.shape = 'image';
+ }
+ graphData.nodes.push(graphNode);
+ });
+ }
+
+ // copy the edges
+ if (dotData.edges) {
+ /**
+ * Convert an edge in DOT format to an edge with VisGraph format
+ * @param {Object} dotEdge
+ * @returns {Object} graphEdge
+ */
+ var convertEdge = function convertEdge(dotEdge) {
+ var graphEdge = {
+ from: dotEdge.from,
+ to: dotEdge.to
+ };
+ merge(graphEdge, convertAttr(dotEdge.attr, EDGE_ATTR_MAPPING));
+ graphEdge.arrows = dotEdge.type === '->' ? 'to' : undefined;
+
+ return graphEdge;
+ };
+
+ dotData.edges.forEach(function (dotEdge) {
+ var from, to;
+ if (dotEdge.from instanceof Object) {
+ from = dotEdge.from.nodes;
+ } else {
+ from = {
+ id: dotEdge.from
+ };
+ }
+
+ // TODO: support of solid/dotted/dashed edges (attr = 'style')
+ // TODO: support for attributes 'dir' and 'arrowhead' (edge arrows)
+
+ if (dotEdge.to instanceof Object) {
+ to = dotEdge.to.nodes;
+ } else {
+ to = {
+ id: dotEdge.to
+ };
+ }
+
+ if (dotEdge.from instanceof Object && dotEdge.from.edges) {
+ dotEdge.from.edges.forEach(function (subEdge) {
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+ }
+
+ forEach2(from, to, function (from, to) {
+ var subEdge = createEdge(graphData, from.id, to.id, dotEdge.type, dotEdge.attr);
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+
+ if (dotEdge.to instanceof Object && dotEdge.to.edges) {
+ dotEdge.to.edges.forEach(function (subEdge) {
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+ }
+ });
+ }
+
+ // copy the options
+ if (dotData.attr) {
+ graphData.options = dotData.attr;
+ }
+
+ return graphData;
+ }
+
+ // exports
+ exports.parseDOT = parseDOT;
+ exports.DOTToGraph = DOTToGraph;
+
+/***/ },
+/* 119 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ function parseGephi(gephiJSON, optionsObj) {
+ var edges = [];
+ var nodes = [];
+ var options = {
+ edges: {
+ inheritColor: false
+ },
+ nodes: {
+ fixed: false,
+ parseColor: false
+ }
+ };
+
+ if (optionsObj !== undefined) {
+ if (optionsObj.fixed !== undefined) {
+ options.nodes.fixed = optionsObj.fixed;
+ }
+ if (optionsObj.parseColor !== undefined) {
+ options.nodes.parseColor = optionsObj.parseColor;
+ }
+ if (optionsObj.inheritColor !== undefined) {
+ options.edges.inheritColor = optionsObj.inheritColor;
+ }
+ }
+
+ var gEdges = gephiJSON.edges;
+ var gNodes = gephiJSON.nodes;
+ for (var i = 0; i < gEdges.length; i++) {
+ var edge = {};
+ var gEdge = gEdges[i];
+ edge['id'] = gEdge.id;
+ edge['from'] = gEdge.source;
+ edge['to'] = gEdge.target;
+ edge['attributes'] = gEdge.attributes;
+ edge['label'] = gEdge.label;
+ edge['title'] = gEdge.attributes !== undefined ? gEdge.attributes.title : undefined;
+ if (gEdge['type'] === 'Directed') {
+ edge['arrows'] = 'to';
+ }
+ // edge['value'] = gEdge.attributes !== undefined ? gEdge.attributes.Weight : undefined;
+ // edge['width'] = edge['value'] !== undefined ? undefined : edgegEdge.size;
+ if (gEdge.color && options.inheritColor === false) {
+ edge['color'] = gEdge.color;
+ }
+ edges.push(edge);
+ }
+
+ for (var i = 0; i < gNodes.length; i++) {
+ var node = {};
+ var gNode = gNodes[i];
+ node['id'] = gNode.id;
+ node['attributes'] = gNode.attributes;
+ node['title'] = gNode.title;
+ node['x'] = gNode.x;
+ node['y'] = gNode.y;
+ node['label'] = gNode.label;
+ node['title'] = gNode.attributes !== undefined ? gNode.attributes.title : undefined;
+ if (options.nodes.parseColor === true) {
+ node['color'] = gNode.color;
+ } else {
+ node['color'] = gNode.color !== undefined ? { background: gNode.color, border: gNode.color, highlight: { background: gNode.color, border: gNode.color }, hover: { background: gNode.color, border: gNode.color } } : undefined;
+ }
+ node['size'] = gNode.size;
+ node['fixed'] = options.nodes.fixed && gNode.x !== undefined && gNode.y !== undefined;
+ nodes.push(node);
+ }
+
+ return { nodes: nodes, edges: edges };
+ }
+
+ exports.parseGephi = parseGephi;
+
+/***/ },
+/* 120 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ // English
+ exports['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.'
+ };
+ exports['en_EN'] = exports['en'];
+ exports['en_US'] = exports['en'];
+
+ // German
+ exports['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.'
+ };
+ exports['de_DE'] = exports['de'];
+
+ // Spanish
+ exports['es'] = {
+ edit: 'Editar',
+ del: 'Eliminar selección',
+ back: 'Átras',
+ 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.'
+ };
+ exports['es_ES'] = exports['es'];
+
+ // Dutch
+ exports['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.'
+ };
+ exports['nl_NL'] = exports['nl'];
+ exports['nl_BE'] = exports['nl'];
+
+/***/ }
+/******/ ])
+});
+;
\ No newline at end of file
--- /dev/null
+{"version":3,"sources":["vis.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","util","extend","_typeof","Symbol","iterator","obj","constructor","moment","uuid","isNumber","object","Number","recursiveDOMDelete","DOMobject","hasChildNodes","firstChild","removeChild","giveRange","min","max","total","value","scale","Math","isString","String","isDate","Date","match","ASPDateRegex","exec","isNaN","parse","randomUUID","v4","assignAllKeys","prop","hasOwnProperty","fillIfDefined","a","b","allowDeletion","arguments","length","undefined","protoExtend","i","other","selectiveExtend","props","Array","isArray","Error","selectiveDeepExtend","TypeError","Object","deepExtend","selectiveNotDeepExtend","indexOf","push","equalArray","len","convert","type","Boolean","valueOf","isMoment","toDate","getType","toISOString","copyAndExtendArray","arr","newValue","newArr","copyArray","getAbsoluteLeft","elem","getBoundingClientRect","left","getAbsoluteRight","right","getAbsoluteTop","top","addClassName","className","classes","split","join","removeClassName","index","splice","forEach","callback","toArray","array","updateProperty","key","throttle","fn","wait","timeout","needExecution","throttled","setTimeout","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","preventDefault","event","window","returnValue","getTarget","target","srcElement","nodeType","parentNode","hasParent","parent","e","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","hexToRGB","hex","shorthandRegex","replace","r","g","result","parseInt","overrideOpacity","color","opacity","rgb","substr","RGBToHex","red","green","blue","toString","slice","parseColor","isValidRGB","map","isValidHex","hsv","hexToHSV","lighterColorHSV","h","s","v","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","RGBToHSV","minRGB","maxRGB","d","hue","saturation","cssUtil","cssText","styles","style","trim","parts","keys","addCssText","currentStyles","newStyles","removeCssText","removeStyles","HSVToRGB","floor","f","q","t","isOk","test","isValidRGBA","rgba","selectiveBridgeObject","fields","referenceObject","objectTo","create","bridgeObject","insertSort","compare","k","j","mergeOptions","mergeTarget","options","globalOptions","enabled","binarySearchCustom","orderedItems","comparator","field","field2","maxIterations","iteration","low","high","middle","item","searchResult","binarySearchValue","sidePreference","prevValue","nextValue","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","global","utils_hooks__hooks","hookCallback","apply","setHookCallback","input","prototype","res","hasOwnProp","create_utc__createUTC","format","locale","strict","createLocalOrUTC","utc","defaultParsingFlags","empty","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","meridiem","getParsingFlags","_pf","valid__isValid","_isValid","flags","parsedParts","some","_d","getTime","invalidWeekday","_strict","bigHour","valid__createInvalid","NaN","isUndefined","copyConfig","to","from","val","_isAMomentObject","_i","_f","_l","_tzm","_isUTC","_offset","_locale","momentProperties","Moment","config","updateInProgress","updateOffset","absFloor","number","ceil","toInt","argumentForCoercion","coercedNumber","isFinite","compareArrays","array1","array2","dontConvert","lengthDiff","abs","diffs","warn","msg","suppressDeprecationWarnings","console","deprecate","firstTime","deprecationHandler","stack","deprecateSimple","name","deprecations","isFunction","Function","isObject","locale_set__set","_config","_ordinalParseLenient","RegExp","_ordinalParse","source","mergeConfigs","parentConfig","childConfig","Locale","set","normalizeLocale","toLowerCase","chooseLocale","names","next","loadLocale","oldLocale","locales","globalLocale","_abbr","code","locale_locales__getSetGlobalLocale","values","data","locale_locales__getLocale","defineLocale","abbr","parentLocale","updateLocale","locale_locales__listLocales","addUnitAlias","unit","shorthand","lowerCase","aliases","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","makeGetSet","keepTime","get_set__set","get_set__get","mom","isValid","getSet","zeroFill","targetLength","forceSign","absNumber","zerosToFill","sign","pow","addFormatToken","token","padded","ordinal","func","formatTokenFunctions","localeData","removeFormattingTokens","makeFormatFunction","formattingTokens","output","formatMoment","expandFormat","formatFunctions","invalidDate","replaceLongDateFormatTokens","longDateFormat","localFormattingTokens","lastIndex","addRegexToken","regex","strictRegex","regexes","isStrict","getParseRegexForToken","unescapeFormat","regexEscape","matched","p1","p2","p3","p4","addParseToken","tokens","addWeekParseToken","_w","addTimeToArrayFromToken","_a","daysInMonth","year","month","UTC","getUTCDate","localeMonths","_months","MONTHS_IN_FORMAT","localeMonthsShort","_monthsShort","units_month__handleStrictParse","monthName","ii","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","monthsShort","months","localeMonthsParse","_monthsParseExact","setMonth","dayOfMonth","monthsParse","date","getSetMonth","getDaysInMonth","monthsShortRegex","computeMonthsParse","_monthsShortStrictRegex","_monthsShortRegex","monthsRegex","_monthsStrictRegex","_monthsRegex","cmpLenRev","shortPieces","longPieces","mixedPieces","sort","checkOverflow","MONTH","DATE","YEAR","HOUR","MINUTE","SECOND","MILLISECOND","_overflowDayOfYear","_overflowWeeks","WEEK","_overflowWeekday","WEEKDAY","configFromISO","l","allowTime","dateFormat","timeFormat","tzFormat","string","extendedIsoRegex","basicIsoRegex","isoDates","isoTimes","tzRegex","configFromStringAndFormat","configFromString","aspNetJsonRegex","createFromInputFallback","createDate","y","M","ms","getFullYear","setFullYear","createUTCDate","getUTCFullYear","setUTCFullYear","daysInYear","isLeapYear","getIsLeapYear","firstWeekOffset","dow","doy","fwd","fwdlw","getUTCDay","dayOfYearFromWeeks","week","weekday","resYear","resDayOfYear","localWeekday","weekOffset","dayOfYear","weekOfYear","resWeek","weeksInYear","weekOffsetNext","defaults","currentDateArray","nowValue","now","_useUTC","getUTCMonth","getMonth","getDate","configFromArray","currentDate","yearToUse","dayOfYearFromWeekInfo","_dayOfYear","_nextDay","setUTCMinutes","getUTCMinutes","w","weekYear","temp","weekdayOverflow","GG","W","E","local__createLocal","_week","gg","ISO_8601","parsedInput","skipped","stringLength","totalParsedInputLength","_meridiem","meridiemFixWrap","hour","isPm","meridiemHour","isPM","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","score","configFromObject","day","minute","second","millisecond","createFromConfig","prepareConfig","add","preparse","configFromInput","isUTC","pickBy","moments","args","Duration","duration","years","quarters","quarter","weeks","days","hours","minutes","seconds","milliseconds","_milliseconds","_days","_data","_bubble","isDuration","offset","separator","utcOffset","offsetFromString","matcher","matches","chunk","chunkOffset","cloneWithOffset","model","diff","clone","setTime","local","getDateOffset","round","getTimezoneOffset","getSetOffset","keepLocalTime","localAdjust","matchShortOffset","_changeInProgress","add_subtract__addSubtract","create__createDuration","getSetZone","setOffsetToUTC","setOffsetToLocal","subtract","setOffsetToParsedOffset","matchOffset","hasAlignedHourOffset","isDaylightSavingTime","isDaylightSavingTimeShifted","_isDSTShifted","isLocal","isUtcOffset","isUtc","ret","diffRes","aspNetRegex","isoRegex","parseIso","momentsDifference","inp","parseFloat","positiveMomentsDifference","base","isAfter","isBefore","absRound","createAdder","direction","period","dur","tmp","isAdding","moment_calendar__calendar","time","formats","sod","startOf","calendar","localInput","endOf","isBetween","inclusivity","isSame","inputMs","isSameOrAfter","isSameOrBefore","asFloat","that","zoneDelta","delta","monthDiff","anchor2","adjust","wholeMonthDiff","anchor","moment_format__toISOString","inputString","defaultFormatUtc","defaultFormat","postformat","withoutSuffix","humanize","fromNow","toNow","newLocaleData","isoWeekday","to_type__valueOf","unix","toObject","toJSON","moment_valid__isValid","parsingFlags","invalidAt","creationData","addWeekYearFormatToken","getter","getSetWeekYear","getSetWeekYearHelper","getSetISOWeekYear","isoWeek","getISOWeeksInYear","getWeeksInYear","weekInfo","weeksTarget","setWeekAll","dayOfYearData","getSetQuarter","localeWeek","localeFirstDayOfWeek","localeFirstDayOfYear","getSetWeek","getSetISOWeek","parseWeekday","weekdaysParse","localeWeekdays","_weekdays","isFormat","localeWeekdaysShort","_weekdaysShort","localeWeekdaysMin","_weekdaysMin","day_of_week__handleStrictParse","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","weekdaysMin","weekdaysShort","weekdays","localeWeekdaysParse","_weekdaysParseExact","_fullWeekdaysParse","getSetDayOfWeek","getDay","getSetLocaleDayOfWeek","getSetISODayOfWeek","weekdaysRegex","computeWeekdaysParse","_weekdaysStrictRegex","_weekdaysRegex","weekdaysShortRegex","_weekdaysShortStrictRegex","_weekdaysShortRegex","weekdaysMinRegex","_weekdaysMinStrictRegex","_weekdaysMinRegex","minp","shortp","longp","minPieces","getSetDayOfYear","hFormat","kFormat","lowercase","matchMeridiem","_meridiemParse","localeIsPM","charAt","localeMeridiem","isLower","parseMs","getZoneAbbr","getZoneName","moment__createUnix","moment__createInZone","parseZone","locale_calendar__calendar","_calendar","_longDateFormat","formatUpper","toUpperCase","_invalidDate","_ordinal","preParsePostFormat","relative__relativeTime","isFuture","_relativeTime","pastFuture","lists__get","setter","listMonthsImpl","out","listWeekdaysImpl","localeSorted","shift","lists__listMonths","lists__listMonthsShort","lists__listWeekdays","lists__listWeekdaysShort","lists__listWeekdaysMin","duration_abs__abs","mathAbs","duration_add_subtract__addSubtract","duration_add_subtract__add","duration_add_subtract__subtract","absCeil","bubble","monthsFromDays","monthsToDays","daysToMonths","as","duration_as__valueOf","makeAs","alias","duration_get__get","makeGetter","substituteTimeAgo","relativeTime","duration_humanize__relativeTime","posNegDuration","thresholds","duration_humanize__getSetRelativeTimeThreshold","threshold","limit","withSuffix","iso_string__toISOString","iso_string__abs","Y","D","asSeconds","fun","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchTimestamp","matchWord","o","defaultLocaleMonths","defaultLocaleMonthsShort","defaultMonthsShortRegex","defaultMonthsRegex","parseTwoDigitYear","getSetYear","prototypeMin","prototypeMax","add_subtract__add","add_subtract__subtract","lang","isoWeekYear","defaultLocaleWeek","getSetDayOfMonth","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","defaultWeekdaysRegex","defaultWeekdaysShortRegex","defaultWeekdaysMinRegex","_isPm","pos","pos1","pos2","defaultLocaleMeridiemParse","getSetHour","getSetMinute","getSetSecond","getSetMillisecond","momentPrototype__proto","get","isoWeeks","isoWeeksInYear","isDST","isDSTShifted","zoneAbbr","zoneName","dates","zone","momentPrototype","defaultCalendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","defaultLongDateFormat","LTS","LT","L","LL","LLL","LLLL","defaultInvalidDate","defaultOrdinal","defaultOrdinalParse","defaultRelativeTime","future","past","mm","hh","dd","MM","yy","prototype__proto","firstDayOfYear","firstDayOfWeek","ordinalParse","langData","asMilliseconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","duration_prototype__proto","toIsoString","version","invalid","relativeTimeThreshold","_moment","webpackPolyfill","paths","children","webpackContext","req","resolve","buf","oct","_hexToByte","unparse","bth","_byteToHex","v1","clockseq","_clockseq","msecs","nsecs","_lastNSecs","dt","_lastMSecs","tl","tmh","node","_nodeId","n","rnds","random","rng","_rng","globalVar","crypto","getRandomValues","_rnds8","Uint8Array","_rnds","_seedBytes","DOMutil","DataSet","DataView","Queue","Graph3d","graph3d","Camera","Filter","Point2d","Point3d","Slider","StepNumber","Hammer","keycharm","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","resetElements","getSVGElement","svgContainer","document","createElementNS","appendChild","getDOMElement","DOMContainer","insertBefore","createElement","drawPoint","x","groupTemplate","labelObj","point","setAttributeNS","size","label","xOffset","yOffset","content","textContent","drawBar","width","height","rect","_options","_fieldId","fieldId","_type","_subscribers","setOptions","queue","_queue","destroy","on","subscribers","subscribe","off","filter","unsubscribe","_trigger","params","senderId","concat","subscriber","addedIds","me","_addItem","items","update","updatedIds","oldData","updatedData","addOrUpdate","oldItem","_updateItem","ids","firstType","returnType","allowedValues","itemIds","itemId","_getItem","order","_sort","_filterFields","resultant","getIds","getDataSet","mappedItems","filteredItem","itemFields","av","bv","remove","removedId","removedIds","_remove","clear","maxField","itemField","minField","distinct","fieldType","count","exists","types","raw","converted","JSON","stringify","delay","Infinity","_timeout","_extended","_flushIfNeeded","flush","methods","original","method","context","entry","clearTimeout","_ids","_onEvent","setData","refresh","oldIds","newIds","added","removed","viewOptions","getArguments","defaultFilter","dataSet","updated","container","SyntaxError","containerElement","margin","defaultXCenter","defaultYCenter","xLabel","yLabel","zLabel","passValueFn","xValueLabel","yValueLabel","zValueLabel","filterLabel","legendLabel","STYLE","DOT","showPerspective","showGrid","keepAspectRatio","showShadow","showGrayBottom","showTooltip","verticalRatio","animationInterval","animationPreload","camera","setArmRotation","setArmLength","eye","dataTable","dataPoints","colX","colY","colZ","colValue","colFilter","xMin","xStep","xMax","yMin","yStep","yMax","zMin","zStep","zMax","valueMin","valueMax","xBarWidth","yBarWidth","axisColor","gridColor","dataColor","fill","stroke","strokeWidth","dotSizeRatio","getMouseX","clientX","targetTouches","getMouseY","clientY","Emitter","_setScale","z","xCenter","yCenter","zCenter","setArmLocation","_convert3Dto2D","point3d","translation","_convertPointToTranslation","_convertTranslationToScreen","ax","ay","az","cx","getCameraLocation","cy","cz","sinTx","sin","getCameraRotation","cosTx","cos","sinTy","cosTy","sinTz","cosTz","dx","dy","dz","bx","by","ex","ey","ez","getArmLength","xcenter","frame","canvas","clientWidth","ycenter","_setBackgroundColor","backgroundColor","borderColor","borderWidth","borderStyle","BAR","BARCOLOR","BARSIZE","DOTLINE","DOTCOLOR","DOTSIZE","GRID","LINE","SURFACE","_getStyleNumber","styleName","_determineColumnIndexes","getNumberOfColumns","getNumberOfRows","counter","column","getDistinctValues","distinctValues","getColumnRange","minMax","_dataInitialize","rawData","_onChange","dataFilter","setOnLoadCallback","redraw","withBars","defaultXBarWidth","dataX","defaultYBarWidth","dataY","xRange","defaultXMin","defaultXMax","defaultXStep","yRange","defaultYMin","defaultYMax","defaultYStep","zRange","defaultZMin","defaultZMax","defaultZStep","valueRange","defaultValueMin","defaultValueMax","_getDataPoints","sortNumber","dataMatrix","xIndex","yIndex","trans","screen","bottom","pointRight","pointTop","pointCross","position","noCanvas","fontWeight","padding","innerHTML","onmousedown","_onMouseDown","ontouchstart","_onTouchStart","onmousewheel","_onWheel","ontooltip","_onTooltip","onkeydown","setSize","_resizeCanvas","clientHeight","animationStart","slider","play","animationStop","stop","_resizeCenter","setCameraPosition","horizontal","vertical","distance","getCameraPosition","getArmRotation","_readData","_redrawFilter","animationAutoStart","cameraPosition","styleNumber","tooltip","showAnimationControls","_redrawSlider","_redrawClear","_redrawAxis","_redrawDataGrid","_redrawDataLine","_redrawDataBar","_redrawDataDot","_redrawInfo","_redrawLegend","ctx","getContext","clearRect","widthMin","widthMax","dotSize","lineWidth","font","ymin","ymax","_hsv2rgb","strokeStyle","beginPath","moveTo","lineTo","strokeRect","fillStyle","closePath","gridLineLen","step","start","getCurrent","end","textAlign","textBaseline","fillText","visible","setValues","setPlayInterval","onchange","getIndex","selectValue","setOnChangeCallback","lineStyle","getLabel","getSelectedValue","prettyStep","text","xText","yText","zText","xMin2d","xMax2d","gridLenX","gridLenY","textMargin","armAngle","H","S","V","R","G","B","C","Hi","X","cross","topSideVisible","zAvg","lineJoin","lineCap","transBottom","dist","sortDepth","aDiff","bDiff","crossproduct","crossProduct","_getStrokeWidth","radius","arc","PI","surface","corners","xWidth","yWidth","surfaces","center","avg","transCenter","leftButtonDown","_onMouseUp","which","button","touchDown","startMouseX","startMouseY","startStart","startEnd","startArmRotation","cursor","onmousemove","_onMouseMove","onmouseup","diffX","diffY","horizontalNew","verticalNew","snapAngle","snapValue","parameters","emit","boundingRect","mouseX","mouseY","tooltipTimeout","_hideTooltip","dataPoint","_dataPointFromXY","_showTooltip","ontouchmove","_onTouchMove","ontouchend","_onTouchEnd","wheelDelta","detail","oldLength","newLength","_insideTriangle","triangle","bs","cs","distMax","closestDataPoint","closestDist","triangle1","triangle2","distX","distY","sqrt","line","dot","dom","borderRadius","boxShadow","borderLeft","contentWidth","offsetWidth","contentHeight","offsetHeight","lineHeight","dotWidth","dotHeight","mixin","_callbacks","once","self","removeListener","removeAllListeners","callbacks","cb","listeners","hasListeners","sub","sum","armLocation","armRotation","armLength","cameraLocation","cameraRotation","calculateCameraOrientation","rot","graph","onLoadCallback","loadInBackground","isLoaded","getLoadedProgress","getColumn","getValues","getValue","dataView","progress","prev","bar","MozBorderRadius","slide","onclick","togglePlay","onChangeCallback","playTimeout","playInterval","playLoop","setIndex","playNext","interval","clearInterval","getPlayInterval","setPlayLoop","doLoop","onChange","indexToLeft","startClientX","startSlideX","leftToIndex","_start","_end","_step","precision","_current","setRange","setStep","calculatePrettyStep","log10","log","LN10","step1","step2","step5","toPrecision","getStep","propagating","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","_firstTarget","hammer","events","propagatedHandler","srcEvent","_handled","stopped","stopPropagation","srcStop","bind","firstTarget","elemHammer","_handlers","Manager","PropagatingHammer","assign","wrapper","pointerType","isFirst","handler","eventType","hammers","idx","exportName","setTimeoutContext","bindFn","invokeArrayArg","arg","each","message","deprecationMessage","inherit","child","properties","childP","baseP","_super","boolOrFn","TYPE_FUNCTION","ifUndefined","val1","val2","addEventListeners","splitStr","removeEventListeners","inStr","str","find","inArray","src","findByKey","uniqueArray","results","prefixed","property","prefix","camelProp","VENDOR_PREFIXES","uniqueId","_uniqueId","getWindowForElement","doc","ownerDocument","defaultView","parentWindow","Input","manager","inputTarget","domHandler","ev","enable","init","createInputInstance","Type","inputClass","SUPPORT_POINTER_EVENTS","PointerEventInput","SUPPORT_ONLY_TOUCH","TouchInput","SUPPORT_TOUCH","TouchMouseInput","MouseInput","inputHandler","pointersLen","pointers","changedPointersLen","changedPointers","INPUT_START","isFinal","INPUT_END","INPUT_CANCEL","session","computeInputData","recognize","prevInput","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","getCenter","timeStamp","deltaTime","angle","getAngle","getDistance","computeDeltaXY","offsetDirection","getDirection","deltaX","deltaY","overallVelocity","getVelocity","overallVelocityX","overallVelocityY","getScale","rotation","getRotation","maxPointers","computeIntervalInputData","offsetDelta","prevDelta","velocity","velocityX","velocityY","last","lastInterval","COMPUTE_INTERVAL","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","PROPS_XY","atan2","PROPS_CLIENT_XY","evEl","MOUSE_ELEMENT_EVENTS","evWin","MOUSE_WINDOW_EVENTS","allow","pressed","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","store","pointerEvents","SingleTouchInput","evTarget","SINGLE_TOUCH_TARGET_EVENTS","SINGLE_TOUCH_WINDOW_EVENTS","started","normalizeSingleTouches","all","touches","changed","changedTouches","TOUCH_TARGET_EVENTS","targetIds","getTouches","allTouches","INPUT_MOVE","identifier","changedTargetTouches","touch","mouse","TouchAction","cleanTouchActions","actions","TOUCH_ACTION_NONE","hasPanX","TOUCH_ACTION_PAN_X","hasPanY","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_AUTO","Recognizer","state","STATE_POSSIBLE","simultaneous","requireFail","stateStr","STATE_CANCELLED","STATE_ENDED","STATE_CHANGED","STATE_BEGAN","directionStr","getRecognizerByNameIfManager","otherRecognizer","recognizer","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","recognizers","preset","handlers","touchAction","toggleCssProps","recognizeWith","requireFailure","cssProps","triggerDomEvent","gestureEvent","createEvent","initEvent","gesture","dispatchEvent","TEST_ELEMENT","nextKey","dest","merge","MOBILE_REGEX","INPUT_TYPE_TOUCH","INPUT_TYPE_PEN","INPUT_TYPE_MOUSE","INPUT_TYPE_KINECT","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM",2,3,4,5,"MSPointerEvent","PointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","TOUCH_INPUT_MAP","inputEvent","inputData","isMouse","PREFIXED_TOUCH_ACTION","NATIVE_TOUCH_ACTION","TOUCH_ACTION_COMPUTE","compute","getTouchAction","preventDefaults","prevented","hasNone","isTapPointer","isTapMovement","isTapTouchTime","preventSrc","STATE_RECOGNIZED","STATE_FAILED","dropRecognizeWith","dropRequireFailure","hasRequireFailures","canRecognizeWith","additionalEvent","tryEmit","canEmit","inputDataClone","process","reset","attrTest","optionPointers","isRecognized","directionTest","hasMoved","inOut","validPointers","validMovement","validTime","taps","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","VERSION","domEvents","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","STOP","FORCED_STOP","force","curRecognizer","existing","Tap","Pan","Swipe","Pinch","Rotate","Press","freeGlobal","_exportFunctions","_bound","keydown","keyup","_keys","fromCharCode","down","handleEvent","up","keyCode","bound","shiftKey","bindAll","getKey","unbind","newBindings","Timeline","Graph2d","timeline","Core","DateUtil","Range","TimeStep","components","Item","BackgroundItem","BoxItem","PointItem","RangeItem","BackgroundGroup","Component","CurrentTime","CustomTime","DataAxis","DataScale","GraphGroup","Group","ItemSet","Legend","LineGraph","TimeAxis","_interopRequireDefault","__esModule","default","groups","forthArgument","defaultOptions","autoResize","throttleRedraw","orientation","axis","rtl","maxHeight","minHeight","_create","body","domProps","emitter","hiddenDates","timeAxis","toScreen","_toScreen","toGlobalScreen","_toGlobalScreen","toTime","_toTime","toGlobalTime","_toGlobalTime","range","timeAxis2","currentTime","itemSet","itemsData","groupsData","getEventProperties","oncontextmenu","fitDone","getItemRange","setWindow","animation","fit","setGroups","setItems","_redraw","_Configurator","_Configurator2","_Validator","_Validator2","printStyle","allOptions","configureOptions","_createConfigurator","markDirty","refreshItems","errorFound","validate","selection","getSelection","setSelection","newDataSet","focus","itemData","dataset","getDataRange","_this","minItem","maxItem","factor","lhs","rhs","getStart","getEnd","show","repositionX","startSide","getWidthRight","endSide","getWidthLeft","centerContainer","itemFromTarget","group","groupFromTarget","customTime","customTimeFromTarget","snap","snappedTime","what","foreground","labelSet","groupId","pageX","pageY","_classCallCheck","instance","Constructor","defineProperty","_createClass","defineProperties","descriptor","enumerable","configurable","writable","protoProps","staticProps","_ColorPicker","_ColorPicker2","Configurator","parentModule","defaultContainer","pixelRatio","changedOptions","allowCreation","initialized","popupCounter","showButton","moduleOptions","domElements","popupDiv","popupLimit","popupHistory","colorPicker","_removePopup","_clean","_handleObject","_makeItem","_makeHeader","generateButton","_printOptions","onmouseover","onmouseout","optionsContainer","_push","_showPopupIfNeeded","path","_arguments","_this2","_len","_key","_ret2","div","objectLabel","select","selectedValue","selected","_update","_makeLabel","err","popupString","popupValue","oninput","itemIndex","_setupPopup","_this3","html","hideTimeout","deleteTimeout","_this4","correspondingElement","checkbox","checked","_this5","defaultColor","_showColorPicker","_this6","insertTo","setColor","setUpdateCallback","colorString","setCloseCallback","checkOnly","visibleInSet","subObj","newPath","_getValue","_handleArray","_makeTextInput","_makeCheckbox","draw","physics","solver","enabledPath","enabledValue","_label","error","_makeColorField","_makeDropdown","_makeRange","_constructOptions","optionsObj","pointer","getOptions","hammerUtil","ColorPicker","generated","centerCoordinates","hueCircle","initialColor","previousColor","applied","updateCallback","closeCallback","_bindHammer","_setSize","htmlColors","black","navy","darkblue","mediumblue","darkgreen","teal","darkcyan","deepskyblue","darkturquoise","mediumspringgreen","lime","springgreen","aqua","cyan","midnightblue","dodgerblue","lightseagreen","forestgreen","seagreen","darkslategray","limegreen","mediumseagreen","turquoise","royalblue","steelblue","darkslateblue","mediumturquoise","indigo","darkolivegreen","cadetblue","cornflowerblue","mediumaquamarine","dimgray","slateblue","olivedrab","slategray","lightslategray","mediumslateblue","lawngreen","chartreuse","aquamarine","maroon","purple","olive","gray","skyblue","lightskyblue","blueviolet","darkred","darkmagenta","saddlebrown","darkseagreen","lightgreen","mediumpurple","darkviolet","palegreen","darkorchid","yellowgreen","sienna","brown","darkgray","lightblue","greenyellow","paleturquoise","lightsteelblue","powderblue","firebrick","darkgoldenrod","mediumorchid","rosybrown","darkkhaki","silver","mediumvioletred","indianred","peru","chocolate","tan","lightgrey","palevioletred","thistle","orchid","goldenrod","crimson","gainsboro","plum","burlywood","lightcyan","lavender","darksalmon","violet","palegoldenrod","lightcoral","khaki","aliceblue","honeydew","azure","sandybrown","wheat","beige","whitesmoke","mintcream","ghostwhite","salmon","antiquewhite","linen","lightgoldenrodyellow","oldlace","fuchsia","magenta","deeppink","orangered","tomato","hotpink","coral","darkorange","lightsalmon","orange","lightpink","pink","gold","peachpuff","navajowhite","moccasin","bisque","mistyrose","blanchedalmond","papayawhip","lavenderblush","seashell","cornsilk","lemonchiffon","floralwhite","snow","yellow","lightyellow","ivory","white","setInitial","htmlColor","_isColorString","rgbaArray","_rgbaArray","rgbObj","alpha","_setColor","display","_generateHueCircle","storePrevious","_hide","_updatePicker","alert","angleConvert","colorPickerSelector","colorPickerCanvas","pixelRation","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","putImageData","circle","brightnessRange","opacityRange","initialColorDiv","newColorDiv","colorPickerDiv","opacityDiv","brightnessDiv","arrowDiv","_setOpacity","_setBrightness","brightnessLabel","opacityLabel","cancelButton","applyButton","_apply","saveButton","_save","loadButton","_loadLast","drag","pinch","onTouch","_moveSelector","sat","hfac","sfac","fillRect","getImageData","centerY","centerX","newTop","newLeft","onRelease","offTouch","offRelease","disablePreventDefaultVertically","pinchRecognizer","Validator","referenceOptions","subObject","usedOptions","check","__any__","getSuggestion","__type__","checkFields","referenceOption","refOptionObj","optionType","refOptionType","print","printLocation","localSearch","findInOptions","globalSearch","localSearchThreshold","globalSearchThreshold","indexMatch","closestMatch","recursive","closestMatchPath","lowerCaseOption","op","levenshteinDistance","_j","_j2","matrix","deltaDifference","scaleOffset","startToFront","endToFront","moveable","zoomable","zoomMin","zoomMax","animationTimer","_onDragStart","_onDrag","_onDragEnd","_onMouseWheel","_onTouch","_onPinch","validateDirection","byUser","finalStart","finalEnd","_cancelAnimation","initStart","initEnd","easingName","easingFunction","initTime","anyChanged","dragging","ease","done","_applyRange","updateHiddenDates","newStart","newEnd","getRange","conversion","totalHidden","previousDelta","_isInsideRange","allowDragging","getHiddenDurationBetween","diffRange","safeStart","snapAwayFromHidden","safeEnd","startDate","endDate","zoomKey","getPointer","pointerDate","_pointerToDate","zoom","centerDate","hiddenDuration","hiddenDurationBefore","getHiddenDurationBefore","hiddenDurationAfter","move","_isResized","resized","_previousWidth","_previousHeight","convertHiddenOptions","repeat","dateItem","totalRange","pixelTime","runUntil","dayOffset","removeDuplicates","startHidden","isHidden","endHidden","rangeStart","rangeEnd","hidden","safeDates","printDates","stepOverHiddenDates","timeStep","previousTime","stepInHidden","currentValue","current","switchedYear","switchedMonth","switchedDay","correctTimeForHidden","totalDuration","partialDuration","accumulatedHiddenDuration","getAccumulatedHiddenDuration","newTime","timeOffset","requiredDuration","previousPoint","correctionEnabled","Activator","onMouseWheel","isActive","backgroundVertical","backgroundHorizontal","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","initialDrawDone","_redrawTimer","scrollTop","scrollTopMin","customTimes","redrawCount","contentContainer","drawPoints","onRender","clickToUse","activator","_initAutoResize","component","configurator","configure","appliedOptions","setModuleOptions","_origRedraw","active","_stopAutoResize","setCustomTime","getCustomTime","setCustomTimeTitle","title","setCustomTitle","addCustomTime","timestamp","removeCustomTime","getVisibleItems","getWindow","borderRootHeight","borderRootWidth","autoHeight","containerHeight","centerWidth","_updateScrollTop","visibilityTop","visibilityBottom","visibility","contentsOverflow","MAX_REDRAW","repaint","setCurrentTime","getCurrentTime","_startAutoResize","_onResize","lastWidth","lastHeight","watchTimer","setInterval","initialScrollTop","oldScrollTop","_getScrollTop","newScrollTop","_setScrollTop","align","groupOrderSwap","fromGroup","toGroup","targetOrder","groupOrder","selectable","multiselect","itemsAlwaysDraggable","editable","updateTime","updateGroup","groupEditable","onAdd","onUpdate","onMove","onRemove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup","itemOptions","itemListeners","_onAdd","_onUpdate","_onRemove","groupListeners","_onAddGroups","_onUpdateGroups","_onRemoveGroups","groupIds","stackDirty","touchParams","groupTouchParams","UNGROUPED","BACKGROUND","box","_updateUngrouped","backgroundGroup","_onSelectItem","_onMultiSelectItem","_onAddItem","groupHammer","_onGroupDragStart","_onGroupDrag","_onGroupDragEnd","addCallback","dirty","displayed","hide","unselect","rawVisibleItems","visibleItems","_deselect","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","restack","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","groupResized","firstGroupIndex","firstGroupId","ungrouped","_getGroupId","getLabelSet","oldItemsData","getItems","_order","getGroups","removeItem","_getType","_removeItem","groupData","groupOptions","oldGroupId","oldSubGroupId","subgroup","oldGroup","_constructByEndArray","endArray","dragLeftItem","dragRightItem","itemProps","_getGroupIndex","initialX","dragLeft","_cloneItemData","dragRight","selectedItem","baseGroupIndex","itemsToDrag","groupIndex","groupOffset","ctrlKey","metaKey","_onDragStartAddItem","xAbs","newItem","offsetLeft","updateGroupAllowed","newGroupBase","initial","updateTimeAllowed","initialEnd","initialStart","newOffset","_moveToGroup","originalOrder","movingUp","targetGroupTop","draggedGroupHeight","targetGroupHeight","targetGroup","draggedGroup","newOrder","origOrder","draggedId","numGroups","curPos","orgOffset","slippedPosition","switchGroup","shouldBeGroup","switchGroupId","oldSelection","newSelection","newItemData","itemGroup","lastSelectedGroup","multiselectPerGroup","_getItemRange","_item","itemSetFromTarget","minimumStep","autoScale","FORMAT","minorLabels","majorLabels","setMoment","setFormat","setMinimumStep","roundToMinor","hasNext","setScale","setAutoScale","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","isMajor","getLabelMinor","getLabelMajor","getClassName","even","today","currentWeek","currentMonth","currentYear","subgroups","subgroupIndex","subgroupOrderer","subgroupOrder","byStart","byEnd","checkRangedItems","inner","marker","Element","getLabelWidth","markerHeight","lastMarkerHeight","_calculateSubGroupHeights","limitSize","customOrderedItems","_updateVisibleItems","nostack","_calculateHeight","offsetTop","repositionY","resetSubgroups","setParent","orderSubgroups","_checkIfVisible","sortArray","sortField","removeFromDataSet","startArray","orderByStart","orderByEnd","oldVisibleItems","visibleItemsLookup","lowerBound","upperBound","searchFunction","_checkIfVisibleWithReference","initialPosByStart","_traceVisible","initialPosByEnd","initialPos","breakCondition","isVisible","EPSILON","aTime","bTime","iMax","collidingItem","jj","collision","baseClassName","_updateContents","_updateTitle","_updateDataAttributes","_updateStyle","getComputedStyle","maxWidth","_repaintDeleteButton","_repaintDragLeft","_repaintDragRight","contentStartPosition","parentWidth","boxWidth","groupChanged","deleteButton","template","_contentToString","removeAttribute","dataAttributes","attributes","setAttribute","outerHTML","itemSetHeight","marginLeft","marginRight","onTop","itemSubgroup","totalHeight","newHeight","lines","majorTexts","minorTexts","lineTop","showMinorLabels","showMajorLabels","maxMinorChars","parentChanged","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineHeight","minorLineWidth","majorLineHeight","majorLineWidth","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","timeLabelsize","minorCharWidth","xNext","nextIsMajor","prevWidth","labelMinor","xFirstMajorLabel","MAX","showMinorGrid","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","warnedForOverflow","leftTime","leftText","widthText","majorCharWidth","pop","createTextNode","childNodes","nodeValue","measureCharMinor","measureCharMajor","overlay","_onTapOverlay","onClick","_hasParent","deactivate","escListener","activate","eventParams","warned","substring","showCurrentTime","currentTimeTimer","boolean","any","function","null","groupsDraggable","linegraph","initialLoad","getLegend","isGroupVisible","yAxisLeft","yAxisRight","legendLeft","legendRight","screenToValue","yAxisOrientation","defaultGroup","sampling","graphHeight","shaded","barChart","sideBySide","interpolation","parametrization","dataAxis","legend","abortedGraphUpdate","updateSVGheight","updateSVGheightOnResize","forceGraphUpdate","lastStart","svgElements","groupsUsingDefaultStyles","svg","framework","Bars","Lines","Points","_removeGroup","_updateAllGroupData","removeGroup","_updateGroup","addGroup","groupsContent","groupCounts","extended","orginalY","_updateGraph","rangePerPixelInv","_getSortedGroupIds","grouplist","zIndex","bz","groupRanges","changeCalled","minDate","maxDate","_getRelevantData","_applySampling","_convertXcoordinates","_getYRanges","_updateYAxis","below","excludeFromStacking","_stack","_convertYcoordinates","calcPath","subGroupId","drawShading","subData","subPrevPoint","subNextPoint","dateComparator","first","dataContainer","increment","amountOfPoints","xDistance","pointsPerPixel","sampledData","combinedDataLeft","combinedDataRight","getYRange","getStackedYRange","minVal","maxVal","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","ignore","_toggleAxisVisiblity","drawIcons","master","masterAxis","lineOffset","tempGroups","axisUsed","datapoints","screen_x","screen_y","svgHeight","convertValue","setZeroPosition","linegraphOptions","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","alignZeros","linegraphSVG","DOMelements","labels","conversionFactor","minWidth","stepPixels","zeroCrossing","amountOfSteps","iconsRemoved","amountOfGroups","lineContainer","graphOptions","_redrawGroupIcons","iconHeight","iconOffset","groupArray","_cleanupIcons","activeGroups","_redrawLabels","_redrawTitle","customRange","autoScaleEnd","autoScaleStart","followScale","maxLabelSize","getLines","major","_redrawLabel","_redrawLine","titleWidth","titleCharHeight","characterHeight","largestWidth","textMinor","textMajor","textTitle","measureCharTitle","titleCharWidth","zeroAlign","formattingFunction","majorSteps","minorSteps","customLines","minorStepIdx","magnitudefactor","determineScale","rounded","setCharHeight","setHeight","minimumStepValue","orderOfMagnitude","solutionFound","stepSize","is_major","getFirstMajor","majorStep","formatValue","bottomOffset","oldStepIdx","oldStart","oldEnd","increaseMagnitude","decreaseMagnitude","otherZero","otherStep","newRange","myOriginalZero","majorOffset","zeroOffset","pixels","usingDefaultStyle","zeroPosition","drawIcon","icon","Bargraph","fillHeight","outline","barWidth","originalWidth","bar1Height","bar2Height","processedGroupData","coreDistance","drawData","combinedData","intersections","barPoints","_getDataIntersections","heightOffset","_getSafeDrawData","amount","resolved","accumulatedNegative","accumulatedPositive","pointData","groupLabel","_getStackedYRange","xpos","getGroupTemplate","callbackResult","getCallback","Line","_catmullRom","_linear","fillPath","pathArray","subPathArray","dFill","zero","serializePath","inverse","_catmullRomUniform","p0","bp1","bp2","normalization","d1","d2","d3","A","N","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","side","iconSize","iconSpacing","excludeFromLegend","textArea","scrollableHeight","drawLegendIcons","paddingTop","Network","network","Images","dotparser","gephiParser","convertDot","DOTToGraph","convertGephi","parseGephi","nodes","nodeIndices","edges","edgeIndices","eventListeners","onTap","onDoubleTap","onHold","onDragStart","onDrag","onDragEnd","onPinch","onMouseMove","onContext","functions","createNode","createEdge","view","bindEventListeners","images","_Images2","_Groups2","_Canvas2","selectionHandler","_SelectionHandler2","interactionHandler","_InteractionHandler2","_View2","renderer","_CanvasRenderer2","_PhysicsEngine2","layoutEngine","_LayoutEngine2","clustering","_Clustering2","manipulation","_ManipulationSystem2","nodesHandler","_NodesHandler2","edgesHandler","_EdgesHandler2","_KamadaKawai2","_Images","_Groups","_NodesHandler","_EdgesHandler","_PhysicsEngine","_Clustering","_CanvasRenderer","_Canvas","_View","_InteractionHandler","_SelectionHandler","_LayoutEngine","_ManipulationSystem","_KamadaKawai","layout","interaction","networkOptions","_updateVisibleIndices","nodeId","edgeId","_updateValueRange","unselectAll","dotData","gephi","gephiData","valueTotal","setValueRange","canvasToDOM","DOMtoCanvas","findNode","isCluster","openCluster","cluster","getNodesInCluster","clusterByConnection","clusterByHubsize","clusterOutliers","getSeed","enableEditMode","disableEditMode","addNodeMode","editNode","editNodeMode","addEdgeMode","editEdgeMode","deleteSelected","getPositions","storePositions","moveNode","getBoundingBox","getConnectedNodes","objectId","getConnectedEdges","startSimulation","stopSimulation","stabilize","getSelectedNodes","getSelectedEdges","getNodeAt","getEdgeAt","edge","selectNodes","selectEdges","getViewPosition","releaseNode","getOptionsFromConfigurator","imageBroken","url","imageToCache","brokenUrl","imageToLoadBrokenUrlOn","onerror","_addImageToCache","Image","imageToRedrawWith","cachedImage","img","onload","_redrawWithImage","_tryloadBrokenUrl","Groups","defaultIndex","groupsArray","defaultGroups","useDefaultGroups","optionFields","groupName","groupname","_index","_Node","_Node2","_Label","_Label2","NodesHandler","nodesListeners","borderWidthSelected","brokenImage","fixed","face","strokeColor","image","labelHighlightBold","level","mass","scaling","maxVisible","drawThreshold","customScalingFunction","shadow","shape","shapeProperties","borderDashes","useImageSize","useBorderWithImage","parseOptions","updateShape","updateLabelModule","_reset","_nodeId2","doNotEmit","oldNodesData","newNodes","positionInitially","changedData","dataChanged","constructorClass","clearPositions","dataArray","_node","_node2","boundingBox","nodeList","nodeObj","toId","fromId","edgeList","_Box","_Box2","_Circle","_Circle2","_CircularImage","_CircularImage2","_Database","_Database2","_Diamond","_Diamond2","_Dot","_Dot2","_Ellipse","_Ellipse2","_Icon","_Icon2","_Image","_Image2","_Square","_Square2","_Star","_Star2","_Text","_Text2","_Triangle","_Triangle2","_TriangleDown","_TriangleDown2","Node","imagelist","baseSize","baseFontSize","predefinedPosition","labelModule","currentShape","groupObj","imageObj","load","distanceToBorder","sizeDiff","fontDiff","updateBoundingBox","resize","parentOptions","newOptions","parsedColor","_slicedToArray","sliceIterator","_arr","_n","_e","_s","Label","edgelabel","pointToSelf","fontOptions","yLine","isEdgeLabel","nodeOptions","labelDirty","baseline","viewFontSize","calculateLabelSize","_drawBackground","_drawText","lineMargin","fontSize","_getColor2","_getColor","_getColor3","fontColor","_setAlignment2","_setAlignment","_setAlignment3","lineCount","strokeText","_processLabel","measureText","newOptionsArray","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","_NodeBase2","_NodeBase3","Box","_NodeBase","getPrototypeOf","textSize","getTextSize","selectionLineWidth","roundRect","enableShadow","disableShadow","save","enableBorderDashes","disableBorderDashes","restore","NodeBase","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","setLineDash","dashes","_CircleImageBase2","_CircleImageBase3","Circle","_CircleImageBase","diameter","_drawRawCircle","CircleImageBase","labelOffset","imageLoaded","ratio","neutralborderWidth","globalAlpha","can2","ctx2","drawImage","iterations","labelDimensions","CircularImage","_swapToImageResizeWhenImageLoaded","_resizeImage","clip","_drawImageAtPosition","_drawImageLabel","Database","database","_distanceToBorder","_ShapeBase2","_ShapeBase3","Diamond","_ShapeBase","_resizeShape","_drawShape","ShapeBase","sizeMultiplier","Dot","Ellipse","ellipse","Icon","_icon","iconTextSpacing","Square","Star","Text","Triangle","TriangleDown","_Edge","_Edge2","EdgesHandler","edgesListeners","arrows","scaleFactor","arrowStrikethrough","hoverWidth","selectionWidth","selfReferenceSize","smooth","forceDirection","roundness","emitChange","edgeData","edgeOptions","reconnectEdges","markAllEdgesAsDirty","updateEdgeType","_edgeId","oldEdgesData","edgesData","oldEdge","disconnect","showInternalIds","connect","cleanup","edgeType","colorDirty","_CubicBezierEdge","_CubicBezierEdge2","_BezierEdgeDynamic","_BezierEdgeDynamic2","_BezierEdgeStatic","_BezierEdgeStatic2","_StraightEdge","_StraightEdge2","Edge","baseWidth","connected","_setInteractionWidths","changeInType","attachEdge","detachEdge","widthDiff","viaNode","getViaNode","arrowData","fromPoint","toPoint","getArrowData","core","drawLine","drawArrows","drawLabel","drawArrowHead","node1","node2","getPoint","translate","_rotateForLabelAlignment","_pointOnCircle","xFrom","yFrom","xTo","yTo","xObj","yObj","getDistanceToEdge","angleInDegrees","rotate","percentage","colorsDefined","_CubicBezierEdgeBase2","_CubicBezierEdgeBase3","CubicBezierEdge","_CubicBezierEdgeBase","viaNodes","via1","via2","bezierCurveTo","x1","y1","x2","y2","_getViaCoordinates","nearNode","_findBorderPositionBezier","x3","y3","_ref","_ref2","_getDistanceToBezierEdge","_ref3","_ref4","vec","_BezierEdgeBase2","_BezierEdgeBase3","CubicBezierEdgeBase","_BezierEdgeBase","minDistance","lastX","lastY","_getDistanceToLine","_EdgeBase2","_EdgeBase3","BezierEdgeBase","_EdgeBase","distanceToPoint","difference","via","EdgeBase","getColor","getLineWidth","_drawDashedLine","_drawLine","_line","_getCircleData2","_getCircleData","_getCircleData3","_circle","pattern","lineDashOffset","_getCircleData4","_getCircleData5","dashedLine","_getCircleData6","_getCircleData7","_x","_y","_radius","_findBorderPosition","_findBorderPositionCircle","_getCircleData8","_getCircleData9","colorOptions","grd","createLinearGradient","fromColor","toColor","addColorStop","_getDistanceToEdge","_getCircleData10","_getCircleData11","px","py","something","u","arrowPoint","guideOffset","findBorderPosition","guidePos","_getCircleData12","_getCircleData13","xi","yi","arrowCore","arrow","BezierEdgeDynamic","_boundFunction","positionBezierNode","physicsChange","setupSupportNode","parentEdgeId","quadraticCurveTo","BezierEdgeStatic","xVia","yVia","pi","originalAngle","myAngle","_pi","_originalAngle","_myAngle","StraightEdge","edgeSegmentLength","toBorderDist","toBorderPoint","borderPos","_BarnesHutSolver","_BarnesHutSolver2","_RepulsionSolver","_RepulsionSolver2","_HierarchicalRepulsionSolver","_HierarchicalRepulsionSolver2","_SpringSolver","_SpringSolver2","_HierarchicalSpringSolver","_HierarchicalSpringSolver2","_CentralGravitySolver","_CentralGravitySolver2","_FA2BasedRepulsionSolver","_FA2BasedRepulsionSolver2","_FA2BasedCentralGravitySolver","_FA2BasedCentralGravitySolver2","PhysicsEngine","physicsBody","physicsNodeIndices","physicsEdgeIndices","forces","velocities","physicsEnabled","simulationInterval","requiresTimeout","previousStates","referenceState","freezeCache","renderTimer","adaptiveTimestep","adaptiveTimestepEnabled","adaptiveCounter","adaptiveInterval","stabilized","startedStabilization","stabilizationIterations","ready","barnesHut","theta","gravitationalConstant","centralGravity","springLength","springConstant","damping","avoidOverlap","forceAtlas2Based","repulsion","nodeDistance","hierarchicalRepulsion","maxVelocity","minVelocity","stabilization","updateInterval","onlyDynamicEdges","timestep","layoutFailed","initPhysics","updatePhysicsData","nodesSolver","edgesSolver","gravitySolver","modelOptions","viewFunction","simulationStep","_emitStabilized","startTime","physicsTick","physicsTime","runDoubleSpeed","amountOfIterations","calculateForces","moveNodes","revert","_evaluateStepQuality","nodeIds","positions","vx","vy","dpos","reference","maxNodeVelocity","averageNodeVelocity","velocityAdaptiveThreshold","nodeVelocity","_performStep","totalVelocity","solve","targetIterations","_freezeNodes","_stabilizationBatch","_finalizeStabilization","_restoreFrozenNodes","colorFactor","forceSize","arrowSize","BarnesHutSolver","barnesHutTree","randomSeed","thetaInversed","overlapAvoidanceFactor","nodeCount","_formBarnesHutTree","_getForceContribution","NW","NE","SW","SE","parentBranch","childrenCount","centerOfMass","calcSize","_calculateForces","gravityForce","fx","fy","minX","minY","maxX","maxY","minimumTreeSize","rootSize","halfRootSize","_splitBranch","_placeInTree","totalMass","totalMassInv","biggestSize","skipMassUpdate","_updateBranchMass","_placeInRegion","region","seededRandom","containedNode","_insertRegion","childSize","_drawBranch","branch","RepulsionSolver","repulsingForce","HierarchicalRepulsionSolver","steepness","SpringSolver","edgeLength","node3","_calculateSpringForce","springForce","HierarchicalSpringSolver","springFx","springFy","_i2","totalFx","totalFy","_i3","correctionFx","correctionFy","_i4","_nodeId3","CentralGravitySolver","_BarnesHutSolver3","ForceAtlas2BasedRepulsionSolver","degree","_CentralGravitySolver3","ForceAtlas2BasedCentralGravitySolver","_NetworkUtil","_NetworkUtil2","_Cluster","_Cluster2","ClusterEngine","clusteredNodes","clusteredEdges","hubsize","_getHubSize","_checkOptions","nodesToCluster","refreshData","joinCondition","childNodesObj","childEdgesObj","clonedOptions","cloneOptions","_cluster","edgeCount","clusters","usedNodes","relevantEdgeCount","gatheringSuccessful","childNodeId","_getConnectedId","clusterByEdgeCount","clusterNodeProperties","parentNodeId","parentClonedOptions","childClonedOptions","clusterEdgeProperties","childNode","otherNodeId","childKeys","createEdges","_edge","newEdge","clusteringEdgeReplacingId","_backupEdgeOptions","processProperties","childNodesOptions","childEdgesOptions","_clonedOptions","clusterId","_getClusterPosition","clusterNode","containedNodes","containedEdges","_createClusterEdges","originalOptions","clusterNodeId","releaseFunction","clusterPosition","newPositions","_containedNode","_nodeId4","_containedNode2","_nodeId5","_containedNode3","edgesToBeDeleted","otherCluster","transferEdge","replacedEdge","_restoreEdge","nodesArray","reverse","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","hubThreshold","NetworkUtil","allNodes","specificNodes","amountOfConnections","_Node3","Cluster","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","CanvasRenderer","redrawRequested","renderingActive","renderRequests","allowRedraw","hideEdgesOnDrag","hideNodesOnDrag","_determineBrowserMethod","_resizeNodes","_requestRedraw","_startRendering","cancelAnimationFrame","_renderStep","_drawEdges","_drawNodes","alwaysShow","topLeft","bottomRight","viewableArea","isSelected","isBoundingBoxOverlappingWith","browserType","Canvas","resizeTimer","resizeFunction","cameraState","hammerFrame","_cleanUp","previousWidth","previousHeight","widthRatio","heightRatio","newScale","currentViewCenter","distanceFromCenter","tabIndex","_prepareValue","emitEvent","oldWidth","oldHeight","previousRatio","_getCameraState","_setCameraState","_XconvertCanvasToDOM","_YconvertCanvasToDOM","_XconvertDOMtoCanvas","_YconvertDOMtoCanvas","View","animationSpeed","renderRefreshRate","animationEasingFunction","easingTime","sourceScale","targetScale","sourceTranslation","targetTranslation","lockedOnNodeId","lockedOnNodeOffset","touchTime","initialZoom","zoomLevel","positionDefined","numberOfNodes","yDistance","xZoomLevel","yZoomLevel","findCenter","animationOptions","nodePosition","lockedOnNode","animateView","locked","_transitionRedraw","viewCenter","_lockedRedraw","finished","_NavigationHandler","_NavigationHandler2","_Popup","_Popup2","InteractionHandler","navigationHandler","popup","popupObj","popupTimer","dragNodes","dragView","keyboard","speed","bindToWindow","navigationButtons","tooltipDelay","zoomView","pinched","checkSelectionChanges","_generateClickEvent","previouslySelectedEdgeCount","_getSelectedEdgeCount","previouslySelectedNodeCount","_getSelectedNodeCount","previousSelection","selectAdditionalOnPoint","selectOnPoint","selectedEdgesCount","selectedNodesCount","currentSelection","_determineIfDifferent2","_determineIfDifferent","nodesChanged","edgesChanged","nodeSelected","selectObject","selectionObj","xFixed","yFixed","scaleOld","preScaleDragPointer","scaleFrac","tx","ty","postScaleDragPointer","popupVisible","_checkHidePopup","setPosition","_checkShowPopup","hoverObject","pointerObj","previousPopupObjId","nodeUnderCursor","popupType","overlappingNodes","isOverlappingWith","getTitle","overlappingEdges","popupTargetType","popupTargetId","setText","_pointerToPositionObject","stillOnObj","overNode","NavigationHandler","iconsCreated","navigationHammers","boundFunctions","activated","configureKeyboardBindings","loadNavigationElements","cleanNavigation","navigationDOM","navigationDivs","navigationDivActions","_fit","bindToRedraw","_stopMovement","boundAction","unbindFromRedraw","Popup","doShow","SelectionHandler","hoverObj","selectConnectedEdges","hoverConnectedEdges","updateSelection","selectionChanged","deselectObject","emptySelection","DOM","highlightEdges","_selectConnectedEdges","_addToSelection","_removeFromSelection","canvasPos","returnNode","positionObject","_getAllNodesOverlappingWith","_getEdgesOverlappingWith","returnEdge","_getAllEdgesOverlappingWith","_unselectConnectedEdges","clusterSize","_addToHover","hoverChanged","blurObject","_hoverConnectedEdges","edgeIds","idArray","RangeError","LayoutEngine","initialRandomSeed","setPhysics","optionsBackup","improvedLayout","hierarchical","levelSeparation","nodeSpacing","treeSpacing","blockShifting","edgeMinimization","parentCentralization","sortMethod","setupHierarchicalLayout","layoutNetwork","prevHierarchicalState","adaptAllOptionsForHierarchicalLayout","MAX_LEVELS","clusterThreshold","startLength","before","clusterBridges","after","_declusterAll","info","kamadaKawai","_shiftToCenter","getRangeCore","clustersPresent","definedLevel","definedPositions","undefinedLevel","hierarchicalLevels","lastNodeOnLevel","hierarchicalChildrenReference","hierarchicalParentReference","hierarchicalTrees","treeIndex","distributionOrdering","distributionIndex","distributionOrderingPresence","_determineLevelsByHubsize","_determineLevelsDirected","_determineLevelsCustomCallback","distribution","_getDistribution","_generateMap","_placeNodesByHierarchy","_condenseHierarchy","stillShifting","branches","shiftTrees","treeSizes","getTreeSizes","shiftTree","_getPositionForHierarchy","_setPositionForHierarchy","getTreeSize","treeWidths","getBranchNodes","getBranchBoundary","branchMap","maxLevel","minSpace","maxSpace","branchNode","_getSpaceAroundNode2","_getSpaceAroundNode","_getSpaceAroundNode3","minSpaceNode","maxSpaceNode","getMaxLevel","getCollisionLevel","maxLevel1","maxLevel2","hasSameParent","parents1","parents2","shiftElementsCloser","levels","centerParents","levelNodes","branchShiftCallback","centerParent","diffAbs","branchNodes1","branchNodes2","_getBranchBoundary","_getBranchBoundary2","max1","_getBranchBoundary3","_getBranchBoundary4","min2","minSpace2","diffBranch","_shiftBlock","_centerParent","minimizeEdgeLength","allEdges","nodeLevel","C2","referenceNodes","aboveEdges","otherNode","getFx","getDFx","getGuess","guess","guessMap","dfx","moveBranch","branchNodes","_getBranchBoundary5","_getBranchBoundary6","minSpaceBranch","maxSpaceBranch","branchOffset","_getSpaceAroundNode4","_getSpaceAroundNode5","newPosition","minimizeEdgeLengthBottomUp","shiftBranchesCloserBottomUp","centerAllParents","centerAllParentsBottomUp","useMap","prevNode","prevPos","nextNode","nextPos","parents","parentId","minPos","maxPos","_i5","_getSpaceAroundNode6","_getSpaceAroundNode7","positionedNodes","nodeArray","_indexArrayToNodes","_sortNodeArray","handledNodeCount","_validataPositionAndContinue","parentLevel","_i6","childNodeLevel","_i7","previousPos","sharedParent","_findCommonParent","withChild","_placeBranchNodes","hubSize","levelDownstream","nodeA","nodeB","_crawlNetwork","minLevel","customCallback","levelByDirection","levelA","_setMinLevelToZero","fillInRelations","_this7","startingNodeId","crawler","tree","childA","childB","_this8","iterateParents","findParent","foundParent","doNotUpdate","ManipulationSystem","editMode","manipulationDiv","editModeDiv","closeDiv","manipulationHammers","temporaryUIFunctions","temporaryEventFunctions","temporaryIds","guiEnabled","inMode","selectedControlNode","initiallyActive","addNode","addEdge","editEdge","deleteNode","deleteEdge","controlNodeStyle","_restore","_setup","showManipulatorToolbar","_createEditButton","manipulationDOM","selectedNodeCount","selectedEdgeCount","selectedTotalCount","needSeperator","_createAddNodeButton","_createSeperator","_createAddEdgeButton","_createEditNodeButton","_createEditEdgeButton","_createDeleteButton","_bindHammerToDiv","toggleEditMode","_temporaryBindEvent","_createBackButton","_createDescription","_performAddNode","_getSelectedNode","finalizedData","_temporaryBindUI","_handleConnect","_finishConnect","_dragControlNode","edgeBeingEditedId","controlNodeFrom","_getNewTargetNode","controlNodeTo","_controlNodeTouch","_controlNodeDragStart","_controlNodeDrag","_controlNodeDragEnd","findBorderPositions","selectedNodes","selectedEdges","deleteFunction","_createWrappers","_removeManipulationDOM","_createButton","_cleanManipulatorHammers","_cleanupTemporaryNodesAndEdges","_unbindTemporaryUIs","_unbindTemporaryEvents","deleteBtnClass","labelClassName","newFunction","boundFunction","UIfunctionName","functionName","eventName","domElement","indexTempEdge","indexTempNode","lastTouch","fromSelect","toSelect","overlappingNodeIds","_performEditEdge","targetNode","connectionEdge","connectFromId","_performAddEdge","clickData","defaultData","sourceNodeId","targetNodeId","_FloydWarshall","_FloydWarshall2","KamadaKawai","edgeStrength","distanceSolver","edgesArray","ignoreClusters","D_matrix","getDistances","_createL_matrix","_createK_matrix","innerThreshold","maxInnerIterations","maxEnergy","highE_nodeId","dE_dx","dE_dy","delta_m","subIterations","_getHighestEnergyNode2","_getHighestEnergyNode","_getHighestEnergyNode3","_moveNode","_getEnergy2","_getEnergy","_getEnergy3","maxEnergyNodeId","dE_dx_max","dE_dy_max","nodeIdx","_getEnergy4","_getEnergy5","x_m","y_m","iIdx","x_i","y_i","denominator","K_matrix","L_matrix","d2E_dx2","d2E_dxdy","d2E_dy2","FloydWarshall","CanvasRenderingContext2D","square","s2","ir","triangleDown","star","diamond","r2d","kappa","ox","oy","xe","ye","xm","ym","wEllipse","hEllipse","ymb","yeb","xt","yt","xl","yl","xr","yr","patternLength","slope","distRemaining","patternIndex","dashLength","parseDOT","parseGraph","nextPreview","isAlphaNumeric","regexAlphaNumeric","setValue","graphs","attr","getToken","tokenType","TOKENTYPE","NULL","isComment","DELIMITER","c2","DELIMITERS","IDENTIFIER","newSyntaxError","UNKNOWN","chop","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","maxLength","forEach2","elem1","elem2","setProp","convertAttr","mapping","visProp","visPropI","graphData","dotNode","graphNode","NODE_ATTR_MAPPING","convertEdge","dotEdge","graphEdge","EDGE_ATTR_MAPPING","subEdge","fontsize","fontcolor","labelfontcolor","fontname","fillcolor","labeltooltip","{","}","[","]",";","=",",","->","--","gephiJSON","inheritColor","gEdges","gNodes","gEdge","gNode","edit","del","back","addDescription","edgeDescription","editEdgeDescription","createEdgeError","deleteClusterError","editClusterError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,cAEA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,GACe,gBAAZC,SACdA,Q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vis.map"}
\ No newline at end of file
--- /dev/null
+.vis-background,.vis-labelset,.vis-timeline{overflow:hidden}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}.vis-panel,.vis-timeline{padding:0;box-sizing:border-box}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380', GradientType=0 );box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8', GradientType=0 )}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}.vis-timeline{position:relative;border:1px solid #bfbfbf;margin:0}.vis-panel{position:absolute;margin:0}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-itemset,.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label.draggable{cursor:pointer}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-itemset{padding:0;margin:0}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-item{position:absolute;color:#1A1A1A;border-color:#97B0F8;border-width:1px;background-color:#D5DDF6;display:inline-block}.vis-item.vis-point.vis-selected,.vis-item.vis-selected{background-color:#FFF785}.vis-item.vis-selected{border-color:#FFC200;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item .vis-delete,.vis-item .vis-delete-rtl{background:url(img/timeline/delete.png) center no-repeat;height:24px;top:-4px;cursor:pointer}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-delete{position:absolute;width:24px;right:-24px}.vis-item .vis-delete-rtl{position:absolute;width:24px;left:-24px}.vis-item.vis-range .vis-drag-left{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-time-axis{position:relative;overflow:hidden}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-current-time{background-color:#FF7F6E;width:2px;z-index:1}.vis-custom-time{background-color:#6E94FF;width:2px;cursor:move;z-index:1}div.vis-network div.vis-close,div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-khtml-user-select:none}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}div.vis-network div.vis-manipulation{border-width:0;border-bottom:1px;border-style:solid;border-color:#d6d9d8;background:#fff;background:-moz-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(48%,#fcfcfc),color-stop(50%,#fafafa),color-stop(100%,#fcfcfc));background:-webkit-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-o-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-ms-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:linear-gradient(to bottom,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc', GradientType=0 );padding-top:4px;position:absolute;left:0;top:0;width:100%;height:28px}div.vis-network div.vis-edit-mode{position:absolute;left:0;top:5px;height:30px}div.vis-network div.vis-close{position:absolute;right:0;top:0;width:30px;height:30px;background-position:20px 3px;background-repeat:no-repeat;background-image:url(img/network/cross.png);user-select:none}div.vis-network div.vis-close:hover{opacity:.6}div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{float:left;font-family:verdana;font-size:12px;-moz-border-radius:15px;border-radius:15px;display:inline-block;background-position:0 0;background-repeat:no-repeat;height:24px;margin-left:10px;padding:0 8px;user-select:none}div.vis-network div.vis-manipulation div.vis-button:hover{box-shadow:1px 1px 8px rgba(0,0,0,.2)}div.vis-network div.vis-manipulation div.vis-button:active{box-shadow:1px 1px 8px rgba(0,0,0,.5)}div.vis-network div.vis-manipulation div.vis-button.vis-back{background-image:url(img/network/backIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-none:hover{box-shadow:1px 1px 8px transparent;cursor:default}div.vis-network div.vis-manipulation div.vis-button.vis-none:active{box-shadow:1px 1px 8px transparent}div.vis-network div.vis-manipulation div.vis-button.vis-none{padding:0}div.vis-network div.vis-manipulation div.notification{margin:2px;font-weight:700}div.vis-network div.vis-manipulation div.vis-button.vis-add{background-image:url(img/network/addNodeIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit,div.vis-network div.vis-manipulation div.vis-button.vis-edit{background-image:url(img/network/editIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode{background-color:#fcfcfc;border:1px solid #ccc}div.vis-network div.vis-manipulation div.vis-button.vis-connect{background-image:url(img/network/connectIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-delete{background-image:url(img/network/deleteIcon.png)}div.vis-network div.vis-edit-mode div.vis-label,div.vis-network div.vis-manipulation div.vis-label{margin:0 0 0 23px;line-height:25px}div.vis-network div.vis-manipulation div.vis-separator-line{float:left;display:inline-block;width:1px;height:21px;background-color:#bdbdbd;margin:0 7px 0 15px}div.vis-network-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(img/network/upArrow.png);bottom:50px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-down{background-image:url(img/network/downArrow.png);bottom:10px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-left{background-image:url(img/network/leftArrow.png);bottom:10px;left:15px}div.vis-network div.vis-navigation div.vis-button.vis-right{background-image:url(img/network/rightArrow.png);bottom:10px;left:95px}div.vis-network div.vis-navigation div.vis-button.vis-zoomIn{background-image:url(img/network/plus.png);bottom:10px;right:15px}div.vis-network div.vis-navigation div.vis-button.vis-zoomOut{background-image:url(img/network/minus.png);bottom:10px;right:55px}div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends{background-image:url(img/network/zoomExtends.png);bottom:50px;right:15px}div.vis-color-picker{position:absolute;top:0;left:30px;margin-top:-140px;margin-left:30px;width:310px;height:444px;z-index:1;padding:10px;border-radius:15px;background-color:#fff;display:none;box-shadow:rgba(0,0,0,.5) 0 0 10px 0}div.vis-color-picker div.vis-arrow{position:absolute;top:147px;left:5px}div.vis-color-picker div.vis-arrow::after,div.vis-color-picker div.vis-arrow::before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.vis-color-picker div.vis-arrow:after{border-color:rgba(255,255,255,0);border-right-color:#fff;border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{position:absolute;width:289px;height:289px;cursor:pointer}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{position:absolute;top:137px;left:137px;width:15px;height:15px;border-radius:15px;border:1px solid #fff;background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0 )}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{width:140px;height:20px;top:380px;font-size:10px;color:rgba(0,0,0,.4);line-height:20px;position:absolute;vertical-align:middle}div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:159px;text-align:right;padding-right:2px}div.vis-color-picker div.vis-initial-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:10px;text-align:left;padding-left:2px}div.vis-color-picker div.vis-label{position:absolute;width:300px;left:10px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{position:absolute;width:68px;height:25px;border-radius:10px;vertical-align:middle;text-align:center;line-height:25px;top:410px;border:2px solid #d9d9d9;background-color:#f7f7f7;cursor:pointer}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{width:290px;height:20px}
\ No newline at end of file
--- /dev/null
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.16.1
+ * @date 2016-04-18
+ *
+ * @license
+ * Copyright (C) 2011-2016 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var o=i(1);o.extend(e,i(7)),o.extend(e,i(24)),o.extend(e,i(60))},function(t,e,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},n=i(2),s=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=r.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return s.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==o(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var s in t)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===t[s]||n!==!0?t[s]=i[s]:delete t[s]:"object"===o(t[s])&&e.fillIfDefined(t[s],i[s],n))},e.protoExtend=function(t,e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)t[n]=o[n]}return t},e.extend=function(t,e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t},e.selectiveExtend=function(t,e,i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var o=2;o<arguments.length;o++)for(var n=arguments[o],s=0;s<t.length;s++){var r=t[s];n.hasOwnProperty(r)&&(e[r]=n[r])}return e},e.selectiveDeepExtend=function(t,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var r=arguments[s],a=0;a<t.length;a++){var h=t[a];if(r.hasOwnProperty(h))if(o[h]&&o[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?e.deepExtend(i[h],o[h],!1,n):null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h];else{if(Array.isArray(o[h]))throw new TypeError("Arrays are not supported by deepExtend");null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h]}}return i},e.selectiveNotDeepExtend=function(t,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&-1==t.indexOf(s))if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r<o[s].length;r++)i[s].push(o[s][r])}else null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];return i},e.deepExtend=function(t,i,o,n){for(var s in i)if(i.hasOwnProperty(s)||o===!0)if(i[s]&&i[s].constructor===Object)void 0===t[s]&&(t[s]={}),t[s].constructor===Object?e.deepExtend(t[s],i[s],o):null===i[s]&&void 0!==t[s]&&n===!0?delete t[s]:t[s]=i[s];else if(Array.isArray(i[s])){t[s]=[];for(var r=0;r<i[s].length;r++)t[s].push(i[s][r])}else null===i[s]&&void 0!==t[s]&&n===!0?delete t[s]:t[s]=i[s];return t},e.equalArray=function(t,e){if(t.length!=e.length)return!1;for(var i=0,o=t.length;o>i;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var o;if(void 0!==t){if(null===t)return null;if(!i)return t;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(n.isMoment(t))return new Date(t.valueOf());if(e.isString(t))return o=r.exec(t),o?new Date(Number(o[1])):n(t).toDate();throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"Moment":if(e.isNumber(t))return n(t);if(t instanceof Date)return n(t.valueOf());if(n.isMoment(t))return n(t);if(e.isString(t))return o=r.exec(t),n(o?Number(o[1]):t);throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"ISODate":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(n.isMoment(t))return t.toDate().toISOString();if(e.isString(t))return o=r.exec(t),o?new Date(Number(o[1])).toISOString():new Date(t).toISOString();throw new Error("Cannot convert object of type "+e.getType(t)+" to type ISODate");case"ASPDate":if(e.isNumber(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(e.isString(t)){o=r.exec(t);var s;return s=o?new Date(Number(o[1])).valueOf():new Date(t).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+e.getType(t)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var r=/^\/?Date\((\-?\d+)/i;e.getType=function(t){var e="undefined"==typeof t?"undefined":o(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},e.copyAndExtendArray=function(t,e){for(var i=[],o=0;o<t.length;o++)i.push(t[o]);return i.push(e),i},e.copyArray=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);return e},e.getAbsoluteLeft=function(t){return t.getBoundingClientRect().left},e.getAbsoluteRight=function(t){return t.getBoundingClientRect().right},e.getAbsoluteTop=function(t){return t.getBoundingClientRect().top},e.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},e.removeClassName=function(t,e){var i=t.className.split(" "),o=i.indexOf(e);-1!=o&&(i.splice(o,1),t.className=i.join(" "))},e.forEach=function(t,e){var i,o;if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},e.toArray=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},e.throttle=function(t,e){var i=null,o=!1;return function n(){i?o=!0:(o=!1,t(),i=setTimeout(function(){i=null,o&&n()},e))}},e.addEventListener=function(t,e,i,o){t.addEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(-1!=t.indexOf("rgba"))return t;if(-1!=t.indexOf("rgb")){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=a.split(t.style.cssText),n=a.split(i),s=e.extend(o,n);t.style.cssText=a.join(s)},e.removeCssText=function(t,e){var i=a.split(t.style.cssText),o=a.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=a.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s<t.length;s++)i.hasOwnProperty(t[s])&&"object"==o(i[t[s]])&&(n[t[s]]=e.bridgeObject(i[t[s]]));return n}return null},e.bridgeObject=function(t){if("object"==("undefined"==typeof t?"undefined":o(t))){var i=Object.create(t);for(var n in t)t.hasOwnProperty(n)&&"object"==o(t[n])&&(i[n]=e.bridgeObject(t[n]));return i}return null},e.insertSort=function(t,e){for(var i=0;i<t.length;i++){for(var o=t[i],n=i;n>0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length<=3||void 0===arguments[3]?!1:arguments[3],arguments.length<=4||void 0===arguments[4]?{}:arguments[4]);if(null===e[i])t[i]=Object.create(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;a>=r&&n>s;){var h=Math.floor((r+a)/2),d=t[h],l=void 0===o?d[i]:d[i][o],c=e(l);if(0==c)return h;-1==c?r=h+1:a=h-1,s++}return-1},e.binarySearchValue=function(t,e,i,o,n){for(var s,r,a,h,d=1e4,l=0,c=0,u=t.length-1,n=void 0!=n?n:function(t,e){return t==e?0:e>t?-1:1};u>=c&&d>l;){if(h=Math.floor(.5*(u+c)),s=t[Math.max(0,h-1)][i],r=t[h][i],a=t[Math.min(t.length-1,h+1)][i],0==n(r,e))return h;if(n(s,e)<0&&n(r,e)>0)return"before"==o?Math.max(0,h-1):h;if(n(r,e)<0&&n(a,e)>0)return"before"==o?h:Math.min(t.length-1,h+1);n(r,e)<0?c=h+1:u=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return.5>t?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return.5>t?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.5>t?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.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t}}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return ro.apply(null,arguments)}function i(t){ro=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var i,o=[];for(i=0;i<t.length;++i)o.push(e(t[i],i));return o}function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function a(t,e){for(var i in e)r(e,i)&&(t[i]=e[i]);return r(e,"toString")&&(t.toString=e.toString),r(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,i,o){return Lt(t,e,i,o,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(t){return null==t._pf&&(t._pf=d()),t._pf}function c(t){if(null==t._isValid){var e=l(t),i=ao.call(e.parsedDateParts,function(t){return null!=t});t._isValid=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function u(t){var e=h(NaN);return null!=t?a(l(e),t):l(e).userInvalidated=!0,e}function p(t){return void 0===t}function f(t,e){var i,o,n;if(p(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),p(e._i)||(t._i=e._i),p(e._f)||(t._f=e._f),p(e._l)||(t._l=e._l),p(e._strict)||(t._strict=e._strict),p(e._tzm)||(t._tzm=e._tzm),p(e._isUTC)||(t._isUTC=e._isUTC),p(e._offset)||(t._offset=e._offset),p(e._pf)||(t._pf=l(e)),p(e._locale)||(t._locale=e._locale),ho.length>0)for(i in ho)o=ho[i],n=e[o],p(n)||(t[o]=n);return t}function m(t){f(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),lo===!1&&(lo=!0,e.updateOffset(this),lo=!1)}function v(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function g(t){return 0>t?Math.ceil(t):Math.floor(t)}function y(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=g(e)),i}function b(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;n>o;o++)(i&&t[o]!==e[o]||!i&&y(t[o])!==y(e[o]))&&r++;return r+s}function w(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function _(t,i){var o=!0;return a(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),o&&(w(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),o=!1),i.apply(this,arguments)},i)}function x(t,i){null!=e.deprecationHandler&&e.deprecationHandler(t,i),co[t]||(w(i),co[t]=!0)}function k(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function O(t){return"[object Object]"===Object.prototype.toString.call(t)}function M(t){var e,i;for(i in t)e=t[i],k(e)?this[i]=e:this["_"+i]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function D(t,e){var i,o=a({},t);for(i in e)r(e,i)&&(O(t[i])&&O(e[i])?(o[i]={},a(o[i],t[i]),a(o[i],e[i])):null!=e[i]?o[i]=e[i]:delete o[i]);return o}function S(t){null!=t&&this.set(t)}function C(t){return t?t.toLowerCase().replace("_","-"):t}function T(t){for(var e,i,o,n,s=0;s<t.length;){for(n=C(t[s]).split("-"),e=n.length,i=C(t[s+1]),i=i?i.split("-"):null;e>0;){if(o=E(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&b(n,i,!0)>=e-1)break;e--}s++}return null}function E(e){var i=null;if(!mo[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=po._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),P(i)}catch(o){}return mo[e]}function P(t,e){var i;return t&&(i=p(e)?R(t):I(t,e),i&&(po=i)),po._abbr}function I(t,e){return null!==e?(e.abbr=t,null!=mo[t]?(x("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=D(mo[t]._config,e)):null!=e.parentLocale&&(null!=mo[e.parentLocale]?e=D(mo[e.parentLocale]._config,e):x("parentLocaleUndefined","specified parentLocale is not defined yet")),mo[t]=new S(e),P(t),mo[t]):(delete mo[t],null)}function N(t,e){if(null!=e){var i;null!=mo[t]&&(e=D(mo[t]._config,e)),i=new S(e),i.parentLocale=mo[t],mo[t]=i,P(t)}else null!=mo[t]&&(null!=mo[t].parentLocale?mo[t]=mo[t].parentLocale:null!=mo[t]&&delete mo[t]);return mo[t]}function R(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return po;if(!o(t)){if(e=E(t))return e;t=[t]}return T(t)}function z(){return uo(mo)}function L(t,e){var i=t.toLowerCase();vo[i]=vo[i+"s"]=vo[e]=t}function A(t){return"string"==typeof t?vo[t]||vo[t.toLowerCase()]:void 0}function B(t){var e,i,o={};for(i in t)r(t,i)&&(e=A(i),e&&(o[e]=t[i]));return o}function F(t,i){return function(o){return null!=o?(H(this,t,o),e.updateOffset(this,i),this):j(this,t)}}function j(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function H(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function W(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=A(t),k(this[t]))return this[t](e);return this}function Y(t,e,i){var o=""+Math.abs(t),n=e-o.length,s=t>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function G(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(wo[t]=n),e&&(wo[e[0]]=function(){return Y(n.apply(this,arguments),e[1],e[2])}),i&&(wo[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function V(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function U(t){var e,i,o=t.match(go);for(e=0,i=o.length;i>e;e++)wo[o[e]]?o[e]=wo[o[e]]:o[e]=V(o[e]);return function(e){var n,s="";for(n=0;i>n;n++)s+=o[n]instanceof Function?o[n].call(e,t):o[n];return s}}function q(t,e){return t.isValid()?(e=X(e,t.localeData()),bo[e]=bo[e]||U(e),bo[e](t)):t.localeData().invalidDate()}function X(t,e){function i(t){return e.longDateFormat(t)||t}var o=5;for(yo.lastIndex=0;o>=0&&yo.test(t);)t=t.replace(yo,i),yo.lastIndex=0,o-=1;return t}function Z(t,e,i){Bo[t]=k(e)?e:function(t,o){return t&&i?i:e}}function K(t,e){return r(Bo,t)?Bo[t](e._strict,e._locale):new RegExp(J(t))}function J(t){return Q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function Q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(o=function(t,i){i[e]=y(t)}),i=0;i<t.length;i++)Fo[t[i]]=o}function tt(t,e){$(t,function(t,i,o,n){o._w=o._w||{},e(t,o._w,o,n)})}function et(t,e,i){null!=e&&r(Fo,t)&&Fo[t](e,i._a,i,t)}function it(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function ot(t,e){return o(this._months)?this._months[t.month()]:this._months[Zo.test(e)?"format":"standalone"][t.month()]}function nt(t,e){return o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Zo.test(e)?"format":"standalone"][t.month()]}function st(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;12>o;++o)s=h([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===e?(n=fo.call(this._shortMonthsParse,r),-1!==n?n:null):(n=fo.call(this._longMonthsParse,r),-1!==n?n:null):"MMM"===e?(n=fo.call(this._shortMonthsParse,r),-1!==n?n:(n=fo.call(this._longMonthsParse,r),-1!==n?n:null)):(n=fo.call(this._longMonthsParse,r),-1!==n?n:(n=fo.call(this._shortMonthsParse,r),-1!==n?n:null))}function rt(t,e,i){var o,n,s;if(this._monthsParseExact)return st.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;12>o;o++){if(n=h([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[o].test(t))return o;if(i&&"MMM"===e&&this._shortMonthsParse[o].test(t))return o;if(!i&&this._monthsParse[o].test(t))return o}}function at(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=y(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return i=Math.min(t.date(),it(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function ht(t){return null!=t?(at(this,t),e.updateOffset(this,!0),this):j(this,"Month")}function dt(){return it(this.year(),this.month())}function lt(t){return this._monthsParseExact?(r(this,"_monthsRegex")||ut.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ct(t){return this._monthsParseExact?(r(this,"_monthsRegex")||ut.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ut(){function t(t,e){return e.length-t.length}var e,i,o=[],n=[],s=[];for(e=0;12>e;e++)i=h([2e3,e]),o.push(this.monthsShort(i,"")),n.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(o.sort(t),n.sort(t),s.sort(t),e=0;12>e;e++)o[e]=Q(o[e]),n[e]=Q(n[e]),s[e]=Q(s[e]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function pt(t){var e,i=t._a;return i&&-2===l(t).overflow&&(e=i[Ho]<0||i[Ho]>11?Ho:i[Wo]<1||i[Wo]>it(i[jo],i[Ho])?Wo:i[Yo]<0||i[Yo]>24||24===i[Yo]&&(0!==i[Go]||0!==i[Vo]||0!==i[Uo])?Yo:i[Go]<0||i[Go]>59?Go:i[Vo]<0||i[Vo]>59?Vo:i[Uo]<0||i[Uo]>999?Uo:-1,l(t)._overflowDayOfYear&&(jo>e||e>Wo)&&(e=Wo),l(t)._overflowWeeks&&-1===e&&(e=qo),l(t)._overflowWeekday&&-1===e&&(e=Xo),l(t).overflow=e),t}function ft(t){var e,i,o,n,s,r,a=t._i,h=tn.exec(a)||en.exec(a);if(h){for(l(t).iso=!0,e=0,i=nn.length;i>e;e++)if(nn[e][1].exec(h[1])){n=nn[e][0],o=nn[e][2]!==!1;break}if(null==n)return void(t._isValid=!1);if(h[3]){for(e=0,i=sn.length;i>e;e++)if(sn[e][1].exec(h[3])){s=(h[2]||" ")+sn[e][0];break}if(null==s)return void(t._isValid=!1)}if(!o&&null!=s)return void(t._isValid=!1);if(h[4]){if(!on.exec(h[4]))return void(t._isValid=!1);r="Z"}t._f=n+(s||"")+(r||""),Tt(t)}else t._isValid=!1}function mt(t){var i=rn.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(ft(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function vt(t,e,i,o,n,s,r){var a=new Date(t,e,i,o,n,s,r);return 100>t&&t>=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function gt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function yt(t){return bt(t)?366:365}function bt(t){return t%4===0&&t%100!==0||t%400===0}function wt(){return bt(this.year())}function _t(t,e,i){var o=7+e-i,n=(7+gt(t,0,o).getUTCDay()-e)%7;return-n+o-1}function xt(t,e,i,o,n){var s,r,a=(7+i-o)%7,h=_t(t,o,n),d=1+7*(e-1)+a+h;return 0>=d?(s=t-1,r=yt(s)+d):d>yt(t)?(s=t+1,r=d-yt(t)):(s=t,r=d),{year:s,dayOfYear:r}}function kt(t,e,i){var o,n,s=_t(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return 1>r?(n=t.year()-1,o=r+Ot(n,e,i)):r>Ot(t.year(),e,i)?(o=r-Ot(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function Ot(t,e,i){var o=_t(t,e,i),n=_t(t+1,e,i);return(yt(t)-o+n)/7}function Mt(t,e,i){return null!=t?t:null!=e?e:i}function Dt(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function St(t){var e,i,o,n,s=[];if(!t._d){for(o=Dt(t),t._w&&null==t._a[Wo]&&null==t._a[Ho]&&Ct(t),t._dayOfYear&&(n=Mt(t._a[jo],o[jo]),t._dayOfYear>yt(n)&&(l(t)._overflowDayOfYear=!0),i=gt(n,0,t._dayOfYear),t._a[Ho]=i.getUTCMonth(),t._a[Wo]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Yo]&&0===t._a[Go]&&0===t._a[Vo]&&0===t._a[Uo]&&(t._nextDay=!0,t._a[Yo]=0),t._d=(t._useUTC?gt:vt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Yo]=24)}}function Ct(t){var e,i,o,n,s,r,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(s=1,r=4,i=Mt(e.GG,t._a[jo],kt(At(),1,4).year),o=Mt(e.W,1),n=Mt(e.E,1),(1>n||n>7)&&(h=!0)):(s=t._locale._week.dow,r=t._locale._week.doy,i=Mt(e.gg,t._a[jo],kt(At(),s,r).year),o=Mt(e.w,1),null!=e.d?(n=e.d,(0>n||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s),1>o||o>Ot(i,s,r)?l(t)._overflowWeeks=!0:null!=h?l(t)._overflowWeekday=!0:(a=xt(i,o,n,s,r),t._a[jo]=a.year,t._dayOfYear=a.dayOfYear)}function Tt(t){if(t._f===e.ISO_8601)return void ft(t);t._a=[],l(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=X(t._f,t._locale).match(go)||[],i=0;i<n.length;i++)s=n[i],o=(a.match(K(s,t))||[])[0],o&&(r=a.substr(0,a.indexOf(o)),r.length>0&&l(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),wo[s]?(o?l(t).empty=!1:l(t).unusedTokens.push(s),et(s,o,t)):t._strict&&!o&&l(t).unusedTokens.push(s);l(t).charsLeftOver=h-d,a.length>0&&l(t).unusedInput.push(a),l(t).bigHour===!0&&t._a[Yo]<=12&&t._a[Yo]>0&&(l(t).bigHour=void 0),l(t).parsedDateParts=t._a.slice(0),l(t).meridiem=t._meridiem,t._a[Yo]=Et(t._locale,t._a[Yo],t._meridiem),St(t),pt(t)}function Et(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&12>e&&(e+=12),o||12!==e||(e=0),e):e}function Pt(t){var e,i,o,n,s;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;n<t._f.length;n++)s=0,e=f({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[n],Tt(e),c(e)&&(s+=l(e).charsLeftOver,s+=10*l(e).unusedTokens.length,l(e).score=s,(null==o||o>s)&&(o=s,i=e));a(t,i||e)}function It(t){if(!t._d){var e=B(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),St(t)}}function Nt(t){var e=new m(pt(Rt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Rt(t){var e=t._i,i=t._f;return t._locale=t._locale||R(t._l),null===e||void 0===i&&""===e?u({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),v(e)?new m(pt(e)):(o(i)?Pt(t):i?Tt(t):n(e)?t._d=e:zt(t),c(t)||(t._d=null),t))}function zt(t){var i=t._i;void 0===i?t._d=new Date(e.now()):n(i)?t._d=new Date(i.valueOf()):"string"==typeof i?mt(t):o(i)?(t._a=s(i.slice(0),function(t){return parseInt(t,10)}),St(t)):"object"==typeof i?It(t):"number"==typeof i?t._d=new Date(i):e.createFromInputFallback(t)}function Lt(t,e,i,o,n){var s={};return"boolean"==typeof i&&(o=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=i,s._i=t,s._f=e,s._strict=o,Nt(s)}function At(t,e,i,o){return Lt(t,e,i,o,!1)}function Bt(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return At();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}function Ft(){var t=[].slice.call(arguments,0);return Bt("isBefore",t)}function jt(){var t=[].slice.call(arguments,0);return Bt("isAfter",t)}function Ht(t){var e=B(t),i=e.year||0,o=e.quarter||0,n=e.month||0,s=e.week||0,r=e.day||0,a=e.hour||0,h=e.minute||0,d=e.second||0,l=e.millisecond||0;this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+n+3*o+12*i,this._data={},this._locale=R(),this._bubble()}function Wt(t){return t instanceof Ht}function Yt(t,e){G(t,0,0,function(){var t=this.utcOffset(),i="+";return 0>t&&(t=-t,i="-"),i+Y(~~(t/60),2)+e+Y(~~t%60,2)})}function Gt(t,e){var i=(e||"").match(t)||[],o=i[i.length-1]||[],n=(o+"").match(cn)||["-",0,0],s=+(60*n[1])+y(n[2]);return"+"===n[0]?s:-s}function Vt(t,i){var o,s;return i._isUTC?(o=i.clone(),s=(v(t)||n(t)?t.valueOf():At(t).valueOf())-o.valueOf(),o._d.setTime(o._d.valueOf()+s),e.updateOffset(o,!1),o):At(t).local()}function Ut(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function qt(t,i){var o,n=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Gt(zo,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&i&&(o=Ut(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),n!==t&&(!i||this._changeInProgress?le(this,ne(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?n:Ut(this):null!=t?this:NaN}function Xt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Zt(t){return this.utcOffset(0,t)}function Kt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ut(this),"m")),this}function Jt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Gt(Ro,this._i)),this}function Qt(t){return this.isValid()?(t=t?At(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function $t(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!p(this._isDSTShifted))return this._isDSTShifted;var t={};if(f(t,this),t=Rt(t),t._a){var e=t._isUTC?h(t._a):At(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ie(){return this.isValid()?this._isUTC:!1}function oe(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ne(t,e){var i,o,n,s=t,a=null;return Wt(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=un.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:y(a[Wo])*i,h:y(a[Yo])*i,m:y(a[Go])*i,s:y(a[Vo])*i,ms:y(a[Uo])*i}):(a=pn.exec(t))?(i="-"===a[1]?-1:1,s={y:se(a[2],i),M:se(a[3],i),w:se(a[4],i),d:se(a[5],i),h:se(a[6],i),m:se(a[7],i),s:se(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=ae(At(s.from),At(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new Ht(s),Wt(t)&&r(t,"_locale")&&(o._locale=t._locale),o}function se(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function re(t,e){var i={milliseconds:0,months:0};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 ae(t,e){var i;return t.isValid()&&e.isValid()?(e=Vt(e,t),t.isBefore(e)?i=re(t,e):(i=re(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function he(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function de(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(x(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=ne(i,o),le(this,n,t),this}}function le(t,i,o,n){var s=i._milliseconds,r=he(i._days),a=he(i._months);t.isValid()&&(n=null==n?!0:n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&H(t,"Date",j(t,"Date")+r*o),a&&at(t,j(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function ce(t,e){var i=t||At(),o=Vt(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse",r=e&&(k(e[s])?e[s]():e[s]);return this.format(r||this.localeData().calendar(s,this,At(i)))}function ue(){return new m(this)}function pe(t,e){var i=v(t)?t:At(t);return this.isValid()&&i.isValid()?(e=A(p(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf()):!1}function fe(t,e){var i=v(t)?t:At(t);return this.isValid()&&i.isValid()?(e=A(p(e)?"millisecond":e),"millisecond"===e?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf()):!1}function me(t,e,i,o){return o=o||"()",("("===o[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===o[1]?this.isBefore(e,i):!this.isAfter(e,i))}function ve(t,e){var i,o=v(t)?t:At(t);return this.isValid()&&o.isValid()?(e=A(e||"millisecond"),"millisecond"===e?this.valueOf()===o.valueOf():(i=o.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf())):!1}function ge(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ye(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function be(t,e,i){var o,n,s,r;return this.isValid()?(o=Vt(t,this),o.isValid()?(n=6e4*(o.utcOffset()-this.utcOffset()),e=A(e),"year"===e||"month"===e||"quarter"===e?(r=we(this,o),"quarter"===e?r/=3:"year"===e&&(r/=12)):(s=this-o,r="second"===e?s/1e3:"minute"===e?s/6e4:"hour"===e?s/36e5:"day"===e?(s-n)/864e5:"week"===e?(s-n)/6048e5:s),i?r:g(r)):NaN):NaN}function we(t,e){var i,o,n=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(n,"months");return 0>e-s?(i=t.clone().add(n-1,"months"),o=(e-s)/(s-i)):(i=t.clone().add(n+1,"months"),o=(e-s)/(i-s)),-(n+o)||0}function _e(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function xe(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?k(Date.prototype.toISOString)?this.toDate().toISOString():q(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):q(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function ke(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var i=q(this,t);return this.localeData().postformat(i)}function Oe(t,e){return this.isValid()&&(v(t)&&t.isValid()||At(t).isValid())?ne({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Me(t){return this.from(At(),t)}function De(t,e){return this.isValid()&&(v(t)&&t.isValid()||At(t).isValid())?ne({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Se(t){return this.to(At(),t)}function Ce(t){var e;return void 0===t?this._locale._abbr:(e=R(t),null!=e&&(this._locale=e),this)}function Te(){return this._locale}function Ee(t){switch(t=A(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function Pe(t){return t=A(t),void 0===t||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))}function Ie(){return this._d.valueOf()-6e4*(this._offset||0)}function Ne(){return Math.floor(this.valueOf()/1e3)}function Re(){return this._offset?new Date(this.valueOf()):this._d}function ze(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Le(){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()}}function Ae(){return this.isValid()?this.toISOString():null}function Be(){return c(this)}function Fe(){return a({},l(this))}function je(){return l(this).overflow}function He(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function We(t,e){G(0,[t,t.length],0,e)}function Ye(t){return qe.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ge(t){return qe.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Ve(){return Ot(this.year(),1,4)}function Ue(){var t=this.localeData()._week;return Ot(this.year(),t.dow,t.doy)}function qe(t,e,i,o,n){var s;return null==t?kt(this,o,n).year:(s=Ot(t,o,n),e>s&&(e=s),Xe.call(this,t,e,i,o,n))}function Xe(t,e,i,o,n){var s=xt(t,e,i,o,n),r=gt(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Ze(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ke(t){return kt(t,this._week.dow,this._week.doy).week}function Je(){return this._week.dow}function Qe(){return this._week.doy}function $e(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function ti(t){var e=kt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function ei(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function ii(t,e){return o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function oi(t){return this._weekdaysShort[t.day()]}function ni(t){return this._weekdaysMin[t.day()]}function si(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;7>o;++o)s=h([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=fo.call(this._weekdaysParse,r),-1!==n?n:null):"ddd"===e?(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:null):(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:null):"dddd"===e?(n=fo.call(this._weekdaysParse,r),-1!==n?n:(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:null))):"ddd"===e?(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:(n=fo.call(this._weekdaysParse,r),-1!==n?n:(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:null))):(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:(n=fo.call(this._weekdaysParse,r),-1!==n?n:(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:null)))}function ri(t,e,i){var o,n,s;if(this._weekdaysParseExact)return si.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(n=h([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function ai(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=ei(t,this.localeData()),this.add(t-e,"d")):e}function hi(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")}function di(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function li(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex}function ci(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ui(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function pi(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],d=[],l=[];for(e=0;7>e;e++)i=h([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),d.push(s),l.push(o),l.push(n),l.push(s);for(r.sort(t),a.sort(t),d.sort(t),l.sort(t),e=0;7>e;e++)a[e]=Q(a[e]),d[e]=Q(d[e]),l[e]=Q(l[e]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function fi(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function mi(){return this.hours()%12||12}function vi(){return this.hours()||24}function gi(t,e){G(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function yi(t,e){return e._meridiemParse}function bi(t){return"p"===(t+"").toLowerCase().charAt(0)}function wi(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function _i(t,e){e[Uo]=y(1e3*("0."+t))}function xi(){return this._isUTC?"UTC":""}function ki(){return this._isUTC?"Coordinated Universal Time":""}function Oi(t){return At(1e3*t)}function Mi(){return At.apply(null,arguments).parseZone()}function Di(t,e,i){var o=this._calendar[t];return k(o)?o.call(e,i):o}function Si(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])}function Ci(){return this._invalidDate}function Ti(t){return this._ordinal.replace("%d",t)}function Ei(t){return t}function Pi(t,e,i,o){var n=this._relativeTime[i];return k(n)?n(t,e,i,o):n.replace(/%d/i,t)}function Ii(t,e){var i=this._relativeTime[t>0?"future":"past"];return k(i)?i(e):i.replace(/%s/i,e)}function Ni(t,e,i,o){var n=R(),s=h().set(o,e);return n[i](s,t)}function Ri(t,e,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Ni(t,e,i,"month");var o,n=[];for(o=0;12>o;o++)n[o]=Ni(t,o,i,"month");return n}function zi(t,e,i,o){"boolean"==typeof t?("number"==typeof e&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,"number"==typeof e&&(i=e,e=void 0),e=e||"");var n=R(),s=t?n._week.dow:0;if(null!=i)return Ni(e,(i+s)%7,o,"day");var r,a=[];for(r=0;7>r;r++)a[r]=Ni(e,(r+s)%7,o,"day");return a}function Li(t,e){return Ri(t,e,"months")}function Ai(t,e){return Ri(t,e,"monthsShort")}function Bi(t,e,i){return zi(t,e,i,"weekdays")}function Fi(t,e,i){return zi(t,e,i,"weekdaysShort")}function ji(t,e,i){return zi(t,e,i,"weekdaysMin")}function Hi(){var t=this._data;return this._milliseconds=jn(this._milliseconds),this._days=jn(this._days),this._months=jn(this._months),t.milliseconds=jn(t.milliseconds),t.seconds=jn(t.seconds),t.minutes=jn(t.minutes),t.hours=jn(t.hours),t.months=jn(t.months),t.years=jn(t.years),this}function Wi(t,e,i,o){var n=ne(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Yi(t,e){return Wi(this,t,e,1)}function Gi(t,e){return Wi(this,t,e,-1)}function Vi(t){return 0>t?Math.floor(t):Math.ceil(t)}function Ui(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||0>=s&&0>=r&&0>=a||(s+=864e5*Vi(Xi(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=g(s/1e3),h.seconds=t%60,e=g(t/60),h.minutes=e%60,i=g(e/60),h.hours=i%24,r+=g(i/24),n=g(qi(r)),a+=n,r-=Vi(Xi(n)),o=g(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function qi(t){return 4800*t/146097}function Xi(t){return 146097*t/4800}function Zi(t){var e,i,o=this._milliseconds;if(t=A(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+qi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(Xi(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function Ki(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function Ji(t){return function(){return this.as(t)}}function Qi(t){return t=A(t),this[t+"s"]()}function $i(t){return function(){return this._data[t]}}function to(){return g(this.days()/7)}function eo(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function io(t,e,i){var o=ne(t).abs(),n=is(o.as("s")),s=is(o.as("m")),r=is(o.as("h")),a=is(o.as("d")),h=is(o.as("M")),d=is(o.as("y")),l=n<os.s&&["s",n]||1>=s&&["m"]||s<os.m&&["mm",s]||1>=r&&["h"]||r<os.h&&["hh",r]||1>=a&&["d"]||a<os.d&&["dd",a]||1>=h&&["M"]||h<os.M&&["MM",h]||1>=d&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=i,eo.apply(null,l)}function oo(t,e){return void 0===os[t]?!1:void 0===e?os[t]:(os[t]=e,!0)}function no(t){var e=this.localeData(),i=io(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function so(){var t,e,i,o=ns(this._milliseconds)/1e3,n=ns(this._days),s=ns(this._months);t=g(o/60),e=g(t/60),o%=60,t%=60,i=g(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,c=o,u=this.asSeconds();return u?(0>u?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||c?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var ro,ao;ao=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;i>o;o++)if(o in e&&t.call(this,e[o],o,e))return!0;return!1};var ho=e.momentProperties=[],lo=!1,co={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var uo;uo=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)r(t,e)&&i.push(e);return i};var po,fo,mo={},vo={},go=/(\[[^\[]*\])|(\\)?([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,yo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bo={},wo={},_o=/\d/,xo=/\d\d/,ko=/\d{3}/,Oo=/\d{4}/,Mo=/[+-]?\d{6}/,Do=/\d\d?/,So=/\d\d\d\d?/,Co=/\d\d\d\d\d\d?/,To=/\d{1,3}/,Eo=/\d{1,4}/,Po=/[+-]?\d{1,6}/,Io=/\d+/,No=/[+-]?\d+/,Ro=/Z|[+-]\d\d:?\d\d/gi,zo=/Z|[+-]\d\d(?::?\d\d)?/gi,Lo=/[+-]?\d+(\.\d{1,3})?/,Ao=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Bo={},Fo={},jo=0,Ho=1,Wo=2,Yo=3,Go=4,Vo=5,Uo=6,qo=7,Xo=8;fo=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},G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),G("MMMM",0,0,function(t){return this.localeData().months(this,t)}),L("month","M"),Z("M",Do),Z("MM",Do,xo),Z("MMM",function(t,e){return e.monthsShortRegex(t)}),Z("MMMM",function(t,e){return e.monthsRegex(t)}),$(["M","MM"],function(t,e){e[Ho]=y(t)-1}),$(["MMM","MMMM"],function(t,e,i,o){var n=i._locale.monthsParse(t,o,i._strict);null!=n?e[Ho]=n:l(i).invalidMonth=t});var Zo=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ko="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Jo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Qo=Ao,$o=Ao,tn=/^\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)?)?/,en=/^\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)?)?/,on=/Z|[+-]\d\d(?::?\d\d)?/,nn=[["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}/]],sn=[["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/]],rn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=_("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),G("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),L("year","y"),Z("Y",No),Z("YY",Do,xo),Z("YYYY",Eo,Oo),Z("YYYYY",Po,Mo),Z("YYYYYY",Po,Mo),$(["YYYYY","YYYYYY"],jo),$("YYYY",function(t,i){i[jo]=2===t.length?e.parseTwoDigitYear(t):y(t)}),$("YY",function(t,i){i[jo]=e.parseTwoDigitYear(t)}),$("Y",function(t,e){e[jo]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return y(t)+(y(t)>68?1900:2e3)};var an=F("FullYear",!0);e.ISO_8601=function(){};var hn=_("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=At.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:u()}),dn=_("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=At.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:u()}),ln=function(){return Date.now?Date.now():+new Date};Yt("Z",":"),Yt("ZZ",""),Z("Z",zo),Z("ZZ",zo),$(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Gt(zo,t)});var cn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var un=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,pn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;ne.fn=Ht.prototype;var fn=de(1,"add"),mn=de(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var vn=_("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)});G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),We("gggg","weekYear"),We("ggggg","weekYear"),We("GGGG","isoWeekYear"),We("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Z("G",No),Z("g",No),Z("GG",Do,xo),Z("gg",Do,xo),Z("GGGG",Eo,Oo),Z("gggg",Eo,Oo),Z("GGGGG",Po,Mo),Z("ggggg",Po,Mo),tt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=y(t)}),tt(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),G("Q",0,"Qo","quarter"),L("quarter","Q"),Z("Q",_o),$("Q",function(t,e){e[Ho]=3*(y(t)-1)}),G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Z("w",Do),Z("ww",Do,xo),Z("W",Do),Z("WW",Do,xo),tt(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=y(t)});var gn={dow:0,doy:6};G("D",["DD",2],"Do","date"),L("date","D"),Z("D",Do),Z("DD",Do,xo),Z("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),$(["D","DD"],Wo),$("Do",function(t,e){e[Wo]=y(t.match(Do)[0],10)});var yn=F("Date",!0);G("d",0,"do","day"),G("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),G("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),G("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Z("d",Do),Z("e",Do),Z("E",Do),Z("dd",function(t,e){return e.weekdaysMinRegex(t)}),Z("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Z("dddd",function(t,e){return e.weekdaysRegex(t)}),tt(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:l(i).invalidWeekday=t}),tt(["d","e","E"],function(t,e,i,o){e[o]=y(t)});var bn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_n="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xn=Ao,kn=Ao,On=Ao;G("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Z("DDD",To),Z("DDDD",ko),$(["DDD","DDDD"],function(t,e,i){i._dayOfYear=y(t)}),G("H",["HH",2],0,"hour"),G("h",["hh",2],0,mi),G("k",["kk",2],0,vi),G("hmm",0,0,function(){return""+mi.apply(this)+Y(this.minutes(),2)}),G("hmmss",0,0,function(){return""+mi.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),gi("a",!0),gi("A",!1),L("hour","h"),Z("a",yi),Z("A",yi),Z("H",Do),Z("h",Do),Z("HH",Do,xo),Z("hh",Do,xo),Z("hmm",So),Z("hmmss",Co),Z("Hmm",So),Z("Hmmss",Co),$(["H","HH"],Yo),$(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),$(["h","hh"],function(t,e,i){e[Yo]=y(t),l(i).bigHour=!0}),$("hmm",function(t,e,i){var o=t.length-2;e[Yo]=y(t.substr(0,o)),e[Go]=y(t.substr(o)),l(i).bigHour=!0}),$("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[Yo]=y(t.substr(0,o)),e[Go]=y(t.substr(o,2)),e[Vo]=y(t.substr(n)),l(i).bigHour=!0}),$("Hmm",function(t,e,i){var o=t.length-2;e[Yo]=y(t.substr(0,o)),e[Go]=y(t.substr(o))}),$("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[Yo]=y(t.substr(0,o)),e[Go]=y(t.substr(o,2)),e[Vo]=y(t.substr(n))});var Mn=/[ap]\.?m?\.?/i,Dn=F("Hours",!0);G("m",["mm",2],0,"minute"),L("minute","m"),Z("m",Do),Z("mm",Do,xo),$(["m","mm"],Go);var Sn=F("Minutes",!1);G("s",["ss",2],0,"second"),L("second","s"),Z("s",Do),Z("ss",Do,xo),$(["s","ss"],Vo);var Cn=F("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return 10*this.millisecond()}),G(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),G(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),G(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),G(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),G(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),Z("S",To,_o),Z("SS",To,xo),Z("SSS",To,ko);var Tn;for(Tn="SSSS";Tn.length<=9;Tn+="S")Z(Tn,Io);for(Tn="S";Tn.length<=9;Tn+="S")$(Tn,_i);var En=F("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var Pn=m.prototype;Pn.add=fn,Pn.calendar=ce,Pn.clone=ue,Pn.diff=be,Pn.endOf=Pe,Pn.format=ke,Pn.from=Oe,Pn.fromNow=Me,Pn.to=De,Pn.toNow=Se,Pn.get=W,Pn.invalidAt=je,Pn.isAfter=pe,Pn.isBefore=fe,Pn.isBetween=me,Pn.isSame=ve,Pn.isSameOrAfter=ge,Pn.isSameOrBefore=ye,Pn.isValid=Be,Pn.lang=vn,Pn.locale=Ce,Pn.localeData=Te,Pn.max=dn,Pn.min=hn,Pn.parsingFlags=Fe,Pn.set=W,Pn.startOf=Ee,Pn.subtract=mn,Pn.toArray=ze,Pn.toObject=Le,Pn.toDate=Re,Pn.toISOString=xe,Pn.toJSON=Ae,Pn.toString=_e,Pn.unix=Ne,Pn.valueOf=Ie,Pn.creationData=He,Pn.year=an,Pn.isLeapYear=wt,Pn.weekYear=Ye,Pn.isoWeekYear=Ge,Pn.quarter=Pn.quarters=Ze,Pn.month=ht,Pn.daysInMonth=dt,Pn.week=Pn.weeks=$e,Pn.isoWeek=Pn.isoWeeks=ti,Pn.weeksInYear=Ue,Pn.isoWeeksInYear=Ve,Pn.date=yn,Pn.day=Pn.days=ai,Pn.weekday=hi,Pn.isoWeekday=di,Pn.dayOfYear=fi,Pn.hour=Pn.hours=Dn,Pn.minute=Pn.minutes=Sn,Pn.second=Pn.seconds=Cn,Pn.millisecond=Pn.milliseconds=En,Pn.utcOffset=qt,Pn.utc=Zt,Pn.local=Kt,Pn.parseZone=Jt,Pn.hasAlignedHourOffset=Qt,Pn.isDST=$t,Pn.isDSTShifted=te,Pn.isLocal=ee,Pn.isUtcOffset=ie,Pn.isUtc=oe,Pn.isUTC=oe,Pn.zoneAbbr=xi,Pn.zoneName=ki,Pn.dates=_("dates accessor is deprecated. Use date instead.",yn),Pn.months=_("months accessor is deprecated. Use month instead",ht),Pn.years=_("years accessor is deprecated. Use year instead",an),Pn.zone=_("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Xt);var In=Pn,Nn={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Rn={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"},zn="Invalid date",Ln="%d",An=/\d{1,2}/,Bn={future:"in %s",past:"%s ago",s:"a few 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"},Fn=S.prototype;Fn._calendar=Nn,Fn.calendar=Di,Fn._longDateFormat=Rn,Fn.longDateFormat=Si,Fn._invalidDate=zn,Fn.invalidDate=Ci,Fn._ordinal=Ln,Fn.ordinal=Ti,Fn._ordinalParse=An,Fn.preparse=Ei,Fn.postformat=Ei,Fn._relativeTime=Bn,Fn.relativeTime=Pi,Fn.pastFuture=Ii,Fn.set=M,Fn.months=ot,Fn._months=Ko,Fn.monthsShort=nt,Fn._monthsShort=Jo,Fn.monthsParse=rt,Fn._monthsRegex=$o,Fn.monthsRegex=ct,Fn._monthsShortRegex=Qo,Fn.monthsShortRegex=lt,Fn.week=Ke,Fn._week=gn,Fn.firstDayOfYear=Qe,Fn.firstDayOfWeek=Je,Fn.weekdays=ii,Fn._weekdays=bn,Fn.weekdaysMin=ni,Fn._weekdaysMin=_n,Fn.weekdaysShort=oi,Fn._weekdaysShort=wn,Fn.weekdaysParse=ri,Fn._weekdaysRegex=xn,Fn.weekdaysRegex=li,Fn._weekdaysShortRegex=kn,Fn.weekdaysShortRegex=ci,Fn._weekdaysMinRegex=On,Fn.weekdaysMinRegex=ui,Fn.isPM=bi,Fn._meridiemParse=Mn,Fn.meridiem=wi,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===y(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=_("moment.lang is deprecated. Use moment.locale instead.",P),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",R);var jn=Math.abs,Hn=Ji("ms"),Wn=Ji("s"),Yn=Ji("m"),Gn=Ji("h"),Vn=Ji("d"),Un=Ji("w"),qn=Ji("M"),Xn=Ji("y"),Zn=$i("milliseconds"),Kn=$i("seconds"),Jn=$i("minutes"),Qn=$i("hours"),$n=$i("days"),ts=$i("months"),es=$i("years"),is=Math.round,os={s:45,m:45,h:22,d:26,M:11},ns=Math.abs,ss=Ht.prototype;ss.abs=Hi,ss.add=Yi,ss.subtract=Gi,ss.as=Zi,ss.asMilliseconds=Hn,ss.asSeconds=Wn,ss.asMinutes=Yn,ss.asHours=Gn,ss.asDays=Vn,ss.asWeeks=Un,ss.asMonths=qn,ss.asYears=Xn,ss.valueOf=Ki,ss._bubble=Ui,ss.get=Qi,ss.milliseconds=Zn,ss.seconds=Kn,ss.minutes=Jn,ss.hours=Qn,ss.days=$n,ss.weeks=to,ss.months=ts,ss.years=es,ss.humanize=no,ss.toISOString=so,ss.toString=so,ss.toJSON=so,ss.locale=Ce,ss.localeData=Te,ss.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",so),ss.lang=vn,G("X",0,0,"unix"),G("x",0,0,"valueOf"),Z("x",No),Z("X",Lo),$("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),$("x",function(t,e,i){i._d=new Date(y(t))}),e.version="2.13.0",i(At),e.fn=In,e.min=Ft,e.max=jt,e.now=ln,e.utc=h,e.unix=Oi,e.months=Li,e.isDate=n,e.locale=P,e.invalid=u,e.duration=ne,e.isMoment=v,e.weekdays=Bi,e.parseZone=Mi,e.localeData=R,e.isDuration=Wt,e.monthsShort=Ai,e.weekdaysMin=ji,e.defineLocale=I,e.updateLocale=N,e.locales=z,e.weekdaysShort=Fi,e.normalizeUnits=A,e.relativeTimeThreshold=oo,e.prototype=In;var rs=e;return rs})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>n&&(e[o+n++]=c[t])});16>n;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:g+1,d=a-v+(h-g)/1e4;if(0>d&&void 0===t.clockseq&&(r=r+1&16383),(0>d||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,g=h,m=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var c=a/4294967296*1e4&268435455;s[n++]=c>>>8&255,s[n++]=255&c,s[n++]=c>>>24&15|16,s[n++]=c>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var u=t.node||f,p=0;6>p;p++)s[n+p]=u[p];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;16>a;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],c={},u=0;256>u;u++)l[u]=(u+256).toString(16).substr(1),c[l[u]]=u;var p=r(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],m=16383&(p[6]<<8|p[7]),v=0,g=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},function(t,e,i){e.util=i(1),e.DOMutil=i(8),e.DataSet=i(9),e.DataView=i(11),e.Queue=i(10),e.Graph3d=i(12),e.graph3d={Camera:i(16),Filter:i(17),Point2d:i(15),Point3d:i(14),Slider:i(18),StepNumber:i(19)},e.moment=i(2),e.Hammer=i(20),e.keycharm=i(23)},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 o;return e.hasOwnProperty(t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);
+r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;n>o;o++){var s=i[o],r=this._options.type[s];"Date"==r||"ISODate"==r||"ASPDate"==r?this._type[s]="Date":this._type[s]=r}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=i(10);o.prototype.setOptions=function(t){t&&void 0!==t.queue&&(t.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=r.extend(this,{replace:["add","update","remove"]})),"object"===n(t.queue)&&this._queue.setOptions(t.queue)))},o.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var o=[];t in this._subscribers&&(o=o.concat(this._subscribers[t])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0,s=o.length;s>n;n++){var r=o[n];r.callback&&r.callback(t,e,i||null)}},o.prototype.add=function(t,e){var i,o=[],n=this;if(Array.isArray(t))for(var s=0,r=t.length;r>s;s++)i=n._addItem(t[s]),o.push(i);else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=n._addItem(t),o.push(i)}return o.length&&this._trigger("add",{items:o},e),o},o.prototype.update=function(t,e){var i=[],o=[],n=[],r=[],a=this,h=a._fieldId,d=function(t){var e=t[h];if(a._data[e]){var d=s.extend({},a._data[e]);e=a._updateItem(t),o.push(e),r.push(t),n.push(d)}else e=a._addItem(t),i.push(e)};if(Array.isArray(t))for(var l=0,c=t.length;c>l;l++)t[l]instanceof Object?d(t[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!(t instanceof Object))throw new Error("Unknown dataType");d(t)}if(i.length&&this._trigger("add",{items:i},e),o.length){var u={items:o,oldData:n,data:r};this._trigger("update",u,e)}return i.concat(o)},o.prototype.get=function(t){var e,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(e=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,c,u,p,f=o&&o.type||this._options.type,m=o&&o.filter,v=[];if(void 0!=e)d=n._getItem(e,f),d&&m&&!m(d)&&(d=null);else if(void 0!=i)for(u=0,p=i.length;p>u;u++)d=n._getItem(i[u],f),m&&!m(d)||v.push(d);else for(l=Object.keys(this._data),u=0,p=l.length;p>u;u++)c=l[u],d=n._getItem(c,f),m&&!m(d)||v.push(d);if(o&&o.order&&void 0==e&&this._sort(v,o.order),o&&o.fields){var g=o.fields;if(void 0!=e)d=this._filterFields(d,g);else for(u=0,p=v.length;p>u;u++)v[u]=this._filterFields(v[u],g)}if("Object"==a){var y,b={};for(u=0,p=v.length;p>u;u++)y=v[u],b[y.id]=y;return b}return void 0!=e?d:v},o.prototype.getIds=function(t){var e,i,o,n,s,r=this._data,a=t&&t.filter,h=t&&t.order,d=t&&t.type||this._options.type,l=Object.keys(r),c=[];if(a)if(h){for(s=[],e=0,i=l.length;i>e;e++)o=l[e],n=this._getItem(o,d),a(n)&&s.push(n);for(this._sort(s,h),e=0,i=s.length;i>e;e++)c.push(s[e][this._fieldId])}else for(e=0,i=l.length;i>e;e++)o=l[e],n=this._getItem(o,d),a(n)&&c.push(n[this._fieldId]);else if(h){for(s=[],e=0,i=l.length;i>e;e++)o=l[e],s.push(r[o]);for(this._sort(s,h),e=0,i=s.length;i>e;e++)c.push(s[e][this._fieldId])}else for(e=0,i=l.length;i>e;e++)o=l[e],n=r[o],c.push(n[this._fieldId]);return c},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(t,e){var i,o,n,s,r=e&&e.filter,a=e&&e.type||this._options.type,h=this._data,d=Object.keys(h);if(e&&e.order){var l=this.get(e);for(i=0,o=l.length;o>i;i++)n=l[i],s=n[this._fieldId],t(n,s)}else for(i=0,o=d.length;o>i;i++)s=d[i],n=this._getItem(s,a),r&&!r(n)||t(n,s)},o.prototype.map=function(t,e){var i,o,n,s,r=e&&e.filter,a=e&&e.type||this._options.type,h=[],d=this._data,l=Object.keys(d);for(i=0,o=l.length;o>i;i++)n=l[i],s=this._getItem(n,a),r&&!r(s)||h.push(t(s,n));return e&&e.order&&this._sort(h,e.order),h},o.prototype._filterFields=function(t,e){if(!t)return t;var i,o,n={},s=Object.keys(t),r=s.length;if(Array.isArray(e))for(i=0;r>i;i++)o=s[i],-1!=e.indexOf(o)&&(n[o]=t[o]);else for(i=0;r>i;i++)o=s[i],e.hasOwnProperty(o)&&(n[e[o]]=t[o]);return n},o.prototype._sort=function(t,e){if(s.isString(e)){var i=e;t.sort(function(t,e){var o=t[i],n=e[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}},o.prototype.remove=function(t,e){var i,o,n,s=[];if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)n=this._remove(t[i]),null!=n&&s.push(n);else n=this._remove(t),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},e),s},o.prototype._remove=function(t){if(s.isNumber(t)||s.isString(t)){if(this._data[t])return delete this._data[t],this.length--,t}else if(t instanceof Object){var e=t[this._fieldId];if(void 0!==e&&this._data[e])return delete this._data[e],this.length--,e}return null},o.prototype.clear=function(t){var e=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:e},t),e},o.prototype.max=function(t){var e,i,o=this._data,n=Object.keys(o),s=null,r=null;for(e=0,i=n.length;i>e;e++){var a=n[e],h=o[a],d=h[t];null!=d&&(!s||d>r)&&(s=h,r=d)}return s},o.prototype.min=function(t){var e,i,o=this._data,n=Object.keys(o),s=null,r=null;for(e=0,i=n.length;i>e;e++){var a=n[e],h=o[a],d=h[t];null!=d&&(!s||r>d)&&(s=h,r=d)}return s},o.prototype.distinct=function(t){var e,i,o,n=this._data,r=Object.keys(n),a=[],h=this._options.type&&this._options.type[t]||null,d=0;for(e=0,o=r.length;o>e;e++){var l=r[e],c=n[l],u=c[t],p=!1;for(i=0;d>i;i++)if(a[i]==u){p=!0;break}p||void 0===u||(a[d]=u,d++)}if(h)for(e=0,o=a.length;o>e;e++)a[e]=s.convert(a[e],h);return a},o.prototype._addItem=function(t){var e=t[this._fieldId];if(void 0!=e){if(this._data[e])throw new Error("Cannot add item: item with id "+e+" already exists")}else e=s.randomUUID(),t[this._fieldId]=e;var i,o,n={},r=Object.keys(t);for(i=0,o=r.length;o>i;i++){var a=r[i],h=this._type[a];n[a]=s.convert(t[a],h)}return this._data[e]=n,this.length++,e},o.prototype._getItem=function(t,e){var i,o,n,r,a=this._data[t];if(!a)return null;var h={},d=Object.keys(a);if(e)for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=s.convert(o,e[i]);else for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=o;return h},o.prototype._updateItem=function(t){var e=t[this._fieldId];if(void 0==e)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this._data[e];if(!i)throw new Error("Cannot update item: no item with id "+e+" found");for(var o=Object.keys(t),n=0,r=o.length;r>n;n++){var a=o[n],h=this._type[a];i[a]=s.convert(t[a],h)}return e},t.exports=o},function(t,e){function i(t){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(t)}i.prototype.setOptions=function(t){t&&"undefined"!=typeof t.delay&&(this.delay=t.delay),t&&"undefined"!=typeof t.max&&(this.max=t.max),this._flushIfNeeded()},i.extend=function(t,e){var o=new i(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){o.flush()};var n=[{name:"flush",original:void 0}];if(e&&e.replace)for(var s=0;s<e.replace.length;s++){var r=e.replace[s];n.push({name:r,original:t[r]}),o.replace(t,r)}return o._extended={object:t,methods:n},o},i.prototype.destroy=function(){if(this.flush(),this._extended){for(var t=this._extended.object,e=this._extended.methods,i=0;i<e.length;i++){var o=e[i];o.original?t[o.name]=o.original:delete t[o.name]}this._extended=null}},i.prototype.replace=function(t,e){var i=this,o=t[e];if(!o)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.queue({args:t,fn:o,context:this})}},i.prototype.queue=function(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()},i.prototype._flushIfNeeded=function(){if(this._queue.length>this.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var n=i(1),s=i(9);o.prototype.setData=function(t){var e,i,o,n;if(this._data&&(this._data.off&&this._data.off("*",this.listener),e=Object.keys(this._ids),this._ids={},this.length=0,this._trigger("remove",{items:e})),this._data=t,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",e=this._data.getIds({filter:this._options&&this._options.filter}),o=0,n=e.length;n>o;o++)i=e[o],this._ids[i]=!0;this.length=e.length,this._trigger("add",{items:e}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){var t,e,i,o=this._data.getIds({filter:this._options&&this._options.filter}),n=Object.keys(this._ids),s={},r=[],a=[];for(e=0,i=o.length;i>e;e++)t=o[e],s[t]=!0,this._ids[t]||(r.push(t),this._ids[t]=!0);for(e=0,i=n.length;i>e;e++)t=n[e],s[t]||(a.push(t),delete this._ids[t]);this.length+=r.length-a.length,r.length&&this._trigger("add",{items:r}),a.length&&this._trigger("remove",{items:a})},o.prototype.get=function(t){var e,i,o,s=this,r=n.getType(arguments[0]);"String"==r||"Number"==r||"Array"==r?(e=arguments[0],i=arguments[1],o=arguments[2]):(i=arguments[0],o=arguments[1]);var a=n.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(t){return s._options.filter(t)&&i.filter(t)});var h=[];return void 0!=e&&h.push(e),h.push(a),h.push(o),this._data&&this._data.get.apply(this._data,h)},o.prototype.getIds=function(t){var e;if(this._data){var i,o=this._options.filter;i=t&&t.filter?o?function(e){return o(e)&&t.filter(e)}:t.filter:o,e=this._data.getIds({filter:i,order:t&&t.order})}else e=[];return e},o.prototype.map=function(t,e){var i=[];if(this._data){var o,n=this._options.filter;o=e&&e.filter?n?function(t){return n(t)&&e.filter(t)}:e.filter:n,i=this._data.map(t,{filter:o,order:e&&e.order})}else i=[];return i},o.prototype.getDataSet=function(){for(var t=this;t instanceof o;)t=t._data;return t||null},o.prototype._onEvent=function(t,e,i){var o,n,s,r,a=e&&e.items,h=this._data,d=[],l=[],c=[],u=[];if(a&&h){switch(t){case"add":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r&&(this._ids[s]=!0,l.push(s));break;case"update":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r?this._ids[s]?(c.push(s),d.push(e.data[o])):(this._ids[s]=!0,l.push(s)):this._ids[s]&&(delete this._ids[s],u.push(s));break;case"remove":for(o=0,n=a.length;n>o;o++)s=a[o],this._ids[s]&&(delete this._ids[s],u.push(s))}this.length+=l.length-u.length,l.length&&this._trigger("add",{items:l},i),c.length&&this._trigger("update",{items:c,data:d},i),u.length&&this._trigger("remove",{items:u},i)}},o.prototype.on=s.prototype.on,o.prototype.off=s.prototype.off,o.prototype._trigger=s.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,t.exports=o},function(t,e,i){function o(t,e,i){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.width="400px",this.height="400px",this.margin=10,this.defaultXCenter="55%",this.defaultYCenter="50%",this.xLabel="x",this.yLabel="y",this.zLabel="z";var n=function(t){return t};this.xValueLabel=n,this.yValueLabel=n,this.zValueLabel=n,this.filterLabel="time",this.legendLabel="value",this.style=o.STYLE.DOT,this.showPerspective=!0,this.showGrid=!0,this.keepAspectRatio=!0,this.showShadow=!1,this.showGrayBottom=!1,this.showTooltip=!1,this.verticalRatio=.5,this.animationInterval=1e3,this.animationPreload=!1,this.camera=new p,this.camera.setArmRotation(1,.5),this.camera.setArmLength(1.7),this.eye=new c(0,0,-1),this.dataTable=null,this.dataPoints=null,this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.colFilter=void 0,this.xMin=0,this.xStep=void 0,this.xMax=1,this.yMin=0,this.yStep=void 0,this.yMax=1,this.zMin=0,this.zStep=void 0,this.zMax=1,this.valueMin=0,this.valueMax=1,this.xBarWidth=1,this.yBarWidth=1,this.axisColor="#4D4D4D",this.gridColor="#D3D3D3",this.dataColor={fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},this.dotSizeRatio=.02,this.create(),this.setOptions(i),e&&this.setData(e)}function n(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function s(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=i(13),h=i(9),d=i(11),l=i(1),c=i(14),u=i(15),p=i(16),f=i(17),m=i(18),v=i(19);a(o.prototype),o.prototype._setScale=function(){this.scale=new c(1/(this.xMax-this.xMin),1/(this.yMax-this.yMin),1/(this.zMax-this.zMin)),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,this.scale.value=1/(this.valueMax-this.valueMin);var t=(this.xMax+this.xMin)/2*this.scale.x,e=(this.yMax+this.yMin)/2*this.scale.y,i=(this.zMax+this.zMin)/2*this.scale.z;this.camera.setArmLocation(t,e,i)},o.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},o.prototype._convertPointToTranslation=function(t){var e=t.x*this.scale.x,i=t.y*this.scale.y,o=t.z*this.scale.z,n=this.camera.getCameraLocation().x,s=this.camera.getCameraLocation().y,r=this.camera.getCameraLocation().z,a=Math.sin(this.camera.getCameraRotation().x),h=Math.cos(this.camera.getCameraRotation().x),d=Math.sin(this.camera.getCameraRotation().y),l=Math.cos(this.camera.getCameraRotation().y),u=Math.sin(this.camera.getCameraRotation().z),p=Math.cos(this.camera.getCameraRotation().z),f=l*(u*(i-s)+p*(e-n))-d*(o-r),m=a*(l*(o-r)+d*(u*(i-s)+p*(e-n)))+h*(p*(i-s)-u*(e-n)),v=h*(l*(o-r)+d*(u*(i-s)+p*(e-n)))-a*(p*(i-s)-u*(e-n));return new c(f,m,v)},o.prototype._convertTranslationToScreen=function(t){var e,i,o=this.eye.x,n=this.eye.y,s=this.eye.z,r=t.x,a=t.y,h=t.z;return this.showPerspective?(e=(r-o)*(s/h),i=(a-n)*(s/h)):(e=r*-(s/this.camera.getArmLength()),i=a*-(s/this.camera.getArmLength())),new u(this.xcenter+e*this.frame.canvas.clientWidth,this.ycenter-i*this.frame.canvas.clientWidth)},o.prototype._setBackgroundColor=function(t){var e="white",i="gray",o=1;if("string"==typeof t)e=t,i="none",o=0;else if("object"===("undefined"==typeof t?"undefined":r(t)))void 0!==t.fill&&(e=t.fill),void 0!==t.stroke&&(i=t.stroke),void 0!==t.strokeWidth&&(o=t.strokeWidth);else if(void 0!==t)throw"Unsupported type of backgroundColor";this.frame.style.backgroundColor=e,this.frame.style.borderColor=i,this.frame.style.borderWidth=o+"px",this.frame.style.borderStyle="solid"},o.STYLE={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},o.prototype._getStyleNumber=function(t){switch(t){case"dot":return o.STYLE.DOT;case"dot-line":return o.STYLE.DOTLINE;case"dot-color":return o.STYLE.DOTCOLOR;case"dot-size":return o.STYLE.DOTSIZE;case"line":return o.STYLE.LINE;case"grid":return o.STYLE.GRID;case"surface":return o.STYLE.SURFACE;case"bar":return o.STYLE.BAR;case"bar-color":return o.STYLE.BARCOLOR;case"bar-size":return o.STYLE.BARSIZE}return-1},o.prototype._determineColumnIndexes=function(t,e){if(this.style===o.STYLE.DOT||this.style===o.STYLE.DOTLINE||this.style===o.STYLE.LINE||this.style===o.STYLE.GRID||this.style===o.STYLE.SURFACE||this.style===o.STYLE.BAR)this.colX=0,this.colY=1,this.colZ=2,this.colValue=void 0,t.getNumberOfColumns()>3&&(this.colFilter=3);else{if(this.style!==o.STYLE.DOTCOLOR&&this.style!==o.STYLE.DOTSIZE&&this.style!==o.STYLE.BARCOLOR&&this.style!==o.STYLE.BARSIZE)throw'Unknown style "'+this.style+'"';this.colX=0,this.colY=1,this.colZ=2,this.colValue=3,t.getNumberOfColumns()>4&&(this.colFilter=4)}},o.prototype.getNumberOfRows=function(t){return t.length},o.prototype.getNumberOfColumns=function(t){var e=0;for(var i in t[0])t[0].hasOwnProperty(i)&&e++;return e},o.prototype.getDistinctValues=function(t,e){for(var i=[],o=0;o<t.length;o++)-1==i.indexOf(t[o][e])&&i.push(t[o][e]);return i},o.prototype.getColumnRange=function(t,e){for(var i={min:t[0][e],max:t[0][e]},o=0;o<t.length;o++)i.min>t[o][e]&&(i.min=t[o][e]),i.max<t[o][e]&&(i.max=t[o][e]);return i},o.prototype._dataInitialize=function(t,e){var i=this;if(this.dataSet&&this.dataSet.off("*",this._onChange),void 0!==t){Array.isArray(t)&&(t=new h(t));var n;if(!(t instanceof h||t instanceof d))throw new Error("Array, DataSet, or DataView expected");if(n=t.get(),0!=n.length){this.dataSet=t,this.dataTable=n,this._onChange=function(){i.setData(i.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z",this.colValue="style",this.colFilter="filter",n[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new f(t,this.colFilter,this),this.dataFilter.setOnLoadCallback(function(){i.redraw()}));var s=this.style==o.STYLE.BAR||this.style==o.STYLE.BARCOLOR||this.style==o.STYLE.BARSIZE;if(s){if(void 0!==this.defaultXBarWidth)this.xBarWidth=this.defaultXBarWidth;else{var r=this.getDistinctValues(n,this.colX);this.xBarWidth=r[1]-r[0]||1}if(void 0!==this.defaultYBarWidth)this.yBarWidth=this.defaultYBarWidth;else{var a=this.getDistinctValues(n,this.colY);this.yBarWidth=a[1]-a[0]||1}}var l=this.getColumnRange(n,this.colX);s&&(l.min-=this.xBarWidth/2,l.max+=this.xBarWidth/2),this.xMin=void 0!==this.defaultXMin?this.defaultXMin:l.min,this.xMax=void 0!==this.defaultXMax?this.defaultXMax:l.max,this.xMax<=this.xMin&&(this.xMax=this.xMin+1),this.xStep=void 0!==this.defaultXStep?this.defaultXStep:(this.xMax-this.xMin)/5;var c=this.getColumnRange(n,this.colY);s&&(c.min-=this.yBarWidth/2,c.max+=this.yBarWidth/2),this.yMin=void 0!==this.defaultYMin?this.defaultYMin:c.min,this.yMax=void 0!==this.defaultYMax?this.defaultYMax:c.max,this.yMax<=this.yMin&&(this.yMax=this.yMin+1),this.yStep=void 0!==this.defaultYStep?this.defaultYStep:(this.yMax-this.yMin)/5;var u=this.getColumnRange(n,this.colZ);if(this.zMin=void 0!==this.defaultZMin?this.defaultZMin:u.min,this.zMax=void 0!==this.defaultZMax?this.defaultZMax:u.max,this.zMax<=this.zMin&&(this.zMax=this.zMin+1),this.zStep=void 0!==this.defaultZStep?this.defaultZStep:(this.zMax-this.zMin)/5,void 0!==this.colValue){var p=this.getColumnRange(n,this.colValue);this.valueMin=void 0!==this.defaultValueMin?this.defaultValueMin:p.min,this.valueMax=void 0!==this.defaultValueMax?this.defaultValueMax:p.max,this.valueMax<=this.valueMin&&(this.valueMax=this.valueMin+1)}this._setScale()}}},o.prototype._getDataPoints=function(t){var e,i,n,s,r,a,h=[];if(this.style===o.STYLE.GRID||this.style===o.STYLE.SURFACE){var d=[],l=[];for(n=0;n<this.getNumberOfRows(t);n++)e=t[n][this.colX]||0,i=t[n][this.colY]||0,-1===d.indexOf(e)&&d.push(e),-1===l.indexOf(i)&&l.push(i);var u=function(t,e){return t-e};d.sort(u),l.sort(u);var p=[];for(n=0;n<t.length;n++){e=t[n][this.colX]||0,i=t[n][this.colY]||0,s=t[n][this.colZ]||0;var f=d.indexOf(e),m=l.indexOf(i);void 0===p[f]&&(p[f]=[]);var v=new c;v.x=e,v.y=i,v.z=s,r={},r.point=v,r.trans=void 0,r.screen=void 0,r.bottom=new c(e,i,this.zMin),p[f][m]=r,h.push(r)}for(e=0;e<p.length;e++)for(i=0;i<p[e].length;i++)p[e][i]&&(p[e][i].pointRight=e<p.length-1?p[e+1][i]:void 0,p[e][i].pointTop=i<p[e].length-1?p[e][i+1]:void 0,p[e][i].pointCross=e<p.length-1&&i<p[e].length-1?p[e+1][i+1]:void 0)}else for(n=0;n<t.length;n++)a=new c,a.x=t[n][this.colX]||0,a.y=t[n][this.colY]||0,a.z=t[n][this.colZ]||0,void 0!==this.colValue&&(a.value=t[n][this.colValue]||0),r={},r.point=a,r.bottom=new c(a.x,a.y,this.zMin),r.trans=void 0,r.screen=void 0,h.push(r);return h},o.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);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.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this,i=function(t){e._onMouseDown(t)},o=function(t){e._onTouchStart(t)},n=function(t){e._onWheel(t)},s=function(t){e._onTooltip(t)};l.addEventListener(this.frame.canvas,"keydown",onkeydown),l.addEventListener(this.frame.canvas,"mousedown",i),l.addEventListener(this.frame.canvas,"touchstart",o),l.addEventListener(this.frame.canvas,"mousewheel",n),l.addEventListener(this.frame.canvas,"mousemove",s),this.containerElement.appendChild(this.frame)},o.prototype.setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},o.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},o.prototype.animationStart=function(){if(!this.frame.filter||!this.frame.filter.slider)throw"No animation available";this.frame.filter.slider.play()},o.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},o.prototype._resizeCenter=function(){"%"===this.defaultXCenter.charAt(this.defaultXCenter.length-1)?this.xcenter=parseFloat(this.defaultXCenter)/100*this.frame.canvas.clientWidth:this.xcenter=parseFloat(this.defaultXCenter),"%"===this.defaultYCenter.charAt(this.defaultYCenter.length-1)?this.ycenter=parseFloat(this.defaultYCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.ycenter=parseFloat(this.defaultYCenter)},o.prototype.setCameraPosition=function(t){void 0!==t&&(void 0!==t.horizontal&&void 0!==t.vertical&&this.camera.setArmRotation(t.horizontal,t.vertical),void 0!==t.distance&&this.camera.setArmLength(t.distance),this.redraw())},o.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},o.prototype._readData=function(t){this._dataInitialize(t,this.style),this.dataFilter?this.dataPoints=this.dataFilter._getDataPoints():this.dataPoints=this._getDataPoints(this.dataTable),this._redrawFilter()},o.prototype.setData=function(t){this._readData(t),this.redraw(),this.animationAutoStart&&this.dataFilter&&this.animationStart()},o.prototype.setOptions=function(t){var e=void 0;if(this.animationStop(),void 0!==t){if(void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.xCenter&&(this.defaultXCenter=t.xCenter),void 0!==t.yCenter&&(this.defaultYCenter=t.yCenter),void 0!==t.filterLabel&&(this.filterLabel=t.filterLabel),void 0!==t.legendLabel&&(this.legendLabel=t.legendLabel),void 0!==t.xLabel&&(this.xLabel=t.xLabel),void 0!==t.yLabel&&(this.yLabel=t.yLabel),void 0!==t.zLabel&&(this.zLabel=t.zLabel),void 0!==t.xValueLabel&&(this.xValueLabel=t.xValueLabel),void 0!==t.yValueLabel&&(this.yValueLabel=t.yValueLabel),void 0!==t.zValueLabel&&(this.zValueLabel=t.zValueLabel),void 0!==t.dotSizeRatio&&(this.dotSizeRatio=t.dotSizeRatio),void 0!==t.style){var i=this._getStyleNumber(t.style);-1!==i&&(this.style=i)}void 0!==t.showGrid&&(this.showGrid=t.showGrid),void 0!==t.showPerspective&&(this.showPerspective=t.showPerspective),void 0!==t.showShadow&&(this.showShadow=t.showShadow),void 0!==t.tooltip&&(this.showTooltip=t.tooltip),void 0!==t.showAnimationControls&&(this.showAnimationControls=t.showAnimationControls),void 0!==t.keepAspectRatio&&(this.keepAspectRatio=t.keepAspectRatio),void 0!==t.verticalRatio&&(this.verticalRatio=t.verticalRatio),void 0!==t.animationInterval&&(this.animationInterval=t.animationInterval),void 0!==t.animationPreload&&(this.animationPreload=t.animationPreload),void 0!==t.animationAutoStart&&(this.animationAutoStart=t.animationAutoStart),void 0!==t.xBarWidth&&(this.defaultXBarWidth=t.xBarWidth),void 0!==t.yBarWidth&&(this.defaultYBarWidth=t.yBarWidth),void 0!==t.xMin&&(this.defaultXMin=t.xMin),void 0!==t.xStep&&(this.defaultXStep=t.xStep),void 0!==t.xMax&&(this.defaultXMax=t.xMax),void 0!==t.yMin&&(this.defaultYMin=t.yMin),void 0!==t.yStep&&(this.defaultYStep=t.yStep),void 0!==t.yMax&&(this.defaultYMax=t.yMax),void 0!==t.zMin&&(this.defaultZMin=t.zMin),void 0!==t.zStep&&(this.defaultZStep=t.zStep),void 0!==t.zMax&&(this.defaultZMax=t.zMax),void 0!==t.valueMin&&(this.defaultValueMin=t.valueMin),void 0!==t.valueMax&&(this.defaultValueMax=t.valueMax),void 0!==t.backgroundColor&&this._setBackgroundColor(t.backgroundColor),void 0!==t.cameraPosition&&(e=t.cameraPosition),void 0!==e&&(this.camera.setArmRotation(e.horizontal,e.vertical),this.camera.setArmLength(e.distance)),void 0!==t.axisColor&&(this.axisColor=t.axisColor),void 0!==t.gridColor&&(this.gridColor=t.gridColor),t.dataColor&&("string"==typeof t.dataColor?(this.dataColor.fill=t.dataColor,this.dataColor.stroke=t.dataColor):(t.dataColor.fill&&(this.dataColor.fill=t.dataColor.fill),t.dataColor.stroke&&(this.dataColor.stroke=t.dataColor.stroke),void 0!==t.dataColor.strokeWidth&&(this.dataColor.strokeWidth=t.dataColor.strokeWidth)))}this.setSize(this.width,this.height),this.dataTable&&this.setData(this.dataTable),this.animationAutoStart&&this.dataFilter&&this.animationStart()},o.prototype.redraw=function(){if(void 0===this.dataPoints)throw"Error: graph data not initialized";this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this.style===o.STYLE.GRID||this.style===o.STYLE.SURFACE?this._redrawDataGrid():this.style===o.STYLE.LINE?this._redrawDataLine():this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE?this._redrawDataBar():this._redrawDataDot(),this._redrawInfo(),this._redrawLegend()},o.prototype._redrawClear=function(){var t=this.frame.canvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height)},o.prototype._redrawLegend=function(){var t;if(this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.DOTSIZE){var e,i,n=this.frame.clientWidth*this.dotSizeRatio;this.style===o.STYLE.DOTSIZE?(e=n/2,i=n/2+2*n):(e=20,i=20);var s=Math.max(.25*this.frame.clientHeight,100),r=this.margin,a=this.frame.clientWidth-this.margin,h=a-i,d=r+s}var l=this.frame.canvas,c=l.getContext("2d");if(c.lineWidth=1,c.font="14px arial",this.style===o.STYLE.DOTCOLOR){var u=0,p=s;for(t=u;p>t;t++){var f=(t-u)/(p-u),m=240*f,g=this._hsv2rgb(m,1,1);c.strokeStyle=g,c.beginPath(),c.moveTo(h,r+t),c.lineTo(a,r+t),c.stroke()}c.strokeStyle=this.axisColor,c.strokeRect(h,r,i,s)}if(this.style===o.STYLE.DOTSIZE&&(c.strokeStyle=this.axisColor,c.fillStyle=this.dataColor.fill,c.beginPath(),c.moveTo(h,r),c.lineTo(a,r),c.lineTo(a-i+e,d),c.lineTo(h,d),c.closePath(),c.fill(),c.stroke()),this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.DOTSIZE){var y=5,b=new v(this.valueMin,this.valueMax,(this.valueMax-this.valueMin)/5,!0);for(b.start(),b.getCurrent()<this.valueMin&&b.next();!b.end();)t=d-(b.getCurrent()-this.valueMin)/(this.valueMax-this.valueMin)*s,c.beginPath(),c.moveTo(h-y,t),c.lineTo(h,t),c.stroke(),c.textAlign="right",c.textBaseline="middle",c.fillStyle=this.axisColor,c.fillText(b.getCurrent(),h-2*y,t),b.next();c.textAlign="right",c.textBaseline="top";var w=this.legendLabel;c.fillText(w,a,d+this.margin)}},o.prototype._redrawFilter=function(){if(this.frame.filter.innerHTML="",this.dataFilter){var t={visible:this.showAnimationControls},e=new m(this.frame.filter,t);this.frame.filter.slider=e,this.frame.filter.style.padding="10px",e.setValues(this.dataFilter.values),e.setPlayInterval(this.animationInterval);var i=this,o=function(){var t=e.getIndex();i.dataFilter.selectValue(t),i.dataPoints=i.dataFilter._getDataPoints(),i.redraw()};e.setOnChangeCallback(o)}else this.frame.filter.slider=void 0},o.prototype._redrawSlider=function(){void 0!==this.frame.filter.slider&&this.frame.filter.slider.redraw()},o.prototype._redrawInfo=function(){if(this.dataFilter){var t=this.frame.canvas,e=t.getContext("2d");e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var i=this.margin,o=this.margin;e.fillText(this.dataFilter.getLabel()+": "+this.dataFilter.getSelectedValue(),i,o)}},o.prototype._redrawAxis=function(){var t,e,i,o,n,s,r,a,h,d,l,u,p,f=this.frame.canvas,m=f.getContext("2d");m.font=24/this.camera.getArmLength()+"px arial";var g=.025/this.scale.x,y=.025/this.scale.y,b=5/this.camera.getArmLength(),w=this.camera.getArmRotation().horizontal;for(m.lineWidth=1,o=void 0===this.defaultXStep,i=new v(this.xMin,this.xMax,this.xStep,o),i.start(),i.getCurrent()<this.xMin&&i.next();!i.end();){var _=i.getCurrent();this.showGrid?(t=this._convert3Dto2D(new c(_,this.yMin,this.zMin)),e=this._convert3Dto2D(new c(_,this.yMax,this.zMin)),m.strokeStyle=this.gridColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()):(t=this._convert3Dto2D(new c(_,this.yMin,this.zMin)),e=this._convert3Dto2D(new c(_,this.yMin+g,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new c(_,this.yMax,this.zMin)),e=this._convert3Dto2D(new c(_,this.yMax-g,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()),r=Math.cos(w)>0?this.yMin:this.yMax,n=this._convert3Dto2D(new c(_,r,this.zMin)),Math.cos(2*w)>0?(m.textAlign="center",m.textBaseline="top",n.y+=b):Math.sin(2*w)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.xValueLabel(i.getCurrent())+" ",n.x,n.y),i.next()}for(m.lineWidth=1,o=void 0===this.defaultYStep,i=new v(this.yMin,this.yMax,this.yStep,o),i.start(),i.getCurrent()<this.yMin&&i.next();!i.end();)this.showGrid?(t=this._convert3Dto2D(new c(this.xMin,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new c(this.xMax,i.getCurrent(),this.zMin)),m.strokeStyle=this.gridColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()):(t=this._convert3Dto2D(new c(this.xMin,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new c(this.xMin+y,i.getCurrent(),this.zMin)),
+m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new c(this.xMax,i.getCurrent(),this.zMin)),e=this._convert3Dto2D(new c(this.xMax-y,i.getCurrent(),this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke()),s=Math.sin(w)>0?this.xMin:this.xMax,n=this._convert3Dto2D(new c(s,i.getCurrent(),this.zMin)),Math.cos(2*w)<0?(m.textAlign="center",m.textBaseline="top",n.y+=b):Math.sin(2*w)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.yValueLabel(i.getCurrent())+" ",n.x,n.y),i.next();for(m.lineWidth=1,o=void 0===this.defaultZStep,i=new v(this.zMin,this.zMax,this.zStep,o),i.start(),i.getCurrent()<this.zMin&&i.next(),s=Math.cos(w)>0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax;!i.end();)t=this._convert3Dto2D(new c(s,r,i.getCurrent())),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(t.x-b,t.y),m.stroke(),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(this.zValueLabel(i.getCurrent())+" ",t.x-5,t.y),i.next();m.lineWidth=1,t=this._convert3Dto2D(new c(s,r,this.zMin)),e=this._convert3Dto2D(new c(s,r,this.zMax)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),m.lineWidth=1,u=this._convert3Dto2D(new c(this.xMin,this.yMin,this.zMin)),p=this._convert3Dto2D(new c(this.xMax,this.yMin,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(u.x,u.y),m.lineTo(p.x,p.y),m.stroke(),u=this._convert3Dto2D(new c(this.xMin,this.yMax,this.zMin)),p=this._convert3Dto2D(new c(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(u.x,u.y),m.lineTo(p.x,p.y),m.stroke(),m.lineWidth=1,t=this._convert3Dto2D(new c(this.xMin,this.yMin,this.zMin)),e=this._convert3Dto2D(new c(this.xMin,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke(),t=this._convert3Dto2D(new c(this.xMax,this.yMin,this.zMin)),e=this._convert3Dto2D(new c(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(t.x,t.y),m.lineTo(e.x,e.y),m.stroke();var x=this.xLabel;x.length>0&&(l=.1/this.scale.y,s=(this.xMin+this.xMax)/2,r=Math.cos(w)>0?this.yMin-l:this.yMax+l,n=this._convert3Dto2D(new c(s,r,this.zMin)),Math.cos(2*w)>0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*w)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(x,n.x,n.y));var k=this.yLabel;k.length>0&&(d=.1/this.scale.x,s=Math.sin(w)>0?this.xMin-d:this.xMax+d,r=(this.yMin+this.yMax)/2,n=this._convert3Dto2D(new c(s,r,this.zMin)),Math.cos(2*w)<0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*w)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(k,n.x,n.y));var O=this.zLabel;O.length>0&&(h=30,s=Math.cos(w)>0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax,a=(this.zMin+this.zMax)/2,n=this._convert3Dto2D(new c(s,r,a)),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(O,n.x-h,n.y))},o.prototype._hsv2rgb=function(t,e,i){var o,n,s,r,a,h;switch(r=i*e,a=Math.floor(t/60),h=r*(1-Math.abs(t/60%2-1)),a){case 0:o=r,n=h,s=0;break;case 1:o=h,n=r,s=0;break;case 2:o=0,n=r,s=h;break;case 3:o=0,n=h,s=r;break;case 4:o=h,n=0,s=r;break;case 5:o=r,n=0,s=h;break;default:o=0,n=0,s=0}return"RGB("+parseInt(255*o)+","+parseInt(255*n)+","+parseInt(255*s)+")"},o.prototype._redrawDataGrid=function(){var t,e,i,n,s,r,a,h,d,l,u,p,f=this.frame.canvas,m=f.getContext("2d");if(m.lineJoin="round",m.lineCap="round",!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(s=0;s<this.dataPoints.length;s++){var v=this._convertPointToTranslation(this.dataPoints[s].point),g=this._convertTranslationToScreen(v);this.dataPoints[s].trans=v,this.dataPoints[s].screen=g;var y=this._convertPointToTranslation(this.dataPoints[s].bottom);this.dataPoints[s].dist=this.showPerspective?y.length():-y.z}var b=function(t,e){return e.dist-t.dist};if(this.dataPoints.sort(b),this.style===o.STYLE.SURFACE){for(s=0;s<this.dataPoints.length;s++)if(t=this.dataPoints[s],e=this.dataPoints[s].pointRight,i=this.dataPoints[s].pointTop,n=this.dataPoints[s].pointCross,void 0!==t&&void 0!==e&&void 0!==i&&void 0!==n){if(this.showGrayBottom||this.showShadow){var w=c.subtract(n.trans,t.trans),_=c.subtract(i.trans,e.trans),x=c.crossProduct(w,_),k=x.length();r=x.z>0}else r=!0;r?(p=(t.point.z+e.point.z+i.point.z+n.point.z)/4,d=240*(1-(p-this.zMin)*this.scale.z/this.verticalRatio),l=1,this.showShadow?(u=Math.min(1+x.x/k/2,1),a=this._hsv2rgb(d,l,u),h=a):(u=1,a=this._hsv2rgb(d,l,u),h=this.axisColor)):(a="gray",h=this.axisColor),m.lineWidth=this._getStrokeWidth(t),m.fillStyle=a,m.strokeStyle=h,m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(e.screen.x,e.screen.y),m.lineTo(n.screen.x,n.screen.y),m.lineTo(i.screen.x,i.screen.y),m.closePath(),m.fill(),m.stroke()}}else for(s=0;s<this.dataPoints.length;s++)t=this.dataPoints[s],e=this.dataPoints[s].pointRight,i=this.dataPoints[s].pointTop,void 0!==t&&void 0!==e&&(p=(t.point.z+e.point.z)/2,d=240*(1-(p-this.zMin)*this.scale.z/this.verticalRatio),m.lineWidth=2*this._getStrokeWidth(t),m.strokeStyle=this._hsv2rgb(d,1,1),m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(e.screen.x,e.screen.y),m.stroke()),void 0!==t&&void 0!==i&&(p=(t.point.z+i.point.z)/2,d=240*(1-(p-this.zMin)*this.scale.z/this.verticalRatio),m.lineWidth=2*this._getStrokeWidth(t),m.strokeStyle=this._hsv2rgb(d,1,1),m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(i.screen.x,i.screen.y),m.stroke())}},o.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},o.prototype._redrawDataDot=function(){var t,e=this.frame.canvas,i=e.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t<this.dataPoints.length;t++){var n=this._convertPointToTranslation(this.dataPoints[t].point),s=this._convertTranslationToScreen(n);this.dataPoints[t].trans=n,this.dataPoints[t].screen=s;var r=this._convertPointToTranslation(this.dataPoints[t].bottom);this.dataPoints[t].dist=this.showPerspective?r.length():-r.z}var a=function(t,e){return e.dist-t.dist};this.dataPoints.sort(a);var h=this.frame.clientWidth*this.dotSizeRatio;for(t=0;t<this.dataPoints.length;t++){var d=this.dataPoints[t];if(this.style===o.STYLE.DOTLINE){var l=this._convert3Dto2D(d.bottom);i.lineWidth=1,i.strokeStyle=this.gridColor,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(d.screen.x,d.screen.y),i.stroke()}var c;c=this.style===o.STYLE.DOTSIZE?h/2+2*h*(d.point.value-this.valueMin)/(this.valueMax-this.valueMin):h;var u;u=this.showPerspective?c/-d.trans.z:c*-(this.eye.z/this.camera.getArmLength()),0>u&&(u=0);var p,f,m;this.style===o.STYLE.DOTCOLOR?(p=240*(1-(d.point.value-this.valueMin)*this.scale.value),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)):this.style===o.STYLE.DOTSIZE?(f=this.dataColor.fill,m=this.dataColor.stroke):(p=240*(1-(d.point.z-this.zMin)*this.scale.z/this.verticalRatio),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)),i.lineWidth=this._getStrokeWidth(d),i.strokeStyle=m,i.fillStyle=f,i.beginPath(),i.arc(d.screen.x,d.screen.y,u,0,2*Math.PI,!0),i.fill(),i.stroke()}}},o.prototype._redrawDataBar=function(){var t,e,i,n,s=this.frame.canvas,r=s.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t<this.dataPoints.length;t++){var a=this._convertPointToTranslation(this.dataPoints[t].point),h=this._convertTranslationToScreen(a);this.dataPoints[t].trans=a,this.dataPoints[t].screen=h;var d=this._convertPointToTranslation(this.dataPoints[t].bottom);this.dataPoints[t].dist=this.showPerspective?d.length():-d.z}var l=function(t,e){return e.dist-t.dist};this.dataPoints.sort(l),r.lineJoin="round",r.lineCap="round";var u=this.xBarWidth/2,p=this.yBarWidth/2;for(t=0;t<this.dataPoints.length;t++){var f,m,v,g=this.dataPoints[t];this.style===o.STYLE.BARCOLOR?(f=240*(1-(g.point.value-this.valueMin)*this.scale.value),m=this._hsv2rgb(f,1,1),v=this._hsv2rgb(f,1,.8)):this.style===o.STYLE.BARSIZE?(m=this.dataColor.fill,v=this.dataColor.stroke):(f=240*(1-(g.point.z-this.zMin)*this.scale.z/this.verticalRatio),m=this._hsv2rgb(f,1,1),v=this._hsv2rgb(f,1,.8)),this.style===o.STYLE.BARSIZE&&(u=this.xBarWidth/2*((g.point.value-this.valueMin)/(this.valueMax-this.valueMin)*.8+.2),p=this.yBarWidth/2*((g.point.value-this.valueMin)/(this.valueMax-this.valueMin)*.8+.2));var y=this,b=g.point,w=[{point:new c(b.x-u,b.y-p,b.z)},{point:new c(b.x+u,b.y-p,b.z)},{point:new c(b.x+u,b.y+p,b.z)},{point:new c(b.x-u,b.y+p,b.z)}],_=[{point:new c(b.x-u,b.y-p,this.zMin)},{point:new c(b.x+u,b.y-p,this.zMin)},{point:new c(b.x+u,b.y+p,this.zMin)},{point:new c(b.x-u,b.y+p,this.zMin)}];w.forEach(function(t){t.screen=y._convert3Dto2D(t.point)}),_.forEach(function(t){t.screen=y._convert3Dto2D(t.point)});var x=[{corners:w,center:c.avg(_[0].point,_[2].point)},{corners:[w[0],w[1],_[1],_[0]],center:c.avg(_[1].point,_[0].point)},{corners:[w[1],w[2],_[2],_[1]],center:c.avg(_[2].point,_[1].point)},{corners:[w[2],w[3],_[3],_[2]],center:c.avg(_[3].point,_[2].point)},{corners:[w[3],w[0],_[0],_[3]],center:c.avg(_[0].point,_[3].point)}];for(g.surfaces=x,e=0;e<x.length;e++){i=x[e];var k=this._convertPointToTranslation(i.center);i.dist=this.showPerspective?k.length():-k.z}for(x.sort(function(t,e){var i=e.dist-t.dist;return i?i:t.corners===w?1:e.corners===w?-1:0}),r.lineWidth=this._getStrokeWidth(g),r.strokeStyle=v,r.fillStyle=m,e=2;e<x.length;e++)i=x[e],n=i.corners,r.beginPath(),r.moveTo(n[3].screen.x,n[3].screen.y),r.lineTo(n[0].screen.x,n[0].screen.y),r.lineTo(n[1].screen.x,n[1].screen.y),r.lineTo(n[2].screen.x,n[2].screen.y),r.lineTo(n[3].screen.x,n[3].screen.y),r.fill(),r.stroke()}}},o.prototype._redrawDataLine=function(){var t,e,i=this.frame.canvas,o=i.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(e=0;e<this.dataPoints.length;e++){var n=this._convertPointToTranslation(this.dataPoints[e].point),s=this._convertTranslationToScreen(n);this.dataPoints[e].trans=n,this.dataPoints[e].screen=s}if(this.dataPoints.length>0){for(t=this.dataPoints[0],o.lineWidth=this._getStrokeWidth(t),o.lineJoin="round",o.lineCap="round",o.strokeStyle=this.dataColor.stroke,o.beginPath(),o.moveTo(t.screen.x,t.screen.y),e=1;e<this.dataPoints.length;e++)t=this.dataPoints[e],o.lineTo(t.screen.x,t.screen.y);o.stroke()}}},o.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this.startMouseX=n(t),this.startMouseY=s(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},l.addEventListener(document,"mousemove",e.onmousemove),l.addEventListener(document,"mouseup",e.onmouseup),l.preventDefault(t)}},o.prototype._onMouseMove=function(t){t=t||window.event;var e=parseFloat(n(t))-this.startMouseX,i=parseFloat(s(t))-this.startMouseY,o=this.startArmRotation.horizontal+e/200,r=this.startArmRotation.vertical+i/200,a=4,h=Math.sin(a/360*2*Math.PI);Math.abs(Math.sin(o))<h&&(o=Math.round(o/Math.PI)*Math.PI-.001),Math.abs(Math.cos(o))<h&&(o=(Math.round(o/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(r))<h&&(r=Math.round(r/Math.PI)*Math.PI),Math.abs(Math.cos(r))<h&&(r=(Math.round(r/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(o,r),this.redraw();var d=this.getCameraPosition();this.emit("cameraPositionChange",d),l.preventDefault(t)},o.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,l.removeEventListener(document,"mousemove",this.onmousemove),l.removeEventListener(document,"mouseup",this.onmouseup),l.preventDefault(t)},o.prototype._onTooltip=function(t){var e=300,i=this.frame.getBoundingClientRect(),o=n(t)-i.left,r=s(t)-i.top;if(this.showTooltip){if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)return void this._hideTooltip();if(this.tooltip&&this.tooltip.dataPoint){var a=this._dataPointFromXY(o,r);a!==this.tooltip.dataPoint&&(a?this._showTooltip(a):this._hideTooltip())}else{var h=this;this.tooltipTimeout=setTimeout(function(){h.tooltipTimeout=null;var t=h._dataPointFromXY(o,r);t&&h._showTooltip(t)},e)}}},o.prototype._onTouchStart=function(t){this.touchDown=!0;var e=this;this.ontouchmove=function(t){e._onTouchMove(t)},this.ontouchend=function(t){e._onTouchEnd(t)},l.addEventListener(document,"touchmove",e.ontouchmove),l.addEventListener(document,"touchend",e.ontouchend),this._onMouseDown(t)},o.prototype._onTouchMove=function(t){this._onMouseMove(t)},o.prototype._onTouchEnd=function(t){this.touchDown=!1,l.removeEventListener(document,"touchmove",this.ontouchmove),l.removeEventListener(document,"touchend",this.ontouchend),this._onMouseUp(t)},o.prototype._onWheel=function(t){t||(t=window.event);var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var i=this.camera.getArmLength(),o=i*(1-e/10);this.camera.setArmLength(o),this.redraw(),this._hideTooltip()}var n=this.getCameraPosition();this.emit("cameraPositionChange",n),l.preventDefault(t)},o.prototype._insideTriangle=function(t,e){function i(t){return t>0?1:0>t?-1:0}var o=e[0],n=e[1],s=e[2],r=i((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),a=i((s.x-n.x)*(t.y-n.y)-(s.y-n.y)*(t.x-n.x)),h=i((o.x-s.x)*(t.y-s.y)-(o.y-s.y)*(t.x-s.x));return!(0!=r&&0!=a&&r!=a||0!=a&&0!=h&&a!=h||0!=r&&0!=h&&r!=h)},o.prototype._dataPointFromXY=function(t,e){var i,n=100,s=null,r=null,a=null,h=new u(t,e);if(this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){s=this.dataPoints[i];var d=s.surfaces;if(d)for(var l=d.length-1;l>=0;l--){var c=d[l],p=c.corners,f=[p[0].screen,p[1].screen,p[2].screen],m=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,f)||this._insideTriangle(h,m))return s}}else for(i=0;i<this.dataPoints.length;i++){s=this.dataPoints[i];var v=s.screen;if(v){var g=Math.abs(t-v.x),y=Math.abs(e-v.y),b=Math.sqrt(g*g+y*y);(null===a||a>b)&&n>b&&(a=b,r=s)}}return r},o.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),e.style.position="absolute",e.style.padding="10px",e.style.border="1px solid #4d4d4d",e.style.color="#1a1a1a",e.style.background="rgba(255,255,255,0.7)",e.style.borderRadius="2px",e.style.boxShadow="5px 5px 10px rgba(128,128,128,0.5)",i=document.createElement("div"),i.style.position="absolute",i.style.height="40px",i.style.width="0",i.style.borderLeft="1px solid #4d4d4d",o=document.createElement("div"),o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.border="5px solid #4d4d4d",o.style.borderRadius="5px",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,s=e.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,d=t.screen.x-n/2;d=Math.min(Math.max(d,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=d+"px",e.style.top=t.screen.y-r-s+"px",o.style.left=t.screen.x-a/2+"px",o.style.top=t.screen.y-h/2+"px"},o.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},t.exports=o},function(t,e){function i(t){return t?o(t):void 0}function o(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,n=0;n<i.length;n++)if(o=i[n],o===e||o.fn===e){i.splice(n,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),i=this._callbacks[t];if(i){i=i.slice(0);for(var o=0,n=i.length;n>o;++o)i[o].apply(this,e)}return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){function i(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}i.subtract=function(t,e){var o=new i;return o.x=t.x-e.x,o.y=t.y-e.y,o.z=t.z-e.z,o},i.add=function(t,e){var o=new i;return o.x=t.x+e.x,o.y=t.y+e.y,o.z=t.z+e.z,o},i.avg=function(t,e){return new i((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},i.crossProduct=function(t,e){var o=new i;return o.x=t.y*e.z-t.z*e.y,o.y=t.z*e.x-t.x*e.z,o.z=t.x*e.y-t.y*e.x,o},i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.exports=i},function(t,e){function i(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0}t.exports=i},function(t,e,i){function o(){this.armLocation=new n,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraLocation=new n,this.cameraRotation=new n(.5*Math.PI,0,0),this.calculateCameraOrientation()}var n=i(14);o.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},o.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},o.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},o.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},o.prototype.getArmLength=function(){return this.armLength},o.prototype.getCameraLocation=function(){return this.cameraLocation},o.prototype.getCameraRotation=function(){return this.cameraRotation},o.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},t.exports=o},function(t,e,i){function o(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:e>t?-1:0}),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var n=i(11);o.prototype.isLoaded=function(){return this.loaded},o.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},o.prototype.getLabel=function(){return this.graph.filterLabel},o.prototype.getColumn=function(){return this.column},o.prototype.getSelectedValue=function(){return void 0!==this.index?this.values[this.index]:void 0},o.prototype.getValues=function(){return this.values},o.prototype.getValue=function(t){if(t>=this.values.length)throw"Error: index out of range";return this.values[t]},o.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var o=new n(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(o),this.dataPoints[t]=e}return e},o.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},o.prototype.selectValue=function(t){if(t>=this.values.length)throw"Error: index out of range";this.index=t,this.value=this.values[t]},o.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<this.values.length){this._getDataPoints(t);void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var i=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+i+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var o=this;setTimeout(function(){o.loadInBackground(t+1)},10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()},t.exports=o},function(t,e,i){function o(t,e){if(void 0===t)throw"Error: No container element defined";if(this.container=t,this.visible=e&&void 0!=e.visible?e.visible:!0,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}var n=i(1);o.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},o.prototype.next=function(){var t=this.getIndex();t<this.values.length-1&&(t++,this.setIndex(t))},o.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<this.values.length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var i=new Date,o=i-t,n=Math.max(this.playInterval-o,0),s=this;this.playTimeout=setTimeout(function(){s.playNext()},n)},o.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},o.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},o.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},o.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},o.prototype.setPlayInterval=function(t){this.playInterval=t},o.prototype.getPlayInterval=function(t){return this.playInterval},o.prototype.setPlayLoop=function(t){this.playLoop=t},o.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},o.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},o.prototype.setValues=function(t){this.values=t,this.values.length>0?this.setIndex(0):this.index=void 0},o.prototype.setIndex=function(t){if(!(t<this.values.length))throw"Error: index out of range";this.index=t,this.redraw(),this.onChange()},o.prototype.getIndex=function(){return this.index},o.prototype.get=function(){return this.values[this.index]},o.prototype._onMouseDown=function(t){var e=t.which?1===t.which:1===t.button;if(e){this.startClientX=t.clientX,this.startSlideX=parseFloat(this.frame.slide.style.left),this.frame.style.cursor="move";var i=this;this.onmousemove=function(t){i._onMouseMove(t)},this.onmouseup=function(t){i._onMouseUp(t)},n.addEventListener(document,"mousemove",this.onmousemove),n.addEventListener(document,"mouseup",this.onmouseup),n.preventDefault(t)}},o.prototype.leftToIndex=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t-3,o=Math.round(i/e*(this.values.length-1));return 0>o&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,o=i+3;return o},o.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,o=this.leftToIndex(i);this.setIndex(o),n.preventDefault()},o.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",n.removeEventListener(document,"mousemove",this.onmousemove),n.removeEventListener(document,"mouseup",this.onmouseup),n.preventDefault()},t.exports=o},function(t,e){function i(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}i.prototype.setRange=function(t,e,i,o){this._start=t?t:0,this._end=e?e:0,this.setStep(i,o)},i.prototype.setStep=function(t,e){void 0===t||0>=t||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=i.calculatePrettyStep(t):this._step=t)},i.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),s=i;return Math.abs(o-t)<=Math.abs(s-t)&&(s=o),Math.abs(n-t)<=Math.abs(s-t)&&(s=n),0>=s&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(){this._current=this._start-this._start%this._step},i.prototype.next=function(){this._current+=this._step},i.prototype.end=function(){return this._current>this._end},t.exports=i},function(t,e,i){if("undefined"!=typeof window){var o=i(21),n=window.Hammer||i(22);t.exports=o(n,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,o){function n(t){return t.match(/[^ ]+/g)}function s(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var i=!1;e.stopPropagation=function(){i=!0};var o=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof o&&(e.srcEvent.stopPropagation=function(){o(),e.stopPropagation()}),e.firstTarget=t;for(var n=t;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a<s.length;a++)if(r=s[a]._handlers[e.type])for(var h=0;h<r.length&&!i;h++)r[h](e);n=n.parentNode}}var r=o||{preventDefault:!1};if(i.Manager){var a=i,h=function(t,i){var o=Object.create(r);return i&&a.assign(o,i),e(new a(t,o),o)};return a.assign(h,a),h.Manager=function(t,i){var o=Object.create(r);return i&&a.assign(o,i),e(new a.Manager(t,o),o)},h}var d=Object.create(i),l=i.element;return l.hammer||(l.hammer=[]),l.hammer.push(d),i.on("hammer.input",function(e){r.preventDefault!==!0&&r.preventDefault!==e.pointerType||e.preventDefault(),e.isFirst&&(t=e.target)}),d._handlers={},d.on=function(t,e){return n(t).forEach(function(t){var o=d._handlers[t];o||(d._handlers[t]=o=[],i.on(t,s)),o.push(e)}),d},d.off=function(t,e){return n(t).forEach(function(t){var o=d._handlers[t];o&&(o=e?o.filter(function(t){return t!==e}):[],o.length>0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){var t=i.element.hammer,e=t.indexOf(d);-1!==e&&t.splice(e,1),t.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;!function(n,s,r,a){function h(t,e,i){return setTimeout(p(t,i),e)}function d(t,e,i){return Array.isArray(t)?(l(t,i[e],i),!0):!1}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o<t.length;)e.call(i,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(i,t[o],o,t)}function c(t,e,i){var o="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",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function u(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&ct(o,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==ft?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){l(w(e),function(e){t.addEventListener(e,i,!1)})}function g(t,e,i){l(w(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function _(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;o<t.length;){if(i&&t[o][i]==e||!i&&t[o]===e)return o;o++}return-1}function x(t){return Array.prototype.slice.call(t,0)}function k(t,e,i){for(var o=[],n=[],s=0;s<t.length;){var r=e?t[s][e]:t[s];_(n,r)<0&&o.push(t[s]),n[s]=r,s++}return i&&(o=e?o.sort(function(t,i){return t[e]>i[e]}):o.sort()),o}function O(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s<ut.length;){if(i=ut[s],o=i?i+n:e,o in t)return o;s++}return a}function M(){return wt++}function D(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||n}function S(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){f(t.options.enable,[t])&&i.handler(e)},this.init()}function C(t){var e,i=t.options.inputClass;return new(e=i?i:kt?W:Ot?V:xt?q:H)(t,T)}function T(t,e,i){var o=i.pointers.length,n=i.changedPointers.length,s=e&Et&&o-n===0,r=e&(It|Nt)&&o-n===0;
+i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,E(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function E(t,e){var i=t.session,o=e.pointers,n=o.length;i.firstInput||(i.firstInput=N(e)),n>1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=R(o);e.timeStamp=gt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=B(a,h),e.distance=A(a,h),P(i,e),e.offsetDirection=L(e.deltaX,e.deltaY);var d=z(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=vt(d.x)>vt(d.y)?d.x:d.y,e.scale=r?j(r.pointers,o):1,e.rotation=r?F(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,I(i,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==Et&&s.eventType!==It||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function I(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Nt&&(h>Tt||r.velocity===a)){var d=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,c=z(h,d,l);o=c.x,n=c.y,i=vt(c.x)>vt(c.y)?c.x:c.y,s=L(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:mt(t.pointers[i].clientX),clientY:mt(t.pointers[i].clientY)},i++;return{timeStamp:gt(),pointers:e,center:R(e),deltaX:t.deltaX,deltaY:t.deltaY}}function R(t){var e=t.length;if(1===e)return{x:mt(t[0].clientX),y:mt(t[0].clientY)};for(var i=0,o=0,n=0;e>n;)i+=t[n].clientX,o+=t[n].clientY,n++;return{x:mt(i/e),y:mt(o/e)}}function z(t,e,i){return{x:e/t||0,y:i/t||0}}function L(t,e){return t===e?Rt:vt(t)>=vt(e)?0>t?zt:Lt:0>e?At:Bt}function A(t,e,i){i||(i=Wt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function B(t,e,i){i||(i=Wt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function F(t,e){return B(e[1],e[0],Yt)+B(t[1],t[0],Yt)}function j(t,e){return A(e[0],e[1],Yt)/A(t[0],t[1],Yt)}function H(){this.evEl=Vt,this.evWin=Ut,this.allow=!0,this.pressed=!1,S.apply(this,arguments)}function W(){this.evEl=Zt,this.evWin=Kt,S.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=Qt,this.evWin=$t,this.started=!1,S.apply(this,arguments)}function G(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(It|Nt)&&(i=k(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=ee,this.targetIds={},S.apply(this,arguments)}function U(t,e){var i=x(t.touches),o=this.targetIds;if(e&(Et|Pt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return y(t.target,h)}),e===Et)for(n=0;n<s.length;)o[s[n].identifier]=!0,n++;for(n=0;n<r.length;)o[r[n].identifier]&&a.push(r[n]),e&(It|Nt)&&delete o[r[n].identifier],n++;return a.length?[k(s.concat(a),"identifier",!0),a]:void 0}function q(){S.apply(this,arguments);var t=p(this.handler,this);this.touch=new V(this.manager,t),this.mouse=new H(this.manager,t)}function X(t,e){this.manager=t,this.set(e)}function Z(t){if(b(t,ae))return ae;var e=b(t,he),i=b(t,de);return e&&i?ae:e||i?e?he:de:b(t,re)?re:se}function K(t){this.options=ct({},this.defaults,t||{}),this.id=M(),this.manager=null,this.options.enable=m(this.options.enable,!0),this.state=le,this.simultaneous={},this.requireFail=[]}function J(t){return t&me?"cancel":t&pe?"end":t&ue?"move":t&ce?"start":""}function Q(t){return t==Bt?"down":t==At?"up":t==zt?"left":t==Lt?"right":""}function $(t,e){var i=e.manager;return i?i.get(t):t}function tt(){K.apply(this,arguments)}function et(){tt.apply(this,arguments),this.pX=null,this.pY=null}function it(){tt.apply(this,arguments)}function ot(){K.apply(this,arguments),this._timer=null,this._input=null}function nt(){tt.apply(this,arguments)}function st(){tt.apply(this,arguments)}function rt(){K.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function at(t,e){return e=e||{},e.recognizers=m(e.recognizers,at.defaults.preset),new ht(t,e)}function ht(t,e){this.options=ct({},at.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=C(this),this.touchAction=new X(this,this.options.touchAction),dt(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function dt(t,e){var i=t.element;i.style&&l(t.options.cssProps,function(t,o){i.style[O(i.style,o)]=e?t:""})}function lt(t,e){var i=s.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}var ct,ut=["","webkit","Moz","MS","ms","o"],pt=s.createElement("div"),ft="function",mt=Math.round,vt=Math.abs,gt=Date.now;ct="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var o=arguments[i];if(o!==a&&null!==o)for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n])}return e}:Object.assign;var yt=c(function(t,e,i){for(var o=Object.keys(e),n=0;n<o.length;)(!i||i&&t[o[n]]===a)&&(t[o[n]]=e[o[n]]),n++;return t},"extend","Use `assign`."),bt=c(function(t,e){return yt(t,e,!0)},"merge","Use `assign`."),wt=1,_t=/mobile|tablet|ip(ad|hone|od)|android/i,xt="ontouchstart"in n,kt=O(n,"PointerEvent")!==a,Ot=xt&&_t.test(navigator.userAgent),Mt="touch",Dt="pen",St="mouse",Ct="kinect",Tt=25,Et=1,Pt=2,It=4,Nt=8,Rt=1,zt=2,Lt=4,At=8,Bt=16,Ft=zt|Lt,jt=At|Bt,Ht=Ft|jt,Wt=["x","y"],Yt=["clientX","clientY"];S.prototype={handler:function(){},init:function(){this.evEl&&v(this.element,this.evEl,this.domHandler),this.evTarget&&v(this.target,this.evTarget,this.domHandler),this.evWin&&v(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(D(this.element),this.evWin,this.domHandler)}};var Gt={mousedown:Et,mousemove:Pt,mouseup:It},Vt="mousedown",Ut="mousemove mouseup";u(H,S,{handler:function(t){var e=Gt[t.type];e&Et&&0===t.button&&(this.pressed=!0),e&Pt&&1!==t.which&&(e=It),this.pressed&&this.allow&&(e&It&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:St,srcEvent:t}))}});var qt={pointerdown:Et,pointermove:Pt,pointerup:It,pointercancel:Nt,pointerout:Nt},Xt={2:Mt,3:Dt,4:St,5:Ct},Zt="pointerdown",Kt="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Zt="MSPointerDown",Kt="MSPointerMove MSPointerUp MSPointerCancel"),u(W,S,{handler:function(t){var e=this.store,i=!1,o=t.type.toLowerCase().replace("ms",""),n=qt[o],s=Xt[t.pointerType]||t.pointerType,r=s==Mt,a=_(e,t.pointerId,"pointerId");n&Et&&(0===t.button||r)?0>a&&(e.push(t),a=e.length-1):n&(It|Nt)&&(i=!0),0>a||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var Jt={touchstart:Et,touchmove:Pt,touchend:It,touchcancel:Nt},Qt="touchstart",$t="touchstart touchmove touchend touchcancel";u(Y,S,{handler:function(t){var e=Jt[t.type];if(e===Et&&(this.started=!0),this.started){var i=G.call(this,t,e);e&(It|Nt)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Mt,srcEvent:t})}}});var te={touchstart:Et,touchmove:Pt,touchend:It,touchcancel:Nt},ee="touchstart touchmove touchend touchcancel";u(V,S,{handler:function(t){var e=te[t.type],i=U.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Mt,srcEvent:t})}}),u(q,S,{handler:function(t,e,i){var o=i.pointerType==Mt,n=i.pointerType==St;if(o)this.mouse.allow=!1;else if(n&&!this.mouse.allow)return;e&(It|Nt)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ie=O(pt.style,"touchAction"),oe=ie!==a,ne="compute",se="auto",re="manipulation",ae="none",he="pan-x",de="pan-y";X.prototype={set:function(t){t==ne&&(t=this.compute()),oe&&this.manager.element.style&&(this.manager.element.style[ie]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){f(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Z(t.join(" "))},preventDefaults:function(t){if(!oe){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var o=this.actions,n=b(o,ae),s=b(o,de),r=b(o,he);if(n){var a=1===t.pointers.length,h=t.distance<2,d=t.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return n||s&&i&Ft||r&&i&jt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var le=1,ce=2,ue=4,pe=8,fe=pe,me=16,ve=32;K.prototype={defaults:{},set:function(t){return ct(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(d(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=$(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return d(t,"dropRecognizeWith",this)?this:(t=$(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(d(t,"requireFailure",this))return this;var e=this.requireFail;return t=$(t,this),-1===_(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(d(t,"dropRequireFailure",this))return this;t=$(t,this);var e=_(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;pe>o&&e(i.options.event+J(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=pe&&e(i.options.event+J(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=ve)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(ve|le)))return!1;t++}return!0},recognize:function(t){var e=ct({},t);return f(this.options.enable,[this,e])?(this.state&(fe|me|ve)&&(this.state=le),this.state=this.process(e),void(this.state&(ce|ue|pe|me)&&this.tryEmit(e))):(this.reset(),void(this.state=ve))},process:function(t){},getTouchAction:function(){},reset:function(){}},u(tt,K,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,o=e&(ce|ue),n=this.attrTest(t);return o&&(i&Nt||!n)?e|me:o||n?i&It?e|pe:e&ce?e|ue:ce:ve}}),u(et,tt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ht},getTouchAction:function(){var t=this.options.direction,e=[];return t&Ft&&e.push(de),t&jt&&e.push(he),e},directionTest:function(t){var e=this.options,i=!0,o=t.distance,n=t.direction,s=t.deltaX,r=t.deltaY;return n&e.direction||(e.direction&Ft?(n=0===s?Rt:0>s?zt:Lt,i=s!=this.pX,o=Math.abs(t.deltaX)):(n=0===r?Rt:0>r?At:Bt,i=r!=this.pY,o=Math.abs(t.deltaY))),t.direction=n,i&&o>e.threshold&&n&e.direction},attrTest:function(t){return tt.prototype.attrTest.call(this,t)&&(this.state&ce||!(this.state&ce)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Q(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(it,tt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ce)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(ot,K,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[se]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance<e.threshold,n=t.deltaTime>e.time;if(this._input=t,!o||!i||t.eventType&(It|Nt)&&!n)this.reset();else if(t.eventType&Et)this.reset(),this._timer=h(function(){this.state=fe,this.tryEmit()},e.time,this);else if(t.eventType&It)return fe;return ve},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===fe&&(t&&t.eventType&It?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=gt(),this.manager.emit(this.options.event,this._input)))}}),u(nt,tt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ce)}}),u(st,tt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ft|jt,pointers:1},getTouchAction:function(){return et.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Ft|jt)?e=t.overallVelocity:i&Ft?e=t.overallVelocityX:i&jt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&vt(e)>this.options.velocity&&t.eventType&It},emit:function(t){var e=Q(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(rt,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[re]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance<e.threshold,n=t.deltaTime<e.time;if(this.reset(),t.eventType&Et&&0===this.count)return this.failTimeout();if(o&&n&&i){if(t.eventType!=It)return this.failTimeout();var s=this.pTime?t.timeStamp-this.pTime<e.interval:!0,r=!this.pCenter||A(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,r&&s?this.count+=1:this.count=1,this._input=t;var a=this.count%e.taps;if(0===a)return this.hasRequireFailures()?(this._timer=h(function(){this.state=fe,this.tryEmit()},e.interval,this),ce):fe}return ve},failTimeout:function(){return this._timer=h(function(){this.state=ve},this.options.interval,this),ve},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==fe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),at.VERSION="2.0.6",at.defaults={domEvents:!1,touchAction:ne,enable:!0,inputTarget:null,inputClass:null,preset:[[nt,{enable:!1}],[it,{enable:!1},["rotate"]],[st,{direction:Ft}],[et,{direction:Ft},["swipe"]],[rt],[rt,{event:"doubletap",taps:2},["tap"]],[ot]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ge=1,ye=2;ht.prototype={set:function(t){return ct(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ye:ge},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,o=this.recognizers,n=e.curRecognizer;(!n||n&&n.state&fe)&&(n=e.curRecognizer=null);for(var s=0;s<o.length;)i=o[s],e.stopped===ye||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(t),!n&&i.state&(ce|ue|pe)&&(n=e.curRecognizer=i),s++}},get:function(t){if(t instanceof K)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(d(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},remove:function(t){if(d(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=_(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){var i=this.handlers;return l(w(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this},off:function(t,e){var i=this.handlers;return l(w(t),function(t){e?i[t]&&i[t].splice(_(i[t],e),1):delete i[t]}),this},emit:function(t,e){this.options.domEvents&<(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 o=0;o<i.length;)i[o](e),o++}},destroy:function(){this.element&&dt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ct(at,{INPUT_START:Et,INPUT_MOVE:Pt,INPUT_END:It,INPUT_CANCEL:Nt,STATE_POSSIBLE:le,STATE_BEGAN:ce,STATE_CHANGED:ue,STATE_ENDED:pe,STATE_RECOGNIZED:fe,STATE_CANCELLED:me,STATE_FAILED:ve,DIRECTION_NONE:Rt,DIRECTION_LEFT:zt,DIRECTION_RIGHT:Lt,DIRECTION_UP:At,DIRECTION_DOWN:Bt,DIRECTION_HORIZONTAL:Ft,DIRECTION_VERTICAL:jt,DIRECTION_ALL:Ht,Manager:ht,Input:S,TouchAction:X,TouchInput:V,MouseInput:H,PointerEventInput:W,TouchMouseInput:q,SingleTouchInput:Y,Recognizer:K,AttrRecognizer:tt,Tap:rt,Pan:et,Swipe:st,Pinch:it,Rotate:nt,Press:ot,on:v,off:g,each:l,merge:bt,extend:yt,assign:ct,inherit:u,bindFn:p,prefixed:O});var be="undefined"!=typeof n?n:"undefined"!=typeof self?self:{};be.Hammer=at,o=function(){return at}.call(e,i,e,t),!(o!==a&&(t.exports=o))}(window,document,"Hammer")},function(t,e,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(this,function(){function t(t){var e,i=t&&t.preventDefault||!1,o=t&&t.container||window,n={},s={keydown:{},keyup:{}},r={};for(e=97;122>=e;e++)r[String.fromCharCode(e)]={code:65+(e-97),shift:!1};for(e=65;90>=e;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;9>=e;e++)r[""+e]={code:48+e,shift:!1};for(e=1;12>=e;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;9>=e;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){d(t,"keydown")},h=function(t){d(t,"keyup")},d=function(t,e){if(void 0!==s[e][t.keyCode]){for(var o=s[e][t.keyCode],n=0;n<o.length;n++)void 0===o[n].shift?o[n].fn(t):1==o[n].shift&&1==t.shiftKey?o[n].fn(t):0==o[n].shift&&0==t.shiftKey&&o[n].fn(t);1==i&&t.preventDefault()}};return n.bind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===r[t])throw new Error("unsupported key: "+t);void 0===s[i][r[t].code]&&(s[i][r[t].code]=[]),s[i][r[t].code].push({fn:e,shift:r[t].shift})},n.bindAll=function(t,e){void 0===e&&(e="keydown");for(var i in r)r.hasOwnProperty(i)&&n.bind(i,t,e)},n.getKey=function(t){for(var e in r)if(r.hasOwnProperty(e)){if(1==t.shiftKey&&1==r[e].shift&&t.keyCode==r[e].code)return e;if(0==t.shiftKey&&0==r[e].shift&&t.keyCode==r[e].code)return e;if(t.keyCode==r[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},n.unbind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===r[t])throw new Error("unsupported key: "+t);if(void 0!==e){var o=[],n=s[i][r[t].code];if(void 0!==n)for(var a=0;a<n.length;a++)n[a].fn==e&&n[a].shift==r[t].shift||o.push(s[i][r[t].code][a]);s[i][r[t].code]=o}else s[i][r[t].code]=[]},n.reset=function(){s={keydown:{},keyup:{}}},n.destroy=function(){s={keydown:{},keyup:{}},o.removeEventListener("keydown",a,!0),o.removeEventListener("keyup",h,!0)},o.addEventListener("keydown",a,!0),o.addEventListener("keyup",h,!0),n}return t})},function(t,e,i){e.util=i(1),e.DOMutil=i(8),e.DataSet=i(9),e.DataView=i(11),e.Queue=i(10),e.Timeline=i(25),e.Graph2d=i(50),e.timeline={Core:i(33),DateUtil:i(32),Range:i(30),stack:i(37),TimeStep:i(35),components:{items:{Item:i(39),BackgroundItem:i(43),BoxItem:i(41),PointItem:i(42),RangeItem:i(38)},BackgroundGroup:i(40),Component:i(31),CurrentTime:i(48),CustomTime:i(46),DataAxis:i(52),DataScale:i(53),GraphGroup:i(54),Group:i(36),ItemSet:i(34),Legend:i(58),LineGraph:i(51),TimeAxis:i(44)}},e.moment=i(2),e.Hammer=i(20),e.keycharm=i(23)},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e,i,o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!(Array.isArray(i)||i instanceof c||i instanceof u)&&i instanceof Object){var s=o;o=i,i=s}var r=this;this.defaultOptions={start:null,end:null,autoResize:!0,throttleRedraw:0,orientation:{axis:"bottom",item:"bottom"},rtl:!1,moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{getScale:function(){return r.timeAxis.step.scale},getStep:function(){return r.timeAxis.step.step},toScreen:r._toScreen.bind(r),toGlobalScreen:r._toGlobalScreen.bind(r),toTime:r._toTime.bind(r),toGlobalTime:r._toGlobalTime.bind(r)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new m(this.body),this.timeAxis2=null,this.components.push(this.timeAxis),this.currentTime=new v(this.body),this.components.push(this.currentTime),this.itemSet=new y(this.body,this.options),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){r.emit("click",r.getEventProperties(t))}),this.on("doubletap",function(t){r.emit("doubleClick",r.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){r.emit("contextmenu",r.getEventProperties(t))},this.fitDone=!1,this.on("changed",function(){if(null!=this.itemsData&&!r.fitDone)if(r.fitDone=!0,void 0!=r.options.start||void 0!=r.options.end){if(void 0==r.options.start||void 0==r.options.end)var t=r.getItemRange();var e=void 0!=r.options.start?r.options.start:t.min,i=void 0!=r.options.end?r.options.end:t.max;r.setWindow(e,i,{animation:!1})}else r.fit({animation:!1})}),o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(26),r=o(s),a=i(29),h=o(a),d=(i(13),i(20),i(2)),l=i(1),c=i(9),u=i(11),p=i(30),f=i(33),m=i(44),v=i(48),g=i(46),y=i(34),b=i(29).printStyle,w=i(49).allOptions,_=i(49).configureOptions;n.prototype=new f,n.prototype._createConfigurator=function(){return new r["default"](this,this.dom.container,_)},n.prototype.redraw=function(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()},n.prototype.setOptions=function(t){var e=h["default"].validate(t,w);if(e===!0&&console.log("%cErrors have been found in the supplied options object.",b),f.prototype.setOptions.call(this,t),"type"in t&&t.type!==this.options.type){this.options.type=t.type;var i=this.itemsData;if(i){var o=this.getSelection();this.setItems(null),this.setItems(i),this.setSelection(o)}}},n.prototype.setItems=function(t){var e;e=t?t instanceof c||t instanceof u?t:new c(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.itemSet&&this.itemSet.setItems(e)},n.prototype.setGroups=function(t){var e;e=t?t instanceof c||t instanceof u?t:new c(t):null,this.groupsData=e,this.itemSet.setGroups(e)},n.prototype.setData=function(t){t&&t.groups&&this.setGroups(t.groups),t&&t.items&&this.setItems(t.items)},n.prototype.setSelection=function(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)},n.prototype.getSelection=function(){return this.itemSet&&this.itemSet.getSelection()||[]},n.prototype.focus=function(t,e){if(this.itemsData&&void 0!=t){var i=Array.isArray(t)?t:[t],o=this.itemsData.getDataSet().get(i,{type:{start:"Date",end:"Date"}}),n=null,s=null;if(o.forEach(function(t){var e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===n||n>e)&&(n=e),(null===s||i>s)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=e&&void 0!==e.animation?e.animation:!0;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(t){var e,i=t&&void 0!==t.animation?t.animation:!0,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(e=this.getDataRange(),this.moveTo(e.min.valueOf(),{animation:i})):(e=this.getItemRange(),this.range.setRange(e.min,e.max,i))},n.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=null!==e.min?e.min.valueOf():null,o=null!==e.max?e.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,c;!function(){var e=function(t){return l.convert(t.data.start,"Date").valueOf()},u=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return l.convert(e,"Date").valueOf()};r=o-i,0>=r&&(r=10),a=r/t.props.center.width,l.forEach(t.itemSet.items,function(t){t.show(),t.repositionX();var r=e(t),h=u(t);if(this.options.rtl)var d=r-(t.getWidthRight()+10)*a,l=h+(t.getWidthLeft()+10)*a;else var d=r-(t.getWidthLeft()+10)*a,l=h+(t.getWidthRight()+10)*a;i>d&&(i=d,n=t),l>o&&(o=l,s=t)}.bind(t)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,c=t.props.center.width-h-d,c>0&&(t.options.rtl?(i=e(n)-d*r/c,o=u(s)+h*r/c):(i=e(n)-h*r/c,o=u(s)+d*r/c)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||t>o)&&(t=o),(null===e||n>e)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(t),r=this.itemSet.groupFromTarget(t),a=g.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),c=this.body.util.getStep(),u=this._toTime(o),p=h?h(u,d,c):u,f=l.getTarget(t),m=null;return null!=s?m="item":null!=a?m="custom-time":l.hasParent(f,this.timeAxis.dom.foreground)?m="axis":this.timeAxis2&&l.hasParent(f,this.timeAxis2.dom.foreground)?m="axis":l.hasParent(f,this.itemSet.dom.labelSet)?m="group-label":l.hasParent(f,this.currentTime.bar)?m="current-time":l.hasParent(f,this.dom.center)&&(m="background"),{event:t,item:s?s.id:null,group:r?r.groupId:null,what:m,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:u,snappedTime:p}},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(27),h=o(a),d=i(1),l=function(){function t(e,i,o){var s=arguments.length<=3||void 0===arguments[3]?1:arguments[3];n(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},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h["default"](s),this.wrapper=void 0}return r(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":s(t))?(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)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&-1===e.indexOf(n)||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){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"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),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){var e=arguments,i=this;if(this.allowCreation===!0){var o,n,r,a=function(){var s=document.createElement("div");for(s.className="vis-configuration vis-config-item vis-config-s"+t.length,o=e.length,n=Array(o>1?o-1:0),r=1;o>r;r++)n[r-1]=e[r];return n.forEach(function(t){s.appendChild(t)}),i.domElements.push(s),{v:i.domElements.length}}();if("object"===("undefined"==typeof a?"undefined":s(a)))return a.v}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]?!1:arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML="<i><b>"+t+":</b></i>":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&-1!==t.indexOf(e)&&(n=t.indexOf(e));for(var s=0;s<t.length;s++){var r=document.createElement("option");r.value=t[s],s===n&&(r.selected="selected"),r.innerHTML=t[s],o.appendChild(r)}var a=this;o.onchange=function(){a._update(this.value,i)};var h=this._makeLabel(i[i.length-1],i);this._makeItem(i,h,o)}},{key:"_makeRange",value:function(t,e,i){
+var o=t[0],n=t[1],s=t[2],r=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=s}catch(h){}a.step=r;var d="",l=0;if(void 0!==e){var c=1.2;0>e&&n>e*c?(a.min=Math.ceil(e*c),l=a.min,d="range increased"):n>e/c&&(a.min=Math.ceil(e/c),l=a.min,d="range increased"),e*c>s&&1!==s&&(a.max=Math.ceil(e*c),l=a.max,d="range increased"),a.value=e}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var p=this;a.onchange=function(){u.value=this.value,p._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var f=this._makeLabel(i[i.length-1],i),m=this._makeItem(i,f,a,u);""!==d&&this.popupHistory[m]!==l&&(this.popupHistory[m]=l,this._setupPopup(d,m))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var o=document.createElement("div");o.id="vis-configuration-popup",o.className="vis-configuration-popup",o.innerHTML=t,o.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:o,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],i=e.getBoundingClientRect();this.popupDiv.html.style.left=i.left+"px",this.popupDiv.html.style.top=i.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 o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=t,void 0!==e&&(o.checked=e,e!==t&&("object"===("undefined"==typeof t?"undefined":s(t))?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));var n=this;o.onchange=function(){n._update(this.checked,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}},{key:"_makeTextInput",value:function(t,e,i){var o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=e,e!==t&&this.changedOptions.push({path:i,value:e});var n=this;o.onchange=function(){n._update(this.value,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}},{key:"_makeColorField",value:function(t,e,i){var o=this,n=t[1],s=document.createElement("div");e=void 0===e?n:e,"none"!==e?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=e):s.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,s.onclick=function(){o._showColorPicker(e,s,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,s)}},{key:"_showColorPicker",value:function(t,e,i){var o=this;e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback(function(t){var n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,o._update(n,i)}),this.colorPicker.setCloseCallback(function(){e.onclick=function(){o._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]?!1:arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],h=d.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var c=!0;if(-1!==e.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(c=!1),c===!0)if(void 0!==a.enabled){var u=d.copyAndExtendArray(h,"enabled"),p=this._getValue(u);if(p===!0){var f=this._makeLabel(r,h,!0);this._makeItem(h,f),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,p,h)}else{var m=this._makeLabel(r,h,!0);this._makeItem(h,m),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{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],o=i;t="true"===t?!0:t,t="false"===t?!1:t;for(var n=0;n<e.length;n++)"global"!==e[n]&&(void 0===o[e[n]]&&(o[e[n]]={}),n!==e.length-1?o=o[e[n]]:o[e[n]]=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}();e["default"]=l},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(20),r=i(28),a=i(1),h=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];o(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 n(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){var e={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"};return"string"==typeof t?e[t]:void 0}},{key:"setColor",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),a.isString(t)===!0){if(a.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(t)===!0){var s=t.substr(5).substr(0,t.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(t)===!0){var r=a.hexToRGB(t);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var h=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:h}}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]?!0:arguments[0];e===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&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]?!0:arguments[1];e===!0&&(this.initialColor=a.extend({},t)),this.color=t;var i=a.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.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=a.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=a.HSVToRGB(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]?this.color:arguments[0],e=a.RGBToHSV(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 o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var t=this;this.drag={},this.pinch={},this.hammer=new s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.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(this.generated===!1){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=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var h=2*Math.PI/360,d=1/360,l=1/this.r,c=void 0;for(s=0;360>s;s++)for(r=0;r<this.r;r++)o=this.centerCoordinates.x+r*Math.sin(h*s),n=this.centerCoordinates.y+r*Math.cos(h*s),c=a.HSVToRGB(s*d,r*l,1),t.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",t.fillRect(o-.5,n-.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,e,i)}this.generated=!0}},{key:"_moveSelector",value:function(t){var e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,o=t.center.y-e.top,n=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,h=o-n,d=Math.atan2(r,h),l=.98*Math.min(Math.sqrt(r*r+h*h),s),c=Math.cos(d)*l+n,u=Math.sin(d)*l+s;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";var p=d/(2*Math.PI);p=0>p?p+1:p;var f=l/this.r,m=a.RGBToHSV(this.color.r,this.color.g,this.color.b);m.h=p,m.s=f;var v=a.HSVToRGB(m.h,m.s,m.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}();e["default"]=h},function(t,e,i){i(20);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){var e="pan-y";return t.getTouchAction=function(){return[e]},t}},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(1),a=!1,h=void 0,d="background: #FFeeee; color: #dd0000",l=function(){function t(){o(this,t)}return s(t,null,[{key:"validate",value:function(e,i,o){a=!1,h=i;var n=i;return void 0!==o&&(n=i[o]),t.parse(e,n,[]),a}},{key:"parse",value:function(e,i,o){for(var n in e)e.hasOwnProperty(n)&&t.check(n,e,i,o)}},{key:"check",value:function(e,i,o,n){void 0===o[e]&&void 0===o.__any__?t.getSuggestion(e,o,n):void 0===o[e]&&void 0!==o.__any__?"object"===t.getType(i[e])&&void 0!==o.__any__.__type__?t.checkFields(e,i,o,"__any__",o.__any__.__type__,n):t.checkFields(e,i,o,"__any__",o.__any__,n):void 0!==o[e].__type__?t.checkFields(e,i,o,e,o[e].__type__,n):t.checkFields(e,i,o,e,o[e],n)}},{key:"checkFields",value:function(e,i,o,n,s,h){var l=t.getType(i[e]),c=s[l];void 0!==c?"array"===t.getType(c)&&-1===c.indexOf(i[e])?(console.log('%cInvalid option detected in "'+e+'". Allowed values are:'+t.print(c)+' not "'+i[e]+'". '+t.printLocation(h,e),d),a=!0):"object"===l&&"__any__"!==n&&(h=r.copyAndExtendArray(h,e),t.parse(i[e],o[n],h)):void 0===s.any&&(console.log('%cInvalid type received for "'+e+'". Expected: '+t.print(Object.keys(s))+". Received ["+l+'] "'+i[e]+'"'+t.printLocation(h,e),d),a=!0)}},{key:"getType",value:function(t){var e="undefined"==typeof t?"undefined":n(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":t._isAMomentObject===!0?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}},{key:"getSuggestion",value:function(e,i,o){var n=t.findInOptions(e,i,o,!1),s=t.findInOptions(e,h,[],!0),r=8,l=4;void 0!==n.indexMatch?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n',d):s.distance<=l&&n.distance>s.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),d):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print(Object.keys(i))+t.printLocation(o,e),d),a=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3],s=1e9,a="",h=[],d=e.toLowerCase(),l=void 0;for(var c in i){var u=void 0;if(void 0!==i[c].__type__&&n===!0){var p=t.findInOptions(e,i[c],r.copyAndExtendArray(o,c));s>p.distance&&(a=p.closestMatch,h=p.path,s=p.distance,l=p.indexMatch)}else-1!==c.toLowerCase().indexOf(d)&&(l=c),u=t.levenshteinDistance(e,c),s>u&&(a=c,h=r.copyArray(o),s=u)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length<=2||void 0===arguments[2]?"Problem value found at: \n":arguments[2],o="\n\n"+i+"options = {\n",n=0;n<t.length;n++){for(var s=0;n+1>s;s++)o+=" ";o+=t[n]+": {\n"}for(var r=0;r<t.length+1;r++)o+=" ";o+=e+"\n";for(var a=0;a<t.length+1;a++){for(var h=0;h<t.length-a;h++)o+=" ";o+="}\n"}return o+"\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,o=[];for(i=0;i<=e.length;i++)o[i]=[i];var n;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}();e["default"]=l,e.printStyle=d},function(t,e,i){function o(t,e){var i=a().hours(0).minutes(0).seconds(0).milliseconds(0);this.start=i.clone().add(-3,"days").valueOf(),this.end=i.clone().add(4,"days").valueOf(),this.body=t,this.deltaDifference=0,this.scaleOffset=0,this.startToFront=!1,this.endToFront=!0,this.defaultOptions={rtl:!1,start:null,end:null,moment:a,direction:"horizontal",moveable:!0,zoomable:!0,min:null,max:null,zoomMin:10,zoomMax:31536e10},this.options=r.extend({},this.defaultOptions),this.props={touch:{}},this.animationTimer=null,this.body.emitter.on("panstart",this._onDragStart.bind(this)),this.body.emitter.on("panmove",this._onDrag.bind(this)),this.body.emitter.on("panend",this._onDragEnd.bind(this)),this.body.emitter.on("mousewheel",this._onMouseWheel.bind(this)),this.body.emitter.on("touch",this._onTouch.bind(this)),this.body.emitter.on("pinch",this._onPinch.bind(this)),this.setOptions(e)}function n(t){if("horizontal"!=t&&"vertical"!=t)throw new TypeError('Unknown direction "'+t+'". Choose "horizontal" or "vertical".')}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=i(1),a=(i(28),i(2)),h=i(31),d=i(32);o.prototype=new h,o.prototype.setOptions=function(t){if(t){var e=["direction","min","max","zoomMin","zoomMax","moveable","zoomable","moment","activate","hiddenDates","zoomKey","rtl"];r.selectiveExtend(e,this.options,t),("start"in t||"end"in t)&&this.setRange(t.start,t.end)}},o.prototype.setRange=function(t,e,i,o){o!==!0&&(o=!1);var n=void 0!=t?r.convert(t,"Date").valueOf():null,a=void 0!=e?r.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),i){var h=this,l=this.start,c=this.end,u="object"===("undefined"==typeof i?"undefined":s(i))&&"duration"in i?i.duration:500,p="object"===("undefined"==typeof i?"undefined":s(i))&&"easingFunction"in i?i.easingFunction:"easeInOutQuad",f=r.easingFunctions[p];if(!f)throw new Error("Unknown easing function "+JSON.stringify(p)+". Choose from: "+Object.keys(r.easingFunctions).join(", "));var m=(new Date).valueOf(),v=!1,g=function w(){if(!h.props.touch.dragging){var t=(new Date).valueOf(),e=t-m,i=f(e/u),s=e>u,r=s||null===n?n:l+(n-l)*i,p=s||null===a?a:c+(a-c)*i;y=h._applyRange(r,p),d.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),v=v||y,y&&h.body.emitter.emit("rangechange",{start:new Date(h.start),end:new Date(h.end),byUser:o}),s?v&&h.body.emitter.emit("rangechanged",{start:new Date(h.start),end:new Date(h.end),byUser:o}):h.animationTimer=setTimeout(w,20)}};return g()}var y=this._applyRange(n,a);if(d.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),y){var b={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",b),this.body.emitter.emit("rangechanged",b)}},o.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},o.prototype._applyRange=function(t,e){var i,o=null!=t?r.convert(t,"Date").valueOf():this.start,n=null!=e?r.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(o>n&&(n=o),null!==a&&a>o&&(i=a-o,o+=i,n+=i,null!=s&&n>s&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=a&&a>o&&(o=a)),null!==this.options.zoomMin){var h=parseFloat(this.options.zoomMin);0>h&&(h=0),h>n-o&&(this.end-this.start===h&&o>this.start&&n<this.end?(o=this.start,n=this.end):(i=h-(n-o),o-=i/2,n+=i/2))}if(null!==this.options.zoomMax){var d=parseFloat(this.options.zoomMax);0>d&&(d=0),n-o>d&&(this.end-this.start===d&&o<this.start&&n>this.end?(o=this.start,n=this.end):(i=n-o-d,o+=i/2,n-=i/2))}var l=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(t,e){return o.conversion(this.start,this.end,t,e)},o.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(t){if(this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;n(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,s=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=s;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,l=this.props.touch.end+a,c=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),u=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(c!=h||u!=l)return this.deltaDifference+=i,this.props.touch.start=c,this.props.touch.end=u,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,l);var p=new Date(this.start),f=new Date(this.end);this.body.emitter.emit("rangechange",{start:p,end:f,byUser:!0})}},o.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(t){if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&(!this.options.zoomKey||t[this.options.zoomKey])){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var i;i=0>e?1-e/5:1/(1+e/5);var o=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center),n=this._pointerToDate(o);this.zoom(i,n,e)}t.preventDefault()}},o.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center));var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*e,a=i+s+(this.props.touch.end-(i+s))*e;
+this.startToFront=0>=1-e,this.endToFront=0>=e-1;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-t.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-r.getAbsoluteLeft(this.body.dom.centerContainer);else var i=r.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(n(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},o.prototype.getPointer=function(t,e){return this.options.rtl?{x:r.getAbsoluteRight(e)-t.x,y:t.y-r.getAbsoluteTop(e)}:{x:t.x-r.getAbsoluteLeft(e),y:t.y-r.getAbsoluteTop(e)}},o.prototype.zoom=function(t,e,i){null==e&&(e=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),s=o-n,r=e-n+(this.start-(e-n))*t,a=e+s+(this.end-(e+s))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);h==r&&l==a||(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},o.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n)},t.exports=o},function(t,e){function i(t,e){this.options=null,this.props=null}i.prototype.setOptions=function(t){t&&util.extend(this.options,t)},i.prototype.redraw=function(){return!1},i.prototype.destroy=function(){},i.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=i},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n<o.length;n++)if(void 0===o[n].repeat){var s={};s.start=t(o[n].start).toDate().valueOf(),s.end=t(o[n].end).toDate().valueOf(),i.hiddenDates.push(s)}i.hiddenDates.sort(function(t,e){return t.start-e.start})}},e.updateHiddenDates=function(t,i,o){if(o&&!Array.isArray(o))return e.updateHiddenDates(t,i,[o]);if(o&&void 0!==i.domProps.centerContainer.width){e.convertHiddenOptions(t,i,o);for(var n=t(i.range.start),s=t(i.range.end),r=i.range.end-i.range.start,a=r/i.domProps.centerContainer.width,h=0;h<o.length;h++)if(void 0!==o[h].repeat){var d=t(o[h].start),l=t(o[h].end);if("Invalid Date"==d._d)throw new Error("Supplied start date is not valid: "+o[h].start);if("Invalid Date"==l._d)throw new Error("Supplied end date is not valid: "+o[h].end);var c=l-d;if(c>=4*a){var u=0,p=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(u=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-u,"days"),p.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(u=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(u,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(u=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(u,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;p>d;)switch(i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()}),o[h].repeat){case"daily":d.add(1,"days"),l.add(1,"days");break;case"weekly":d.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":d.add(1,"months"),l.add(1,"months");break;case"yearly":d.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()})}}e.removeDuplicates(i);var v=e.isHidden(i.range.start,i.hiddenDates),g=e.isHidden(i.range.end,i.hiddenDates),y=i.range.start,b=i.range.end;1==v.hidden&&(y=1==i.range.startToFront?v.startDate-1:v.endDate+1),1==g.hidden&&(b=1==i.range.endToFront?g.startDate-1:g.endDate+1),1!=v.hidden&&1!=g.hidden||i.range._applyRange(y,b)}},e.removeDuplicates=function(t){for(var e=t.hiddenDates,i=[],o=0;o<e.length;o++)for(var n=0;n<e.length;n++)o!=n&&1!=e[n].remove&&1!=e[o].remove&&(e[n].start>=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o<e.length;o++)e[o].remove!==!0&&i.push(e[o]);t.hiddenDates=i,t.hiddenDates.sort(function(t,e){return t.start-e.start})},e.printDates=function(t){for(var e=0;e<t.length;e++)console.log(e,new Date(t[e].start),new Date(t[e].end),t[e].start,t[e].end,t[e].remove)},e.stepOverHiddenDates=function(t,e,i){for(var o=!1,n=e.current.valueOf(),s=0;s<e.hiddenDates.length;s++){var r=e.hiddenDates[s].start,a=e.hiddenDates[s].end;if(n>=r&&a>n){o=!0;break}}if(1==o&&n<e._end.valueOf()&&n!=i){var h=t(i),d=t(a);h.year()!=d.year()?e.switchedYear=!0:h.month()!=d.month()?e.switchedMonth=!0:h.dayOfYear()!=d.dayOfYear()&&(e.switchedDay=!0),e.current=d}},e.toScreen=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return(i.valueOf()-n.offset)*n.scale}var s=e.isHidden(i,t.body.hiddenDates);1==s.hidden&&(i=s.startDate);var r=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end);i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,t.range,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale},e.toTime=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return new Date(i/n.scale+n.offset)}var s=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end),r=t.range.end-t.range.start-s,a=r*i/o,h=e.getAccumulatedHiddenDuration(t.body.hiddenDates,t.range,a),d=new Date(h+a+t.range.start);return d},e.getHiddenDurationBetween=function(t,e,i){for(var o=0,n=0;n<t.length;n++){var s=t[n].start,r=t[n].end;s>=e&&i>r&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s<e.length;s++){var r=e[s].start,a=e[s].end;r>=i.start&&a<i.end&&o>=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r<t.length;r++){var a=t[r].start,h=t[r].end;if(a>=e.start&&h<e.end){if(n+=a-s,s=h,n>=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?0>o?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i<e.length;i++){var o=e[i].start,n=e[i].end;if(t>=o&&n>t)return{hidden:!0,startDate:o,endDate:n}}return{hidden:!1,startDate:o,endDate:n}}},function(t,e,i){function o(){}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(13),r=i(20),a=i(28),h=i(1),d=(i(9),i(11),i(30),i(34),i(44)),l=i(45),c=i(32),u=i(46);s(o.prototype),o.prototype._create=function(t){function e(t){i.isActive()&&i.emit("mousewheel",t)}this.dom={},this.dom.container=t,this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.on("rangechange",function(){this.initialDrawDone===!0&&this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("pan",this._onDrag.bind(this));var i=this;this.on("_change",function(t){t&&1==t.queue?i._redrawTimer||(i._redrawTimer=setTimeout(function(){i._redrawTimer=null,i._redraw()},0)):i._redraw()}),this.hammer=new r(this.dom.root);var o=this.hammer.get("pinch").set({enable:!0});a.disablePreventDefaultVertically(o),this.hammer.get("pan").set({threshold:5,direction:r.DIRECTION_HORIZONTAL}),this.listeners={};var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];if(n.forEach(function(t){var e=function(e){i.isActive()&&i.emit(t,e)};i.hammer.on(t,e),i.listeners[t]=e}),a.onTouch(this.hammer,function(t){i.emit("touch",t)}.bind(this)),a.onRelease(this.hammer,function(t){i.emit("release",t)}.bind(this)),this.dom.root.addEventListener("mousewheel",e),this.dom.root.addEventListener("DOMMouseScroll",e),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root)},o.prototype.setOptions=function(t){if(t){var e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","rtl","throttleRedraw"];if(h.selectiveExtend(e,this.options,t),this.options.rtl){var i=this.dom.leftContainer;this.dom.leftContainer=this.dom.rightContainer,this.dom.rightContainer=i,this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"}if(this.options.orientation={item:void 0,axis:void 0},"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"===n(t.orientation)&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){var o=this.timeAxis2=new d(this.body);o.setOptions=function(t){var e=t?h.extend({},t):{};e.orientation="top",d.prototype.setOptions.call(o,e)},this.components.push(o)}}else if(this.timeAxis2){var s=this.components.indexOf(this.timeAxis2);-1!==s&&this.components.splice(s,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&c.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new l(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),"showCustomTime"in t)throw new Error("Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])");this._initAutoResize()}if(this.components.forEach(function(e){return e.setOptions(t)}),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);var r=h.deepExtend({},this.options);this.components.forEach(function(t){h.deepExtend(r,t.options)}),this.configurator.setModuleOptions({global:r})}this._origRedraw?this._redraw():(this._origRedraw=this._redraw.bind(this),this._redraw=h.throttle(this._origRedraw,this.options.throttleRedraw))},o.prototype.isActive=function(){return!this.activator||this.activator.active},o.prototype.destroy=function(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(var t in this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];this.listeners=null,this.hammer=null,this.components.forEach(function(t){return t.destroy()}),this.body=null},o.prototype.setCustomTime=function(t,e){var i=this.customTimes.filter(function(t){return e===t.options.id});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));i.length>0&&i[0].setCustomTime(t)},o.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));return e[0].getCustomTime()},o.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));return i.length>0?i[0].setCustomTitle(t):void 0},o.prototype.getEventProperties=function(t){return{event:t}},o.prototype.addCustomTime=function(t,e){var i=void 0!==t?h.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+JSON.stringify(e)+" already exists");var n=new u(this.body,h.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},o.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=t&&void 0!==t.animation?t.animation:!0;this.range.setRange(o,n,s)}},o.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},o.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0!==n.animation?n.animation:!0,this.range.setRange(n.start,n.end,o)}else o=i&&void 0!==i.animation?i.animation:!0,this.range.setRange(t,e,o)},o.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=h.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=e&&void 0!==e.animation?e.animation:!0;this.range.setRange(n,s,r)},o.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){this.redrawCount++;var t=!1,e=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){c.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(h.addClassName(o.root,"vis-top"),h.removeClassName(o.root,"vis-bottom")):(h.removeClassName(o.root,"vis-top"),h.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=h.option.asSize(e.maxHeight,""),o.root.style.minHeight=h.option.asSize(e.minHeight,""),o.root.style.width=h.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var n=o.root.offsetHeight-o.root.clientHeight,s=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(s=n),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var a=Math.max(i.left.height,i.center.height,i.right.height),d=i.top.height+a+i.bottom.height+n+i.border.top+i.border.bottom;o.root.style.height=h.option.asSize(e.height,d+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-n;var l=i.root.height-i.top.height-i.bottom.height-n;i.centerContainer.height=l,i.leftContainer.height=l,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-s,i.left.width=o.leftContainer.clientWidth||-i.border.left,i.leftContainer.width=i.left.width,i.right.width=o.rightContainer.clientWidth||-i.border.right,i.rightContainer.width=i.right.width;var u=i.root.width-i.left.width-i.right.width-s;i.center.width=u,i.centerContainer.width=u,i.top.width=u,i.bottom.width=u,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px",this._updateScrollTop();var p=this.props.scrollTop;"top"!=e.orientation.item&&(p+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=p+"px",o.left.style.left="0",o.left.style.top=p+"px",o.right.style.left="0",o.right.style.top=p+"px";var f=0==this.props.scrollTop?"hidden":"",m=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=f,o.shadowBottom.style.visibility=m,o.shadowTopLeft.style.visibility=f,o.shadowBottomLeft.style.visibility=m,o.shadowTopRight.style.visibility=f,o.shadowBottomRight.style.visibility=m;var v=this.props.center.height>this.props.centerContainer.height;this.hammer.get("pan").set({direction:v?r.DIRECTION_ALL:r.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var g=5;if(t){if(this.redrawCount<g)return void this.body.emitter.emit("_change");console.log("WARNING: infinite loop in redraw?")}else this.redrawCount=0;this.initialDrawDone=!0,this.body.emitter.emit("changed")}},o.prototype.repaint=function(){throw new Error("Function repaint is deprecated. Use redraw instead.")},o.prototype.setCurrentTime=function(t){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");this.currentTime.setCurrentTime(t)},o.prototype.getCurrentTime=function(){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");return this.currentTime.getCurrentTime()},o.prototype._toTime=function(t){return c.toTime(this,t,this.props.center.width)},o.prototype._toGlobalTime=function(t){return c.toTime(this,t,this.props.root.width)},o.prototype._toScreen=function(t){return c.toScreen(this,t,this.props.center.width)},o.prototype._toGlobalScreen=function(t){return c.toScreen(this,t,this.props.root.width)},o.prototype._initAutoResize=function(){1==this.options.autoResize?this._startAutoResize():this._stopAutoResize()},o.prototype._startAutoResize=function(){var t=this;this._stopAutoResize(),this._onResize=function(){return 1!=t.options.autoResize?void t._stopAutoResize():void(t.dom.root&&(t.dom.root.offsetWidth==t.props.lastWidth&&t.dom.root.offsetHeight==t.props.lastHeight||(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight,t.body.emitter.emit("_change"))))},h.addEventListener(window,"resize",this._onResize),t.dom.root&&(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight),this.watchTimer=setInterval(this._onResize,1e3)},o.prototype._stopAutoResize=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0),this._onResize&&(h.removeEventListener(window,"resize",this._onResize),this._onResize=null)},o.prototype._onTouch=function(t){this.touch.allowDragging=!0,this.touch.initialScrollTop=this.props.scrollTop},o.prototype._onPinch=function(t){this.touch.allowDragging=!1},o.prototype._onDrag=function(t){if(this.touch.allowDragging){var e=t.deltaY,i=this._getScrollTop(),o=this._setScrollTop(this.touch.initialScrollTop+e);o!=i&&this.emit("verticalDrag")}},o.prototype._setScrollTop=function(t){return this.props.scrollTop=t,this._updateScrollTop(),this.props.scrollTop},o.prototype._updateScrollTop=function(){var t=Math.min(this.props.centerContainer.height-this.props.center.height,0);return t!=this.props.scrollTopMin&&("top"!=this.options.orientation.item&&(this.props.scrollTop+=t-this.props.scrollTopMin),this.props.scrollTopMin=t),this.props.scrollTop>0&&(this.props.scrollTop=0),this.props.scrollTop<t&&(this.props.scrollTop=t),this.props.scrollTop},o.prototype._getScrollTop=function(){return this.props.scrollTop},o.prototype._createConfigurator=function(){throw new Error("Cannot invoke abstract method _createConfigurator")},t.exports=o},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={rtl:!1,type:null,orientation:{item:"bottom"},align:"auto",stack:!0,groupOrderSwap:function(t,e,i){var o=e.order;e.order=t.order,t.order=o},groupOrder:"order",selectable:!0,multiselect:!1,itemsAlwaysDraggable:!1,editable:{updateTime:!1,updateGroup:!1,add:!1,remove:!1},groupEditable:{order:!1,add:!1,remove:!1},snap:d.snap,onAdd:function(t,e){e(t)},onUpdate:function(t,e){e(t)},onMove:function(t,e){e(t)},onRemove:function(t,e){e(t)},onMoving:function(t,e){e(t)},onAddGroup:function(t,e){e(t)},onMoveGroup:function(t,e){e(t)},onRemoveGroup:function(t,e){e(t)},margin:{item:{horizontal:10,vertical:10},axis:20}},this.options=r.extend({},this.defaultOptions),this.itemOptions={type:{start:"Date",end:"Date"}},this.conversion={toScreen:t.util.toScreen,toTime:t.util.toTime},this.dom={},this.props={},this.hammer=null;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.groups={},this.groupIds=[],this.selection=[],this.stackDirty=!0,this.touchParams={},this.groupTouchParams={},this._create(),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(20),r=i(1),a=i(9),h=i(11),d=i(35),l=i(31),c=i(36),u=i(40),p=i(41),f=i(42),m=i(38),v=i(43),g="__ungrouped__",y="__background__";o.prototype=new l,o.types={background:v,box:p,range:m,point:f},o.prototype._create=function(){var t=document.createElement("div");t.className="vis-itemset",t["timeline-itemset"]=this,this.dom.frame=t;var e=document.createElement("div");e.className="vis-background",t.appendChild(e),this.dom.background=e;var i=document.createElement("div");i.className="vis-foreground",t.appendChild(i),this.dom.foreground=i;var o=document.createElement("div");o.className="vis-axis",this.dom.axis=o;var n=document.createElement("div");n.className="vis-labelset",this.dom.labelSet=n,this._updateUngrouped();var r=new u(y,null,this);r.show(),this.groups[y]=r,this.hammer=new s(this.body.dom.centerContainer),this.hammer.on("hammer.input",function(t){t.isFirst&&this._onTouch(t)}.bind(this)),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_HORIZONTAL}),this.hammer.on("tap",this._onSelectItem.bind(this)),this.hammer.on("press",this._onMultiSelectItem.bind(this)),this.hammer.on("doubletap",this._onAddItem.bind(this)),this.groupHammer=new s(this.body.dom.leftContainer),this.groupHammer.on("panstart",this._onGroupDragStart.bind(this)),this.groupHammer.on("panmove",this._onGroupDrag.bind(this)),this.groupHammer.on("panend",this._onGroupDragEnd.bind(this)),this.groupHammer.get("pan").set({threshold:5,direction:s.DIRECTION_HORIZONTAL}),this.show()},o.prototype.setOptions=function(t){if(t){var e=["type","rtl","align","order","stack","selectable","multiselect","itemsAlwaysDraggable","multiselectPerGroup","groupOrder","dataAttributes","template","groupTemplate","hide","snap","groupOrderSwap"];r.selectiveExtend(e,this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.item="top"===t.orientation?"top":"bottom":"object"===n(t.orientation)&&"item"in t.orientation&&(this.options.orientation.item=t.orientation.item)),"margin"in t&&("number"==typeof t.margin?(this.options.margin.axis=t.margin,this.options.margin.item.horizontal=t.margin,this.options.margin.item.vertical=t.margin):"object"===n(t.margin)&&(r.selectiveExtend(["axis"],this.options.margin,t.margin),"item"in t.margin&&("number"==typeof t.margin.item?(this.options.margin.item.horizontal=t.margin.item,this.options.margin.item.vertical=t.margin.item):"object"===n(t.margin.item)&&r.selectiveExtend(["horizontal","vertical"],this.options.margin.item,t.margin.item)))),"editable"in t&&("boolean"==typeof t.editable?(this.options.editable.updateTime=t.editable,this.options.editable.updateGroup=t.editable,this.options.editable.add=t.editable,this.options.editable.remove=t.editable):"object"===n(t.editable)&&r.selectiveExtend(["updateTime","updateGroup","add","remove"],this.options.editable,t.editable)),"groupEditable"in t&&("boolean"==typeof t.groupEditable?(this.options.groupEditable.order=t.groupEditable,this.options.groupEditable.add=t.groupEditable,this.options.groupEditable.remove=t.groupEditable):"object"===n(t.groupEditable)&&r.selectiveExtend(["order","add","remove"],this.options.groupEditable,t.groupEditable));var i=function(e){var i=t[e];if(i){if(!(i instanceof Function))throw new Error("option "+e+" must be a function "+e+"(item, callback)");this.options[e]=i}}.bind(this);["onAdd","onUpdate","onRemove","onMove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup"].forEach(i),this.markDirty()}},o.prototype.markDirty=function(t){this.groupIds=[],this.stackDirty=!0,t&&t.refreshItems&&r.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()})},o.prototype.destroy=function(){this.hide(),this.setItems(null),this.setGroups(null),this.hammer=null,this.body=null,this.conversion=null},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.axis.parentNode&&this.dom.axis.parentNode.removeChild(this.dom.axis),this.dom.labelSet.parentNode&&this.dom.labelSet.parentNode.removeChild(this.dom.labelSet)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame),this.dom.axis.parentNode||this.body.dom.backgroundVertical.appendChild(this.dom.axis),this.dom.labelSet.parentNode||this.body.dom.left.appendChild(this.dom.labelSet)},o.prototype.setSelection=function(t){var e,i,o,n;for(void 0==t&&(t=[]),Array.isArray(t)||(t=[t]),e=0,i=this.selection.length;i>e;e++)o=this.selection[e],n=this.items[o],n&&n.unselect();for(this.selection=[],e=0,i=t.length;i>e;e++)o=t[e],n=this.items[o],n&&(this.selection.push(o),n.select())},o.prototype.getSelection=function(){return this.selection.concat([])},o.prototype.getVisibleItems=function(){var t=this.body.range.getRange();if(this.options.rtl)var e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end);else var i=this.body.util.toScreen(t.start),e=this.body.util.toScreen(t.end);var o=[];for(var n in this.groups)if(this.groups.hasOwnProperty(n))for(var s=this.groups[n],r=s.visibleItems,a=0;a<r.length;a++){var h=r[a];this.options.rtl?h.right<i&&h.right+h.width>e&&o.push(h.id):h.left<e&&h.left+h.width>i&&o.push(h.id)}return o},o.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;o>i;i++)if(e[i]==t){e.splice(i,1);break}},o.prototype.redraw=function(){var t=this.options.margin,e=this.body.range,i=r.option.asSize,o=this.options,n=o.orientation.item,s=!1,a=this.dom.frame;this.props.top=this.body.domProps.top.height+this.body.domProps.border.top,this.options.rtl?this.props.right=this.body.domProps.right.width+this.body.domProps.border.right:this.props.left=this.body.domProps.left.width+this.body.domProps.border.left,a.className="vis-itemset",s=this._orderGroups()||s;var h=e.end-e.start,d=h!=this.lastVisibleInterval||this.props.width!=this.props.lastWidth;d&&(this.stackDirty=!0),
+this.lastVisibleInterval=h,this.props.lastWidth=this.props.width;var l=this.stackDirty,c=this._firstGroup(),u={item:t.item,axis:t.axis},p={item:t.item,axis:t.item.vertical/2},f=0,m=t.axis+t.item.vertical;return this.groups[y].redraw(e,p,l),r.forEach(this.groups,function(t){var i=t==c?u:p,o=t.redraw(e,i,l);s=o||s,f+=t.height}),f=Math.max(f,m),this.stackDirty=!1,a.style.height=i(f),this.props.width=a.offsetWidth,this.props.height=f,this.dom.axis.style.top=i("top"==n?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.options.rtl?this.dom.axis.style.right="0":this.dom.axis.style.left="0",s=this._isResized()||s},o.prototype._firstGroup=function(){var t="top"==this.options.orientation.item?0:this.groupIds.length-1,e=this.groupIds[t],i=this.groups[e]||this.groups[g];return i||null},o.prototype._updateUngrouped=function(){var t,e,i=this.groups[g];this.groups[y];if(this.groupsData){if(i){i.hide(),delete this.groups[g];for(e in this.items)if(this.items.hasOwnProperty(e)){t=this.items[e],t.parent&&t.parent.remove(t);var o=this._getGroupId(t.data),n=this.groups[o];n&&n.add(t)||t.hide()}}}else if(!i){var s=null,r=null;i=new c(s,r,this),this.groups[g]=i;for(e in this.items)this.items.hasOwnProperty(e)&&(t=this.items[e],i.add(t));i.show()}},o.prototype.getLabelSet=function(){return this.dom.labelSet},o.prototype.setItems=function(t){var e,i=this,o=this.itemsData;if(t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=t}else this.itemsData=null;if(o&&(r.forEach(this.itemListeners,function(t,e){o.off(e,t)}),e=o.getIds(),this._onRemove(e)),this.itemsData){var n=this.id;r.forEach(this.itemListeners,function(t,e){i.itemsData.on(e,t,n)}),e=this.itemsData.getIds(),this._onAdd(e),this._updateUngrouped()}this.body.emitter.emit("_change",{queue:!0})},o.prototype.getItems=function(){return this.itemsData},o.prototype.setGroups=function(t){var e,i=this;if(this.groupsData&&(r.forEach(this.groupListeners,function(t,e){i.groupsData.off(e,t)}),e=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(e)),t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var o=this.id;r.forEach(this.groupListeners,function(t,e){i.groupsData.on(e,t,o)}),e=this.groupsData.getIds(),this._onAddGroups(e)}this._updateUngrouped(),this._order(),this.body.emitter.emit("_change",{queue:!0})},o.prototype.getGroups=function(){return this.groupsData},o.prototype.removeItem=function(t){var e=this.itemsData.get(t),i=this.itemsData.getDataSet();e&&this.options.onRemove(e,function(e){e&&i.remove(t)})},o.prototype._getType=function(t){return t.type||this.options.type||(t.end?"range":"box")},o.prototype._getGroupId=function(t){var e=this._getType(t);return"background"==e&&void 0==t.group?y:this.groupsData?t.group:g},o.prototype._onUpdate=function(t){var e=this;t.forEach(function(t){var i,n=e.itemsData.get(t,e.itemOptions),s=e.items[t],r=e._getType(n),a=o.types[r];if(s&&(a&&s instanceof a?e._updateItem(s,n):(i=s.selected,e._removeItem(s),s=null)),!s){if(!a)throw"rangeoverflow"==r?new TypeError('Item type "rangeoverflow" is deprecated. Use css styling instead: .vis-item.vis-range .vis-item-content {overflow: visible;}'):new TypeError('Unknown item type "'+r+'"');s=new a(n,e.conversion,e.options),s.id=t,e._addItem(s),i&&(this.selection.push(t),s.select())}}.bind(this)),this._order(),this.stackDirty=!0,this.body.emitter.emit("_change",{queue:!0})},o.prototype._onAdd=o.prototype._onUpdate,o.prototype._onRemove=function(t){var e=0,i=this;t.forEach(function(t){var o=i.items[t];o&&(e++,i._removeItem(o))}),e&&(this._order(),this.stackDirty=!0,this.body.emitter.emit("_change",{queue:!0}))},o.prototype._order=function(){r.forEach(this.groups,function(t){t.order()})},o.prototype._onUpdateGroups=function(t){this._onAddGroups(t)},o.prototype._onAddGroups=function(t){var e=this;t.forEach(function(t){var i=e.groupsData.get(t),o=e.groups[t];if(o)o.setData(i);else{if(t==g||t==y)throw new Error("Illegal group id. "+t+" is a reserved id.");var n=Object.create(e.options);r.extend(n,{height:null}),o=new c(t,i,e),e.groups[t]=o;for(var s in e.items)if(e.items.hasOwnProperty(s)){var a=e.items[s];a.data.group==t&&o.add(a)}o.order(),o.show()}}),this.body.emitter.emit("_change",{queue:!0})},o.prototype._onRemoveGroups=function(t){var e=this.groups;t.forEach(function(t){var i=e[t];i&&(i.hide(),delete e[t])}),this.markDirty(),this.body.emitter.emit("_change",{queue:!0})},o.prototype._orderGroups=function(){if(this.groupsData){var t=this.groupsData.getIds({order:this.options.groupOrder}),e=!r.equalArray(t,this.groupIds);if(e){var i=this.groups;t.forEach(function(t){i[t].hide()}),t.forEach(function(t){i[t].show()}),this.groupIds=t}return e}return!1},o.prototype._addItem=function(t){this.items[t.id]=t;var e=this._getGroupId(t.data),i=this.groups[e];i&&i.add(t)},o.prototype._updateItem=function(t,e){var i=t.data.group,o=t.data.subgroup;if(t.setData(e),i!=t.data.group||o!=t.data.subgroup){var n=this.groups[i];n&&n.remove(t);var s=this._getGroupId(t.data),r=this.groups[s];r&&r.add(t)}},o.prototype._removeItem=function(t){t.hide(),delete this.items[t.id];var e=this.selection.indexOf(t.id);-1!=e&&this.selection.splice(e,1),t.parent&&t.parent.remove(t)},o.prototype._constructByEndArray=function(t){for(var e=[],i=0;i<t.length;i++)t[i]instanceof m&&e.push(t[i]);return e},o.prototype._onTouch=function(t){this.touchParams.item=this.itemFromTarget(t),this.touchParams.dragLeftItem=t.target.dragLeftItem||!1,this.touchParams.dragRightItem=t.target.dragRightItem||!1,this.touchParams.itemProps=null},o.prototype._getGroupIndex=function(t){for(var e=0;e<this.groupIds.length;e++)if(t==this.groupIds[e])return e},o.prototype._onDragStart=function(t){var e,i=this.touchParams.item||null,o=this;if(i&&(i.selected||this.options.itemsAlwaysDraggable)){if(!this.options.editable.updateTime&&!this.options.editable.updateGroup&&!i.editable)return;if(i.editable===!1)return;var n=this.touchParams.dragLeftItem,s=this.touchParams.dragRightItem;if(n)e={item:n,initialX:t.center.x,dragLeft:!0,data:this._cloneItemData(i.data)},this.touchParams.itemProps=[e];else if(s)e={item:s,initialX:t.center.x,dragRight:!0,data:this._cloneItemData(i.data)},this.touchParams.itemProps=[e];else{this.touchParams.selectedItem=i;var r=this._getGroupIndex(i.data.group),a=this.options.itemsAlwaysDraggable&&!i.selected?[i.id]:this.getSelection();this.touchParams.itemProps=a.map(function(e){var i=o.items[e],n=o._getGroupIndex(i.data.group);return{item:i,initialX:t.center.x,groupOffset:r-n,data:this._cloneItemData(i.data)}}.bind(this))}t.stopPropagation()}else this.options.editable.add&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey)&&this._onDragStartAddItem(t)},o.prototype._onDragStartAddItem=function(t){var e=this.options.snap||null;if(this.options.rtl)var i=r.getAbsoluteRight(this.dom.frame),o=i-t.center.x+10;else var i=r.getAbsoluteLeft(this.dom.frame),o=t.center.x-i-10;var n=this.body.util.toTime(o),s=this.body.util.getScale(),a=this.body.util.getStep(),h=e?e(n,s,a):n,d=h,l={type:"range",start:h,end:d,content:"new item"},c=r.randomUUID();l[this.itemsData._fieldId]=c;var u=this.groupFromTarget(t);u&&(l.group=u.groupId);var p=new m(l,this.conversion,this.options);p.id=c,p.data=this._cloneItemData(l),this._addItem(p);var f={item:p,initialX:t.center.x,data:p.data};this.options.rtl?f.dragLeft=!0:f.dragRight=!0,this.touchParams.itemProps=[f],t.stopPropagation()},o.prototype._onDrag=function(t){if(this.touchParams.itemProps){t.stopPropagation();var e=this,i=this.options.snap||null;if(this.options.rtl)var o=this.body.dom.root.offsetLeft+this.body.domProps.right.width;else var o=this.body.dom.root.offsetLeft+this.body.domProps.left.width;var n=this.body.util.getScale(),s=this.body.util.getStep(),a=this.touchParams.selectedItem,h=e.options.editable.updateGroup,d=null;if(h&&a&&void 0!=a.data.group){var l=e.groupFromTarget(t);l&&(d=this._getGroupIndex(l.groupId))}this.touchParams.itemProps.forEach(function(a){var h=e.body.util.toTime(t.center.x-o),l=e.body.util.toTime(a.initialX-o);if(this.options.rtl)var c=-(h-l);else var c=h-l;var u=this._cloneItemData(a.item.data);if(a.item.editable!==!1){var p=e.options.editable.updateTime||a.item.editable===!0;if(p)if(a.dragLeft){if(this.options.rtl){if(void 0!=u.end){var f=r.convert(a.data.end,"Date"),m=new Date(f.valueOf()+c);u.end=i?i(m,n,s):m}}else if(void 0!=u.start){var v=r.convert(a.data.start,"Date"),g=new Date(v.valueOf()+c);u.start=i?i(g,n,s):g}}else if(a.dragRight){if(this.options.rtl){if(void 0!=u.start){var v=r.convert(a.data.start,"Date"),g=new Date(v.valueOf()+c);u.start=i?i(g,n,s):g}}else if(void 0!=u.end){var f=r.convert(a.data.end,"Date"),m=new Date(f.valueOf()+c);u.end=i?i(m,n,s):m}}else if(void 0!=u.start){var v=r.convert(a.data.start,"Date").valueOf(),g=new Date(v+c);if(void 0!=u.end){var f=r.convert(a.data.end,"Date"),y=f.valueOf()-v.valueOf();u.start=i?i(g,n,s):g,u.end=new Date(u.start.valueOf()+y)}else u.start=i?i(g,n,s):g}var b=e.options.editable.updateGroup||a.item.editable===!0;if(b&&!a.dragLeft&&!a.dragRight&&null!=d&&void 0!=u.group){var w=d-a.groupOffset;w=Math.max(0,w),w=Math.min(e.groupIds.length-1,w),u.group=e.groupIds[w]}u=this._cloneItemData(u),e.options.onMoving(u,function(t){t&&a.item.setData(this._cloneItemData(t,"Date"))}.bind(this))}}.bind(this)),this.stackDirty=!0,this.body.emitter.emit("_change")}},o.prototype._moveToGroup=function(t,e){var i=this.groups[e];if(i&&i.groupId!=t.data.group){var o=t.parent;o.remove(t),o.order(),i.add(t),i.order(),t.data.group=i.groupId}},o.prototype._onDragEnd=function(t){if(this.touchParams.itemProps){t.stopPropagation();var e=this,i=this.itemsData.getDataSet(),o=this.touchParams.itemProps;this.touchParams.itemProps=null,o.forEach(function(t){var o=t.item.id,n=null!=e.itemsData.get(o,e.itemOptions);if(n){var s=this._cloneItemData(t.item.data);e.options.onMove(s,function(n){n?(n[i._fieldId]=o,i.update(n)):(t.item.setData(t.data),e.stackDirty=!0,e.body.emitter.emit("_change"))})}else e.options.onAdd(t.item.data,function(i){e._removeItem(t.item),i&&e.itemsData.getDataSet().add(i),e.stackDirty=!0,e.body.emitter.emit("_change")})}.bind(this))}},o.prototype._onGroupDragStart=function(t){this.options.groupEditable.order&&(this.groupTouchParams.group=this.groupFromTarget(t),this.groupTouchParams.group&&(t.stopPropagation(),this.groupTouchParams.originalOrder=this.groupsData.getIds({order:this.options.groupOrder})))},o.prototype._onGroupDrag=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this.groupFromTarget(t);if(e&&e.height!=this.groupTouchParams.group.height){var i=e.top<this.groupTouchParams.group.top,o=t.center?t.center.y:t.clientY,n=r.getAbsoluteTop(e.dom.foreground),s=this.groupTouchParams.group.height;if(i){if(o>n+s)return}else{var a=e.height;if(n+a-s>o)return}}if(e&&e!=this.groupTouchParams.group){var h=this.groupsData,d=h.get(e.groupId),l=h.get(this.groupTouchParams.group.groupId);l&&d&&(this.options.groupOrderSwap(l,d,this.groupsData),this.groupsData.update(l),this.groupsData.update(d));var c=this.groupsData.getIds({order:this.options.groupOrder});if(!r.equalArray(c,this.groupTouchParams.originalOrder))for(var h=this.groupsData,u=this.groupTouchParams.originalOrder,p=this.groupTouchParams.group.groupId,f=Math.min(u.length,c.length),m=0,v=0,g=0;f>m;){for(;f>m+v&&f>m+g&&c[m+v]==u[m+g];)m++;if(m+v>=f)break;if(c[m+v]!=p)if(u[m+g]!=p){var y=c.indexOf(u[m+g]),b=h.get(c[m+v]),w=h.get(u[m+g]);this.options.groupOrderSwap(b,w,h),h.update(b),h.update(w);var _=c[m+v];c[m+v]=u[m+g],c[y]=_,m++}else g=1;else v=1}}}},o.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=r.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!r.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,a=Math.min(s.length,n.length),h=0;a>h;){for(;a>h&&n[h]==s[h];)h++;if(h>=a)break;var d=n.indexOf(s[h]),l=o.get(n[h]),c=o.get(s[h]);e.options.groupOrderSwap(l,c,o),groupsData.update(l),groupsData.update(c);var u=n[h];n[h]=s[h],n[d]=u,h++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},o.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}},o.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(o){var n=e.itemsData.get(o.id);this.options.onUpdate(n,function(t){t&&e.itemsData.getDataSet().update(t)})}else{if(this.options.rtl)var s=r.getAbsoluteRight(this.dom.frame),a=s-t.center.x;else var s=r.getAbsoluteLeft(this.dom.frame),a=t.center.x-s;var h=this.body.util.toTime(a),d=this.body.util.getScale(),l=this.body.util.getStep(),c={start:i?i(h,d,l):h,content:"new item"};if("range"===this.options.type){var u=this.body.util.toTime(a+this.props.width/5);c.end=i?i(u,d,l):u}c[this.itemsData._fieldId]=r.randomUUID();var p=this.groupFromTarget(t);p&&(c.group=p.groupId),c=this._cloneItemData(c),this.options.onAdd(c,function(t){t&&e.itemsData.getDataSet().add(t)})}}},o.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],n=t.srcEvent&&t.srcEvent.shiftKey||!1;if(n&&this.options.multiselect){var s=this.itemsData.get(e.id).group,r=void 0;this.options.multiselectPerGroup&&i.length>0&&(r=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&void 0!=r&&r!=s||i.push(e.id);var a=o._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,c=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&c<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof v||i.push(d.id)}}}else{var u=i.indexOf(e.id);-1==u?i.push(e.id):i.splice(u,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}},o._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.start<i)&&(i=t.start),void 0!=t.end?(null==e||t.end>e)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},o.prototype.itemFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},o.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;i<this.groupIds.length;i++){var o=this.groupIds[i],n=this.groups[o],s=n.dom.foreground,a=r.getAbsoluteTop(s);if(e>a&&e<a+s.offsetHeight)return n;if("top"===this.options.orientation.item){if(i===this.groupIds.length-1&&e>a)return n}else if(0===i&&e<a+s.offset)return n}return null},o.itemSetFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-itemset"))return e["timeline-itemset"];e=e.parentNode}return null},o.prototype._cloneItemData=function(t,e){var i=r.extend({},t);return e||(e=this.itemsData.getDataSet()._options.type),void 0!=i.start&&(i.start=r.convert(i.start,e&&e.start||"Date")),void 0!=i.end&&(i.end=r.convert(i.end,e&&e.end||"Date")),i},t.exports=o},function(t,e,i){function o(t,e,i,s){this.moment=n,this.current=this.moment(),this._start=this.moment(),this._end=this.moment(),this.autoScale=!0,this.scale="day",this.step=1,this.setRange(t,e,i),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,Array.isArray(s)?this.hiddenDates=s:void 0!=s?this.hiddenDates=[s]:this.hiddenDates=[],this.format=o.FORMAT}var n=i(2),s=i(32),r=i(1);o.FORMAT={minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},o.prototype.setMoment=function(t){this.moment=t,this.current=this.moment(this.current),this._start=this.moment(this._start),this._end=this.moment(this._end)},o.prototype.setFormat=function(t){var e=r.deepExtend({},o.FORMAT);this.format=r.deepExtend(e,t)},o.prototype.setRange=function(t,e,i){if(!(t instanceof Date&&e instanceof Date))throw"No legal start or end date in method setRange";this._start=void 0!=t?this.moment(t.valueOf()):new Date,this._end=void 0!=e?this.moment(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i)},o.prototype.start=function(){this.current=this._start.clone(),this.roundToMinor()},o.prototype.roundToMinor=function(){switch(this.scale){case"year":this.current.year(this.step*Math.floor(this.current.year()/this.step)),this.current.month(0);case"month":this.current.date(1);case"day":case"weekday":this.current.hours(0);case"hour":this.current.minutes(0);case"minute":this.current.seconds(0);case"second":this.current.milliseconds(0)}if(1!=this.step)switch(this.scale){case"millisecond":this.current.subtract(this.current.milliseconds()%this.step,"milliseconds");break;case"second":this.current.subtract(this.current.seconds()%this.step,"seconds");break;case"minute":this.current.subtract(this.current.minutes()%this.step,"minutes");break;case"hour":this.current.subtract(this.current.hours()%this.step,"hours");break;case"weekday":case"day":this.current.subtract((this.current.date()-1)%this.step,"day");break;case"month":this.current.subtract(this.current.month()%this.step,"month");break;case"year":this.current.subtract(this.current.year()%this.step,"year")}},o.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},o.prototype.next=function(){var t=this.current.valueOf();if(this.current.month()<6)switch(this.scale){case"millisecond":this.current.add(this.step,"millisecond");break;case"second":this.current.add(this.step,"second");break;case"minute":this.current.add(this.step,"minute");break;case"hour":this.current.add(this.step,"hour"),this.current.subtract(this.current.hours()%this.step,"hour");break;case"weekday":case"day":this.current.add(this.step,"day");break;case"month":this.current.add(this.step,"month");break;case"year":this.current.add(this.step,"year")}else switch(this.scale){case"millisecond":this.current.add(this.step,"millisecond");break;case"second":this.current.add(this.step,"second");break;case"minute":this.current.add(this.step,"minute");break;case"hour":this.current.add(this.step,"hour");break;case"weekday":case"day":this.current.add(this.step,"day");break;case"month":this.current.add(this.step,"month");break;case"year":this.current.add(this.step,"year")}if(1!=this.step)switch(this.scale){case"millisecond":this.current.milliseconds()<this.step&&this.current.milliseconds(0);break;case"second":this.current.seconds()<this.step&&this.current.seconds(0);break;case"minute":this.current.minutes()<this.step&&this.current.minutes(0);break;case"hour":this.current.hours()<this.step&&this.current.hours(0);break;case"weekday":case"day":this.current.date()<this.step+1&&this.current.date(1);break;case"month":this.current.month()<this.step&&this.current.month(0);break;case"year":}this.current.valueOf()==t&&(this.current=this._end.clone()),s.stepOverHiddenDates(this.moment,this,t)},o.prototype.getCurrent=function(){return this.current},o.prototype.setScale=function(t){t&&"string"==typeof t.scale&&(this.scale=t.scale,this.step=t.step>0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.switchedYear=!1,this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.switchedMonth=!1,this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.switchedDay=!1,this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){void 0==t&&(t=this.current);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){void 0==t&&(t=this.current);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return t(a.milliseconds()).trim();case"second":return t(a.seconds()).trim();case"minute":return t(a.minutes()).trim();case"hour":var d=a.hours();return 4==this.step&&(d=d+"-h"+(d+4)),"vis-h"+d+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":var l=a.date(),c=a.format("MMMM").toLowerCase();return"vis-day"+l+" vis-"+c+o(a)+t(l-1);case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var u=a.year();return"vis-year"+u+n(a)+t(u);default:return""}},t.exports=o},function(t,e,i){function o(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var n=i(1),s=i(37);i(38);o.prototype._create=function(){var t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.innerHTML="?",this.dom.background.appendChild(this.dom.marker)},o.prototype.setData=function(t){var e;if(e=this.itemSet.options&&this.itemSet.options.groupTemplate?this.itemSet.options.groupTemplate(t):t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?n.removeClassName(this.dom.inner,"vis-hidden"):n.addClassName(this.dom.inner,"vis-hidden");var i=t&&t.className||null;i!=this.className&&(this.className&&(n.removeClassName(this.dom.label,this.className),n.removeClassName(this.dom.foreground,this.className),n.removeClassName(this.dom.background,this.className),n.removeClassName(this.dom.axis,this.className)),n.addClassName(this.dom.label,i),n.addClassName(this.dom.foreground,i),n.addClassName(this.dom.background,i),n.addClassName(this.dom.axis,i),this.className=i),this.style&&(n.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(n.addCssText(this.dom.label,t.style),this.style=t.style)},o.prototype.getLabelWidth=function(){return this.props.label.width},o.prototype.redraw=function(t,e,i){var o=!1,r=this.dom.marker.clientHeight;if(r!=this.lastMarkerHeight&&(this.lastMarkerHeight=r,n.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(),"function"==typeof this.itemSet.options.order){if(i){var a=this,h=!1;n.forEach(this.items,function(t){t.displayed||(t.redraw(),a.visibleItems.push(t)),t.repositionX(h)});var d=this.orderedItems.byStart.slice().sort(function(t,e){return a.itemSet.options.order(t.data,e.data)});s.stack(d,e,!0)}this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?s.stack(this.visibleItems,e,i):s.nostack(this.visibleItems,e,this.subgroups);var l=this._calculateHeight(e),c=this.dom.foreground;this.top=c.offsetTop,this.right=c.offsetLeft,this.width=c.offsetWidth,o=n.updateProperty(this,"height",l)||o,o=n.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=n.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=l+"px",this.dom.foreground.style.height=l+"px",this.dom.label.style.height=l+"px";for(var u=0,p=this.visibleItems.length;p>u;u++){var f=this.visibleItems[u];f.repositionY(e)}return o},o.prototype._calculateSubGroupHeights=function(){if(Object.keys(this.subgroups).length>0){var t=this;this.resetSubgroups(),n.forEach(this.visibleItems,function(e){void 0!==e.data.subgroup&&(t.subgroups[e.data.subgroup].height=Math.max(t.subgroups[e.data.subgroup].height,e.height),t.subgroups[e.data.subgroup].visible=!0)})}},o.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,s=i[0].top+i[0].height;if(n.forEach(i,function(t){o=Math.min(o,t.top),s=Math.max(s,t.top+t.height)}),o>t.axis){var r=o-t.axis;s-=r,n.forEach(i,function(t){t.top-=r})}e=s+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),-1==this.visibleItems.indexOf(t)){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;i<t.length;i++)this.subgroups[t[i].subgroup].index=i}},o.prototype.resetSubgroups=function(){for(var t in this.subgroups)this.subgroups.hasOwnProperty(t)&&(this.subgroups[t].visible=!1)},o.prototype.remove=function(t){delete this.items[t.id],t.setParent(null);var e=this.visibleItems.indexOf(t);if(-1!=e&&this.visibleItems.splice(e,1),void 0!==t.data.subgroup){var i=this.subgroups[t.data.subgroup];if(i){var o=i.items.indexOf(t);i.items.splice(o,1),i.items.length||(delete this.subgroups[t.data.subgroup],this.subgroupIndex--),this.orderSubgroups()}}},o.prototype.removeFromDataSet=function(t){this.itemSet.removeItem(t.id)},o.prototype.order=function(){for(var t=n.toArray(this.items),e=[],i=[],o=0;o<t.length;o++)void 0!==t[o].data.end&&i.push(t[o]),e.push(t[o]);this.orderedItems={byStart:e,byEnd:i},s.orderByStart(this.orderedItems.byStart),s.orderByEnd(this.orderedItems.byEnd)},o.prototype._updateVisibleItems=function(t,e,i){var o,s,r=[],a={},h=(i.end-i.start)/4,d=i.start-h,l=i.end+h,c=function(t){
+return d>t?-1:l>=t?0:1};if(e.length>0)for(s=0;s<e.length;s++)this._checkIfVisibleWithReference(e[s],r,a,i);var u=n.binarySearchCustom(t.byStart,c,"data","start");if(this._traceVisible(u,t.byStart,r,a,function(t){return t.data.start<d||t.data.start>l}),1==this.checkRangedItems)for(this.checkRangedItems=!1,s=0;s<t.byEnd.length;s++)this._checkIfVisibleWithReference(t.byEnd[s],r,a,i);else{var p=n.binarySearchCustom(t.byEnd,c,"data","end");this._traceVisible(p,t.byEnd,r,a,function(t){return t.data.end<d||t.data.end>l})}for(s=0;s<r.length;s++)o=r[s],o.displayed||o.show(),o.repositionX();return r},o.prototype._traceVisible=function(t,e,i,o,n){var s,r;if(-1!=t){for(r=t;r>=0&&(s=e[r],!n(s));r--)void 0===o[s.id]&&(o[s.id]=!0,i.push(s));for(r=t+1;r<e.length&&(s=e[r],!n(s));r++)void 0===o[s.id]&&(o[s.id]=!0,i.push(s))}},o.prototype._checkIfVisible=function(t,e,i){t.isVisible(i)?(t.displayed||t.show(),t.repositionX(),e.push(t)):t.displayed&&t.hide()},o.prototype._checkIfVisibleWithReference=function(t,e,i,o){t.isVisible(o)?void 0===i[t.id]&&(i[t.id]=!0,e.push(t)):t.displayed&&t.hide()},t.exports=o},function(t,e){var i=.001;e.orderByStart=function(t){t.sort(function(t,e){return t.data.start-e.data.start})},e.orderByEnd=function(t){t.sort(function(t,e){var i="end"in t.data?t.data.end:t.data.start,o="end"in e.data?e.data.end:e.data.start;return i-o})},e.stack=function(t,i,o){var n,s;if(o)for(n=0,s=t.length;s>n;n++)t[n].top=null;for(n=0,s=t.length;s>n;n++){var r=t[n];if(r.stack&&null===r.top){r.top=i.axis;do{for(var a=null,h=0,d=t.length;d>h;h++){var l=t[h];if(null!==l.top&&l!==r&&l.stack&&e.collision(r,l,i.item,l.options.rtl)){a=l;break}}null!=a&&(r.top=a.top+a.height+i.item.vertical)}while(a)}}},e.nostack=function(t,e,i){var o,n,s;for(o=0,n=t.length;n>o;o++)if(void 0!==t[o].data.subgroup){s=e.axis;for(var r in i)i.hasOwnProperty(r)&&1==i[r].visible&&i[r].index<i[t[o].data.subgroup].index&&(s+=i[r].height+e.item.vertical);t[o].top=s}else t[o].top=e.axis},e.collision=function(t,e,o,n){return n?t.right-o.horizontal+i<e.right+e.width&&t.right+t.width+o.horizontal-i>e.right&&t.top-o.vertical+i<e.top+e.height&&t.top+t.height+o.vertical-i>e.top:t.left-o.horizontal+i<e.left+e.width&&t.left+t.width+o.horizontal-i>e.left&&t.top-o.vertical+i<e.top+e.height&&t.top+t.height+o.vertical-i>e.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(20),i(39));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.start<t.end&&this.data.end>t.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintDeleteButton(t.box),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==t&&t!==!0||(-o>n&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:0>n?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":this.dom.content.style.left=e+"px"}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&"boolean"==typeof this.data.editable&&(this.editable=t.editable)}var n=i(20),s=i(1);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&"boolean"==typeof t.editable&&(this.editable=t.editable),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},o.prototype.isVisible=function(t){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.remove||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new n(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._updateContents=function(t){var e;if(this.options.template){var i=this.parent.itemSet.itemsData.get(this.id);e=this.options.template(i)}else e=this.data.content;var o=this._contentToString(this.content)!==this._contentToString(e);if(o){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}},o.prototype._updateTitle=function(t){null!=this.data.title?t.title=this.data.title||"":t.removeAttribute("vis-title")},o.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(var i=0;i<e.length;i++){var o=e[i],n=this.data[o];null!=n?t.setAttribute("data-"+o,n):t.removeAttribute("data-"+o)}}},o.prototype._updateStyle=function(t){this.style&&(s.removeCssText(t,this.style),this.style=null),this.data.style&&(s.addCssText(t,this.data.style),this.style=this.data.style)},o.prototype._contentToString=function(t){return"string"==typeof t?t:t&&"outerHTML"in t?t.outerHTML:t},o.prototype.getWidthLeft=function(){return 0},o.prototype.getWidthRight=function(){return 0},t.exports=o},function(t,e,i){function o(t,e,i){n.call(this,t,e,i),this.width=0,this.height=0,this.top=0,this.left=0}var n=(i(1),i(36));o.prototype=Object.create(n.prototype),o.prototype.redraw=function(t,e,i){var o=!1;this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.width=this.dom.background.offsetWidth,this.dom.background.style.height="0";for(var n=0,s=this.visibleItems.length;s>n;n++){var r=this.visibleItems[n];r.repositionY(e)}return o},o.prototype.show=function(){this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background)},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={dot:{width:0,height:0},line:{width:0,height:0}},this.options=i,t&&void 0==t.start)throw new Error('Property "start" missing in item '+t);n.call(this,t,e,i)}var n=i(39);i(1);o.prototype=new n(null,null,null),o.prototype.isVisible=function(t){var e=(t.end-t.start)/4;return this.data.start>t.start-e&&this.data.start<t.end+e},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="vis-item-content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="vis-line",t.dot=document.createElement("DIV"),t.dot.className="vis-dot",t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(!t.line.parentNode){var i=this.parent.dom.background;if(!i)throw new Error("Cannot redraw item: parent has no background container element");i.appendChild(t.line)}if(!t.dot.parentNode){var o=this.parent.dom.axis;if(!i)throw new Error("Cannot redraw item: parent has no axis container element");o.appendChild(t.dot)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var n=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,s=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(n?" vis-editable":" vis-readonly");t.box.className="vis-item vis-box"+s,t.line.className="vis-item vis-line"+s,t.dot.className="vis-item vis-dot"+s,this.props.dot.height=t.dot.offsetHeight,this.props.dot.width=t.dot.offsetWidth,this.props.line.width=t.line.offsetWidth,this.width=t.box.offsetWidth,this.height=t.box.offsetHeight,this.dirty=!1}this._repaintDeleteButton(t.box)},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom;t.box.parentNode&&t.box.parentNode.removeChild(t.box),t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot),this.displayed=!1}},o.prototype.repositionX=function(){var t=this.conversion.toScreen(this.data.start),e=this.options.align;"right"==e?this.options.rtl?(this.right=t-this.width,this.dom.box.style.right=this.right+"px",this.dom.line.style.right=t-this.props.line.width+"px",this.dom.dot.style.right=t-this.props.line.width/2-this.props.dot.width/2+"px"):(this.left=t-this.width,this.dom.box.style.left=this.left+"px",this.dom.line.style.left=t-this.props.line.width+"px",this.dom.dot.style.left=t-this.props.line.width/2-this.props.dot.width/2+"px"):"left"==e?this.options.rtl?(this.right=t,this.dom.box.style.right=this.right+"px",this.dom.line.style.right=t+"px",this.dom.dot.style.right=t+this.props.line.width/2-this.props.dot.width/2+"px"):(this.left=t,this.dom.box.style.left=this.left+"px",this.dom.line.style.left=t+"px",this.dom.dot.style.left=t+this.props.line.width/2-this.props.dot.width/2+"px"):this.options.rtl?(this.right=t-this.width/2,this.dom.box.style.right=this.right+"px",this.dom.line.style.right=t-this.props.line.width+"px",this.dom.dot.style.right=t-this.props.dot.width/2+"px"):(this.left=t-this.width/2,this.dom.box.style.left=this.left+"px",this.dom.line.style.left=t-this.props.line.width/2+"px",this.dom.dot.style.left=t-this.props.dot.width/2+"px")},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box,i=this.dom.line,o=this.dom.dot;if("top"==t)e.style.top=(this.top||0)+"px",i.style.top="0",i.style.height=this.parent.top+this.top+1+"px",i.style.bottom="";else{var n=this.parent.itemSet.props.height,s=n-this.parent.top-this.parent.height+this.top;e.style.top=(this.parent.height-this.top-this.height||0)+"px",i.style.top=n-s+"px",i.style.bottom="0"}o.style.top=-this.props.dot.height/2+"px"},o.prototype.getWidthLeft=function(){return this.width/2},o.prototype.getWidthRight=function(){return this.width/2},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0,marginRight:0}},this.options=i,t&&void 0==t.start)throw new Error('Property "start" missing in item '+t);n.call(this,t,e,i)}var n=i(39);o.prototype=new n(null,null,null),o.prototype.isVisible=function(t){var e=(t.end-t.start)/4;return this.data.start>t.start-e&&this.data.start<t.end+e},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="vis-item-content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.point.appendChild(t.dot),t.point["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.point.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.point)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.point),this._updateDataAttributes(this.dom.point),this._updateStyle(this.dom.point);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.point.className="vis-item vis-point"+o,t.dot.className="vis-item vis-dot"+o,this.props.dot.width=t.dot.offsetWidth,this.props.dot.height=t.dot.offsetHeight,this.props.content.height=t.content.offsetHeight,this.options.rtl?t.content.style.marginRight=2*this.props.dot.width+"px":t.content.style.marginLeft=2*this.props.dot.width+"px",this.width=t.point.offsetWidth,this.height=t.point.offsetHeight,t.dot.style.top=(this.height-this.props.dot.height)/2+"px",this.options.rtl?t.dot.style.right=this.props.dot.width/2+"px":t.dot.style.left=this.props.dot.width/2+"px",this.dirty=!1}this._repaintDeleteButton(t.point)},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){this.displayed&&(this.dom.point.parentNode&&this.dom.point.parentNode.removeChild(this.dom.point),this.displayed=!1)},o.prototype.repositionX=function(){var t=this.conversion.toScreen(this.data.start);this.options.rtl?(this.right=t-this.props.dot.width,this.dom.point.style.right=this.right+"px"):(this.left=t-this.props.dot.width,this.dom.point.style.left=this.left+"px")},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.point;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype.getWidthLeft=function(){return this.props.dot.width},o.prototype.getWidthRight=function(){return this.props.dot.width},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(20),i(39)),s=i(40),r=i(38);o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-background",o.prototype.stack=!1,o.prototype.isVisible=function(t){return this.data.start<t.end&&this.data.end>t.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e="top"===this.options.orientation.item;this.dom.content.style.top=e?"":"0",this.dom.content.style.bottom=e?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,r=n[o].index;if(1==e){i=this.parent.subgroups[o].height+t.item.vertical,i+=0==r?t.axis-.5*t.item.vertical:0;var a=this.parent.top;for(var h in n)n.hasOwnProperty(h)&&1==n[h].visible&&n[h].index<r&&(a+=n[h].height+t.item.vertical);a+=0!=r?t.axis-.5*t.item.vertical:0,this.dom.box.style.top=a+"px",this.dom.box.style.bottom=""}else{var a=this.parent.top,d=0;for(var h in n)if(n.hasOwnProperty(h)&&1==n[h].visible){var l=n[h].height+t.item.vertical;d+=l,n[h].index>r&&(a+=l)}i=this.parent.subgroups[o].height+t.item.vertical,this.dom.box.style.top=this.parent.height-d+a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof s?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=e?"0":"",this.dom.box.style.bottom=e?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},t.exports=o},function(t,e,i){function o(t,e){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:a.FORMAT,moment:d,timeAxis:null},this.options=s.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=i(31),a=i(35),h=i(32),d=i(2);o.prototype=new r,o.prototype.setOptions=function(t){t&&(s.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),s.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"===n(t.orientation)&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof d.locale?d.locale(t.locale):d.lang(t.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=s.convert(this.body.range.start,"Number"),i=s.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-h.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var r=new a(new Date(e),new Date(i),n,this.body.hiddenDates);r.setMoment(this.options.moment),this.options.format&&r.setFormat(this.options.format),this.options.timeAxis&&r.setScale(this.options.timeAxis),this.step=r;var d=this.dom;d.redundant.lines=d.lines,d.redundant.majorTexts=d.majorTexts,d.redundant.minorTexts=d.minorTexts,d.lines=[],d.majorTexts=[],d.minorTexts=[];var c,u,p,f,m,v,g,y,b,w,_=0,x=void 0,k=0,O=1e3;for(r.start(),u=r.getCurrent(),f=this.body.util.toScreen(u);r.hasNext()&&O>k;){k++,m=r.isMajor(),w=r.getClassName(),b=r.getLabelMinor(),c=u,p=f,r.next(),u=r.getCurrent(),v=r.isMajor(),f=this.body.util.toScreen(u),g=_,_=f-p;var M=_>=.4*g;if(this.options.showMinorLabels&&M){var D=this._repaintMinorText(p,b,t,w);D.style.width=_+"px"}m&&this.options.showMajorLabels?(p>0&&(void 0==x&&(x=p),D=this._repaintMajorText(p,r.getLabelMajor(),t,w)),y=this._repaintMajorLine(p,_,t,w)):M?y=this._repaintMinorLine(p,_,t,w):y&&(y.style.width=parseInt(y.style.width)+_+"px")}if(k!==O||l||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+O+" lines."),l=!0),this.options.showMajorLabels){var S=this.body.util.toTime(0),C=r.getLabelMajor(S),T=C.length*(this.props.majorCharWidth||10)+10;(void 0==x||x>T)&&this._repaintMajorText(0,C,t,w)}s.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},o.prototype._repaintMinorText=function(t,e,i,o){var n=this.dom.redundant.minorTexts.shift();if(!n){var s=document.createTextNode("");n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.minorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.top="top"==i?this.props.majorLabelHeight+"px":"0",this.options.rtl?(n.style.left="",n.style.right=t+"px"):n.style.left=t+"px",n.className="vis-text vis-minor "+o,n},o.prototype._repaintMajorText=function(t,e,i,o){var n=this.dom.redundant.majorTexts.shift();if(!n){var s=document.createTextNode(e);n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.majorTexts.push(n),n.childNodes[0].nodeValue=e,n.className="vis-text vis-major "+o,n.style.top="top"==i?"0":this.props.minorLabelHeight+"px",this.options.rtl?(n.style.left="",n.style.right=t+"px"):n.style.left=t+"px",n},o.prototype._repaintMinorLine=function(t,e,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top=s.majorLabelHeight+"px":n.style.top=this.body.domProps.top.height+"px",n.style.height=s.minorLineHeight+"px",this.options.rtl?(n.style.left="",n.style.right=t-s.minorLineWidth/2+"px",n.className="vis-grid vis-vertical-rtl vis-minor "+o):(n.style.left=t-s.minorLineWidth/2+"px",n.className="vis-grid vis-vertical vis-minor "+o),n.style.width=e+"px",n},o.prototype._repaintMajorLine=function(t,e,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top="0":n.style.top=this.body.domProps.top.height+"px",this.options.rtl?(n.style.left="",n.style.right=t-s.majorLineWidth/2+"px",n.className="vis-grid vis-vertical-rtl vis-major "+o):(n.style.left=t-s.majorLineWidth/2+"px",n.className="vis-grid vis-vertical vis-major "+o),n.style.height=s.majorLineHeight+"px",n.style.width=e+"px",n},o.prototype._calculateCharSize=function(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth};var l=!1;t.exports=o},function(t,e,i){function o(t){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=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var e=this,i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];i.forEach(function(t){e.hammer.on(t,function(t){t.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){n(i.target,t)||e.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function n(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}var s=i(23),r=i(13),a=i(20),h=i(1);r(o.prototype),o.current=null,o.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},o.prototype.activate=function(){o.current&&o.current.deactivate(),o.current=this,this.active=!0,this.dom.overlay.style.display="none",h.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},o.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",h.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},o.prototype._onTapOverlay=function(t){this.activate(),t.stopPropagation()},t.exports=o},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={moment:a,locales:h,locale:"en",id:void 0,title:void 0},this.options=s.extend({},this.defaultOptions),e&&e.time?this.customTime=e.time:this.customTime=new Date,this.eventParams={},this.setOptions(e),this._create()}var n=i(20),s=i(1),r=i(31),a=i(2),h=i(47);o.prototype=new r,o.prototype.setOptions=function(t){t&&s.selectiveExtend(["moment","locale","locales","id"],this.options,t)},o.prototype._create=function(){var t=document.createElement("div");t["custom-time"]=this,t.className="vis-custom-time "+(this.options.id||""),t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t;var e=document.createElement("div");e.style.position="relative",e.style.top="0px",e.style.left="-10px",e.style.height="100%",e.style.width="20px",t.appendChild(e),this.hammer=new n(e),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:n.DIRECTION_HORIZONTAL})},o.prototype.destroy=function(){this.hide(),this.hammer.destroy(),this.hammer=null,this.body=null},o.prototype.redraw=function(){var t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar));var e=this.body.util.toScreen(this.customTime),i=this.options.locales[this.options.locale];i||(this.warned||(console.log("WARNING: options.locales['"+this.options.locale+"'] not found. See http://visjs.org/docs/timeline.html#Localization"),this.warned=!0),i=this.options.locales.en);var o=this.options.title;return void 0===o&&(o=i.time+": "+this.options.moment(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss"),o=o.charAt(0).toUpperCase()+o.substring(1)),this.bar.style.left=e+"px",this.bar.title=o,!1},o.prototype.hide=function(){this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar)},o.prototype.setCustomTime=function(t){this.customTime=s.convert(t,"Date"),this.redraw()},o.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())},o.prototype.setCustomTitle=function(t){this.options.title=t},o.prototype._onDragStart=function(t){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,t.stopPropagation()},o.prototype._onDrag=function(t){if(this.eventParams.dragging){var e=this.body.util.toScreen(this.eventParams.customTime)+t.deltaX,i=this.body.util.toTime(e);this.setCustomTime(i),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf())
+}),t.stopPropagation()}},o.prototype._onDragEnd=function(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf())}),t.stopPropagation())},o.customTimeFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("custom-time"))return e["custom-time"];e=e.parentNode}return null},t.exports=o},function(t,e){e.en={current:"current",time:"time"},e.en_EN=e.en,e.en_US=e.en,e.nl={current:"huidige",time:"tijd"},e.nl_NL=e.nl,e.nl_BE=e.nl},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={rtl:!1,showCurrentTime:!0,moment:r,locales:a,locale:"en"},this.options=n.extend({},this.defaultOptions),this.offset=0,this._create(),this.setOptions(e)}var n=i(1),s=i(31),r=i(2),a=i(47);o.prototype=new s,o.prototype._create=function(){var t=document.createElement("div");t.className="vis-current-time",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t},o.prototype.destroy=function(){this.options.showCurrentTime=!1,this.redraw(),this.body=null},o.prototype.setOptions=function(t){t&&n.selectiveExtend(["rtl","showCurrentTime","moment","locale","locales"],this.options,t)},o.prototype.redraw=function(){if(this.options.showCurrentTime){var t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar),this.start());var e=this.options.moment((new Date).valueOf()+this.offset),i=this.body.util.toScreen(e),o=this.options.locales[this.options.locale];o||(this.warned||(console.log("WARNING: options.locales['"+this.options.locale+"'] not found. See http://visjs.org/docs/timeline/#Localization"),this.warned=!0),o=this.options.locales.en);var n=o.current+" "+o.time+": "+e.format("dddd, MMMM Do YYYY, H:mm:ss");n=n.charAt(0).toUpperCase()+n.substring(1),this.options.rtl?this.bar.style.right=i+"px":this.bar.style.left=i+"px",this.bar.title=n}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1},o.prototype.start=function(){function t(){e.stop();var i=e.body.range.conversion(e.body.domProps.center.width).scale,o=1/i/10;30>o&&(o=30),o>1e3&&(o=1e3),e.redraw(),e.body.emitter.emit("currentTimeTick"),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",c={configure:{enabled:{"boolean":o},filter:{"boolean":o,"function":"function"},container:{dom:h},__type__:{object:a,"boolean":o,"function":"function"}},align:{string:i},rtl:{"boolean":o,undefined:"undefined"},autoResize:{"boolean":o},throttleRedraw:{number:n},clickToUse:{"boolean":o},dataAttributes:{string:i,array:s},editable:{add:{"boolean":o,undefined:"undefined"},remove:{"boolean":o,undefined:"undefined"},updateGroup:{"boolean":o,undefined:"undefined"},updateTime:{"boolean":o,undefined:"undefined"},__type__:{"boolean":o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},__type__:{object:a}},moment:{"function":"function"},groupOrder:{string:i,"function":"function"},groupEditable:{add:{"boolean":o,undefined:"undefined"},remove:{"boolean":o,undefined:"undefined"},order:{"boolean":o,undefined:"undefined"},__type__:{"boolean":o,object:a}},groupOrderSwap:{"function":"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{"boolean":o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{"boolean":o},multiselect:{"boolean":o},multiselectPerGroup:{"boolean":o},onAdd:{"function":"function"},onUpdate:{"function":"function"},onMove:{"function":"function"},onMoving:{"function":"function"},onRemove:{"function":"function"},onAddGroup:{"function":"function"},onMoveGroup:{"function":"function"},onRemoveGroup:{"function":"function"},order:{"function":"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{"boolean":o},showCurrentTime:{"boolean":o},showMajorLabels:{"boolean":o},showMinorLabels:{"boolean":o},stack:{"boolean":o},snap:{"function":"function","null":"null"},start:{date:r,number:n,string:i,moment:d},template:{"function":"function"},groupTemplate:{"function":"function"},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{"boolean":o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},u={global:{align:["center","left","right"],direction:!1,autoResize:!0,throttleRedraw:[10,0,1e3,10],clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,start:"",type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};e.allOptions=c,e.configureOptions=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e,i,o){if(!(Array.isArray(i)||i instanceof c||i instanceof u)&&i instanceof Object){var n=o;o=i,i=n}var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new m(this.body),this.components.push(this.timeAxis),this.currentTime=new v(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){s.emit("click",s.getEventProperties(t))}),this.on("doubletap",function(t){s.emit("doubleClick",s.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(26),r=o(s),a=i(29),h=o(a),d=(i(13),i(20),i(2)),l=i(1),c=i(9),u=i(11),p=i(30),f=i(33),m=i(44),v=i(48),g=i(46),y=i(51),b=i(29).printStyle,w=i(59).allOptions,_=i(59).configureOptions;n.prototype=new f,n.prototype.setOptions=function(t){var e=h["default"].validate(t,w);e===!0&&console.log("%cErrors have been found in the supplied options object.",b),f.prototype.setOptions.call(this,t)},n.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof c||t instanceof u?t:new c(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(t){var e;e=t?t instanceof c||t instanceof u?t:new c(t):null,this.groupsData=e,this.linegraph.setGroups(e)},n.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},n.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]):!1},n.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;o<this.linegraph.groups[i].itemsData.length;o++){var n=this.linegraph.groups[i].itemsData[o],s=l.convert(n.x,"Date").valueOf();t=null==t?s:t>s?s:t,e=null==e?s:s>e?s:e}return{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,o=e-l.getAbsoluteLeft(this.dom.centerContainer),n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this._toTime(o),r=g.customTimeFromTarget(t),a=l.getTarget(t),h=null;l.hasParent(a,this.timeAxis.dom.foreground)?h="axis":this.timeAxis2&&l.hasParent(a,this.timeAxis2.dom.foreground)?h="axis":l.hasParent(a,this.linegraph.yAxisLeft.dom.frame)?h="data-axis":l.hasParent(a,this.linegraph.yAxisRight.dom.frame)?h="data-axis":l.hasParent(a,this.linegraph.legendLeft.dom.frame)?h="legend":l.hasParent(a,this.linegraph.legendRight.dom.frame)?h="legend":null!=r?h="custom-time":l.hasParent(a,this.currentTime.bar)?h="current-time":l.hasParent(a,this.dom.center)&&(h="background");var d=[],c=this.linegraph.yAxisLeft,u=this.linegraph.yAxisRight;return c.hidden||d.push(c.screenToValue(n)),u.hidden||d.push(u.screenToValue(n)),{event:t,what:h,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:s,value:d}},n.prototype._createConfigurator=function(){return new r["default"](this,this.dom.container,_)},t.exports=n},function(t,e,i){function o(t,e){this.id=s.randomUUID(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{},legend:{},groups:{visibility:{}}},this.options=s.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1,this.forceGraphUpdate=!0;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=s.option.asSize(-i.props.width),i.forceGraphUpdate=!0,i.redraw.call(i)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups}}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=i(8),a=i(9),h=i(11),d=i(31),l=i(52),c=i(54),u=i(58),p=i(55),f=i(57),m=i(56),v="__ungrouped__";o.prototype=new d,o.prototype._create=function(){var t=document.createElement("div");t.className="vis-line-graph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new l(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new l(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new u(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new u(this.body,this.options.legend,"right",this.options.groups),this.show()},o.prototype.setOptions=function(t){if(t){var e=["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===t.graphHeight&&void 0!==t.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))<this.body.domProps.centerContainer.height&&(this.updateSVGheight=!0),s.selectiveDeepExtend(e,this.options,t),s.mergeOptions(this.options,t,"interpolation"),s.mergeOptions(this.options,t,"drawPoints"),s.mergeOptions(this.options,t,"shaded"),s.mergeOptions(this.options,t,"legend"),t.interpolation&&"object"==n(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5)),this.yAxisLeft&&void 0!==t.dataAxis&&(this.yAxisLeft.setOptions(this.options.dataAxis),this.yAxisRight.setOptions(this.options.dataAxis)),this.legendLeft&&void 0!==t.legend&&(this.legendLeft.setOptions(this.options.legend),this.legendRight.setOptions(this.options.legend)),this.groups.hasOwnProperty(v)&&this.groups[v].setOptions(t)}this.dom.frame&&(this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0}))},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame)},o.prototype.setItems=function(t){var e,i=this,o=this.itemsData;if(t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=t}else this.itemsData=null;if(o&&(s.forEach(this.itemListeners,function(t,e){o.off(e,t)}),e=o.getIds(),this._onRemove(e)),this.itemsData){var n=this.id;s.forEach(this.itemListeners,function(t,e){i.itemsData.on(e,t,n)}),e=this.itemsData.getIds(),this._onAdd(e)}},o.prototype.setGroups=function(t){var e,i=this;if(this.groupsData){s.forEach(this.groupListeners,function(t,e){i.groupsData.off(e,t)}),e=this.groupsData.getIds(),this.groupsData=null;for(var o=0;o<e.length;o++)this._removeGroup(e[o])}if(t){if(!(t instanceof a||t instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var n=this.id;s.forEach(this.groupListeners,function(t,e){i.groupsData.on(e,t,n)}),e=this.groupsData.getIds(),this._onAddGroups(e)}},o.prototype._onUpdate=function(t){this._updateAllGroupData()},o.prototype._onAdd=function(t){this._onUpdate(t)},o.prototype._onRemove=function(t){this._onUpdate(t)},o.prototype._onUpdateGroups=function(t){this._updateAllGroupData()},o.prototype._onAddGroups=function(t){this._onUpdateGroups(t)},o.prototype._onRemoveGroups=function(t){for(var e=0;e<t.length;e++)this._removeGroup(t[e]);this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0})},o.prototype._removeGroup=function(t){this.groups.hasOwnProperty(t)&&("right"==this.groups[t].options.yAxisOrientation?(this.yAxisRight.removeGroup(t),this.legendRight.removeGroup(t),this.legendRight.redraw()):(this.yAxisLeft.removeGroup(t),this.legendLeft.removeGroup(t),this.legendLeft.redraw()),delete this.groups[t])},o.prototype._updateGroup=function(t,e){this.groups.hasOwnProperty(e)?(this.groups[e].update(t),"right"==this.groups[e].options.yAxisOrientation?(this.yAxisRight.updateGroup(e,this.groups[e]),this.legendRight.updateGroup(e,this.groups[e]),this.yAxisLeft.removeGroup(e),this.legendLeft.removeGroup(e)):(this.yAxisLeft.updateGroup(e,this.groups[e]),this.legendLeft.updateGroup(e,this.groups[e]),this.yAxisRight.removeGroup(e),this.legendRight.removeGroup(e))):(this.groups[e]=new c(t,e,this.options,this.groupsUsingDefaultStyles),"right"==this.groups[e].options.yAxisOrientation?(this.yAxisRight.addGroup(e,this.groups[e]),this.legendRight.addGroup(e,this.groups[e])):(this.yAxisLeft.addGroup(e,this.groups[e]),this.legendLeft.addGroup(e,this.groups[e]))),this.legendLeft.redraw(),this.legendRight.redraw()},o.prototype._updateAllGroupData=function(){if(null!=this.itemsData){for(var t={},e=this.itemsData.get(),i={},o=0;o<e.length;o++){var n=e[o],r=n.group;null!==r&&void 0!==r||(r=v),i.hasOwnProperty(r)?i[r]++:i[r]=1}for(var o=0;o<e.length;o++){var n=e[o],r=n.group;null!==r&&void 0!==r||(r=v),t.hasOwnProperty(r)||(t[r]=new Array(i[r]));var a=s.bridgeObject(n);a.x=s.convert(n.x,"Date"),a.orginalY=n.y,a.y=Number(n.y);var h=t[r].length-i[r]--;t[r][h]=a}for(var r in this.groups)this.groups.hasOwnProperty(r)&&(t.hasOwnProperty(r)||(t[r]=new Array(0)));for(var r in t)if(t.hasOwnProperty(r))if(0==t[r].length)this.groups.hasOwnProperty(r)&&this._removeGroup(r);else{var d=void 0;void 0!=this.groupsData&&(d=this.groupsData.get(r)),void 0==d&&(d={id:r,content:this.options.defaultGroup+r}),this._updateGroup(d,r),this.groups[r].setItems(t[r])}this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0})}},o.prototype.redraw=function(){var t=!1;this.props.width=this.dom.frame.offsetWidth,this.props.height=this.body.domProps.centerContainer.height-this.body.domProps.border.top-this.body.domProps.border.bottom,t=this._isResized()||t;var e=this.body.range.end-this.body.range.start,i=e!=this.lastVisibleInterval;if(this.lastVisibleInterval=e,1==t&&(this.svg.style.width=s.option.asSize(3*this.props.width),this.svg.style.left=s.option.asSize(-this.props.width),-1==(this.options.height+"").indexOf("%")&&1!=this.updateSVGheightOnResize||(this.updateSVGheight=!0)),1==this.updateSVGheight?(this.options.graphHeight!=this.props.height+"px"&&(this.options.graphHeight=this.props.height+"px",this.svg.style.height=this.props.height+"px"),this.updateSVGheight=!1):this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",1==t||1==i||1==this.abortedGraphUpdate||1==this.forceGraphUpdate)t=this._updateGraph()||t,this.forceGraphUpdate=!1;else if(0!=this.lastStart){var o=this.body.range.start-this.lastStart,n=this.body.range.end-this.body.range.start;if(0!=this.props.width){var r=this.props.width/n,a=o*r;this.svg.style.left=-this.props.width-a+"px"}}return this.legendLeft.redraw(),this.legendRight.redraw(),t},o.prototype._getSortedGroupIds=function(){var t=[];for(var e in this.groups)if(this.groups.hasOwnProperty(e)){var i=this.groups[e];1!=i.visible||void 0!==this.options.groups.visibility[e]&&1!=this.options.groups.visibility[e]||t.push({id:e,zIndex:i.options.zIndex})}s.insertSort(t,function(t,e){var i=t.zIndex,o=e.zIndex;return void 0===i&&(i=0),void 0===o&&(o=0),i==o?0:o>i?-1:1});for(var o=new Array(t.length),n=0;n<t.length;n++)o[n]=t[n].id;return o},o.prototype._updateGraph=function(){if(r.prepareElements(this.svgElements),0!=this.props.width&&null!=this.itemsData){var t,e,i={},o=!1,n=this.body.util.toGlobalTime(-this.body.domProps.root.width),s=this.body.util.toGlobalTime(2*this.body.domProps.root.width),a=this._getSortedGroupIds();if(a.length>0){var h={};for(this._getRelevantData(a,h,n,s),this._applySampling(a,h),e=0;e<a.length;e++)this._convertXcoordinates(h[a[e]]);if(this._getYRanges(a,h,i),o=this._updateYAxis(a,i),1==o)return r.cleanupElements(this.svgElements),this.abortedGraphUpdate=!0,!0;this.abortedGraphUpdate=!1;var d=void 0;for(e=0;e<a.length;e++)t=this.groups[a[e]],this.options.stack===!0&&"line"===this.options.style&&(void 0!=t.options.excludeFromStacking&&t.options.excludeFromStacking||(void 0!=d&&(this._stack(h[t.id],h[d.id]),1==t.options.shaded.enabled&&"group"!==t.options.shaded.orientation&&("top"==t.options.shaded.orientation&&"group"!==d.options.shaded.orientation?(d.options.shaded.orientation="group",d.options.shaded.groupId=t.id):(t.options.shaded.orientation="group",t.options.shaded.groupId=d.id))),d=t)),this._convertYcoordinates(h[a[e]],t);var l={};for(e=0;e<a.length;e++)if(t=this.groups[a[e]],"line"===t.options.style&&1==t.options.shaded.enabled){var c=h[a[e]];if(null==c||0==c.length)continue;if(l.hasOwnProperty(a[e])||(l[a[e]]=f.calcPath(c,t)),"group"===t.options.shaded.orientation){var u=t.options.shaded.groupId;if(-1===a.indexOf(u)){console.log(t.id+": Unknown shading group target given:"+u);continue}l.hasOwnProperty(u)||(l[u]=f.calcPath(h[u],this.groups[u])),f.drawShading(l[a[e]],t,l[u],this.framework)}else f.drawShading(l[a[e]],t,void 0,this.framework)}for(p.draw(a,h,this.framework),e=0;e<a.length;e++)if(t=this.groups[a[e]],h[a[e]].length>0)switch(t.options.style){case"line":l.hasOwnProperty(a[e])||(l[a[e]]=f.calcPath(h[a[e]],t)),f.draw(l[a[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||m.draw(h[a[e]],t,this.framework);break;case"bar":}}}return r.cleanupElements(this.svgElements),!1},o.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;a<t.length;a++){s=void 0,r=void 0;for(var h=i;h<e.length;h++){if(e[h].x===t[a].x){s=e[h],r=e[h],i=h;break}if(e[h].x>t[a].x){r=e[h],s=0==h?r:e[h-1],i=h;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?t[a].y=t[a].orginalY+r.y:t[a].y=t[a].orginalY+n/o*(t[a].x-s.x)+s.y}},o.prototype._getRelevantData=function(t,e,i,o){var n,r,a,h;if(t.length>0)for(r=0;r<t.length;r++){n=this.groups[t[r]];var d=n.getItems();if(1==n.options.sort){var l=function(t,e){return t.getTime()==e.getTime()?0:e>t?-1:1},c=Math.max(0,s.binarySearchValue(d,i,"x","before",l)),u=Math.min(d.length,s.binarySearchValue(d,o,"x","after",l)+1);0>=u&&(u=d.length);var p=new Array(u-c);for(a=c;u>a;a++)h=n.itemsData[a],p[a-c]=h;e[t[r]]=p}else e[t[r]]=n.itemsData}},o.prototype._applySampling=function(t,e){var i;if(t.length>0)for(var o=0;o<t.length;o++)if(i=this.groups[t[o]],1==i.options.sampling){var n=e[t[o]];if(n.length>0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=new Array(r),l=0;r>l;l+=s){var c=Math.round(l/s);d[c]=n[l]}e[t[o]]=d.splice(0,Math.round(r/s))}}},o.prototype._getYRanges=function(t,e,i){var o,n,s,r,a=[],h=[];if(t.length>0){for(s=0;s<t.length;s++)o=e[t[s]],r=this.groups[t[s]].options,o.length>0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[t[s]]=n.getYRange(o,t[s]));p.getStackedYRange(a,i,t,"__barStackLeft","left"),p.getStackedYRange(h,i,t,"__barStackRight","right")}},o.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var c=0;c<t.length;c++){var u=this.groups[t[c]];u&&"right"!=u.options.yAxisOrientation?(s=!0,a=1e9,d=-1e9):u&&u.options.yAxisOrientation&&(r=!0,h=1e9,l=-1e9)}for(var c=0;c<t.length;c++)e.hasOwnProperty(t[c])&&e[t[c]].ignore!==!0&&(i=e[t[c]].min,o=e[t[c]].max,"right"!=e[t[c]].yAxisOrientation?(s=!0,a=a>i?i:a,d=o>d?o:d):(r=!0,h=h>i?i:h,l=o>l?o:l));1==s&&this.yAxisLeft.setRange(a,d),1==r&&this.yAxisRight.setRange(h,l)}n=this._toggleAxisVisiblity(s,this.yAxisLeft)||n,n=this._toggleAxisVisiblity(r,this.yAxisRight)||n,1==r&&1==s?(this.yAxisLeft.drawIcons=!0,this.yAxisRight.drawIcons=!0):(this.yAxisLeft.drawIcons=!1,this.yAxisRight.drawIcons=!1),this.yAxisRight.master=!s,this.yAxisRight.masterAxis=this.yAxisLeft,0==this.yAxisRight.master?(1==r?this.yAxisLeft.lineOffset=this.yAxisRight.width:this.yAxisLeft.lineOffset=0,n=this.yAxisLeft.redraw()||n,n=this.yAxisRight.redraw()||n):n=this.yAxisRight.redraw()||n;for(var p=["__barStackLeft","__barStackRight","__lineStackLeft","__lineStackRight"],c=0;c<p.length;c++)-1!=t.indexOf(p[c])&&t.splice(t.indexOf(p[c]),1);return n},o.prototype._toggleAxisVisiblity=function(t,e){var i=!1;return 0==t?e.dom.frame.parentNode&&0==e.hidden&&(e.hide(),i=!0):e.dom.frame.parentNode||1!=e.hidden||(e.show(),i=!0),i},o.prototype._convertXcoordinates=function(t){for(var e=this.body.util.toScreen,i=0;i<t.length;i++)t[i].screen_x=e(t[i].x)+this.props.width,t[i].screen_y=t[i].y},o.prototype._convertYcoordinates=function(t,e){var i=this.yAxisLeft,o=Number(this.svg.style.height.replace("px",""));"right"==e.options.yAxisOrientation&&(i=this.yAxisRight);for(var n=0;n<t.length;n++)t[n].screen_y=Math.round(i.convertValue(t[n].y));e.setZeroPosition(Math.min(o,i.convertValue(0)))},t.exports=o},function(t,e,i){function o(t,e,i,o){this.id=n.randomUUID(),this.body=t,this.defaultOptions={orientation:"left",showMinorLabels:!0,showMajorLabels:!0,icons:!1,majorLinesOffset:7,minorLinesOffset:4,labelOffsetX:10,labelOffsetY:2,iconWidth:20,width:"40px",visible:!0,alignZeros:!0,left:{range:{min:void 0,max:void 0},format:function(t){return""+parseFloat(t.toPrecision(3))},title:{text:void 0,style:void 0}},right:{range:{min:void 0,max:void 0},format:function(t){return""+parseFloat(t.toPrecision(3))},title:{text:void 0,style:void 0}}},this.linegraphOptions=o,this.linegraphSVG=i,this.props={},this.DOMelements={lines:{},labels:{},title:{}},this.dom={},this.scale=void 0,this.range={start:0,end:0},this.options=n.extend({},this.defaultOptions),this.conversionFactor=1,this.setOptions(e),this.width=Number((""+this.options.width).replace("px","")),this.minWidth=this.width,this.height=this.linegraphSVG.getBoundingClientRect().height,this.hidden=!1,this.stepPixels=25,this.zeroCrossing=-1,this.amountOfSteps=-1,this.lineOffset=0,this.master=!0,this.masterAxis=null,this.svgElements={},this.iconsRemoved=!1,this.groups={},this.amountOfGroups=0,this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups};var s=this;this.body.emitter.on("verticalDrag",function(){s.dom.lineContainer.style.top=s.body.domProps.scrollTop+"px"})}var n=i(1),s=i(8),r=i(31),a=i(53);o.prototype=new r,o.prototype.addGroup=function(t,e){this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1},o.prototype.updateGroup=function(t,e){this.groups.hasOwnProperty(t)||(this.amountOfGroups+=1),this.groups[t]=e},o.prototype.removeGroup=function(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)},o.prototype.setOptions=function(t){if(t){var e=!1;this.options.orientation!=t.orientation&&void 0!==t.orientation&&(e=!0);var i=["orientation","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","width","visible","left","right","alignZeros"];n.selectiveDeepExtend(i,this.options,t),this.minWidth=Number((""+this.options.width).replace("px","")),e===!0&&this.dom.frame&&(this.hide(),this.show())}},o.prototype._create=function(){this.dom.frame=document.createElement("div"),this.dom.frame.style.width=this.options.width,this.dom.frame.style.height=this.height,this.dom.lineContainer=document.createElement("div"),this.dom.lineContainer.style.width="100%",this.dom.lineContainer.style.height=this.height,this.dom.lineContainer.style.position="relative",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.height="100%",this.svg.style.width="100%",this.svg.style.display="block",this.dom.frame.appendChild(this.svg)},o.prototype._redrawGroupIcons=function(){s.prepareElements(this.svgElements);var t,e=this.options.iconWidth,i=15,o=4,n=o+.5*i;t="left"===this.options.orientation?o:this.width-e-o;var r=Object.keys(this.groups);r.sort(function(t,e){return e>t?-1:1});for(var a=0;a<r.length;a++){var h=r[a];this.groups[h].visible!==!0||void 0!==this.linegraphOptions.visibility[h]&&this.linegraphOptions.visibility[h]!==!0||(this.groups[h].getLegend(e,i,this.framework,t,n),n+=i+o)}s.cleanupElements(this.svgElements),this.iconsRemoved=!1},o.prototype._cleanupIcons=function(){this.iconsRemoved===!1&&(s.prepareElements(this.svgElements),s.cleanupElements(this.svgElements),this.iconsRemoved=!0)},o.prototype.show=function(){this.hidden=!1,this.dom.frame.parentNode||(this.options.rtl?this.body.dom.left.appendChild(this.dom.frame):this.body.dom.left.appendChild(this.dom.frame)),this.dom.lineContainer.parentNode||this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer)},o.prototype.hide=function(){this.hidden=!0,this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.lineContainer.parentNode&&this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer)},o.prototype.setRange=function(t,e){this.range.start=t,this.range.end=e},o.prototype.redraw=function(){var t=!1,e=0;this.dom.lineContainer.style.top=this.body.domProps.scrollTop+"px";for(var i in this.groups)this.groups.hasOwnProperty(i)&&(this.groups[i].visible!==!0||void 0!==this.linegraphOptions.visibility[i]&&this.linegraphOptions.visibility[i]!==!0||e++);if(0===this.amountOfGroups||0===e)this.hide();else{this.show(),this.height=Number(this.linegraphSVG.style.height.replace("px","")),this.dom.lineContainer.style.height=this.height+"px",this.width=this.options.visible===!0?Number((""+this.options.width).replace("px","")):0;var o=this.props,n=this.dom.frame;n.className="vis-data-axis",this._calculateCharSize();var s=this.options.orientation,r=this.options.showMinorLabels,a=this.options.showMajorLabels;o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=a?o.majorCharHeight:0,o.minorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.minorLinesOffset,o.minorLineHeight=1,o.majorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.majorLinesOffset,o.majorLineHeight=1,"left"===s?(n.style.top="0",n.style.left="0",n.style.bottom="",n.style.width=this.width+"px",n.style.height=this.height+"px",this.props.width=this.body.domProps.left.width,this.props.height=this.body.domProps.left.height):(n.style.top="",n.style.bottom="0",n.style.left="0",n.style.width=this.width+"px",n.style.height=this.height+"px",this.props.width=this.body.domProps.right.width,
+this.props.height=this.body.domProps.right.height),t=this._redrawLabels(),t=this._isResized()||t,this.options.icons===!0?this._redrawGroupIcons():this._cleanupIcons(),this._redrawTitle(s)}return t},o.prototype._redrawLabels=function(){var t=this,e=!1;s.prepareElements(this.DOMelements.lines),s.prepareElements(this.DOMelements.labels);var i=this.options.orientation,o=void 0!=this.options[i].range?this.options[i].range:{},n=!0;void 0!=o.max&&(this.range.end=o.max,n=!1);var r=!0;void 0!=o.min&&(this.range.start=o.min,r=!1),this.scale=new a(this.range.start,this.range.end,r,n,this.dom.frame.offsetHeight,this.props.majorCharHeight,this.options.alignZeros,this.options[i].format),this.master===!1&&void 0!=this.masterAxis&&this.scale.followScale(this.masterAxis.scale),this.maxLabelSize=0;var h=this.scale.getLines();h.forEach(function(e){var o=e.y,n=e.major;t.options.showMinorLabels&&n===!1&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-minor",t.props.minorCharHeight),n&&o>=0&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-major",t.props.majorCharHeight),t.master===!0&&(n?t._redrawLine(o,i,"vis-grid vis-horizontal vis-major",t.options.majorLinesOffset,t.props.majorLineWidth):t._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",t.options.minorLinesOffset,t.props.minorLineWidth))});var d=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(d=this.props.titleCharHeight);var l=this.options.icons===!0?Math.max(this.options.iconWidth,d)+this.options.labelOffsetX+15:d+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-l&&this.options.visible===!0?(this.width=this.maxLabelSize+l,this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSize<this.width-l&&this.options.visible===!0&&this.width>this.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+l),this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),e=!1),e},o.prototype.convertValue=function(t){return this.scale.convertValue(t)},o.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},o.prototype._redrawLabel=function(t,e,i,o,n){var r=s.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=e,"left"===i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize<e.length*a&&(this.maxLabelSize=e.length*a)},o.prototype._redrawLine=function(t,e,i,o,n){if(this.master===!0){var r=s.getDOMElement("div",this.DOMelements.lines,this.dom.lineContainer);r.className=i,r.innerHTML="","left"===e?r.style.left=this.width-o+"px":r.style.right=this.width-o+"px",r.style.width=n+"px",r.style.top=t+"px"}},o.prototype._redrawTitle=function(t){if(s.prepareElements(this.DOMelements.title),void 0!==this.options[t].title&&void 0!==this.options[t].title.text){var e=s.getDOMElement("div",this.DOMelements.title,this.dom.frame);e.className="vis-y-axis vis-title vis-"+t,e.innerHTML=this.options[t].title.text,void 0!==this.options[t].title.style&&n.addCssText(e,this.options[t].title.style),"left"===t?e.style.left=this.props.titleCharHeight+"px":e.style.right=this.props.titleCharHeight+"px",e.style.width=this.height+"px"}s.cleanupElements(this.DOMelements.title)},o.prototype._calculateCharSize=function(){if(!("minorCharHeight"in this.props)){var t=document.createTextNode("0"),e=document.createElement("div");e.className="vis-y-axis vis-minor vis-measure",e.appendChild(t),this.dom.frame.appendChild(e),this.props.minorCharHeight=e.clientHeight,this.props.minorCharWidth=e.clientWidth,this.dom.frame.removeChild(e)}if(!("majorCharHeight"in this.props)){var i=document.createTextNode("0"),o=document.createElement("div");o.className="vis-y-axis vis-major vis-measure",o.appendChild(i),this.dom.frame.appendChild(o),this.props.majorCharHeight=o.clientHeight,this.props.majorCharWidth=o.clientWidth,this.dom.frame.removeChild(o)}if(!("titleCharHeight"in this.props)){var n=document.createTextNode("0"),s=document.createElement("div");s.className="vis-y-axis vis-title vis-measure",s.appendChild(n),this.dom.frame.appendChild(s),this.props.titleCharHeight=s.clientHeight,this.props.titleCharWidth=s.clientWidth,this.dom.frame.removeChild(s)}},t.exports=o},function(t,e){function i(t,e,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?!1:arguments[6],a=arguments.length<=7||void 0===arguments[7]?!1:arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=n,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=o,this.formattingFunction=a,i||o){var h=this,d=function(t){var e=t-t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx]);return t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx])>.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?e+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:e};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=d(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=d(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(t){this.majorCharHeight=t},i.prototype.setHeight=function(t){this.containerHeight=t},i.prototype.determineScale=function(){var t=this._end-this._start;this.scale=this.containerHeight/t;var e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;0>i&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r<this.minorSteps.length;r++){var a=this.magnitudefactor*this.minorSteps[r];if(a>=e){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)},i.prototype.formatValue=function(t){var e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?""+e:"string"==typeof e?e:t.toPrecision(5)},i.prototype.getLines=function(){for(var t=[],e=this.getStep(),i=(e-this._start%e)%e,o=this._start+i;this._end-o>1e-5;o+=e)o!=this._start&&t.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return t},i.prototype.followScale=function(t){var e=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdx<this.minorStepIdx?(this.minorStepIdx=1,2==e?s():(s(),s())):(this.minorStepIdx=2,1==e?r():(r(),r())));for(var a=(t.getLines(),t.convertValue(0)),h=t.getStep()*t.scale,d=!1,l=0;!d&&l++<5;){this.scale=h/(this.minorSteps[this.minorStepIdx]*this.magnitudefactor);var c=this.containerHeight/this.scale;this._start=i,this._end=this._start+c;var u=this._end*this.scale,p=this.magnitudefactor*this.majorSteps[this.minorStepIdx],f=this.getFirstMajor()-t.getFirstMajor();if(this.zeroAlign){var m=a-u;this._end+=m/this.scale,this._start=this._end-c}else this.autoScaleStart?(this._start-=f/this.scale,this._end=this._start+c):(this._start+=p-f/this.scale,this._end=this._start+c);if(!this.autoScaleEnd&&this._end>o+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start<i-1e-5){if(!(this.zeroAlign&&i>=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&o-i>c?(s(),d=!1):d=!0}}},i.prototype.convertValue=function(t){return this.containerHeight-(t-this._start)*this.scale},i.prototype.screenToValue=function(t){return(this.containerHeight-t)/this.scale+this._start},t.exports=i},function(t,e,i){function o(t,e,i,o){this.id=e;var n=["sampling","style","sort","yAxisOrientation","barChart","drawPoints","shaded","interpolation","zIndex","excludeFromStacking","excludeFromLegend"];this.options=s.selectiveBridgeObject(n,i),this.usingDefaultStyle=void 0===t.className,this.groupsUsingDefaultStyles=o,this.zeroPosition=0,this.update(t),1==this.usingDefaultStyle&&(this.groupsUsingDefaultStyles[0]+=1),this.itemsData=[],this.visible=void 0===t.visible?!0:t.visible}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=i(1),r=(i(8),i(55)),a=i(57),h=i(56);o.prototype.setItems=function(t){null!=t?(this.itemsData=t,1==this.options.sort&&s.insertSort(this.itemsData,function(t,e){return t.x>e.x?1:-1})):this.itemsData=[]},o.prototype.getItems=function(){return this.itemsData},o.prototype.setZeroPosition=function(t){this.zeroPosition=t},o.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];s.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),s.mergeOptions(this.options,t,"interpolation"),s.mergeOptions(this.options,t,"drawPoints"),s.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==n(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},o.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible?!0:t.visible,this.style=t.style,this.setOptions(t.options)},o.prototype.getLegend=function(t,e,i,o,n){if(void 0==i||null==i){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");i={svg:s,svgElements:{},options:this.options,groups:[this]}}switch(void 0!=o&&null!=o||(o=0),void 0!=n&&null!=n||(n=.5*e),this.options.style){case"line":a.drawIcon(this,o,n,t,e,i);break;case"points":case"point":h.drawIcon(this,o,n,t,e,i);break;case"bar":r.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},o.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;o<t.length;o++)e=e>t[o].y?t[o].y:e,i=i<t[o].y?t[o].y:i;return{min:e,max:i,yAxisOrientation:this.options.yAxisOrientation}},t.exports=o},function(t,e,i){function o(t,e){}var n=i(8),s=i(56);o.drawIcon=function(t,e,i,o,s,r){var a=.5*s,h=n.getSVGElement("rect",r.svgElements,r.svg);h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i-a),h.setAttributeNS(null,"width",o),h.setAttributeNS(null,"height",2*a),h.setAttributeNS(null,"class","vis-outline");var d=Math.round(.3*o),l=t.options.barChart.width,c=l/d,u=Math.round(.4*s),p=Math.round(.75*s),f=Math.round((o-2*d)/3);if(n.drawBar(e+.5*d+f,i+a-u-1,d,u,t.className+" vis-bar",r.svgElements,r.svg,t.style),n.drawBar(e+1.5*d+f+2,i+a-p-1,d,p,t.className+" vis-bar",r.svgElements,r.svg,t.style),1==t.options.drawPoints.enabled){var m={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size/c,className:t.className};n.drawPoint(e+.5*d+f,i+a-u-1,m,r.svgElements,r.svg),n.drawPoint(e+1.5*d+f+2,i+a-p-1,m,r.svgElements,r.svg)}},o.draw=function(t,e,i){var r,a,h,d,l,c,u=[],p={},f=0;for(l=0;l<t.length;l++)if(d=i.groups[t[l]],"bar"===d.options.style&&d.visible===!0&&(void 0===i.options.groups.visibility[t[l]]||i.options.groups.visibility[t[l]]===!0))for(c=0;c<e[t[l]].length;c++)u.push({screen_x:e[t[l]][c].screen_x,screen_y:e[t[l]][c].screen_y,x:e[t[l]][c].x,y:e[t[l]][c].y,groupId:t[l],label:e[t[l]][c].label}),f+=1;if(0!==f)for(u.sort(function(t,e){return t.screen_x===e.screen_x?t.groupId<e.groupId?-1:1:t.screen_x-e.screen_x}),o._getDataIntersections(p,u),l=0;l<u.length;l++){d=i.groups[u[l].groupId];var m=void 0!=d.options.barChart.minWidth?d.options.barChart.minWidth:.1*d.options.barChart.width;a=u[l].screen_x;var v=0;if(void 0===p[a])l+1<u.length&&(r=Math.abs(u[l+1].screen_x-a)),h=o._getSafeDrawData(r,d,m);else{var g=l+(p[a].amount-p[a].resolved);l-(p[a].resolved+1);g<u.length&&(r=Math.abs(u[g].screen_x-a)),h=o._getSafeDrawData(r,d,m),p[a].resolved+=1,d.options.stack===!0&&d.options.excludeFromStacking!==!0?u[l].screen_y<d.zeroPosition?(v=p[a].accumulatedNegative,p[a].accumulatedNegative+=d.zeroPosition-u[l].screen_y):(v=p[a].accumulatedPositive,p[a].accumulatedPositive+=d.zeroPosition-u[l].screen_y):d.options.barChart.sideBySide===!0&&(h.width=h.width/p[a].amount,h.offset+=p[a].resolved*h.width-.5*h.width*(p[a].amount+1))}if(n.drawBar(u[l].screen_x+h.offset,u[l].screen_y-v,h.width,d.zeroPosition-u[l].screen_y,d.className+" vis-bar",i.svgElements,i.svg,d.style),d.options.drawPoints.enabled===!0){var y={screen_x:u[l].screen_x,screen_y:u[l].screen_y-v,x:u[l].x,y:u[l].y,groupId:u[l].groupId,label:u[l].label};s.draw([y],d,i,h.offset)}}},o._getDataIntersections=function(t,e){for(var i,o=0;o<e.length;o++)o+1<e.length&&(i=Math.abs(e[o+1].screen_x-e[o].screen_x)),o>0&&(i=Math.min(i,Math.abs(e[o-1].screen_x-e[o].screen_x))),0===i&&(void 0===t[e[o].screen_x]&&(t[e[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].screen_x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t<e.options.barChart.width&&t>0?(o=i>t?i:t,n=0,"left"===e.options.barChart.align?n-=.5*t:"right"===e.options.barChart.align&&(n+=.5*t)):(o=e.options.barChart.width,n=0,"left"===e.options.barChart.align?n-=.5*e.options.barChart.width:"right"===e.options.barChart.align&&(n+=.5*e.options.barChart.width)),{width:o,offset:n}},o.getStackedYRange=function(t,e,i,n,s){if(t.length>0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupId<e.groupId?-1:1:t.screen_x-e.screen_x});var r={};o._getDataIntersections(r,t),e[n]=o._getStackedYRange(r,t),e[n].yAxisOrientation=s,i.push(n)}},o._getStackedYRange=function(t,e){for(var i,o=e[0].screen_y,n=e[0].screen_y,s=0;s<e.length;s++)i=e[s].screen_x,void 0===t[i]?(o=o>e[s].screen_y?e[s].screen_y:o,n=n<e[s].screen_y?e[s].screen_y:n):e[s].screen_y<0?t[i].accumulatedNegative+=e[s].screen_y:t[i].accumulatedPositive+=e[s].screen_y;for(var r in t)t.hasOwnProperty(r)&&(o=o>t[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n<t[r].accumulatedNegative?t[r].accumulatedNegative:n,n=n<t[r].accumulatedPositive?t[r].accumulatedPositive:n);return{min:o,max:n}},t.exports=o},function(t,e,i){function o(t,e){}function n(t,e){return e="undefined"==typeof e?{}:e,{style:e.style||t.options.drawPoints.style,styles:e.styles||t.options.drawPoints.styles,size:e.size||t.options.drawPoints.size,className:e.className||t.className}}function s(t,e){var i=void 0;return t.options&&t.options.drawPoints&&t.options.drawPoints.onRender&&"function"==typeof t.options.drawPoints.onRender&&(i=t.options.drawPoints.onRender),e.group.options&&e.group.options.drawPoints&&e.group.options.drawPoints.onRender&&"function"==typeof e.group.options.drawPoints.onRender&&(i=e.group.options.drawPoints.onRender),i}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=i(8);o.draw=function(t,e,i,o){o=o||0;for(var h=s(i,e),d=0;d<t.length;d++)if(h){var l=h(t[d],e);l!==!0&&"object"!==("undefined"==typeof l?"undefined":r(l))||a.drawPoint(t[d].screen_x+o,t[d].screen_y,n(e,l),i.svgElements,i.svg,t[d].label)}else a.drawPoint(t[d].screen_x+o,t[d].screen_y,n(e),i.svgElements,i.svg,t[d].label)},o.drawIcon=function(t,e,i,o,s,r){var h=.5*s,d=a.getSVGElement("rect",r.svgElements,r.svg);d.setAttributeNS(null,"x",e),d.setAttributeNS(null,"y",i-h),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",2*h),d.setAttributeNS(null,"class","vis-outline"),a.drawPoint(e+.5*o,i,n(t),r.svgElements,r.svg)},t.exports=o},function(t,e,i){function o(t,e){}var n=i(8);o.calcPath=function(t,e){if(null!=t&&t.length>0){var i=[];return i=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t)}},o.drawIcon=function(t,e,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",e),l.setAttributeNS(null,"y",i-d),l.setAttributeNS(null,"width",o),l.setAttributeNS(null,"height",2*d),l.setAttributeNS(null,"class","vis-outline"),a=n.getSVGElement("path",r.svgElements,r.svg),a.setAttributeNS(null,"class",t.className),void 0!==t.style&&a.setAttributeNS(null,"style",t.style),a.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+o)+","+i),1==t.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==t.options.shaded.orientation?h.setAttributeNS(null,"d","M"+e+", "+(i-d)+"L"+e+","+i+" L"+(e+o)+","+i+" L"+(e+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+d)+" L"+(e+o)+","+(i+d)+"L"+(e+o)+","+i),h.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&h.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled){var c={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className};n.drawPoint(e+.5*o,i,c,r.svgElements,r.svg)}},o.drawShading=function(t,e,i,o){if(1==e.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),h="group"==e.options.shaded.orientation&&null!=i&&void 0!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+d+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(t,e,i){if(null!=t&&void 0!=t){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",e.className),void 0!==e.style&&o.setAttributeNS(null,"style",e.style);var s="L";1==e.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,s,!1))}},o.serializePath=function(t,e,i){if(t.length<2)return"";var o=e;if(i)for(var n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(var n=1;n<t.length;n++)o+=t[n][0]+","+t[n][1]+" ";return o},o._catmullRomUniform=function(t){var e,i,o,n,s,r,a=[];a.push([Math.round(t[0].screen_x),Math.round(t[0].screen_y)]);for(var h=1/6,d=t.length,l=0;d-1>l;l++)e=0==l?t[0]:t[l-1],i=t[l],o=t[l+1],n=d>l+2?t[l+2]:o,s={screen_x:(-e.screen_x+6*i.screen_x+o.screen_x)*h,screen_y:(-e.screen_y+6*i.screen_y+o.screen_y)*h},r={screen_x:(i.screen_x+6*o.screen_x-n.screen_x)*h,screen_y:(i.screen_y+6*o.screen_y-n.screen_y)*h},a.push([s.screen_x,s.screen_y]),a.push([r.screen_x,r.screen_y]),a.push([o.screen_x,o.screen_y]);return a},o._catmullRom=function(t,e){var i=e.options.interpolation.alpha;if(0==i||void 0===i)return this._catmullRomUniform(t);var o,n,s,r,a,h,d,l,c,u,p,f,m,v,g,y,b,w,_,x=[];x.push([Math.round(t[0].screen_x),Math.round(t[0].screen_y)]);for(var k=t.length,O=0;k-1>O;O++)o=0==O?t[0]:t[O-1],n=t[O],s=t[O+1],r=k>O+2?t[O+2]:s,d=Math.sqrt(Math.pow(o.screen_x-n.screen_x,2)+Math.pow(o.screen_y-n.screen_y,2)),l=Math.sqrt(Math.pow(n.screen_x-s.screen_x,2)+Math.pow(n.screen_y-s.screen_y,2)),c=Math.sqrt(Math.pow(s.screen_x-r.screen_x,2)+Math.pow(s.screen_y-r.screen_y,2)),v=Math.pow(c,i),y=Math.pow(c,2*i),g=Math.pow(l,i),b=Math.pow(l,2*i),_=Math.pow(d,i),w=Math.pow(d,2*i),u=2*w+3*_*g+b,p=2*y+3*v*g+b,f=3*_*(_+g),f>0&&(f=1/f),m=3*v*(v+g),m>0&&(m=1/m),a={screen_x:(-b*o.screen_x+u*n.screen_x+w*s.screen_x)*f,screen_y:(-b*o.screen_y+u*n.screen_y+w*s.screen_y)*f},h={screen_x:(y*n.screen_x+p*s.screen_x-b*r.screen_x)*m,screen_y:(y*n.screen_y+p*s.screen_y-b*r.screen_y)*m},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(t){for(var e=[],i=0;i<t.length;i++)e.push([t[i].screen_x,t[i].screen_y]);return e},t.exports=o},function(t,e,i){function o(t,e,i,o){this.body=t,this.defaultOptions={enabled:!1,icons:!0,iconSize:20,iconSpacing:6,left:{visible:!0,position:"top-left"},right:{visible:!0,position:"top-right"}},this.side=i,this.options=n.extend({},this.defaultOptions),this.linegraphOptions=o,this.svgElements={},this.dom={},this.groups={},this.amountOfGroups=0,this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups},this.setOptions(e)}var n=i(1),s=i(8),r=i(31);o.prototype=new r,o.prototype.clear=function(){this.groups={},this.amountOfGroups=0},o.prototype.addGroup=function(t,e){1!=e.options.excludeFromLegend&&(this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1)},o.prototype.updateGroup=function(t,e){this.groups[t]=e},o.prototype.removeGroup=function(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)},o.prototype._create=function(){this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-legend",this.dom.frame.style.position="absolute",this.dom.frame.style.top="10px",this.dom.frame.style.display="block",this.dom.textArea=document.createElement("div"),this.dom.textArea.className="vis-legend-text",this.dom.textArea.style.position="relative",this.dom.textArea.style.top="0px",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.width=this.options.iconSize+5+"px",this.svg.style.height="100%",this.dom.frame.appendChild(this.svg),this.dom.frame.appendChild(this.dom.textArea)},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame)},o.prototype.setOptions=function(t){var e=["enabled","orientation","icons","left","right"];n.selectiveDeepExtend(e,this.options,t)},o.prototype.redraw=function(){var t=0,e=Object.keys(this.groups);e.sort(function(t,e){return e>t?-1:1});for(var i=0;i<e.length;i++){var o=e[i];1!=this.groups[o].visible||void 0!==this.linegraphOptions.visibility[o]&&1!=this.linegraphOptions.visibility[o]||t++}if(0==this.options[this.side].visible||0==this.amountOfGroups||0==this.options.enabled||0==t)this.hide();else{if(this.show(),"top-left"==this.options[this.side].position||"bottom-left"==this.options[this.side].position?(this.dom.frame.style.left="4px",this.dom.frame.style.textAlign="left",this.dom.textArea.style.textAlign="left",this.dom.textArea.style.left=this.options.iconSize+15+"px",this.dom.textArea.style.right="",this.svg.style.left="0px",this.svg.style.right=""):(this.dom.frame.style.right="4px",this.dom.frame.style.textAlign="right",this.dom.textArea.style.textAlign="right",this.dom.textArea.style.right=this.options.iconSize+15+"px",this.dom.textArea.style.left="",this.svg.style.right="0px",this.svg.style.left=""),"top-left"==this.options[this.side].position||"top-right"==this.options[this.side].position)this.dom.frame.style.top=4-Number(this.body.dom.center.style.top.replace("px",""))+"px",this.dom.frame.style.bottom="";else{var n=this.body.domProps.center.height-this.body.domProps.centerContainer.height;this.dom.frame.style.bottom=4+n+Number(this.body.dom.center.style.top.replace("px",""))+"px",this.dom.frame.style.top=""}0==this.options.icons?(this.dom.frame.style.width=this.dom.textArea.offsetWidth+10+"px",this.dom.textArea.style.right="",this.dom.textArea.style.left="",this.svg.style.width="0px"):(this.dom.frame.style.width=this.options.iconSize+15+this.dom.textArea.offsetWidth+10+"px",this.drawLegendIcons());for(var s="",i=0;i<e.length;i++){var o=e[i];1!=this.groups[o].visible||void 0!==this.linegraphOptions.visibility[o]&&1!=this.linegraphOptions.visibility[o]||(s+=this.groups[o].content+"<br />")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort(function(t,e){return e>t?-1:1}),s.resetElements(this.svgElements);var e=window.getComputedStyle(this.dom.frame).paddingTop,i=Number(e.replace("px","")),o=i,n=this.options.iconSize,r=.75*this.options.iconSize,a=i+.5*r+3;this.svg.style.width=n+5+i+"px";for(var h=0;h<t.length;h++){var d=t[h];1!=this.groups[d].visible||void 0!==this.linegraphOptions.visibility[d]&&1!=this.linegraphOptions.visibility[d]||(this.groups[d].getLegend(n,r,this.framework,o,a),a+=r+this.options.iconSpacing)}}},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",c={configure:{enabled:{"boolean":o},filter:{"boolean":o,"function":"function"},container:{dom:h},__type__:{object:a,"boolean":o,"function":"function"}},yAxisOrientation:{string:["left","right"]},defaultGroup:{string:i},sort:{"boolean":o},sampling:{"boolean":o},stack:{"boolean":o},graphHeight:{string:i,number:n},shaded:{enabled:{"boolean":o},orientation:{string:["bottom","top","zero","group"]},groupId:{object:a},__type__:{"boolean":o,object:a}},style:{string:["line","bar","points"]},barChart:{width:{number:n},minWidth:{number:n},sideBySide:{"boolean":o},align:{string:["left","center","right"]},__type__:{object:a}},interpolation:{enabled:{"boolean":o},parametrization:{string:["centripetal","chordal","uniform"]},alpha:{number:n},__type__:{object:a,"boolean":o}},drawPoints:{enabled:{"boolean":o},onRender:{"function":"function"},size:{number:n},style:{string:["square","circle"]},__type__:{object:a,"boolean":o,"function":"function"}},dataAxis:{showMinorLabels:{"boolean":o},showMajorLabels:{"boolean":o},icons:{"boolean":o},width:{string:i,number:n},visible:{"boolean":o},alignZeros:{"boolean":o},left:{range:{min:{number:n},max:{number:n},__type__:{object:a}},format:{"function":"function"},title:{text:{string:i,number:n},style:{string:i},__type__:{object:a}},__type__:{object:a}},right:{range:{min:{number:n},max:{number:n},__type__:{object:a}},format:{"function":"function"},title:{text:{string:i,number:n},style:{string:i},__type__:{object:a}},__type__:{object:a}},__type__:{object:a}},legend:{enabled:{"boolean":o},icons:{"boolean":o},left:{visible:{"boolean":o},position:{string:["top-right","bottom-right","top-left","bottom-left"]},__type__:{object:a}},right:{visible:{"boolean":o},position:{string:["top-right","bottom-right","top-left","bottom-left"]},__type__:{object:a}},__type__:{object:a,"boolean":o}},groups:{visibility:{any:l},__type__:{object:a}},autoResize:{"boolean":o},throttleRedraw:{number:n},clickToUse:{"boolean":o},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},__type__:{object:a}},moment:{"function":"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{"boolean":o},multiselect:{"boolean":o},orientation:{string:i},showCurrentTime:{"boolean":o},showMajorLabels:{"boolean":o},showMinorLabels:{"boolean":o},start:{date:r,number:n,string:i,moment:d},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},width:{string:i,number:n},zoomable:{"boolean":o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},zIndex:{number:n},__type__:{object:a}},u={global:{sort:!0,sampling:!0,stack:!1,shaded:{enabled:!1,orientation:["zero","top","bottom","group"]},style:["line","bar","points"],barChart:{width:[50,5,100,5],minWidth:[50,5,100,5],sideBySide:!1,align:["left","center","right"]},interpolation:{enabled:!0,parametrization:["centripetal","chordal","uniform"]},drawPoints:{enabled:!0,size:[6,2,30,1],style:["square","circle"]},dataAxis:{showMinorLabels:!0,showMajorLabels:!0,icons:!1,width:[40,0,200,1],visible:!0,alignZeros:!0,left:{title:{text:"",style:""}},right:{title:{text:"",style:""}}},legend:{enabled:!1,icons:!0,left:{visible:!0,position:["top-right","bottom-right","top-left","bottom-left"]},right:{visible:!0,position:["top-right","bottom-right","top-left","bottom-left"]}},autoResize:!0,throttleRedraw:[10,0,1e3,10],clickToUse:!1,end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},height:"",locale:"",max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!0,orientation:["both","bottom","top"],showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,start:"",width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1],zIndex:0}};e.allOptions=c,e.configureOptions=u},function(t,e,i){e.util=i(1),e.DOMutil=i(8),e.DataSet=i(9),e.DataView=i(11),e.Queue=i(10),e.Network=i(61),e.network={Images:i(62),dotparser:i(118),gephiParser:i(119),allOptions:i(114)},e.network.convertDot=function(t){return e.network.dotparser.DOTToGraph(t)},e.network.convertGephi=function(t,i){return e.network.gephiParser.parseGephi(t,i)},e.moment=i(2),e.Hammer=i(20),e.keycharm=i(23)},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e,i){var o=this;if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:Y,clickToUse:!1},F.extend(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 r["default"](function(){return o.body.emitter.emit("_requestRedraw")}),this.groups=new h["default"],this.canvas=new w["default"](this.body),this.selectionHandler=new D["default"](this.body,this.canvas),this.interactionHandler=new O["default"](this.body,this.canvas,this.selectionHandler),this.view=new x["default"](this.body,this.canvas),this.renderer=new y["default"](this.body,this.canvas),this.physics=new f["default"](this.body),this.layoutEngine=new C["default"](this.body),this.clustering=new v["default"](this.body),this.manipulation=new E["default"](this.body,this.canvas,this.selectionHandler),this.nodesHandler=new l["default"](this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new u["default"](this.body,this.images,this.groups),this.body.modules.kamadaKawai=new A["default"](this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(e)}var s=i(62),r=o(s),a=i(63),h=o(a),d=i(64),l=o(d),c=i(84),u=o(c),p=i(93),f=o(p),m=i(102),v=o(m),g=i(105),y=o(g),b=i(106),w=o(b),_=i(107),x=o(_),k=i(108),O=o(k),M=i(111),D=o(M),S=i(112),C=o(S),T=i(113),E=o(T),P=i(26),I=o(P),N=i(29),R=o(N),z=i(114),L=i(115),A=o(L);i(117);var B=i(13),F=i(1),j=(i(9),i(11),i(118)),H=i(119),W=i(45),Y=i(120);B(n.prototype),n.prototype.setOptions=function(t){var e=this;if(void 0!==t){var i=R["default"].validate(t,z.allOptions);i===!0&&console.log("%cErrors have been found in the supplied options object.",N.printStyle);var o=["locale","locales","clickToUse"];if(F.selectiveDeepExtend(o,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 I["default"](this,this.body.container,z.configureOptions,this.canvas.pixelRatio)),this.configurator.setOptions(t.configure)),this.configurator&&this.configurator.options.enabled===!0){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};F.deepExtend(n.nodes,this.nodesHandler.options),F.deepExtend(n.edges,this.edgesHandler.options),F.deepExtend(n.layout,this.layoutEngine.options),F.deepExtend(n.interaction,this.selectionHandler.options),F.deepExtend(n.interaction,this.renderer.options),F.deepExtend(n.interaction,this.interactionHandler.options),F.deepExtend(n.manipulation,this.manipulation.options),F.deepExtend(n.physics,this.physics.options),F.deepExtend(n.global,this.canvas.options),F.deepExtend(n.global,this.options),this.configurator.setModuleOptions(n)}void 0!==t.clickToUse?t.clickToUse===!0?void 0===this.activator&&(this.activator=new W(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")}},n.prototype._updateVisibleIndices=function(){var t=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var i in t)t.hasOwnProperty(i)&&t[i].options.hidden===!1&&this.body.nodeIndices.push(t[i].id);for(var o in e)e.hasOwnProperty(o)&&e[o].options.hidden===!1&&this.body.edgeIndices.push(e[o].id)},n.prototype.bindEventListeners=function(){var t=this;this.body.emitter.on("_dataChanged",function(){t._updateVisibleIndices(),t.body.emitter.emit("_requestRedraw"),t.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){t._updateValueRange(t.body.nodes),t._updateValueRange(t.body.edges),t.body.emitter.emit("startSimulation"),t.body.emitter.emit("_requestRedraw")})},n.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 depricated. 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=j.DOTToGraph(t.dot);return void this.setData(e)}if(t&&t.gephi){console.log("The gephi property has been depricated. 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=H.parseGephi(t.gephi);return void this.setData(i)}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")},n.prototype.destroy=function(){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;for(var t in this.body.nodes)delete this.body.nodes[t];for(var e in this.body.edges)delete this.body.edges[e];F.recursiveDOMDelete(this.body.container)},n.prototype._updateValueRange=function(t){var e,i=void 0,o=void 0,n=0;for(e in t)if(t.hasOwnProperty(e)){var s=t[e].getValue();void 0!==s&&(i=void 0===i?s:Math.min(s,i),o=void 0===o?s:Math.max(s,o),n+=s)}if(void 0!==i&&void 0!==o)for(e in t)t.hasOwnProperty(e)&&t[e].setValueRange(i,o,n)},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},n.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},n.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},n.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},n.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},n.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},n.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},n.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},n.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},n.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},n.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},n.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},n.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},n.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},n.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},n.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},n.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},n.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},n.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},n.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},n.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},n.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},n.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)},n.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},n.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},n.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},n.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},n.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},n.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},n.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},n.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},n.prototype.getNodeAt=function(){var t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},n.prototype.getEdgeAt=function(){var t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==t&&void 0!==t.id?t.id:t},n.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},n.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},n.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},n.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},n.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},n.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},n.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},n.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},n.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},n.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},n.prototype.getOptionsFromConfigurator=function(){var t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t},t.exports=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e){i(this,t),this.images={},this.imageBroken={},this.callback=e}return o(t,[{key:"_addImageToCache",value:function(t,e){0===e.width&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e)),this.images[t]=e}},{key:"_tryloadBrokenUrl",value:function(t,e,i){var o=this;void 0!==t&&void 0!==e&&void 0!==i&&(i.onerror=function(){console.error("Could not load brokenImage:",e),o._addImageToCache(t,new Image)},i.src=e)}},{key:"_redrawWithImage",value:function(t){this.callback&&this.callback(t)}},{key:"load",value:function(t,e,i){var o=this,n=this.images[t];if(n)return n;var s=new Image;return s.onload=function(){o._addImageToCache(t,s),o._redrawWithImage(s)},s.onerror=function(){console.error("Could not load image:",t),o._tryloadBrokenUrl(t,e,s)},s.src=t,s}}]),t}();e["default"]=n},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(1),r=function(){function t(){o(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},s.extend(this.options,this.defaultOptions)}return n(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 o=t[i];this.add(i,o)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(t){var e=this.groups[t];if(void 0===e)if(this.options.useDefaultGroups===!1&&this.groupsArray.length>0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,e={},e.color=this.groups[this.groupsArray[i]],this.groups[t]=e}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,e={},e.color=this.defaultGroups[o],this.groups[t]=e}return e}},{key:"add",value:function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e}}]),t}();e["default"]=r},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(65),a=o(r),h=i(66),d=o(h),l=i(1),c=i(9),u=i(11),p=function(){function t(e,i,o,s){var r=this;n(this,t),this.body=e,this.images=i,this.groups=o,this.layoutEngine=s,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)},remove:function(t,e){r.remove(e.items)}},this.options={},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"},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,label:void 0,labelHighlightBold:!0,level:void 0,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,o){if(e===t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)}},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},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(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(){l.forEach(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(a["default"].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){d["default"].parseOptions(this.options.font,t);for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i]._reset())}if(void 0!==t.size)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&this.body.nodes[o]._reset();void 0===t.hidden&&void 0===t.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.nodes;if(t instanceof c||t instanceof u)this.body.data.nodes=t;else if(Array.isArray(t))this.body.data.nodes=new c,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new c}o&&l.forEach(this.nodesListeners,function(t,e){o.off(e,t)}),this.body.nodes={},this.body.data.nodes&&!function(){var t=e;l.forEach(e.nodesListeners,function(e,i){t.body.data.nodes.on(i,e)});var i=e.body.data.nodes.getIds();e.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=[],n=0;n<t.length;n++){i=t[n];var s=this.body.data.nodes.get(i),r=this.create(s);o.push(r),this.body.nodes[i]=r}this.layoutEngine.positionInitially(o),e===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(t,e){for(var i=this.body.nodes,o=!1,n=0;n<t.length;n++){var s=t[n],r=i[s],a=e[n];void 0!==r?o=r.setOptions(a):(o=!0,r=this.create(a),i[s]=r)}o===!0?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++){var o=t[i];delete e[o]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?a["default"]:arguments[1];return new e(t,this.body,this.images,this.groups,this.options)}},{key:"refresh",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.body.nodes;for(var i in e){var o=void 0;e.hasOwnProperty(i)&&(o=e[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(t===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(t){var e={};if(void 0!==t){if(Array.isArray(t)===!0){for(var i=0;i<t.length;i++)if(void 0!==this.body.nodes[t[i]]){var o=this.body.nodes[t[i]];e[t[i]]={x:Math.round(o.x),y:Math.round(o.y)}}}else if(void 0!==this.body.nodes[t]){var n=this.body.nodes[t];e[t]={x:Math.round(n.x),y:Math.round(n.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var r=this.body.nodes[this.body.nodeIndices[s]];e[this.body.nodeIndices[s]]={x:Math.round(r.x),y:Math.round(r.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 o=this.body.nodes[i];e._data[i].x==Math.round(o.x)&&e._data[i].y==Math.round(o.y)||t.push({id:o.id,x:Math.round(o.x),y:Math.round(o.y)})}e.update(t)}},{key:"getBoundingBox",value:function(t){return void 0!==this.body.nodes[t]?this.body.nodes[t].shape.boundingBox:void 0}},{key:"getConnectedNodes",value:function(t){var e=[];if(void 0!==this.body.nodes[t])for(var i=this.body.nodes[t],o={},n=0;n<i.edges.length;n++){var s=i.edges[n];s.toId==i.id?void 0===o[s.fromId]&&(e.push(s.fromId),o[s.fromId]=!0):s.fromId==i.id&&void 0===o[s.toId]&&(e.push(s.toId),o[s.toId]=!0)}return e}},{key:"getConnectedEdges",value:function(t){var e=[];if(void 0!==this.body.nodes[t])for(var i=this.body.nodes[t],o=0;o<i.edges.length;o++)e.push(i.edges[o].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",t);return e}},{key:"moveNode",value:function(t,e,i){var o=this;void 0!==this.body.nodes[t]?(this.body.nodes[t].x=Number(e),this.body.nodes[t].y=Number(i),setTimeout(function(){o.body.emitter.emit("startSimulation")},0)):console.log("Node id supplied to moveNode does not exist. Provided: ",t)}}]),t}();e["default"]=p},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(66),a=o(r),h=i(67),d=o(h),l=i(69),c=o(l),u=i(71),p=o(u),f=i(72),m=o(f),v=i(73),g=o(v),y=i(75),b=o(y),w=i(76),_=o(w),x=i(77),k=o(x),O=i(78),M=o(O),D=i(79),S=o(D),C=i(80),T=o(C),E=i(81),P=o(E),I=i(82),N=o(I),R=i(83),z=o(R),L=i(29),A=(o(L),i(1)),B=function(){function t(e,i,o,s,r){n(this,t),this.options=A.bridgeObject(r),this.globalOptions=r,this.body=i,this.edges=[],this.id=void 0,this.imagelist=o,this.grouplist=s,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 a["default"](this.body,this.options,!1),this.setOptions(e)}return s(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.id&&(this.id=e.id),void 0===this.id)throw"Node must have an id";if(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)),"number"==typeof e.group||"string"==typeof e.group&&""!=e.group){var o=this.grouplist.get(e.group);A.deepExtend(this.options,o),this.options.color=A.parseColor(this.options.color)}if(t.parseOptions(this.options,e,!0,this.globalOptions),void 0!==this.options.image){if(!this.imagelist)throw"No imagelist provided";this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id)}return this.updateLabelModule(),this.updateShape(i),void 0!==e.hidden||void 0!==e.physics}}},{key:"updateLabelModule",value:function(){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),this.labelModule.setOptions(this.options,!0),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);else switch(this.options.shape){case"box":this.shape=new d["default"](this.options,this.body,this.labelModule);break;case"circle":this.shape=new c["default"](this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new p["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"database":this.shape=new m["default"](this.options,this.body,this.labelModule);break;case"diamond":this.shape=new g["default"](this.options,this.body,this.labelModule);break;case"dot":this.shape=new b["default"](this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new _["default"](this.options,this.body,this.labelModule);break;case"icon":this.shape=new k["default"](this.options,this.body,this.labelModule);break;case"image":this.shape=new M["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"square":this.shape=new S["default"](this.options,this.body,this.labelModule);break;case"star":this.shape=new T["default"](this.options,this.body,this.labelModule);break;case"text":this.shape=new P["default"](this.options,this.body,this.labelModule);break;case"triangle":this.shape=new N["default"](this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new z["default"](this.options,this.body,this.labelModule);break;default:this.shape=new _["default"](this.options,this.body,this.labelModule)}this._reset()}},{key:"select",value:function(){this.selected=!0,this._reset()}},{key:"unselect",value:function(){this.selected=!1,this._reset()}},{key:"_reset",value:function(){this.shape.width=void 0,this.shape.height=void 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:"setValueRange",value:function(t,e,i){if(void 0!==this.options.value){var o=this.options.scaling.customScalingFunction(t,e,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.size=this.options.scaling.min+o*n}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(t){this.shape.draw(t,this.x,this.y,this.selected,this.hover)}},{key:"updateBoundingBox",value:function(t){this.shape.updateBoundingBox(this.x,this.y,t)}},{key:"resize",value:function(t){this.shape.resize(t,this.selected)}},{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:"parseOptions",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["color","font","fixed","shadow"];if(A.selectiveNotDeepExtend(n,t,e,i),A.mergeOptions(t,e,"shadow",i,o),void 0!==e.color&&null!==e.color){var s=A.parseColor(e.color);A.fillIfDefined(t.color,s)}else i===!0&&null===e.color&&(t.color=A.bridgeObject(o.color));void 0!==e.fixed&&null!==e.fixed&&("boolean"==typeof e.fixed?(t.fixed.x=e.fixed,t.fixed.y=e.fixed):(void 0!==e.fixed.x&&"boolean"==typeof e.fixed.x&&(t.fixed.x=e.fixed.x),void 0!==e.fixed.y&&"boolean"==typeof e.fixed.y&&(t.fixed.y=e.fixed.y))),void 0!==e.font&&null!==e.font?a["default"].parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=A.bridgeObject(o.font)),void 0!==e.scaling&&A.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)}}]),t}();e["default"]=B},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(1),h=function(){function t(e,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];o(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 r(t,[{key:"setOptions",value:function(e){var i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];this.nodeOptions=e,this.fontOptions=a.deepExtend({},e.font,!0),void 0!==e.label&&(this.labelDirty=!0),void 0!==e.font&&(t.parseOptions(this.fontOptions,e,i),"string"==typeof e.font?this.baseSize=this.fontOptions.size:"object"===s(e.font)&&void 0!==e.font.size&&(this.baseSize=e.font.size))}},{key:"draw",value:function(t,e,i,o){var n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];if(void 0!==this.nodeOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.nodeOptions.label&&s<this.nodeOptions.scaling.label.drawThreshold-1||(this.calculateLabelSize(t,o,e,i,n),
+this._drawBackground(t),this._drawText(t,o,e,i,n))}}},{key:"_drawBackground",value:function(t){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){t.fillStyle=this.fontOptions.background;var e=2;if(this.isEdgeLabel)switch(this.fontOptions.align){case"middle":t.fillRect(.5*-this.size.width,.5*-this.size.height,this.size.width,this.size.height);break;case"top":t.fillRect(.5*-this.size.width,-(this.size.height+e),this.size.width,this.size.height);break;case"bottom":t.fillRect(.5*-this.size.width,e,this.size.width,this.size.height);break;default:t.fillRect(this.size.left,this.size.top-.5*e,this.size.width,this.size.height)}else t.fillRect(this.size.left,this.size.top-.5*e,this.size.width,this.size.height)}}},{key:"_drawText",value:function(t,e,i,o){var s=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4],r=this.fontOptions.size,a=r*this.body.view.scale;a>=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),c=l[0],u=l[1],p=this._setAlignment(t,i,h,s),f=n(p,2);i=f[0],h=f[1],t.font=(e&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,t.fillStyle=c,this.isEdgeLabel||"left"!==this.fontOptions.align?t.textAlign="center":(t.textAlign=this.fontOptions.align,i-=.5*this.size.width),this.fontOptions.strokeWidth>0&&(t.lineWidth=this.fontOptions.strokeWidth,t.strokeStyle=u,t.lineJoin="round");for(var m=0;m<this.lineCount;m++)this.fontOptions.strokeWidth>0&&t.strokeText(this.lines[m],i,h),t.fillText(this.lines[m],i,h),h+=r}},{key:"_setAlignment",value:function(t,e,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){e=0,i=0;var n=2;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=2*n):t.textBaseline="middle"}else t.textBaseline=o;return[e,i]}},{key:"_getColor",value:function(t){var e=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(t<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-t)));e=a.overrideOpacity(e,o),i=a.overrideOpacity(i,o)}return[e,i]}},{key:"getTextSize",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i={width:this._processLabel(t,e),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2],o=arguments.length<=3||void 0===arguments[3]?0:arguments[3],n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];this.labelDirty===!0&&(this.size.width=this._processLabel(t,e)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(t,e){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,t.font=(e&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=t.measureText(o[0]).width;for(var s=1;n>s;s++){var r=t.measureText(o[s]).width;i=r>i?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if("string"==typeof e.font){var o=e.font.split(" ");t.size=o[0].replace("px",""),t.face=o[1],t.color=o[2]}else"object"===s(e.font)&&a.fillIfDefined(t,e.font,i);t.size=Number(t.size)}}]),t}();e["default"]=h},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t,e){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(t,e);this.width=o.width+2*i,this.height=o.height+2*i,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n){this.resize(t,o),this.left=e-this.width/2,this.top=i-this.height/2;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth;t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.lineWidth=o?r:s,t.lineWidth/=this.body.view.scale,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background;var a=this.options.shapeProperties.borderRadius;t.roundRect(this.left,this.top,this.width,this.height,a),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),s>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),this.updateBoundingBox(e,i,t,o),this.labelModule.draw(t,e,i,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-.5*this.width,this.top=e-.5*this.height;var n=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-n,this.boundingBox.top=this.top-n,this.boundingBox.bottom=this.top+this.height+n,this.boundingBox.right=this.left+this.width+n}},{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}(d["default"]);e["default"]=l},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=o,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.boundingBox={top:0,left:0,right:0,bottom:0}}return o(t,[{key:"setOptions",value:function(t){this.options=t}},{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){this.options.shadow.enabled===!0&&(t.shadowColor=this.options.shadow.color,t.shadowBlur=this.options.shadow.size,t.shadowOffsetX=this.options.shadow.x,t.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(t){if(this.options.shapeProperties.borderDashes!==!1)if(void 0!==t.setLineDash){var e=this.options.shapeProperties.borderDashes;e===!0&&(e=[5,15]),t.setLineDash(e)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1}},{key:"disableBorderDashes",value:function(t){this.options.shapeProperties.borderDashes!==!1&&(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))}}]),t}();e["default"]=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(70),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t,e){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(t,e),n=Math.max(o.width,o.height)+2*i;this.options.size=n/2,this.width=n,this.height=n,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n){this.resize(t,o),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,o,n,this.options.size),this.boundingBox.top=i-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=i+this.options.size,this.updateBoundingBox(e,i),this.labelModule.draw(t,e,i,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}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){n(this,e);var r=s(this,Object.getPrototypeOf(e).call(this,t,i,o));return r.labelOffset=0,r.imageLoaded=!1,r}return r(e,t),a(e,[{key:"setOptions",value:function(t,e){this.options=t,e&&(this.imageObj=e)}},{key:"_resizeImage",value:function(){var t=!1;if(this.imageObj.width&&this.imageObj.height?this.imageLoaded===!1&&(this.imageLoaded=!0,t=!0):this.imageLoaded=!1,!this.width||!this.height||t===!0){var e,i,o;this.imageObj.width&&this.imageObj.height&&(e=0,i=0),this.options.shapeProperties.useImageSize===!1?this.imageObj.width>this.imageObj.height?(o=this.imageObj.width/this.imageObj.height,e=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,e=2*this.options.size,i=2*this.options.size*o):(e=this.imageObj.width,i=this.imageObj.height),this.width=e,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(t,e,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;t.lineWidth=Math.min(this.width,h),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.circle(e,i,s),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),h>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore()}},{key:"_drawImageAtPosition",value:function(t){if(0!=this.imageObj.width){t.globalAlpha=1,this.enableShadow(t);var e=this.imageObj.width/this.width/this.body.view.scale;if(e>2&&this.options.shapeProperties.interpolation===!0){var i=this.imageObj.width,o=this.imageObj.height,n=document.createElement("canvas");n.width=i,n.height=i;var s=n.getContext("2d");e*=.5,i*=.5,o*=.5,s.drawImage(this.imageObj,0,0,i,o);for(var r=0,a=1;e>2&&4>a;)s.drawImage(n,r,0,i,o,r+i,0,i/2,o/2),r+=i,e*=.5,i*=.5,o*=.5,a+=1;t.drawImage(n,r,0,i,o,this.left,this.top,this.width,this.height)}else t.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(t)}}},{key:"_drawImageLabel",value:function(t,e,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(t);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(t,e,n,o,"hanging")}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(70),d=o(h),l=function(t){function e(t,i,o,r){n(this,e);var a=s(this,Object.getPrototypeOf(e).call(this,t,i,o));return a.imageObj=r,a._swapToImageResizeWhenImageLoaded=!0,a}return r(e,t),a(e,[{key:"resize",value:function(){if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){if(!this.width){var t=2*this.options.size;this.width=t,this.height=t,this._swapToImageResizeWhenImageLoaded=!0,this.radius=.5*this.width}}else this._swapToImageResizeWhenImageLoaded&&(this.width=void 0,this.height=void 0,this._swapToImageResizeWhenImageLoaded=!1),this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n){this.resize(),this.left=e-this.width/2,this.top=i-this.height/2;var s=Math.min(.5*this.height,.5*this.width);this._drawRawCircle(t,e,i,o,n,s),t.save(),t.clip(),this._drawImageAtPosition(t),t.restore(),this._drawImageLabel(t,e,i,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}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t,e){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(t,e),n=o.width+2*i;this.width=n,this.height=n,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n){this.resize(t,o),this.left=e-this.width/2,this.top=i-this.height/2;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;t.lineWidth=Math.min(this.width,a),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.database(e-this.width/2,i-.5*this.height,this.width,this.height),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),a>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),this.updateBoundingBox(e,i,t,o),this.labelModule.draw(t,e,i,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-.5*this.width,this.top=e-.5*this.height,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:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(74),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n){this._drawShape(t,"diamond",4,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_resizeShape",value:function(){if(void 0===this.width){var t=2*this.options.size;this.width=t,this.height=t,this.radius=.5*this.width}}},{key:"_drawShape",value:function(t,e,i,o,n,s,r){this._resizeShape(),this.left=o-this.width/2,this.top=n-this.height/2;var a=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,d=(s?h:a)/this.body.view.scale;if(t.lineWidth=Math.min(this.width,d),t.strokeStyle=s?this.options.color.highlight.border:r?this.options.color.hover.border:this.options.color.border,t.fillStyle=s?this.options.color.highlight.background:r?this.options.color.hover.background:this.options.color.background,t[e](o,n,this.options.size),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),d>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(t,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{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+3))}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(74),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n){this._drawShape(t,"circle",2,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),this.options.size}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t,e){if(void 0===this.width){var i=this.labelModule.getTextSize(t,e);this.width=1.5*i.width,this.height=2*i.height,this.width<this.height&&(this.width=this.height),this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n){this.resize(t,o),this.left=e-.5*this.width,this.top=i-.5*this.height;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;t.lineWidth=Math.min(this.width,a),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.ellipse(this.left,this.top,this.width,this.height),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),a>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),this.updateBoundingBox(e,i,t,o),this.labelModule.draw(t,e,i,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-.5*this.width,this.top=e-.5*this.height,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:"distanceToBorder",value:function(t,e){this.resize(t);var i=.5*this.width,o=.5*this.height,n=Math.sin(e)*i,s=Math.cos(e)*o;return i*o/Math.sqrt(n*n+s*s)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t){if(void 0===this.width){var e=5,i={width:Number(this.options.icon.size),height:Number(this.options.icon.size)};this.width=i.width+2*e,this.height=i.height+2*e,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n){if(this.resize(t),this.options.icon.size=this.options.icon.size||50,this.left=e-.5*this.width,this.top=i-.5*this.height,this._icon(t,e,i,o),void 0!==this.options.label){var s=5;this.labelModule.draw(t,e,i+.5*this.height+s,o)}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){var i=5;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+i)}}},{key:"_icon",value:function(t,e,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=(o?"bold ":"")+n+"px "+this.options.icon.face,t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t),t.fillText(this.options.icon.code,e,i),this.disableShadow(t)):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}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(70),d=o(h),l=function(t){function e(t,i,o,r){n(this,e);var a=s(this,Object.getPrototypeOf(e).call(this,t,i,o));return a.imageObj=r,a}return r(e,t),a(e,[{key:"resize",value:function(){this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n){if(this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,this.options.shapeProperties.useBorderWithImage===!0){var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;t.lineWidth=Math.min(this.width,a),t.beginPath(),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?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(),t.save(),a>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),t.closePath()}this._drawImageAtPosition(t),this._drawImageLabel(t,e,i,o||n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.resize(),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,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}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(74),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n){this._drawShape(t,"square",2,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(74),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n){this._drawShape(t,"star",4,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(68),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t,e){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(t,e);this.width=o.width+2*i,this.height=o.height+2*i,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n){this.resize(t,o||n),this.left=e-this.width/2,this.top=i-this.height/2,this.enableShadow(t),this.labelModule.draw(t,e,i,o||n),this.disableShadow(t),this.updateBoundingBox(e,i,t,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(74),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n){this._drawShape(t,"triangle",3,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(74),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n){this._drawShape(t,"triangleDown",3,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(85),a=o(r),h=i(66),d=o(h),l=i(1),c=i(9),u=i(11),p=function(){function t(e,i,o){var s=this;n(this,t),this.body=e,this.images=i,this.groups=o,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(t,e){s.add(e.items)},update:function(t,e){s.update(e.items)},remove:function(t,e){s.remove(e.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1},middle:{enabled:!1,scaleFactor:1},from:{enabled:!1,scaleFactor:1}},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"},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,o){if(e===t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("_forceDisableDynamicCurves",function(e){"dynamic"===e&&(e="continuous");var i=!1;for(var o in t.body.edges)if(t.body.edges.hasOwnProperty(o)){var n=t.body.edges[o],s=t.body.data.edges._data[o];if(void 0!==s){var r=s.smooth;void 0!==r&&r.enabled===!0&&"dynamic"===r.type&&(void 0===e?n.setOptions({smooth:!1}):n.setOptions({smooth:{type:e}}),i=!0)}}i===!0&&t.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){t.reconnectEdges(),t.markAllEdgesAsDirty()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){l.forEach(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){a["default"].parseOptions(this.options,t),void 0!==t.color&&this.markAllEdgesAsDirty();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){d["default"].parseOptions(this.options.font,t);for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&this.body.edges[o].updateLabelModule()}void 0===t.hidden&&void 0===t.physics&&e!==!0||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.edges;if(t instanceof c||t instanceof u)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new c,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new c}if(o&&l.forEach(this.edgesListeners,function(t,e){o.off(e,t)}),this.body.edges={},this.body.data.edges){l.forEach(this.edgesListeners,function(t,i){e.body.data.edges.on(i,t)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;n<t.length;n++){var s=t[n],r=i[s];r&&r.disconnect();var a=o.get(s,{showInternalIds:!0});i[s]=this.create(a)}e===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(t){for(var e=this.body.edges,i=this.body.data.edges,o=!1,n=0;n<t.length;n++){var s=t[n],r=i.get(s),a=e[s];void 0!==a?(a.disconnect(),o=a.setOptions(r)||o,a.connect()):(this.body.edges[s]=this.create(r),o=!0)}o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(t){for(var e=this.body.edges,i=0;i<t.length;i++){var o=t[i],n=e[o];void 0!==n&&(n.cleanup(),n.disconnect(),delete e[o])}this.body.emitter.emit("_dataChanged")}},{key:"refresh",value:function(){var t=this.body.edges;for(var e in t){var i=void 0;t.hasOwnProperty(e)&&(i=t[e]);var o=this.body.data.edges._data[e];void 0!==i&&void 0!==o&&i.setOptions(o)}}},{key:"create",value:function(t){return new a["default"](t,this.body,this.options)}},{key:"markAllEdgesAsDirty",value:function(){for(var t in this.body.edges)this.body.edges[t].edgeType.colorDirty=!0}},{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 o=i[t];o.from=null,o.to=null,o.connect()}}},{key:"getConnectedNodes",value:function(t){var e=[];if(void 0!==this.body.edges[t]){var i=this.body.edges[t];i.fromId&&e.push(i.fromId),i.toId&&e.push(i.toId)}return e}}]),t}();e["default"]=p},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(66),h=o(a),d=i(86),l=o(d),c=i(90),u=o(c),p=i(91),f=o(p),m=i(92),v=o(m),g=i(1),y=function(){function t(e,i,o){if(n(this,t),void 0===i)throw"No body provided";this.options=g.bridgeObject(o),this.globalOptions=o,this.body=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.colorDirty=!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 h["default"](this.body,this.options,!0),this.setOptions(e)}return r(t,[{key:"setOptions",value:function(e){if(e){this.colorDirty=!0,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)),this.updateLabelModule();var i=this.updateEdgeType();return this._setInteractionWidths(),this.connect(),void 0===e.hidden&&void 0===e.physics||(i=!0),i}}},{key:"updateLabelModule",value:function(){this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var t=!1,e=!0,i=this.options.smooth;return void 0!==this.edgeType&&(this.edgeType instanceof u["default"]&&i.enabled===!0&&"dynamic"===i.type&&(e=!1),this.edgeType instanceof l["default"]&&i.enabled===!0&&"cubicBezier"===i.type&&(e=!1),this.edgeType instanceof f["default"]&&i.enabled===!0&&"dynamic"!==i.type&&"cubicBezier"!==i.type&&(e=!1),this.edgeType instanceof v["default"]&&i.enabled===!1&&(e=!1),e===!0&&(t=this.cleanup())),e===!0?this.options.smooth.enabled===!0?"dynamic"===this.options.smooth.type?(t=!0,this.edgeType=new u["default"](this.options,this.body,this.labelModule)):"cubicBezier"===this.options.smooth.type?this.edgeType=new l["default"](this.options,this.body,this.labelModule):this.edgeType=new f["default"](this.options,this.body,this.labelModule):this.edgeType=new v["default"](this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,this.connected===!0?(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 o=this.options.scaling.customScalingFunction(t,e,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.width=this.options.scaling.min+o*n}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.edgeType.getViaNode(),i={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,this.options.arrows.from.enabled===!0&&(i.from=this.edgeType.getArrowData(t,"from",e,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.fromPoint=i.from.core)),this.options.arrows.to.enabled===!0&&(i.to=this.edgeType.getArrowData(t,"to",e,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.toPoint=i.to.core)),this.options.arrows.middle.enabled===!0&&(i.middle=this.edgeType.getArrowData(t,"middle",e,this.selected,this.hover)),this.edgeType.drawLine(t,this.selected,this.hover,e),this.drawArrows(t,i),this.drawLabel(t,e)}},{key:"drawArrows",value:function(t,e){this.options.arrows.from.enabled===!0&&this.edgeType.drawArrowHead(t,this.selected,this.hover,e.from),this.options.arrows.middle.enabled===!0&&this.edgeType.drawArrowHead(t,this.selected,this.hover,e.middle),this.options.arrows.to.enabled===!0&&this.edgeType.drawArrowHead(t,this.selected,this.hover,e.to)}},{key:"drawLabel",value:function(t,e){if(void 0!==this.options.label){var i=this.from,o=this.to,n=this.from.selected||this.to.selected||this.selected;if(i.id!=o.id){this.labelModule.pointToSelf=!1;var s=this.edgeType.getPoint(.5,e);t.save(),"horizontal"!==this.options.font.align&&(this.labelModule.calculateLabelSize(t,n,s.x,s.y),t.translate(s.x,this.labelModule.size.yLine),this._rotateForLabelAlignment(t)),this.labelModule.draw(t,s.x,s.y,n),t.restore()}else{this.labelModule.pointToSelf=!0;var r,a,h=this.options.selfReferenceSize;i.shape.width>i.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(t,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=t.left,a=t.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return e>h}return!1}},{key:"_rotateForLabelAlignment",value:function(t){var e=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(e,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),t.rotate(o)}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(g.selectiveDeepExtend(n,t,e,i),g.mergeOptions(t,e,"smooth",i,o),g.mergeOptions(t,e,"shadow",i,o),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:i===!0&&null===e.dashes&&(t.dashes=Object.create(o.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),g.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)):i===!0&&null===e.scaling&&(t.scaling=Object.create(o.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var r=e.arrows.toLowerCase();t.arrows.to.enabled=-1!=r.indexOf("to"),t.arrows.middle.enabled=-1!=r.indexOf("middle"),t.arrows.from.enabled=-1!=r.indexOf("from")}else{if("object"!==s(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));g.mergeOptions(t.arrows,e.arrows,"to",i,o.arrows),g.mergeOptions(t.arrows,e.arrows,"middle",i,o.arrows),g.mergeOptions(t.arrows,e.arrows,"from",i,o.arrows)}else i===!0&&null===e.arrows&&(t.arrows=Object.create(o.arrows));if(void 0!==e.color&&null!==e.color)if(t.color=g.deepExtend({},t.color,!0),g.isString(e.color))t.color.color=e.color,t.color.highlight=e.color,t.color.hover=e.color,t.color.inherit=!1;else{var a=!1;void 0!==e.color.color&&(t.color.color=e.color.color,a=!0),void 0!==e.color.highlight&&(t.color.highlight=e.color.highlight,a=!0),void 0!==e.color.hover&&(t.color.hover=e.color.hover,a=!0),void 0!==e.color.inherit&&(t.color.inherit=e.color.inherit),void 0!==e.color.opacity&&(t.color.opacity=Math.min(1,Math.max(0,e.color.opacity))),void 0===e.color.inherit&&a===!0&&(t.color.inherit=!1)}else i===!0&&null===e.color&&(t.color=g.bridgeObject(o.color));void 0!==e.font&&null!==e.font?h["default"].parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=g.bridgeObject(o.font))}}]),t}();e["default"]=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),d=i(87),l=o(d),c=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),h(e,[{key:"_line",value:function(t,e){var i=e[0],o=e[1];t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===e||void 0===i.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.bezierCurveTo(i.x,i.y,o.x,o.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t),t.stroke(),this.disableShadow(t)}},{key:"_getViaCoordinates",value:function(){var t=this.from.x-this.to.x,e=this.from.y-this.to.y,i=void 0,o=void 0,n=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(t)>Math.abs(e)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*t,n=this.to.x+r*t):(o=this.from.y-r*e,s=this.to.y+r*e,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{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,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6],h=a(r,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(t,e,i,o,n,s,d,l)}},{key:"getPoint",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=a(e,2),o=i[0],n=i[1],s=t,r=[];r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3);var h=r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,d=r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y;return{x:h,y:d}}}]),e}(l["default"]);e["default"]=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(88),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_getDistanceToBezierEdge",value:function(t,e,i,o,n,s,r,a){var h=1e9,d=void 0,l=void 0,c=void 0,u=void 0,p=void 0,f=t,m=e,v=[0,0,0,0];for(l=1;10>l;l++)c=.1*l,v[0]=Math.pow(1-c,3),v[1]=3*c*Math.pow(1-c,2),v[2]=3*Math.pow(c,2)*(1-c),v[3]=Math.pow(c,3),u=v[0]*t+v[1]*r.x+v[2]*a.x+v[3]*i,p=v[0]*e+v[1]*r.y+v[2]*a.y+v[3]*o,l>0&&(d=this._getDistanceToLine(f,m,u,p,n,s),h=h>d?d:h),f=u,m=p;return h}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(89),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_findBorderPositionBezier",value:function(t,e){var i,o,n,s,r,a=arguments.length<=2||void 0===arguments[2]?this._getViaCoordinates():arguments[2],h=10,d=0,l=0,c=1,u=.2,p=this.to,f=!1;for(t.id===this.from.id&&(p=this.from,f=!0);c>=l&&h>d;){var m=.5*(l+c);if(i=this.getPoint(m,a),o=Math.atan2(p.y-i.y,p.x-i.x),n=p.distanceToBorder(e,o),s=Math.sqrt(Math.pow(i.x-p.x,2)+Math.pow(i.y-p.y,2)),r=n-s,Math.abs(r)<u)break;0>r?f===!1?l=m:c=m:f===!1?c=m:l=m,d++}return i.t=m,i}},{key:"_getDistanceToBezierEdge",value:function(t,e,i,o,n,s,r){var a=1e9,h=void 0,d=void 0,l=void 0,c=void 0,u=void 0,p=t,f=e;for(d=1;10>d;d++)l=.1*d,c=Math.pow(1-l,2)*t+2*l*(1-l)*r.x+Math.pow(l,2)*i,u=Math.pow(1-l,2)*e+2*l*(1-l)*r.y+Math.pow(l,2)*o,d>0&&(h=this._getDistanceToLine(p,f,c,u,n,s),a=a>h?h:a),p=c,f=u;return a}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(1),a=function(){function t(e,i,n){o(this,t),this.body=i,this.labelModule=n,this.options={},this.setOptions(e),this.colorDirty=!0,this.color={},this.selectionWidth=2,this.hoverWidth=1.5,this.fromPoint=this.from,this.toPoint=this.to}return s(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,o){t.strokeStyle=this.getColor(t,e,i),t.lineWidth=this.getLineWidth(e,i),this.options.dashes!==!1?this._drawDashedLine(t,o):this._drawLine(t,o)}},{key:"_drawLine",value:function(t,e,i,o){if(this.from!=this.to)this._line(t,e,i,o);else{var s=this._getCircleData(t),r=n(s,3),a=r[0],h=r[1],d=r[2];this._circle(t,a,h,d)}}},{key:"_drawDashedLine",value:function(t,e,i,o){t.lineCap="round";var s=[5,5];if(Array.isArray(this.options.dashes)===!0&&(s=this.options.dashes),void 0!==t.setLineDash){if(t.save(),t.setLineDash(s),t.lineDashOffset=0,this.from!=this.to)this._line(t,e);else{var r=this._getCircleData(t),a=n(r,3),h=a[0],d=a[1],l=a[2];this._circle(t,h,d,l)}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,s);else{var c=this._getCircleData(t),u=n(c,3),p=u[0],f=u[1],m=u[2];this._circle(t,p,f,m)}this.enableShadow(t),t.stroke(),this.disableShadow(t)}}},{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){var e={},i={};if(this.from!=this.to)e=this._findBorderPosition(this.from,t),i=this._findBorderPosition(this.to,t);else{var o=this._getCircleData(t),s=n(o,3),r=s[0],a=s[1];s[2];e=this._findBorderPositionCircle(this.from,t,{x:r,y:a,low:.25,high:.6,direction:-1}),i=this._findBorderPositionCircle(this.from,t,{x:r,y:a,low:.6,high:.8,direction:1})}return{from:e,to:i}}},{key:"_getCircleData",value:function(t){var e=void 0,i=void 0,o=this.from,n=this.options.selfReferenceSize;return void 0!==t&&void 0===o.shape.width&&o.shape.resize(t),o.shape.width>o.shape.height?(e=o.x+.5*o.shape.width,i=o.y-n):(e=o.x+n,i=o.y-.5*o.shape.height),[e,i,n]}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,c=void 0,u=void 0,p=void 0,f=void 0,m=void 0,v=.05,g=.5*(s+r);r>=s&&h>d&&(g=.5*(s+r),c=this._pointOnCircle(o,n,l,g),u=Math.atan2(t.y-c.y,t.x-c.x),p=t.distanceToBorder(e,u),f=Math.sqrt(Math.pow(c.x-t.x,2)+Math.pow(c.y-t.y,2)),
+m=p-f,!(Math.abs(m)<v));)m>0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return c.t=g,c}},{key:"getLineWidth",value:function(t,e){return t===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):e===!0?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,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,e===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(t,e,i,o){this.enableShadow(t),t.beginPath(),t.arc(e,i,o,0,2*Math.PI,!1),t.stroke(),this.disableShadow(t)}},{key:"getDistanceToEdge",value:function(t,e,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(t,e,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),c=l[0],u=l[1],p=l[2],f=c-s,m=u-r;h=Math.abs(Math.sqrt(f*f+m*m)-p)}return this.labelModule.size.left<s&&this.labelModule.size.left+this.labelModule.size.width>s&&this.labelModule.size.top<r&&this.labelModule.size.top+this.labelModule.size.height>r?0:h}},{key:"_getDistanceToLine",value:function(t,e,i,o,n,s){var r=i-t,a=o-e,h=r*r+a*a,d=((n-t)*r+(s-e)*a)/h;d>1?d=1:0>d&&(d=0);var l=t+d*r,c=e+d*a,u=l-n,p=c-s;return Math.sqrt(u*u+p*p)}},{key:"getArrowData",value:function(t,e,i,o,s){var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,c=void 0,u=this.getLineWidth(o,s);if("from"===e?(h=this.from,d=this.to,l=.1,c=this.options.arrows.from.scaleFactor):"to"===e?(h=this.to,d=this.from,l=-.1,c=this.options.arrows.to.scaleFactor):(h=this.to,d=this.from,c=this.options.arrows.middle.scaleFactor),h!=d)if("middle"!==e)if(this.options.smooth.enabled===!0){a=this.findBorderPosition(h,t,{via:i});var p=this.getPoint(Math.max(0,Math.min(1,a.t+l)),i);r=Math.atan2(a.y-p.y,a.x-p.x)}else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.findBorderPosition(h,t);else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.getPoint(.5,i);else{var f=this._getCircleData(t),m=n(f,3),v=m[0],g=m[1],y=m[2];"from"===e?(a=this.findBorderPosition(this.from,t,{x:v,y:g,low:.25,high:.6,direction:-1}),r=-2*a.t*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===e?(a=this.findBorderPosition(this.from,t,{x:v,y:g,low:.6,high:1,direction:1}),r=-2*a.t*Math.PI+1.5*Math.PI-1.1*Math.PI):(a=this._pointOnCircle(v,g,y,.175),r=3.9269908169872414)}var b=15*c+3*u,w=a.x-.9*b*Math.cos(r),_=a.y-.9*b*Math.sin(r),x={x:w,y:_};return{point:a,core:x,angle:r,length:b}}},{key:"drawArrowHead",value:function(t,e,i,o){t.strokeStyle=this.getColor(t,e,i),t.fillStyle=t.strokeStyle,t.lineWidth=this.getLineWidth(e,i),t.arrow(o.point.x,o.point.y,o.angle,o.length),this.enableShadow(t),t.fill(),this.disableShadow(t)}},{key:"enableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor=this.options.shadow.color,t.shadowBlur=this.options.shadow.size,t.shadowOffsetX=this.options.shadow.x,t.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}}]),t}();e["default"]=a},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(88),d=o(h),l=function(t){function e(t,i,o){n(this,e);var r=s(this,Object.getPrototypeOf(e).call(this,t,i,o));return r._boundFunction=function(){r.positionBezierNode()},r.body.emitter.on("_repositionBezierNodes",r._boundFunction),r}return r(e,t),a(e,[{key:"setOptions",value:function(t){var e=!1;this.options.physics!==t.physics&&(e=!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(),e===!0&&(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||this.options.physics===!1?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):!1}},{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){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===e.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(e.x,e.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t),t.stroke(),this.disableShadow(t)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.via:arguments[1],i=t,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToBezierEdge(t,e,i,o,n,s,this.via)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(88),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_line",value:function(t,e){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===e.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(e.x,e.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t),t.stroke(),this.disableShadow(t)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var t=void 0,e=void 0,i=this.options.smooth.roundness,o=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===o||"diagonalCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s):this.from.y<this.to.y&&(this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y+i*s):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s)),"discrete"===o&&(t=i*s>n?this.from.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n):this.from.y<this.to.y&&(this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y+i*n):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n)),"discrete"===o&&(e=i*n>s?this.from.y:e));else if("straightCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(t=this.from.x,e=this.from.y<this.to.y?this.to.y-(1-i)*s:this.to.y+(1-i)*s):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(t=this.from.x<this.to.x?this.to.x-(1-i)*n:this.to.x+(1-i)*n,e=this.from.y);else if("horizontal"===o)t=this.from.x<this.to.x?this.to.x-(1-i)*n:this.to.x+(1-i)*n,e=this.from.y;else if("vertical"===o)t=this.from.x,e=this.from.y<this.to.y?this.to.y-(1-i)*s:this.to.y+(1-i)*s;else if("curvedCW"===o){n=this.to.x-this.from.x,s=this.from.y-this.to.y;var r=Math.sqrt(n*n+s*s),a=Math.PI,h=Math.atan2(s,n),d=(h+(.5*i+.5)*a)%(2*a);t=this.from.x+(.5*i+.5)*r*Math.sin(d),e=this.from.y+(.5*i+.5)*r*Math.cos(d)}else if("curvedCCW"===o){n=this.to.x-this.from.x,s=this.from.y-this.to.y;var l=Math.sqrt(n*n+s*s),c=Math.PI,u=Math.atan2(s,n),p=(u+(.5*-i+.5)*c)%(2*c);t=this.from.x+(.5*i+.5)*l*Math.sin(p),e=this.from.y+(.5*i+.5)*l*Math.cos(p)}else Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s,t=this.to.x<t?this.to.x:t):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s,t=this.to.x>t?this.to.x:t):this.from.y<this.to.y&&(this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y+i*s,t=this.to.x<t?this.to.x:t):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s,t=this.to.x>t?this.to.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.y<this.to.y&&(this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y+i*n,e=this.to.y<e?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n,e=this.to.y<e?this.to.y:e)));return{x:t,y:e}}},{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,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6];return this._getDistanceToBezierEdge(t,e,i,o,n,s,r)}},{key:"getPoint",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=t,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(89),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_line",value:function(t){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),t.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(t),t.stroke(),this.disableShadow(t)}},{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,o=this.from;t.id===this.from.id&&(i=this.from,o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),h=t.distanceToBorder(e,n),d=(a-h)/a,l={};return l.x=(1-d)*o.x+d*i.x,l.y=(1-d)*o.y+d*i.y,l}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToLine(t,e,i,o,n,s)}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(94),a=o(r),h=i(95),d=o(h),l=i(96),c=o(l),u=i(97),p=o(u),f=i(98),m=o(f),v=i(99),g=o(v),y=i(100),b=o(y),w=i(101),_=o(w),x=i(1),k=function(){function t(e){n(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},x.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return s(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),t.ready===!0&&t.startSimulation()}),this.body.emitter.on("startSimulation",function(){t.ready===!0&&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&&(t===!1?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):(this.physicsEnabled=!0,x.selectiveNotDeepExtend(["stabilization"],this.options,t),x.mergeOptions(this.options,t,"stabilization"),void 0===t.enabled&&(this.options.enabled=!0),this.options.enabled===!1&&(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 b["default"](this.body,this.physicsBody,t),this.edgesSolver=new p["default"](this.body,this.physicsBody,t),this.gravitySolver=new _["default"](this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new d["default"](this.body,this.physicsBody,t),this.edgesSolver=new p["default"](this.body,this.physicsBody,t),this.gravitySolver=new g["default"](this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new c["default"](this.body,this.physicsBody,t),this.edgesSolver=new m["default"](this.body,this.physicsBody,t),this.gravitySolver=new g["default"](this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new a["default"](this.body,this.physicsBody,t),this.edgesSolver=new p["default"](this.body,this.physicsBody,t),this.gravitySolver=new g["default"](this.body,this.physicsBody,t)),this.modelOptions=t}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?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(){this.physicsEnabled===!0&&this.options.enabled===!0?(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]?!0:arguments[0];this.stabilized=!0,t===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,t===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Date.now();this.physicsTick();var e=Date.now()-t;(e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?this.stabilizationIterations:arguments[0];(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var t=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=t*this.timestep:this.timestep/t<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/t))):(this.calculateForces(),this.moveNodes()),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.calculateForces(),this.moveNodes();this.stabilized===!0&&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)&&t[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(t[i].id);for(var o in e)e.hasOwnProperty(o)&&e[o].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(e[o].id);for(var n=0;n<this.physicsBody.physicsNodeIndices.length;n++){var s=this.physicsBody.physicsNodeIndices[n];this.physicsBody.forces[s]={x:0,y:0},void 0===this.physicsBody.velocities[s]&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var r in this.physicsBody.velocities)void 0===t[r]&&delete this.physicsBody.velocities[r]}},{key:"revert",value:function(){var t=Object.keys(this.previousStates),e=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var o=0;o<t.length;o++){var n=t[o];void 0!==e[n]?e[n].options.physics===!0&&(this.referenceState[n]={positions:{x:e[n].x,y:e[n].y}},i[n].x=this.previousStates[n].vx,i[n].y=this.previousStates[n].vy,e[n].x=this.previousStates[n].x,e[n].y=this.previousStates[n].y):delete this.previousStates[n]}}},{key:"_evaluateStepQuality",value:function(){var t=void 0,e=void 0,i=void 0,o=this.body.nodes,n=this.referenceState,s=.3;for(var r in this.referenceState)if(this.referenceState.hasOwnProperty(r)&&void 0!==o[r]&&(t=o[r].x-n[r].positions.x,e=o[r].y-n[r].positions.y,i=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),i>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;s<t.length;s++){var r=t[s],a=this._performStep(r,e);i=Math.max(i,a),o+=a}this.adaptiveTimestepEnabled=o/t.length<n,this.stabilized=i<this.options.minVelocity}},{key:"_performStep",value:function(t,e){var i=this.body.nodes[t],o=this.timestep,n=this.physicsBody.forces,s=this.physicsBody.velocities;if(this.previousStates[t]={x:i.x,y:i.y,vx:s[t].x,vy:s[t].y},i.options.fixed.x===!1){var r=this.modelOptions.damping*s[t].x,a=(n[t].x-r)/i.options.mass;s[t].x+=a*o,s[t].x=Math.abs(s[t].x)>e?s[t].x>0?e:-e:s[t].x,i.x+=s[t].x*o}else n[t].x=0,s[t].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[t].y,d=(n[t].y-h)/i.options.mass;s[t].y+=d*o,s[t].y=Math.abs(s[t].y)>e?s[t].y>0?e:-e:s[t].y,i.y+=s[t].y*o}else n[t].y=0,s[t].y=0;var l=Math.sqrt(Math.pow(s[t].x,2)+Math.pow(s[t].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&t[e].x&&t[e].y&&(this.freezeCache[e]={x:t[e].options.fixed.x,y:t[e].options.fixed.y},t[e].options.fixed.x=!0,t[e].options.fixed.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]?this.options.stabilization.iterations:arguments[0];return"number"!=typeof e&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),e=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return t._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var t=0;this.stabilized===!1&&t<this.options.stabilization.updateInterval&&this.stabilizationIterations<this.targetIterations;)this.physicsTick(),t++;this.stabilized===!1&&this.stabilizationIterations<this.targetIterations?(this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations}),setTimeout(this._stabilizationBatch.bind(this),0)):this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?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.body.nodes[this.physicsBody.physicsNodeIndices[e]],o=this.physicsBody.forces[this.physicsBody.physicsNodeIndices[e]],n=20,s=.03,r=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),a=Math.min(Math.max(5,r),15),h=3*a,d=x.HSVToHex((180-180*Math.min(1,Math.max(0,s*r)))/360,1,1);t.lineWidth=a,t.strokeStyle=d,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(i.x+n*o.x,i.y+n*o.y),t.stroke();var l=Math.atan2(o.y,o.x);t.fillStyle=d,t.arrow(i.x+n*o.x+Math.cos(l)*h,i.y+n*o.y+Math.sin(l)*h,l,h),t.fill()}}}]),t}();e["default"]=k},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=e,this.physicsBody=o,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return o(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=void 0,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(e,i);this.barnesHutTree=n;for(var s=0;o>s;s++)t=e[i[s]],t.options.mass>0&&(this._getForceContribution(n.root.children.NW,t),this._getForceContribution(n.root.children.NE,t),this._getForceContribution(n.root.children.SW,t),this._getForceContribution(n.root.children.SE,t))}}},{key:"_getForceContribution",value:function(t,e){if(t.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=t.centerOfMass.x-e.x,o=t.centerOfMass.y-e.y,n=Math.sqrt(i*i+o*o),n*t.calcSize>this.thetaInversed?this._calculateForces(n,i,o,e,t):4===t.childrenCount?(this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)):t.children.data.id!=e.id&&this._calculateForces(n,i,o,e,t)}}},{key:"_calculateForces",value:function(t,e,i,o,n){0===t&&(t=.1,e=t),this.overlapAvoidanceFactor<1&&(t=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,t-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(t,3),r=e*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i=void 0,o=e.length,n=t[e[0]].x,s=t[e[0]].y,r=t[e[0]].x,a=t[e[0]].y,h=1;o>h;h++){var d=t[e[h]].x,l=t[e[h]].y;t[e[h]].options.mass>0&&(n>d&&(n=d),d>r&&(r=d),s>l&&(s=l),l>a&&(a=l))}var c=Math.abs(r-n)-Math.abs(a-s);c>0?(s-=.5*c,a+=.5*c):(n+=.5*c,r-=.5*c);var u=1e-5,p=Math.max(u,Math.abs(r-n)),f=.5*p,m=.5*(n+r),v=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-f,maxX:m+f,minY:v-f,maxY:v+f},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var y=0;o>y;y++)i=t[e[y]],i.options.mass>0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(t,e){var i=t.mass+e.options.mass,o=1/i;t.centerOfMass.x=t.centerOfMass.x*t.mass+e.x*e.options.mass,t.centerOfMass.x*=o,t.centerOfMass.y=t.centerOfMass.y*t.mass+e.y*e.options.mass,t.centerOfMass.y*=o,t.mass=i;var n=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidth<n?n:t.maxWidth}},{key:"_placeInTree",value:function(t,e,i){1==i&&void 0!==i||this._updateBranchMass(t,e),t.children.NW.range.maxX>e.x?t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NW"):this._placeInRegion(t,e,"SW"):t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NE"):this._placeInRegion(t,e,"SE")}},{key:"_placeInRegion",value:function(t,e,i){switch(t.children[i].childrenCount){case 0:t.children[i].children.data=e,t.children[i].childrenCount=1,this._updateBranchMass(t.children[i],e);break;case 1:t.children[i].children.data.x===e.x&&t.children[i].children.data.y===e.y?(e.x+=this.seededRandom(),e.y+=this.seededRandom()):(this._splitBranch(t.children[i]),this._placeInTree(t.children[i],e));break;case 4:this._placeInTree(t.children[i],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=void 0,o=void 0,n=void 0,s=void 0,r=.5*t.size;switch(e){case"NW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY,s=t.range.minY+r;break;case"NE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY,s=t.range.minY+r;break;case"SW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY+r,s=t.range.maxY;break;case"SE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY+r,s=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},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}();e["default"]=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=e,this.physicsBody=o,this.setOptions(n)}return o(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,o,n,s,r,a,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,c=this.options.nodeDistance,u=-2/3/c,p=4/3,f=0;f<d.length-1;f++){r=h[d[f]];for(var m=f+1;m<d.length;m++)a=h[d[m]],t=a.x-r.x,e=a.y-r.y,i=Math.sqrt(t*t+e*e),0===i&&(i=.1*Math.random(),t=i),2*c>i&&(s=.5*c>i?1:u*i+p,s/=i,o=t*s,n=e*s,l[r.id].x-=o,l[r.id].y-=n,l[a.id].x+=o,l[a.id].y+=n)}}}]),t}();e["default"]=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=e,this.physicsBody=o,this.setOptions(n)}return o(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){var t,e,i,o,n,s,r,a,h,d,l=this.body.nodes,c=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,p=this.options.nodeDistance;for(h=0;h<c.length-1;h++)for(r=l[c[h]],d=h+1;d<c.length;d++)if(a=l[c[d]],r.level===a.level){t=a.x-r.x,e=a.y-r.y,i=Math.sqrt(t*t+e*e);var f=.05;s=p>i?-Math.pow(f*i,2)+Math.pow(f*p,2):0,0===i?i=.01:s/=i,o=t*s,n=e*s,u[r.id].x-=o,u[r.id].y-=n,u[a.id].x+=o,u[a.id].y+=n}}}]),t}();e["default"]=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=e,this.physicsBody=o,this.setOptions(n)}return o(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t=void 0,e=void 0,i=this.physicsBody.physicsEdgeIndices,o=this.body.edges,n=void 0,s=void 0,r=void 0,a=0;a<i.length;a++)e=o[i[a]],e.connected===!0&&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,n=e.to,s=e.edgeType.via,r=e.from,this._calculateSpringForce(n,s,.5*t),this._calculateSpringForce(s,r,.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 o=t.x-e.x,n=t.y-e.y,s=Math.max(Math.sqrt(o*o+n*n),.01),r=this.options.springConstant*(i-s)/s,a=o*r,h=n*r;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}();e["default"]=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=e,this.physicsBody=o,this.setOptions(n)}return o(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,o,n,s,r,a,h=this.body.edges,d=.5,l=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,p=0;p<c.length;p++){var f=c[p];u[f].springFx=0,u[f].springFy=0}for(var m=0;m<l.length;m++)e=h[l[m]],e.connected===!0&&(t=void 0===e.options.length?this.options.springLength:e.options.length,i=e.from.x-e.to.x,o=e.from.y-e.to.y,a=Math.sqrt(i*i+o*o),a=0===a?.01:a,r=this.options.springConstant*(t-a)/a,n=i*r,s=o*r,e.to.level!=e.from.level?(void 0!==u[e.toId]&&(u[e.toId].springFx-=n,u[e.toId].springFy-=s),void 0!==u[e.fromId]&&(u[e.fromId].springFx+=n,u[e.fromId].springFy+=s)):(void 0!==u[e.toId]&&(u[e.toId].x-=d*n,u[e.toId].y-=d*s),void 0!==u[e.fromId]&&(u[e.fromId].x+=d*n,u[e.fromId].y+=d*s)));for(var v,g,r=1,y=0;y<c.length;y++){var b=c[y];v=Math.min(r,Math.max(-r,u[b].springFx)),g=Math.min(r,Math.max(-r,u[b].springFy)),u[b].x+=v,u[b].y+=g}for(var w=0,_=0,x=0;x<c.length;x++){var k=c[x];w+=u[k].x,_+=u[k].y}for(var O=w/c.length,M=_/c.length,D=0;D<c.length;D++){var S=c[D];u[S].x-=O,u[S].y-=M}}}]),t}();e["default"]=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e,o,n){i(this,t),this.body=e,this.physicsBody=o,this.setOptions(n)}return o(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t=void 0,e=void 0,i=void 0,o=void 0,n=this.body.nodes,s=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=0;a<s.length;a++){var h=s[a];o=n[h],t=-o.x,e=-o.y,i=Math.sqrt(t*t+e*e),this._calculateForces(i,t,e,r,o)}}},{key:"_calculateForces",value:function(t,e,i,o,n){var s=0===t?0:this.options.centralGravity/t;o[n.id].x=e*s,o[n.id].y=i*s}}]),t}();e["default"]=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(94),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_calculateForces",value:function(t,e,i,o,n){0===t&&(t=.1*Math.random(),e=t),this.overlapAvoidanceFactor<1&&(t=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,t-o.shape.radius));var s=o.edges.length+1,r=this.options.gravitationalConstant*n.mass*o.options.mass*s/Math.pow(t,2),a=e*r,h=i*r;this.physicsBody.forces[o.id].x+=a,this.physicsBody.forces[o.id].y+=h}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(99),d=o(h),l=function(t){function e(t,i,o){return n(this,e),s(this,Object.getPrototypeOf(e).call(this,t,i,o))}return r(e,t),a(e,[{key:"_calculateForces",value:function(t,e,i,o,n){if(t>0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=e*r,o[n.id].y=i*r}}}]),e}(d["default"]);e["default"]=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(103),h=o(a),d=i(104),l=o(d),c=i(1),u=function(){function t(e){var i=this;n(this,t),this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},c.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return r(t,[{key:"setOptions",value:function(t){}},{key:"clusterByHubsize",value:function(t,e){void 0===t?t=this._getHubSize():"object"===("undefined"==typeof t?"undefined":s(t))&&(e=this._checkOptions(t),t=this._getHubSize());for(var i=[],o=0;o<this.body.nodeIndices.length;o++){var n=this.body.nodes[this.body.nodeIndices[o]];n.edges.length>=t&&i.push(n.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=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);for(var i={},o={},n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodeIndices[n],r=this.body.nodes[s],a=h["default"].cloneOptions(r);if(t.joinCondition(a)===!0){i[s]=this.body.nodes[s];for(var d=0;d<r.edges.length;d++){var l=r.edges[d];void 0===this.clusteredEdges[l.id]&&(o[l.id]=l)}}}this._cluster(i,o,t,e)}},{key:"clusterByEdgeCount",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];e=this._checkOptions(e);for(var o=[],n={},s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,c=0;c<this.body.nodeIndices.length;c++){var u={},p={};if(d=this.body.nodeIndices[c],void 0===n[d]){l=0,a=this.body.nodes[d],r=[];for(var f=0;f<a.edges.length;f++)s=a.edges[f],void 0===this.clusteredEdges[s.id]&&(s.toId!==s.fromId&&l++,r.push(s));if(l===t){for(var m=!0,v=0;v<r.length;v++){s=r[v];var g=this._getConnectedId(s,d);if(void 0===e.joinCondition)p[s.id]=s,u[d]=this.body.nodes[d],u[g]=this.body.nodes[g],n[d]=!0;else{var y=h["default"].cloneOptions(this.body.nodes[d]);if(e.joinCondition(y)!==!0){m=!1;break}p[s.id]=s,u[d]=this.body.nodes[d],n[d]=!0}}Object.keys(u).length>0&&Object.keys(p).length>0&&m===!0&&o.push({nodes:u,edges:p})}}}for(var b=0;b<o.length;b++)this._cluster(o[b].nodes,o[b].edges,e,!1);i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!0: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 o=this.body.nodes[t];e=this._checkOptions(e,o),void 0===e.clusterNodeProperties.x&&(e.clusterNodeProperties.x=o.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=o.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=o.options.fixed.x,e.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},s={},r=o.id,a=h["default"].cloneOptions(o);n[r]=o;for(var d=0;d<o.edges.length;d++){var l=o.edges[d];if(void 0===this.clusteredEdges[l.id]){var c=this._getConnectedId(l,r);if(void 0===this.clusteredNodes[c])if(c!==r)if(void 0===e.joinCondition)s[l.id]=l,n[c]=this.body.nodes[c];else{var u=h["default"].cloneOptions(this.body.nodes[c]);e.joinCondition(a,u)===!0&&(s[l.id]=l,n[c]=this.body.nodes[c])}else s[l.id]=l}}this._cluster(n,s,e,i)}},{key:"_createClusterEdges",value:function(t,e,i,o){for(var n=void 0,s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,u=Object.keys(t),p=[],f=0;f<u.length;f++){s=u[f],r=t[s];for(var m=0;m<r.edges.length;m++)n=r.edges[m],void 0===this.clusteredEdges[n.id]&&(n.toId==n.fromId?e[n.id]=n:n.toId==s?(a=i.id,d=n.fromId,l=d):(a=n.toId,d=i.id,l=a),void 0===t[l]&&p.push({edge:n,fromId:d,toId:a}))}for(var v=0;v<p.length;v++){var g=p[v].edge,y=h["default"].cloneOptions(g,"edge");c.deepExtend(y,o),y.from=p[v].fromId,y.to=p[v].toId,y.id="clusterEdge:"+c.randomUUID();var b=this.body.functions.createEdge(y);b.clusteringEdgeReplacingId=g.id,this.body.edges[b.id]=b,b.connect(),this._backupEdgeOptions(g),g.setOptions({physics:!1,hidden:!0})}}},{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 o=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];if(!(Object.keys(t).length<2)){for(var n in t)if(t.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var s=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var r=[];for(var a in t)if(t.hasOwnProperty(a)){var d=h["default"].cloneOptions(t[a]);r.push(d)}var u=[];for(var p in e)if(e.hasOwnProperty(p)&&"clusterEdge:"!==p.substr(0,12)){var f=h["default"].cloneOptions(e[p],"edge");u.push(f)}if(s=i.processProperties(s,r,u),!s)throw new Error("The processProperties function does not return properties!")}void 0===s.id&&(s.id="cluster:"+c.randomUUID());var m=s.id;void 0===s.label&&(s.label="cluster");var v=void 0;void 0===s.x&&(v=this._getClusterPosition(t),s.x=v.x),void 0===s.y&&(void 0===v&&(v=this._getClusterPosition(t)),s.y=v.y),s.id=m;var g=this.body.functions.createNode(s,l["default"]);g.isCluster=!0,g.containedNodes=t,g.containedEdges=e,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[s.id]=g,this._createClusterEdges(t,e,s,i.clusterEdgeProperties);for(var y in e)if(e.hasOwnProperty(y)&&void 0!==this.body.edges[y]){var b=this.body.edges[y];this._backupEdgeOptions(b),b.setOptions({physics:!1,hidden:!0})}for(var w in t)t.hasOwnProperty(w)&&(this.clusteredNodes[w]={clusterId:s.id,node:this.body.nodes[w]},this.body.nodes[w].setOptions({hidden:!0,physics:!1}));s.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics,hidden:t.options.hidden})}},{key:"_restoreEdge",value:function(t){var e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics,hidden:e.hidden}),delete this.clusteredEdges[t.id])}},{key:"isCluster",value:function(t){return void 0!==this.body.nodes[t]?this.body.nodes[t].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(t){for(var e=Object.keys(t),i=t[e[0]].x,o=t[e[0]].x,n=t[e[0]].y,s=t[e[0]].y,r=void 0,a=1;a<e.length;a++)r=t[e[a]],i=r.x<i?r.x:i,o=r.x>o?r.x:o,n=r.y<n?r.y:n,s=r.y>s?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[t])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[t].containedNodes)return void console.log("The node:"+t+" is not a cluster.");var o=this.body.nodes[t],n=o.containedNodes,s=o.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=e.releaseFunction(a,r);for(var p in n)if(n.hasOwnProperty(p)){var f=this.body.nodes[p];void 0!==u[p]&&(f.x=void 0===u[p].x?o.x:u[p].x,f.y=void 0===u[p].y?o.y:u[p].y)}}else for(var m in n)if(n.hasOwnProperty(m)){var v=this.body.nodes[m];v=n[m],v.options.fixed.x===!1&&(v.x=o.x),v.options.fixed.y===!1&&(v.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var y=this.body.nodes[g];y.vx=o.vx,y.vy=o.vy,y.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var b=[],w=0;w<o.edges.length;w++)b.push(o.edges[w]);for(var _=0;_<b.length;_++){var x=b[_],k=this._getConnectedId(x,t);if(void 0!==this.clusteredNodes[k]){var O=this.body.nodes[this.clusteredNodes[k].clusterId],M=this.body.edges[x.clusteringEdgeReplacingId];if(void 0!==M){O.containedEdges[M.id]=M,delete s[M.id];var D=M.fromId,S=M.toId;M.toId==k?S=this.clusteredNodes[k].clusterId:D=this.clusteredNodes[k].clusterId;var C=h["default"].cloneOptions(M,"edge");c.deepExtend(C,O.clusterEdgeProperties);var T="clusterEdge:"+c.randomUUID();c.deepExtend(C,{from:D,to:S,hidden:!1,physics:!0,id:T});var E=this.body.functions.createEdge(C);E.clusteringEdgeReplacingId=M.id,this.body.edges[T]=E,this.body.edges[T].connect()}}else{var P=this.body.edges[x.clusteringEdgeReplacingId];void 0!==P&&this._restoreEdge(P)}x.cleanup(),x.disconnect(),delete this.body.edges[x.id]}for(var I in s)s.hasOwnProperty(I)&&this._restoreEdge(s[I]);delete this.body.nodes[t],i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(t){var e=[];if(this.isCluster(t)===!0){var i=this.body.nodes[t].containedNodes;for(var o in i)i.hasOwnProperty(o)&&e.push(this.body.nodes[o].id)}return e}},{key:"findNode",value:function(t){for(var e=[],i=100,o=0;void 0!==this.clusteredNodes[t]&&i>o;)e.push(this.body.nodes[t].id),t=this.clusteredNodes[t].clusterId,o++;return e.push(this.body.nodes[t].id),e.reverse(),e}},{key:"_getConnectedId",value:function(t,e){return t.toId!=e?t.toId:t.fromId!=e?t.fromId:t.fromId}},{key:"_getHubSize",value:function(){for(var t=0,e=0,i=0,o=0,n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodes[this.body.nodeIndices[n]];s.edges.length>o&&(o=s.edges.length),t+=s.edges.length,e+=Math.pow(s.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),h=Math.floor(t+2*a);return h>o&&(h=o),h}}]),t}();e["default"]=u},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(1),r=function(){function t(){o(this,t)}return n(t,null,[{key:"getRange",value:function(t){var e,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)e=t[i[a]],s>e.shape.boundingBox.left&&(s=e.shape.boundingBox.left),r<e.shape.boundingBox.right&&(r=e.shape.boundingBox.right),o>e.shape.boundingBox.top&&(o=e.shape.boundingBox.top),n<e.shape.boundingBox.bottom&&(n=e.shape.boundingBox.bottom);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"getRangeCore",value:function(t){var e,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)e=t[i[a]],s>e.x&&(s=e.x),r<e.x&&(r=e.x),o>e.y&&(o=e.y),n<e.y&&(n=e.y);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{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?(s.deepExtend(i,t.options,!0),i.x=t.x,i.y=t.y,i.amountOfConnections=t.edges.length):s.deepExtend(i,t.options,!0),i}}]),t}();e["default"]=r},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=i(65),h=o(a),d=function(t){function e(t,i,o,r,a){n(this,e);var h=s(this,Object.getPrototypeOf(e).call(this,t,i,o,r,a));return h.isCluster=!0,h.containedNodes={},h.containedEdges={},h}return r(e,t),e}(h["default"]);e["default"]=d},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();"undefined"!=typeof window&&(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame);var s=i(1),r=function(){function t(e,i){o(this,t),this.body=e,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.pixelRatio=void 0,this.allowRedraw=!0,this.dragging=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideNodesOnDrag:!1},s.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return n(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("dragStart",function(){t.dragging=!0}),this.body.emitter.on("dragEnd",function(){return t.dragging=!1}),this.body.emitter.on("_resizeNodes",function(){return t._resizeNodes()}),this.body.emitter.on("_redraw",function(){t.renderingActive===!1&&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,t.requiresTimeout===!0?clearTimeout(t.renderTimer):cancelAnimationFrame(t.renderTimer),t.body.emitter.off()})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(e,this.options,t)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){t._redraw(!1)},0):window.requestAnimationFrame(function(){t._redraw(!1)}))}},{key:"_redraw",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var e=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,o),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(),t===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(e),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(e,t),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),t===!0&&e.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var t=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(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),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=this.body.nodes,i=void 0;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l<o.length;l++)n=i[o[l]],n.isSelected()?s.push(o[l]):e===!0?n.draw(t):n.isBoundingBoxOverlappingWith(d)===!0?n.draw(t):n.updateBoundingBox(t,n.selected);for(var c=0;c<s.length;c++)n=i[s[c]],n.draw(t)}},{key:"_drawEdges",value:function(t){for(var e=this.body.edges,i=this.body.edgeIndices,o=void 0,n=0;n<i.length;n++)o=e[i[n]],o.connected===!0&&o.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}();e["default"]=r},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(20),r=i(28),a=i(1),h=function(){function t(e){o(this,t),this.body=e,this.pixelRatio=1,this.resizeTimer=void 0,this.resizeFunction=this._onResize.bind(this),this.cameraState={},this.initialized=!1,this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},a.extend(this.options,this.defaultOptions),this.bindEventListeners()}return n(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){var i=["width","height","autoResize"];a.selectiveDeepExtend(i,this.options,t)}this.options.autoResize===!0&&(this._cleanUp(),this.resizeTimer=setInterval(function(){var t=e.setSize();t===!0&&e.body.emitter.emit("_requestRedraw")},1e3),this.resizeFunction=this._onResize.bind(this),a.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),a.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var t=arguments.length<=0||void 0===arguments[0]?this.pixelRatio:arguments[0];this.initialized===!0&&(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 o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.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){var t=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),
+this.frame.canvas.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.frame.canvas.appendChild(e)}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 s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_ALL}),r.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("mousewheel",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("DOMMouseScroll",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 s(this.frame),r.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(){var t=arguments.length<=0||void 0===arguments[0]?this.options.width:arguments[0],e=arguments.length<=1||void 0===arguments[1]?this.options.height:arguments[1];t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),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,i=!0):(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._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(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(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{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}();e["default"]=h},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(103),a=o(r),h=i(1),d=function(){function t(e,i){var o=this;n(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(){o.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return s(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=arguments.length<=0||void 0===arguments[0]?{nodes:[]}:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=void 0;if(void 0!==t.nodes&&0!==t.nodes.length||(t.nodes=this.body.nodeIndices),e===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(t,!1);i=a["default"].getRange(this.body.nodes,t.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a["default"].getRange(this.body.nodes,t.nodes);var l=1.1*Math.abs(i.maxX-i.minX),c=1.1*Math.abs(i.maxY-i.minY),u=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/c;o=p>=u?u:p}o>1?o=1:0===o&&(o=1);var f=a["default"].findCenter(i),m={position:f,scale:o,animation:t.animation};this.moveTo(m)}},{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){return void 0===t?void(t={}):(void 0===t.offset&&(t.offset={x:0,y:0}),void 0===t.offset.x&&(t.offset.x=0),void 0===t.offset.y&&(t.offset.y=0),void 0===t.scale&&(t.scale=this.body.view.scale),void 0===t.position&&(t.position=this.getViewPosition()),void 0===t.animation&&(t.animation={duration:0}),t.animation===!1&&(t.animation={duration:0}),t.animation===!0&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),void this.animateView(t))}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),t.locked===!0&&(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={x:e.x-t.position.x,y:e.y-t.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+t.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+t.offset.y},0===t.animation.duration?void 0!=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={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.x,y:e.y-t.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{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]?!1:arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=t===!0?1:this.easingTime;var e=h.easingFunctions[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,void 0!=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}();e["default"]=d},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(109),a=o(r),h=i(110),d=o(h),l=i(1),c=function(){function t(e,i,o){n(this,t),this.body=e,this.canvas=i,this.selectionHandler=o,this.navigationHandler=new a["default"](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},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(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){var e=["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];l.selectiveNotDeepExtend(e,this.options,t),l.mergeOptions(this.options,t,"keyboard"),t.tooltip&&(l.extend(this.options.tooltip,t.tooltip),t.tooltip.color&&(this.options.tooltip.color=l.parseColor(t.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(t){return{x:t.x-l.getAbsoluteLeft(this.canvas.frame.canvas),y:t.y-l.getAbsoluteTop(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]?!1:arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),c=l.nodesChanged,u=l.edgesChanged,p=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",e,t),r=!0,p=!0):c===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),this.selectionHandler._generateClickEvent("selectNode",e,t),p=!0,r=!0):0>h-n&&(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),r=!0),a-o>0&&p===!1?(this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a>0&&u===!0?(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):0>a-o&&(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",e,t)}},{key:"_determineIfDifferent",value:function(t,e){for(var i=!1,o=!1,n=0;n<t.nodes.length;n++)-1===e.nodes.indexOf(t.nodes[n])&&(i=!0);for(var s=0;s<e.nodes.length;s++)-1===t.nodes.indexOf(t.nodes[s])&&(i=!0);for(var r=0;r<t.edges.length;r++)-1===e.edges.indexOf(t.edges[r])&&(o=!0);for(var a=0;a<e.edges.length;a++)-1===t.edges.indexOf(t.edges[a])&&(o=!0);return{nodesChanged:i,edgesChanged:o}}},{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=l.extend({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==e&&this.options.dragNodes===!0){this.drag.nodeId=e.id,e.isSelected()===!1&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(e)),this.selectionHandler._generateClickEvent("dragStart",t,this.drag.pointer);var i=this.selectionHandler.selectionObj.nodes;for(var o in i)if(i.hasOwnProperty(o)){var n=i[o],s={id:n.id,node:n,x:n.x,y:n.y,xFixed:n.options.fixed.x,yFixed:n.options.fixed.y};n.options.fixed.x=!0,n.options.fixed.y=!0,this.drag.selection.push(s)}}else this.selectionHandler._generateClickEvent("dragStart",t,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(t){var e=this;if(this.drag.pinched!==!0){this.body.emitter.emit("unlockNode");var i=this.getPointer(t.center),o=this.drag.selection;if(o&&o.length&&this.options.dragNodes===!0)!function(){e.selectionHandler._generateClickEvent("dragging",t,i);var n=i.x-e.drag.pointer.x,s=i.y-e.drag.pointer.y;o.forEach(function(t){var i=t.node;t.xFixed===!1&&(i.x=e.canvas._XconvertDOMtoCanvas(e.canvas._XconvertCanvasToDOM(t.x)+n)),t.yFixed===!1&&(i.y=e.canvas._YconvertDOMtoCanvas(e.canvas._YconvertCanvasToDOM(t.y)+s))}),e.body.emitter.emit("startSimulation")}();else if(this.options.dragView===!0){if(this.selectionHandler._generateClickEvent("dragging",t,i,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(t);var n=i.x-this.drag.pointer.x,s=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+s},this.body.emitter.emit("_redraw")}}}},{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(this.options.zoomView===!0){var i=this.body.view.scale;1e-5>t&&(t=1e-5),t>10&&(t=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=t/i,r=(1-s)*e.x+n.x*s,a=(1-s)*e.y+n.y*s;if(this.body.view.scale=t,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),t>i?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}}},{key:"onMouseWheel",value:function(t){if(this.options.zoomView===!0){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0!==e){var i=this.body.view.scale,o=e/10;0>e&&(o/=1-o),i*=1+o;var n=this.getPointer({x:t.clientX,y:t.clientY});this.zoom(i,n)}t.preventDefault()}}},{key:"onMouseMove",value:function(t){var e=this,i=this.getPointer({x:t.clientX,y:t.clientY}),o=!1;if(void 0!==this.popup&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(o=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),o===!1&&(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))),this.options.hover===!0){var n=this.selectionHandler.getNodeAt(i);void 0===n&&(n=this.selectionHandler.getEdgeAt(i)),this.selectionHandler.hoverObject(n)}}},{key:"_checkShowPopup",value:function(t){var e=this.canvas._XconvertDOMtoCanvas(t.x),i=this.canvas._YconvertDOMtoCanvas(t.y),o={left:e,top:i,right:e,bottom:i},n=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,h=this.body.nodes,l=void 0,c=[],u=0;u<a.length;u++)l=h[a[u]],l.isOverlappingWith(o)===!0&&void 0!==l.getTitle()&&c.push(a[u]);c.length>0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var p=this.body.edgeIndices,f=this.body.edges,m=void 0,v=[],g=0;g<p.length;g++)m=f[p[g]],m.isOverlappingWith(o)===!0&&m.connected===!0&&void 0!==m.getTitle()&&v.push(p[g]);v.length>0&&(this.popupObj=f[v[v.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d["default"](this.canvas.frame)),this.popup.popupTargetType=r,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]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),i===!0)){var o=this.selectionHandler.getNodeAt(t);i=o.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));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}();e["default"]=c},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=(i(1),i(20)),r=i(28),a=i(23),h=function(){function t(e,i){var n=this;o(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 n(t,[{key:"setOptions",value:function(t){void 0!==t&&(this.options=t,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&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 o=0;o<e.length;o++){this.navigationDOM[e[o]]=document.createElement("div"),this.navigationDOM[e[o]].className="vis-button vis-"+e[o],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[o]]);var n=new s(this.navigationDOM[e[o]]);"_fit"===i[o]?r.onTouch(n,this._fit.bind(this)):r.onTouch(n,this.bindToRedraw.bind(this,i[o])),this.navigationHammers.push(n)}var a=new s(this.canvas.frame);r.onRelease(a,function(){t._stopMovement()}),this.navigationHammers.push(a),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(){this.body.view.scale*=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{key:"_zoomOut",value:function(){this.body.view.scale/=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var t=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(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}();e["default"]=h},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(e){i(this,t),this.container=e,this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-network-tooltip",this.container.appendChild(this.frame)}return o(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),t===!0){var e=this.frame.clientHeight,i=this.frame.clientWidth,o=this.frame.parentNode.clientHeight,n=this.frame.parentNode.clientWidth,s=this.y-e;s+e+this.padding>o&&(s=o-e-this.padding),s<this.padding&&(s=this.padding);var r=this.x;r+i+this.padding>n&&(r=n-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.visibility="hidden"}}]),t}();e["default"]=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(65),a=o(r),h=i(85),d=o(h),l=i(1),c=function(){function t(e,i){var o=this;n(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},l.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){o.updateSelection()})}return s(t,[{key:"setOptions",value:function(t){if(void 0!==t){var e=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];l.selectiveDeepExtend(e,this.options,t)}}},{key:"selectOnPoint",value:function(t){var e=!1;if(this.options.selectable===!0){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(this.options.selectable===!0){var i=this.getNodeAt(t)||this.getEdgeAt(t);void 0!==i&&(e=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return e}},{key:"_generateClickEvent",value:function(t,e,i,o){var n=arguments.length<=4||void 0===arguments[4]?!1:arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=e,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(t,s)}},{key:"selectObject",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.options.selectConnectedEdges:arguments[1];return void 0!==t?(t instanceof a["default"]&&e===!0&&this._selectConnectedEdges(t),t.select(),this._addToSelection(t),!0):!1}},{key:"deselectObject",value:function(t){t.isSelected()===!0&&(t.selected=!1,this._removeFromSelection(t))}},{key:"_getAllNodesOverlappingWith",value:function(t){for(var e=[],i=this.body.nodes,o=0;o<this.body.nodeIndices.length;o++){var n=this.body.nodeIndices[o];i[n].isOverlappingWith(t)&&e.push(n)}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]?!0:arguments[1],i=this._pointerToPositionObject(t),o=this._getAllNodesOverlappingWith(i);
+return o.length>0?e===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,o=0;o<this.body.edgeIndices.length;o++){var n=this.body.edgeIndices[o];i[n].isOverlappingWith(t)&&e.push(n)}}},{key:"_getAllEdgesOverlappingWith",value:function(t){var e=[];return this._getEdgesOverlappingWith(t,e),e}},{key:"getEdgeAt",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],i=this._pointerToPositionObject(t),o=this._getAllEdgesOverlappingWith(i);return o.length>0?e===!0?this.body.edges[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_addToSelection",value:function(t){t instanceof a["default"]?this.selectionObj.nodes[t.id]=t:this.selectionObj.edges[t.id]=t}},{key:"_addToHover",value:function(t){t instanceof a["default"]?this.hoverObj.nodes[t.id]=t:this.hoverObj.edges[t.id]=t}},{key:"_removeFromSelection",value:function(t){t instanceof a["default"]?(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:"blurObject",value:function(t){t.hover===!0&&(t.hover=!1,t instanceof a["default"]?this.body.emitter.emit("blurNode",{node:t.id}):this.body.emitter.emit("blurEdge",{edge:t.id}))}},{key:"hoverObject",value:function(t){var e=!1;for(var i in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(i)&&(void 0===t||t instanceof a["default"]&&t.id!=i||t instanceof d["default"])&&(this.blurObject(this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],e=!0);for(var o in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(o)&&(e===!0?(this.hoverObj.edges[o].hover=!1,delete this.hoverObj.edges[o]):void 0===t&&(this.blurObject(this.hoverObj.edges[o]),delete this.hoverObj.edges[o],e=!0));void 0!==t&&(t.hover===!1&&(t.hover=!0,this._addToHover(t),e=!0,t instanceof a["default"]?this.body.emitter.emit("hoverNode",{node:t.id}):this.body.emitter.emit("hoverEdge",{edge:t.id})),t instanceof a["default"]&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(t)),e===!0&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){var t=this.getSelectedNodes(),e=this.getSelectedEdges();return{nodes:t,edges:e}}},{key:"getSelectedNodes",value:function(){var t=[];if(this.options.selectable===!0)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(this.options.selectable===!0)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=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=void 0,o=void 0;if(!t||!t.nodes&&!t.edges)throw"Selection must be an object with nodes and/or edges properties";if((e.unselectAll||void 0===e.unselectAll)&&this.unselectAll(),t.nodes)for(i=0;i<t.nodes.length;i++){o=t.nodes[i];var n=this.body.nodes[o];if(!n)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(n,e.highlightEdges)}if(t.edges)for(i=0;i<t.edges.length;i++){o=t.edges[i];var s=this.body.edges[o];if(!s)throw new RangeError('Edge with id "'+o+'" not found');this.selectObject(s)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!0: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])}}]),t}();e["default"]=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(103),d=o(h),l=i(1),c=function(){function t(e){n(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,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return a(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()})}},{key:"setOptions",value:function(t,e){if(void 0!==t){var i=this.options.hierarchical.enabled;if(l.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,t),l.mergeOptions(this.options,t,"hierarchical"),void 0!==t.randomSeed&&(this.initialRandomSeed=t.randomSeed),this.options.hierarchical.enabled===!0)return i===!0&&this.body.emitter.emit("refresh",!0),"RL"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.options.hierarchical.levelSeparation>0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(i===!0)return this.body.emitter.emit("refresh"),l.deepExtend(e,this.optionsBackup)}return e}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(t){if(this.options.hierarchical.enabled===!0){void 0===t.physics||t.physics===!0?(t.physics={enabled:void 0===this.optionsBackup.physics.enabled?!0:this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled?!0:this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===r(t.physics)?(this.optionsBackup.physics.enabled=void 0===t.physics.enabled?!0:t.physics.enabled,this.optionsBackup.physics.solver=t.physics.solver||"barnesHut",t.physics.solver="hierarchicalRepulsion"):t.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",t.physics={solver:"hierarchicalRepulsion"});var e="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(e="vertical"),void 0===t.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1}):void 0===t.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1):"boolean"==typeof t.edges.smooth?(this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:e}):(void 0!==t.edges.smooth.type&&"dynamic"!==t.edges.smooth.type&&(e=t.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===t.edges.smooth.enabled?!0:t.edges.smooth.enabled,type:void 0===t.edges.smooth.type?"dynamic":t.edges.smooth.type,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0===t.edges.smooth.forceDirection?!1:t.edges.smooth.forceDirection},t.edges.smooth={enabled:void 0===t.edges.smooth.enabled?!0:t.edges.smooth.enabled,type:e,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0===t.edges.smooth.forceDirection?!1:t.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",e)}return t}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"positionInitially",value:function(t){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var e=0;e<t.length;e++){var i=t[e],o=1*t.length+10,n=2*Math.PI*this.seededRandom();void 0===i.x&&(i.x=o*Math.cos(n)),void 0===i.y&&(i.y=o*Math.sin(n))}}}},{key:"layoutNetwork",value:function(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){for(var t=0,e=0;e<this.body.nodeIndices.length;e++){var i=this.body.nodes[this.body.nodeIndices[e]];i.predefinedPosition===!0&&(t+=1)}if(t<.5*this.body.nodeIndices.length){var o=10,n=0,s=100;if(this.body.nodeIndices.length>s){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)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*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l<this.body.nodeIndices.length;l++)this.body.nodes[this.body.nodeIndices[l]].x+=(.5-this.seededRandom())*d,this.body.nodes[this.body.nodeIndices[l]].y+=(.5-this.seededRandom())*d;this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var t=d["default"].getRangeCore(this.body.nodes,this.body.nodeIndices),e=d["default"].findCenter(t),i=0;i<this.body.nodeIndices.length;i++)this.body.nodes[this.body.nodeIndices[i]].x-=e.x,this.body.nodes[this.body.nodeIndices[i]].y-=e.y}},{key:"_declusterAll",value:function(){for(var t=!0;t===!0;){t=!1;for(var e=0;e<this.body.nodeIndices.length;e++)this.body.nodes[this.body.nodeIndices[e]].isCluster===!0&&(t=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[e],{},!1));t===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){var t=void 0,e=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(t=this.body.nodes[e],void 0===t.options.x&&void 0===t.options.y&&(o=!1),void 0!==t.options.level?(i=!0,this.hierarchicalLevels[e]=t.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var t=this,e=!1,i={},o=function(){for(var e=a(),i=0;i<e.length-1;i++){var o=e[i].max-e[i+1].min;n(i+1,o+t.options.hierarchical.treeSpacing)}},n=function(e,i){for(var o in t.hierarchicalTrees)if(t.hierarchicalTrees.hasOwnProperty(o)&&t.hierarchicalTrees[o]===e){var n=t.body.nodes[o],s=t._getPositionForHierarchy(n);t._setPositionForHierarchy(n,s+i,void 0,!0)}},r=function(e){var i=1e9,o=-1e9;for(var n in t.hierarchicalTrees)if(t.hierarchicalTrees.hasOwnProperty(n)&&t.hierarchicalTrees[n]===e){var s=t._getPositionForHierarchy(t.body.nodes[n]);i=Math.min(s,i),o=Math.max(s,o)}return{min:i,max:o}},a=function(){for(var e=[],i=0;i<=t.treeIndex;i++)e.push(r(i));return e},h=function w(e,i){if(i[e.id]=!0,t.hierarchicalChildrenReference[e.id]){var o=t.hierarchicalChildrenReference[e.id];if(o.length>0)for(var n=0;n<o.length;n++)w(t.body.nodes[o[n]],i)}},d=function(e){var i=arguments.length<=1||void 0===arguments[1]?1e9:arguments[1],o=1e9,n=1e9,r=1e9,a=-1e9;for(var h in e)if(e.hasOwnProperty(h)){var d=t.body.nodes[h],l=t.hierarchicalLevels[d.id],c=t._getPositionForHierarchy(d),u=t._getSpaceAroundNode(d,e),p=s(u,2),f=p[0],m=p[1];o=Math.min(f,o),n=Math.min(m,n),i>=l&&(r=Math.min(c,r),a=Math.max(c,a))}return[r,a,o,n]},l=function _(e){var i=t.hierarchicalLevels[e];if(t.hierarchicalChildrenReference[e]){var o=t.hierarchicalChildrenReference[e];if(o.length>0)for(var n=0;n<o.length;n++)i=Math.max(i,_(o[n]))}return i},c=function(t,e){var i=l(t.id),o=l(e.id);return Math.min(i,o)},u=function(e,i){var o=t.hierarchicalParentReference[e.id],n=t.hierarchicalParentReference[i.id];if(void 0===o||void 0===n)return!1;for(var s=0;s<o.length;s++)for(var r=0;r<n.length;r++)if(o[s]==n[r])return!0;return!1},p=function(e,i,o){for(var n=0;n<i.length;n++){var s=i[n],r=t.distributionOrdering[s];if(r.length>1)for(var a=0;a<r.length-1;a++)u(r[a],r[a+1])===!0&&t.hierarchicalTrees[r[a].id]===t.hierarchicalTrees[r[a+1].id]&&e(r[a],r[a+1],o)}},f=function(i,o){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],r=t._getPositionForHierarchy(i),a=t._getPositionForHierarchy(o),l=Math.abs(a-r);if(l>t.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var p={};p[o.id]=!0,h(i,u),h(o,p);var f=c(i,o),m=d(u,f),v=s(m,4),g=(v[0],v[1]),y=(v[2],v[3],d(p,f)),b=s(y,4),w=b[0],_=(b[1],b[2]),x=(b[3],Math.abs(g-w));if(x>t.options.hierarchical.nodeSpacing){var k=g-w+t.options.hierarchical.nodeSpacing;k<-_+t.options.hierarchical.nodeSpacing&&(k=-_+t.options.hierarchical.nodeSpacing),0>k&&(t._shiftBlock(o.id,k),e=!0,n===!0&&t._centerParent(o))}}},m=function(o,n){for(var r=n.id,a=n.edges,l=t.hierarchicalLevels[n.id],c=t.options.hierarchical.levelSeparation*t.options.hierarchical.levelSeparation,u={},p=[],f=0;f<a.length;f++){var m=a[f];if(m.toId!=m.fromId){var v=m.toId==r?m.from:m.to;u[a[f].id]=v,t.hierarchicalLevels[v.id]<l&&p.push(m)}}var g=function(e,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=t._getPositionForHierarchy(u[i[n].id])-e;o+=s/Math.sqrt(s*s+c)}return o},y=function(e,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=t._getPositionForHierarchy(u[i[n].id])-e;o-=c*Math.pow(s*s+c,-1.5)}return o},b=function(e,i){for(var o=t._getPositionForHierarchy(n),s={},r=0;e>r;r++){var a=g(o,i),h=y(o,i),d=40,l=Math.max(-d,Math.min(d,Math.round(a/h)));if(o-=l,void 0!==s[o])break;s[o]=r}return o},w=function(o){var r=t._getPositionForHierarchy(n);if(void 0===i[n.id]){var a={};a[n.id]=!0,h(n,a),i[n.id]=a}var l=d(i[n.id]),c=s(l,4),u=(c[0],c[1],c[2]),p=c[3],f=o-r,m=0;f>0?m=Math.min(f,p-t.options.hierarchical.nodeSpacing):0>f&&(m=-Math.min(-f,u-t.options.hierarchical.nodeSpacing)),0!=m&&(t._shiftBlock(n.id,m),e=!0)},_=function(i){var o=t._getPositionForHierarchy(n),r=t._getSpaceAroundNode(n),a=s(r,2),h=a[0],d=a[1],l=i-o,c=o;l>0?c=Math.min(o+(d-t.options.hierarchical.nodeSpacing),i):0>l&&(c=Math.max(o-(h-t.options.hierarchical.nodeSpacing),i)),c!==o&&(t._setPositionForHierarchy(n,c,void 0,!0),e=!0)},x=b(o,p);w(x),x=b(o,a),_(x)},v=function(i){var o=Object.keys(t.distributionOrdering);o=o.reverse();for(var n=0;i>n;n++){e=!1;for(var s=0;s<o.length;s++)for(var r=o[s],a=t.distributionOrdering[r],h=0;h<a.length;h++)m(1e3,a[h]);if(e!==!0)break}},g=function(i){var o=Object.keys(t.distributionOrdering);o=o.reverse();for(var n=0;i>n&&(e=!1,p(f,o,!0),e===!0);n++);},y=function(){for(var e in t.body.nodes)t.body.nodes.hasOwnProperty(e)&&t._centerParent(t.body.nodes[e])},b=function(){var e=Object.keys(t.distributionOrdering);e=e.reverse();for(var i=0;i<e.length;i++)for(var o=e[i],n=t.distributionOrdering[o],s=0;s<n.length;s++)t._centerParent(n[s])};this.options.hierarchical.blockShifting===!0&&(g(5),y()),this.options.hierarchical.edgeMinimization===!0&&v(20),this.options.hierarchical.parentCentralization===!0&&b(),o()}},{key:"_getSpaceAroundNode",value:function(t,e){var i=!0;void 0===e&&(i=!1);var o=this.hierarchicalLevels[t.id];if(void 0!==o){var n=this.distributionIndex[t.id],s=this._getPositionForHierarchy(t),r=1e9,a=1e9;if(0!==n){var h=this.distributionOrdering[o][n-1];if(i===!0&&void 0===e[h.id]||i===!1){var d=this._getPositionForHierarchy(h);r=s-d}}if(n!=this.distributionOrdering[o].length-1){var l=this.distributionOrdering[o][n+1];if(i===!0&&void 0===e[l.id]||i===!1){var c=this._getPositionForHierarchy(l);a=Math.min(a,c-s)}}return[r,a]}return[0,0]}},{key:"_centerParent",value:function(t){if(this.hierarchicalParentReference[t.id])for(var e=this.hierarchicalParentReference[t.id],i=0;i<e.length;i++){var o=e[i],n=this.body.nodes[o];if(this.hierarchicalChildrenReference[o]){var r=1e9,a=-1e9,h=this.hierarchicalChildrenReference[o];if(h.length>0)for(var d=0;d<h.length;d++){var l=this.body.nodes[h[d]];r=Math.min(r,this._getPositionForHierarchy(l)),a=Math.max(a,this._getPositionForHierarchy(l))}var c=this._getPositionForHierarchy(n),u=this._getSpaceAroundNode(n),p=s(u,2),f=p[0],m=p[1],v=.5*(r+a),g=c-v;(0>g&&Math.abs(g)<m-this.options.hierarchical.nodeSpacing||g>0&&Math.abs(g)<f-this.options.hierarchical.nodeSpacing)&&this._setPositionForHierarchy(n,v,void 0,!0)}}}},{key:"_placeNodesByHierarchy",value:function(t){this.positionedNodes={};for(var e in t)if(t.hasOwnProperty(e)){var i=Object.keys(t[e]);i=this._indexArrayToNodes(i),this._sortNodeArray(i);for(var o=0,n=0;n<i.length;n++){var s=i[n];if(void 0===this.positionedNodes[s.id]){var r=this.options.hierarchical.nodeSpacing*o;o>0&&(r=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(s,r,e),this._validataPositionAndContinue(s,e,r),o++}}}}},{key:"_placeBranchNodes",value:function(t,e){if(void 0!==this.hierarchicalChildrenReference[t]){for(var i=[],o=0;o<this.hierarchicalChildrenReference[t].length;o++)i.push(this.body.nodes[this.hierarchicalChildrenReference[t][o]]);this._sortNodeArray(i);for(var n=0;n<i.length;n++){var s=i[n],r=this.hierarchicalLevels[s.id];if(!(r>e&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[t]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l<i.length;l++){var c=i[l].id;h=Math.min(h,this._getPositionForHierarchy(this.body.nodes[c])),d=Math.max(d,this._getPositionForHierarchy(this.body.nodes[c]))}this._setPositionForHierarchy(this.body.nodes[t],.5*(h+d),e)}}},{key:"_validataPositionAndContinue",value:function(t,e,i){if(void 0!==this.lastNodeOnLevel[e]){var o=this._getPositionForHierarchy(this.body.nodes[this.lastNodeOnLevel[e]]);if(i-o<this.options.hierarchical.nodeSpacing){var n=o+this.options.hierarchical.nodeSpacing-i,s=this._findCommonParent(this.lastNodeOnLevel[e],t.id);this._shiftBlock(s.withChild,n)}}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=void 0,i=void 0;for(e in this.body.nodes)if(this.body.nodes.hasOwnProperty(e)){i=this.body.nodes[e];var o=void 0===this.hierarchicalLevels[e]?0:this.hierarchicalLevels[e];"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?(i.y=this.options.hierarchical.levelSeparation*o,i.options.fixed.y=!0):(i.x=this.options.hierarchical.levelSeparation*o,i.options.fixed.x=!0),void 0===t[o]&&(t[o]={}),t[o][e]=i}return t}},{key:"_getHubSize",value:function(){var t=0;for(var e in this.body.nodes)if(this.body.nodes.hasOwnProperty(e)){var i=this.body.nodes[e];void 0===this.hierarchicalLevels[e]&&(t=i.edges.length<t?t:i.edges.length)}return t}},{key:"_determineLevelsByHubsize",value:function(){for(var t=this,e=1,i=function(e,i){void 0===t.hierarchicalLevels[i.id]&&(void 0===t.hierarchicalLevels[e.id]&&(t.hierarchicalLevels[e.id]=0),t.hierarchicalLevels[i.id]=t.hierarchicalLevels[e.id]+1)};e>0&&(e=this._getHubSize(),0!==e);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===e&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var t=this,e=1e5,i=function(t,e,i){},o=function(o,n,s){var r=t.hierarchicalLevels[o.id];void 0===r&&(t.hierarchicalLevels[o.id]=e);var a=i(d["default"].cloneOptions(o,"node"),d["default"].cloneOptions(n,"node"),d["default"].cloneOptions(s,"edge"));t.hierarchicalLevels[n.id]=t.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var t=this,e=1e4,i=function(i,o,n){var s=t.hierarchicalLevels[i.id];void 0===s&&(t.hierarchicalLevels[i.id]=e),n.toId==o.id?t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]+1:t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var t=1e9;for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&void 0!==this.hierarchicalLevels[e]&&(t=Math.min(this.hierarchicalLevels[e],t));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=t)}},{key:"_generateMap",value:function(){var t=this,e=function(e,i){if(t.hierarchicalLevels[i.id]>t.hierarchicalLevels[e.id]){var o=e.id,n=i.id;void 0===t.hierarchicalChildrenReference[o]&&(t.hierarchicalChildrenReference[o]=[]),t.hierarchicalChildrenReference[o].push(n),void 0===t.hierarchicalParentReference[n]&&(t.hierarchicalParentReference[n]=[]),t.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(e)}},{key:"_crawlNetwork",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?function(){}:arguments[0],i=arguments[1],o={},n=0,s=function d(i,n){if(void 0===o[i.id]){void 0===t.hierarchicalTrees[i.id]&&(t.hierarchicalTrees[i.id]=n,t.treeIndex=Math.max(n,t.treeIndex)),o[i.id]=!0;for(var s=void 0,r=0;r<i.edges.length;r++)i.edges[r].connected===!0&&(s=i.edges[r].toId===i.id?i.edges[r].from:i.edges[r].to,i.id!==s.id&&(e(i,s,i.edges[r]),d(s,n)))}};if(void 0===i)for(var r=0;r<this.body.nodeIndices.length;r++){var a=this.body.nodes[this.body.nodeIndices[r]];void 0===o[a.id]&&(s(a,n),n+=1)}else{var h=this.body.nodes[i];if(void 0===h)return void console.error("Node not found:",i);s(h)}}},{key:"_shiftBlock",value:function(t,e){if("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.body.nodes[t].x+=e:this.body.nodes[t].y+=e,void 0!==this.hierarchicalChildrenReference[t])for(var i=0;i<this.hierarchicalChildrenReference[t].length;i++)this._shiftBlock(this.hierarchicalChildrenReference[t][i],e)}},{key:"_findCommonParent",value:function(t,e){var i=this,o={},n=function r(t,e){if(void 0!==i.hierarchicalParentReference[e])for(var o=0;o<i.hierarchicalParentReference[e].length;o++){var n=i.hierarchicalParentReference[e][o];t[n]=!0,r(t,n)}},s=function a(t,e){if(void 0!==i.hierarchicalParentReference[e])for(var o=0;o<i.hierarchicalParentReference[e].length;o++){var n=i.hierarchicalParentReference[e][o];if(void 0!==t[n])return{foundParent:n,withChild:e};var s=a(t,n);if(null!==s.foundParent)return s}return{foundParent:null,withChild:e}};return n(o,t),s(o,e)}},{key:"_setPositionForHierarchy",value:function(t,e,i){var o=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][t.id]&&(this.distributionOrdering[i].push(t),this.distributionIndex[t.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][t.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x=e:t.y=e}},{key:"_getPositionForHierarchy",value:function(t){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x:t.y}},{key:"_sortNodeArray",value:function(t){t.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.sort(function(t,e){return t.x-e.x}):t.sort(function(t,e){return t.y-e.y}))}}]),t}();e["default"]=c},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(1),r=i(20),a=i(28),h=function(){function t(e,i,n){var r=this;o(this,t),this.body=e,this.canvas=i,this.selectionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},s.extend(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 n(t,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?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,s.deepExtend(this.options,t)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(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(),this.guiEnabled===!0&&(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={},this.guiEnabled===!0){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,o=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===t&&"function"==typeof this.options.editNode?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===e&&0===t&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==i&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===t&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){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;this.editMode!==!0&&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(e.isCluster!==!0){var i=s.deepExtend({},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&&void 0!==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(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){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",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var t=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var e=t.body.edges[t.edgeBeingEditedId],i=t._getNewTargetNode(e.from.x,e.from.y),o=t._getNewTargetNode(e.to.x,e.to.y);t.temporaryIds.nodes.push(i.id),t.temporaryIds.nodes.push(o.id),t.body.nodes[i.id]=i,t.body.nodeIndices.push(i.id),t.body.nodes[o.id]=o,t.body.nodeIndices.push(o.id),t._temporaryBindUI("onTouch",t._controlNodeTouch.bind(t)),t._temporaryBindUI("onTap",function(){}),t._temporaryBindUI("onHold",function(){}),t._temporaryBindUI("onDragStart",t._controlNodeDragStart.bind(t)),t._temporaryBindUI("onDrag",t._controlNodeDrag.bind(t)),t._temporaryBindUI("onDragEnd",t._controlNodeDragEnd.bind(t)),t._temporaryBindUI("onMouseMove",function(){}),t._temporaryBindEvent("beforeDrawing",function(t){var n=e.edgeType.findBorderPositions(t);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),t.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var t=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(e.length>0){for(var n=0;n<e.length;n++)if(this.body.nodes[e[n]].isCluster===!0)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(o=this.options.deleteNode)}else i.length>0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:e,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(e){null!==e&&void 0!==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(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?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",this.editMode===!0?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=s.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:t,right:t,top:e,bottom:e},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(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,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var t=0;t<this.manipulationHammers.length;t++)this.manipulationHammers[t].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),s.recursiveDOMDelete(this.manipulationDiv),s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var t=arguments.length<=0||void 0===arguments[0]?1:arguments[0];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){if(this.options.rtl)var e="vis-button vis-delete-rtl";else var e="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 o=arguments.length<=3||void 0===arguments[3]?"vis-label":arguments[3];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=o,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 r(t,{});a.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 o=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);-1!==o&&this.body.nodeIndices.splice(o,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(t){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=s.extend({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(t){var e=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(e),o=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],s=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var r=o.isOverlappingWith(i),a=n.isOverlappingWith(i);r===!0?(this.selectedControlNode=o,s.edgeType.from=o):a===!0&&(this.selectedControlNode=n,s.edgeType.to=n),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);if(void 0!==this.selectedControlNode)this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y;else{var o=e.x-this.lastTouch.x,n=e.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),o=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)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(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.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=s.extend({},this.body.view.translation);var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(e.x),i.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else{var o=e.x-this.lastTouch.x,n=e.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(n[r])){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(t){var e=this,i={id:s.randomUUID(),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 new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(t){null!==t&&void 0!==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,o={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(o,function(t){null!==t&&void 0!==t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,o={id:this.edgeBeingEditedId,from:t,to:e};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(t){null===t||void 0===t||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}();e["default"]=h},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{"boolean":o},filter:{"boolean":o,string:i,array:s,"function":"function"},container:{dom:a},showButton:{"boolean":o},__type__:{object:r,"boolean":o,string:i,array:s,"function":"function"}},edges:{arrows:{to:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},middle:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},from:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{"boolean":o},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],"boolean":o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{"boolean":o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},__type__:{object:r,string:i}},hidden:{"boolean":o},hoverWidth:{"function":"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},length:{number:n,undefined:"undefined"},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},selectionWidth:{"function":"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},smooth:{enabled:{"boolean":o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],"boolean":o},__type__:{object:r,"boolean":o}},title:{string:i,undefined:"undefined"},width:{number:n},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{"boolean":o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{"boolean":o},dragView:{"boolean":o},hideEdgesOnDrag:{"boolean":o},hideNodesOnDrag:{"boolean":o},hover:{"boolean":o},keyboard:{enabled:{"boolean":o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{"boolean":o},__type__:{object:r,"boolean":o}},multiselect:{"boolean":o},navigationButtons:{"boolean":o},selectable:{"boolean":o},selectConnectedEdges:{"boolean":o},hoverConnectedEdges:{"boolean":o},tooltipDelay:{number:n},zoomView:{"boolean":o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{"boolean":o},hierarchical:{enabled:{"boolean":o},levelSeparation:{number:n},nodeSpacing:{number:n},treeSpacing:{number:n},blockShifting:{"boolean":o},edgeMinimization:{"boolean":o},parentCentralization:{"boolean":o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,"boolean":o}},__type__:{object:r}},manipulation:{enabled:{"boolean":o},initiallyActive:{"boolean":o},addNode:{"boolean":o,"function":"function"},addEdge:{"boolean":o,"function":"function"},editNode:{"function":"function"},editEdge:{"boolean":o,"function":"function"},deleteNode:{"boolean":o,"function":"function"},deleteEdge:{"boolean":o,"function":"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,"boolean":o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{"boolean":o},y:{"boolean":o},__type__:{object:r,"boolean":o}},font:{align:{string:i},color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},__type__:{object:r,string:i}},group:{string:i,number:n,undefined:"undefined"},hidden:{"boolean":o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{"boolean":o,array:s},borderRadius:{number:n},interpolation:{"boolean":o},useImageSize:{"boolean":o},useBorderWithImage:{"boolean":o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{"boolean":o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{"boolean":o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{"boolean":o},fit:{"boolean":o},__type__:{object:r,"boolean":o}},timestep:{number:n},adaptiveTimestep:{"boolean":o},__type__:{object:r,"boolean":o}},autoResize:{"boolean":o},clickToUse:{"boolean":o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={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"],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]},middle:{enabled:!1,scaleFactor:[1,0,3,.05]},from:{enabled:!1,scaleFactor:[1,0,3,.05]}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,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},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]},global:{locale:["en","nl"]}};e.allOptions=d,e.configureOptions=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(116),h=o(a),d=function(){function t(e,i,o){n(this,t),this.body=e,this.springLength=i,this.springConstant=o,this.distanceSolver=new h["default"]}return r(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]?!1:arguments[2],o=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,l=1e9,c=0,u=0,p=0,f=0,m=0;l>n&&h>a;){a+=1;var v=this._getHighestEnergyNode(i),g=s(v,4);for(c=g[0],l=g[1],u=g[2],p=g[3],f=l,m=0;f>r&&d>m;){m+=1,this._moveNode(c,u,p);var y=this._getEnergy(c),b=s(y,3);f=b[0],u=b[1],p=b[2]}}}},{key:"_getHighestEnergyNode",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,o=0,n=e[0],r=0,a=0,h=0;h<e.length;h++){var d=e[h];if(i[d].predefinedPosition===!1||i[d].isCluster===!0&&t===!0||i[d].options.fixed.x===!0||i[d].options.fixed.y===!0){var l=this._getEnergy(d),c=s(l,3),u=c[0],p=c[1],f=c[2];u>o&&(o=u,n=d,r=p,a=f)}}return[n,o,r,a]}},{key:"_getEnergy",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,o=i[t].x,n=i[t].y,s=0,r=0,a=0;a<e.length;a++){var h=e[a];if(h!==t){var d=i[h].x,l=i[h].y,c=1/Math.sqrt(Math.pow(o-d,2)+Math.pow(n-l,2));s+=this.K_matrix[t][h]*(o-d-this.L_matrix[t][h]*(o-d)*c),r+=this.K_matrix[t][h]*(n-l-this.L_matrix[t][h]*(n-l)*c)}}var u=Math.sqrt(Math.pow(s,2)+Math.pow(r,2));return[u,s,r]}},{key:"_moveNode",value:function(t,e,i){for(var o=this.body.nodeIndices,n=this.body.nodes,s=0,r=0,a=0,h=n[t].x,d=n[t].y,l=0;l<o.length;l++){var c=o[l];if(c!==t){var u=n[c].x,p=n[c].y,f=1/Math.pow(Math.pow(h-u,2)+Math.pow(d-p,2),1.5);s+=this.K_matrix[t][c]*(1-this.L_matrix[t][c]*Math.pow(d-p,2)*f),r+=this.K_matrix[t][c]*(this.L_matrix[t][c]*(h-u)*(d-p)*f),a+=this.K_matrix[t][c]*(1-this.L_matrix[t][c]*Math.pow(h-u,2)*f)}}var m=s,v=r,g=e,y=a,b=i,w=(g/m+b/v)/(v/m-y/v),_=-(v*w+g)/m;n[t].x+=_,n[t].y+=w}},{key:"_createL_matrix",value:function(t){var e=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(var o=0;o<e.length;o++){this.L_matrix[e[o]]={};for(var n=0;n<e.length;n++)this.L_matrix[e[o]][e[n]]=i*t[e[o]][e[n]]}}},{key:"_createK_matrix",value:function(t){var e=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(var o=0;o<e.length;o++){this.K_matrix[e[o]]={};for(var n=0;n<e.length;n++)this.K_matrix[e[o]][e[n]]=i*Math.pow(t[e[o]][e[n]],-2)}}}]),t}();e["default"]=d},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),n=function(){function t(){i(this,t)}return o(t,[{key:"getDistances",value:function(t,e,i){for(var o={},n=t.edges,s=0;s<e.length;s++){o[e[s]]={},o[e[s]]={};for(var r=0;r<e.length;r++)o[e[s]][e[r]]=s==r?0:1e9,o[e[s]][e[r]]=s==r?0:1e9}for(var a=0;a<i.length;a++){var h=n[i[a]];h.connected===!0&&void 0!==o[h.fromId]&&void 0!==o[h.toId]&&(o[h.fromId][h.toId]=1,o[h.toId][h.fromId]=1)}for(var d=e.length,l=0;d>l;l++)for(var c=0;d-1>c;c++)for(var u=c+1;d>u;u++)o[e[c]][e[u]]=Math.min(o[e[c]][e[u]],o[e[c]][e[l]]+o[e[l]][e[u]]),o[e[u]][e[c]]=o[e[c]][e[u]];return o}}]),t}();e["default"]=n},function(t,e){"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(),i*=1.15,e+=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(t,e-(r-s)),this.lineTo(t+n,e+s),this.lineTo(t-n,e+s),this.lineTo(t,e-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(t,e,i){this.beginPath(),i*=1.15,e-=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(t,e+(r-s)),
+this.lineTo(t+n,e-s),this.lineTo(t-n,e-s),this.lineTo(t,e+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(t,e,i){this.beginPath(),i*=.82,e+=.1*i;for(var o=0;10>o;o++){var n=o%2===0?1.3*i:.5*i;this.lineTo(t+n*Math.sin(2*o*Math.PI/10),e-n*Math.cos(2*o*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,o,n){var s=Math.PI/180;0>i-2*n&&(n=i/2),0>o-2*n&&(n=o/2),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,270*s,360*s,!1),this.lineTo(t+i,e+o-n),this.arc(t+i-n,e+o-n,n,0,90*s,!1),this.lineTo(t+n,e+o),this.arc(t+n,e+o-n,n,90*s,180*s,!1),this.lineTo(t,e+n),this.arc(t+n,e+n,n,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse=function(t,e,i,o){var n=.5522848,s=i/2*n,r=o/2*n,a=t+i,h=e+o,d=t+i/2,l=e+o/2;this.beginPath(),this.moveTo(t,l),this.bezierCurveTo(t,l-r,d-s,e,d,e),this.bezierCurveTo(d+s,e,a,l-r,a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,t,l+r,t,l),this.closePath()},CanvasRenderingContext2D.prototype.database=function(t,e,i,o){var n=1/3,s=i,r=o*n,a=.5522848,h=s/2*a,d=r/2*a,l=t+s,c=e+r,u=t+s/2,p=e+r/2,f=e+(o-r/2),m=e+o;this.beginPath(),this.moveTo(l,p),this.bezierCurveTo(l,p+d,u+h,c,u,c),this.bezierCurveTo(u-h,c,t,p+d,t,p),this.bezierCurveTo(t,p-d,u-h,e,u,e),this.bezierCurveTo(u+h,e,l,p-d,l,p),this.lineTo(l,f),this.bezierCurveTo(l,f+d,u+h,m,u,m),this.bezierCurveTo(u-h,m,t,f+d,t,f),this.lineTo(t,p)},CanvasRenderingContext2D.prototype.arrow=function(t,e,i,o){var n=t-o*Math.cos(i),s=e-o*Math.sin(i),r=t-.9*o*Math.cos(i),a=e-.9*o*Math.sin(i),h=n+o/3*Math.cos(i+.5*Math.PI),d=s+o/3*Math.sin(i+.5*Math.PI),l=n+o/3*Math.cos(i-.5*Math.PI),c=s+o/3*Math.sin(i-.5*Math.PI);this.beginPath(),this.moveTo(t,e),this.lineTo(h,d),this.lineTo(r,a),this.lineTo(l,c),this.closePath()},CanvasRenderingContext2D.prototype.dashedLine=function(t,e,i,o,n){this.beginPath(),this.moveTo(t,e);for(var s=n.length,r=i-t,a=o-e,h=a/r,d=Math.sqrt(r*r+a*a),l=0,c=!0,u=0,p=n[0];d>=.1;)p=n[l++%s],p>d&&(p=d),u=Math.sqrt(p*p/(1+h*h)),u=0>r?-u:u,t+=u,e+=h*u,c===!0?this.lineTo(t,e):this.moveTo(t,e),d-=p,c=!c})},function(t,e){function i(t){return P=t,p()}function o(){I=0,N=P.charAt(0)}function n(){I++,N=P.charAt(I)}function s(){return P.charAt(I+1)}function r(t){return L.test(t)}function a(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function h(t,e,i){for(var o=e.split("."),n=t;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function d(t,e){for(var i,o,n=null,s=[t],r=t;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;o>i;i++)if(e.id===r.nodes[i].id){n=r.nodes[i];break}for(n||(n={id:e.id},t.node&&(n.attr=a(n.attr,t.node))),i=s.length-1;i>=0;i--){var h=s[i];h.nodes||(h.nodes=[]),-1===h.nodes.indexOf(n)&&h.nodes.push(n)}e.attr&&(n.attr=a(n.attr,e.attr))}function l(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=a({},t.edge);e.attr=a(i,e.attr)}}function c(t,e,i,o,n){var s={from:e,to:i,type:o};return t.edge&&(s.attr=a({},t.edge)),s.attr=a(s.attr||{},n),s}function u(){for(z=T.NULL,R="";" "===N||" "===N||"\n"===N||"\r"===N;)n();do{var t=!1;if("#"===N){for(var e=I-1;" "===P.charAt(e)||" "===P.charAt(e);)e--;if("\n"===P.charAt(e)||""===P.charAt(e)){for(;""!=N&&"\n"!=N;)n();t=!0}}if("/"===N&&"/"===s()){for(;""!=N&&"\n"!=N;)n();t=!0}if("/"===N&&"*"===s()){for(;""!=N;){if("*"===N&&"/"===s()){n(),n();break}n()}t=!0}for(;" "===N||" "===N||"\n"===N||"\r"===N;)n()}while(t);if(""===N)return void(z=T.DELIMITER);var i=N+s();if(E[i])return z=T.DELIMITER,R=i,n(),void n();if(E[N])return z=T.DELIMITER,R=N,void n();if(r(N)||"-"===N){for(R+=N,n();r(N);)R+=N,n();return"false"===R?R=!1:"true"===R?R=!0:isNaN(Number(R))||(R=Number(R)),void(z=T.IDENTIFIER)}if('"'===N){for(n();""!=N&&('"'!=N||'"'===N&&'"'===s());)R+=N,'"'===N&&n(),n();if('"'!=N)throw _('End of string " expected');return n(),void(z=T.IDENTIFIER)}for(z=T.UNKNOWN;""!=N;)R+=N,n();throw new SyntaxError('Syntax error in part "'+x(R,30)+'"')}function p(){var t={};if(o(),u(),"strict"===R&&(t.strict=!0,u()),"graph"!==R&&"digraph"!==R||(t.type=R,u()),z===T.IDENTIFIER&&(t.id=R,u()),"{"!=R)throw _("Angle bracket { expected");if(u(),f(t),"}"!=R)throw _("Angle bracket } expected");if(u(),""!==R)throw _("End of file expected");return u(),delete t.node,delete t.edge,delete t.graph,t}function f(t){for(;""!==R&&"}"!=R;)m(t),";"===R&&u()}function m(t){var e=v(t);if(e)return void b(t,e);var i=g(t);if(!i){if(z!=T.IDENTIFIER)throw _("Identifier expected");var o=R;if(u(),"="===R){if(u(),z!=T.IDENTIFIER)throw _("Identifier expected");t[o]=R,u()}else y(t,o)}}function v(t){var e=null;if("subgraph"===R&&(e={},e.type="subgraph",u(),z===T.IDENTIFIER&&(e.id=R,u())),"{"===R){if(u(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,f(e),"}"!=R)throw _("Angle bracket } expected");u(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function g(t){return"node"===R?(u(),t.node=w(),"node"):"edge"===R?(u(),t.edge=w(),"edge"):"graph"===R?(u(),t.graph=w(),"graph"):null}function y(t,e){var i={id:e},o=w();o&&(i.attr=o),d(t,i),b(t,e)}function b(t,e){for(;"->"===R||"--"===R;){var i,o=R;u();var n=v(t);if(n)i=n;else{if(z!=T.IDENTIFIER)throw _("Identifier or subgraph expected");i=R,d(t,{id:i}),u()}var s=w(),r=c(t,e,i,o,s);l(t,r),e=i}}function w(){for(var t=null;"["===R;){for(u(),t={};""!==R&&"]"!=R;){if(z!=T.IDENTIFIER)throw _("Attribute name expected");var e=R;if(u(),"="!=R)throw _("Equal sign = expected");if(u(),z!=T.IDENTIFIER)throw _("Attribute value expected");var i=R;h(t,e,i),u(),","==R&&u()}if("]"!=R)throw _("Bracket ] expected");u()}return t}function _(t){return new SyntaxError(t+', got "'+x(R,30)+'" (char '+I+")")}function x(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function k(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)}function O(t,e,i){for(var o=e.split("."),n=o.pop(),s=t,r=0;r<o.length;r++){var a=o[r];a in s||(s[a]={}),s=s[a]}return s[n]=i,t}function M(t,e){var i={};for(var o in t)if(t.hasOwnProperty(o)){var n=e[o];Array.isArray(n)?n.forEach(function(e){O(i,e,t[o])}):"string"==typeof n?O(i,n,t[o]):O(i,o,t[o])}return i}function D(t){var e=i(t),o={nodes:[],edges:[],options:{}};if(e.nodes&&e.nodes.forEach(function(t){var e={id:t.id,label:String(t.label||t.id)};a(e,M(t.attr,S)),e.image&&(e.shape="image"),o.nodes.push(e)}),e.edges){var n=function(t){var e={from:t.from,to:t.to};return a(e,M(t.attr,C)),e.arrows="->"===t.type?"to":void 0,e};e.edges.forEach(function(t){var e,i;e=t.from instanceof Object?t.from.nodes:{id:t.from},i=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);o.edges.push(e)}),k(e,i,function(e,i){var s=c(o,e.id,i.id,t.type,t.attr),r=n(s);o.edges.push(r)}),t.to instanceof Object&&t.to.edges&&t.to.edges.forEach(function(t){var e=n(t);o.edges.push(e)})})}return e.attr&&(o.options=e.attr),o}var S={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},C=Object.create(S);C.color="color.color";var T={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},E={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},P="",I=0,N="",R="",z=T.NULL,L=/[a-zA-Z_0-9.:#]/;e.parseDOT=i,e.DOTToGraph=D},function(t,e){function i(t,e){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==e&&(void 0!==e.fixed&&(n.nodes.fixed=e.fixed),void 0!==e.parseColor&&(n.nodes.parseColor=e.parseColor),void 0!==e.inheritColor&&(n.edges.inheritColor=e.inheritColor));for(var s=t.edges,r=t.nodes,a=0;a<s.length;a++){var h={},d=s[a];h.id=d.id,h.from=d.source,h.to=d.target,h.attributes=d.attributes,h.label=d.label,h.title=void 0!==d.attributes?d.attributes.title:void 0,"Directed"===d.type&&(h.arrows="to"),d.color&&n.inheritColor===!1&&(h.color=d.color),i.push(h)}for(var a=0;a<r.length;a++){var l={},c=r[a];l.id=c.id,l.attributes=c.attributes,l.title=c.title,l.x=c.x,l.y=c.y,l.label=c.label,l.title=void 0!==c.attributes?c.attributes.title:void 0,n.nodes.parseColor===!0?l.color=c.color:l.color=void 0!==c.color?{background:c.color,border:c.color,highlight:{background:c.color,border:c.color},hover:{background:c.color,border:c.color}}:void 0,l.size=c.size,l.fixed=n.nodes.fixed&&void 0!==c.x&&void 0!==c.y,o.push(l)}return{nodes:o,edges:i}}e.parseGephi=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:"Átras",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.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}])});
+//# sourceMappingURL=vis.map