diff --git a/includes/js/vis/dist/vis-timeline-graph2d.css b/includes/js/vis/dist/vis-timeline-graph2d.css new file mode 100644 index 0000000..904c6d2 --- /dev/null +++ b/includes/js/vis/dist/vis-timeline-graph2d.css @@ -0,0 +1,1215 @@ +.vis-custom-time { + background-color: #6E94FF; + width: 2px; + cursor: move; + z-index: 1; +} + +.vis-custom-time > .vis-custom-time-marker { + background-color: inherit; + color: white; + font-size: 12px; + white-space: nowrap; + padding: 3px 5px; + top: 0px; + cursor: initial; + z-index: inherit; +} +.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-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 +} +/* override some bootstrap styles screwing up the timelines css */ + +.vis [class*="span"] { + min-height: 0; + width: auto; +} + + +.vis-item { + position: absolute; + color: #1A1A1A; + border-color: #97B0F8; + border-width: 1px; + background-color: #D5DDF6; + display: inline-block; + z-index: 1; + /*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-visible-frame { + white-space: nowrap; +} + +.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-onUpdateTime-tooltip { + position: absolute; + background: #4f81bd; + color: white; + width: 200px; + text-align: center; + white-space: nowrap; + padding: 5px; + border-radius: 1px; + transition: 0.4s; + -o-transition: 0.4s; + -moz-transition: 0.4s; + -webkit-transition: 0.4s; +} + +.vis-item .vis-delete, .vis-item .vis-delete-rtl { + position: absolute; + top: 0px; + width: 24px; + height: 24px; + box-sizing: border-box; + padding: 0px 5px; + cursor: pointer; + + -webkit-transition: background 0.2s linear; + -moz-transition: background 0.2s linear; + -ms-transition: background 0.2s linear; + -o-transition: background 0.2s linear; + transition: background 0.2s linear; +} + +.vis-item .vis-delete { + right: -24px; +} + +.vis-item .vis-delete-rtl { + left: -24px; +} + +.vis-item .vis-delete:after, .vis-item .vis-delete-rtl:after { + content: "\00D7"; /* MULTIPLICATION SIGN */ + color: red; + font-family: arial, sans-serif; + font-size: 22px; + font-weight: bold; + + -webkit-transition: color 0.2s linear; + -moz-transition: color 0.2s linear; + -ms-transition: color 0.2s linear; + -o-transition: color 0.2s linear; + transition: color 0.2s linear; +} + +.vis-item .vis-delete:hover, .vis-item .vis-delete-rtl:hover { + background: red; +} + +.vis-item .vis-delete:hover:after, .vis-item .vis-delete-rtl:hover:after { + color: white; +} + +.vis-item .vis-drag-center { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0px; + cursor: move; +} + +.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-item.vis-cluster { + vertical-align: center; + text-align: center; + border-style: solid; + border-radius: 2px; +} + +.vis-item.vis-cluster-line { + padding: 0; + position: absolute; + width: 0; + border-left-width: 1px; + border-left-style: solid; +} + +.vis-item.vis-cluster-dot { + position: absolute; + padding: 0; + border-width: 4px; + border-style: solid; + border-radius: 4px; +} +.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-current-time { + background-color: #FF7F6E; + width: 2px; + z-index: 1; + pointer-events: none; +} + +.vis-rolling-mode-btn { + height: 40px; + width: 40px; + position: absolute; + top: 7px; + right: 20px; + border-radius: 50%; + font-size: 28px; + cursor: pointer; + opacity: 0.8; + color: white; + font-weight: bold; + text-align: center; + background: #3876c2; +} +.vis-rolling-mode-btn:before { + content: "\26F6"; +} + +.vis-rolling-mode-btn:hover { + opacity: 1; +} +.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-left.vis-panel.vis-vertical-scroll, .vis-right.vis-panel.vis-vertical-scroll { + height: 100%; + overflow-x: hidden; + overflow-y: scroll; +} + +.vis-left.vis-panel.vis-vertical-scroll { + direction: rtl; +} + +.vis-left.vis-panel.vis-vertical-scroll .vis-content { + direction: ltr; +} + +.vis-right.vis-panel.vis-vertical-scroll { + direction: ltr; +} + +.vis-right.vis-panel.vis-vertical-scroll .vis-content { + direction: rtl; +} + +.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-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; +} + + +.vis-timeline { + position: relative; + border: 1px solid #bfbfbf; + overflow: hidden; + padding: 0; + margin: 0; + box-sizing: border-box; +} + +.vis-loading-screen { + width: 100%; + height: 100%; + position: absolute; + top: 0; + 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-group-is-dragging { + background: rgba(0, 0, 0, .1); +} + +.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-nesting-group { + cursor: pointer; +} + +.vis-label.vis-nested-group.vis-group-level-unknown-but-gte1 { + background: #f5f5f5; +} +.vis-label.vis-nested-group.vis-group-level-0 { + background-color: #ffffff; +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-0 .vis-inner { + padding-left: 0; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-0 .vis-inner { + padding-right: 0; +} +.vis-label.vis-nested-group.vis-group-level-1 { + background-color: rgba(0, 0, 0, 0.05); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-1 .vis-inner { + padding-left: 15px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-1 .vis-inner { + padding-right: 15px; +} +.vis-label.vis-nested-group.vis-group-level-2 { + background-color: rgba(0, 0, 0, 0.1); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-2 .vis-inner { + padding-left: 30px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-2 .vis-inner { + padding-right: 30px; +} +.vis-label.vis-nested-group.vis-group-level-3 { + background-color: rgba(0, 0, 0, 0.15); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-3 .vis-inner { + padding-left: 45px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-3 .vis-inner { + padding-right: 45px; +} +.vis-label.vis-nested-group.vis-group-level-4 { + background-color: rgba(0, 0, 0, 0.2); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-4 .vis-inner { + padding-left: 60px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-4 .vis-inner { + padding-right: 60px; +} +.vis-label.vis-nested-group.vis-group-level-5 { + background-color: rgba(0, 0, 0, 0.25); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-5 .vis-inner { + padding-left: 75px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-5 .vis-inner { + padding-right: 75px; +} +.vis-label.vis-nested-group.vis-group-level-6 { + background-color: rgba(0, 0, 0, 0.3); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-6 .vis-inner { + padding-left: 90px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-6 .vis-inner { + padding-right: 90px; +} +.vis-label.vis-nested-group.vis-group-level-7 { + background-color: rgba(0, 0, 0, 0.35); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-7 .vis-inner { + padding-left: 105px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-7 .vis-inner { + padding-right: 105px; +} +.vis-label.vis-nested-group.vis-group-level-8 { + background-color: rgba(0, 0, 0, 0.4); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-8 .vis-inner { + padding-left: 120px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-8 .vis-inner { + padding-right: 120px; +} +.vis-label.vis-nested-group.vis-group-level-9 { + background-color: rgba(0, 0, 0, 0.45); +} +.vis-ltr .vis-label.vis-nested-group.vis-group-level-9 .vis-inner { + padding-left: 135px; +} +.vis-rtl .vis-label.vis-nested-group.vis-group-level-9 .vis-inner { + padding-right: 135px; +} +/* default takes over beginning with level-10 (thats why we add .vis-nested-group + to the selectors above, to have higher specifity than these rules for the defaults) */ +.vis-label.vis-nested-group { + background-color: rgba(0, 0, 0, 0.5); +} +.vis-ltr .vis-label.vis-nested-group .vis-inner { + padding-left: 150px; +} +.vis-rtl .vis-label.vis-nested-group .vis-inner { + padding-right: 150px; +} + +.vis-group-level-unknown-but-gte1 { + border: 1px solid red; +} + +/* expanded/collapsed indicators */ +.vis-label.vis-nesting-group:before, +.vis-label.vis-nesting-group:before { + display: inline-block; + width: 15px; +} +.vis-label.vis-nesting-group.expanded:before { + content: "\25BC"; +} +.vis-label.vis-nesting-group.collapsed:before { + content: "\25B6"; +} +.vis-rtl .vis-label.vis-nesting-group.collapsed:before { + content: "\25C0"; +} +/* compensate missing expanded/collapsed indicator, but only at levels > 0 */ +.vis-ltr .vis-label:not(.vis-nesting-group):not(.vis-group-level-0) { + padding-left: 15px; +} +.vis-rtl .vis-label:not(.vis-nesting-group):not(.vis-group-level-0) { + padding-right: 15px; +} + +.vis-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 10; +} +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 .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; +} + +div.vis-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; + + z-index: 5; +} diff --git a/includes/js/vis/dist/vis-timeline-graph2d.esm.js b/includes/js/vis/dist/vis-timeline-graph2d.esm.js new file mode 100644 index 0000000..4c59958 --- /dev/null +++ b/includes/js/vis/dist/vis-timeline-graph2d.esm.js @@ -0,0 +1,48797 @@ +/** + * vis-timeline and vis-graph2d + * https://visjs.github.io/vis-timeline/ + * + * Create a fully customizable, interactive timeline with items and ranges. + * + * @version 0.0.0-no-version + * @date 2020-01-04T00:10:26.063Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +var defineProperty = _defineProperty; + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } +} + +var arrayWithoutHoles = _arrayWithoutHoles; + +function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} + +var iterableToArray = _iterableToArray; + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); +} + +var nonIterableSpread = _nonIterableSpread; + +function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); +} + +var toConsumableArray = _toConsumableArray; +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function commonjsRequire() { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); +} + +function createCommonjsModule(fn, module) { + return module = { + exports: {} + }, fn(module, module.exports), module.exports; +} + +var _typeof_1 = createCommonjsModule(function (module) { + function _typeof2(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof2(obj); + } + + function _typeof(obj) { + if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); + } + + module.exports = _typeof; +}); + +var moment = createCommonjsModule(function (module, exports) { + (function (global, factory) { + module.exports = factory(); + })(commonjsGlobal, function () { + var hookCallback; + + function 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 isObject(input) { + // IE8 will treat undefined and null as object if it wasn't for + // input != null + return input != null && Object.prototype.toString.call(input) === '[object Object]'; + } + + function isObjectEmpty(obj) { + if (Object.getOwnPropertyNames) { + return Object.getOwnPropertyNames(obj).length === 0; + } else { + var k; + + for (k in obj) { + if (obj.hasOwnProperty(k)) { + return false; + } + } + + return true; + } + } + + function isUndefined(input) { + return input === void 0; + } + + function isNumber(input) { + return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; + } + + 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 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, + rfc2822: false, + weekdayMismatch: false + }; + } + + 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 isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + var parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }); + var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); + + if (m._strict) { + isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; + } + + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } else { + return isNowValid; + } + } + + return m._isValid; + } + + function createInvalid(flags) { + var m = createUTC(NaN); + + if (flags != null) { + extend(getParsingFlags(m), flags); + } else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + + + var momentProperties = 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 = 0; i < momentProperties.length; i++) { + 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); + + if (!this.isValid()) { + this._d = new Date(NaN); + } // Prevent infinite loop in case updateOffset creates new moment + // objects. + + + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment(obj) { + return obj instanceof Moment || obj != null && obj._isAMomentObject != null; + } + + function absFloor(number) { + if (number < 0) { + // -0 -> 0 + return Math.ceil(number) || 0; + } 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 (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + return extend(function () { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + + if (firstTime) { + var args = []; + var arg; + + for (var i = 0; i < arguments.length; i++) { + arg = ''; + + if (typeof arguments[i] === 'object') { + arg += '\n[' + i + '] '; + + for (var key in arguments[0]) { + arg += key + ': ' + arguments[0][key] + ', '; + } + + arg = arg.slice(0, -2); // Remove trailing comma and space + } else { + arg = arguments[i]; + } + + args.push(arg); + } + + warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack); + firstTime = false; + } + + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function 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 _dayOfMonthOrdinalParse. + // TODO: Remove "ordinalParse" fallback in next major release. + + this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || 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]; + } + } + } + + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) { + // make sure changes to properties don't modify parent config + res[prop] = extend({}, 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; + }; + } + + 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 calendar(key, mom, now) { + var output = this._calendar[key] || this._calendar['sameElse']; + 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 defaultDayOfMonthOrdinalParse = /\d{1,2}/; + + function ordinal(number) { + return this._ordinal.replace('%d', number); + } + + var defaultRelativeTime = { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + ss: '%d seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }; + + function 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 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; + } + + var priorities = {}; + + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + + function getPrioritizedUnits(unitsObj) { + var units = []; + + for (var u in unitsObj) { + units.push({ + unit: u, + priority: priorities[u] + }); + } + + units.sort(function (a, b) { + return a.priority - b.priority; + }); + return units; + } + + 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 += isFunction(array[i]) ? 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]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; + 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 (isNumber(callback)) { + 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; // 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'); // PRIORITIES + + addUnitPriority('year', 1); // 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 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = 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 + + + hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; // MOMENTS + + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear() { + return isLeapYear(this.year()); + } + + function makeGetSet(unit, keepTime) { + return function (value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get(this, unit); + } + }; + } + + function get(mom, unit) { + return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function set$1(mom, unit, value) { + if (mom.isValid() && !isNaN(value)) { + if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); + } else { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + } + } // MOMENTS + + + function stringGet(units) { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](); + } + + return this; + } + + function stringSet(units, value) { + if (typeof units === 'object') { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units); + + for (var i = 0; i < prioritized.length; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); + } + } else { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](value); + } + } + + return this; + } + + function mod(n, x) { + return (n % x + x) % x; + } + + 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) { + if (isNaN(year) || isNaN(month)) { + return NaN; + } + + var modMonth = mod(month, 12); + year += (month - modMonth) / 12; + return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; + } // 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'); // PRIORITY + + addUnitPriority('month', 8); // 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) { + if (!m) { + return isArray(this._months) ? this._months : this._months['standalone']; + } + + return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || 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) { + if (!m) { + return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; + } + + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + function 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 = 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 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 = 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 (!isNumber(value)) { + 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); + hooks.updateOffset(this, true); + return this; + } else { + return 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 { + if (!hasOwnProp(this, '_monthsShortRegex')) { + this._monthsShortRegex = defaultMonthsShortRegex; + } + + 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 { + if (!hasOwnProp(this, '_monthsRegex')) { + this._monthsRegex = defaultMonthsRegex; + } + + 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 = 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]); + } + + for (i = 0; i < 24; 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 createDate(y, m, d, h, M, s, ms) { + // can't just apply() to create a date: + // https://stackoverflow.com/q/181348 + var date; // the date constructor remaps years 0-99 to 1900-1999 + + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + date = new Date(y + 400, m, d, h, M, s, ms); + + if (isFinite(date.getFullYear())) { + date.setFullYear(y); + } + } else { + date = new Date(y, m, d, h, M, s, ms); + } + + return date; + } + + function createUTCDate(y) { + var date; // the Date.UTC function remaps years 0-99 to 1900-1999 + + if (y < 100 && y >= 0) { + var args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset + + args[0] = y + 400; + date = new Date(Date.UTC.apply(null, args)); + + if (isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + } else { + date = new Date(Date.UTC.apply(null, arguments)); + } + + return date; + } // 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; + } // https://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; + } // FORMATTING + + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); // PRIORITIES + + addUnitPriority('week', 5); + addUnitPriority('isoWeek', 5); // 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 6th 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', 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'); // PRIORITY + + addUnitPriority('day', 11); + addUnitPriority('weekday', 11); + addUnitPriority('isoWeekday', 11); // 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; + } + + function parseIsoWeekday(input, locale) { + if (typeof input === 'string') { + return locale.weekdaysParse(input) % 7 || 7; + } + + return isNaN(input) ? null : input; + } // LOCALES + + + function shiftWeekdays(ws, n) { + return ws.slice(n, 7).concat(ws.slice(0, n)); + } + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + + function localeWeekdays(m, format) { + var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone']; + return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + + function localeWeekdaysShort(m) { + return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + + function localeWeekdaysMin(m) { + return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + + function handleStrictParse$1(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 = 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 handleStrictParse$1.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 = 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. + + + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 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 { + if (!hasOwnProp(this, '_weekdaysRegex')) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + + 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 { + if (!hasOwnProp(this, '_weekdaysShortRegex')) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + + 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 { + if (!hasOwnProp(this, '_weekdaysMinRegex')) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + + 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 = 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 + + + 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'); // PRIORITY + + addUnitPriority('hour', 13); // PARSING + + function matchMeridiem(isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('k', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + addRegexToken('kk', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); + addParseToken(['k', 'kk'], function (input, array, config) { + var kInput = toInt(input); + array[HOUR] = kInput === 24 ? 0 : kInput; + }); + 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 they want. 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); + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, + relativeTime: defaultRelativeTime, + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, + week: defaultLocaleWeek, + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, + meridiemParse: defaultLocaleMeridiemParse + }; // internal storage for locale config files + + var locales = {}; + var localeFamilies = {}; + 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 globalLocale; + } + + function loadLocale(name) { + var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node + + if (!locales[name] && 'object' !== 'undefined' && module && module.exports) { + try { + oldLocale = globalLocale._abbr; + var aliasedRequire = commonjsRequire; + aliasedRequire('./locale/' + name); + 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 getSetGlobalLocale(key, values) { + var data; + + if (key) { + if (isUndefined(values)) { + data = getLocale(key); + } else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } else { + if (typeof console !== 'undefined' && console.warn) { + //warn user if arguments are passed but the locale could not be set + console.warn('Locale ' + key + ' not found. Did you forget to load it?'); + } + } + } + + return globalLocale._abbr; + } + + function defineLocale(name, config) { + if (config !== null) { + var locale, + parentConfig = baseConfig; + 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 ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + locale = loadLocale(config.parentLocale); + + if (locale != null) { + parentConfig = locale._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + + localeFamilies[config.parentLocale].push({ + name: name, + config: config + }); + return null; + } + } + } + + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + + if (localeFamilies[name]) { + localeFamilies[name].forEach(function (x) { + defineLocale(x.name, x.config); + }); + } // backwards compat for now: also set the locale + // make sure we set the locale AFTER all child locales have been + // created, so we won't end up with the child locale set. + + + getSetGlobalLocale(name); + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + function updateLocale(name, config) { + if (config != null) { + var locale, + tmpLocale, + parentConfig = baseConfig; // MERGE + + tmpLocale = loadLocale(name); + + if (tmpLocale != null) { + parentConfig = tmpLocale._config; + } + + config = mergeConfigs(parentConfig, config); + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; // backwards compat for now: also set the locale + + 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 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 listLocales() { + return keys(locales); + } + + 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; + } // 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(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, + expectedWeekday, + 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 != null) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { + 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); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // 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; + } // check for mismatching day of week + + + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { + getParsingFlags(config).weekdayMismatch = true; + } + } + + 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(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; + var curWeek = weekOfYear(createLocal(), dow, doy); + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. + + week = defaults(w.w, curWeek.week); + + 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 beginning of week + weekday = w.e + dow; + + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + // default to beginning 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; + } + } // 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; + } + } // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 + + + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; + + function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)]; + + if (secondStr) { + result.push(parseInt(secondStr, 10)); + } + + return result; + } + + function untruncateYear(yearStr) { + var year = parseInt(yearStr, 10); + + if (year <= 49) { + return 2000 + year; + } else if (year <= 999) { + return 1900 + year; + } + + return year; + } + + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + + function checkWeekday(weekdayStr, parsedInput, config) { + if (weekdayStr) { + // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. + var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), + weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); + + if (weekdayProvided !== weekdayActual) { + getParsingFlags(config).weekdayMismatch = true; + config._isValid = false; + return false; + } + } + + return true; + } + + var obsOffsets = { + UT: 0, + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + + function calculateOffset(obsOffset, militaryOffset, numOffset) { + if (obsOffset) { + return obsOffsets[obsOffset]; + } else if (militaryOffset) { + // the only allowed military tz is Z + return 0; + } else { + var hm = parseInt(numOffset, 10); + var m = hm % 100, + h = (hm - m) / 100; + return h * 60 + m; + } + } // date and time from ref 2822 format + + + function configFromRFC2822(config) { + var match = rfc2822.exec(preprocessRFC2822(config._i)); + + if (match) { + var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); + + if (!checkWeekday(match[1], parsedArray, config)) { + return; + } + + config._a = parsedArray; + config._tzm = calculateOffset(match[8], match[9], match[10]); + config._d = createUTCDate.apply(null, config._a); + + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + + getParsingFlags(config).rfc2822 = true; + } 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; + } else { + return; + } + + configFromRFC2822(config); + + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } // Final attempt, use Input Fallback + + + hooks.createFromInputFallback(config); + } + + hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + }); // constant that refers to the ISO standard + + hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form + + + hooks.RFC_2822 = 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 === hooks.ISO_8601) { + configFromISO(config); + return; + } + + if (config._f === hooks.RFC_2822) { + configFromRFC2822(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 (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && 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 (!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 || getLocale(config._l); + + if (input === null || format === undefined && input === '') { + return createInvalid({ + nullInput: true + }); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + + if (!isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + + if (isUndefined(input)) { + config._d = new Date(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 (isObject(input)) { + configFromObject(config); + } else if (isNumber(input)) { + // from milliseconds + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC(input, format, locale, strict, isUTC) { + var c = {}; + + if (locale === true || locale === false) { + strict = locale; + locale = undefined; + } + + if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) { + input = 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 createLocal(input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } + }); + var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return 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 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(); + }; + + var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; + + function isDurationValid(m) { + for (var key in m) { + if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { + return false; + } + } + + var unitHasDecimal = false; + + for (var i = 0; i < ordering.length; ++i) { + if (m[ordering[i]]) { + if (unitHasDecimal) { + return false; // only allow non-integers for smallest unit + } + + if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { + unitHasDecimal = true; + } + } + } + + return true; + } + + function isValid$1() { + return this._isValid; + } + + function createInvalid$1() { + return createDuration(NaN); + } + + function Duration(duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || normalizedInput.isoWeek || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + this._isValid = isDurationValid(normalizedInput); // 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 to 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 = getLocale(); + + this._bubble(); + } + + function isDuration(obj) { + return obj instanceof Duration; + } + + function absRound(number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } // 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); + + if (matches === null) { + return null; + } + + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + return minutes === 0 ? 0 : 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() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. + + res._d.setTime(res._d.valueOf() + diff); + + hooks.updateOffset(res, false); + return res; + } else { + return 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. + + + 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, keepMinutes) { + 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); + + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16 && !keepMinutes) { + 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) { + addSubtract(this, createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + 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 != null) { + this.utcOffset(this._tzm, false, true); + } else if (typeof this._i === 'string') { + var tZone = offsetFromString(matchOffset, this._i); + + if (tZone != null) { + this.utcOffset(tZone); + } else { + this.utcOffset(0, true); + } + } + + return this; + } + + function hasAlignedHourOffset(input) { + if (!this.isValid()) { + return false; + } + + input = input ? 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 ? createUTC(c._a) : 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*)?)?$/; // 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 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 (isNumber(input)) { + 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(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match + + }; + } 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(createLocal(duration.from), 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; + } + + createDuration.fn = Duration.prototype; + createDuration.invalid = createInvalid$1; + + 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 = {}; + 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; + } // 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). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); + tmp = val; + val = period; + period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } + + function 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 (months) { + setMonth(mom, get(mom, 'Month') + months * isAdding); + } + + if (days) { + set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); + } + + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + + if (updateOffset) { + hooks.updateOffset(mom, days || months); + } + } + + var add = createAdder(1, 'add'); + var subtract = createAdder(-1, 'subtract'); + + function getCalendarFormat(myMoment, now) { + var diff = myMoment.diff(now, 'days', true); + return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; + } + + function calendar$1(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 || createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + format = hooks.calendarFormat(this, sod) || 'sameElse'; + var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); + } + + function clone() { + return new Moment(this); + } + + function isAfter(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(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 : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(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) { + var localFrom = isMoment(from) ? from : createLocal(from), + localTo = isMoment(to) ? to : createLocal(to); + + if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { + return false; + } + + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); + } + + function isSame(input, units) { + var localInput = isMoment(input) ? input : 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, output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); + + switch (units) { + case 'year': + output = monthDiff(this, that) / 12; + break; + + case 'month': + output = monthDiff(this, that); + break; + + case 'quarter': + output = monthDiff(this, that) / 3; + break; + + case 'second': + output = (this - that) / 1e3; + break; + // 1000 + + case 'minute': + output = (this - that) / 6e4; + break; + // 1000 * 60 + + case 'hour': + output = (this - that) / 36e5; + break; + // 1000 * 60 * 60 + + case 'day': + output = (this - that - zoneDelta) / 864e5; + break; + // 1000 * 60 * 60 * 24, negate dst + + case 'week': + output = (this - that - zoneDelta) / 6048e5; + break; + // 1000 * 60 * 60 * 24 * 7, negate dst + + default: + output = this - that; + } + + 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; + } + + hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + 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 toISOString(keepOffset) { + if (!this.isValid()) { + return null; + } + + var utc = keepOffset !== true; + var m = utc ? this.clone().utc() : this; + + if (m.year() < 0 || m.year() > 9999) { + return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + + if (isFunction(Date.prototype.toISOString)) { + // native implementation is ~50x faster, use it when we can + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); + } + } + + return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + /** + * Return a human readable representation of a moment that can + * also be evaluated to get a new moment which is the same + * + * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects + */ + + + function inspect() { + if (!this.isValid()) { + return 'moment.invalid(/* ' + this._i + ' */)'; + } + + var func = 'moment'; + var zone = ''; + + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; + zone = 'Z'; + } + + var prefix = '[' + func + '("]'; + var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; + var datetime = '-MM-DD[T]HH:mm:ss.SSS'; + var suffix = zone + '[")]'; + return this.format(prefix + year + datetime + suffix); + } + + function format(inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; + } + + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + + function from(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + to: this, + from: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow(withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } + + function to(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + from: this, + to: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow(withoutSuffix) { + return this.to(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 = 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; + } + + var MS_PER_SECOND = 1000; + var MS_PER_MINUTE = 60 * MS_PER_SECOND; + var MS_PER_HOUR = 60 * MS_PER_MINUTE; + var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): + + function mod$1(dividend, divisor) { + return (dividend % divisor + divisor) % divisor; + } + + function localStartOfDate(y, m, d) { + // the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + return new Date(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return new Date(y, m, d).valueOf(); + } + } + + function utcStartOfDate(y, m, d) { + // Date.UTC remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return Date.UTC(y, m, d); + } + } + + function startOf(units) { + var time; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year(), 0, 1); + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3, 1); + break; + + case 'month': + time = startOfDate(this.year(), this.month(), 1); + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date()); + break; + + case 'hour': + time = this._d.valueOf(); + time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); + break; + + case 'minute': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_MINUTE); + break; + + case 'second': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_SECOND); + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function endOf(units) { + var time; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year() + 1, 0, 1) - 1; + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; + break; + + case 'month': + time = startOfDate(this.year(), this.month() + 1, 1) - 1; + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; + break; + + case 'hour': + time = this._d.valueOf(); + time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; + break; + + case 'minute': + time = this._d.valueOf(); + time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; + break; + + case 'second': + time = this._d.valueOf(); + time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function valueOf() { + return this._d.valueOf() - (this._offset || 0) * 60000; + } + + function unix() { + return Math.floor(this.valueOf() / 1000); + } + + function toDate() { + return new Date(this.valueOf()); + } + + 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 isValid$2() { + return 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'); // PRIORITY + + addUnitPriority('weekYear', 1); + addUnitPriority('isoWeekYear', 1); // 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] = 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'); // PRIORITY + + addUnitPriority('quarter', 7); // 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('D', ['DD', 2], 'Do', 'date'); // ALIASES + + addUnitAlias('date', 'D'); // PRIORITY + + addUnitPriority('date', 9); // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + // TODO: Remove "ordinalParse" fallback in next major release. + return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; + }); + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0]); + }); // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); // PRIORITY + + addUnitPriority('dayOfYear', 4); // 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 + + + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES + + addUnitAlias('minute', 'm'); // PRIORITY + + addUnitPriority('minute', 14); // 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'); // PRIORITY + + addUnitPriority('second', 15); // 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'); // PRIORITY + + addUnitPriority('millisecond', 16); // 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 proto = Moment.prototype; + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$2; + proto.lang = lang; + proto.locale = locale; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + proto.quarter = proto.quarters = getSetQuarter; + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.isoWeeksInYear = getISOWeeksInYear; + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + proto.hour = proto.hours = getSetHour; + proto.minute = proto.minutes = getSetMinute; + proto.second = proto.seconds = getSetSecond; + proto.millisecond = proto.milliseconds = getSetMillisecond; + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); + proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); + + function createUnix(input) { + return createLocal(input * 1000); + } + + function createInZone() { + return createLocal.apply(null, arguments).parseZone(); + } + + function preParsePostFormat(string) { + return string; + } + + var proto$1 = Locale.prototype; + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set; + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + + function get$1(format, index, field, setter) { + var locale = getLocale(); + var utc = createUTC().set(setter, index); + return locale[field](utc, format); + } + + function listMonthsImpl(format, index, field) { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return get$1(format, index, field, 'month'); + } + + var i; + var out = []; + + for (i = 0; i < 12; i++) { + out[i] = get$1(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 (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = getLocale(), + shift = localeSorted ? locale._week.dow : 0; + + if (index != null) { + return get$1(format, (index + shift) % 7, field, 'day'); + } + + var i; + var out = []; + + for (i = 0; i < 7; i++) { + out[i] = get$1(format, (i + shift) % 7, field, 'day'); + } + + return out; + } + + function listMonths(format, index) { + return listMonthsImpl(format, index, 'months'); + } + + function listMonthsShort(format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } + + function listWeekdays(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } + + function listWeekdaysShort(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } + + function listWeekdaysMin(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } + + getSetGlobalLocale('en', { + dayOfMonthOrdinalParse: /\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 + + hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); + hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); + var mathAbs = Math.abs; + + function 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 addSubtract$1(duration, input, value, direction) { + var other = 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 add$1(input, value) { + return addSubtract$1(this, input, value, 1); + } // supports only 2.0-style subtract(1, 's') or subtract(duration) + + + function subtract$1(input, value) { + return addSubtract$1(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) { + if (!this.isValid()) { + return NaN; + } + + var days; + var months; + var milliseconds = this._milliseconds; + units = normalizeUnits(units); + + if (units === 'month' || units === 'quarter' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + + switch (units) { + case 'month': + return months; + + case 'quarter': + return months / 3; + + case 'year': + return 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 valueOf$1() { + if (!this.isValid()) { + return NaN; + } + + 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 asQuarters = makeAs('Q'); + var asYears = makeAs('y'); + + function clone$1() { + return createDuration(this); + } + + function get$2(units) { + units = normalizeUnits(units); + return this.isValid() ? this[units + 's']() : NaN; + } + + function makeGetter(name) { + return function () { + return this.isValid() ? this._data[name] : NaN; + }; + } + + 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 = { + ss: 44, + // a few seconds to seconds + 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 relativeTime$1(posNegDuration, withoutSuffix, locale) { + var duration = 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.ss && ['s', seconds] || seconds < thresholds.s && ['ss', 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 the rounding function for relative time strings + + + function getSetRelativeTimeRounding(roundingFunction) { + if (roundingFunction === undefined) { + return round; + } + + if (typeof roundingFunction === 'function') { + round = roundingFunction; + return true; + } + + return false; + } // This function allows you to set a threshold for relative time strings + + + function getSetRelativeTimeThreshold(threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + + if (limit === undefined) { + return thresholds[threshold]; + } + + thresholds[threshold] = limit; + + if (threshold === 's') { + thresholds.ss = limit - 1; + } + + return true; + } + + function humanize(withSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var locale = this.localeData(); + var output = relativeTime$1(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var abs$1 = Math.abs; + + function sign(x) { + return (x > 0) - (x < 0) || +x; + } + + function toISOString$1() { + // 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) + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var seconds = abs$1(this._milliseconds) / 1000; + var days = abs$1(this._days); + var months = abs$1(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 ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; + 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'; + } + + var totalSign = total < 0 ? '-' : ''; + var ymSign = sign(this._months) !== sign(total) ? '-' : ''; + var daysSign = sign(this._days) !== sign(total) ? '-' : ''; + var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; + return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : ''); + } + + var proto$2 = Duration.prototype; + proto$2.isValid = isValid$1; + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asQuarters = asQuarters; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.clone = clone$1; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale; + proto$2.localeData = localeData; + proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); + proto$2.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 + + hooks.version = '2.24.0'; + setHookCallback(createLocal); + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats + + hooks.HTML5_FMT = { + DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', + // + DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', + // + DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', + // + DATE: 'YYYY-MM-DD', + // + TIME: 'HH:mm', + // + TIME_SECONDS: 'HH:mm:ss', + // + TIME_MS: 'HH:mm:ss.SSS', + // + WEEK: 'GGGG-[W]WW', + // + MONTH: 'YYYY-MM' // + + }; + return hooks; + }); +}); // Maps for number <-> hex string conversion + +var byteToHex = []; + +for (var i = 0; i < 256; i++) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} +/** + * Represent binary UUID into it's string representation. + * + * @param buf - Buffer containing UUID bytes. + * @param offset - Offset from the start of the buffer where the UUID is saved (not needed if the buffer starts with the UUID). + * + * @returns String representation of the UUID. + */ + + +function stringifyUUID(buf, offset) { + var i = offset || 0; + var 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++]]; +} +/** + * Generate 16 random bytes to be used as a base for UUID. + * + * @ignore + */ + + +var random = function () { + if (typeof crypto !== 'undefined' && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + + return function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; + } // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). + // It's fast, but is of unspecified quality. + + + var _rnds = new Array(16); + + return function () { + 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 + // return require('./rng'); +}(); + +var byteToHex$1 = []; + +for (var i$1 = 0; i$1 < 256; i$1++) { + byteToHex$1[i$1] = (i$1 + 0x100).toString(16).substr(1); +} // **`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 = random(); // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + +var defaultNodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; // Per 4.2.2, randomize (14 bit) clockseq + +var defaultClockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; // Previous uuid creation time + +/** + * UUIDv4 options. + */ + +/** + * Generate UUIDv4 + * + * @param options - Options to be used instead of default generated values. + * String 'binary' is a shorthand for uuid4({}, new Array(16)). + * @param buf - If present the buffer will be filled with the generated UUID. + * @param offset - Offset of the UUID from the start of the buffer. + * + * @returns UUIDv4 + */ + +function uuid4() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var buf = arguments.length > 1 ? arguments[1] : undefined; + var offset = arguments.length > 2 ? arguments[2] : undefined; // Deprecated - 'format' argument, as supported in v1.2 + + var i = buf && offset || 0; + + if (typeof options === 'string') { + buf = options === 'binary' ? new Array(16) : undefined; + options = {}; + } + + var rnds = options.random || (options.rng || random)(); // 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 || stringifyUUID(rnds); +} // Rollup will complain about mixing default and named exports in UMD build, + + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + keys.push.apply(keys, Object.getOwnPropertySymbols(object)); + } + + if (enumerableOnly) keys = keys.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + return keys; +} + +function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; +} // for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/' +// code from http://momentjs.com/ + + +var ASPDateRegex = /^\/?Date\((-?\d+)/i; // Hex color + +var fullHexRE = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i; +var shortHexRE = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; +/** + * Hue, Saturation, Value. + */ + +/** + * Test whether given object is a number + * + * @param value - Input value of unknown type. + * + * @returns True if number, false otherwise. + */ + +function isNumber(value) { + return value instanceof Number || typeof value === 'number'; +} +/** + * Remove everything in the DOM object + * + * @param DOMobject - Node whose child nodes will be recursively deleted. + */ + + +function recursiveDOMDelete(DOMobject) { + if (DOMobject) { + while (DOMobject.hasChildNodes() === true) { + var child = DOMobject.firstChild; + + if (child) { + recursiveDOMDelete(child); + DOMobject.removeChild(child); + } + } + } +} +/** + * Test whether given object is a string + * + * @param value - Input value of unknown type. + * + * @returns True if string, false otherwise. + */ + + +function isString(value) { + return value instanceof String || typeof value === 'string'; +} +/** + * Test whether given object is a object (not primitive or null). + * + * @param value - Input value of unknown type. + * + * @returns True if not null object, false otherwise. + */ + + +function isObject(value) { + return _typeof_1(value) === 'object' && value !== null; +} +/** + * Test whether given object is a Date, or a String containing a Date + * + * @param value - Input value of unknown type. + * + * @returns True if Date instance or string date representation, false otherwise. + */ + + +function isDate(value) { + if (value instanceof Date) { + return true; + } else if (isString(value)) { + // test whether this string contains a date + var match = ASPDateRegex.exec(value); + + if (match) { + return true; + } else if (!isNaN(Date.parse(value))) { + return true; + } + } + + return false; +} +/** + * Test whether given object is a Moment date. + * @TODO: This is basically a workaround, if Moment was imported property it wouldn't necessary as moment.isMoment is a TS type guard. + * + * @param value - Input value of unknown type. + * + * @returns True if Moment instance, false otherwise. + */ + + +function isMoment(value) { + return moment.isMoment(value); +} +/** + * Copy property from b to a if property present in a. + * If property in b explicitly set to null, delete it if `allowDeletion` set. + * + * Internal helper routine, should not be exported. Not added to `exports` for that reason. + * + * @param a - Target object. + * @param b - Source object. + * @param prop - Name of property to copy from b to a. + * @param allowDeletion if true, delete property in a if explicitly set to null in b + */ + + +function copyOrDelete(a, b, prop, allowDeletion) { + var doDeletion = false; + + if (allowDeletion === true) { + doDeletion = b[prop] === null && a[prop] !== undefined; + } + + if (doDeletion) { + delete a[prop]; + } else { + a[prop] = b[prop]; // Remember, this is a reference copy! + } +} +/** + * Fill an object with a possibly partially defined other object. + * + * Only copies values for the properties already present in a. + * That means an object is not created on a property if only the b object has it. + * + * @param a - The object that will have it's properties updated. + * @param b - The object with property updates. + * @param allowDeletion - if true, delete properties in a that are explicitly set to null in b + */ + + +function fillIfDefined(a, b) { + var allowDeletion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; // NOTE: iteration of properties of a + // NOTE: prototype properties iterated over as well + + for (var prop in a) { + if (b[prop] !== undefined) { + if (b[prop] === null || _typeof_1(b[prop]) !== 'object') { + // Note: typeof null === 'object' + copyOrDelete(a, b, prop, allowDeletion); + } else { + var aProp = a[prop]; + var bProp = b[prop]; + + if (isObject(aProp) && isObject(bProp)) { + fillIfDefined(aProp, bProp, allowDeletion); + } + } + } + } +} +/** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * + * @param target - The target object to copy to. + * @param source - The source object from which to copy properties. + * + * @return The target object. + */ + + +var extend = Object.assign; +/** + * Extend object a with selected properties of object b or a series of objects + * Only properties with defined values are copied + * + * @param props - Properties to be copied to a. + * @param a - The target. + * @param others - The sources. + * + * @returns Argument a. + */ + +function selectiveExtend(props, a) { + if (!Array.isArray(props)) { + throw new Error('Array with property names expected as first argument'); + } + + for (var _len = arguments.length, others = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + others[_key - 2] = arguments[_key]; + } + + for (var _i = 0, _others = others; _i < _others.length; _i++) { + var other = _others[_i]; + + for (var p = 0; p < props.length; p++) { + var prop = props[p]; + + if (other && Object.prototype.hasOwnProperty.call(other, prop)) { + a[prop] = other[prop]; + } + } + } + + return a; +} +/** + * Extend object a with selected properties of object b. + * Only properties with defined values are copied. + * + * **Note:** Previous version of this routine implied that multiple source objects + * could be used; however, the implementation was **wrong**. + * Since multiple (>1) sources weren't used anywhere in the `vis.js` code, + * this has been removed + * + * @param props - Names of first-level properties to copy over. + * @param a - Target object. + * @param b - Source object. + * @param allowDeletion - If true, delete property in a if explicitly set to null in b. + * + * @returns Argument a. + */ + + +function selectiveDeepExtend(props, a, b) { + var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; // TODO: add support for Arrays to deepExtend + + if (Array.isArray(b)) { + throw new TypeError('Arrays are not supported by deepExtend'); + } + + for (var p = 0; p < props.length; p++) { + var prop = props[p]; + + if (Object.prototype.hasOwnProperty.call(b, prop)) { + if (b[prop] && b[prop].constructor === Object) { + if (a[prop] === undefined) { + a[prop] = {}; + } + + if (a[prop].constructor === Object) { + deepExtend(a[prop], b[prop], false, allowDeletion); + } else { + copyOrDelete(a, b, prop, allowDeletion); + } + } else if (Array.isArray(b[prop])) { + throw new TypeError('Arrays are not supported by deepExtend'); + } else { + copyOrDelete(a, b, prop, allowDeletion); + } + } + } + + return a; +} +/** + * Extend object `a` with properties of object `b`, ignoring properties which are explicitly + * specified to be excluded. + * + * The properties of `b` are considered for copying. + * Properties which are themselves objects are are also extended. + * Only properties with defined values are copied + * + * @param propsToExclude - Names of properties which should *not* be copied. + * @param a - Object to extend. + * @param b - Object to take properties from for extension. + * @param allowDeletion - If true, delete properties in a that are explicitly set to null in b. + * + * @returns Argument a. + */ + + +function selectiveNotDeepExtend(propsToExclude, a, b) { + var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; // TODO: add support for Arrays to deepExtend + // NOTE: array properties have an else-below; apparently, there is a problem here. + + if (Array.isArray(b)) { + throw new TypeError('Arrays are not supported by deepExtend'); + } + + for (var prop in b) { + if (!Object.prototype.hasOwnProperty.call(b, prop)) { + continue; + } // Handle local properties only + + + if (propsToExclude.indexOf(prop) !== -1) { + continue; + } // In exclusion list, skip + + + if (b[prop] && b[prop].constructor === Object) { + if (a[prop] === undefined) { + a[prop] = {}; + } + + if (a[prop].constructor === Object) { + deepExtend(a[prop], b[prop]); // NOTE: allowDeletion not propagated! + } else { + copyOrDelete(a, b, prop, allowDeletion); + } + } else if (Array.isArray(b[prop])) { + a[prop] = []; + + for (var i = 0; i < b[prop].length; i++) { + a[prop].push(b[prop][i]); + } + } else { + copyOrDelete(a, b, prop, allowDeletion); + } + } + + return a; +} +/** + * Deep extend an object a with the properties of object b + * + * @param a - Target object. + * @param b - Source object. + * @param protoExtend - If true, the prototype values will also be extended + * (ie. the options objects that inherit from others will also get the inherited options). + * @param allowDeletion - If true, the values of fields that are null will be deleted. + * + * @returns Argument a. + */ + + +function deepExtend(a, b) { + var protoExtend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + for (var prop in b) { + if (Object.prototype.hasOwnProperty.call(b, prop) || protoExtend === true) { + if (b[prop] && b[prop].constructor === Object) { + if (a[prop] === undefined) { + a[prop] = {}; + } + + if (a[prop].constructor === Object) { + deepExtend(a[prop], b[prop], protoExtend); // NOTE: allowDeletion not propagated! + } else { + copyOrDelete(a, b, prop, allowDeletion); + } + } else if (Array.isArray(b[prop])) { + a[prop] = []; + + for (var i = 0; i < b[prop].length; i++) { + a[prop].push(b[prop][i]); + } + } else { + copyOrDelete(a, b, prop, allowDeletion); + } + } + } + + return a; +} +/** + * Test whether all elements in two arrays are equal. + * + * @param a - First array. + * @param b - Second array. + * + * @returns True if both arrays have the same length and same elements (1 = '1'). + */ + + +function equalArray(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 into another type + * + * @param object - Value of unknown type. + * @param type - Name of the desired type. + * + * @returns Object in the desired type. + * @throws Error + */ + + +function convert(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': + if (isString(object) && !isNaN(Date.parse(object))) { + return moment(object).valueOf(); + } else { + // @TODO: I don't think that Number and String constructors are a good idea. + // This could also fail if the object doesn't have valueOf method or if it's redefined. + // For example: Object.create(null) or { valueOf: 7 }. + return Number(object.valueOf()); + } + + case 'string': + case 'String': + return String(object); + + case 'Date': + if (isNumber(object)) { + return new Date(object); + } + + if (object instanceof Date) { + return new Date(object.valueOf()); + } else if (isMoment(object)) { + return new Date(object.valueOf()); + } + + if (isString(object)) { + match = ASPDateRegex.exec(object); + + if (match) { + // object is an ASP date + return new Date(Number(match[1])); // parse number + } else { + return moment(new Date(object)).toDate(); // parse string + } + } else { + throw new Error('Cannot convert object of type ' + getType(object) + ' to type Date'); + } + + case 'Moment': + if (isNumber(object)) { + return moment(object); + } + + if (object instanceof Date) { + return moment(object.valueOf()); + } else if (isMoment(object)) { + return moment(object); + } + + if (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 ' + getType(object) + ' to type Date'); + } + + case 'ISODate': + if (isNumber(object)) { + return new Date(object); + } else if (object instanceof Date) { + return object.toISOString(); + } else if (isMoment(object)) { + return object.toDate().toISOString(); + } else if (isString(object)) { + match = ASPDateRegex.exec(object); + + if (match) { + // object is an ASP date + return new Date(Number(match[1])).toISOString(); // parse number + } else { + return moment(object).format(); // ISO 8601 + } + } else { + throw new Error('Cannot convert object of type ' + getType(object) + ' to type ISODate'); + } + + case 'ASPDate': + if (isNumber(object)) { + return '/Date(' + object + ')/'; + } else if (object instanceof Date || isMoment(object)) { + return '/Date(' + object.valueOf() + ')/'; + } else if (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 ' + getType(object) + ' to type ASPDate'); + } + + default: + var never = type; + throw new Error("Unknown type ".concat(never)); + } +} +/** + * Get the type of an object, for example exports.getType([]) returns 'Array' + * + * @param object - Input value of unknown type. + * + * @returns Detected type. + */ + + +function getType(object) { + var type = _typeof_1(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'; + } + + if (type === 'number') { + return 'Number'; + } + + if (type === 'boolean') { + return 'Boolean'; + } + + if (type === 'string') { + return 'String'; + } + + if (type === undefined) { + return 'undefined'; + } + + return type; +} +/** + * Used to extend an array and copy it. This is used to propagate paths recursively. + * + * @param arr - First part. + * @param newValue - The value to be aadded into the array. + * + * @returns A new array with all items from arr and newValue (which is last). + */ + + +function copyAndExtendArray(arr, newValue) { + return [].concat(toConsumableArray(arr), [newValue]); +} +/** + * Used to extend an array and copy it. This is used to propagate paths recursively. + * + * @param arr - The array to be copied. + * + * @returns Shallow copy of arr. + */ + + +function copyArray(arr) { + return arr.slice(); +} +/** + * Retrieve the absolute left value of a DOM element + * + * @param elem - A dom element, for example a div. + * + * @returns The absolute left position of this element in the browser page. + */ + + +function getAbsoluteLeft(elem) { + return elem.getBoundingClientRect().left; +} +/** + * Retrieve the absolute right value of a DOM element + * + * @param elem - A dom element, for example a div. + * + * @returns The absolute right position of this element in the browser page. + */ + + +function getAbsoluteRight(elem) { + return elem.getBoundingClientRect().right; +} +/** + * Retrieve the absolute top value of a DOM element + * + * @param elem - A dom element, for example a div. + * + * @returns The absolute top position of this element in the browser page. + */ + + +function getAbsoluteTop(elem) { + return elem.getBoundingClientRect().top; +} +/** + * Add a className to the given elements style. + * + * @param elem - The element to which the classes will be added. + * @param classNames - Space separated list of classes. + */ + + +function addClassName(elem, classNames) { + var classes = elem.className.split(' '); + var newClasses = classNames.split(' '); + classes = classes.concat(newClasses.filter(function (className) { + return classes.indexOf(className) < 0; + })); + elem.className = classes.join(' '); +} +/** + * Remove a className from the given elements style. + * + * @param elem - The element from which the classes will be removed. + * @param classNames - Space separated list of classes. + */ + + +function removeClassName(elem, classNames) { + var classes = elem.className.split(' '); + var oldClasses = classNames.split(' '); + classes = classes.filter(function (className) { + return oldClasses.indexOf(className) < 0; + }); + elem.className = classes.join(' '); +} +/** + * For each method for both arrays and objects. + * In case of an array, the built-in Array.forEach() is applied (**No, it's not!**). + * In case of an Object, the method loops over all properties of the object. + * + * @param object - An Object or Array to be iterated over. + * @param callback - Array.forEach-like callback. + */ + + +function forEach(object, callback) { + if (Array.isArray(object)) { + // array + var len = object.length; + + for (var i = 0; i < len; i++) { + callback(object[i], i, object); + } + } else { + // object + for (var _key2 in object) { + if (Object.prototype.hasOwnProperty.call(object, _key2)) { + callback(object[_key2], _key2, object); + } + } + } +} +/** + * Convert an object into an array: all objects properties are put into the array. The resulting array is unordered. + * + * @param o - Object that contains the properties and methods. + * + * @returns An array of unordered values. + */ + + +var toArray = Object.values; +/** + * Update a property in an object + * + * @param object - The object whose property will be updated. + * @param key - Name of the property to be updated. + * @param value - The new value to be assigned. + * + * @returns Whether the value was updated (true) or already strictly the same in the original object (false). + */ + +function updateProperty(object, key, value) { + if (object[key] !== value) { + object[key] = value; + return true; + } else { + return false; + } +} +/** + * Throttle the given function to be only executed once per animation frame. + * + * @param fn - The original function. + * + * @returns The throttled function. + */ + + +function throttle(fn) { + var scheduled = false; + return function () { + if (!scheduled) { + scheduled = true; + requestAnimationFrame(function () { + scheduled = false; + fn(); + }); + } + }; +} +/** + * Add and event listener. Works for all browsers. + * + * @param element - The element to bind the event listener to. + * @param action - Same as Element.addEventListener(action, —, —). + * @param listener - Same as Element.addEventListener(—, listener, —). + * @param useCapture - Same as Element.addEventListener(—, —, useCapture). + */ + + +function addEventListener(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 - The element to bind the event listener to. + * @param action - Same as Element.removeEventListener(action, —, —). + * @param listener - Same as Element.removeEventListener(—, listener, —). + * @param useCapture - Same as Element.removeEventListener(—, —, useCapture). + */ + + +function removeEventListener(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 { + element.detachEvent('on' + action, listener); // IE browsers + } +} +/** + * Cancels the event's default action if it is cancelable, without stopping further propagation of the event. + * + * @param event - The event whose default action should be prevented. + */ + + +function preventDefault(event) { + if (!event) { + event = window.event; + } + + if (!event) ;else 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 - The event. + * + * @returns The element or null if not obtainable. + */ + + +function getTarget() { + var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.event; // code from http://www.quirksmode.org/js/events_properties.html + // @TODO: EventTarget can be almost anything, is it okay to return only Elements? + + var target = null; + if (!event) ;else if (event.target) { + target = event.target; + } else if (event.srcElement) { + target = event.srcElement; + } + + if (!(target instanceof Element)) { + return null; + } + + if (target.nodeType != null && target.nodeType == 3) { + // defeat Safari bug + target = target.parentNode; + + if (!(target instanceof Element)) { + return null; + } + } + + return target; +} +/** + * Check if given element contains given parent somewhere in the DOM tree + * + * @param element - The element to be tested. + * @param parent - The ancestor (not necessarily parent) of the element. + * + * @returns True if parent is an ancestor of the element, false otherwise. + */ + + +function hasParent(element, parent) { + var elem = element; + + while (elem) { + if (elem === parent) { + return true; + } else if (elem.parentNode) { + elem = elem.parentNode; + } else { + return false; + } + } + + return false; +} + +var option = { + /** + * Convert a value into a boolean. + * + * @param value - Value to be converted intoboolean, a function will be executed as (() => unknown). + * @param defaultValue - If the value or the return value of the function == null then this will be returned. + * + * @returns Corresponding boolean value, if none then the default value, if none then null. + */ + asBoolean: function asBoolean(value, defaultValue) { + if (typeof value == 'function') { + value = value(); + } + + if (value != null) { + return value != false; + } + + return defaultValue || null; + }, + + /** + * Convert a value into a number. + * + * @param value - Value to be converted intonumber, a function will be executed as (() => unknown). + * @param defaultValue - If the value or the return value of the function == null then this will be returned. + * + * @returns Corresponding **boxed** number value, if none then the default value, if none then null. + */ + asNumber: function asNumber(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 value - Value to be converted intostring, a function will be executed as (() => unknown). + * @param defaultValue - If the value or the return value of the function == null then this will be returned. + * + * @returns Corresponding **boxed** string value, if none then the default value, if none then null. + */ + asString: function asString(value, defaultValue) { + if (typeof value == 'function') { + value = value(); + } + + if (value != null) { + return String(value); + } + + return defaultValue || null; + }, + + /** + * Convert a value into a size. + * + * @param value - Value to be converted intosize, a function will be executed as (() => unknown). + * @param defaultValue - If the value or the return value of the function == null then this will be returned. + * + * @returns Corresponding string value (number + 'px'), if none then the default value, if none then null. + */ + asSize: function asSize(value, defaultValue) { + if (typeof value == 'function') { + value = value(); + } + + if (isString(value)) { + return value; + } else if (isNumber(value)) { + return value + 'px'; + } else { + return defaultValue || null; + } + }, + + /** + * Convert a value into a DOM Element. + * + * @param value - Value to be converted into DOM Element, a function will be executed as (() => unknown). + * @param defaultValue - If the value or the return value of the function == null then this will be returned. + * + * @returns The DOM Element, if none then the default value, if none then null. + */ + asElement: function asElement(value, defaultValue) { + if (typeof value == 'function') { + value = value(); + } + + return value || defaultValue || null; + } +}; +/** + * Convert hex color string into RGB color object. + * http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb + * + * @param hex - Hex color string (3 or 6 digits, with or without #). + * + * @returns RGB color object. + */ + +function hexToRGB(hex) { + var result; + + switch (hex.length) { + case 3: + case 4: + result = shortHexRE.exec(hex); + return result ? { + r: parseInt(result[1] + result[1], 16), + g: parseInt(result[2] + result[2], 16), + b: parseInt(result[3] + result[3], 16) + } : null; + + case 6: + case 7: + result = fullHexRE.exec(hex); + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null; + + default: + return null; + } +} +/** + * This function takes string color in hex or RGB format and adds the opacity, RGBA is passed through unchanged. + * + * @param color - The color string (hex, RGB, RGBA). + * @param opacity - The new opacity. + * + * @returns RGBA string, for example 'rgba(255, 0, 127, 0.3)'. + */ + + +function overrideOpacity(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 = hexToRGB(color); + + if (_rgb == null) { + return color; + } else { + return 'rgba(' + _rgb.r + ',' + _rgb.g + ',' + _rgb.b + ',' + opacity + ')'; + } + } +} +/** + * Convert RGB <0, 255> into hex color string. + * + * @param red - Red channel. + * @param green - Green channel. + * @param blue - Blue channel. + * + * @returns Hex color string (for example: '#0acdc0'). + */ + + +function RGBToHex(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 inputColor - Shorthand color string or input color object. + * @param defaultColor - Full color object to fill in missing values in inputColor. + * + * @returns Color object. + */ + + +function parseColor(inputColor, defaultColor) { + if (isString(inputColor)) { + var colorStr = inputColor; + + if (isValidRGB(colorStr)) { + var rgb = colorStr.substr(4).substr(0, colorStr.length - 5).split(',').map(function (value) { + return parseInt(value); + }); + colorStr = RGBToHex(rgb[0], rgb[1], rgb[2]); + } + + if (isValidHex(colorStr) === true) { + var hsv = hexToHSV(colorStr); + 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 = HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v); + var lighterColorHex = HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v); + return { + background: colorStr, + border: darkerColorHex, + highlight: { + background: lighterColorHex, + border: darkerColorHex + }, + hover: { + background: lighterColorHex, + border: darkerColorHex + } + }; + } else { + return { + background: colorStr, + border: colorStr, + highlight: { + background: colorStr, + border: colorStr + }, + hover: { + background: colorStr, + border: colorStr + } + }; + } + } else { + if (defaultColor) { + var color = { + background: inputColor.background || defaultColor.background, + border: inputColor.border || defaultColor.border, + highlight: isString(inputColor.highlight) ? { + border: inputColor.highlight, + background: inputColor.highlight + } : { + background: inputColor.highlight && inputColor.highlight.background || defaultColor.highlight.background, + border: inputColor.highlight && inputColor.highlight.border || defaultColor.highlight.border + }, + hover: isString(inputColor.hover) ? { + border: inputColor.hover, + background: inputColor.hover + } : { + border: inputColor.hover && inputColor.hover.border || defaultColor.hover.border, + background: inputColor.hover && inputColor.hover.background || defaultColor.hover.background + } + }; + return color; + } else { + var _color = { + background: inputColor.background || undefined, + border: inputColor.border || undefined, + highlight: isString(inputColor.highlight) ? { + border: inputColor.highlight, + background: inputColor.highlight + } : { + background: inputColor.highlight && inputColor.highlight.background || undefined, + border: inputColor.highlight && inputColor.highlight.border || undefined + }, + hover: isString(inputColor.hover) ? { + border: inputColor.hover, + background: inputColor.hover + } : { + border: inputColor.hover && inputColor.hover.border || undefined, + background: inputColor.hover && inputColor.hover.background || undefined + } + }; + return _color; + } + } +} +/** + * Convert RGB <0, 255> into HSV object. + * http://www.javascripter.net/faq/rgb2hsv.htm + * + * @param red - Red channel. + * @param green - Green channel. + * @param blue - Blue channel. + * + * @returns HSV color object. + */ + + +function RGBToHSV(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 _key3 = parts[0].trim(); + + var _value2 = parts[1].trim(); + + styles[_key3] = _value2; + } + }); + 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 - The element that will receive new styles. + * @param cssText - The styles to be appended. + */ + +function addCssText(element, cssText) { + var currentStyles = cssUtil.split(element.style.cssText); + var newStyles = cssUtil.split(cssText); + + var styles = _objectSpread({}, currentStyles, {}, newStyles); + + element.style.cssText = cssUtil.join(styles); +} +/** + * Remove a string with css styles from an element + * + * @param element - The element from which styles should be removed. + * @param cssText - The styles to be removed. + */ + + +function removeCssText(element, cssText) { + var styles = cssUtil.split(element.style.cssText); + var removeStyles = cssUtil.split(cssText); + + for (var _key4 in removeStyles) { + if (Object.prototype.hasOwnProperty.call(removeStyles, _key4)) { + delete styles[_key4]; + } + } + + element.style.cssText = cssUtil.join(styles); +} +/** + * Convert HSV <0, 1> into RGB color object. + * https://gist.github.com/mjijackson/5311256 + * + * @param h - Hue + * @param s - Saturation + * @param v - Value + * + * @returns RGB color object. + */ + + +function HSVToRGB(h, s, v) { + var r; + var g; + var 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) + }; +} +/** + * Convert HSV <0, 1> into hex color string. + * + * @param h - Hue + * @param s - Saturation + * @param v - Value + * + * @returns Hex color string. + */ + + +function HSVToHex(h, s, v) { + var rgb = HSVToRGB(h, s, v); + return RGBToHex(rgb.r, rgb.g, rgb.b); +} +/** + * Convert hex color string into HSV <0, 1>. + * + * @param hex - Hex color string. + * + * @returns HSV color object. + */ + + +function hexToHSV(hex) { + var rgb = hexToRGB(hex); + + if (!rgb) { + throw new TypeError("'".concat(hex, "' is not a valid color.")); + } + + return RGBToHSV(rgb.r, rgb.g, rgb.b); +} +/** + * Validate hex color string. + * + * @param hex - Unknown string that may contain a color. + * + * @returns True if the string is valid, false otherwise. + */ + + +function isValidHex(hex) { + var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex); + return isOk; +} +/** + * Validate RGB color string. + * + * @param rgb - Unknown string that may contain a color. + * + * @returns True if the string is valid, false otherwise. + */ + + +function isValidRGB(rgb) { + rgb = rgb.replace(' ', ''); + var isOk = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(rgb); + return isOk; +} +/** + * Validate RGBA color string. + * + * @param rgba - Unknown string that may contain a color. + * + * @returns True if the string is valid, false otherwise. + */ + + +function isValidRGBA(rgba) { + rgba = rgba.replace(' ', ''); + var isOk = /rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(0?.{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 fields - Names of properties to be bridged. + * @param referenceObject - The original object. + * + * @returns A new object inheriting from the referenceObject. + */ + + +function selectiveBridgeObject(fields, referenceObject) { + if (referenceObject !== null && _typeof_1(referenceObject) === 'object') { + // !!! typeof null === 'object' + var objectTo = Object.create(referenceObject); + + for (var i = 0; i < fields.length; i++) { + if (Object.prototype.hasOwnProperty.call(referenceObject, fields[i])) { + if (_typeof_1(referenceObject[fields[i]]) == 'object') { + objectTo[fields[i]] = 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 - The original object. + * + * @returns The Element if the referenceObject is an Element, or a new object inheriting from the referenceObject. + */ + + +function bridgeObject(referenceObject) { + if (referenceObject === null || _typeof_1(referenceObject) !== 'object') { + return null; + } + + if (referenceObject instanceof Element) { + // Avoid bridging DOM objects + return referenceObject; + } + + var objectTo = Object.create(referenceObject); + + for (var i in referenceObject) { + if (Object.prototype.hasOwnProperty.call(referenceObject, i)) { + if (_typeof_1(referenceObject[i]) == 'object') { + objectTo[i] = bridgeObject(referenceObject[i]); + } + } + } + + return objectTo; +} +/** + * This method provides a stable sort implementation, very fast for presorted data. + * + * @param a - The array to be sorted (in-place). + * @param compare - An order comparator. + * + * @returns The argument a. + */ + + +function insertSort(a, compare) { + for (var i = 0; i < a.length; i++) { + var k = a[i]; + var j = void 0; + + for (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. + * + * The added value here of the merge is that option 'enabled' is set as required. + * + * @param mergeTarget - Either this.options or the options used for the groups. + * @param options - Options. + * @param option - Option key in the options argument. + * @param globalOptions - Global options, passed in to determine value of option 'enabled'. + */ + + +function mergeOptions(mergeTarget, options, option) { + var globalOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; // Local helpers + + var isPresent = function isPresent(obj) { + return obj !== null && obj !== undefined; + }; + + var isObject = function isObject(obj) { + return obj !== null && _typeof_1(obj) === 'object'; + }; // https://stackoverflow.com/a/34491287/1223531 + + + var isEmpty = function isEmpty(obj) { + for (var x in obj) { + if (Object.prototype.hasOwnProperty.call(obj, x)) { + return false; + } + } + + return true; + }; // Guards + + + if (!isObject(mergeTarget)) { + throw new Error('Parameter mergeTarget must be an object'); + } + + if (!isObject(options)) { + throw new Error('Parameter options must be an object'); + } + + if (!isPresent(option)) { + throw new Error('Parameter option must have a value'); + } + + if (!isObject(globalOptions)) { + throw new Error('Parameter globalOptions must be an object'); + } // + // Actual merge routine, separated from main logic + // Only a single level of options is merged. Deeper levels are ref'd. This may actually be an issue. + // + + + var doMerge = function doMerge(target, options, option) { + if (!isObject(target[option])) { + target[option] = {}; + } + + var src = options[option]; + var dst = target[option]; + + for (var prop in src) { + if (Object.prototype.hasOwnProperty.call(src, prop)) { + dst[prop] = src[prop]; + } + } + }; // Local initialization + + + var srcOption = options[option]; + var globalPassed = isObject(globalOptions) && !isEmpty(globalOptions); + var globalOption = globalPassed ? globalOptions[option] : undefined; + var globalEnabled = globalOption ? globalOption.enabled : undefined; ///////////////////////////////////////// + // Main routine + ///////////////////////////////////////// + + if (srcOption === undefined) { + return; // Nothing to do + } + + if (typeof srcOption === 'boolean') { + if (!isObject(mergeTarget[option])) { + mergeTarget[option] = {}; + } + + mergeTarget[option].enabled = srcOption; + return; + } + + if (srcOption === null && !isObject(mergeTarget[option])) { + // If possible, explicit copy from globals + if (isPresent(globalOption)) { + mergeTarget[option] = Object.create(globalOption); + } else { + return; // Nothing to do + } + } + + if (!isObject(srcOption)) { + return; + } // + // Ensure that 'enabled' is properly set. It is required internally + // Note that the value from options will always overwrite the existing value + // + + + var enabled = true; // default value + + if (srcOption.enabled !== undefined) { + enabled = srcOption.enabled; + } else { + // Take from globals, if present + if (globalEnabled !== undefined) { + enabled = globalOption.enabled; + } + } + + doMerge(mergeTarget, options, option); + mergeTarget[option].enabled = enabled; +} +/** + * 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 orderedItems - Items ordered by start + * @param comparator - -1 is lower, 0 is equal, 1 is higher + * @param field - Property name on an item (i.e. item[field]). + * @param field2 - Second property name on an item (i.e. item[field][field2]). + * + * @returns Index of the found item or -1 if nothing was found. + */ + + +function binarySearchCustom(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 _value3 = field2 === undefined ? item[field] : item[field][field2]; + + var searchResult = comparator(_value3); + + 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 orderedItems - Sorted array. + * @param target - The searched value. + * @param field - Name of the property in items to be searched. + * @param sidePreference - If the target is between two values, should the index of the before or the after be returned? + * @param comparator - An optional comparator, returning -1, 0, 1 for <, ===, >. + * + * @returns The index of found value or -1 if nothing was found. + */ + + +function binarySearchValue(orderedItems, target, field, sidePreference, comparator) { + var maxIterations = 10000; + var iteration = 0; + var low = 0; + var high = orderedItems.length - 1; + var prevValue; + var value; + var nextValue; + var middle; + 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. + * Only considering the t value for the range [0, 1] => [0, 1]. + * + * Inspiration: from http://gizma.com/easing/ + * https://gist.github.com/gre/1650294 + */ + + +var easingFunctions = { + /** + * no easing, no acceleration + * + * @param t - Time. + * + * @returns Value at time t. + */ + linear: function linear(t) { + return t; + }, + + /** + * accelerating from zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInQuad: function easeInQuad(t) { + return t * t; + }, + + /** + * decelerating to zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeOutQuad: function easeOutQuad(t) { + return t * (2 - t); + }, + + /** + * acceleration until halfway, then deceleration + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInOutQuad: function easeInOutQuad(t) { + return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; + }, + + /** + * accelerating from zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInCubic: function easeInCubic(t) { + return t * t * t; + }, + + /** + * decelerating to zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeOutCubic: function easeOutCubic(t) { + return --t * t * t + 1; + }, + + /** + * acceleration until halfway, then deceleration + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInOutCubic: function easeInOutCubic(t) { + return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; + }, + + /** + * accelerating from zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInQuart: function easeInQuart(t) { + return t * t * t * t; + }, + + /** + * decelerating to zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeOutQuart: function easeOutQuart(t) { + return 1 - --t * t * t * t; + }, + + /** + * acceleration until halfway, then deceleration + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInOutQuart: function easeInOutQuart(t) { + return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t; + }, + + /** + * accelerating from zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInQuint: function easeInQuint(t) { + return t * t * t * t * t; + }, + + /** + * decelerating to zero velocity + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeOutQuint: function easeOutQuint(t) { + return 1 + --t * t * t * t * t; + }, + + /** + * acceleration until halfway, then deceleration + * + * @param t - Time. + * + * @returns Value at time t. + */ + easeInOutQuint: function easeInOutQuint(t) { + return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t; + } +}; +/** + * Experimentaly compute the width of the scrollbar for this browser. + * + * @returns The width in pixels. + */ + +function getScrollBarWidth() { + var inner = document.createElement('p'); + inner.style.width = '100%'; + inner.style.height = '200px'; + var outer = document.createElement('div'); + outer.style.position = 'absolute'; + outer.style.top = '0px'; + outer.style.left = '0px'; + outer.style.visibility = 'hidden'; + outer.style.width = '200px'; + outer.style.height = '150px'; + outer.style.overflow = 'hidden'; + outer.appendChild(inner); + document.body.appendChild(outer); + var w1 = inner.offsetWidth; + outer.style.overflow = 'scroll'; + var w2 = inner.offsetWidth; + + if (w1 == w2) { + w2 = outer.clientWidth; + } + + document.body.removeChild(outer); + return w1 - w2; +} // @TODO: This doesn't work properly. +// It works only for single property objects, +// otherwise it combines all of the types in a union. +// export function topMost ( +// pile: Record[], +// accessors: K1 | [K1] +// ): undefined | V1 +// export function topMost ( +// pile: Record>[], +// accessors: [K1, K2] +// ): undefined | V1 | V2 +// export function topMost ( +// pile: Record>>[], +// accessors: [K1, K2, K3] +// ): undefined | V1 | V2 | V3 + +/** + * Get the top most property value from a pile of objects. + * + * @param pile - Array of objects, no required format. + * @param accessors - Array of property names (e.g. object['foo']['bar'] → ['foo', 'bar']). + * + * @returns Value of the property with given accessors path from the first pile item where it's not undefined. + */ + + +function topMost(pile, accessors) { + var candidate; + + if (!Array.isArray(accessors)) { + accessors = [accessors]; + } + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = pile[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var member = _step.value; + + if (member) { + candidate = member[accessors[0]]; + + for (var i = 1; i < accessors.length; i++) { + if (candidate) { + candidate = candidate[accessors[i]]; + } + } + + if (typeof candidate !== 'undefined') { + break; + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return candidate; +} + +var util = +/*#__PURE__*/ +Object.freeze({ + isNumber: isNumber, + recursiveDOMDelete: recursiveDOMDelete, + isString: isString, + isObject: isObject, + isDate: isDate, + isMoment: isMoment, + fillIfDefined: fillIfDefined, + extend: extend, + selectiveExtend: selectiveExtend, + selectiveDeepExtend: selectiveDeepExtend, + selectiveNotDeepExtend: selectiveNotDeepExtend, + deepExtend: deepExtend, + equalArray: equalArray, + convert: convert, + getType: getType, + copyAndExtendArray: copyAndExtendArray, + copyArray: copyArray, + getAbsoluteLeft: getAbsoluteLeft, + getAbsoluteRight: getAbsoluteRight, + getAbsoluteTop: getAbsoluteTop, + addClassName: addClassName, + removeClassName: removeClassName, + forEach: forEach, + toArray: toArray, + updateProperty: updateProperty, + throttle: throttle, + addEventListener: addEventListener, + removeEventListener: removeEventListener, + preventDefault: preventDefault, + getTarget: getTarget, + hasParent: hasParent, + option: option, + hexToRGB: hexToRGB, + overrideOpacity: overrideOpacity, + RGBToHex: RGBToHex, + parseColor: parseColor, + RGBToHSV: RGBToHSV, + addCssText: addCssText, + removeCssText: removeCssText, + HSVToRGB: HSVToRGB, + HSVToHex: HSVToHex, + hexToHSV: hexToHSV, + isValidHex: isValidHex, + isValidRGB: isValidRGB, + isValidRGBA: isValidRGBA, + selectiveBridgeObject: selectiveBridgeObject, + bridgeObject: bridgeObject, + insertSort: insertSort, + mergeOptions: mergeOptions, + binarySearchCustom: binarySearchCustom, + binarySearchValue: binarySearchValue, + easingFunctions: easingFunctions, + getScrollBarWidth: getScrollBarWidth, + topMost: topMost, + randomUUID: uuid4 +}); // New API (tree shakeable). + +var util$1 = /*#__PURE__*/Object.freeze({ + 'default': util, + HSVToHex: HSVToHex, + HSVToRGB: HSVToRGB, + RGBToHSV: RGBToHSV, + RGBToHex: RGBToHex, + addClassName: addClassName, + addCssText: addCssText, + addEventListener: addEventListener, + binarySearchCustom: binarySearchCustom, + binarySearchValue: binarySearchValue, + bridgeObject: bridgeObject, + convert: convert, + copyAndExtendArray: copyAndExtendArray, + copyArray: copyArray, + deepExtend: deepExtend, + easingFunctions: easingFunctions, + equalArray: equalArray, + extend: extend, + fillIfDefined: fillIfDefined, + forEach: forEach, + getAbsoluteLeft: getAbsoluteLeft, + getAbsoluteRight: getAbsoluteRight, + getAbsoluteTop: getAbsoluteTop, + getScrollBarWidth: getScrollBarWidth, + getTarget: getTarget, + getType: getType, + hasParent: hasParent, + hexToHSV: hexToHSV, + hexToRGB: hexToRGB, + insertSort: insertSort, + isDate: isDate, + isMoment: isMoment, + isNumber: isNumber, + isObject: isObject, + isString: isString, + isValidHex: isValidHex, + isValidRGB: isValidRGB, + isValidRGBA: isValidRGBA, + mergeOptions: mergeOptions, + option: option, + overrideOpacity: overrideOpacity, + parseColor: parseColor, + preventDefault: preventDefault, + randomUUID: uuid4, + recursiveDOMDelete: recursiveDOMDelete, + removeClassName: removeClassName, + removeCssText: removeCssText, + removeEventListener: removeEventListener, + selectiveBridgeObject: selectiveBridgeObject, + selectiveDeepExtend: selectiveDeepExtend, + selectiveExtend: selectiveExtend, + selectiveNotDeepExtend: selectiveNotDeepExtend, + throttle: throttle, + toArray: toArray, + topMost: topMost, + updateProperty: updateProperty +}); + +// DOM utility methods + +/** + * this prepares the JSON container for allocating SVG elements + * @param {Object} JSONcontainer + * @private + */ +function prepareElements(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 {Object} JSONcontainer + * @private + */ + +function cleanupElements(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 {Object} JSONcontainer + */ + +function resetElements(JSONcontainer) { + prepareElements(JSONcontainer); + cleanupElements(JSONcontainer); + 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 {string} elementType + * @param {Object} JSONcontainer + * @param {Object} svgContainer + * @returns {Element} + * @private + */ + +function getSVGElement(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 {string} elementType + * @param {Object} JSONcontainer + * @param {Element} DOMContainer + * @param {Element} insertBefore + * @returns {*} + */ + +function getDOMElement(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 {number} x + * @param {number} y + * @param {Object} groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' } + * @param {Object} JSONcontainer + * @param {Object} svgContainer + * @param {Object} labelObj + * @returns {vis.PointItem} + */ + +function drawPoint(x, y, groupTemplate, JSONcontainer, svgContainer, labelObj) { + var point; + + if (groupTemplate.style == 'circle') { + point = getSVGElement('circle', JSONcontainer, svgContainer); + point.setAttributeNS(null, "cx", x); + point.setAttributeNS(null, "cy", y); + point.setAttributeNS(null, "r", 0.5 * groupTemplate.size); + } else { + point = 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 = 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 {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {string} className + * @param {Object} JSONcontainer + * @param {Object} svgContainer + * @param {string} style + */ + +function drawBar(x, y, width, height, className, JSONcontainer, svgContainer, style) { + if (height != 0) { + if (height < 0) { + height *= -1; + y -= height; + } + + var rect = 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); + } + } +} +/** + * get default language + * @returns {string} + */ + +function getNavigatorLanguage() { + if (!navigator) return 'en'; + + if (navigator.languages && navigator.languages.length) { + return navigator.languages; + } else { + return navigator.userLanguage || navigator.language || navigator.browserLanguage || 'en'; + } +} + +var DOMutil = /*#__PURE__*/Object.freeze({ + prepareElements: prepareElements, + cleanupElements: cleanupElements, + resetElements: resetElements, + getSVGElement: getSVGElement, + getDOMElement: getDOMElement, + drawPoint: drawPoint, + drawBar: drawBar, + getNavigatorLanguage: getNavigatorLanguage +}); + +/** + * vis-data - data + * http://visjs.org/ + * + * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data. + * + * @version 6.1.0 + * @date 2019-07-16T13:37:00Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ +function _defineProperty$1(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +var defineProperty$1 = _defineProperty$1; + +function createCommonjsModule$1(fn, module) { + return module = { + exports: {} + }, fn(module, module.exports), module.exports; +} + +var _typeof_1$1 = createCommonjsModule$1(function (module) { + function _typeof2(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof2(obj); + } + + function _typeof(obj) { + if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); + } + + module.exports = _typeof; +}); + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +var classCallCheck = _classCallCheck; + +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); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +var createClass = _createClass; + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +var assertThisInitialized = _assertThisInitialized; + +function _possibleConstructorReturn(self, call) { + if (call && (_typeof_1$1(call) === "object" || typeof call === "function")) { + return call; + } + + return assertThisInitialized(self); +} + +var possibleConstructorReturn = _possibleConstructorReturn; +var getPrototypeOf = createCommonjsModule$1(function (module) { + function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + + module.exports = _getPrototypeOf; +}); +var setPrototypeOf = createCommonjsModule$1(function (module) { + function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + module.exports = _setPrototypeOf; +}); + +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) setPrototypeOf(subClass, superClass); +} + +var inherits = _inherits; // Maps for number <-> hex string conversion + +var byteToHex$2 = []; + +for (var i$2 = 0; i$2 < 256; i$2++) { + byteToHex$2[i$2] = (i$2 + 0x100).toString(16).substr(1); +} +/** + * Represent binary UUID into it's string representation. + * + * @param buf - Buffer containing UUID bytes. + * @param offset - Offset from the start of the buffer where the UUID is saved (not needed if the buffer starts with the UUID). + * + * @returns String representation of the UUID. + */ + + +function stringifyUUID$1(buf, offset) { + var i = offset || 0; + var bth = byteToHex$2; + 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++]]; +} +/** + * Generate 16 random bytes to be used as a base for UUID. + * + * @ignore + */ + + +var random$1 = function () { + if (typeof crypto !== 'undefined' && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + + return function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; + } // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). + // It's fast, but is of unspecified quality. + + + var _rnds = new Array(16); + + return function () { + 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 + // return require('./rng'); +}(); + +var byteToHex$1$1 = []; + +for (var i$1$1 = 0; i$1$1 < 256; i$1$1++) { + byteToHex$1$1[i$1$1] = (i$1$1 + 0x100).toString(16).substr(1); +} // **`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$1 = random$1(); // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + +var defaultNodeId$1 = [seedBytes$1[0] | 0x01, seedBytes$1[1], seedBytes$1[2], seedBytes$1[3], seedBytes$1[4], seedBytes$1[5]]; // Per 4.2.2, randomize (14 bit) clockseq + +var defaultClockseq$1 = (seedBytes$1[6] << 8 | seedBytes$1[7]) & 0x3fff; // Previous uuid creation time + +/** + * UUIDv4 options. + */ + +/** + * Generate UUIDv4 + * + * @param options - Options to be used instead of default generated values. + * String 'binary' is a shorthand for uuid4({}, new Array(16)). + * @param buf - If present the buffer will be filled with the generated UUID. + * @param offset - Offset of the UUID from the start of the buffer. + * + * @returns UUIDv4 + */ + +function uuid4$1() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var buf = arguments.length > 1 ? arguments[1] : undefined; + var offset = arguments.length > 2 ? arguments[2] : undefined; // Deprecated - 'format' argument, as supported in v1.2 + + var i = buf && offset || 0; + + if (typeof options === 'string') { + buf = options === 'binary' ? new Array(16) : undefined; + options = {}; + } + + var rnds = options.random || (options.rng || random$1)(); // 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 || stringifyUUID$1(rnds); +} // Rollup will complain about mixing default and named exports in UMD build, + + +function _typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + +var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function commonjsRequire$1() { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); +} + +function createCommonjsModule$1$1(fn, module) { + return module = { + exports: {} + }, fn(module, module.exports), module.exports; +} + +var moment$1 = createCommonjsModule$1$1(function (module, exports) { + (function (global, factory) { + module.exports = factory(); + })(commonjsGlobal$1, function () { + var hookCallback; + + function 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 isObject(input) { + // IE8 will treat undefined and null as object if it wasn't for + // input != null + return input != null && Object.prototype.toString.call(input) === '[object Object]'; + } + + function isObjectEmpty(obj) { + if (Object.getOwnPropertyNames) { + return Object.getOwnPropertyNames(obj).length === 0; + } else { + var k; + + for (k in obj) { + if (obj.hasOwnProperty(k)) { + return false; + } + } + + return true; + } + } + + function isUndefined(input) { + return input === void 0; + } + + function isNumber(input) { + return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; + } + + 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 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, + rfc2822: false, + weekdayMismatch: false + }; + } + + 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 isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + var parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }); + var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); + + if (m._strict) { + isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; + } + + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } else { + return isNowValid; + } + } + + return m._isValid; + } + + function createInvalid(flags) { + var m = createUTC(NaN); + + if (flags != null) { + extend(getParsingFlags(m), flags); + } else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + + + var momentProperties = 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 = 0; i < momentProperties.length; i++) { + 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); + + if (!this.isValid()) { + this._d = new Date(NaN); + } // Prevent infinite loop in case updateOffset creates new moment + // objects. + + + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment(obj) { + return obj instanceof Moment || obj != null && obj._isAMomentObject != null; + } + + function absFloor(number) { + if (number < 0) { + // -0 -> 0 + return Math.ceil(number) || 0; + } 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 (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + return extend(function () { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + + if (firstTime) { + var args = []; + var arg; + + for (var i = 0; i < arguments.length; i++) { + arg = ''; + + if (typeof arguments[i] === 'object') { + arg += '\n[' + i + '] '; + + for (var key in arguments[0]) { + arg += key + ': ' + arguments[0][key] + ', '; + } + + arg = arg.slice(0, -2); // Remove trailing comma and space + } else { + arg = arguments[i]; + } + + args.push(arg); + } + + warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack); + firstTime = false; + } + + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function 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 _dayOfMonthOrdinalParse. + // TODO: Remove "ordinalParse" fallback in next major release. + + this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || 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]; + } + } + } + + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) { + // make sure changes to properties don't modify parent config + res[prop] = extend({}, 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; + }; + } + + 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 calendar(key, mom, now) { + var output = this._calendar[key] || this._calendar['sameElse']; + 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 defaultDayOfMonthOrdinalParse = /\d{1,2}/; + + function ordinal(number) { + return this._ordinal.replace('%d', number); + } + + var defaultRelativeTime = { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + ss: '%d seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }; + + function 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 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; + } + + var priorities = {}; + + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + + function getPrioritizedUnits(unitsObj) { + var units = []; + + for (var u in unitsObj) { + units.push({ + unit: u, + priority: priorities[u] + }); + } + + units.sort(function (a, b) { + return a.priority - b.priority; + }); + return units; + } + + 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 += isFunction(array[i]) ? 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]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; + 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 (isNumber(callback)) { + 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; // 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'); // PRIORITIES + + addUnitPriority('year', 1); // 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 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = 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 + + + hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; // MOMENTS + + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear() { + return isLeapYear(this.year()); + } + + function makeGetSet(unit, keepTime) { + return function (value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get(this, unit); + } + }; + } + + function get(mom, unit) { + return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function set$1(mom, unit, value) { + if (mom.isValid() && !isNaN(value)) { + if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); + } else { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + } + } // MOMENTS + + + function stringGet(units) { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](); + } + + return this; + } + + function stringSet(units, value) { + if (typeof units === 'object') { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units); + + for (var i = 0; i < prioritized.length; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); + } + } else { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](value); + } + } + + return this; + } + + function mod(n, x) { + return (n % x + x) % x; + } + + 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) { + if (isNaN(year) || isNaN(month)) { + return NaN; + } + + var modMonth = mod(month, 12); + year += (month - modMonth) / 12; + return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; + } // 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'); // PRIORITY + + addUnitPriority('month', 8); // 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) { + if (!m) { + return isArray(this._months) ? this._months : this._months['standalone']; + } + + return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || 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) { + if (!m) { + return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; + } + + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + function 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 = 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 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 = 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 (!isNumber(value)) { + 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); + hooks.updateOffset(this, true); + return this; + } else { + return 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 { + if (!hasOwnProp(this, '_monthsShortRegex')) { + this._monthsShortRegex = defaultMonthsShortRegex; + } + + 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 { + if (!hasOwnProp(this, '_monthsRegex')) { + this._monthsRegex = defaultMonthsRegex; + } + + 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 = 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]); + } + + for (i = 0; i < 24; 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 createDate(y, m, d, h, M, s, ms) { + // can't just apply() to create a date: + // https://stackoverflow.com/q/181348 + var date; // the date constructor remaps years 0-99 to 1900-1999 + + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + date = new Date(y + 400, m, d, h, M, s, ms); + + if (isFinite(date.getFullYear())) { + date.setFullYear(y); + } + } else { + date = new Date(y, m, d, h, M, s, ms); + } + + return date; + } + + function createUTCDate(y) { + var date; // the Date.UTC function remaps years 0-99 to 1900-1999 + + if (y < 100 && y >= 0) { + var args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset + + args[0] = y + 400; + date = new Date(Date.UTC.apply(null, args)); + + if (isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + } else { + date = new Date(Date.UTC.apply(null, arguments)); + } + + return date; + } // 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; + } // https://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; + } // FORMATTING + + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); // PRIORITIES + + addUnitPriority('week', 5); + addUnitPriority('isoWeek', 5); // 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 6th 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', 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'); // PRIORITY + + addUnitPriority('day', 11); + addUnitPriority('weekday', 11); + addUnitPriority('isoWeekday', 11); // 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; + } + + function parseIsoWeekday(input, locale) { + if (typeof input === 'string') { + return locale.weekdaysParse(input) % 7 || 7; + } + + return isNaN(input) ? null : input; + } // LOCALES + + + function shiftWeekdays(ws, n) { + return ws.slice(n, 7).concat(ws.slice(0, n)); + } + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + + function localeWeekdays(m, format) { + var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone']; + return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + + function localeWeekdaysShort(m) { + return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + + function localeWeekdaysMin(m) { + return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + + function handleStrictParse$1(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 = 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 handleStrictParse$1.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 = 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. + + + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 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 { + if (!hasOwnProp(this, '_weekdaysRegex')) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + + 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 { + if (!hasOwnProp(this, '_weekdaysShortRegex')) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + + 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 { + if (!hasOwnProp(this, '_weekdaysMinRegex')) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + + 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 = 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 + + + 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'); // PRIORITY + + addUnitPriority('hour', 13); // PARSING + + function matchMeridiem(isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('k', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + addRegexToken('kk', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); + addParseToken(['k', 'kk'], function (input, array, config) { + var kInput = toInt(input); + array[HOUR] = kInput === 24 ? 0 : kInput; + }); + 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 they want. 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); + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, + relativeTime: defaultRelativeTime, + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, + week: defaultLocaleWeek, + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, + meridiemParse: defaultLocaleMeridiemParse + }; // internal storage for locale config files + + var locales = {}; + var localeFamilies = {}; + 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 globalLocale; + } + + function loadLocale(name) { + var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node + + if (!locales[name] && 'object' !== 'undefined' && module && module.exports) { + try { + oldLocale = globalLocale._abbr; + var aliasedRequire = commonjsRequire$1; + aliasedRequire('./locale/' + name); + 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 getSetGlobalLocale(key, values) { + var data; + + if (key) { + if (isUndefined(values)) { + data = getLocale(key); + } else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } else { + if (typeof console !== 'undefined' && console.warn) { + //warn user if arguments are passed but the locale could not be set + console.warn('Locale ' + key + ' not found. Did you forget to load it?'); + } + } + } + + return globalLocale._abbr; + } + + function defineLocale(name, config) { + if (config !== null) { + var locale, + parentConfig = baseConfig; + 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 ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + locale = loadLocale(config.parentLocale); + + if (locale != null) { + parentConfig = locale._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + + localeFamilies[config.parentLocale].push({ + name: name, + config: config + }); + return null; + } + } + } + + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + + if (localeFamilies[name]) { + localeFamilies[name].forEach(function (x) { + defineLocale(x.name, x.config); + }); + } // backwards compat for now: also set the locale + // make sure we set the locale AFTER all child locales have been + // created, so we won't end up with the child locale set. + + + getSetGlobalLocale(name); + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + function updateLocale(name, config) { + if (config != null) { + var locale, + tmpLocale, + parentConfig = baseConfig; // MERGE + + tmpLocale = loadLocale(name); + + if (tmpLocale != null) { + parentConfig = tmpLocale._config; + } + + config = mergeConfigs(parentConfig, config); + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; // backwards compat for now: also set the locale + + 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 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 listLocales() { + return keys(locales); + } + + 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; + } // 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(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, + expectedWeekday, + 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 != null) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { + 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); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // 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; + } // check for mismatching day of week + + + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { + getParsingFlags(config).weekdayMismatch = true; + } + } + + 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(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; + var curWeek = weekOfYear(createLocal(), dow, doy); + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. + + week = defaults(w.w, curWeek.week); + + 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 beginning of week + weekday = w.e + dow; + + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + // default to beginning 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; + } + } // 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; + } + } // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 + + + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; + + function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)]; + + if (secondStr) { + result.push(parseInt(secondStr, 10)); + } + + return result; + } + + function untruncateYear(yearStr) { + var year = parseInt(yearStr, 10); + + if (year <= 49) { + return 2000 + year; + } else if (year <= 999) { + return 1900 + year; + } + + return year; + } + + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + + function checkWeekday(weekdayStr, parsedInput, config) { + if (weekdayStr) { + // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. + var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), + weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); + + if (weekdayProvided !== weekdayActual) { + getParsingFlags(config).weekdayMismatch = true; + config._isValid = false; + return false; + } + } + + return true; + } + + var obsOffsets = { + UT: 0, + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + + function calculateOffset(obsOffset, militaryOffset, numOffset) { + if (obsOffset) { + return obsOffsets[obsOffset]; + } else if (militaryOffset) { + // the only allowed military tz is Z + return 0; + } else { + var hm = parseInt(numOffset, 10); + var m = hm % 100, + h = (hm - m) / 100; + return h * 60 + m; + } + } // date and time from ref 2822 format + + + function configFromRFC2822(config) { + var match = rfc2822.exec(preprocessRFC2822(config._i)); + + if (match) { + var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); + + if (!checkWeekday(match[1], parsedArray, config)) { + return; + } + + config._a = parsedArray; + config._tzm = calculateOffset(match[8], match[9], match[10]); + config._d = createUTCDate.apply(null, config._a); + + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + + getParsingFlags(config).rfc2822 = true; + } 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; + } else { + return; + } + + configFromRFC2822(config); + + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } // Final attempt, use Input Fallback + + + hooks.createFromInputFallback(config); + } + + hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + }); // constant that refers to the ISO standard + + hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form + + + hooks.RFC_2822 = 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 === hooks.ISO_8601) { + configFromISO(config); + return; + } + + if (config._f === hooks.RFC_2822) { + configFromRFC2822(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 (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && 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 (!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 || getLocale(config._l); + + if (input === null || format === undefined && input === '') { + return createInvalid({ + nullInput: true + }); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + + if (!isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + + if (isUndefined(input)) { + config._d = new Date(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 (isObject(input)) { + configFromObject(config); + } else if (isNumber(input)) { + // from milliseconds + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC(input, format, locale, strict, isUTC) { + var c = {}; + + if (locale === true || locale === false) { + strict = locale; + locale = undefined; + } + + if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) { + input = 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 createLocal(input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } + }); + var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return 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 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(); + }; + + var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; + + function isDurationValid(m) { + for (var key in m) { + if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { + return false; + } + } + + var unitHasDecimal = false; + + for (var i = 0; i < ordering.length; ++i) { + if (m[ordering[i]]) { + if (unitHasDecimal) { + return false; // only allow non-integers for smallest unit + } + + if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { + unitHasDecimal = true; + } + } + } + + return true; + } + + function isValid$1() { + return this._isValid; + } + + function createInvalid$1() { + return createDuration(NaN); + } + + function Duration(duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || normalizedInput.isoWeek || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + this._isValid = isDurationValid(normalizedInput); // 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 to 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 = getLocale(); + + this._bubble(); + } + + function isDuration(obj) { + return obj instanceof Duration; + } + + function absRound(number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } // 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); + + if (matches === null) { + return null; + } + + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + return minutes === 0 ? 0 : 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() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. + + res._d.setTime(res._d.valueOf() + diff); + + hooks.updateOffset(res, false); + return res; + } else { + return 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. + + + 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, keepMinutes) { + 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); + + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16 && !keepMinutes) { + 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) { + addSubtract(this, createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + 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 != null) { + this.utcOffset(this._tzm, false, true); + } else if (typeof this._i === 'string') { + var tZone = offsetFromString(matchOffset, this._i); + + if (tZone != null) { + this.utcOffset(tZone); + } else { + this.utcOffset(0, true); + } + } + + return this; + } + + function hasAlignedHourOffset(input) { + if (!this.isValid()) { + return false; + } + + input = input ? 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 ? createUTC(c._a) : 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*)?)?$/; // 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 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 (isNumber(input)) { + 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(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match + + }; + } 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(createLocal(duration.from), 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; + } + + createDuration.fn = Duration.prototype; + createDuration.invalid = createInvalid$1; + + 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 = {}; + 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; + } // 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). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); + tmp = val; + val = period; + period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } + + function 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 (months) { + setMonth(mom, get(mom, 'Month') + months * isAdding); + } + + if (days) { + set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); + } + + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + + if (updateOffset) { + hooks.updateOffset(mom, days || months); + } + } + + var add = createAdder(1, 'add'); + var subtract = createAdder(-1, 'subtract'); + + function getCalendarFormat(myMoment, now) { + var diff = myMoment.diff(now, 'days', true); + return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; + } + + function calendar$1(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 || createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + format = hooks.calendarFormat(this, sod) || 'sameElse'; + var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); + } + + function clone() { + return new Moment(this); + } + + function isAfter(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(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 : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(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) { + var localFrom = isMoment(from) ? from : createLocal(from), + localTo = isMoment(to) ? to : createLocal(to); + + if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { + return false; + } + + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); + } + + function isSame(input, units) { + var localInput = isMoment(input) ? input : 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, output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); + + switch (units) { + case 'year': + output = monthDiff(this, that) / 12; + break; + + case 'month': + output = monthDiff(this, that); + break; + + case 'quarter': + output = monthDiff(this, that) / 3; + break; + + case 'second': + output = (this - that) / 1e3; + break; + // 1000 + + case 'minute': + output = (this - that) / 6e4; + break; + // 1000 * 60 + + case 'hour': + output = (this - that) / 36e5; + break; + // 1000 * 60 * 60 + + case 'day': + output = (this - that - zoneDelta) / 864e5; + break; + // 1000 * 60 * 60 * 24, negate dst + + case 'week': + output = (this - that - zoneDelta) / 6048e5; + break; + // 1000 * 60 * 60 * 24 * 7, negate dst + + default: + output = this - that; + } + + 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; + } + + hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + 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 toISOString(keepOffset) { + if (!this.isValid()) { + return null; + } + + var utc = keepOffset !== true; + var m = utc ? this.clone().utc() : this; + + if (m.year() < 0 || m.year() > 9999) { + return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + + if (isFunction(Date.prototype.toISOString)) { + // native implementation is ~50x faster, use it when we can + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); + } + } + + return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + /** + * Return a human readable representation of a moment that can + * also be evaluated to get a new moment which is the same + * + * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects + */ + + + function inspect() { + if (!this.isValid()) { + return 'moment.invalid(/* ' + this._i + ' */)'; + } + + var func = 'moment'; + var zone = ''; + + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; + zone = 'Z'; + } + + var prefix = '[' + func + '("]'; + var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; + var datetime = '-MM-DD[T]HH:mm:ss.SSS'; + var suffix = zone + '[")]'; + return this.format(prefix + year + datetime + suffix); + } + + function format(inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; + } + + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + + function from(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + to: this, + from: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow(withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } + + function to(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + from: this, + to: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow(withoutSuffix) { + return this.to(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 = 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; + } + + var MS_PER_SECOND = 1000; + var MS_PER_MINUTE = 60 * MS_PER_SECOND; + var MS_PER_HOUR = 60 * MS_PER_MINUTE; + var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): + + function mod$1(dividend, divisor) { + return (dividend % divisor + divisor) % divisor; + } + + function localStartOfDate(y, m, d) { + // the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + return new Date(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return new Date(y, m, d).valueOf(); + } + } + + function utcStartOfDate(y, m, d) { + // Date.UTC remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return Date.UTC(y, m, d); + } + } + + function startOf(units) { + var time; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year(), 0, 1); + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3, 1); + break; + + case 'month': + time = startOfDate(this.year(), this.month(), 1); + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date()); + break; + + case 'hour': + time = this._d.valueOf(); + time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); + break; + + case 'minute': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_MINUTE); + break; + + case 'second': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_SECOND); + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function endOf(units) { + var time; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year() + 1, 0, 1) - 1; + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; + break; + + case 'month': + time = startOfDate(this.year(), this.month() + 1, 1) - 1; + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; + break; + + case 'hour': + time = this._d.valueOf(); + time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; + break; + + case 'minute': + time = this._d.valueOf(); + time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; + break; + + case 'second': + time = this._d.valueOf(); + time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function valueOf() { + return this._d.valueOf() - (this._offset || 0) * 60000; + } + + function unix() { + return Math.floor(this.valueOf() / 1000); + } + + function toDate() { + return new Date(this.valueOf()); + } + + 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 isValid$2() { + return 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'); // PRIORITY + + addUnitPriority('weekYear', 1); + addUnitPriority('isoWeekYear', 1); // 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] = 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'); // PRIORITY + + addUnitPriority('quarter', 7); // 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('D', ['DD', 2], 'Do', 'date'); // ALIASES + + addUnitAlias('date', 'D'); // PRIORITY + + addUnitPriority('date', 9); // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + // TODO: Remove "ordinalParse" fallback in next major release. + return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; + }); + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0]); + }); // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); // PRIORITY + + addUnitPriority('dayOfYear', 4); // 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 + + + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES + + addUnitAlias('minute', 'm'); // PRIORITY + + addUnitPriority('minute', 14); // 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'); // PRIORITY + + addUnitPriority('second', 15); // 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'); // PRIORITY + + addUnitPriority('millisecond', 16); // 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 proto = Moment.prototype; + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$2; + proto.lang = lang; + proto.locale = locale; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + proto.quarter = proto.quarters = getSetQuarter; + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.isoWeeksInYear = getISOWeeksInYear; + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + proto.hour = proto.hours = getSetHour; + proto.minute = proto.minutes = getSetMinute; + proto.second = proto.seconds = getSetSecond; + proto.millisecond = proto.milliseconds = getSetMillisecond; + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); + proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); + + function createUnix(input) { + return createLocal(input * 1000); + } + + function createInZone() { + return createLocal.apply(null, arguments).parseZone(); + } + + function preParsePostFormat(string) { + return string; + } + + var proto$1 = Locale.prototype; + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set; + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + + function get$1(format, index, field, setter) { + var locale = getLocale(); + var utc = createUTC().set(setter, index); + return locale[field](utc, format); + } + + function listMonthsImpl(format, index, field) { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return get$1(format, index, field, 'month'); + } + + var i; + var out = []; + + for (i = 0; i < 12; i++) { + out[i] = get$1(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 (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = getLocale(), + shift = localeSorted ? locale._week.dow : 0; + + if (index != null) { + return get$1(format, (index + shift) % 7, field, 'day'); + } + + var i; + var out = []; + + for (i = 0; i < 7; i++) { + out[i] = get$1(format, (i + shift) % 7, field, 'day'); + } + + return out; + } + + function listMonths(format, index) { + return listMonthsImpl(format, index, 'months'); + } + + function listMonthsShort(format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } + + function listWeekdays(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } + + function listWeekdaysShort(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } + + function listWeekdaysMin(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } + + getSetGlobalLocale('en', { + dayOfMonthOrdinalParse: /\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 + + hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); + hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); + var mathAbs = Math.abs; + + function 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 addSubtract$1(duration, input, value, direction) { + var other = 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 add$1(input, value) { + return addSubtract$1(this, input, value, 1); + } // supports only 2.0-style subtract(1, 's') or subtract(duration) + + + function subtract$1(input, value) { + return addSubtract$1(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) { + if (!this.isValid()) { + return NaN; + } + + var days; + var months; + var milliseconds = this._milliseconds; + units = normalizeUnits(units); + + if (units === 'month' || units === 'quarter' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + + switch (units) { + case 'month': + return months; + + case 'quarter': + return months / 3; + + case 'year': + return 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 valueOf$1() { + if (!this.isValid()) { + return NaN; + } + + 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 asQuarters = makeAs('Q'); + var asYears = makeAs('y'); + + function clone$1() { + return createDuration(this); + } + + function get$2(units) { + units = normalizeUnits(units); + return this.isValid() ? this[units + 's']() : NaN; + } + + function makeGetter(name) { + return function () { + return this.isValid() ? this._data[name] : NaN; + }; + } + + 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 = { + ss: 44, + // a few seconds to seconds + 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 relativeTime$1(posNegDuration, withoutSuffix, locale) { + var duration = 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.ss && ['s', seconds] || seconds < thresholds.s && ['ss', 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 the rounding function for relative time strings + + + function getSetRelativeTimeRounding(roundingFunction) { + if (roundingFunction === undefined) { + return round; + } + + if (typeof roundingFunction === 'function') { + round = roundingFunction; + return true; + } + + return false; + } // This function allows you to set a threshold for relative time strings + + + function getSetRelativeTimeThreshold(threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + + if (limit === undefined) { + return thresholds[threshold]; + } + + thresholds[threshold] = limit; + + if (threshold === 's') { + thresholds.ss = limit - 1; + } + + return true; + } + + function humanize(withSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var locale = this.localeData(); + var output = relativeTime$1(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var abs$1 = Math.abs; + + function sign(x) { + return (x > 0) - (x < 0) || +x; + } + + function toISOString$1() { + // 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) + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var seconds = abs$1(this._milliseconds) / 1000; + var days = abs$1(this._days); + var months = abs$1(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 ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; + 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'; + } + + var totalSign = total < 0 ? '-' : ''; + var ymSign = sign(this._months) !== sign(total) ? '-' : ''; + var daysSign = sign(this._days) !== sign(total) ? '-' : ''; + var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; + return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : ''); + } + + var proto$2 = Duration.prototype; + proto$2.isValid = isValid$1; + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asQuarters = asQuarters; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.clone = clone$1; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale; + proto$2.localeData = localeData; + proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); + proto$2.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 + + hooks.version = '2.24.0'; + setHookCallback(createLocal); + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats + + hooks.HTML5_FMT = { + DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', + // + DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', + // + DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', + // + DATE: 'YYYY-MM-DD', + // + TIME: 'HH:mm', + // + TIME_SECONDS: 'HH:mm:ss', + // + TIME_MS: 'HH:mm:ss.SSS', + // + WEEK: 'GGGG-[W]WW', + // + MONTH: 'YYYY-MM' // + + }; + return hooks; + }); +}); // Maps for number <-> hex string conversion + +var byteToHex$2$1 = []; + +for (var i$2$1 = 0; i$2$1 < 256; i$2$1++) { + byteToHex$2$1[i$2$1] = (i$2$1 + 0x100).toString(16).substr(1); +} +/** + * Generate 16 random bytes to be used as a base for UUID. + * + * @ignore + */ + + +var random$1$1 = function () { + if (typeof crypto !== 'undefined' && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + + return function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; + } // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). + // It's fast, but is of unspecified quality. + + + var _rnds = new Array(16); + + return function () { + 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 + // return require('./rng'); +}(); + +var byteToHex$1$1$1 = []; + +for (var i$1$1$1 = 0; i$1$1$1 < 256; i$1$1$1++) { + byteToHex$1$1$1[i$1$1$1] = (i$1$1$1 + 0x100).toString(16).substr(1); +} // **`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$1$1 = random$1$1(); // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + +var defaultNodeId$1$1 = [seedBytes$1$1[0] | 0x01, seedBytes$1$1[1], seedBytes$1$1[2], seedBytes$1$1[3], seedBytes$1$1[4], seedBytes$1$1[5]]; // Per 4.2.2, randomize (14 bit) clockseq + +var defaultClockseq$1$1 = (seedBytes$1$1[6] << 8 | seedBytes$1$1[7]) & 0x3fff; // Previous uuid creation time +// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/' +// code from http://momentjs.com/ + +var ASPDateRegex$1 = /^\/?Date\((-?\d+)/i; // Hex color + +/** + * Hue, Saturation, Value. + */ + +/** + * Test whether given object is a number + * + * @param value - Input value of unknown type. + * + * @returns True if number, false otherwise. + */ + +function isNumber$1(value) { + return value instanceof Number || typeof value === 'number'; +} +/** + * Test whether given object is a string + * + * @param value - Input value of unknown type. + * + * @returns True if string, false otherwise. + */ + + +function isString$1(value) { + return value instanceof String || typeof value === 'string'; +} +/** + * Test whether given object is a Moment date. + * @TODO: This is basically a workaround, if Moment was imported property it wouldn't necessary as moment.isMoment is a TS type guard. + * + * @param value - Input value of unknown type. + * + * @returns True if Moment instance, false otherwise. + */ + + +function isMoment$1(value) { + return moment$1.isMoment(value); +} +/** + * Convert an object into another type + * + * @param object - Value of unknown type. + * @param type - Name of the desired type. + * + * @returns Object in the desired type. + * @throws Error + */ + + +function convert$1(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': + if (isString$1(object) && !isNaN(Date.parse(object))) { + return moment$1(object).valueOf(); + } else { + // @TODO: I don't think that Number and String constructors are a good idea. + // This could also fail if the object doesn't have valueOf method or if it's redefined. + // For example: Object.create(null) or { valueOf: 7 }. + return Number(object.valueOf()); + } + + case 'string': + case 'String': + return String(object); + + case 'Date': + if (isNumber$1(object)) { + return new Date(object); + } + + if (object instanceof Date) { + return new Date(object.valueOf()); + } else if (isMoment$1(object)) { + return new Date(object.valueOf()); + } + + if (isString$1(object)) { + match = ASPDateRegex$1.exec(object); + + if (match) { + // object is an ASP date + return new Date(Number(match[1])); // parse number + } else { + return moment$1(new Date(object)).toDate(); // parse string + } + } else { + throw new Error('Cannot convert object of type ' + getType$1(object) + ' to type Date'); + } + + case 'Moment': + if (isNumber$1(object)) { + return moment$1(object); + } + + if (object instanceof Date) { + return moment$1(object.valueOf()); + } else if (isMoment$1(object)) { + return moment$1(object); + } + + if (isString$1(object)) { + match = ASPDateRegex$1.exec(object); + + if (match) { + // object is an ASP date + return moment$1(Number(match[1])); // parse number + } else { + return moment$1(object); // parse string + } + } else { + throw new Error('Cannot convert object of type ' + getType$1(object) + ' to type Date'); + } + + case 'ISODate': + if (isNumber$1(object)) { + return new Date(object); + } else if (object instanceof Date) { + return object.toISOString(); + } else if (isMoment$1(object)) { + return object.toDate().toISOString(); + } else if (isString$1(object)) { + match = ASPDateRegex$1.exec(object); + + if (match) { + // object is an ASP date + return new Date(Number(match[1])).toISOString(); // parse number + } else { + return moment$1(object).format(); // ISO 8601 + } + } else { + throw new Error('Cannot convert object of type ' + getType$1(object) + ' to type ISODate'); + } + + case 'ASPDate': + if (isNumber$1(object)) { + return '/Date(' + object + ')/'; + } else if (object instanceof Date) { + return '/Date(' + object.valueOf() + ')/'; + } else if (isString$1(object)) { + match = ASPDateRegex$1.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 ' + getType$1(object) + ' to type ASPDate'); + } + + default: + var never = type; + throw new Error("Unknown type ".concat(never)); + } +} +/** + * Get the type of an object, for example exports.getType([]) returns 'Array' + * + * @param object - Input value of unknown type. + * + * @returns Detected type. + */ + + +function getType$1(object) { + var type = _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'; + } + + if (type === 'number') { + return 'Number'; + } + + if (type === 'boolean') { + return 'Boolean'; + } + + if (type === 'string') { + return 'String'; + } + + if (type === undefined) { + return 'undefined'; + } + + return type; +} +/** + * Determine whether a value can be used as an id. + * + * @param value - Input value of unknown type. + * + * @returns True if the value is valid id, false otherwise. + */ + + +function isId(value) { + return typeof value === 'string' || typeof value === 'number'; +} +/** + * A queue. + * + * @typeParam T - The type of method names to be replaced by queued versions. + */ + + +var Queue = +/*#__PURE__*/ +function () { + /** + * Construct a new Queue. + * + * @param options - Queue configuration. + */ + function Queue(options) { + classCallCheck(this, Queue); + this._queue = []; + this._timeout = null; + this._extended = null; // options + + this.delay = null; + this.max = Infinity; + this.setOptions(options); + } + /** + * Update the configuration of the queue. + * + * @param options - Queue configuration. + */ + + + createClass(Queue, [{ + key: "setOptions", + value: function setOptions(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 - The object to be extended. + * @param options - Additional options. + * + * @returns The created queue. + */ + + }, { + key: "destroy", + + /** + * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object. + */ + value: function destroy() { + 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 { + // @TODO: better solution? + delete object[method.name]; + } + } + + this._extended = null; + } + } + /** + * Replace a method on an object with a queued version. + * + * @param object - Object having the method. + * @param method - The method name. + */ + + }, { + key: "replace", + value: function replace(object, method) { + var me = this; + var original = object[method]; + + if (!original) { + throw new Error('Method ' + method + ' undefined'); + } + + object[method] = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } // add this call to the queue + + + me.queue({ + args: args, + fn: original, + context: this + }); + }; + } + /** + * Queue a call. + * + * @param entry - The function or entry to be queued. + */ + + }, { + key: "queue", + value: function queue(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. + */ + + }, { + key: "_flushIfNeeded", + value: function _flushIfNeeded() { + var _this = this; // 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 + + + if (this._timeout != null) { + clearTimeout(this._timeout); + this._timeout = null; + } + + if (this.queue.length > 0 && typeof this.delay === 'number') { + this._timeout = setTimeout(function () { + _this.flush(); + }, this.delay); + } + } + /** + * Flush all queued calls + */ + + }, { + key: "flush", + value: function flush() { + this._queue.splice(0).forEach(function (entry) { + entry.fn.apply(entry.context || entry.fn, entry.args || []); + }); + } + }], [{ + key: "extend", + value: function extend(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, + // @TODO: better solution? + original: object[name] + }); // @TODO: better solution? + + queue.replace(object, name); + } + } + + queue._extended = { + object: object, + methods: methods + }; + return queue; + } + }]); + return Queue; +}(); + +function _arrayWithoutHoles$1(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } +} + +var arrayWithoutHoles$1 = _arrayWithoutHoles$1; + +function _iterableToArray$1(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} + +var iterableToArray$1 = _iterableToArray$1; + +function _nonIterableSpread$1() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); +} + +var nonIterableSpread$1 = _nonIterableSpread$1; + +function _toConsumableArray$1(arr) { + return arrayWithoutHoles$1(arr) || iterableToArray$1(arr) || nonIterableSpread$1(); +} + +var toConsumableArray$1 = _toConsumableArray$1; +/** + * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]]. + * + * @typeParam Item - Item type that may or may not have an id. + * @typeParam IdProp - Name of the property that contains the id. + */ + +var DataSetPart = +/*#__PURE__*/ +function () { + function DataSetPart() { + classCallCheck(this, DataSetPart); + this._subscribers = { + '*': [], + add: [], + remove: [], + update: [] + }; + /** + * @deprecated Use on instead (PS: DataView.subscribe === DataView.on). + */ + + this.subscribe = DataSetPart.prototype.on; + /** + * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off). + */ + + this.unsubscribe = DataSetPart.prototype.off; + } + /** + * Trigger an event + * + * @param event - Event name. + * @param payload - Event payload. + * @param senderId - Id of the sender. + */ + + + createClass(DataSetPart, [{ + key: "_trigger", + value: function _trigger(event, payload, senderId) { + if (event === '*') { + throw new Error('Cannot trigger event *'); + } + + var subscribers = [].concat(toConsumableArray$1(this._subscribers[event]), toConsumableArray$1(this._subscribers['*'])); + + for (var i = 0, len = subscribers.length; i < len; i++) { + var subscriber = subscribers[i]; + + if (subscriber.callback) { + subscriber.callback(event, payload, senderId != null ? senderId : null); + } + } + } + /** + * Subscribe to an event, add an event listener. + * + * @param event - Event name. + * @param callback - Callback method. + */ + + }, { + key: "on", + value: function on(event, callback) { + this._subscribers[event].push({ + callback: callback + }); + } + /** + * Unsubscribe from an event, remove an event listener. + * + * @remarks If the same callback was subscribed more than once **all** occurences will be removed. + * + * @param event - Event name. + * @param callback - Callback method. + */ + + }, { + key: "off", + value: function off(event, callback) { + this._subscribers[event] = this._subscribers[event].filter(function (listener) { + return listener.callback !== callback; + }); + } + }]); + return DataSetPart; +}(); + +function ownKeys$1(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + keys.push.apply(keys, Object.getOwnPropertySymbols(object)); + } + + if (enumerableOnly) keys = keys.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + return keys; +} + +function _objectSpread$1(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys$1(source, true).forEach(function (key) { + defineProperty$1(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys$1(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; +} +/** + * # DataSet + * + * Vis.js comes with a flexible DataSet, which can be used to hold and manipulate unstructured data and listen for changes in the data. The DataSet is key/value based. Data items can be added, updated and removed from the DataSet, and one can subscribe to changes in the DataSet. The data in the DataSet can be filtered and ordered, and fields (like dates) can be converted to a specific type. Data can be normalized when appending it to the DataSet as well. + * + * ## Example + * + * The following example shows how to use a DataSet. + * + * ```javascript + * // create a DataSet + * var options = {}; + * var data = new vis.DataSet(options); + * + * // add items + * // note that the data items can contain different properties and data formats + * data.add([ + * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true}, + * {id: 2, text: 'item 2', date: '2013-06-23', group: 2}, + * {id: 3, text: 'item 3', date: '2013-06-25', group: 2}, + * {id: 4, text: 'item 4'} + * ]); + * + * // subscribe to any change in the DataSet + * data.on('*', function (event, properties, senderId) { + * console.log('event', event, properties); + * }); + * + * // update an existing item + * data.update({id: 2, group: 1}); + * + * // remove an item + * data.remove(4); + * + * // get all ids + * var ids = data.getIds(); + * console.log('ids', ids); + * + * // get a specific item + * var item1 = data.get(1); + * console.log('item1', item1); + * + * // retrieve a filtered subset of the data + * var items = data.get({ + * filter: function (item) { + * return item.group == 1; + * } + * }); + * console.log('filtered items', items); + * + * // retrieve formatted items + * var items = data.get({ + * fields: ['id', 'date'], + * type: { + * date: 'ISODate' + * } + * }); + * console.log('formatted items', items); + * ``` + * + * @typeParam Item - Item type that may or may not have an id. + * @typeParam IdProp - Name of the property that contains the id. + */ + + +var DataSet = +/*#__PURE__*/ +function (_DataSetPart) { + inherits(DataSet, _DataSetPart); + /** + * Construct a new DataSet. + * + * @param data - Initial data or options. + * @param options - Options (type error if data is also options). + */ + + function DataSet(data, options) { + var _this; + + classCallCheck(this, DataSet); + _this = possibleConstructorReturn(this, getPrototypeOf(DataSet).call(this)); // correctly read optional arguments + + if (data && !Array.isArray(data)) { + options = data; + data = []; + } + + _this._options = options || {}; + _this._data = Object.create({}); // map with data indexed by id + + _this.length = 0; // number of items in the DataSet + + _this._idProp = _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; + } + } + } // add initial data when provided + + + if (data && data.length) { + _this.add(data); + } + + _this.setOptions(options); + + return _this; + } + /** + * Set new options. + * + * @param options - The new options. + */ + + + createClass(DataSet, [{ + key: "setOptions", + value: function setOptions(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 (options.queue && _typeof_1$1(options.queue) === 'object') { + this._queue.setOptions(options.queue); + } + } + } + } + /** + * Add a data item or an array with items. + * + * After the items are added to the DataSet, the DataSet will trigger an event `add`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers. + * + * ## Example + * + * ```javascript + * // create a DataSet + * const data = new vis.DataSet() + * + * // add items + * const ids = data.add([ + * { id: 1, text: 'item 1' }, + * { id: 2, text: 'item 2' }, + * { text: 'item without an id' } + * ]) + * + * console.log(ids) // [1, 2, ''] + * ``` + * + * @param data - Items to be added (ids will be generated if missing). + * @param senderId - Sender id. + * + * @returns addedIds - Array with the ids (generated if not present) of the added items. + * + * @throws When an item with the same id as any of the added items already exists. + */ + + }, { + key: "add", + value: function add(data, senderId) { + var addedIds = []; + var id; + + if (Array.isArray(data)) { + // Array + for (var i = 0, len = data.length; i < len; i++) { + id = this._addItem(data[i]); + addedIds.push(id); + } + } else if (data && _typeof_1$1(data) === 'object') { + // Single item + id = this._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 + * + * The provided properties will be merged in the existing item. When an item does not exist, it will be created. + * + * After the items are updated, the DataSet will trigger an event `add` for the added items, and an event `update`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers. + * + * ## Example + * + * ```javascript + * // create a DataSet + * const data = new vis.DataSet([ + * { id: 1, text: 'item 1' }, + * { id: 2, text: 'item 2' }, + * { id: 3, text: 'item 3' } + * ]) + * + * // update items + * const ids = data.update([ + * { id: 2, text: 'item 2 (updated)' }, + * { id: 4, text: 'item 4 (new)' } + * ]) + * + * console.log(ids) // [2, 4] + * ``` + * + * @param data - Items to be updated (if the id is already present) or added (if the id is missing). + * @param senderId - Sender id. + * + * @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items. + * + * @throws When the supplied data is neither an item nor an array of items. + */ + + }, { + key: "update", + value: function update(data, senderId) { + var _this2 = this; + + var addedIds = []; + var updatedIds = []; + var oldData = []; + var updatedData = []; + var idProp = this._idProp; + + var addOrUpdate = function addOrUpdate(item) { + var origId = item[idProp]; + + if (origId != null && _this2._data[origId]) { + var fullItem = item; // it has an id, therefore it is a fullitem + + var oldItem = Object.assign({}, _this2._data[origId]); // update item + + var id = _this2._updateItem(fullItem); + + updatedIds.push(id); + updatedData.push(fullItem); + oldData.push(oldItem); + } else { + // add new item + var _id = _this2._addItem(item); + + addedIds.push(_id); + } + }; + + if (Array.isArray(data)) { + // Array + for (var i = 0, len = data.length; i < len; i++) { + if (data[i] && _typeof_1$1(data[i]) === 'object') { + addOrUpdate(data[i]); + } else { + console.warn('Ignoring input item, which is not an object at index ' + i); + } + } + } else if (data && _typeof_1$1(data) === '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); + } + /** @inheritdoc */ + + }, { + key: "get", + value: function get(first, second) { + // @TODO: Woudn't it be better to split this into multiple methods? + // parse the arguments + var id = undefined; + var ids = undefined; + var options = undefined; + + if (isId(first)) { + // get(id [, options]) + id = first; + options = second; + } else if (Array.isArray(first)) { + // get(ids [, options]) + ids = first; + options = second; + } else { + // get([, options]) + options = first; + } // determine the return type + + + var returnType = options && options.returnType === 'Object' ? 'Object' : 'Array'; // @TODO: WTF is this? Or am I missing something? + // 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 = []; + var item = null; + var itemIds = null; + var itemId = null; // convert items + + if (id != null) { + // return a single item + item = this._getItem(id, type); + + if (item && filter && !filter(item)) { + item = null; + } + } else if (ids != null) { + // return a subset of items + for (var i = 0, len = ids.length; i < len; i++) { + item = this._getItem(ids[i], type); + + if (item != null && (!filter || filter(item))) { + items.push(item); + } + } + } else { + // return all items + itemIds = Object.keys(this._data); + + for (var _i = 0, _len = itemIds.length; _i < _len; _i++) { + itemId = itemIds[_i]; + item = this._getItem(itemId, type); + + if (item != null && (!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 != null) { + item = this._filterFields(item, fields); + } else { + for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) { + items[_i2] = this._filterFields(items[_i2], fields); + } + } + } // return the results + + + if (returnType == 'Object') { + var result = {}; + + for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) { + var resultant = items[_i3]; // @TODO: Shoudn't this be this._fieldId? + // result[resultant.id] = resultant + + var _id2 = resultant[this._idProp]; + result[_id2] = resultant; + } + + return result; + } else { + if (id != null) { + // a single item + return item; + } else { + // just return our array + return items; + } + } + } + /** @inheritdoc */ + + }, { + key: "getIds", + value: function getIds(options) { + var data = this._data; + var filter = options && options.filter; + var order = options && options.order; + var type = options && options.type || this._options.type; + var itemIds = Object.keys(data); + var ids = []; + var item; + var items; + + if (filter) { + // get filtered items + if (order) { + // create ordered list + items = []; + + for (var i = 0, len = itemIds.length; i < len; i++) { + var id = itemIds[i]; + item = this._getItem(id, type); + + if (filter(item)) { + items.push(item); + } + } + + this._sort(items, order); + + for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) { + ids.push(items[_i4][this._idProp]); + } + } else { + // create unordered list + for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) { + var _id3 = itemIds[_i5]; + item = this._getItem(_id3, type); + + if (filter(item)) { + ids.push(item[this._idProp]); + } + } + } + } else { + // get all items + if (order) { + // create an ordered list + items = []; + + for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) { + var _id4 = itemIds[_i6]; + items.push(data[_id4]); + } + + this._sort(items, order); + + for (var _i7 = 0, _len7 = items.length; _i7 < _len7; _i7++) { + ids.push(items[_i7][this._idProp]); + } + } else { + // create unordered list + for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) { + var _id5 = itemIds[_i8]; + item = data[_id5]; + ids.push(item[this._idProp]); + } + } + } + + return ids; + } + /** @inheritdoc */ + + }, { + key: "getDataSet", + value: function getDataSet() { + return this; + } + /** @inheritdoc */ + + }, { + key: "forEach", + value: function forEach(callback, options) { + var filter = options && options.filter; + var type = options && options.type || this._options.type; + var data = this._data; + var itemIds = Object.keys(data); + + if (options && options.order) { + // execute forEach on ordered list + var items = this.get(options); + + for (var i = 0, len = items.length; i < len; i++) { + var item = items[i]; + var id = item[this._idProp]; + callback(item, id); + } + } else { + // unordered + for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) { + var _id6 = itemIds[_i9]; + + var _item = this._getItem(_id6, type); + + if (!filter || filter(_item)) { + callback(_item, _id6); + } + } + } + } + /** @inheritdoc */ + + }, { + key: "map", + value: function map(callback, options) { + var filter = options && options.filter; + var type = options && options.type || this._options.type; + var mappedItems = []; + var data = this._data; + var itemIds = Object.keys(data); // convert and filter items + + for (var i = 0, len = itemIds.length; i < len; i++) { + var id = itemIds[i]; + + var 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 item - The item whose fields should be filtered. + * @param fields - The names of the fields that will be kept. + * + * @typeParam K - Field name type. + * + * @returns The item without any additional fields. + */ + + }, { + key: "_filterFields", + value: function _filterFields(item, fields) { + if (!item) { + // item is null + return item; + } + + return (Array.isArray(fields) ? // Use the supplied array + fields : // Use the keys of the supplied object + Object.keys(fields)).reduce(function (filteredItem, field) { + filteredItem[field] = item[field]; + return filteredItem; + }, {}); + } + /** + * Sort the provided array with items. + * + * @param items - Items to be sorted in place. + * @param order - A field name or custom sort function. + * + * @typeParam T - The type of the items in the items array. + */ + + }, { + key: "_sort", + value: function _sort(items, order) { + if (typeof order === 'string') { + // order by provided field name + var name = order; // field name + + items.sort(function (a, b) { + // @TODO: How to treat missing properties? + 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); + } else { + // TODO: extend order by an Object {field:string, direction:string} + // where direction can be 'asc' or 'desc' + throw new TypeError('Order must be a function or a string'); + } + } + /** + * Remove an item or multiple items by “reference” (only the id is used) or by id. + * + * The method ignores removal of non-existing items, and returns an array containing the ids of the items which are actually removed from the DataSet. + * + * After the items are removed, the DataSet will trigger an event `remove` for the removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers. + * + * ## Example + * ```javascript + * // create a DataSet + * const data = new vis.DataSet([ + * { id: 1, text: 'item 1' }, + * { id: 2, text: 'item 2' }, + * { id: 3, text: 'item 3' } + * ]) + * + * // remove items + * const ids = data.remove([2, { id: 3 }, 4]) + * + * console.log(ids) // [2, 3] + * ``` + * + * @param id - One or more items or ids of items to be removed. + * @param senderId - Sender id. + * + * @returns The ids of the removed items. + */ + + }, { + key: "remove", + value: function remove(id, senderId) { + var removedIds = []; + var removedItems = []; // force everything to be an array for simplicity + + var ids = Array.isArray(id) ? id : [id]; + + for (var i = 0, len = ids.length; i < len; i++) { + var item = this._remove(ids[i]); + + if (item) { + var itemId = item[this._idProp]; + + if (itemId != null) { + removedIds.push(itemId); + removedItems.push(item); + } + } + } + + if (removedIds.length) { + this._trigger('remove', { + items: removedIds, + oldData: removedItems + }, senderId); + } + + return removedIds; + } + /** + * Remove an item by its id or reference. + * + * @param id - Id of an item or the item itself. + * + * @returns The removed item if removed, null otherwise. + */ + + }, { + key: "_remove", + value: function _remove(id) { + // @TODO: It origianlly returned the item although the docs say id. + // The code expects the item, so probably an error in the docs. + var ident; // confirm the id to use based on the args type + + if (isId(id)) { + ident = id; + } else if (id && _typeof_1$1(id) === 'object') { + ident = id[this._idProp]; // look for the identifier field using ._idProp + } // do the removing if the item is found + + + if (ident != null && this._data[ident]) { + var item = this._data[ident]; + delete this._data[ident]; + --this.length; + return item; + } + + return null; + } + /** + * Clear the entire data set. + * + * After the items are removed, the [[DataSet]] will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers. + * + * @param senderId - Sender id. + * + * @returns removedIds - The ids of all removed items. + */ + + }, { + key: "clear", + value: function clear(senderId) { + var ids = Object.keys(this._data); + var items = []; + + for (var i = 0, len = ids.length; i < len; i++) { + items.push(this._data[ids[i]]); + } + + this._data = {}; + this.length = 0; + + this._trigger('remove', { + items: ids, + oldData: items + }, senderId); + + return ids; + } + /** + * Find the item with maximum value of a specified field. + * + * @param field - Name of the property that should be searched for max value. + * + * @returns Item containing max value, or null if no items. + */ + + }, { + key: "max", + value: function max(field) { + var data = this._data; + var itemIds = Object.keys(data); + var max = null; + var maxField = null; + + for (var i = 0, len = itemIds.length; i < len; i++) { + var id = itemIds[i]; + var item = data[id]; + var itemField = item[field]; + + if (itemField != null && (maxField == null || itemField > maxField)) { + max = item; + maxField = itemField; + } + } + + return max; + } + /** + * Find the item with minimum value of a specified field. + * + * @param field - Name of the property that should be searched for min value. + * + * @returns Item containing min value, or null if no items. + */ + + }, { + key: "min", + value: function min(field) { + var data = this._data; + var itemIds = Object.keys(data); + var min = null; + var minField = null; + + for (var i = 0, len = itemIds.length; i < len; i++) { + var id = itemIds[i]; + var item = data[id]; + var itemField = item[field]; + + if (itemField != null && (minField == null || itemField < minField)) { + min = item; + minField = itemField; + } + } + + return min; + } + /** + * Find all distinct values of a specified field + * + * @param prop - The property name whose distinct values should be returned. + * + * @returns Unordered array containing all distinct values. Items without specified property are ignored. + */ + + }, { + key: "distinct", + value: function distinct(prop) { + var data = this._data; + var itemIds = Object.keys(data); + var values = []; + var fieldType = this._options.type && this._options.type[prop] || null; + var count = 0; + + for (var i = 0, len = itemIds.length; i < len; i++) { + var id = itemIds[i]; + var item = data[id]; + var value = item[prop]; + var exists = false; + + for (var j = 0; j < count; j++) { + if (values[j] == value) { + exists = true; + break; + } + } + + if (!exists && value !== undefined) { + values[count] = value; + count++; + } + } + + if (fieldType) { + for (var _i10 = 0, _len10 = values.length; _i10 < _len10; _i10++) { + values[_i10] = convert$1(values[_i10], fieldType); + } + } + + return values; + } + /** + * Add a single item. Will fail when an item with the same id already exists. + * + * @param item - A new item to be added. + * + * @returns Added item's id. An id is generated when it is not present in the item. + */ + + }, { + key: "_addItem", + value: function _addItem(item) { + var id = item[this._idProp]; + + if (id != null) { + // 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 = uuid4$1(); + item[this._idProp] = id; + } + + var d = {}; + 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] = convert$1(item[field], fieldType); + } + + this._data[id] = d; + this.length++; + return id; + } + /** + * Get an item. Fields can be converted to a specific type + * + * @param id - Id of the requested item. + * @param types - Property name to type name object map of type converstions. + * + * @returns The item, optionally after type conversion. + */ + + }, { + key: "_getItem", + value: function _getItem(id, types) { + // @TODO: I have no idea how to type this. + // get the item from the dataset + var raw = this._data[id]; + + if (!raw) { + return null; + } // convert the items field types + + + var converted; + var fields = Object.keys(raw); + + if (types) { + converted = {}; + + for (var i = 0, len = fields.length; i < len; i++) { + var field = fields[i]; + var value = raw[field]; + converted[field] = convert$1(value, types[field]); + } + } else { + // no field types specified, no converting needed + converted = _objectSpread$1({}, raw); + } + + if (converted[this._idProp] == null) { + converted[this._idProp] = raw.id; + } + + 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 item - The new item + * + * @returns The id of the updated item. + */ + + }, { + key: "_updateItem", + value: function _updateItem(item) { + var id = item[this._idProp]; + + if (id == null) { + 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] = convert$1(item[field], fieldType); + } + + return id; + } + }]); + return DataSet; +}(DataSetPart); +/** + * DataView + * + * A DataView offers a filtered and/or formatted view on a DataSet. One can subscribe to changes in a DataView, and easily get filtered or formatted data without having to specify filters and field types all the time. + * + * ## Example + * ```javascript + * // create a DataSet + * var data = new vis.DataSet(); + * data.add([ + * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true}, + * {id: 2, text: 'item 2', date: '2013-06-23', group: 2}, + * {id: 3, text: 'item 3', date: '2013-06-25', group: 2}, + * {id: 4, text: 'item 4'} + * ]); + * + * // create a DataView + * // the view will only contain items having a property group with value 1, + * // and will only output fields id, text, and date. + * var view = new vis.DataView(data, { + * filter: function (item) { + * return (item.group == 1); + * }, + * fields: ['id', 'text', 'date'] + * }); + * + * // subscribe to any change in the DataView + * view.on('*', function (event, properties, senderId) { + * console.log('event', event, properties); + * }); + * + * // update an item in the data set + * data.update({id: 2, group: 1}); + * + * // get all ids in the view + * var ids = view.getIds(); + * console.log('ids', ids); // will output [1, 2] + * + * // get all items in the view + * var items = view.get(); + * ``` + * + * @typeParam Item - Item type that may or may not have an id. + * @typeParam IdProp - Name of the property that contains the id. + */ + + +var DataView = +/*#__PURE__*/ +function (_DataSetPart) { + inherits(DataView, _DataSetPart); + /** + * Create a DataView. + * + * @param data - The instance containing data (directly or indirectly). + * @param options - Options to configure this data view. + */ + + function DataView(data, options) { + var _this; + + classCallCheck(this, DataView); + _this = possibleConstructorReturn(this, getPrototypeOf(DataView).call(this)); + /** @inheritdoc */ + + _this.length = 0; + _this._ids = {}; // ids of the items currently in memory (just contains a boolean true) + + _this._options = options || {}; + _this.listener = _this._onEvent.bind(assertThisInitialized(_this)); + + _this.setData(data); + + return _this; + } // TODO: implement a function .config() to dynamically update things like configured filter + // and trigger changes accordingly + + /** + * Set a data source for the view. + * + * @param data - The instance containing data (directly or indirectly). + */ + + + createClass(DataView, [{ + key: "setData", + value: function setData(data) { + if (this._data) { + // unsubscribe from current dataset + if (this._data.off) { + this._data.off('*', this.listener); + } // trigger a remove of all items in memory + + + var ids = this._data.getIds({ + filter: this._options.filter + }); + + var items = this._data.get(ids); + + this._ids = {}; + this.length = 0; + + this._trigger('remove', { + items: ids, + oldData: items + }); + } + + if (data != null) { + this._data = data; // trigger an add of all added items + + var _ids = this._data.getIds({ + filter: this._options.filter + }); + + for (var i = 0, len = _ids.length; i < len; i++) { + var id = _ids[i]; + this._ids[id] = true; + } + + this.length = _ids.length; + + this._trigger('add', { + items: _ids + }); + } else { + this._data = new DataSet(); + } // 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. + */ + + }, { + key: "refresh", + value: function refresh() { + var ids = this._data.getIds({ + filter: this._options.filter + }); + + var oldIds = Object.keys(this._ids); + var newIds = {}; + var addedIds = []; + var removedIds = []; + var removedItems = []; // check for additions + + for (var i = 0, len = ids.length; i < len; i++) { + var id = ids[i]; + newIds[id] = true; + + if (!this._ids[id]) { + addedIds.push(id); + this._ids[id] = true; + } + } // check for removals + + + for (var _i = 0, _len = oldIds.length; _i < _len; _i++) { + var _id = oldIds[_i]; + + var item = this._data.get(_id); + + if (item == null) { + // @TODO: Investigate. + // Doesn't happen during tests or examples. + // Is it really impossible or could it eventually happen? + // How to handle it if it does? The types guarantee non-nullable items. + console.error('If you see this, report it please.'); + } else if (!newIds[_id]) { + removedIds.push(_id); + removedItems.push(item); + delete this._ids[_id]; + } + } + + this.length += addedIds.length - removedIds.length; // trigger events + + if (addedIds.length) { + this._trigger('add', { + items: addedIds + }); + } + + if (removedIds.length) { + this._trigger('remove', { + items: removedIds, + oldData: removedItems + }); + } + } + /** @inheritdoc */ + + }, { + key: "get", + value: function get(first, second) { + if (this._data == null) { + return null; + } // parse the arguments + + + var ids = null; + var options; + + if (isId(first) || Array.isArray(first)) { + ids = first; + options = second; + } else { + options = first; + } // extend the options with the default options and provided options + + + var viewOptions = Object.assign({}, this._options, options); // create a combined filter method when needed + + var thisFilter = this._options.filter; + var optionsFilter = options && options.filter; + + if (thisFilter && optionsFilter) { + viewOptions.filter = function (item) { + return thisFilter(item) && optionsFilter(item); + }; + } + + if (ids == null) { + return this._data.get(viewOptions); + } else { + return this._data.get(ids, viewOptions); + } + } + /** @inheritdoc */ + + }, { + key: "getIds", + value: function getIds(options) { + if (this._data.length) { + var defaultFilter = this._options.filter; + var optionsFilter = options != null ? options.filter : null; + var filter; + + if (optionsFilter) { + if (defaultFilter) { + filter = function filter(item) { + return defaultFilter(item) && optionsFilter(item); + }; + } else { + filter = optionsFilter; + } + } else { + filter = defaultFilter; + } + + return this._data.getIds({ + filter: filter, + order: options && options.order + }); + } else { + return []; + } + } + /** @inheritdoc */ + + }, { + key: "forEach", + value: function forEach(callback, options) { + if (this._data) { + var defaultFilter = this._options.filter; + var optionsFilter = options && options.filter; + var filter; + + if (optionsFilter) { + if (defaultFilter) { + filter = function filter(item) { + return defaultFilter(item) && optionsFilter(item); + }; + } else { + filter = optionsFilter; + } + } else { + filter = defaultFilter; + } + + this._data.forEach(callback, { + filter: filter, + order: options && options.order + }); + } + } + /** @inheritdoc */ + + }, { + key: "map", + value: function map(callback, options) { + if (this._data) { + var defaultFilter = this._options.filter; + var optionsFilter = options && options.filter; + var filter; + + if (optionsFilter) { + if (defaultFilter) { + filter = function filter(item) { + return defaultFilter(item) && optionsFilter(item); + }; + } else { + filter = optionsFilter; + } + } else { + filter = defaultFilter; + } + + return this._data.map(callback, { + filter: filter, + order: options && options.order + }); + } else { + return []; + } + } + /** @inheritdoc */ + + }, { + key: "getDataSet", + value: function getDataSet() { + return this._data.getDataSet(); + } + /** + * 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 event - The name of the event. + * @param params - Parameters of the event. + * @param senderId - Id supplied by the sender. + */ + + }, { + key: "_onEvent", + value: function _onEvent(event, params, senderId) { + if (!params || !params.items || !this._data) { + return; + } + + var ids = params.items; + var addedIds = []; + var updatedIds = []; + var removedIds = []; + var oldItems = []; + var updatedItems = []; + var removedItems = []; + + switch (event) { + case 'add': + // filter the ids of the added items + for (var i = 0, len = ids.length; i < len; i++) { + var id = ids[i]; + var item = this.get(id); + + if (item) { + this._ids[id] = true; + addedIds.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 (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) { + var _id2 = ids[_i2]; + + var _item = this.get(_id2); + + if (_item) { + if (this._ids[_id2]) { + updatedIds.push(_id2); + updatedItems.push(params.data[_i2]); + oldItems.push(params.oldData[_i2]); + } else { + this._ids[_id2] = true; + addedIds.push(_id2); + } + } else { + if (this._ids[_id2]) { + delete this._ids[_id2]; + removedIds.push(_id2); + removedItems.push(params.oldData[_i2]); + } + } + } + + break; + + case 'remove': + // filter the ids of the removed items + for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) { + var _id3 = ids[_i3]; + + if (this._ids[_id3]) { + delete this._ids[_id3]; + removedIds.push(_id3); + removedItems.push(params.oldData[_i3]); + } + } + + break; + } + + this.length += addedIds.length - removedIds.length; + + if (addedIds.length) { + this._trigger('add', { + items: addedIds + }, senderId); + } + + if (updatedIds.length) { + this._trigger('update', { + items: updatedIds, + oldData: oldItems, + data: updatedItems + }, senderId); + } + + if (removedIds.length) { + this._trigger('remove', { + items: removedIds, + oldData: removedItems + }, senderId); + } + } + }]); + return DataView; +}(DataSetPart); + +var fails = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } +}; + +var toString = {}.toString; + +var classofRaw = function (it) { + return toString.call(it).slice(8, -1); +}; + +var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings + +var indexedObject = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins + return !Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classofRaw(it) == 'String' ? split.call(it, '') : Object(it); +} : Object; + +// `RequireObjectCoercible` abstract operation +// https://tc39.github.io/ecma262/#sec-requireobjectcoercible +var requireObjectCoercible = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + +var toIndexedObject = function (it) { + return indexedObject(requireObjectCoercible(it)); +}; + +var iterators = {}; + +var commonjsGlobal$2 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function commonjsRequire$2 () { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); +} + +function createCommonjsModule$2(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var O = 'object'; + +var check = function (it) { + return it && it.Math == Math && it; +}; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + + +var global_1 = // eslint-disable-next-line no-undef +check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof commonjsGlobal$2 == O && commonjsGlobal$2) || // eslint-disable-next-line no-new-func +Function('return this')(); + +var descriptors = !fails(function () { + return Object.defineProperty({}, 'a', { + get: function () { + return 7; + } + }).a != 7; +}); + +var isObject$1 = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + +var document$1 = global_1.document; // typeof document.createElement is 'object' in old IE + +var EXISTS = isObject$1(document$1) && isObject$1(document$1.createElement); + +var documentCreateElement = function (it) { + return EXISTS ? document$1.createElement(it) : {}; +}; + +var ie8DomDefine = !descriptors && !fails(function () { + return Object.defineProperty(documentCreateElement('div'), 'a', { + get: function () { + return 7; + } + }).a != 7; +}); + +var anObject = function (it) { + if (!isObject$1(it)) { + throw TypeError(String(it) + ' is not an object'); + } + + return it; +}; + +// https://tc39.github.io/ecma262/#sec-toprimitive +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string + +var toPrimitive = function (input, PREFERRED_STRING) { + if (!isObject$1(input)) return input; + var fn, val; + if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$1(val = fn.call(input))) return val; + if (typeof (fn = input.valueOf) == 'function' && !isObject$1(val = fn.call(input))) return val; + if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$1(val = fn.call(input))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + +var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method +// https://tc39.github.io/ecma262/#sec-object.defineproperty + +var f = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (ie8DomDefine) try { + return nativeDefineProperty(O, P, Attributes); + } catch (error) { + /* empty */ + } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; +var objectDefineProperty = { + f: f +}; + +var createPropertyDescriptor = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + +var hide = descriptors ? function (object, key, value) { + return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + +var setGlobal = function (key, value) { + try { + hide(global_1, key, value); + } catch (error) { + global_1[key] = value; + } + + return value; +}; + +var shared = createCommonjsModule$2(function (module) { + var SHARED = '__core-js_shared__'; + var store = global_1[SHARED] || setGlobal(SHARED, {}); + (module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); + })('versions', []).push({ + version: '3.2.1', + mode: 'pure' , + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' + }); +}); + +var functionToString = shared('native-function-to-string', Function.toString); + +var WeakMap = global_1.WeakMap; +var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap)); + +var hasOwnProperty = {}.hasOwnProperty; + +var has = function (it, key) { + return hasOwnProperty.call(it, key); +}; + +var id = 0; +var postfix = Math.random(); + +var uid = function (key) { + return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); +}; + +var keys = shared('keys'); + +var sharedKey = function (key) { + return keys[key] || (keys[key] = uid(key)); +}; + +var hiddenKeys = {}; + +var WeakMap$1 = global_1.WeakMap; +var set, get, has$1; + +var enforce = function (it) { + return has$1(it) ? get(it) : set(it, {}); +}; + +var getterFor = function (TYPE) { + return function (it) { + var state; + + if (!isObject$1(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } + + return state; + }; +}; + +if (nativeWeakMap) { + var store = new WeakMap$1(); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + + set = function (it, metadata) { + wmset.call(store, it, metadata); + return metadata; + }; + + get = function (it) { + return wmget.call(store, it) || {}; + }; + + has$1 = function (it) { + return wmhas.call(store, it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + + set = function (it, metadata) { + hide(it, STATE, metadata); + return metadata; + }; + + get = function (it) { + return has(it, STATE) ? it[STATE] : {}; + }; + + has$1 = function (it) { + return has(it, STATE); + }; +} + +var internalState = { + set: set, + get: get, + has: has$1, + enforce: enforce, + getterFor: getterFor +}; + +var nativePropertyIsEnumerable = {}.propertyIsEnumerable; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug + +var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ + 1: 2 +}, 1); // `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable + +var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; +} : nativePropertyIsEnumerable; +var objectPropertyIsEnumerable = { + f: f$1 +}; + +var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + +var f$2 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (ie8DomDefine) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { + /* empty */ + } + if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]); +}; +var objectGetOwnPropertyDescriptor = { + f: f$2 +}; + +var replacement = /#|\.prototype\./; + +var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; +}; + +var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); +}; + +var data = isForced.data = {}; +var NATIVE = isForced.NATIVE = 'N'; +var POLYFILL = isForced.POLYFILL = 'P'; +var isForced_1 = isForced; + +var path = {}; + +var aFunction = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } + + return it; +}; + +var bindContext = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + + switch (length) { + case 0: + return function () { + return fn.call(that); + }; + + case 1: + return function (a) { + return fn.call(that, a); + }; + + case 2: + return function (a, b) { + return fn.call(that, a, b); + }; + + case 3: + return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + + return function () + /* ...args */ + { + return fn.apply(that, arguments); + }; +}; + +var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; + +var wrapConstructor = function (NativeConstructor) { + var Wrapper = function (a, b, c) { + if (this instanceof NativeConstructor) { + switch (arguments.length) { + case 0: + return new NativeConstructor(); + + case 1: + return new NativeConstructor(a); + + case 2: + return new NativeConstructor(a, b); + } + + return new NativeConstructor(a, b, c); + } + + return NativeConstructor.apply(this, arguments); + }; + + Wrapper.prototype = NativeConstructor.prototype; + return Wrapper; +}; +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ + + +var _export = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var PROTO = options.proto; + var nativeSource = GLOBAL ? global_1 : STATIC ? global_1[TARGET] : (global_1[TARGET] || {}).prototype; + var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {}); + var targetPrototype = target.prototype; + var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; + var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; + + for (key in source) { + FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native + + USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key); + targetProperty = target[key]; + if (USE_NATIVE) if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor$1(nativeSource, key); + nativeProperty = descriptor && descriptor.value; + } else nativeProperty = nativeSource[key]; // export native or implementation + + sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key]; + if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue; // bind timers to global for call from export context + + if (options.bind && USE_NATIVE) resultProperty = bindContext(sourceProperty, global_1); // wrap global constructors for prevent changs in this version + else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); // make static versions for prototype methods + else if (PROTO && typeof sourceProperty == 'function') resultProperty = bindContext(Function.call, sourceProperty); // default case + else resultProperty = sourceProperty; // add a flag to not completely full polyfills + + if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) { + hide(resultProperty, 'sham', true); + } + + target[key] = resultProperty; + + if (PROTO) { + VIRTUAL_PROTOTYPE = TARGET + 'Prototype'; + if (!has(path, VIRTUAL_PROTOTYPE)) hide(path, VIRTUAL_PROTOTYPE, {}); // export virtual prototype methods + + path[VIRTUAL_PROTOTYPE][key] = sourceProperty; // export real prototype methods + + if (options.real && targetPrototype && !targetPrototype[key]) hide(targetPrototype, key, sourceProperty); + } + } +}; + +// https://tc39.github.io/ecma262/#sec-toobject + +var toObject = function (argument) { + return Object(requireObjectCoercible(argument)); +}; + +var correctPrototypeGetter = !fails(function () { + function F() { + /* empty */ + } + + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; +}); + +var IE_PROTO = sharedKey('IE_PROTO'); +var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.getprototypeof + +var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } + + return O instanceof Object ? ObjectPrototype : null; +}; + +var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { + // Chrome 38 Symbol has incorrect toString conversion + // eslint-disable-next-line no-undef + return !String(Symbol()); +}); + +var Symbol$1 = global_1.Symbol; +var store$1 = shared('wks'); + +var wellKnownSymbol = function (name) { + return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name] || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name)); +}; + +var ITERATOR = wellKnownSymbol('iterator'); +var BUGGY_SAFARI_ITERATORS = false; +// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object + + +var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + +if ([].keys) { + arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` + + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else { + PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } +} + +if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +var iteratorsCore = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS +}; + +var ceil = Math.ceil; +var floor = Math.floor; // `ToInteger` abstract operation +// https://tc39.github.io/ecma262/#sec-tointeger + +var toInteger = function (argument) { + return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); +}; + +var min = Math.min; // `ToLength` abstract operation +// https://tc39.github.io/ecma262/#sec-tolength + +var toLength = function (argument) { + return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; + +var max = Math.max; +var min$1 = Math.min; // Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). + +var toAbsoluteIndex = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min$1(integer, length); +}; + +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; // eslint-disable-next-line no-self-compare + + if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not + } else for (; length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } + return !IS_INCLUDES && -1; + }; +}; + +var arrayIncludes = { + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; + +var indexOf = arrayIncludes.indexOf; + +var objectKeysInternal = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + + for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys + + + while (names.length > i) if (has(O, key = names[i++])) { + ~indexOf(result, key) || result.push(key); + } + + return result; +}; + +// IE8- don't enum bug keys +var enumBugKeys = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; + +// https://tc39.github.io/ecma262/#sec-object.keys + +var objectKeys = Object.keys || function keys(O) { + return objectKeysInternal(O, enumBugKeys); +}; + +// https://tc39.github.io/ecma262/#sec-object.defineproperties + +var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + + while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]); + + return O; +}; + +var aFunction$1 = function (variable) { + return typeof variable == 'function' ? variable : undefined; +}; + +var getBuiltIn = function (namespace, method) { + return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace]) : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method]; +}; + +var html = getBuiltIn('document', 'documentElement'); + +var IE_PROTO$1 = sharedKey('IE_PROTO'); +var PROTOTYPE = 'prototype'; + +var Empty = function () { + /* empty */ +}; // Create object with fake `null` prototype: use iframe Object with cleared prototype + + +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var length = enumBugKeys.length; + var lt = '<'; + var script = 'script'; + var gt = '>'; + var js = 'java' + script + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = String(js); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + + while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; + + return createDict(); +}; // `Object.create` method +// https://tc39.github.io/ecma262/#sec-object.create + + +var objectCreate = Object.create || function create(O, Properties) { + var result; + + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill + + result[IE_PROTO$1] = O; + } else result = createDict(); + + return Properties === undefined ? result : objectDefineProperties(result, Properties); +}; + +hiddenKeys[IE_PROTO$1] = true; + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); // ES3 wrong here + +var CORRECT_ARGUMENTS = classofRaw(function () { + return arguments; +}()) == 'Arguments'; // fallback for IE11 Script Access Denied error + +var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { + /* empty */ + } +}; // getting tag from ES6+ `Object.prototype.toString` + + +var classof = function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case + : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; +}; + +var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); +var test = {}; +test[TO_STRING_TAG$1] = 'z'; // `Object.prototype.toString` method implementation +// https://tc39.github.io/ecma262/#sec-object.prototype.tostring + +var objectToString = String(test) !== '[object z]' ? function toString() { + return '[object ' + classof(this) + ']'; +} : test.toString; + +var defineProperty$2 = objectDefineProperty.f; +var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); +var METHOD_REQUIRED = objectToString !== {}.toString; + +var setToStringTag = function (it, TAG, STATIC, SET_METHOD) { + if (it) { + var target = STATIC ? it : it.prototype; + + if (!has(target, TO_STRING_TAG$2)) { + defineProperty$2(target, TO_STRING_TAG$2, { + configurable: true, + value: TAG + }); + } + + if (SET_METHOD && METHOD_REQUIRED) hide(target, 'toString', objectToString); + } +}; + +var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; + +var returnThis = function () { + return this; +}; + +var createIteratorConstructor = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { + next: createPropertyDescriptor(1, next) + }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; +}; + +var aPossiblePrototype = function (it) { + if (!isObject$1(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } + + return it; +}; + +// https://tc39.github.io/ecma262/#sec-object.setprototypeof +// Works with __proto__ only. Old v8 can't work with null proto objects. + +/* eslint-disable no-proto */ + +var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + + try { + setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; + setter.call(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { + /* empty */ + } + + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter.call(O, proto);else O.__proto__ = proto; + return O; + }; +}() : undefined); + +var redefine = function (target, key, value, options) { + if (options && options.enumerable) target[key] = value;else hide(target, key, value); +}; + +var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; +var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS; +var ITERATOR$1 = wellKnownSymbol('iterator'); +var KEYS = 'keys'; +var VALUES = 'values'; +var ENTRIES = 'entries'; + +var returnThis$1 = function () { + return this; +}; + +var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND]; + + switch (KIND) { + case KEYS: + return function keys() { + return new IteratorConstructor(this, KIND); + }; + + case VALUES: + return function values() { + return new IteratorConstructor(this, KIND); + }; + + case ENTRIES: + return function entries() { + return new IteratorConstructor(this, KIND); + }; + } + + return function () { + return new IteratorConstructor(this); + }; + }; + + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR$1] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; // fix native + + if (anyNativeIterator) { + CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable())); + + if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) { + + + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + iterators[TO_STRING_TAG] = returnThis$1; + } + } // fix Array#{values, @@iterator}.name in V8 / FF + + + if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + INCORRECT_VALUES_NAME = true; + + defaultIterator = function values() { + return nativeIterator.call(this); + }; + } // define iterator + + + if (( FORCED) && IterablePrototype[ITERATOR$1] !== defaultIterator) { + hide(IterablePrototype, ITERATOR$1, defaultIterator); + } + + iterators[NAME] = defaultIterator; // export additional methods + + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } else _export({ + target: NAME, + proto: true, + forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME + }, methods); + } + + return methods; +}; + +var ARRAY_ITERATOR = 'Array Iterator'; +var setInternalState = internalState.set; +var getInternalState = internalState.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method +// https://tc39.github.io/ecma262/#sec-array.prototype.entries +// `Array.prototype.keys` method +// https://tc39.github.io/ecma262/#sec-array.prototype.keys +// `Array.prototype.values` method +// https://tc39.github.io/ecma262/#sec-array.prototype.values +// `Array.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator +// `CreateArrayIterator` internal method +// https://tc39.github.io/ecma262/#sec-createarrayiterator + +var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), + // target + index: 0, + // next index + kind: kind // kind + + }); // `%ArrayIteratorPrototype%.next` method + // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next +}, function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + + if (!target || index >= target.length) { + state.target = undefined; + return { + value: undefined, + done: true + }; + } + + if (kind == 'keys') return { + value: index, + done: false + }; + if (kind == 'values') return { + value: target[index], + done: false + }; + return { + value: [index, target[index]], + done: false + }; +}, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% +// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject +// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject + +iterators.Arguments = iterators.Array; // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + +// iterable DOM collections +// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods +var domIterables = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 +}; + +var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag'); + +for (var COLLECTION_NAME in domIterables) { + var Collection = global_1[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + + if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG$3]) { + hide(CollectionPrototype, TO_STRING_TAG$3, COLLECTION_NAME); + } + + iterators[COLLECTION_NAME] = iterators.Array; +} + +// https://tc39.github.io/ecma262/#sec-isarray + +var isArray = Array.isArray || function isArray(arg) { + return classofRaw(arg) == 'Array'; +}; + +var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation +// https://tc39.github.io/ecma262/#sec-arrayspeciescreate + +var arraySpeciesCreate = function (originalArray, length) { + var C; + + if (isArray(originalArray)) { + C = originalArray.constructor; // cross-realm fallback + + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;else if (isObject$1(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } + + return new (C === undefined ? Array : C)(length === 0 ? 0 : length); +}; + +var push = [].push; // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation + +var createMethod$1 = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = indexedObject(O); + var boundFunction = bindContext(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var value, result; + + for (; length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: + return true; + // some + + case 5: + return value; + // find + + case 6: + return index; + // findIndex + + case 2: + push.call(target, value); + // filter + } else if (IS_EVERY) return false; // every + } + } + + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; +}; + +var arrayIteration = { + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + forEach: createMethod$1(0), + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + map: createMethod$1(1), + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + filter: createMethod$1(2), + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + some: createMethod$1(3), + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + every: createMethod$1(4), + // `Array.prototype.find` method + // https://tc39.github.io/ecma262/#sec-array.prototype.find + find: createMethod$1(5), + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod$1(6) +}; + +var sloppyArrayMethod = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !method || !fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal + method.call(null, argument || function () { + throw 1; + }, 1); + }); +}; + +var $forEach = arrayIteration.forEach; // `Array.prototype.forEach` method implementation +// https://tc39.github.io/ecma262/#sec-array.prototype.foreach + +var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn +/* , thisArg */ +) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); +} : [].forEach; + +// https://tc39.github.io/ecma262/#sec-array.prototype.foreach + + +_export({ + target: 'Array', + proto: true, + forced: [].forEach != arrayForEach +}, { + forEach: arrayForEach +}); + +var entryVirtual = function (CONSTRUCTOR) { + return path[CONSTRUCTOR + 'Prototype']; +}; + +var forEach$1 = entryVirtual('Array').forEach; + +var forEach$2 = forEach$1; + +var ArrayPrototype = Array.prototype; +var DOMIterables = { + DOMTokenList: true, + NodeList: true +}; + +var forEach_1 = function (it) { + var own = it.forEach; + return it === ArrayPrototype || it instanceof Array && own === ArrayPrototype.forEach // eslint-disable-next-line no-prototype-builtins + || DOMIterables.hasOwnProperty(classof(it)) ? forEach$2 : own; +}; + +var forEach$3 = forEach_1; + +var SPECIES$1 = wellKnownSymbol('species'); + +var arrayMethodHasSpeciesSupport = function (METHOD_NAME) { + return !fails(function () { + var array = []; + var constructor = array.constructor = {}; + + constructor[SPECIES$1] = function () { + return { + foo: 1 + }; + }; + + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; + +var $filter = arrayIteration.filter; // `Array.prototype.filter` method +// https://tc39.github.io/ecma262/#sec-array.prototype.filter +// with adding support of @@species + +_export({ + target: 'Array', + proto: true, + forced: !arrayMethodHasSpeciesSupport('filter') +}, { + filter: function filter(callbackfn + /* , thisArg */ + ) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var filter = entryVirtual('Array').filter; + +var ArrayPrototype$1 = Array.prototype; + +var filter_1 = function (it) { + var own = it.filter; + return it === ArrayPrototype$1 || it instanceof Array && own === ArrayPrototype$1.filter ? filter : own; +}; + +var filter$1 = filter_1; + +var filter$2 = filter$1; + +var userAgent = getBuiltIn('navigator', 'userAgent') || ''; + +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check + +var wrap = function (scheduler) { + return function (handler, timeout + /* , ...arguments */ + ) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : undefined; + return scheduler(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof handler == 'function' ? handler : Function(handler)).apply(this, args); + } : handler, timeout); + }; +}; // ie9- setTimeout & setInterval additional parameters fix +// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers + + +_export({ + global: true, + bind: true, + forced: MSIE +}, { + // `setTimeout` method + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout + setTimeout: wrap(global_1.setTimeout), + // `setInterval` method + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval + setInterval: wrap(global_1.setInterval) +}); + +var setTimeout$1 = path.setTimeout; + +var setTimeout$2 = setTimeout$1; + +var slice$1 = [].slice; +var factories = {}; + +var construct = function (C, argsLength, args) { + if (!(argsLength in factories)) { + for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; // eslint-disable-next-line no-new-func + + + factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); + } + + return factories[argsLength](C, args); +}; // `Function.prototype.bind` method implementation +// https://tc39.github.io/ecma262/#sec-function.prototype.bind + + +var functionBind = Function.bind || function bind(that +/* , ...args */ +) { + var fn = aFunction(this); + var partArgs = slice$1.call(arguments, 1); + + var boundFunction = function bound() + /* args... */ + { + var args = partArgs.concat(slice$1.call(arguments)); + return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); + }; + + if (isObject$1(fn.prototype)) boundFunction.prototype = fn.prototype; + return boundFunction; +}; + +// https://tc39.github.io/ecma262/#sec-function.prototype.bind + +_export({ + target: 'Function', + proto: true +}, { + bind: functionBind +}); + +var bind = entryVirtual('Function').bind; + +var FunctionPrototype = Function.prototype; + +var bind_1 = function (it) { + var own = it.bind; + return it === FunctionPrototype || it instanceof Function && own === FunctionPrototype.bind ? bind : own; +}; + +var bind$1 = bind_1; + +var bind$2 = bind$1; + +// https://tc39.github.io/ecma262/#sec-array.isarray + +_export({ + target: 'Array', + stat: true +}, { + isArray: isArray +}); + +var isArray$1 = path.Array.isArray; + +var isArray$2 = isArray$1; + +var isArray$3 = isArray$2; + +function _classCallCheck$1(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +var classCallCheck$1 = _classCallCheck$1; + +// https://tc39.github.io/ecma262/#sec-object.defineproperty + +_export({ + target: 'Object', + stat: true, + forced: !descriptors, + sham: !descriptors +}, { + defineProperty: objectDefineProperty.f +}); + +var defineProperty_1 = createCommonjsModule$2(function (module) { + var Object = path.Object; + + var defineProperty = module.exports = function defineProperty(it, key, desc) { + return Object.defineProperty(it, key, desc); + }; + + if (Object.defineProperty.sham) defineProperty.sham = true; +}); + +var defineProperty$3 = defineProperty_1; + +var defineProperty$4 = defineProperty$3; + +function _defineProperties$1(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; + + defineProperty$4(target, descriptor.key, descriptor); + } +} + +function _createClass$1(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); + if (staticProps) _defineProperties$1(Constructor, staticProps); + return Constructor; +} + +var createClass$1 = _createClass$1; + +var f$3 = wellKnownSymbol; +var wrappedWellKnownSymbol = { + f: f$3 +}; + +var defineProperty$5 = objectDefineProperty.f; + +var defineWellKnownSymbol = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!has(Symbol, NAME)) defineProperty$5(Symbol, NAME, { + value: wrappedWellKnownSymbol.f(NAME) + }); +}; + +// https://tc39.github.io/ecma262/#sec-symbol.iterator + +defineWellKnownSymbol('iterator'); + +var createMethod$2 = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = String(requireObjectCoercible($this)); + var position = toInteger(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = S.charCodeAt(position); + return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + }; +}; + +var stringMultibyte = { + // `String.prototype.codePointAt` method + // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod$2(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod$2(true) +}; + +var charAt = stringMultibyte.charAt; +var STRING_ITERATOR = 'String Iterator'; +var setInternalState$1 = internalState.set; +var getInternalState$1 = internalState.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator + +defineIterator(String, 'String', function (iterated) { + setInternalState$1(this, { + type: STRING_ITERATOR, + string: String(iterated), + index: 0 + }); // `%StringIteratorPrototype%.next` method + // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next +}, function next() { + var state = getInternalState$1(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return { + value: undefined, + done: true + }; + point = charAt(string, index); + state.index += point.length; + return { + value: point, + done: false + }; +}); + +var iterator = wrappedWellKnownSymbol.f('iterator'); + +var iterator$1 = iterator; + +var iterator$2 = iterator$1; + +var createProperty = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value; +}; + +var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; +var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; +var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; +}); +var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); + +var isConcatSpreadable = function (O) { + if (!isObject$1(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); +}; + +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method +// https://tc39.github.io/ecma262/#sec-array.prototype.concat +// with adding support of @@isConcatSpreadable and @@species + +_export({ + target: 'Array', + proto: true, + forced: FORCED +}, { + concat: function concat(arg) { + // eslint-disable-line no-unused-vars + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + createProperty(A, n++, E); + } + } + + A.length = n; + return A; + } +}); + +var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertynames + +var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return objectKeysInternal(O, hiddenKeys$1); +}; + +var objectGetOwnPropertyNames = { + f: f$4 +}; + +var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f; +var toString$1 = {}.toString; +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return nativeGetOwnPropertyNames(it); + } catch (error) { + return windowNames.slice(); + } +}; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + + +var f$5 = function getOwnPropertyNames(it) { + return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it)); +}; + +var objectGetOwnPropertyNamesExternal = { + f: f$5 +}; + +var f$6 = Object.getOwnPropertySymbols; +var objectGetOwnPropertySymbols = { + f: f$6 +}; + +var $forEach$1 = arrayIteration.forEach; +var HIDDEN = sharedKey('hidden'); +var SYMBOL = 'Symbol'; +var PROTOTYPE$1 = 'prototype'; +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); +var setInternalState$2 = internalState.set; +var getInternalState$2 = internalState.getterFor(SYMBOL); +var ObjectPrototype$1 = Object[PROTOTYPE$1]; +var $Symbol = global_1.Symbol; +var JSON$1 = global_1.JSON; +var nativeJSONStringify = JSON$1 && JSON$1.stringify; +var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; +var nativeDefineProperty$1 = objectDefineProperty.f; +var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f; +var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f; +var AllSymbols = shared('symbols'); +var ObjectPrototypeSymbols = shared('op-symbols'); +var StringToSymbolRegistry = shared('string-to-symbol-registry'); +var SymbolToStringRegistry = shared('symbol-to-string-registry'); +var WellKnownSymbolsStore = shared('wks'); +var QObject = global_1.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + +var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + +var setSymbolDescriptor = descriptors && fails(function () { + return objectCreate(nativeDefineProperty$1({}, 'a', { + get: function () { + return nativeDefineProperty$1(this, 'a', { + value: 7 + }).a; + } + })).a != 7; +}) ? function (O, P, Attributes) { + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$1, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype$1[P]; + nativeDefineProperty$1(O, P, Attributes); + + if (ObjectPrototypeDescriptor && O !== ObjectPrototype$1) { + nativeDefineProperty$1(ObjectPrototype$1, P, ObjectPrototypeDescriptor); + } +} : nativeDefineProperty$1; + +var wrap$1 = function (tag, description) { + var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]); + setInternalState$2(symbol, { + type: SYMBOL, + tag: tag, + description: description + }); + if (!descriptors) symbol.description = description; + return symbol; +}; + +var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return Object(it) instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype$1) $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPrimitive(P, true); + anObject(Attributes); + + if (has(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {})); + O[HIDDEN][key] = true; + } else { + if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = objectCreate(Attributes, { + enumerable: createPropertyDescriptor(0, false) + }); + } + + return setSymbolDescriptor(O, key, Attributes); + } + + return nativeDefineProperty$1(O, key, Attributes); +}; + +var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); + $forEach$1(keys, function (key) { + if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); + }); + return O; +}; + +var $create = function create(O, Properties) { + return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties); +}; + +var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPrimitive(V, true); + var enumerable = nativePropertyIsEnumerable$1.call(this, P); + if (this === ObjectPrototype$1 && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; + return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; +}; + +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { + var it = toIndexedObject(O); + var key = toPrimitive(P, true); + if (it === ObjectPrototype$1 && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; + var descriptor = nativeGetOwnPropertyDescriptor$1(it, key); + + if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { + descriptor.enumerable = true; + } + + return descriptor; +}; + +var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames$1(toIndexedObject(O)); + var result = []; + $forEach$1(names, function (key) { + if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); + }); + return result; +}; + +var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$1; + var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); + var result = []; + $forEach$1(names, function (key) { + if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype$1, key))) { + result.push(AllSymbols[key]); + } + }); + return result; +}; // `Symbol` constructor +// https://tc39.github.io/ecma262/#sec-symbol-constructor + + +if (!nativeSymbol) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); + var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); + var tag = uid(description); + + var setter = function (value) { + if (this === ObjectPrototype$1) setter.call(ObjectPrototypeSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); + }; + + if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype$1, tag, { + configurable: true, + set: setter + }); + return wrap$1(tag, description); + }; + + redefine($Symbol[PROTOTYPE$1], 'toString', function toString() { + return getInternalState$2(this).tag; + }); + objectPropertyIsEnumerable.f = $propertyIsEnumerable; + objectDefineProperty.f = $defineProperty; + objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor; + objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames; + objectGetOwnPropertySymbols.f = $getOwnPropertySymbols; + + if (descriptors) { + // https://github.com/tc39/proposal-Symbol-description + nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', { + configurable: true, + get: function description() { + return getInternalState$2(this).description; + } + }); + } + + wrappedWellKnownSymbol.f = function (name) { + return wrap$1(wellKnownSymbol(name), name); + }; +} + +_export({ + global: true, + wrap: true, + forced: !nativeSymbol, + sham: !nativeSymbol +}, { + Symbol: $Symbol +}); +$forEach$1(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); +}); +_export({ + target: SYMBOL, + stat: true, + forced: !nativeSymbol +}, { + // `Symbol.for` method + // https://tc39.github.io/ecma262/#sec-symbol.for + 'for': function (key) { + var string = String(key); + if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; + var symbol = $Symbol(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; + }, + // `Symbol.keyFor` method + // https://tc39.github.io/ecma262/#sec-symbol.keyfor + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); + if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; + }, + useSetter: function () { + USE_SETTER = true; + }, + useSimple: function () { + USE_SETTER = false; + } +}); +_export({ + target: 'Object', + stat: true, + forced: !nativeSymbol, + sham: !descriptors +}, { + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor +}); +_export({ + target: 'Object', + stat: true, + forced: !nativeSymbol +}, { + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames, + // `Object.getOwnPropertySymbols` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols + getOwnPropertySymbols: $getOwnPropertySymbols +}); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 + +_export({ + target: 'Object', + stat: true, + forced: fails(function () { + objectGetOwnPropertySymbols.f(1); + }) +}, { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return objectGetOwnPropertySymbols.f(toObject(it)); + } +}); // `JSON.stringify` method behavior with symbols +// https://tc39.github.io/ecma262/#sec-json.stringify + +JSON$1 && _export({ + target: 'JSON', + stat: true, + forced: !nativeSymbol || fails(function () { + var symbol = $Symbol(); // MS Edge converts symbol values to JSON as {} + + return nativeJSONStringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null + || nativeJSONStringify({ + a: symbol + }) != '{}' // V8 throws on boxed symbols + || nativeJSONStringify(Object(symbol)) != '{}'; + }) +}, { + stringify: function stringify(it) { + var args = [it]; + var index = 1; + var replacer, $replacer; + + while (arguments.length > index) args.push(arguments[index++]); + + $replacer = replacer = args[1]; + if (!isObject$1(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return nativeJSONStringify.apply(JSON$1, args); + } +}); // `Symbol.prototype[@@toPrimitive]` method +// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive + +if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf); // `Symbol.prototype[@@toStringTag]` property +// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag + +setToStringTag($Symbol, SYMBOL); +hiddenKeys[HIDDEN] = true; + +// https://tc39.github.io/ecma262/#sec-symbol.asynciterator + +defineWellKnownSymbol('asyncIterator'); + +// https://tc39.github.io/ecma262/#sec-symbol.hasinstance + +defineWellKnownSymbol('hasInstance'); + +// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable + +defineWellKnownSymbol('isConcatSpreadable'); + +// https://tc39.github.io/ecma262/#sec-symbol.match + +defineWellKnownSymbol('match'); + +defineWellKnownSymbol('matchAll'); + +// https://tc39.github.io/ecma262/#sec-symbol.replace + +defineWellKnownSymbol('replace'); + +// https://tc39.github.io/ecma262/#sec-symbol.search + +defineWellKnownSymbol('search'); + +// https://tc39.github.io/ecma262/#sec-symbol.species + +defineWellKnownSymbol('species'); + +// https://tc39.github.io/ecma262/#sec-symbol.split + +defineWellKnownSymbol('split'); + +// https://tc39.github.io/ecma262/#sec-symbol.toprimitive + +defineWellKnownSymbol('toPrimitive'); + +// https://tc39.github.io/ecma262/#sec-symbol.tostringtag + +defineWellKnownSymbol('toStringTag'); + +// https://tc39.github.io/ecma262/#sec-symbol.unscopables + +defineWellKnownSymbol('unscopables'); + +// https://tc39.github.io/ecma262/#sec-math-@@tostringtag + +setToStringTag(Math, 'Math', true); + +// https://tc39.github.io/ecma262/#sec-json-@@tostringtag + +setToStringTag(global_1.JSON, 'JSON', true); + +var symbol = path.Symbol; + +// https://github.com/tc39/proposal-using-statement + +defineWellKnownSymbol('asyncDispose'); + +// https://github.com/tc39/proposal-using-statement + +defineWellKnownSymbol('dispose'); + +// https://github.com/tc39/proposal-observable + +defineWellKnownSymbol('observable'); + +// https://github.com/tc39/proposal-pattern-matching + +defineWellKnownSymbol('patternMatch'); + +// https://tc39.github.io/proposal-string-replaceall/ + +defineWellKnownSymbol('replaceAll'); + +var symbol$1 = symbol; + +var symbol$2 = symbol$1; + +var _typeof_1$2 = createCommonjsModule$2(function (module) { + function _typeof(obj) { + if (typeof symbol$2 === "function" && typeof iterator$2 === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof symbol$2 === "function" && obj.constructor === symbol$2 && obj !== symbol$2.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + + module.exports = _typeof; +}); + +function _assertThisInitialized$1(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +var assertThisInitialized$1 = _assertThisInitialized$1; + +function _possibleConstructorReturn$1(self, call) { + if (call && (_typeof_1$2(call) === "object" || typeof call === "function")) { + return call; + } + + return assertThisInitialized$1(self); +} + +var possibleConstructorReturn$1 = _possibleConstructorReturn$1; + +var FAILS_ON_PRIMITIVES = fails(function () { + objectGetPrototypeOf(1); +}); // `Object.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.getprototypeof + +_export({ + target: 'Object', + stat: true, + forced: FAILS_ON_PRIMITIVES, + sham: !correctPrototypeGetter +}, { + getPrototypeOf: function getPrototypeOf(it) { + return objectGetPrototypeOf(toObject(it)); + } +}); + +var getPrototypeOf$1 = path.Object.getPrototypeOf; + +var getPrototypeOf$2 = getPrototypeOf$1; + +var getPrototypeOf$3 = getPrototypeOf$2; + +// https://tc39.github.io/ecma262/#sec-object.setprototypeof + +_export({ + target: 'Object', + stat: true +}, { + setPrototypeOf: objectSetPrototypeOf +}); + +var setPrototypeOf$1 = path.Object.setPrototypeOf; + +var setPrototypeOf$2 = setPrototypeOf$1; + +var setPrototypeOf$3 = setPrototypeOf$2; + +var getPrototypeOf$4 = createCommonjsModule$2(function (module) { + function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = setPrototypeOf$3 ? getPrototypeOf$3 : function _getPrototypeOf(o) { + return o.__proto__ || getPrototypeOf$3(o); + }; + return _getPrototypeOf(o); + } + + module.exports = _getPrototypeOf; +}); + +// https://tc39.github.io/ecma262/#sec-object.create + +_export({ + target: 'Object', + stat: true, + sham: !descriptors +}, { + create: objectCreate +}); + +var Object$1 = path.Object; + +var create = function create(P, D) { + return Object$1.create(P, D); +}; + +var create$1 = create; + +var create$2 = create$1; + +var setPrototypeOf$4 = createCommonjsModule$2(function (module) { + function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = setPrototypeOf$3 || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + module.exports = _setPrototypeOf; +}); + +function _inherits$1(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = create$2(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) setPrototypeOf$4(subClass, superClass); +} + +var inherits$1 = _inherits$1; + +var moment$2 = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + module.exports = factory() ; + })(commonjsGlobal$2, function () { + + var hookCallback; + + function 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 isObject(input) { + // IE8 will treat undefined and null as object if it wasn't for + // input != null + return input != null && Object.prototype.toString.call(input) === '[object Object]'; + } + + function isObjectEmpty(obj) { + if (Object.getOwnPropertyNames) { + return Object.getOwnPropertyNames(obj).length === 0; + } else { + var k; + + for (k in obj) { + if (obj.hasOwnProperty(k)) { + return false; + } + } + + return true; + } + } + + function isUndefined(input) { + return input === void 0; + } + + function isNumber(input) { + return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; + } + + 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 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, + rfc2822: false, + weekdayMismatch: false + }; + } + + 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 isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + var parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }); + var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); + + if (m._strict) { + isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; + } + + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } else { + return isNowValid; + } + } + + return m._isValid; + } + + function createInvalid(flags) { + var m = createUTC(NaN); + + if (flags != null) { + extend(getParsingFlags(m), flags); + } else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + + + var momentProperties = 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 = 0; i < momentProperties.length; i++) { + 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); + + if (!this.isValid()) { + this._d = new Date(NaN); + } // Prevent infinite loop in case updateOffset creates new moment + // objects. + + + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment(obj) { + return obj instanceof Moment || obj != null && obj._isAMomentObject != null; + } + + function absFloor(number) { + if (number < 0) { + // -0 -> 0 + return Math.ceil(number) || 0; + } 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 (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + return extend(function () { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + + if (firstTime) { + var args = []; + var arg; + + for (var i = 0; i < arguments.length; i++) { + arg = ''; + + if (typeof arguments[i] === 'object') { + arg += '\n[' + i + '] '; + + for (var key in arguments[0]) { + arg += key + ': ' + arguments[0][key] + ', '; + } + + arg = arg.slice(0, -2); // Remove trailing comma and space + } else { + arg = arguments[i]; + } + + args.push(arg); + } + + warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack); + firstTime = false; + } + + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function 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 _dayOfMonthOrdinalParse. + // TODO: Remove "ordinalParse" fallback in next major release. + + this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || 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]; + } + } + } + + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) { + // make sure changes to properties don't modify parent config + res[prop] = extend({}, 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; + }; + } + + 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 calendar(key, mom, now) { + var output = this._calendar[key] || this._calendar['sameElse']; + 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 defaultDayOfMonthOrdinalParse = /\d{1,2}/; + + function ordinal(number) { + return this._ordinal.replace('%d', number); + } + + var defaultRelativeTime = { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + ss: '%d seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }; + + function 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 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; + } + + var priorities = {}; + + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + + function getPrioritizedUnits(unitsObj) { + var units = []; + + for (var u in unitsObj) { + units.push({ + unit: u, + priority: priorities[u] + }); + } + + units.sort(function (a, b) { + return a.priority - b.priority; + }); + return units; + } + + 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 += isFunction(array[i]) ? 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]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; + 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 (isNumber(callback)) { + 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; // 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'); // PRIORITIES + + addUnitPriority('year', 1); // 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 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = 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 + + + hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; // MOMENTS + + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear() { + return isLeapYear(this.year()); + } + + function makeGetSet(unit, keepTime) { + return function (value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get(this, unit); + } + }; + } + + function get(mom, unit) { + return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function set$1(mom, unit, value) { + if (mom.isValid() && !isNaN(value)) { + if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); + } else { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + } + } // MOMENTS + + + function stringGet(units) { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](); + } + + return this; + } + + function stringSet(units, value) { + if (typeof units === 'object') { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units); + + for (var i = 0; i < prioritized.length; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); + } + } else { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](value); + } + } + + return this; + } + + function mod(n, x) { + return (n % x + x) % x; + } + + 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) { + if (isNaN(year) || isNaN(month)) { + return NaN; + } + + var modMonth = mod(month, 12); + year += (month - modMonth) / 12; + return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; + } // 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'); // PRIORITY + + addUnitPriority('month', 8); // 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) { + if (!m) { + return isArray(this._months) ? this._months : this._months['standalone']; + } + + return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || 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) { + if (!m) { + return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; + } + + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + function 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 = 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 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 = 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 (!isNumber(value)) { + 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); + hooks.updateOffset(this, true); + return this; + } else { + return 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 { + if (!hasOwnProp(this, '_monthsShortRegex')) { + this._monthsShortRegex = defaultMonthsShortRegex; + } + + 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 { + if (!hasOwnProp(this, '_monthsRegex')) { + this._monthsRegex = defaultMonthsRegex; + } + + 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 = 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]); + } + + for (i = 0; i < 24; 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 createDate(y, m, d, h, M, s, ms) { + // can't just apply() to create a date: + // https://stackoverflow.com/q/181348 + var date; // the date constructor remaps years 0-99 to 1900-1999 + + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + date = new Date(y + 400, m, d, h, M, s, ms); + + if (isFinite(date.getFullYear())) { + date.setFullYear(y); + } + } else { + date = new Date(y, m, d, h, M, s, ms); + } + + return date; + } + + function createUTCDate(y) { + var date; // the Date.UTC function remaps years 0-99 to 1900-1999 + + if (y < 100 && y >= 0) { + var args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset + + args[0] = y + 400; + date = new Date(Date.UTC.apply(null, args)); + + if (isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + } else { + date = new Date(Date.UTC.apply(null, arguments)); + } + + return date; + } // 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; + } // https://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; + } // FORMATTING + + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); // PRIORITIES + + addUnitPriority('week', 5); + addUnitPriority('isoWeek', 5); // 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 6th 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', 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'); // PRIORITY + + addUnitPriority('day', 11); + addUnitPriority('weekday', 11); + addUnitPriority('isoWeekday', 11); // 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; + } + + function parseIsoWeekday(input, locale) { + if (typeof input === 'string') { + return locale.weekdaysParse(input) % 7 || 7; + } + + return isNaN(input) ? null : input; + } // LOCALES + + + function shiftWeekdays(ws, n) { + return ws.slice(n, 7).concat(ws.slice(0, n)); + } + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + + function localeWeekdays(m, format) { + var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone']; + return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + + function localeWeekdaysShort(m) { + return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + + function localeWeekdaysMin(m) { + return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + + function handleStrictParse$1(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 = 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 handleStrictParse$1.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 = 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. + + + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 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 { + if (!hasOwnProp(this, '_weekdaysRegex')) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + + 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 { + if (!hasOwnProp(this, '_weekdaysShortRegex')) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + + 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 { + if (!hasOwnProp(this, '_weekdaysMinRegex')) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + + 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 = 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 + + + 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'); // PRIORITY + + addUnitPriority('hour', 13); // PARSING + + function matchMeridiem(isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('k', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + addRegexToken('kk', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); + addParseToken(['k', 'kk'], function (input, array, config) { + var kInput = toInt(input); + array[HOUR] = kInput === 24 ? 0 : kInput; + }); + 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 they want. 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); + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, + relativeTime: defaultRelativeTime, + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, + week: defaultLocaleWeek, + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, + meridiemParse: defaultLocaleMeridiemParse + }; // internal storage for locale config files + + var locales = {}; + var localeFamilies = {}; + 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 globalLocale; + } + + function loadLocale(name) { + var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node + + if (!locales[name] && 'object' !== 'undefined' && module && module.exports) { + try { + oldLocale = globalLocale._abbr; + var aliasedRequire = commonjsRequire$2; + aliasedRequire('./locale/' + name); + 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 getSetGlobalLocale(key, values) { + var data; + + if (key) { + if (isUndefined(values)) { + data = getLocale(key); + } else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } else { + if (typeof console !== 'undefined' && console.warn) { + //warn user if arguments are passed but the locale could not be set + console.warn('Locale ' + key + ' not found. Did you forget to load it?'); + } + } + } + + return globalLocale._abbr; + } + + function defineLocale(name, config) { + if (config !== null) { + var locale, + parentConfig = baseConfig; + 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 ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + locale = loadLocale(config.parentLocale); + + if (locale != null) { + parentConfig = locale._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + + localeFamilies[config.parentLocale].push({ + name: name, + config: config + }); + return null; + } + } + } + + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + + if (localeFamilies[name]) { + localeFamilies[name].forEach(function (x) { + defineLocale(x.name, x.config); + }); + } // backwards compat for now: also set the locale + // make sure we set the locale AFTER all child locales have been + // created, so we won't end up with the child locale set. + + + getSetGlobalLocale(name); + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + function updateLocale(name, config) { + if (config != null) { + var locale, + tmpLocale, + parentConfig = baseConfig; // MERGE + + tmpLocale = loadLocale(name); + + if (tmpLocale != null) { + parentConfig = tmpLocale._config; + } + + config = mergeConfigs(parentConfig, config); + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; // backwards compat for now: also set the locale + + 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 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 listLocales() { + return keys(locales); + } + + 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; + } // 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(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, + expectedWeekday, + 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 != null) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { + 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); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // 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; + } // check for mismatching day of week + + + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { + getParsingFlags(config).weekdayMismatch = true; + } + } + + 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(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; + var curWeek = weekOfYear(createLocal(), dow, doy); + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. + + week = defaults(w.w, curWeek.week); + + 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 beginning of week + weekday = w.e + dow; + + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + // default to beginning 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; + } + } // 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; + } + } // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 + + + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; + + function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)]; + + if (secondStr) { + result.push(parseInt(secondStr, 10)); + } + + return result; + } + + function untruncateYear(yearStr) { + var year = parseInt(yearStr, 10); + + if (year <= 49) { + return 2000 + year; + } else if (year <= 999) { + return 1900 + year; + } + + return year; + } + + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + + function checkWeekday(weekdayStr, parsedInput, config) { + if (weekdayStr) { + // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. + var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), + weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); + + if (weekdayProvided !== weekdayActual) { + getParsingFlags(config).weekdayMismatch = true; + config._isValid = false; + return false; + } + } + + return true; + } + + var obsOffsets = { + UT: 0, + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + + function calculateOffset(obsOffset, militaryOffset, numOffset) { + if (obsOffset) { + return obsOffsets[obsOffset]; + } else if (militaryOffset) { + // the only allowed military tz is Z + return 0; + } else { + var hm = parseInt(numOffset, 10); + var m = hm % 100, + h = (hm - m) / 100; + return h * 60 + m; + } + } // date and time from ref 2822 format + + + function configFromRFC2822(config) { + var match = rfc2822.exec(preprocessRFC2822(config._i)); + + if (match) { + var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); + + if (!checkWeekday(match[1], parsedArray, config)) { + return; + } + + config._a = parsedArray; + config._tzm = calculateOffset(match[8], match[9], match[10]); + config._d = createUTCDate.apply(null, config._a); + + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + + getParsingFlags(config).rfc2822 = true; + } 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; + } else { + return; + } + + configFromRFC2822(config); + + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } // Final attempt, use Input Fallback + + + hooks.createFromInputFallback(config); + } + + hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + }); // constant that refers to the ISO standard + + hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form + + + hooks.RFC_2822 = 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 === hooks.ISO_8601) { + configFromISO(config); + return; + } + + if (config._f === hooks.RFC_2822) { + configFromRFC2822(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 (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && 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 (!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 || getLocale(config._l); + + if (input === null || format === undefined && input === '') { + return createInvalid({ + nullInput: true + }); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + + if (!isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + + if (isUndefined(input)) { + config._d = new Date(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 (isObject(input)) { + configFromObject(config); + } else if (isNumber(input)) { + // from milliseconds + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC(input, format, locale, strict, isUTC) { + var c = {}; + + if (locale === true || locale === false) { + strict = locale; + locale = undefined; + } + + if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) { + input = 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 createLocal(input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } + }); + var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return 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 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(); + }; + + var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; + + function isDurationValid(m) { + for (var key in m) { + if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { + return false; + } + } + + var unitHasDecimal = false; + + for (var i = 0; i < ordering.length; ++i) { + if (m[ordering[i]]) { + if (unitHasDecimal) { + return false; // only allow non-integers for smallest unit + } + + if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { + unitHasDecimal = true; + } + } + } + + return true; + } + + function isValid$1() { + return this._isValid; + } + + function createInvalid$1() { + return createDuration(NaN); + } + + function Duration(duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || normalizedInput.isoWeek || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + this._isValid = isDurationValid(normalizedInput); // 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 to 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 = getLocale(); + + this._bubble(); + } + + function isDuration(obj) { + return obj instanceof Duration; + } + + function absRound(number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } // 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); + + if (matches === null) { + return null; + } + + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + return minutes === 0 ? 0 : 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() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. + + res._d.setTime(res._d.valueOf() + diff); + + hooks.updateOffset(res, false); + return res; + } else { + return 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. + + + 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, keepMinutes) { + 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); + + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16 && !keepMinutes) { + 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) { + addSubtract(this, createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + 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 != null) { + this.utcOffset(this._tzm, false, true); + } else if (typeof this._i === 'string') { + var tZone = offsetFromString(matchOffset, this._i); + + if (tZone != null) { + this.utcOffset(tZone); + } else { + this.utcOffset(0, true); + } + } + + return this; + } + + function hasAlignedHourOffset(input) { + if (!this.isValid()) { + return false; + } + + input = input ? 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 ? createUTC(c._a) : 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*)?)?$/; // 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 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 (isNumber(input)) { + 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(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match + + }; + } 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(createLocal(duration.from), 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; + } + + createDuration.fn = Duration.prototype; + createDuration.invalid = createInvalid$1; + + 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 = {}; + 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; + } // 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). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); + tmp = val; + val = period; + period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } + + function 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 (months) { + setMonth(mom, get(mom, 'Month') + months * isAdding); + } + + if (days) { + set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); + } + + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + + if (updateOffset) { + hooks.updateOffset(mom, days || months); + } + } + + var add = createAdder(1, 'add'); + var subtract = createAdder(-1, 'subtract'); + + function getCalendarFormat(myMoment, now) { + var diff = myMoment.diff(now, 'days', true); + return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; + } + + function calendar$1(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 || createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + format = hooks.calendarFormat(this, sod) || 'sameElse'; + var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); + } + + function clone() { + return new Moment(this); + } + + function isAfter(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(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 : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(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) { + var localFrom = isMoment(from) ? from : createLocal(from), + localTo = isMoment(to) ? to : createLocal(to); + + if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { + return false; + } + + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); + } + + function isSame(input, units) { + var localInput = isMoment(input) ? input : 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, output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); + + switch (units) { + case 'year': + output = monthDiff(this, that) / 12; + break; + + case 'month': + output = monthDiff(this, that); + break; + + case 'quarter': + output = monthDiff(this, that) / 3; + break; + + case 'second': + output = (this - that) / 1e3; + break; + // 1000 + + case 'minute': + output = (this - that) / 6e4; + break; + // 1000 * 60 + + case 'hour': + output = (this - that) / 36e5; + break; + // 1000 * 60 * 60 + + case 'day': + output = (this - that - zoneDelta) / 864e5; + break; + // 1000 * 60 * 60 * 24, negate dst + + case 'week': + output = (this - that - zoneDelta) / 6048e5; + break; + // 1000 * 60 * 60 * 24 * 7, negate dst + + default: + output = this - that; + } + + 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; + } + + hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + 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 toISOString(keepOffset) { + if (!this.isValid()) { + return null; + } + + var utc = keepOffset !== true; + var m = utc ? this.clone().utc() : this; + + if (m.year() < 0 || m.year() > 9999) { + return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + + if (isFunction(Date.prototype.toISOString)) { + // native implementation is ~50x faster, use it when we can + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); + } + } + + return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + /** + * Return a human readable representation of a moment that can + * also be evaluated to get a new moment which is the same + * + * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects + */ + + + function inspect() { + if (!this.isValid()) { + return 'moment.invalid(/* ' + this._i + ' */)'; + } + + var func = 'moment'; + var zone = ''; + + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; + zone = 'Z'; + } + + var prefix = '[' + func + '("]'; + var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; + var datetime = '-MM-DD[T]HH:mm:ss.SSS'; + var suffix = zone + '[")]'; + return this.format(prefix + year + datetime + suffix); + } + + function format(inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; + } + + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + + function from(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + to: this, + from: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow(withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } + + function to(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + from: this, + to: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow(withoutSuffix) { + return this.to(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 = 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; + } + + var MS_PER_SECOND = 1000; + var MS_PER_MINUTE = 60 * MS_PER_SECOND; + var MS_PER_HOUR = 60 * MS_PER_MINUTE; + var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): + + function mod$1(dividend, divisor) { + return (dividend % divisor + divisor) % divisor; + } + + function localStartOfDate(y, m, d) { + // the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + return new Date(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return new Date(y, m, d).valueOf(); + } + } + + function utcStartOfDate(y, m, d) { + // Date.UTC remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0) { + // preserve leap years using a full 400 year cycle, then reset + return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return Date.UTC(y, m, d); + } + } + + function startOf(units) { + var time; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year(), 0, 1); + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3, 1); + break; + + case 'month': + time = startOfDate(this.year(), this.month(), 1); + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date()); + break; + + case 'hour': + time = this._d.valueOf(); + time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); + break; + + case 'minute': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_MINUTE); + break; + + case 'second': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_SECOND); + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function endOf(units) { + var time; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year() + 1, 0, 1) - 1; + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; + break; + + case 'month': + time = startOfDate(this.year(), this.month() + 1, 1) - 1; + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; + break; + + case 'hour': + time = this._d.valueOf(); + time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; + break; + + case 'minute': + time = this._d.valueOf(); + time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; + break; + + case 'second': + time = this._d.valueOf(); + time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function valueOf() { + return this._d.valueOf() - (this._offset || 0) * 60000; + } + + function unix() { + return Math.floor(this.valueOf() / 1000); + } + + function toDate() { + return new Date(this.valueOf()); + } + + 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 isValid$2() { + return 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'); // PRIORITY + + addUnitPriority('weekYear', 1); + addUnitPriority('isoWeekYear', 1); // 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] = 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'); // PRIORITY + + addUnitPriority('quarter', 7); // 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('D', ['DD', 2], 'Do', 'date'); // ALIASES + + addUnitAlias('date', 'D'); // PRIORITY + + addUnitPriority('date', 9); // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + // TODO: Remove "ordinalParse" fallback in next major release. + return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; + }); + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0]); + }); // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); // PRIORITY + + addUnitPriority('dayOfYear', 4); // 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 + + + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES + + addUnitAlias('minute', 'm'); // PRIORITY + + addUnitPriority('minute', 14); // 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'); // PRIORITY + + addUnitPriority('second', 15); // 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'); // PRIORITY + + addUnitPriority('millisecond', 16); // 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 proto = Moment.prototype; + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$2; + proto.lang = lang; + proto.locale = locale; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + proto.quarter = proto.quarters = getSetQuarter; + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.isoWeeksInYear = getISOWeeksInYear; + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + proto.hour = proto.hours = getSetHour; + proto.minute = proto.minutes = getSetMinute; + proto.second = proto.seconds = getSetSecond; + proto.millisecond = proto.milliseconds = getSetMillisecond; + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); + proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); + + function createUnix(input) { + return createLocal(input * 1000); + } + + function createInZone() { + return createLocal.apply(null, arguments).parseZone(); + } + + function preParsePostFormat(string) { + return string; + } + + var proto$1 = Locale.prototype; + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set; + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + + function get$1(format, index, field, setter) { + var locale = getLocale(); + var utc = createUTC().set(setter, index); + return locale[field](utc, format); + } + + function listMonthsImpl(format, index, field) { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return get$1(format, index, field, 'month'); + } + + var i; + var out = []; + + for (i = 0; i < 12; i++) { + out[i] = get$1(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 (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = getLocale(), + shift = localeSorted ? locale._week.dow : 0; + + if (index != null) { + return get$1(format, (index + shift) % 7, field, 'day'); + } + + var i; + var out = []; + + for (i = 0; i < 7; i++) { + out[i] = get$1(format, (i + shift) % 7, field, 'day'); + } + + return out; + } + + function listMonths(format, index) { + return listMonthsImpl(format, index, 'months'); + } + + function listMonthsShort(format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } + + function listWeekdays(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } + + function listWeekdaysShort(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } + + function listWeekdaysMin(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } + + getSetGlobalLocale('en', { + dayOfMonthOrdinalParse: /\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 + + hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); + hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); + var mathAbs = Math.abs; + + function 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 addSubtract$1(duration, input, value, direction) { + var other = 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 add$1(input, value) { + return addSubtract$1(this, input, value, 1); + } // supports only 2.0-style subtract(1, 's') or subtract(duration) + + + function subtract$1(input, value) { + return addSubtract$1(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) { + if (!this.isValid()) { + return NaN; + } + + var days; + var months; + var milliseconds = this._milliseconds; + units = normalizeUnits(units); + + if (units === 'month' || units === 'quarter' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + + switch (units) { + case 'month': + return months; + + case 'quarter': + return months / 3; + + case 'year': + return 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 valueOf$1() { + if (!this.isValid()) { + return NaN; + } + + 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 asQuarters = makeAs('Q'); + var asYears = makeAs('y'); + + function clone$1() { + return createDuration(this); + } + + function get$2(units) { + units = normalizeUnits(units); + return this.isValid() ? this[units + 's']() : NaN; + } + + function makeGetter(name) { + return function () { + return this.isValid() ? this._data[name] : NaN; + }; + } + + 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 = { + ss: 44, + // a few seconds to seconds + 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 relativeTime$1(posNegDuration, withoutSuffix, locale) { + var duration = 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.ss && ['s', seconds] || seconds < thresholds.s && ['ss', 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 the rounding function for relative time strings + + + function getSetRelativeTimeRounding(roundingFunction) { + if (roundingFunction === undefined) { + return round; + } + + if (typeof roundingFunction === 'function') { + round = roundingFunction; + return true; + } + + return false; + } // This function allows you to set a threshold for relative time strings + + + function getSetRelativeTimeThreshold(threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + + if (limit === undefined) { + return thresholds[threshold]; + } + + thresholds[threshold] = limit; + + if (threshold === 's') { + thresholds.ss = limit - 1; + } + + return true; + } + + function humanize(withSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var locale = this.localeData(); + var output = relativeTime$1(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var abs$1 = Math.abs; + + function sign(x) { + return (x > 0) - (x < 0) || +x; + } + + function toISOString$1() { + // 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) + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var seconds = abs$1(this._milliseconds) / 1000; + var days = abs$1(this._days); + var months = abs$1(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 ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; + 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'; + } + + var totalSign = total < 0 ? '-' : ''; + var ymSign = sign(this._months) !== sign(total) ? '-' : ''; + var daysSign = sign(this._days) !== sign(total) ? '-' : ''; + var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; + return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : ''); + } + + var proto$2 = Duration.prototype; + proto$2.isValid = isValid$1; + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asQuarters = asQuarters; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.clone = clone$1; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale; + proto$2.localeData = localeData; + proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); + proto$2.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 + + hooks.version = '2.24.0'; + setHookCallback(createLocal); + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats + + hooks.HTML5_FMT = { + DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', + // + DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', + // + DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', + // + DATE: 'YYYY-MM-DD', + // + TIME: 'HH:mm', + // + TIME_SECONDS: 'HH:mm:ss', + // + TIME_MS: 'HH:mm:ss.SSS', + // + WEEK: 'GGGG-[W]WW', + // + MONTH: 'YYYY-MM' // + + }; + return hooks; + }); +}); + +// use this instance. Else, load via commonjs. + +var moment$3 = typeof window !== 'undefined' && window['moment'] || moment$2; + +var defineProperty$6 = defineProperty_1; + +var defineProperty$7 = defineProperty$6; + +// https://tc39.github.io/ecma262/#sec-object.defineproperties + +_export({ + target: 'Object', + stat: true, + forced: !descriptors, + sham: !descriptors +}, { + defineProperties: objectDefineProperties +}); + +var defineProperties_1 = createCommonjsModule$2(function (module) { + var Object = path.Object; + + var defineProperties = module.exports = function defineProperties(T, D) { + return Object.defineProperties(T, D); + }; + + if (Object.defineProperties.sham) defineProperties.sham = true; +}); + +var defineProperties = defineProperties_1; + +var defineProperties$1 = defineProperties; + +var ownKeys$2 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = objectGetOwnPropertyNames.f(anObject(it)); + var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; +}; + +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + +_export({ + target: 'Object', + stat: true, + sham: !descriptors +}, { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIndexedObject(object); + var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; + var keys = ownKeys$2(O); + var result = {}; + var index = 0; + var key, descriptor; + + while (keys.length > index) { + descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); + if (descriptor !== undefined) createProperty(result, key, descriptor); + } + + return result; + } +}); + +var getOwnPropertyDescriptors = path.Object.getOwnPropertyDescriptors; + +var getOwnPropertyDescriptors$1 = getOwnPropertyDescriptors; + +var getOwnPropertyDescriptors$2 = getOwnPropertyDescriptors$1; + +var nativeGetOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; +var FAILS_ON_PRIMITIVES$1 = fails(function () { + nativeGetOwnPropertyDescriptor$2(1); +}); +var FORCED$1 = !descriptors || FAILS_ON_PRIMITIVES$1; // `Object.getOwnPropertyDescriptor` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + +_export({ + target: 'Object', + stat: true, + forced: FORCED$1, + sham: !descriptors +}, { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { + return nativeGetOwnPropertyDescriptor$2(toIndexedObject(it), key); + } +}); + +var getOwnPropertyDescriptor_1 = createCommonjsModule$2(function (module) { + var Object = path.Object; + + var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) { + return Object.getOwnPropertyDescriptor(it, key); + }; + + if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true; +}); + +var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor_1; + +var getOwnPropertyDescriptor$3 = getOwnPropertyDescriptor$2; + +var getOwnPropertySymbols = path.Object.getOwnPropertySymbols; + +var getOwnPropertySymbols$1 = getOwnPropertySymbols; + +var getOwnPropertySymbols$2 = getOwnPropertySymbols$1; + +var FAILS_ON_PRIMITIVES$2 = fails(function () { + objectKeys(1); +}); // `Object.keys` method +// https://tc39.github.io/ecma262/#sec-object.keys + +_export({ + target: 'Object', + stat: true, + forced: FAILS_ON_PRIMITIVES$2 +}, { + keys: function keys(it) { + return objectKeys(toObject(it)); + } +}); + +var keys$1 = path.Object.keys; + +var keys$2 = keys$1; + +var keys$3 = keys$2; + +function _defineProperty$2(obj, key, value) { + if (key in obj) { + defineProperty$4(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +var defineProperty$8 = _defineProperty$2; + +function ownKeys$3(object, enumerableOnly) { var keys = keys$3(object); if (getOwnPropertySymbols$2) { var symbols = getOwnPropertySymbols$2(object); if (enumerableOnly) symbols = filter$2(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor$3(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; forEach$3(_context = ownKeys$3(source, true)).call(_context, function (key) { defineProperty$8(target, key, source[key]); }); } else if (getOwnPropertyDescriptors$2) { defineProperties$1(target, getOwnPropertyDescriptors$2(source)); } else { var _context2; forEach$3(_context2 = ownKeys$3(source)).call(_context2, function (key) { defineProperty$7(target, key, getOwnPropertyDescriptor$3(source, key)); }); } } return target; } +// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/' +// code from http://momentjs.com/ + +var ASPDateRegex$2 = /^\/?Date\((-?\d+)/i; +/** + * Convert an object into another type + * + * @param object - Value of unknown type. + * @param type - Name of the desired type. + * + * @returns Object in the desired type. + * @throws Error + */ + +function convert$2(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": + if (isString(object) && !isNaN(Date.parse(object))) { + return moment$2(object).valueOf(); + } else { + // @TODO: I don't think that Number and String constructors are a good idea. + // This could also fail if the object doesn't have valueOf method or if it's redefined. + // For example: Object.create(null) or { valueOf: 7 }. + return Number(object.valueOf()); + } + + case "string": + case "String": + return String(object); + + case "Date": + if (isNumber(object)) { + return new Date(object); + } + + if (object instanceof Date) { + return new Date(object.valueOf()); + } else if (moment$2.isMoment(object)) { + return new Date(object.valueOf()); + } + + if (isString(object)) { + match = ASPDateRegex$2.exec(object); + + if (match) { + // object is an ASP date + return new Date(Number(match[1])); // parse number + } else { + return moment$2(new Date(object)).toDate(); // parse string + } + } else { + throw new Error("Cannot convert object of type " + getType(object) + " to type Date"); + } + + case "Moment": + if (isNumber(object)) { + return moment$2(object); + } + + if (object instanceof Date) { + return moment$2(object.valueOf()); + } else if (moment$2.isMoment(object)) { + return moment$2(object); + } + + if (isString(object)) { + match = ASPDateRegex$2.exec(object); + + if (match) { + // object is an ASP date + return moment$2(Number(match[1])); // parse number + } else { + return moment$2(object); // parse string + } + } else { + throw new Error("Cannot convert object of type " + getType(object) + " to type Date"); + } + + case "ISODate": + if (isNumber(object)) { + return new Date(object); + } else if (object instanceof Date) { + return object.toISOString(); + } else if (moment$2.isMoment(object)) { + return object.toDate().toISOString(); + } else if (isString(object)) { + match = ASPDateRegex$2.exec(object); + + if (match) { + // object is an ASP date + return new Date(Number(match[1])).toISOString(); // parse number + } else { + return moment$2(object).format(); // ISO 8601 + } + } else { + throw new Error("Cannot convert object of type " + getType(object) + " to type ISODate"); + } + + case "ASPDate": + if (isNumber(object)) { + return "/Date(" + object + ")/"; + } else if (object instanceof Date || moment$2.isMoment(object)) { + return "/Date(" + object.valueOf() + ")/"; + } else if (isString(object)) { + match = ASPDateRegex$2.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 " + getType(object) + " to type ASPDate"); + } + + default: + throw new Error("Unknown type ".concat(type)); + } +} +var util$2 = _objectSpread$2({}, util$1, { + convert: convert$2 +}); + +// a string of all valid unicode whitespaces +// eslint-disable-next-line max-len +var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + +var whitespace = '[' + whitespaces + ']'; +var ltrim = RegExp('^' + whitespace + whitespace + '*'); +var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation + +var createMethod$3 = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; +}; + +var stringTrim = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart + start: createMethod$3(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimend + end: createMethod$3(2), + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + trim: createMethod$3(3) +}; + +var trim = stringTrim.trim; +var nativeParseFloat = global_1.parseFloat; +var FORCED$2 = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity; // `parseFloat` method +// https://tc39.github.io/ecma262/#sec-parsefloat-string + +var _parseFloat = FORCED$2 ? function parseFloat(string) { + var trimmedString = trim(String(string)); + var result = nativeParseFloat(trimmedString); + return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result; +} : nativeParseFloat; + +// https://tc39.github.io/ecma262/#sec-parsefloat-string + +_export({ + global: true, + forced: parseFloat != _parseFloat +}, { + parseFloat: _parseFloat +}); + +var _parseFloat$1 = path.parseFloat; + +var _parseFloat$2 = _parseFloat$1; + +var _parseFloat$3 = _parseFloat$2; + +// https://tc39.github.io/ecma262/#sec-date.now + +_export({ + target: 'Date', + stat: true +}, { + now: function now() { + return new Date().getTime(); + } +}); + +var now = path.Date.now; + +var now$1 = now; + +var now$2 = now$1; + +var $JSON = path.JSON || (path.JSON = { + stringify: JSON.stringify +}); + +var stringify = function stringify(it) { + // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); +}; + +var stringify$1 = stringify; + +var stringify$2 = stringify$1; + +var concat = entryVirtual('Array').concat; + +var ArrayPrototype$2 = Array.prototype; + +var concat_1 = function (it) { + var own = it.concat; + return it === ArrayPrototype$2 || it instanceof Array && own === ArrayPrototype$2.concat ? concat : own; +}; + +var concat$1 = concat_1; + +var concat$2 = concat$1; + +/** Prototype for visual components */ + +var Component = +/*#__PURE__*/ +function () { + /** + * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} [body] + * @param {Object} [options] + */ + function Component(body, options) { + classCallCheck$1(this, Component); + + // eslint-disable-line no-unused-vars + this.options = null; + this.props = null; + } + /** + * Set options for the component. The new options will be merged into the + * current options. + * @param {Object} options + */ + + + createClass$1(Component, [{ + key: "setOptions", + value: function setOptions(options) { + if (options) { + util$2.extend(this.options, options); + } + } + /** + * Repaint the component + * @return {boolean} Returns true if the component is resized + */ + + }, { + key: "redraw", + value: function redraw() { + // should be implemented by the component + return false; + } + /** + * Destroy the component. Cleanup DOM and event listeners + */ + + }, { + key: "destroy", + value: function destroy() {} // 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 + */ + + }, { + key: "_isResized", + value: function _isResized() { + 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; + } + }]); + + return Component; +}(); + +var nativeSort = [].sort; +var test$1 = [1, 2, 3]; // IE8- + +var FAILS_ON_UNDEFINED = fails(function () { + test$1.sort(undefined); +}); // V8 bug + +var FAILS_ON_NULL = fails(function () { + test$1.sort(null); +}); // Old WebKit + +var SLOPPY_METHOD = sloppyArrayMethod('sort'); +var FORCED$3 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD; // `Array.prototype.sort` method +// https://tc39.github.io/ecma262/#sec-array.prototype.sort + +_export({ + target: 'Array', + proto: true, + forced: FORCED$3 +}, { + sort: function sort(comparefn) { + return comparefn === undefined ? nativeSort.call(toObject(this)) : nativeSort.call(toObject(this), aFunction(comparefn)); + } +}); + +var sort = entryVirtual('Array').sort; + +var ArrayPrototype$3 = Array.prototype; + +var sort_1 = function (it) { + var own = it.sort; + return it === ArrayPrototype$3 || it instanceof Array && own === ArrayPrototype$3.sort ? sort : own; +}; + +var sort$1 = sort_1; + +var sort$2 = sort$1; + +// https://tc39.github.io/ecma262/#sec-string.prototype.repeat + + +var stringRepeat = ''.repeat || function repeat(count) { + var str = String(requireObjectCoercible(this)); + var result = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions'); + + for (; n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; + + return result; +}; + +// https://tc39.github.io/ecma262/#sec-string.prototype.repeat + +_export({ + target: 'String', + proto: true +}, { + repeat: stringRepeat +}); + +var repeat = entryVirtual('String').repeat; + +var StringPrototype = String.prototype; + +var repeat_1 = function (it) { + var own = it.repeat; + return typeof it === 'string' || it === StringPrototype || it instanceof String && own === StringPrototype.repeat ? repeat : own; +}; + +var repeat$1 = repeat_1; + +var repeat$2 = repeat$1; + +/** + * used in Core to convert the options into a volatile variable + * + * @param {function} moment + * @param {Object} body + * @param {Array | Object} hiddenDates + * @returns {number} + */ +function convertHiddenOptions(moment, body, hiddenDates) { + if (hiddenDates && !isArray$3(hiddenDates)) { + return convertHiddenOptions(moment, body, [hiddenDates]); + } + + body.hiddenDates = []; + + if (hiddenDates) { + if (isArray$3(hiddenDates) == true) { + var _context; + + for (var i = 0; i < hiddenDates.length; i++) { + if (repeat$2(hiddenDates[i]) === undefined) { + var dateItem = {}; + dateItem.start = moment(hiddenDates[i].start).toDate().valueOf(); + dateItem.end = moment(hiddenDates[i].end).toDate().valueOf(); + body.hiddenDates.push(dateItem); + } + } + + sort$2(_context = body.hiddenDates).call(_context, 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 + * @returns {null} + */ + +function updateHiddenDates(moment, body, hiddenDates) { + if (hiddenDates && !isArray$3(hiddenDates)) { + return updateHiddenDates(moment, body, [hiddenDates]); + } + + if (hiddenDates && body.domProps.centerContainer.width !== undefined) { + 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 (repeat$2(hiddenDates[i]) !== 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: ".concat(hiddenDates[i].start)); + } + + if (endDate._d == "Invalid Date") { + throw new Error("Supplied end date is not valid: ".concat(hiddenDates[i].end)); + } + + var duration = endDate - startDate; + + if (duration >= 4 * pixelTime) { + var offset = 0; + var runUntil = end.clone(); + + switch (repeat$2(hiddenDates[i])) { + 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:", repeat$2(hiddenDates[i])); + return; + } + + while (startDate < runUntil) { + body.hiddenDates.push({ + start: startDate.valueOf(), + end: endDate.valueOf() + }); + + switch (repeat$2(hiddenDates[i])) { + 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:", repeat$2(hiddenDates[i])); + return; + } + } + + body.hiddenDates.push({ + start: startDate.valueOf(), + end: endDate.valueOf() + }); + } + } + } // remove duplicates, merge where possible + + + removeDuplicates(body); // ensure the new positions are not on hidden dates + + var startHidden = getIsHidden(body.range.start, body.hiddenDates); + var endHidden = getIsHidden(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 {Object} body + */ + +function removeDuplicates(body) { + var _context2; + + 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 (i = 0; i < hiddenDates.length; i++) { + if (hiddenDates[i].remove !== true) { + safeDates.push(hiddenDates[i]); + } + } + + body.hiddenDates = safeDates; + + sort$2(_context2 = body.hiddenDates).call(_context2, function (a, b) { + return a.start - b.start; + }); // sort by start time + +} +/** + * Prints dates to console + * @param {array} dates + */ + +function printDates(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 {Date} previousTime + */ + +function stepOverHiddenDates(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 +// */ +//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 {timeline.Core} Core + * @param {Date} time + * @param {number} width + * @returns {number} + */ + +function toScreen(Core, time, width) { + var conversion; + + if (Core.body.hiddenDates.length == 0) { + conversion = Core.range.conversion(width); + return (time.valueOf() - conversion.offset) * conversion.scale; + } else { + var hidden = getIsHidden(time, Core.body.hiddenDates); + + if (hidden.hidden == true) { + time = hidden.startDate; + } + + var duration = getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end); + + if (time < Core.range.start) { + conversion = Core.range.conversion(width, duration); + var hiddenBeforeStart = getHiddenDurationBeforeStart(Core.body.hiddenDates, time, conversion.offset); + time = Core.options.moment(time).toDate().valueOf(); + time = time + hiddenBeforeStart; + return -(conversion.offset - time.valueOf()) * conversion.scale; + } else if (time > Core.range.end) { + var rangeAfterEnd = { + start: Core.range.start, + end: time + }; + time = correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, rangeAfterEnd, time); + conversion = Core.range.conversion(width, duration); + return (time.valueOf() - conversion.offset) * conversion.scale; + } else { + time = correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, Core.range, time); + conversion = Core.range.conversion(width, duration); + return (time.valueOf() - conversion.offset) * conversion.scale; + } + } +} +/** + * Replaces the core toTime methods + * + * @param {timeline.Core} Core + * @param {number} x + * @param {number} width + * @returns {Date} + */ + +function toTime(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 = 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 = getAccumulatedHiddenDuration(Core.body.hiddenDates, Core.range, partialDuration); + return new Date(accumulatedHiddenDuration + partialDuration + Core.range.start); + } +} +/** + * Support function + * + * @param {Array.<{start: Window.start, end: *}>} hiddenDates + * @param {number} start + * @param {number} end + * @returns {number} + */ + +function getHiddenDurationBetween(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 {Array.<{start: Window.start, end: *}>} hiddenDates + * @param {number} start + * @param {number} end + * @returns {number} + */ + +function getHiddenDurationBeforeStart(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 (startDate >= start && endDate <= end) { + duration += endDate - startDate; + } + } + + return duration; +} +/** + * Support function + * @param {function} moment + * @param {Array.<{start: Window.start, end: *}>} hiddenDates + * @param {{start: number, end: number}} range + * @param {Date} time + * @returns {number} + */ + +function correctTimeForHidden(moment, hiddenDates, range, time) { + time = moment(time).toDate().valueOf(); + time -= getHiddenDurationBefore(moment, hiddenDates, range, time); + return time; +} +/** + * Support function + * @param {function} moment + * @param {Array.<{start: Window.start, end: *}>} hiddenDates + * @param {{start: number, end: number}} range + * @param {Date} time + * @returns {number} + */ + +function getHiddenDurationBefore(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 {Array.<{start: Window.start, end: *}>} hiddenDates + * @param {{start: number, end: number}} range + * @param {number} [requiredDuration=0] + * @returns {number} + */ + +function getAccumulatedHiddenDuration(hiddenDates, range, requiredDuration) { + var hiddenDuration = 0; + var duration = 0; + var previousPoint = range.start; //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 {Array.<{start: Window.start, end: *}>} hiddenDates + * @param {Date} time + * @param {number} direction + * @param {boolean} correctionEnabled + * @returns {Date|number} + */ + +function snapAwayFromHidden(hiddenDates, time, direction, correctionEnabled) { + var isHidden = getIsHidden(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 {Date} time + * @param {Array.<{start: Window.start, end: *}>} hiddenDates + * @returns {{hidden: boolean, startDate: Window.start, endDate: *}} + */ + +function getIsHidden(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 + }; + } + } + + return { + hidden: false, + startDate: startDate, + endDate: endDate + }; +} + +var DateUtil = /*#__PURE__*/Object.freeze({ + convertHiddenOptions: convertHiddenOptions, + updateHiddenDates: updateHiddenDates, + removeDuplicates: removeDuplicates, + printDates: printDates, + stepOverHiddenDates: stepOverHiddenDates, + toScreen: toScreen, + toTime: toTime, + getHiddenDurationBetween: getHiddenDurationBetween, + getHiddenDurationBeforeStart: getHiddenDurationBeforeStart, + correctTimeForHidden: correctTimeForHidden, + getHiddenDurationBefore: getHiddenDurationBefore, + getAccumulatedHiddenDuration: getAccumulatedHiddenDuration, + snapAwayFromHidden: snapAwayFromHidden, + getIsHidden: getIsHidden +}); + +/** + * 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. + */ + +var Range = +/*#__PURE__*/ +function (_Component) { + inherits$1(Range, _Component); + + /** + * @param {{dom: Object, domProps: Object, emitter: Emitter}} body + * @param {Object} [options] See description at Range.setOptions + * @constructor Range + * @extends Component + */ + function Range(body, options) { + var _context, _context2, _context3, _context4, _context5, _context6, _context7; + + var _this; + + classCallCheck$1(this, Range); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(Range).call(this)); + var now = moment$3().hours(0).minutes(0).seconds(0).milliseconds(0); + var start = now.clone().add(-3, 'days').valueOf(); + var end = now.clone().add(3, 'days').valueOf(); + _this.millisecondsPerPixelCache = undefined; + + if (options === undefined) { + _this.start = start; + _this.end = end; + } else { + _this.start = options.start || start; + _this.end = options.end || end; + } + + _this.rolling = false; + _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$3, + direction: 'horizontal', + // 'horizontal' or 'vertical' + moveable: true, + zoomable: true, + min: null, + max: null, + zoomMin: 10, + // milliseconds + zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000, + // milliseconds + rollingMode: { + follow: false, + offset: 0.5 + } + }; + _this.options = util$2.extend({}, _this.defaultOptions); + _this.props = { + touch: {} + }; + _this.animationTimer = null; // drag listeners for dragging + + _this.body.emitter.on('panstart', bind$2(_context = _this._onDragStart).call(_context, assertThisInitialized$1(_this))); + + _this.body.emitter.on('panmove', bind$2(_context2 = _this._onDrag).call(_context2, assertThisInitialized$1(_this))); + + _this.body.emitter.on('panend', bind$2(_context3 = _this._onDragEnd).call(_context3, assertThisInitialized$1(_this))); // mouse wheel for zooming + + + _this.body.emitter.on('mousewheel', bind$2(_context4 = _this._onMouseWheel).call(_context4, assertThisInitialized$1(_this))); // pinch to zoom + + + _this.body.emitter.on('touch', bind$2(_context5 = _this._onTouch).call(_context5, assertThisInitialized$1(_this))); + + _this.body.emitter.on('pinch', bind$2(_context6 = _this._onPinch).call(_context6, assertThisInitialized$1(_this))); // on click of rolling mode button + + + _this.body.dom.rollingModeBtn.addEventListener('click', bind$2(_context7 = _this.startRolling).call(_context7, assertThisInitialized$1(_this))); + + _this.setOptions(options); + + return _this; + } + /** + * 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 + */ + + + createClass$1(Range, [{ + key: "setOptions", + value: function setOptions(options) { + if (options) { + // copy the options that we know + var fields = ['animation', 'direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable', 'moment', 'activate', 'hiddenDates', 'zoomKey', 'zoomFriction', 'rtl', 'showCurrentTime', 'rollingMode', 'horizontalScroll']; + util$2.selectiveExtend(fields, this.options, options); + + if (options.rollingMode && options.rollingMode.follow) { + this.startRolling(); + } + + if ('start' in options || 'end' in options) { + // apply a new range. both start and end are optional + this.setRange(options.start, options.end); + } + } + } + /** + * Start auto refreshing the current time bar + */ + + }, { + key: "startRolling", + value: function startRolling() { + var me = this; + /** + * Updates the current time. + */ + + function update() { + me.stopRolling(); + me.rolling = true; + var interval = me.end - me.start; + var t = util$2.convert(new Date(), 'Date').valueOf(); + var rollingModeOffset = me.options.rollingMode && me.options.rollingMode.offset || 0.5; + var start = t - interval * rollingModeOffset; + var end = t + interval * (1 - rollingModeOffset); + var options = { + animation: false + }; + me.setRange(start, end, options); // determine interval to refresh + + var scale = me.conversion(me.body.domProps.center.width).scale; + interval = 1 / scale / 10; + if (interval < 30) interval = 30; + if (interval > 1000) interval = 1000; + me.body.dom.rollingModeBtn.style.visibility = "hidden"; // start a renderTimer to adjust for the new time + + me.currentTimeTimer = setTimeout$2(update, interval); + } + + update(); + } + /** + * Stop auto refreshing the current time bar + */ + + }, { + key: "stopRolling", + value: function stopRolling() { + if (this.currentTimeTimer !== undefined) { + clearTimeout(this.currentTimeTimer); + this.rolling = false; + this.body.dom.rollingModeBtn.style.visibility = "visible"; + } + } + /** + * Set a new start and end range + * @param {Date | number | string} start + * @param {Date | number | string} end + * @param {Object} options Available options: + * {boolean | {duration: number, easingFunction: string}} [animation=false] + * If true, 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'. + * {boolean} [byUser=false] + * {Event} event Mouse event + * @param {Function} callback a callback function to be executed at the end of this function + * @param {Function} frameCallback a callback function executed each frame of the range animation. + * The callback will be passed three parameters: + * {number} easeCoefficient an easing coefficent + * {boolean} willDraw If true the caller will redraw after the callback completes + * {boolean} done If true then animation is ending after the current frame + * @return {void} + */ + + }, { + key: "setRange", + value: function setRange(start, end, options, callback, frameCallback) { + if (!options) { + options = {}; + } + + if (options.byUser !== true) { + options.byUser = false; + } + + var me = this; + var finalStart = start != undefined ? util$2.convert(start, 'Date').valueOf() : null; + var finalEnd = end != undefined ? util$2.convert(end, 'Date').valueOf() : null; + + this._cancelAnimation(); + + this.millisecondsPerPixelCache = undefined; + + if (options.animation) { + // true or an Object + var initStart = this.start; + var initEnd = this.end; + var duration = _typeof_1$2(options.animation) === 'object' && 'duration' in options.animation ? options.animation.duration : 500; + var easingName = _typeof_1$2(options.animation) === 'object' && 'easingFunction' in options.animation ? options.animation.easingFunction : 'easeInOutQuad'; + var easingFunction = util$2.easingFunctions[easingName]; + + if (!easingFunction) { + var _context8; + + throw new Error(concat$2(_context8 = "Unknown easing function ".concat(stringify$2(easingName), ". Choose from: ")).call(_context8, keys$3(util$2.easingFunctions).join(', '))); + } + + var initTime = now$2(); + + var anyChanged = false; + + var next = function next() { + if (!me.props.touch.dragging) { + var now = now$2(); + + 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); + updateHiddenDates(me.options.moment, me.body, me.options.hiddenDates); + anyChanged = anyChanged || changed; + var params = { + start: new Date(me.start), + end: new Date(me.end), + byUser: options.byUser, + event: options.event + }; + + if (frameCallback) { + frameCallback(ease, changed, done); + } + + if (changed) { + me.body.emitter.emit('rangechange', params); + } + + if (done) { + if (anyChanged) { + me.body.emitter.emit('rangechanged', params); + + if (callback) { + return callback(); + } + } + } else { + // animate with as high as possible frame rate, leave 20 ms in between + // each to prevent the browser from blocking + me.animationTimer = setTimeout$2(next, 20); + } + } + }; + + return next(); + } else { + var changed = this._applyRange(finalStart, finalEnd); + + updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates); + + if (changed) { + var params = { + start: new Date(this.start), + end: new Date(this.end), + byUser: options.byUser, + event: options.event + }; + this.body.emitter.emit('rangechange', params); + clearTimeout(me.timeoutID); + me.timeoutID = setTimeout$2(function () { + me.body.emitter.emit('rangechanged', params); + }, 200); + + if (callback) { + return callback(); + } + } + } + } + /** + * Get the number of milliseconds per pixel. + * + * @returns {undefined|number} + */ + + }, { + key: "getMillisecondsPerPixel", + value: function getMillisecondsPerPixel() { + if (this.millisecondsPerPixelCache === undefined) { + this.millisecondsPerPixelCache = (this.end - this.start) / this.body.dom.center.clientWidth; + } + + return this.millisecondsPerPixelCache; + } + /** + * Stop an animation + * @private + */ + + }, { + key: "_cancelAnimation", + value: function _cancelAnimation() { + 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 + */ + + }, { + key: "_applyRange", + value: function _applyRange(start, end) { + var newStart = start != null ? util$2.convert(start, 'Date').valueOf() : this.start; + var newEnd = end != null ? util$2.convert(end, 'Date').valueOf() : this.end; + var max = this.options.max != null ? util$2.convert(this.options.max, 'Date').valueOf() : null; + var min = this.options.min != null ? util$2.convert(this.options.min, 'Date').valueOf() : null; + var diff; // check for valid number + + if (isNaN(newStart) || newStart === null) { + throw new Error("Invalid start \"".concat(start, "\"")); + } + + if (isNaN(newEnd) || newEnd === null) { + throw new Error("Invalid end \"".concat(end, "\"")); + } // prevent end < start + + + 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$3(this.options.zoomMin); + + if (zoomMin < 0) { + zoomMin = 0; + } + + if (newEnd - newStart < zoomMin) { + // compensate for a scale of 0.5 ms + var compensation = 0.5; + + if (this.end - this.start === zoomMin && newStart >= this.start - compensation && 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$3(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 + */ + + }, { + key: "getRange", + value: function getRange() { + return { + start: this.start, + end: this.end + }; + } + /** + * Calculate the conversion offset and scale for current range, based on + * the provided width + * @param {number} width + * @param {number} [totalHidden=0] + * @returns {{offset: number, scale: number}} conversion + */ + + }, { + key: "conversion", + value: function conversion(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 + * @param {number} [totalHidden=0] + * @returns {{offset: number, scale: number}} conversion + */ + + }, { + key: "_onDragStart", + + /** + * Start dragging horizontally or vertically + * @param {Event} event + * @private + */ + value: function _onDragStart(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.stopRolling(); + 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 + */ + + }, { + key: "_onDrag", + value: function _onDrag(event) { + if (!event) return; + 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 = getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end); + interval -= duration; + var width = direction == 'horizontal' ? this.body.domProps.center.width : this.body.domProps.center.height; + var diffRange; + + if (this.options.rtl) { + diffRange = delta / width * interval; + } else { + 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 = snapAwayFromHidden(this.body.hiddenDates, newStart, this.previousDelta - delta, true); + var safeEnd = 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, + event: event + }); // fire a panmove event + + this.body.emitter.emit('panmove'); + } + /** + * Stop dragging operation + * @param {event} event + * @private + */ + + }, { + key: "_onDragEnd", + value: function _onDragEnd(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: event + }); + } + /** + * Event handler for mouse wheel event, used to zoom + * Code from http://adomas.org/javascript-mouse-wheel/ + * @param {Event} event + * @private + */ + + }, { + key: "_onMouseWheel", + value: function _onMouseWheel(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; + } else if (event.deltaY) { + delta = -event.deltaY / 3; + } // don't allow zoom when the according key is pressed and the zoomKey option or not zoomable but movable + + + if (this.options.zoomKey && !event[this.options.zoomKey] && this.options.zoomable || !this.options.zoomable && this.options.moveable) { + return; + } // 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; // 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 zoomFriction = this.options.zoomFriction || 5; + var scale; + + if (delta < 0) { + scale = 1 - delta / zoomFriction; + } else { + scale = 1 / (1 + delta / zoomFriction); + } // calculate center, the date to zoom around + + + var pointerDate; + + if (this.rolling) { + var rollingModeOffset = this.options.rollingMode && this.options.rollingMode.offset || 0.5; + pointerDate = this.start + (this.end - this.start) * rollingModeOffset; + } else { + var pointer = this.getPointer({ + x: event.clientX, + y: event.clientY + }, this.body.dom.center); + pointerDate = this._pointerToDate(pointer); + } + + this.zoom(scale, pointerDate, delta, event); // Prevent default actions caused by mouse wheel + // (else the page and timeline both scroll) + + event.preventDefault(); + } + } + /** + * Start of a touch gesture + * @param {Event} event + * @private + */ + + }, { + key: "_onTouch", + value: function _onTouch(event) { + // eslint-disable-line no-unused-vars + 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; // Disable the browser default handling of this event. + + util$2.preventDefault(event); + } + /** + * Handle pinch event + * @param {Event} event + * @private + */ + + }, { + key: "_onPinch", + value: function _onPinch(event) { + // only allow zooming when configured as zoomable and moveable + if (!(this.options.zoomable && this.options.moveable)) return; // Disable the browser default handling of this event. + + util$2.preventDefault(event); + this.props.touch.allowDragging = false; + + if (!this.props.touch.center) { + this.props.touch.center = this.getPointer(event.center, this.body.dom.center); + } + + this.stopRolling(); + var scale = 1 / (event.scale + this.scaleOffset); + + var centerDate = this._pointerToDate(this.props.touch.center); + + var hiddenDuration = getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end); + var hiddenDurationBefore = 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 = snapAwayFromHidden(this.body.hiddenDates, newStart, 1 - scale, true); + var safeEnd = 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; + } + + var options = { + animation: false, + byUser: true, + event: event + }; + this.setRange(newStart, newEnd, options); + 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 + */ + + }, { + key: "_isInsideRange", + value: function _isInsideRange(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; + var centerContainerRect = this.body.dom.centerContainer.getBoundingClientRect(); + var x = this.options.rtl ? clientX - centerContainerRect.left : centerContainerRect.right - 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 + */ + + }, { + key: "_pointerToDate", + value: function _pointerToDate(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 + */ + + }, { + key: "getPointer", + value: function getPointer(touch, element) { + var elementRect = element.getBoundingClientRect(); + + if (this.options.rtl) { + return { + x: elementRect.right - touch.x, + y: touch.y - elementRect.top + }; + } else { + return { + x: touch.x - elementRect.left, + y: touch.y - elementRect.top + }; + } + } + /** + * 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. + * @param {number} delta + * @param {Event} event + */ + + }, { + key: "zoom", + value: function zoom(scale, center, delta, event) { + // 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 = getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end); + var hiddenDurationBefore = 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 = snapAwayFromHidden(this.body.hiddenDates, newStart, delta, true); + var safeEnd = snapAwayFromHidden(this.body.hiddenDates, newEnd, -delta, true); + + if (safeStart != newStart || safeEnd != newEnd) { + newStart = safeStart; + newEnd = safeEnd; + } + + var options = { + animation: false, + byUser: true, + event: event + }; + this.setRange(newStart, newEnd, options); + 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 + */ + + }, { + key: "move", + value: function move(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 + */ + + }, { + key: "moveTo", + value: function moveTo(_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; + var options = { + animation: false, + byUser: true, + event: null + }; + this.setRange(newStart, newEnd, options); + } + }], [{ + key: "conversion", + value: function conversion(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 + }; + } + } + }]); + + return Range; +}(Component); + +function validateDirection(direction) { + if (direction != 'horizontal' && direction != 'vertical') { + throw new TypeError("Unknown direction \"".concat(direction, "\". Choose \"horizontal\" or \"vertical\".")); + } +} + +var setInterval = path.setInterval; + +var setInterval$1 = setInterval; + +var $some = arrayIteration.some; // `Array.prototype.some` method +// https://tc39.github.io/ecma262/#sec-array.prototype.some + +_export({ + target: 'Array', + proto: true, + forced: sloppyArrayMethod('some') +}, { + some: function some(callbackfn + /* , thisArg */ + ) { + return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var some = entryVirtual('Array').some; + +var ArrayPrototype$4 = Array.prototype; + +var some_1 = function (it) { + var own = it.some; + return it === ArrayPrototype$4 || it instanceof Array && own === ArrayPrototype$4.some ? some : own; +}; + +var some$1 = some_1; + +var some$2 = some$1; + +var max$1 = Math.max; +var min$2 = Math.min; +var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF; +var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method +// https://tc39.github.io/ecma262/#sec-array.prototype.splice +// with adding support of @@species + +_export({ + target: 'Array', + proto: true, + forced: !arrayMethodHasSpeciesSupport('splice') +}, { + splice: function splice(start, deleteCount + /* , ...items */ + ) { + var O = toObject(this); + var len = toLength(O.length); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min$2(max$1(toInteger(deleteCount), 0), len - actualStart); + } + + if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) { + throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); + } + + A = arraySpeciesCreate(O, actualDeleteCount); + + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + + A.length = actualDeleteCount; + + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from];else delete O[to]; + } + + for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from];else delete O[to]; + } + } + + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; + } + + O.length = len - actualDeleteCount + insertCount; + return A; + } +}); + +var splice = entryVirtual('Array').splice; + +var ArrayPrototype$5 = Array.prototype; + +var splice_1 = function (it) { + var own = it.splice; + return it === ArrayPrototype$5 || it instanceof Array && own === ArrayPrototype$5.splice ? splice : own; +}; + +var splice$1 = splice_1; + +var splice$2 = splice$1; + +var $indexOf = arrayIncludes.indexOf; +var nativeIndexOf = [].indexOf; +var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; +var SLOPPY_METHOD$1 = sloppyArrayMethod('indexOf'); // `Array.prototype.indexOf` method +// https://tc39.github.io/ecma262/#sec-array.prototype.indexof + +_export({ + target: 'Array', + proto: true, + forced: NEGATIVE_ZERO || SLOPPY_METHOD$1 +}, { + indexOf: function indexOf(searchElement + /* , fromIndex = 0 */ + ) { + return NEGATIVE_ZERO // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var indexOf$1 = entryVirtual('Array').indexOf; + +var ArrayPrototype$6 = Array.prototype; + +var indexOf_1 = function (it) { + var own = it.indexOf; + return it === ArrayPrototype$6 || it instanceof Array && own === ArrayPrototype$6.indexOf ? indexOf$1 : own; +}; + +var indexOf$2 = indexOf_1; + +var indexOf$3 = indexOf$2; + +/** + * Expose `Emitter`. + */ +var emitterComponent = 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; +}; + +var propagating = createCommonjsModule$2(function (module, exports) { + + (function (factory) { + { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = 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.>} */ + + 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; + }; + }); +}); + +/*! Hammer.JS - v2.0.17-rc - 2019-12-16 + * http://naver.github.io/egjs + * + * Forked By Naver egjs + * Copyright (c) hammerjs + * Licensed under the MIT license */ +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _assertThisInitialized$2(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} +/** + * @private + * 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; +} + +var assign$1 = assign; +var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o']; +var TEST_ELEMENT = typeof document === "undefined" ? { + style: {} +} : document.createElement('div'); +var TYPE_FUNCTION = 'function'; +var round = Math.round, + abs = Math.abs; +var now$3 = Date.now; +/** + * @private + * get the prefixed property + * @param {Object} obj + * @param {String} property + * @returns {String|Undefined} prefixed + */ + +function prefixed(obj, property) { + var prefix; + var 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; +} +/* eslint-disable no-new-func, no-nested-ternary */ + + +var win; + +if (typeof window === "undefined") { + // window is undefined in node.js + win = {}; +} else { + win = window; +} + +var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction'); +var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined; + +function getTouchActionProps() { + if (!NATIVE_TOUCH_ACTION) { + return false; + } + + var touchMap = {}; + var cssSupports = win.CSS && win.CSS.supports; + ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) { + // If css.supports is not supported but there is native touch-action assume it supports + // all values. This is the case for IE 10 and 11. + return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true; + }); + return touchMap; +} + +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'; +var TOUCH_ACTION_MAP = getTouchActionProps(); +var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i; +var SUPPORT_TOUCH = 'ontouchstart' in win; +var SUPPORT_POINTER_EVENTS = prefixed(win, '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']; +/** + * @private + * 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); + } + } +} +/** + * @private + * 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; +} +/** + * @private + * small indexOf wrapper + * @param {String} str + * @param {String} find + * @returns {Boolean} found + */ + + +function inStr(str, find) { + return str.indexOf(find) > -1; +} +/** + * @private + * 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; +} +/** + * @private + * Touch Action + * sets the touchAction property or uses the js alternative + * @param {Manager} manager + * @param {String} value + * @constructor + */ + + +var TouchAction = +/*#__PURE__*/ +function () { + function TouchAction(manager, value) { + this.manager = manager; + this.set(value); + } + /** + * @private + * set the touchAction value on the element or enable the polyfill + * @param {String} value + */ + + + var _proto = TouchAction.prototype; + + _proto.set = function set(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 && TOUCH_ACTION_MAP[value]) { + this.manager.element.style[PREFIXED_TOUCH_ACTION] = value; + } + + this.actions = value.toLowerCase().trim(); + }; + /** + * @private + * just re-set the touchAction value + */ + + + _proto.update = function update() { + this.set(this.manager.options.touchAction); + }; + /** + * @private + * compute the value for the touchAction property based on the recognizer's settings + * @returns {String} value + */ + + + _proto.compute = function compute() { + var actions = []; + each(this.manager.recognizers, function (recognizer) { + if (boolOrFn(recognizer.options.enable, [recognizer])) { + actions = actions.concat(recognizer.getTouchAction()); + } + }); + return cleanTouchActions(actions.join(' ')); + }; + /** + * @private + * this method is called on each input cycle and provides the preventing of the browser behavior + * @param {Object} input + */ + + + _proto.preventDefaults = function preventDefaults(input) { + 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) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE]; + var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y]; + var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[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); + } + }; + /** + * @private + * call preventDefault to prevent the browser's default behavior (scrolling in most cases) + * @param {Object} srcEvent + */ + + + _proto.preventSrc = function preventSrc(srcEvent) { + this.manager.session.prevented = true; + srcEvent.preventDefault(); + }; + + return TouchAction; +}(); +/** + * @private + * find if a node is in the given parent + * @method hasParent + * @param {HTMLElement} node + * @param {HTMLElement} parent + * @return {Boolean} found + */ + + +function hasParent$1(node, parent) { + while (node) { + if (node === parent) { + return true; + } + + node = node.parentNode; + } + + return false; +} +/** + * @private + * 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; + var y = 0; + var i = 0; + + while (i < pointersLength) { + x += pointers[i].clientX; + y += pointers[i].clientY; + i++; + } + + return { + x: round(x / pointersLength), + y: round(y / pointersLength) + }; +} +/** + * @private + * 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$3(), + pointers: pointers, + center: getCenter(pointers), + deltaX: input.deltaX, + deltaY: input.deltaY + }; +} +/** + * @private + * 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]]; + var y = p2[props[1]] - p1[props[1]]; + return Math.sqrt(x * x + y * y); +} +/** + * @private + * 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]]; + var y = p2[props[1]] - p1[props[1]]; + return Math.atan2(y, x) * 180 / Math.PI; +} +/** + * @private + * 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; +} + +function computeDeltaXY(session, input) { + var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session; + // jscs throwing error on defalut destructured values and without defaults tests fail + + 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); +} +/** + * @private + * 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 + }; +} +/** + * @private + * 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); +} +/** + * @private + * 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); +} +/** + * @private + * velocity is calculated every x ms + * @param {Object} session + * @param {Object} input + */ + + +function computeIntervalInputData(session, input) { + var last = session.lastInterval || input; + var deltaTime = input.timeStamp - last.timeStamp; + var velocity; + var velocityX; + var velocityY; + var 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; +} +/** +* @private + * 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, + firstMultiple = session.firstMultiple; + var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center; + var center = input.center = getCenter(pointers); + input.timeStamp = now$3(); + 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; + var srcEvent = input.srcEvent; + var srcEventTarget; + + if (srcEvent.composedPath) { + srcEventTarget = srcEvent.composedPath()[0]; + } else if (srcEvent.path) { + srcEventTarget = srcEvent.path[0]; + } else { + srcEventTarget = srcEvent.target; + } + + if (hasParent$1(srcEventTarget, target)) { + target = srcEventTarget; + } + + input.target = target; +} +/** + * @private + * 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; +} +/** + * @private + * split string on whitespace + * @param {String} str + * @returns {Array} words + */ + + +function splitStr(str) { + return str.trim().split(/\s+/g); +} +/** + * @private + * 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); + }); +} +/** + * @private + * 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); + }); +} +/** + * @private + * 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; +} +/** + * @private + * create new input type manager + * @param {Manager} manager + * @param {Function} callback + * @returns {Input} + * @constructor + */ + + +var Input = +/*#__PURE__*/ +function () { + 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(); + } + /** + * @private + * should handle the inputEvent data and trigger the callback + * @virtual + */ + + + var _proto = Input.prototype; + + _proto.handler = function handler() {}; + /** + * @private + * bind the events + */ + + + _proto.init = function init() { + 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); + }; + /** + * @private + * unbind the events + */ + + + _proto.destroy = function destroy() { + 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); + }; + + return Input; +}(); +/** + * @private + * 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) { + // do not use === here, test fails + return i; + } + + i++; + } + + return -1; + } +} + +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 (win.MSPointerEvent && !win.PointerEvent) { + POINTER_ELEMENT_EVENTS = 'MSPointerDown'; + POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel'; +} +/** + * @private + * Pointer events input + * @constructor + * @extends Input + */ + + +var PointerEventInput = +/*#__PURE__*/ +function (_Input) { + _inheritsLoose(PointerEventInput, _Input); + + function PointerEventInput() { + var _this; + + var proto = PointerEventInput.prototype; + proto.evEl = POINTER_ELEMENT_EVENTS; + proto.evWin = POINTER_WINDOW_EVENTS; + _this = _Input.apply(this, arguments) || this; + _this.store = _this.manager.session.pointerEvents = []; + return _this; + } + /** + * @private + * handle mouse events + * @param {Object} ev + */ + + + var _proto = PointerEventInput.prototype; + + _proto.handler = function handler(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); + } + }; + + return PointerEventInput; +}(Input); +/** + * @private + * convert array-like objects to real arrays + * @param {Object} obj + * @returns {Array} + */ + + +function toArray$1(obj) { + return Array.prototype.slice.call(obj, 0); +} +/** + * @private + * 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 (a, b) { + return a[key] > b[key]; + }); + } + } + + return results; +} + +var TOUCH_INPUT_MAP = { + touchstart: INPUT_START, + touchmove: INPUT_MOVE, + touchend: INPUT_END, + touchcancel: INPUT_CANCEL +}; +var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel'; +/** + * @private + * Multi-user touch events input + * @constructor + * @extends Input + */ + +var TouchInput = +/*#__PURE__*/ +function (_Input) { + _inheritsLoose(TouchInput, _Input); + + function TouchInput() { + var _this; + + TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS; + _this = _Input.apply(this, arguments) || this; + _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS; + + return _this; + } + + var _proto = TouchInput.prototype; + + _proto.handler = function handler(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 + }); + }; + + return TouchInput; +}(Input); + +function getTouches(ev, type) { + var allTouches = toArray$1(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; + var targetTouches; + var changedTouches = toArray$1(ev.changedTouches); + var changedTargetTouches = []; + var target = this.target; // get target touches from touches + + targetTouches = allTouches.filter(function (touch) { + return hasParent$1(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]; +} + +var MOUSE_INPUT_MAP = { + mousedown: INPUT_START, + mousemove: INPUT_MOVE, + mouseup: INPUT_END +}; +var MOUSE_ELEMENT_EVENTS = 'mousedown'; +var MOUSE_WINDOW_EVENTS = 'mousemove mouseup'; +/** + * @private + * Mouse events input + * @constructor + * @extends Input + */ + +var MouseInput = +/*#__PURE__*/ +function (_Input) { + _inheritsLoose(MouseInput, _Input); + + function MouseInput() { + var _this; + + var proto = MouseInput.prototype; + proto.evEl = MOUSE_ELEMENT_EVENTS; + proto.evWin = MOUSE_WINDOW_EVENTS; + _this = _Input.apply(this, arguments) || this; + _this.pressed = false; // mousedown state + + return _this; + } + /** + * @private + * handle mouse events + * @param {Object} ev + */ + + + var _proto = MouseInput.prototype; + + _proto.handler = function handler(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 + + + if (!this.pressed) { + return; + } + + if (eventType & INPUT_END) { + this.pressed = false; + } + + this.callback(this.manager, eventType, { + pointers: [ev], + changedPointers: [ev], + pointerType: INPUT_TYPE_MOUSE, + srcEvent: ev + }); + }; + + return MouseInput; +}(Input); +/** + * @private + * 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 + */ + + +var DEDUP_TIMEOUT = 2500; +var DEDUP_DISTANCE = 25; + +function setLastTouch(eventData) { + var _eventData$changedPoi = eventData.changedPointers, + touch = _eventData$changedPoi[0]; + + if (touch.identifier === this.primaryTouch) { + var lastTouch = { + x: touch.clientX, + y: touch.clientY + }; + var lts = this.lastTouches; + this.lastTouches.push(lastTouch); + + var removeLastTouch = function removeLastTouch() { + var i = lts.indexOf(lastTouch); + + if (i > -1) { + lts.splice(i, 1); + } + }; + + setTimeout(removeLastTouch, DEDUP_TIMEOUT); + } +} + +function recordTouches(eventType, eventData) { + if (eventType & INPUT_START) { + this.primaryTouch = eventData.changedPointers[0].identifier; + setLastTouch.call(this, eventData); + } else if (eventType & (INPUT_END | INPUT_CANCEL)) { + setLastTouch.call(this, eventData); + } +} + +function isSyntheticEvent(eventData) { + var x = eventData.srcEvent.clientX; + var y = eventData.srcEvent.clientY; + + for (var i = 0; i < this.lastTouches.length; i++) { + var t = this.lastTouches[i]; + var dx = Math.abs(x - t.x); + var dy = Math.abs(y - t.y); + + if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) { + return true; + } + } + + return false; +} + +var TouchMouseInput = +/*#__PURE__*/ +function () { + var TouchMouseInput = + /*#__PURE__*/ + function (_Input) { + _inheritsLoose(TouchMouseInput, _Input); + + function TouchMouseInput(_manager, callback) { + var _this; + + _this = _Input.call(this, _manager, callback) || this; + + _this.handler = function (manager, inputEvent, inputData) { + var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH; + var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE; + + if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) { + return; + } // when we're in a touch event, record touches to de-dupe synthetic mouse event + + + if (isTouch) { + recordTouches.call(_assertThisInitialized$2(_assertThisInitialized$2(_this)), inputEvent, inputData); + } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized$2(_assertThisInitialized$2(_this)), inputData)) { + return; + } + + _this.callback(manager, inputEvent, inputData); + }; + + _this.touch = new TouchInput(_this.manager, _this.handler); + _this.mouse = new MouseInput(_this.manager, _this.handler); + _this.primaryTouch = null; + _this.lastTouches = []; + return _this; + } + /** + * @private + * handle mouse and touch events + * @param {Hammer} manager + * @param {String} inputEvent + * @param {Object} inputData + */ + + + var _proto = TouchMouseInput.prototype; + /** + * @private + * remove the event listeners + */ + + _proto.destroy = function destroy() { + this.touch.destroy(); + this.mouse.destroy(); + }; + + return TouchMouseInput; + }(Input); + + return TouchMouseInput; +}(); +/** + * @private + * create new input type manager + * called by the Manager constructor + * @param {Hammer} manager + * @returns {Input} + */ + + +function createInputInstance(manager) { + var Type; // let inputClass = manager.options.inputClass; + + 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); +} +/** + * @private + * 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; +} + +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; +/** + * @private + * get a unique id + * @returns {number} uniqueId + */ + +var _uniqueId = 1; + +function uniqueId() { + return _uniqueId++; +} +/** + * @private + * 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; +} +/** + * @private + * get a usable string, used as event postfix + * @param {constant} 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 ''; +} +/** + * @private + * 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 + */ + +/** + * @private + * Recognizer + * Every recognizer needs to extend from this class. + * @constructor + * @param {Object} options + */ + + +var Recognizer = +/*#__PURE__*/ +function () { + function Recognizer(options) { + if (options === void 0) { + options = {}; + } + + this.options = _extends({ + enable: true + }, options); + this.id = uniqueId(); + this.manager = null; // default is enable true + + this.state = STATE_POSSIBLE; + this.simultaneous = {}; + this.requireFail = []; + } + /** + * @private + * set options + * @param {Object} options + * @return {Recognizer} + */ + + + var _proto = Recognizer.prototype; + + _proto.set = function set(options) { + assign$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state + + this.manager && this.manager.touchAction.update(); + return this; + }; + /** + * @private + * recognize simultaneous with an other recognizer. + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + + + _proto.recognizeWith = function recognizeWith(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; + }; + /** + * @private + * drop the simultaneous link. it doesnt remove the link on the other recognizer. + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + + + _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) { + if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) { + return this; + } + + otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); + delete this.simultaneous[otherRecognizer.id]; + return this; + }; + /** + * @private + * recognizer can only run when an other is failing + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + + + _proto.requireFailure = function requireFailure(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; + }; + /** + * @private + * drop the requireFailure link. it does not remove the link on the other recognizer. + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + + + _proto.dropRequireFailure = function dropRequireFailure(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; + }; + /** + * @private + * has require failures boolean + * @returns {boolean} + */ + + + _proto.hasRequireFailures = function hasRequireFailures() { + return this.requireFail.length > 0; + }; + /** + * @private + * if the recognizer can recognize simultaneous with an other recognizer + * @param {Recognizer} otherRecognizer + * @returns {Boolean} + */ + + + _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) { + return !!this.simultaneous[otherRecognizer.id]; + }; + /** + * @private + * You should use `tryEmit` instead of `emit` directly to check + * that all the needed recognizers has failed before emitting. + * @param {Object} input + */ + + + _proto.emit = function emit(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)); + } + }; + /** + * @private + * 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 + */ + + + _proto.tryEmit = function tryEmit(input) { + if (this.canEmit()) { + return this.emit(input); + } // it's failing anyway + + + this.state = STATE_FAILED; + }; + /** + * @private + * can we emit? + * @returns {boolean} + */ + + + _proto.canEmit = function canEmit() { + var i = 0; + + while (i < this.requireFail.length) { + if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) { + return false; + } + + i++; + } + + return true; + }; + /** + * @private + * update the recognizer + * @param {Object} inputData + */ + + + _proto.recognize = function recognize(inputData) { + // make a new copy of the inputData + // so we can change the inputData without messing up the other recognizers + var inputDataClone = assign$1({}, 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); + } + }; + /** + * @private + * return the state of the recognizer + * the actual recognizing happens in this method + * @virtual + * @param {Object} inputData + * @returns {constant} STATE + */ + + /* jshint ignore:start */ + + + _proto.process = function process(inputData) {}; + /* jshint ignore:end */ + + /** + * @private + * return the preferred touch-action + * @virtual + * @returns {Array} + */ + + + _proto.getTouchAction = function getTouchAction() {}; + /** + * @private + * called when the gesture isn't allowed to recognize + * like when another is being recognized or it is disabled + * @virtual + */ + + + _proto.reset = function reset() {}; + + return Recognizer; +}(); +/** + * @private + * A tap is recognized 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 + */ + + +var TapRecognizer = +/*#__PURE__*/ +function (_Recognizer) { + _inheritsLoose(TapRecognizer, _Recognizer); + + function TapRecognizer(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + _this = _Recognizer.call(this, _extends({ + 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 + }, options)) || this; // previous time and center, + // used for tap counting + + _this.pTime = false; + _this.pCenter = false; + _this._timer = null; + _this._input = null; + _this.count = 0; + return _this; + } + + var _proto = TapRecognizer.prototype; + + _proto.getTouchAction = function getTouchAction() { + return [TOUCH_ACTION_MANIPULATION]; + }; + + _proto.process = function process(input) { + var _this2 = this; + + 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 = setTimeout(function () { + _this2.state = STATE_RECOGNIZED; + + _this2.tryEmit(); + }, options.interval); + return STATE_BEGAN; + } + } + } + + return STATE_FAILED; + }; + + _proto.failTimeout = function failTimeout() { + var _this3 = this; + + this._timer = setTimeout(function () { + _this3.state = STATE_FAILED; + }, this.options.interval); + return STATE_FAILED; + }; + + _proto.reset = function reset() { + clearTimeout(this._timer); + }; + + _proto.emit = function emit() { + if (this.state === STATE_RECOGNIZED) { + this._input.tapCount = this.count; + this.manager.emit(this.options.event, this._input); + } + }; + + return TapRecognizer; +}(Recognizer); +/** + * @private + * This recognizer is just used as a base for the simple attribute recognizers. + * @constructor + * @extends Recognizer + */ + + +var AttrRecognizer = +/*#__PURE__*/ +function (_Recognizer) { + _inheritsLoose(AttrRecognizer, _Recognizer); + + function AttrRecognizer(options) { + if (options === void 0) { + options = {}; + } + + return _Recognizer.call(this, _extends({ + pointers: 1 + }, options)) || this; + } + /** + * @private + * Used to check if it the recognizer receives valid input, like input.distance > 10. + * @memberof AttrRecognizer + * @param {Object} input + * @returns {Boolean} recognized + */ + + + var _proto = AttrRecognizer.prototype; + + _proto.attrTest = function attrTest(input) { + var optionPointers = this.options.pointers; + return optionPointers === 0 || input.pointers.length === optionPointers; + }; + /** + * @private + * Process the input and return the state for the recognizer + * @memberof AttrRecognizer + * @param {Object} input + * @returns {*} State + */ + + + _proto.process = function process(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; + }; + + return AttrRecognizer; +}(Recognizer); +/** + * @private + * direction cons to string + * @param {constant} 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 ''; +} +/** + * @private + * Pan + * Recognized when the pointer is down and moved in the allowed direction. + * @constructor + * @extends AttrRecognizer + */ + + +var PanRecognizer = +/*#__PURE__*/ +function (_AttrRecognizer) { + _inheritsLoose(PanRecognizer, _AttrRecognizer); + + function PanRecognizer(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + _this = _AttrRecognizer.call(this, _extends({ + event: 'pan', + threshold: 10, + pointers: 1, + direction: DIRECTION_ALL + }, options)) || this; + _this.pX = null; + _this.pY = null; + return _this; + } + + var _proto = PanRecognizer.prototype; + + _proto.getTouchAction = function getTouchAction() { + 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; + }; + + _proto.directionTest = function directionTest(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; + }; + + _proto.attrTest = function attrTest(input) { + return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call + this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input)); + }; + + _proto.emit = function emit(input) { + this.pX = input.deltaX; + this.pY = input.deltaY; + var direction = directionStr(input.direction); + + if (direction) { + input.additionalEvent = this.options.event + direction; + } + + _AttrRecognizer.prototype.emit.call(this, input); + }; + + return PanRecognizer; +}(AttrRecognizer); +/** + * @private + * Swipe + * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction. + * @constructor + * @extends AttrRecognizer + */ + + +var SwipeRecognizer = +/*#__PURE__*/ +function (_AttrRecognizer) { + _inheritsLoose(SwipeRecognizer, _AttrRecognizer); + + function SwipeRecognizer(options) { + if (options === void 0) { + options = {}; + } + + return _AttrRecognizer.call(this, _extends({ + event: 'swipe', + threshold: 10, + velocity: 0.3, + direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, + pointers: 1 + }, options)) || this; + } + + var _proto = SwipeRecognizer.prototype; + + _proto.getTouchAction = function getTouchAction() { + return PanRecognizer.prototype.getTouchAction.call(this); + }; + + _proto.attrTest = function attrTest(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 _AttrRecognizer.prototype.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; + }; + + _proto.emit = function emit(input) { + var direction = directionStr(input.offsetDirection); + + if (direction) { + this.manager.emit(this.options.event + direction, input); + } + + this.manager.emit(this.options.event, input); + }; + + return SwipeRecognizer; +}(AttrRecognizer); +/** + * @private + * Pinch + * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out). + * @constructor + * @extends AttrRecognizer + */ + + +var PinchRecognizer = +/*#__PURE__*/ +function (_AttrRecognizer) { + _inheritsLoose(PinchRecognizer, _AttrRecognizer); + + function PinchRecognizer(options) { + if (options === void 0) { + options = {}; + } + + return _AttrRecognizer.call(this, _extends({ + event: 'pinch', + threshold: 0, + pointers: 2 + }, options)) || this; + } + + var _proto = PinchRecognizer.prototype; + + _proto.getTouchAction = function getTouchAction() { + return [TOUCH_ACTION_NONE]; + }; + + _proto.attrTest = function attrTest(input) { + return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN); + }; + + _proto.emit = function emit(input) { + if (input.scale !== 1) { + var inOut = input.scale < 1 ? 'in' : 'out'; + input.additionalEvent = this.options.event + inOut; + } + + _AttrRecognizer.prototype.emit.call(this, input); + }; + + return PinchRecognizer; +}(AttrRecognizer); +/** + * @private + * Rotate + * Recognized when two or more pointer are moving in a circular motion. + * @constructor + * @extends AttrRecognizer + */ + + +var RotateRecognizer = +/*#__PURE__*/ +function (_AttrRecognizer) { + _inheritsLoose(RotateRecognizer, _AttrRecognizer); + + function RotateRecognizer(options) { + if (options === void 0) { + options = {}; + } + + return _AttrRecognizer.call(this, _extends({ + event: 'rotate', + threshold: 0, + pointers: 2 + }, options)) || this; + } + + var _proto = RotateRecognizer.prototype; + + _proto.getTouchAction = function getTouchAction() { + return [TOUCH_ACTION_NONE]; + }; + + _proto.attrTest = function attrTest(input) { + return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN); + }; + + return RotateRecognizer; +}(AttrRecognizer); +/** + * @private + * Press + * Recognized when the pointer is down for x ms without any movement. + * @constructor + * @extends Recognizer + */ + + +var PressRecognizer = +/*#__PURE__*/ +function (_Recognizer) { + _inheritsLoose(PressRecognizer, _Recognizer); + + function PressRecognizer(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + _this = _Recognizer.call(this, _extends({ + event: 'press', + pointers: 1, + time: 251, + // minimal time of the pointer to be pressed + threshold: 9 + }, options)) || this; + _this._timer = null; + _this._input = null; + return _this; + } + + var _proto = PressRecognizer.prototype; + + _proto.getTouchAction = function getTouchAction() { + return [TOUCH_ACTION_AUTO]; + }; + + _proto.process = function process(input) { + var _this2 = this; + + 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 = setTimeout(function () { + _this2.state = STATE_RECOGNIZED; + + _this2.tryEmit(); + }, options.time); + } else if (input.eventType & INPUT_END) { + return STATE_RECOGNIZED; + } + + return STATE_FAILED; + }; + + _proto.reset = function reset() { + clearTimeout(this._timer); + }; + + _proto.emit = function emit(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$3(); + this.manager.emit(this.options.event, this._input); + } + }; + + return PressRecognizer; +}(Recognizer); + +var defaults = { + /** + * @private + * 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, + + /** + * @private + * 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, + + /** + * @private + * @type {Boolean} + * @default true + */ + enable: true, + + /** + * @private + * 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, + + /** + * @private + * force an input class + * @type {Null|Function} + * @default null + */ + inputClass: null, + + /** + * @private + * 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: { + /** + * @private + * Disables text selection to improve the dragging gesture. Mainly for desktop browsers. + * @type {String} + * @default 'none' + */ + userSelect: "none", + + /** + * @private + * Disable the Windows Phone grippers when pressing an element. + * @type {String} + * @default 'none' + */ + touchSelect: "none", + + /** + * @private + * 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", + + /** + * @private + * Specifies whether zooming is enabled. Used by IE10> + * @type {String} + * @default 'none' + */ + contentZooming: "none", + + /** + * @private + * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers. + * @type {String} + * @default 'none' + */ + userDrag: "none", + + /** + * @private + * 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)" + } +}; +/** + * @private + * Default recognizer setup when calling `Hammer()` + * When creating a new Manager these will be skipped. + * This is separated with other defaults because of tree-shaking. + * @type {Array} + */ + +var preset = [[RotateRecognizer, { + enable: false +}], [PinchRecognizer, { + enable: false +}, ['rotate']], [SwipeRecognizer, { + direction: DIRECTION_HORIZONTAL +}], [PanRecognizer, { + direction: DIRECTION_HORIZONTAL +}, ['swipe']], [TapRecognizer], [TapRecognizer, { + event: 'doubletap', + taps: 2 +}, ['tap']], [PressRecognizer]]; +var STOP = 1; +var FORCED_STOP = 2; +/** + * @private + * 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; + } + + var prop; + each(manager.options.cssProps, function (value, name) { + prop = prefixed(element.style, name); + + if (add) { + manager.oldCssProps[prop] = element.style[prop]; + element.style[prop] = value; + } else { + element.style[prop] = manager.oldCssProps[prop] || ""; + } + }); + + if (!add) { + manager.oldCssProps = {}; + } +} +/** + * @private + * 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); +} +/** +* @private + * Manager + * @param {HTMLElement} element + * @param {Object} [options] + * @constructor + */ + + +var Manager = +/*#__PURE__*/ +function () { + function Manager(element, options) { + var _this = this; + + this.options = assign$1({}, defaults, options || {}); + this.options.inputTarget = this.options.inputTarget || element; + this.handlers = {}; + this.session = {}; + this.recognizers = []; + this.oldCssProps = {}; + 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); + } + /** + * @private + * set options + * @param {Object} options + * @returns {Manager} + */ + + + var _proto = Manager.prototype; + + _proto.set = function set(options) { + assign$1(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; + }; + /** + * @private + * 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] + */ + + + _proto.stop = function stop(force) { + this.session.stopped = force ? FORCED_STOP : STOP; + }; + /** + * @private + * 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 + */ + + + _proto.recognize = function recognize(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) { + session.curRecognizer = null; + 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)) { + session.curRecognizer = recognizer; + curRecognizer = recognizer; + } + + i++; + } + }; + /** + * @private + * get a recognizer by its event name. + * @param {Recognizer|String} recognizer + * @returns {Recognizer|Null} + */ + + + _proto.get = function get(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; + }; + /** + * @private add a recognizer to the manager + * existing recognizers with the same event name will be removed + * @param {Recognizer} recognizer + * @returns {Recognizer|Manager} + */ + + + _proto.add = function add(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; + }; + /** + * @private + * remove a recognizer by name or instance + * @param {Recognizer|String} recognizer + * @returns {Manager} + */ + + + _proto.remove = function remove(recognizer) { + if (invokeArrayArg(recognizer, "remove", this)) { + return this; + } + + var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists + + if (recognizer) { + var recognizers = this.recognizers; + var index = inArray(recognizers, targetRecognizer); + + if (index !== -1) { + recognizers.splice(index, 1); + this.touchAction.update(); + } + } + + return this; + }; + /** + * @private + * bind event + * @param {String} events + * @param {Function} handler + * @returns {EventEmitter} this + */ + + + _proto.on = function on(events, handler) { + if (events === undefined || handler === undefined) { + return this; + } + + var handlers = this.handlers; + each(splitStr(events), function (event) { + handlers[event] = handlers[event] || []; + handlers[event].push(handler); + }); + return this; + }; + /** + * @private unbind event, leave emit blank to remove all handlers + * @param {String} events + * @param {Function} [handler] + * @returns {EventEmitter} this + */ + + + _proto.off = function off(events, handler) { + if (events === undefined) { + return this; + } + + 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; + }; + /** + * @private emit event to the listeners + * @param {String} event + * @param {Object} data + */ + + + _proto.emit = function emit(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++; + } + }; + /** + * @private + * destroy the manager and unbinds all events + * it doesn't unbind dom events, that is the user own responsibility + */ + + + _proto.destroy = function destroy() { + this.element && toggleCssProps(this, false); + this.handlers = {}; + this.session = {}; + this.input.destroy(); + this.element = null; + }; + + return Manager; +}(); + +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'; +/** + * @private + * Touch events input + * @constructor + * @extends Input + */ + +var SingleTouchInput = +/*#__PURE__*/ +function (_Input) { + _inheritsLoose(SingleTouchInput, _Input); + + function SingleTouchInput() { + var _this; + + var proto = SingleTouchInput.prototype; + proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS; + proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS; + _this = _Input.apply(this, arguments) || this; + _this.started = false; + return _this; + } + + var _proto = SingleTouchInput.prototype; + + _proto.handler = function handler(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 + }); + }; + + return SingleTouchInput; +}(Input); + +function normalizeSingleTouches(ev, type) { + var all = toArray$1(ev.touches); + var changed = toArray$1(ev.changedTouches); + + if (type & (INPUT_END | INPUT_CANCEL)) { + all = uniqueArray(all.concat(changed), 'identifier', true); + } + + return [all, changed]; +} +/** + * @private + * 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.\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); + }; +} +/** + * @private + * extend object. + * means that properties in dest will be overwritten by the ones in src. + * @param {Object} dest + * @param {Object} src + * @param {Boolean} [merge=false] + * @returns {Object} dest + */ + + +var extend$1 = deprecate(function (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`.'); +/** + * @private + * 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 (dest, src) { + return extend$1(dest, src, true); +}, 'merge', 'Use `assign`.'); +/** + * @private + * simple class inheritance + * @param {Function} child + * @param {Function} base + * @param {Object} [properties] + */ + +function inherit(child, base, properties) { + var baseP = base.prototype; + var childP; + childP = child.prototype = Object.create(baseP); + childP.constructor = child; + childP._super = baseP; + + if (properties) { + assign$1(childP, properties); + } +} +/** + * @private + * simple function bind + * @param {Function} fn + * @param {Object} context + * @returns {Function} + */ + + +function bindFn(fn, context) { + return function boundFn() { + return fn.apply(context, arguments); + }; +} +/** + * @private + * Simple way to create a manager with a default set of recognizers. + * @param {HTMLElement} element + * @param {Object} [options] + * @constructor + */ + + +var Hammer = +/*#__PURE__*/ +function () { + var Hammer = + /** + * @private + * @const {string} + */ + function Hammer(element, options) { + if (options === void 0) { + options = {}; + } + + return new Manager(element, _extends({ + recognizers: preset.concat() + }, options)); + }; + + Hammer.VERSION = "2.0.17-rc"; + Hammer.DIRECTION_ALL = DIRECTION_ALL; + Hammer.DIRECTION_DOWN = DIRECTION_DOWN; + Hammer.DIRECTION_LEFT = DIRECTION_LEFT; + Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT; + Hammer.DIRECTION_UP = DIRECTION_UP; + Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL; + Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL; + Hammer.DIRECTION_NONE = DIRECTION_NONE; + Hammer.DIRECTION_DOWN = DIRECTION_DOWN; + Hammer.INPUT_START = INPUT_START; + Hammer.INPUT_MOVE = INPUT_MOVE; + Hammer.INPUT_END = INPUT_END; + Hammer.INPUT_CANCEL = INPUT_CANCEL; + Hammer.STATE_POSSIBLE = STATE_POSSIBLE; + Hammer.STATE_BEGAN = STATE_BEGAN; + Hammer.STATE_CHANGED = STATE_CHANGED; + Hammer.STATE_ENDED = STATE_ENDED; + Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED; + Hammer.STATE_CANCELLED = STATE_CANCELLED; + Hammer.STATE_FAILED = STATE_FAILED; + Hammer.Manager = Manager; + Hammer.Input = Input; + Hammer.TouchAction = TouchAction; + Hammer.TouchInput = TouchInput; + Hammer.MouseInput = MouseInput; + Hammer.PointerEventInput = PointerEventInput; + Hammer.TouchMouseInput = TouchMouseInput; + Hammer.SingleTouchInput = SingleTouchInput; + Hammer.Recognizer = Recognizer; + Hammer.AttrRecognizer = AttrRecognizer; + Hammer.Tap = TapRecognizer; + Hammer.Pan = PanRecognizer; + Hammer.Swipe = SwipeRecognizer; + Hammer.Pinch = PinchRecognizer; + Hammer.Rotate = RotateRecognizer; + Hammer.Press = PressRecognizer; + Hammer.on = addEventListeners; + Hammer.off = removeEventListeners; + Hammer.each = each; + Hammer.merge = merge; + Hammer.extend = extend$1; + Hammer.bindFn = bindFn; + Hammer.assign = assign$1; + Hammer.inherit = inherit; + Hammer.bindFn = bindFn; + Hammer.prefixed = prefixed; + Hammer.toArray = toArray$1; + Hammer.inArray = inArray; + Hammer.uniqueArray = uniqueArray; + Hammer.splitStr = splitStr; + Hammer.boolOrFn = boolOrFn; + Hammer.hasParent = hasParent$1; + Hammer.addEventListeners = addEventListeners; + Hammer.removeEventListeners = removeEventListeners; + Hammer.defaults = assign$1({}, defaults, { + preset: preset + }); + return Hammer; +}(); // style loader but by script tag, not by the loader. + +/** + * Setup a mock hammer.js object, for unit testing. + * + * Inspiration: https://github.com/uber/deck.gl/pull/658 + * + * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}} + */ + +function hammerMock() { + var noop = function noop() {}; + + return { + on: noop, + off: noop, + destroy: noop, + emit: noop, + get: function get(m) { + //eslint-disable-line no-unused-vars + return { + set: noop + }; + } + }; +} + +var modifiedHammer; + +if (typeof window !== 'undefined') { + var OurHammer = window['Hammer'] || Hammer; + modifiedHammer = propagating(OurHammer, { + preventDefault: 'mouse' + }); +} else { + modifiedHammer = function modifiedHammer() { + return (// hammer.js is only available in a browser, not in node.js. Replacing it with a mock object. + hammerMock() + ); + }; +} + +var Hammer$1 = modifiedHammer; + +/** + * Register a touch event, taking place before a gesture + * @param {Hammer} hammer A hammer instance + * @param {function} callback Callback, called as callback(event) + */ +function onTouch(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) + * @returns {*} + */ + +function onRelease(hammer, callback) { + callback.inputHandler = function (event) { + if (event.isFinal) { + callback(event); + } + }; + + return hammer.on('hammer.input', callback.inputHandler); +} +/** + * 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 + */ + +function disablePreventDefaultVertically(pinchRecognizer) { + var TOUCH_ACTION_PAN_Y = 'pan-y'; + + pinchRecognizer.getTouchAction = function () { + // default method returns [TOUCH_ACTION_NONE] + return [TOUCH_ACTION_PAN_Y]; + }; + + return pinchRecognizer; +} + +var trim$1 = stringTrim.trim; +var nativeParseInt = global_1.parseInt; +var hex = /^[+-]?0[Xx]/; +var FORCED$4 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; // `parseInt` method +// https://tc39.github.io/ecma262/#sec-parseint-string-radix + +var _parseInt = FORCED$4 ? function parseInt(string, radix) { + var S = trim$1(String(string)); + return nativeParseInt(S, radix >>> 0 || (hex.test(S) ? 16 : 10)); +} : nativeParseInt; + +// https://tc39.github.io/ecma262/#sec-parseint-string-radix + +_export({ + global: true, + forced: parseInt != _parseInt +}, { + parseInt: _parseInt +}); + +var _parseInt$1 = path.parseInt; + +var _parseInt$2 = _parseInt$1; + +var _parseInt$3 = _parseInt$2; + +/** + * 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 + * + */ + +var TimeStep = +/*#__PURE__*/ +function () { + /** + * @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 + * @param {Date|Array.} [hiddenDates] Optional. + * @param {{showMajorLabels: boolean}} [options] Optional. + * @constructor TimeStep + */ + function TimeStep(start, end, minimumStep, hiddenDates, options) { + classCallCheck$1(this, TimeStep); + + this.moment = options && options.moment || moment$3; // 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 (isArray$3(hiddenDates)) { + this.hiddenDates = hiddenDates; + } else if (hiddenDates != undefined) { + this.hiddenDates = [hiddenDates]; + } else { + this.hiddenDates = []; + } + + this.format = TimeStep.FORMAT; // default formatting + + this.options = options ? options : {}; + } + /** + * Set custom constructor function for moment. Can be used to set dates + * to UTC or to set a utcOffset. + * @param {function} moment + */ + + + createClass$1(TimeStep, [{ + key: "setMoment", + value: function setMoment(moment) { + this.moment = moment; // update the date properties, can have a new utcOffset + + this.current = this.moment(this.current.valueOf()); + this._start = this.moment(this._start.valueOf()); + this._end = this.moment(this._end.valueOf()); + } + /** + * 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', 'week', 'month', 'year'. + * @param {{minorLabels: Object, majorLabels: Object}} format + */ + + }, { + key: "setFormat", + value: function setFormat(format) { + var defaultFormat = util$2.deepExtend({}, TimeStep.FORMAT); + this.format = util$2.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 + */ + + }, { + key: "setRange", + value: function setRange(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()) : now$2(); + this._end = end != undefined ? this.moment(end.valueOf()) : now$2(); + + if (this.autoScale) { + this.setMinimumStep(minimumStep); + } + } + /** + * Set the range iterator to the start date. + */ + + }, { + key: "start", + value: function start() { + 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 + */ + + }, { + key: "roundToMinor", + value: function roundToMinor() { + // round to floor + // to prevent year & month scales rounding down to the first day of week we perform this separately + if (this.scale == 'week') { + this.current.weekday(0); + } // 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); + // eslint-disable-line no-fallthrough + + case 'week': // eslint-disable-line no-fallthrough + + case 'day': // eslint-disable-line no-fallthrough + + case 'weekday': + this.current.hours(0); + // eslint-disable-line no-fallthrough + + case 'hour': + this.current.minutes(0); + // eslint-disable-line no-fallthrough + + case 'minute': + this.current.seconds(0); + // eslint-disable-line no-fallthrough + + case 'second': + this.current.milliseconds(0); + // eslint-disable-line no-fallthrough + //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 + var priorCurrent = this.current.clone(); + + 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 'week': + this.current.subtract(this.current.week() % this.step, 'week'); + 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; + } + + if (!priorCurrent.isSame(this.current)) { + this.current = this.moment(snapAwayFromHidden(this.hiddenDates, this.current.valueOf(), -1, true)); + } + } + } + /** + * Check if the there is a next step + * @return {boolean} true if the current date has not passed the end date + */ + + }, { + key: "hasNext", + value: function hasNext() { + return this.current.valueOf() <= this._end.valueOf(); + } + /** + * Do the next step + */ + + }, { + key: "next", + value: function next() { + var prev = this.current.valueOf(); // Two cases, needed to prevent issues with switching daylight savings + // (end of March and end of October) + + 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'); + + if (this.current.month() < 6) { + this.current.subtract(this.current.hours() % this.step, 'hour'); + } else { + if (this.current.hours() % this.step !== 0) { + this.current.add(this.step - this.current.hours() % this.step, 'hour'); + } + } + + break; + + case 'weekday': // intentional fall through + + case 'day': + this.current.add(this.step, 'day'); + break; + + case 'week': + if (this.current.weekday() !== 0) { + // we had a month break not correlating with a week's start before + this.current.weekday(0); // switch back to week cycles + + this.current.add(this.step, 'week'); + } else if (this.options.showMajorLabels === false) { + this.current.add(this.step, 'week'); // the default case + } else { + // first day of the week + var nextWeek = this.current.clone(); + nextWeek.add(1, 'week'); + + if (nextWeek.isSame(this.current, 'month')) { + // is the first day of the next week in the same month? + this.current.add(this.step, 'week'); // the default case + } else { + // inject a step at each first day of the month + this.current.add(this.step, 'week'); + this.current.date(1); + } + } + + 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() > 0 && this.current.milliseconds() < this.step) this.current.milliseconds(0); + break; + + case 'second': + if (this.current.seconds() > 0 && this.current.seconds() < this.step) this.current.seconds(0); + break; + + case 'minute': + if (this.current.minutes() > 0 && this.current.minutes() < this.step) this.current.minutes(0); + break; + + case 'hour': + if (this.current.hours() > 0 && 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 'week': + if (this.current.week() < this.step) this.current.week(1); + break; + // week numbering starts at 1, not 0 + + 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(); + } // Reset switches for year, month and day. Will get set to true where appropriate in DateUtil.stepOverHiddenDates + + + this.switchedDay = false; + this.switchedMonth = false; + this.switchedYear = false; + stepOverHiddenDates(this.moment, this, prev); + } + /** + * Get the current datetime + * @return {Moment} current The current date + */ + + }, { + key: "getCurrent", + value: function getCurrent() { + return this.current.clone(); + } + /** + * 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', 'week', 'month', 'year'. + * - A number 'step'. A step size, by default 1. + * Choose for example 1, 2, 5, or 10. + */ + + }, { + key: "setScale", + value: function setScale(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 + */ + + }, { + key: "setAutoScale", + value: function setAutoScale(enable) { + this.autoScale = enable; + } + /** + * Automatically determine the scale that bests fits the provided minimum step + * @param {number} [minimumStep] The minimum step size in milliseconds + */ + + }, { + key: "setMinimumStep", + value: function setMinimumStep(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 * 7 > minimumStep) { + this.scale = 'week'; + this.step = 1; + } + + 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', 'week', 'month', 'year'. + * @param {number} step Current step (1, 2, 4, 5, ... + * @return {Date} snappedDate + */ + + }, { + key: "isMajor", + + /** + * 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. + */ + value: function isMajor() { + if (this.switchedYear == true) { + switch (this.scale) { + case 'year': + case 'month': + case 'week': + case 'weekday': + case 'day': + case 'hour': + case 'minute': + case 'second': + case 'millisecond': + return true; + + default: + return false; + } + } else if (this.switchedMonth == true) { + switch (this.scale) { + case 'week': + case 'weekday': + case 'day': + case 'hour': + case 'minute': + case 'second': + case 'millisecond': + return true; + + default: + return false; + } + } else if (this.switchedDay == true) { + 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 'week': + 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=this.current] custom date. if not provided, current date is taken + * @returns {String} + */ + + }, { + key: "getLabelMinor", + value: function getLabelMinor(date) { + if (date == undefined) { + date = this.current; + } + + if (date instanceof Date) { + date = this.moment(date); + } + + if (typeof this.format.minorLabels === "function") { + return this.format.minorLabels(date, this.scale, this.step); + } + + var format = this.format.minorLabels[this.scale]; // noinspection FallThroughInSwitchStatementJS + + switch (this.scale) { + case 'week': + // Don't draw the minor label if this date is the first day of a month AND if it's NOT the start of the week. + // The 'date' variable may actually be the 'next' step when called from TimeAxis' _repaintLabels. + if (date.date() === 1 && date.weekday() !== 0) { + return ""; + } + + default: + // eslint-disable-line no-fallthrough + 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=this.current] custom date. if not provided, current date is taken + * @returns {String} + */ + + }, { + key: "getLabelMajor", + value: function getLabelMajor(date) { + if (date == undefined) { + date = this.current; + } + + if (date instanceof Date) { + date = this.moment(date); + } + + if (typeof this.format.majorLabels === "function") { + return this.format.majorLabels(date, this.scale, this.step); + } + + var format = this.format.majorLabels[this.scale]; + return format && format.length > 0 ? this.moment(date).format(format) : ''; + } + /** + * get class name + * @return {string} class name + */ + + }, { + key: "getClassName", + value: function getClassName() { + var _context; + + 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; + var classNames = []; + /** + * + * @param {number} value + * @returns {String} + */ + + function even(value) { + return value / step % 2 == 0 ? ' vis-even' : ' vis-odd'; + } + /** + * + * @param {Date} date + * @returns {String} + */ + + + function today(date) { + if (date.isSame(now$2(), '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 ''; + } + /** + * + * @param {Date} date + * @returns {String} + */ + + + function currentWeek(date) { + return date.isSame(now$2(), 'week') ? ' vis-current-week' : ''; + } + /** + * + * @param {Date} date + * @returns {String} + */ + + + function currentMonth(date) { + return date.isSame(now$2(), 'month') ? ' vis-current-month' : ''; + } + /** + * + * @param {Date} date + * @returns {String} + */ + + + function currentYear(date) { + return date.isSame(now$2(), 'year') ? ' vis-current-year' : ''; + } + + switch (this.scale) { + case 'millisecond': + classNames.push(today(current)); + classNames.push(even(current.milliseconds())); + break; + + case 'second': + classNames.push(today(current)); + classNames.push(even(current.seconds())); + break; + + case 'minute': + classNames.push(today(current)); + classNames.push(even(current.minutes())); + break; + + case 'hour': + classNames.push(concat$2(_context = "vis-h".concat(current.hours())).call(_context, this.step == 4 ? '-h' + (current.hours() + 4) : '')); + classNames.push(today(current)); + classNames.push(even(current.hours())); + break; + + case 'weekday': + classNames.push("vis-".concat(current.format('dddd').toLowerCase())); + classNames.push(today(current)); + classNames.push(currentWeek(current)); + classNames.push(even(current.date())); + break; + + case 'day': + classNames.push("vis-day".concat(current.date())); + classNames.push("vis-".concat(current.format('MMMM').toLowerCase())); + classNames.push(today(current)); + classNames.push(currentMonth(current)); + classNames.push(this.step <= 2 ? today(current) : ''); + classNames.push(this.step <= 2 ? "vis-".concat(current.format('dddd').toLowerCase()) : ''); + classNames.push(even(current.date() - 1)); + break; + + case 'week': + classNames.push("vis-week".concat(current.format('w'))); + classNames.push(currentWeek(current)); + classNames.push(even(current.week())); + break; + + case 'month': + classNames.push("vis-".concat(current.format('MMMM').toLowerCase())); + classNames.push(currentMonth(current)); + classNames.push(even(current.month())); + break; + + case 'year': + classNames.push("vis-year".concat(current.year())); + classNames.push(currentYear(current)); + classNames.push(even(current.year())); + break; + } + + return filter$2(classNames).call(classNames, String).join(" "); + } + }], [{ + key: "snap", + value: function snap(date, scale, step) { + var clone = moment$3(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 == 'week') { + if (clone.weekday() > 2) { + // doing it the momentjs locale aware way + clone.weekday(0); + clone.add(1, 'week'); + } else { + clone.weekday(0); + } + + 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; + } + }]); + + return TimeStep; +}(); // Time formatting + + +TimeStep.FORMAT = { + minorLabels: { + millisecond: 'SSS', + second: 's', + minute: 'HH:mm', + hour: 'HH:mm', + weekday: 'ddd D', + day: 'D', + week: 'w', + 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', + week: 'MMMM YYYY', + month: 'YYYY', + year: '' + } +}; + +/** A horizontal time axis */ + +var TimeAxis = +/*#__PURE__*/ +function (_Component) { + inherits$1(TimeAxis, _Component); + + /** + * @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) { + var _this; + + classCallCheck$1(this, TimeAxis); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(TimeAxis).call(this)); + _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$3, + timeAxis: null + }; + _this.options = util$2.extend({}, _this.defaultOptions); + _this.body = body; // create the HTML DOM + + _this._create(); + + _this.setOptions(options); + + return _this; + } + /** + * Set options for the TimeAxis. + * Parameters will be merged in current options. + * @param {Object} options Available options: + * {string} [orientation.axis] + * {boolean} [showMinorLabels] + * {boolean} [showMajorLabels] + */ + + + createClass$1(TimeAxis, [{ + key: "setOptions", + value: function setOptions(options) { + if (options) { + // copy all options that we know + util$2.selectiveExtend(['showMinorLabels', 'showMajorLabels', 'maxMinorChars', 'hiddenDates', 'timeAxis', 'moment', 'rtl'], this.options, options); // deep copy the format options + + util$2.selectiveDeepExtend(['format'], this.options, options); + + if ('orientation' in options) { + if (typeof options.orientation === 'string') { + this.options.orientation.axis = options.orientation; + } else if (_typeof_1$2(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$3.locale === 'function') { + // moment.js 2.8.1+ + moment$3.locale(options.locale); + } else { + moment$3.lang(options.locale); + } + } + } + } + /** + * Create the HTML DOM for the TimeAxis + */ + + }, { + key: "_create", + value: function _create() { + 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 + */ + + }, { + key: "destroy", + value: function destroy() { + // 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 + */ + + }, { + key: "redraw", + value: function redraw() { + 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 = "".concat(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 + */ + + }, { + key: "_repaintLabels", + value: function _repaintLabels() { + var orientation = this.options.orientation.axis; // calculate range and step (step such that we have space for 7 characters per label) + + var start = util$2.convert(this.body.range.start, 'Number'); + var end = util$2.convert(this.body.range.end, 'Number'); + var timeLabelsize = this.body.util.toTime((this.props.minorCharWidth || 10) * this.options.maxMinorChars).valueOf(); + var minimumStep = timeLabelsize - 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, this.options); + 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; + var showMinorGrid; + var width = 0; + var prevWidth; + var line; + 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(); + current = next; + x = xNext; + step.next(); + next = step.getCurrent(); + xNext = this.body.util.toScreen(next); + prevWidth = width; + width = xNext - x; + + switch (step.scale) { + case 'week': + showMinorGrid = true; + break; + + default: + showMinorGrid = width >= prevWidth * 0.4; + break; + // prevent displaying of the 31th of the month on a scale of 5 days + } + + if (this.options.showMinorLabels && showMinorGrid) { + var label = this._repaintMinorText(x, step.getLabelMinor(current), orientation, className); + + label.style.width = "".concat(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(current), 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 = "".concat(_parseInt$3(line.style.width) + width, "px"); + } + } + } + } + + if (count === MAX && !warnedForOverflow) { + console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to ".concat(MAX, " lines.")); + warnedForOverflow = true; + } // create a major label on the left when needed + + + if (this.options.showMajorLabels) { + var leftTime = this.body.util.toTime(0); // upper bound estimation + + var leftText = step.getLabelMajor(leftTime); + var widthText = leftText.length * (this.props.majorCharWidth || 10) + 10; + + if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) { + this._repaintMajorText(0, leftText, orientation, className); + } + } // Cleanup leftover DOM elements from the redundant list + + + forEach$3(util$2).call(util$2, 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 + */ + + }, { + key: "_repaintMinorText", + value: function _repaintMinorText(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.innerHTML = text; + var y = orientation == 'top' ? this.props.majorLabelHeight : 0; + + this._setXY(label, x, y); + + label.className = "vis-text vis-minor ".concat(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 + */ + + }, { + key: "_repaintMajorText", + value: function _repaintMajorText(x, text, orientation, className) { + // reuse redundant label + var label = this.dom.redundant.majorTexts.shift(); + + if (!label) { + // create label + var content = document.createElement('div'); + label = document.createElement('div'); + label.appendChild(content); + this.dom.foreground.appendChild(label); + } + + label.childNodes[0].innerHTML = text; + label.className = "vis-text vis-major ".concat(className); //label.title = title; // TODO: this is a heavy operation + + var y = orientation == 'top' ? 0 : this.props.minorLabelHeight; + + this._setXY(label, x, y); + + this.dom.majorTexts.push(label); + return label; + } + /** + * sets xy + * @param {string} label + * @param {number} x + * @param {number} y + * @private + */ + + }, { + key: "_setXY", + value: function _setXY(label, x, y) { + var _context; + + // If rtl is true, inverse x. + var directionX = this.options.rtl ? x * -1 : x; + label.style.transform = concat$2(_context = "translate(".concat(directionX, "px, ")).call(_context, y, "px)"); + } + /** + * Create a minor line for the axis at position x + * @param {number} left + * @param {number} width + * @param {string} orientation "top" or "bottom" (default) + * @param {string} className + * @return {Element} Returns the created line + * @private + */ + + }, { + key: "_repaintMinorLine", + value: function _repaintMinorLine(left, width, orientation, className) { + var _context2; + + // 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; + line.style.width = "".concat(width, "px"); + line.style.height = "".concat(props.minorLineHeight, "px"); + var y = orientation == 'top' ? props.majorLabelHeight : this.body.domProps.top.height; + var x = left - props.minorLineWidth / 2; + + this._setXY(line, x, y); + + line.className = concat$2(_context2 = "vis-grid ".concat(this.options.rtl ? 'vis-vertical-rtl' : 'vis-vertical', " vis-minor ")).call(_context2, className); + return line; + } + /** + * Create a Major line for the axis at position x + * @param {number} left + * @param {number} width + * @param {string} orientation "top" or "bottom" (default) + * @param {string} className + * @return {Element} Returns the created line + * @private + */ + + }, { + key: "_repaintMajorLine", + value: function _repaintMajorLine(left, width, orientation, className) { + var _context3; + + // 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; + line.style.width = "".concat(width, "px"); + line.style.height = "".concat(props.majorLineHeight, "px"); + var y = orientation == 'top' ? 0 : this.body.domProps.top.height; + var x = left - props.majorLineWidth / 2; + + this._setXY(line, x, y); + + line.className = concat$2(_context3 = "vis-grid ".concat(this.options.rtl ? 'vis-vertical-rtl' : 'vis-vertical', " vis-major ")).call(_context3, className); + 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 + */ + + }, { + key: "_calculateCharSize", + value: function _calculateCharSize() { + // 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; + } + }]); + + return TimeAxis; +}(Component); + +var warnedForOverflow = false; + +var keycharm = createCommonjsModule$2(function (module, exports) { + /** + * 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) { + { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } + })(commonjsGlobal$2, 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; + }); +}); + +/** + * 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 Activator + */ + +function Activator(container) { + var _context, _context2; + + 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$1(this.dom.overlay); + this.hammer.on('tap', bind$2(_context = this._onTapOverlay).call(_context, this)); // block all touch events (except tap) + + var me = this; + var events = ['tap', 'doubletap', 'press', 'pinch', 'pan', 'panstart', 'panmove', 'panend']; + + forEach$3(events).call(events, 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 = bind$2(_context2 = this.deactivate).call(_context2, this); +} // turn into an event emitter + + +emitterComponent(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); + } // remove keycharm + + + if (this.keycharm !== undefined) { + this.keycharm.destroy(); + } + + this.keycharm = null; // 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 () { + var _context3; + + // 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$2.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 + + bind$2(_context3 = this.keycharm).call(_context3, '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$2.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} event The 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; +} + +var it = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + var it = moment.defineLocale('it', { + months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), + monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), + weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), + weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), + weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[Oggi alle] LT', + nextDay: '[Domani alle] LT', + nextWeek: 'dddd [alle] LT', + lastDay: '[Ieri alle] LT', + lastWeek: function () { + switch (this.day()) { + case 0: + return '[la scorsa] dddd [alle] LT'; + + default: + return '[lo scorso] dddd [alle] LT'; + } + }, + sameElse: 'L' + }, + relativeTime: { + future: function (s) { + return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s; + }, + past: '%s fa', + s: 'alcuni secondi', + ss: '%d secondi', + m: 'un minuto', + mm: '%d minuti', + h: 'un\'ora', + hh: '%d ore', + d: 'un giorno', + dd: '%d giorni', + M: 'un mese', + MM: '%d mesi', + y: 'un anno', + yy: '%d anni' + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 1, + // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + + } + }); + return it; + }); +}); + +var nl = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), + monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); + var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i]; + var monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + var nl = moment.defineLocale('nl', { + months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), + monthsShort: function (m, format) { + if (!m) { + return monthsShortWithDots; + } else if (/-MMM-/.test(format)) { + return monthsShortWithoutDots[m.month()]; + } else { + return monthsShortWithDots[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, + monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), + weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), + weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD-MM-YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[vandaag om] LT', + nextDay: '[morgen om] LT', + nextWeek: 'dddd [om] LT', + lastDay: '[gisteren om] LT', + lastWeek: '[afgelopen] dddd [om] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'over %s', + past: '%s geleden', + s: 'een paar seconden', + ss: '%d seconden', + m: 'één minuut', + mm: '%d minuten', + h: 'één uur', + hh: '%d uur', + d: 'één dag', + dd: '%d dagen', + M: 'één maand', + MM: '%d maanden', + y: 'één jaar', + yy: '%d jaar' + }, + dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, + ordinal: function (number) { + return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de'); + }, + week: { + dow: 1, + // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + + } + }); + return nl; + }); +}); + +var de = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + function processRelativeTime(number, withoutSuffix, key, isFuture) { + var format = { + 'm': ['eine Minute', 'einer Minute'], + 'h': ['eine Stunde', 'einer Stunde'], + 'd': ['ein Tag', 'einem Tag'], + 'dd': [number + ' Tage', number + ' Tagen'], + 'M': ['ein Monat', 'einem Monat'], + 'MM': [number + ' Monate', number + ' Monaten'], + 'y': ['ein Jahr', 'einem Jahr'], + 'yy': [number + ' Jahre', number + ' Jahren'] + }; + return withoutSuffix ? format[key][0] : format[key][1]; + } + + var de = moment.defineLocale('de', { + months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), + monthsParseExact: true, + weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), + weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), + weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd, D. MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[heute um] LT [Uhr]', + sameElse: 'L', + nextDay: '[morgen um] LT [Uhr]', + nextWeek: 'dddd [um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', + lastWeek: '[letzten] dddd [um] LT [Uhr]' + }, + relativeTime: { + future: 'in %s', + past: 'vor %s', + s: 'ein paar Sekunden', + ss: '%d Sekunden', + m: processRelativeTime, + mm: '%d Minuten', + h: processRelativeTime, + hh: '%d Stunden', + d: processRelativeTime, + dd: processRelativeTime, + M: processRelativeTime, + MM: processRelativeTime, + y: processRelativeTime, + yy: processRelativeTime + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + + } + }); + return de; + }); +}); + +var fr = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + var fr = moment.defineLocale('fr', { + months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + monthsParseExact: true, + weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[Aujourd’hui à] LT', + nextDay: '[Demain à] LT', + nextWeek: 'dddd [à] LT', + lastDay: '[Hier à] LT', + lastWeek: 'dddd [dernier à] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'dans %s', + past: 'il y a %s', + s: 'quelques secondes', + ss: '%d secondes', + m: 'une minute', + mm: '%d minutes', + h: 'une heure', + hh: '%d heures', + d: 'un jour', + dd: '%d jours', + M: 'un mois', + MM: '%d mois', + y: 'un an', + yy: '%d ans' + }, + dayOfMonthOrdinalParse: /\d{1,2}(er|)/, + ordinal: function (number, period) { + switch (period) { + // TODO: Return 'e' when day of month > 1. Move this case inside + // block for masculine words below. + // See https://github.com/moment/moment/issues/3375 + case 'D': + return number + (number === 1 ? 'er' : ''); + // Words with masculine grammatical gender: mois, trimestre, jour + + default: + case 'M': + case 'Q': + case 'DDD': + case 'd': + return number + (number === 1 ? 'er' : 'e'); + // Words with feminine grammatical gender: semaine + + case 'w': + case 'W': + return number + (number === 1 ? 're' : 'e'); + } + }, + week: { + dow: 1, + // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + + } + }); + return fr; + }); +}); + +var es = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); + var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]; + var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; + var es = moment.defineLocale('es', { + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + monthsShort: function (m, format) { + if (!m) { + return monthsShortDot; + } else if (/-MMM-/.test(format)) { + return monthsShort[m.month()]; + } else { + return monthsShortDot[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, + monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm' + }, + calendar: { + sameDay: function () { + return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextDay: function () { + return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextWeek: function () { + return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastDay: function () { + return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastWeek: function () { + return '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + sameElse: 'L' + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + ss: '%d segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 1, + // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + + } + }); + return es; + }); +}); + +var uk = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + function plural(word, num) { + var forms = word.split('_'); + return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; + } + + function relativeTimeWithPlural(number, withoutSuffix, key) { + var format = { + 'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд', + 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', + 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', + 'dd': 'день_дні_днів', + 'MM': 'місяць_місяці_місяців', + 'yy': 'рік_роки_років' + }; + + if (key === 'm') { + return withoutSuffix ? 'хвилина' : 'хвилину'; + } else if (key === 'h') { + return withoutSuffix ? 'година' : 'годину'; + } else { + return number + ' ' + plural(format[key], +number); + } + } + + function weekdaysCaseReplace(m, format) { + var weekdays = { + 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), + 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), + 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') + }; + + if (m === true) { + return weekdays['nominative'].slice(1, 7).concat(weekdays['nominative'].slice(0, 1)); + } + + if (!m) { + return weekdays['nominative']; + } + + var nounCase = /(\[[ВвУу]\]) ?dddd/.test(format) ? 'accusative' : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format) ? 'genitive' : 'nominative'; + return weekdays[nounCase][m.day()]; + } + + function processHoursFunction(str) { + return function () { + return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; + }; + } + + var uk = moment.defineLocale('uk', { + months: { + 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), + 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') + }, + monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), + weekdays: weekdaysCaseReplace, + weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY р.', + LLL: 'D MMMM YYYY р., HH:mm', + LLLL: 'dddd, D MMMM YYYY р., HH:mm' + }, + calendar: { + sameDay: processHoursFunction('[Сьогодні '), + nextDay: processHoursFunction('[Завтра '), + lastDay: processHoursFunction('[Вчора '), + nextWeek: processHoursFunction('[У] dddd ['), + lastWeek: function () { + switch (this.day()) { + case 0: + case 3: + case 5: + case 6: + return processHoursFunction('[Минулої] dddd [').call(this); + + case 1: + case 2: + case 4: + return processHoursFunction('[Минулого] dddd [').call(this); + } + }, + sameElse: 'L' + }, + relativeTime: { + future: 'за %s', + past: '%s тому', + s: 'декілька секунд', + ss: relativeTimeWithPlural, + m: relativeTimeWithPlural, + mm: relativeTimeWithPlural, + h: 'годину', + hh: relativeTimeWithPlural, + d: 'день', + dd: relativeTimeWithPlural, + M: 'місяць', + MM: relativeTimeWithPlural, + y: 'рік', + yy: relativeTimeWithPlural + }, + // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason + meridiemParse: /ночі|ранку|дня|вечора/, + isPM: function (input) { + return /^(дня|вечора)$/.test(input); + }, + meridiem: function (hour, minute, isLower) { + if (hour < 4) { + return 'ночі'; + } else if (hour < 12) { + return 'ранку'; + } else if (hour < 17) { + return 'дня'; + } else { + return 'вечора'; + } + }, + dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/, + ordinal: function (number, period) { + switch (period) { + case 'M': + case 'd': + case 'DDD': + case 'w': + case 'W': + return number + '-й'; + + case 'D': + return number + '-го'; + + default: + return number; + } + }, + week: { + dow: 1, + // Monday is the first day of the week. + doy: 7 // The week that contains Jan 7th is the first week of the year. + + } + }); + return uk; + }); +}); + +var ru = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + function plural(word, num) { + var forms = word.split('_'); + return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; + } + + function relativeTimeWithPlural(number, withoutSuffix, key) { + var format = { + 'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд', + 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', + 'hh': 'час_часа_часов', + 'dd': 'день_дня_дней', + 'MM': 'месяц_месяца_месяцев', + 'yy': 'год_года_лет' + }; + + if (key === 'm') { + return withoutSuffix ? 'минута' : 'минуту'; + } else { + return number + ' ' + plural(format[key], +number); + } + } + + var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; // http://new.gramota.ru/spravka/rules/139-prop : § 103 + // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637 + // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753 + + var ru = moment.defineLocale('ru', { + months: { + format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), + standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') + }, + monthsShort: { + // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ? + format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'), + standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_') + }, + weekdays: { + standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), + isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ + }, + weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки + monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, + // копия предыдущего + monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, + // полные названия с падежами + monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i, + // Выражение, которое соотвествует только сокращённым формам + monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i, + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY г.', + LLL: 'D MMMM YYYY г., H:mm', + LLLL: 'dddd, D MMMM YYYY г., H:mm' + }, + calendar: { + sameDay: '[Сегодня, в] LT', + nextDay: '[Завтра, в] LT', + lastDay: '[Вчера, в] LT', + nextWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В следующее] dddd, [в] LT'; + + case 1: + case 2: + case 4: + return '[В следующий] dddd, [в] LT'; + + case 3: + case 5: + case 6: + return '[В следующую] dddd, [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd, [в] LT'; + } else { + return '[В] dddd, [в] LT'; + } + } + }, + lastWeek: function (now) { + if (now.week() !== this.week()) { + switch (this.day()) { + case 0: + return '[В прошлое] dddd, [в] LT'; + + case 1: + case 2: + case 4: + return '[В прошлый] dddd, [в] LT'; + + case 3: + case 5: + case 6: + return '[В прошлую] dddd, [в] LT'; + } + } else { + if (this.day() === 2) { + return '[Во] dddd, [в] LT'; + } else { + return '[В] dddd, [в] LT'; + } + } + }, + sameElse: 'L' + }, + relativeTime: { + future: 'через %s', + past: '%s назад', + s: 'несколько секунд', + ss: relativeTimeWithPlural, + m: relativeTimeWithPlural, + mm: relativeTimeWithPlural, + h: 'час', + hh: relativeTimeWithPlural, + d: 'день', + dd: relativeTimeWithPlural, + M: 'месяц', + MM: relativeTimeWithPlural, + y: 'год', + yy: relativeTimeWithPlural + }, + meridiemParse: /ночи|утра|дня|вечера/i, + isPM: function (input) { + return /^(дня|вечера)$/.test(input); + }, + meridiem: function (hour, minute, isLower) { + if (hour < 4) { + return 'ночи'; + } else if (hour < 12) { + return 'утра'; + } else if (hour < 17) { + return 'дня'; + } else { + return 'вечера'; + } + }, + dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/, + ordinal: function (number, period) { + switch (period) { + case 'M': + case 'd': + case 'DDD': + return number + '-й'; + + case 'D': + return number + '-го'; + + case 'w': + case 'W': + return number + '-я'; + + default: + return number; + } + }, + week: { + dow: 1, + // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + + } + }); + return ru; + }); +}); + +var ja = createCommonjsModule$2(function (module, exports) { + + (function (global, factory) { + typeof commonjsRequire$2 === 'function' ? factory(moment$2) : factory(global.moment); + })(commonjsGlobal$2, function (moment) { + + var ja = moment.defineLocale('ja', { + months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), + monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), + weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), + weekdaysShort: '日_月_火_水_木_金_土'.split('_'), + weekdaysMin: '日_月_火_水_木_金_土'.split('_'), + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY/MM/DD', + LL: 'YYYY年M月D日', + LLL: 'YYYY年M月D日 HH:mm', + LLLL: 'YYYY年M月D日 dddd HH:mm', + l: 'YYYY/MM/DD', + ll: 'YYYY年M月D日', + lll: 'YYYY年M月D日 HH:mm', + llll: 'YYYY年M月D日(ddd) HH:mm' + }, + meridiemParse: /午前|午後/i, + isPM: function (input) { + return input === '午後'; + }, + meridiem: function (hour, minute, isLower) { + if (hour < 12) { + return '午前'; + } else { + return '午後'; + } + }, + calendar: { + sameDay: '[今日] LT', + nextDay: '[明日] LT', + nextWeek: function (now) { + if (now.week() < this.week()) { + return '[来週]dddd LT'; + } else { + return 'dddd LT'; + } + }, + lastDay: '[昨日] LT', + lastWeek: function (now) { + if (this.week() < now.week()) { + return '[先週]dddd LT'; + } else { + return 'dddd LT'; + } + }, + sameElse: 'L' + }, + dayOfMonthOrdinalParse: /\d{1,2}日/, + ordinal: function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + + default: + return number; + } + }, + relativeTime: { + future: '%s後', + past: '%s前', + s: '数秒', + ss: '%d秒', + m: '1分', + mm: '%d分', + h: '1時間', + hh: '%d時間', + d: '1日', + dd: '%d日', + M: '1ヶ月', + MM: '%dヶ月', + y: '1年', + yy: '%d年' + } + }); + return ja; + }); +}); + +// English +var en = { + current: 'current', + time: 'time', + deleteSelected: 'Delete selected' +}; +var en_EN = en; +var en_US = en; // Italiano +var it$1 = { + current: 'attuale', + time: 'tempo', + deleteSelected: 'Cancella la selezione' +}; +var it_IT = it$1; +var it_CH = it$1; // Dutch +var nl$1 = { + current: 'huidige', + time: 'tijd', + deleteSelected: 'Selectie verwijderen' +}; +var nl_NL = nl$1; +var nl_BE = nl$1; // German +var de$1 = { + current: 'Aktuelle', + time: 'Zeit', + deleteSelected: "L\xF6sche Auswahl" +}; +var de_DE = de$1; // French +var fr$1 = { + current: 'actuel', + time: 'heure', + deleteSelected: 'Effacer la selection' +}; +var fr_FR = fr$1; +var fr_CA = fr$1; +var fr_BE = fr$1; // Espanol +var es$1 = { + current: 'corriente', + time: 'hora', + deleteSelected: "Eliminar selecci\xF3n" +}; +var es_ES = es$1; // Ukrainian +var uk$1 = { + current: 'поточний', + time: 'час', + deleteSelected: 'Видалити обране' +}; +var uk_UA = uk$1; // Russian +var ru$1 = { + current: 'текущее', + time: 'время', + deleteSelected: 'Удалить выбранное' +}; +var ru_RU = ru$1; // Japanese +var ja$1 = { + current: '現在', + time: '時刻', + deleteSelected: '選択されたものを削除' +}; +var ja_JP = ja$1; +var locales = { + en: en, + en_EN: en_EN, + en_US: en_US, + it: it$1, + it_IT: it_IT, + it_CH: it_CH, + nl: nl$1, + nl_NL: nl_NL, + nl_BE: nl_BE, + de: de$1, + de_DE: de_DE, + fr: fr$1, + fr_FR: fr_FR, + fr_CA: fr_CA, + fr_BE: fr_BE, + es: es$1, + es_ES: es_ES, + uk: uk$1, + uk_UA: uk_UA, + ru: ru$1, + ru_RU: ru_RU, + ja: ja$1, + ja_JP: ja_JP +}; + +/** A custom time bar */ + +var CustomTime = +/*#__PURE__*/ +function (_Component) { + inherits$1(CustomTime, _Component); + + /** + * @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) { + var _context; + + var _this; + + classCallCheck$1(this, CustomTime); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(CustomTime).call(this)); + _this.body = body; // default options + + _this.defaultOptions = { + moment: moment$3, + locales: locales, + locale: 'en', + id: undefined, + title: undefined + }; + _this.options = util$2.extend({}, _this.defaultOptions); + + _this.setOptions(options); + + _this.options.locales = util$2.extend({}, locales, _this.options.locales); + var defaultLocales = _this.defaultOptions.locales[_this.defaultOptions.locale]; + + forEach$3(_context = keys$3(_this.options.locales)).call(_context, function (locale) { + _this.options.locales[locale] = util$2.extend({}, defaultLocales, _this.options.locales[locale]); + }); + + if (options && options.time) { + _this.customTime = options.time; + } else { + _this.customTime = new Date(); + } + + _this.eventParams = {}; // stores state parameters while dragging the bar + // create the DOM + + _this._create(); + + return _this; + } + /** + * Set options for the component. Options will be merged in current options. + * @param {Object} options Available parameters: + * {number | string} id + * {string} locales + * {string} locale + */ + + + createClass$1(CustomTime, [{ + key: "setOptions", + value: function setOptions(options) { + if (options) { + // copy all options that we know + util$2.selectiveExtend(['moment', 'locale', 'locales', 'id', 'title', 'rtl'], this.options, options); + } + } + /** + * Create the DOM for the custom time + * @private + */ + + }, { + key: "_create", + value: function _create() { + var _context2, _context3, _context4; + + var bar = document.createElement('div'); + bar['custom-time'] = this; + bar.className = "vis-custom-time ".concat(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'; + + if (this.options.rtl) { + drag.style.right = '-10px'; + } else { + drag.style.left = '-10px'; + } + + drag.style.height = '100%'; + drag.style.width = '20px'; + /** + * + * @param {WheelEvent} e + */ + + function onMouseWheel(e) { + this.body.range._onMouseWheel(e); + } + + if (drag.addEventListener) { + // IE9, Chrome, Safari, Opera + drag.addEventListener("mousewheel", bind$2(onMouseWheel).call(onMouseWheel, this), false); // Firefox + + drag.addEventListener("DOMMouseScroll", bind$2(onMouseWheel).call(onMouseWheel, this), false); + } else { + // IE 6/7/8 + drag.attachEvent("onmousewheel", bind$2(onMouseWheel).call(onMouseWheel, this)); + } + + bar.appendChild(drag); // attach event listeners + + this.hammer = new Hammer$1(drag); + this.hammer.on('panstart', bind$2(_context2 = this._onDragStart).call(_context2, this)); + this.hammer.on('panmove', bind$2(_context3 = this._onDrag).call(_context3, this)); + this.hammer.on('panend', bind$2(_context4 = this._onDragEnd).call(_context4, this)); + this.hammer.get('pan').set({ + threshold: 5, + direction: Hammer$1.DIRECTION_ALL + }); + } + /** + * Destroy the CustomTime bar + */ + + }, { + key: "destroy", + value: function destroy() { + this.hide(); + this.hammer.destroy(); + this.hammer = null; + this.body = null; + } + /** + * Repaint the component + * @return {boolean} Returns true if the component is resized + */ + + }, { + key: "redraw", + value: function redraw() { + 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.warn("WARNING: options.locales['".concat(this.options.locale, "'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#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) { + var _context5; + + title = concat$2(_context5 = "".concat(locale.time, ": ")).call(_context5, this.options.moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss')); + title = title.charAt(0).toUpperCase() + title.substring(1); + } else if (typeof title === "function") { + title = title.call(this.customTime); + } + + this.options.rtl ? this.bar.style.right = "".concat(x, "px") : this.bar.style.left = "".concat(x, "px"); + this.bar.title = title; + return false; + } + /** + * Remove the CustomTime from the DOM + */ + + }, { + key: "hide", + value: function hide() { + // remove the line from the DOM + if (this.bar.parentNode) { + this.bar.parentNode.removeChild(this.bar); + } + } + /** + * Set custom time. + * @param {Date | number | string} time + */ + + }, { + key: "setCustomTime", + value: function setCustomTime(time) { + this.customTime = util$2.convert(time, 'Date'); + this.redraw(); + } + /** + * Retrieve the current custom time. + * @return {Date} customTime + */ + + }, { + key: "getCustomTime", + value: function getCustomTime() { + return new Date(this.customTime.valueOf()); + } + /** + * Set custom marker. + * @param {string} [title] Title of the custom marker + * @param {boolean} [editable] Make the custom marker editable. + */ + + }, { + key: "setCustomMarker", + value: function setCustomMarker(title, editable) { + var marker = document.createElement('div'); + marker.className = "vis-custom-time-marker"; + marker.innerHTML = title; + marker.style.position = 'absolute'; + + if (editable) { + var _context6, _context7; + + marker.setAttribute('contenteditable', 'true'); + marker.addEventListener('pointerdown', function () { + marker.focus(); + }); + marker.addEventListener('input', bind$2(_context6 = this._onMarkerChange).call(_context6, this)); // The editable div element has no change event, so here emulates the change event. + + marker.title = title; + marker.addEventListener('blur', bind$2(_context7 = function _context7(event) { + if (this.title != event.target.innerHTML) { + this._onMarkerChanged(event); + + this.title = event.target.innerHTML; + } + }).call(_context7, this)); + } + + this.bar.appendChild(marker); + } + /** + * Set custom title. + * @param {Date | number | string} title + */ + + }, { + key: "setCustomTitle", + value: function setCustomTitle(title) { + this.options.title = title; + } + /** + * Start moving horizontally + * @param {Event} event + * @private + */ + + }, { + key: "_onDragStart", + value: function _onDragStart(event) { + this.eventParams.dragging = true; + this.eventParams.customTime = this.customTime; + event.stopPropagation(); + } + /** + * Perform moving operating. + * @param {Event} event + * @private + */ + + }, { + key: "_onDrag", + value: function _onDrag(event) { + if (!this.eventParams.dragging) return; + var deltaX = this.options.rtl ? -1 * event.deltaX : event.deltaX; + var x = this.body.util.toScreen(this.eventParams.customTime) + 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: event + }); + event.stopPropagation(); + } + /** + * Stop moving operating. + * @param {Event} event + * @private + */ + + }, { + key: "_onDragEnd", + value: function _onDragEnd(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: event + }); + event.stopPropagation(); + } + /** + * Perform input operating. + * @param {Event} event + * @private + */ + + }, { + key: "_onMarkerChange", + value: function _onMarkerChange(event) { + this.body.emitter.emit('markerchange', { + id: this.options.id, + title: event.target.innerHTML, + event: event + }); + event.stopPropagation(); + } + /** + * Perform change operating. + * @param {Event} event + * @private + */ + + }, { + key: "_onMarkerChanged", + value: function _onMarkerChanged(event) { + this.body.emitter.emit('markerchanged', { + id: this.options.id, + title: event.target.innerHTML, + event: event + }); + 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 + */ + + }], [{ + key: "customTimeFromTarget", + value: function customTimeFromTarget(event) { + var target = event.target; + + while (target) { + if (target.hasOwnProperty('custom-time')) { + return target['custom-time']; + } + + target = target.parentNode; + } + + return null; + } + }]); + + return CustomTime; +}(Component); + +/** + * Create a timeline visualization + * @constructor Core + */ + +var Core = +/*#__PURE__*/ +function () { + function Core() { + classCallCheck$1(this, Core); + } + + createClass$1(Core, [{ + key: "_create", + + /** + * 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 + */ + value: function _create(container) { + var _this = this, + _context, + _context2, + _context3; + + this.dom = {}; + this.dom.container = container; + this.dom.container.style.position = 'relative'; + 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.rollingModeBtn = document.createElement('div'); + this.dom.loadingScreen = 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.rollingModeBtn.className = 'vis-rolling-mode-btn'; + this.dom.loadingScreen.className = 'vis-loading-screen'; + 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.root.appendChild(this.dom.rollingModeBtn); + 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); // 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.on('rangechange', function () { + if (_this.initialDrawDone === true) { + _this._redraw(); + } + }); + this.on('rangechanged', function () { + if (!_this.initialRangeChangeDone) { + _this.initialRangeChangeDone = true; + } + }); + this.on('touch', bind$2(_context = this._onTouch).call(_context, this)); + this.on('panmove', bind$2(_context2 = this._onDrag).call(_context2, this)); + var me = this; + this._origRedraw = bind$2(_context3 = this._redraw).call(_context3, this); + this._redraw = util$2.throttle(this._origRedraw); + this.on('_change', function (properties) { + if (me.itemSet && me.itemSet.initialItemSetDrawn && properties && properties.queue == true) { + me._redraw(); + } else { + me._origRedraw(); + } + }); // create event listeners for all interesting events, these events will be + // emitted via emitter + + this.hammer = new Hammer$1(this.dom.root); + var pinchRecognizer = this.hammer.get('pinch').set({ + enable: true + }); + pinchRecognizer && disablePreventDefaultVertically(pinchRecognizer); + this.hammer.get('pan').set({ + threshold: 5, + direction: Hammer$1.DIRECTION_ALL + }); + 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 + ]; + + forEach$3(events).call(events, 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) + + + onTouch(this.hammer, function (event) { + me.emit('touch', event); + }); // emulate a release event (emitted after a pan, pinch, tap, or press) + + onRelease(this.hammer, function (event) { + me.emit('release', event); + }); + /** + * + * @param {WheelEvent} event + */ + + function onMouseWheel(event) { + // Reasonable default wheel deltas + var LINE_HEIGHT = 40; + var PAGE_HEIGHT = 800; + + if (this.isActive()) { + this.emit('mousewheel', event); + } // deltaX and deltaY normalization from jquery.mousewheel.js + + + var deltaX = 0; + var deltaY = 0; // Old school scrollwheel delta + + if ('detail' in event) { + deltaY = event.detail * -1; + } + + if ('wheelDelta' in event) { + deltaY = event.wheelDelta; + } + + if ('wheelDeltaY' in event) { + deltaY = event.wheelDeltaY; + } + + if ('wheelDeltaX' in event) { + deltaX = event.wheelDeltaX * -1; + } // Firefox < 17 horizontal scrolling related to DOMMouseScroll event + + + if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) { + deltaX = deltaY * -1; + deltaY = 0; + } // New school wheel delta (wheel event) + + + if ('deltaY' in event) { + deltaY = event.deltaY * -1; + } + + if ('deltaX' in event) { + deltaX = event.deltaX; + } // Normalize deltas + + + if (event.deltaMode) { + if (event.deltaMode === 1) { + // delta in LINE units + deltaX *= LINE_HEIGHT; + deltaY *= LINE_HEIGHT; + } else { + // delta in PAGE units + deltaX *= LINE_HEIGHT; + deltaY *= PAGE_HEIGHT; + } + } // Prevent scrolling when zooming (no zoom key, or pressing zoom key) + + + if (this.options.preferZoom) { + if (!this.options.zoomKey || event[this.options.zoomKey]) return; + } else { + if (this.options.zoomKey && event[this.options.zoomKey]) return; + } // Don't preventDefault if you can't scroll + + + if (!this.options.verticalScroll && !this.options.horizontalScroll) return; + + if (this.options.verticalScroll && Math.abs(deltaY) >= Math.abs(deltaX)) { + var current = this.props.scrollTop; + var adjusted = current + deltaY; + + if (this.isActive()) { + var newScrollTop = this._setScrollTop(adjusted); + + if (newScrollTop !== current) { + this._redraw(); + + this.emit('scroll', event); // Prevent default actions caused by mouse wheel + // (else the page and timeline both scroll) + + event.preventDefault(); + } + } + } else if (this.options.horizontalScroll) { + var delta = Math.abs(deltaX) >= Math.abs(deltaY) ? deltaX : deltaY; // calculate a single scroll jump relative to the range scale + + var diff = delta / 120 * (this.range.end - this.range.start) / 20; // calculate new start and end + + var newStart = this.range.start + diff; + var newEnd = this.range.end + diff; + var options = { + animation: false, + byUser: true, + event: event + }; + this.range.setRange(newStart, newEnd, options); + event.preventDefault(); + } + } // Add modern wheel event listener + + + var wheelType = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel" + document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel" + // DOMMouseScroll - Older Firefox versions use "DOMMouseScroll" + // onmousewheel - All the use "onmousewheel" + this.dom.centerContainer.addEventListener ? "DOMMouseScroll" : "onmousewheel"; + this.dom.top.addEventListener ? "DOMMouseScroll" : "onmousewheel"; + this.dom.bottom.addEventListener ? "DOMMouseScroll" : "onmousewheel"; + this.dom.centerContainer.addEventListener(wheelType, bind$2(onMouseWheel).call(onMouseWheel, this), false); + this.dom.top.addEventListener(wheelType, bind$2(onMouseWheel).call(onMouseWheel, this), false); + this.dom.bottom.addEventListener(wheelType, bind$2(onMouseWheel).call(onMouseWheel, this), false); + /** + * + * @param {scroll} event + */ + + function onMouseScrollSide(event) { + if (!me.options.verticalScroll) return; + event.preventDefault(); + + if (me.isActive()) { + var adjusted = -event.target.scrollTop; + + me._setScrollTop(adjusted); + + me._redraw(); + + me.emit('scrollSide', event); + } + } + + this.dom.left.parentNode.addEventListener('scroll', bind$2(onMouseScrollSide).call(onMouseScrollSide, this)); + this.dom.right.parentNode.addEventListener('scroll', bind$2(onMouseScrollSide).call(onMouseScrollSide, this)); + var itemAddedToTimeline = false; + /** + * + * @param {dragover} event + * @returns {boolean} + */ + + function handleDragOver(event) { + var _context4; + + if (event.preventDefault) { + me.emit('dragover', me.getEventProperties(event)); + event.preventDefault(); // Necessary. Allows us to drop. + } // make sure your target is a timeline element + + + if (!(indexOf$3(_context4 = event.target.className).call(_context4, "timeline") > -1)) return; // make sure only one item is added every time you're over the timeline + + if (itemAddedToTimeline) return; + event.dataTransfer.dropEffect = 'move'; + itemAddedToTimeline = true; + return false; + } + /** + * + * @param {drop} event + * @returns {boolean} + */ + + + function handleDrop(event) { + // prevent redirect to blank page - Firefox + if (event.preventDefault) { + event.preventDefault(); + } + + if (event.stopPropagation) { + event.stopPropagation(); + } // return when dropping non-timeline items + + + try { + var itemData = JSON.parse(event.dataTransfer.getData("text")); + if (!itemData || !itemData.content) return; + } catch (err) { + return false; + } + + itemAddedToTimeline = false; + event.center = { + x: event.clientX, + y: event.clientY + }; + + if (itemData.target !== 'item') { + me.itemSet._onAddItem(event); + } else { + me.itemSet._onDropObjectOnItem(event); + } + + me.emit('drop', me.getEventProperties(event)); + return false; + } + + this.dom.center.addEventListener('dragover', bind$2(handleDragOver).call(handleDragOver, this), false); + this.dom.center.addEventListener('drop', bind$2(handleDrop).call(handleDrop, this), false); + this.customTimes = []; // store state information needed for touch events + + this.touch = {}; + this.redrawCount = 0; + this.initialDrawDone = false; + this.initialRangeChangeDone = false; // attach the root panel to the provided container + + if (!container) throw new Error('No container provided'); + container.appendChild(this.dom.root); + container.appendChild(this.dom.loadingScreen); + } + /** + * 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 + */ + + }, { + key: "setOptions", + value: function setOptions(options) { + var _context7; + + if (options) { + // copy the known options + var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', 'locale', 'locales', 'moment', 'preferZoom', 'rtl', 'zoomKey', 'horizontalScroll', 'verticalScroll']; + util$2.selectiveExtend(fields, this.options, options); + this.dom.rollingModeBtn.style.visibility = 'hidden'; + + if (this.options.rtl) { + this.dom.container.style.direction = "rtl"; + this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical-rtl'; + } + + if (this.options.verticalScroll) { + if (this.options.rtl) { + this.dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll'; + } else { + this.dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll'; + } + } + + if (_typeof_1$2(this.options.orientation) !== 'object') { + 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_1$2(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$2.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 _context5; + + var index = indexOf$3(_context5 = this.components).call(_context5, this.timeAxis2); + + if (index !== -1) { + var _context6; + + splice$2(_context6 = this.components).call(_context6, 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) { + 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; + } + } + } // enable/disable autoResize + + + this._initAutoResize(); + } // propagate options to all components + + + forEach$3(_context7 = this.components).call(_context7, function (component) { + return component.setOptions(options); + }); // enable/disable configure + + + if ('configure' in options) { + var _context8; + + 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$2.deepExtend({}, this.options); + + forEach$3(_context8 = this.components).call(_context8, function (component) { + util$2.deepExtend(appliedOptions, component.options); + }); + + this.configurator.setModuleOptions({ + global: appliedOptions + }); + } + + this._redraw(); + } + /** + * Returns true when the Timeline is active. + * @returns {boolean} + */ + + }, { + key: "isActive", + value: function isActive() { + return !this.activator || this.activator.active; + } + /** + * Destroy the Core, clean up all DOM elements and event listeners. + */ + + }, { + key: "destroy", + value: function destroy() { + var _context9; + + // 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 && this.hammer.destroy(); + this.hammer = null; // give all components the opportunity to cleanup + + forEach$3(_context9 = this.components).call(_context9, 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. + */ + + }, { + key: "setCustomTime", + value: function setCustomTime(time, id) { + var _context10; + + var customTimes = filter$2(_context10 = this.customTimes).call(_context10, function (component) { + return id === component.options.id; + }); + + if (customTimes.length === 0) { + throw new Error("No custom time bar found with id ".concat(stringify$2(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 + */ + + }, { + key: "getCustomTime", + value: function getCustomTime(id) { + var _context11; + + var customTimes = filter$2(_context11 = this.customTimes).call(_context11, function (component) { + return component.options.id === id; + }); + + if (customTimes.length === 0) { + throw new Error("No custom time bar found with id ".concat(stringify$2(id))); + } + + return customTimes[0].getCustomTime(); + } + /** + * Set a custom marker for the custom time bar. + * @param {string} [title] Title of the custom marker. + * @param {number} [id=undefined] Id of the custom marker. + * @param {boolean} [editable=false] Make the custom marker editable. + */ + + }, { + key: "setCustomTimeMarker", + value: function setCustomTimeMarker(title, id, editable) { + var _context12; + + var customTimes = filter$2(_context12 = this.customTimes).call(_context12, function (component) { + return component.options.id === id; + }); + + if (customTimes.length === 0) { + throw new Error("No custom time bar found with id ".concat(stringify$2(id))); + } + + if (customTimes.length > 0) { + customTimes[0].setCustomMarker(title, editable); + } + } + /** + * Set a custom title for the custom time bar. + * @param {string} [title] Custom title + * @param {number} [id=undefined] Id of the custom time bar. + * @returns {*} + */ + + }, { + key: "setCustomTimeTitle", + value: function setCustomTimeTitle(title, id) { + var _context13; + + var customTimes = filter$2(_context13 = this.customTimes).call(_context13, function (component) { + return component.options.id === id; + }); + + if (customTimes.length === 0) { + throw new Error("No custom time bar found with id ".concat(stringify$2(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. + */ + + }, { + key: "getEventProperties", + value: function getEventProperties(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 + */ + + }, { + key: "addCustomTime", + value: function addCustomTime(time, id) { + var _context14; + + var timestamp = time !== undefined ? util$2.convert(time, 'Date').valueOf() : new Date(); + + var exists = some$2(_context14 = this.customTimes).call(_context14, function (customTime) { + return customTime.options.id === id; + }); + + if (exists) { + throw new Error("A custom time with id ".concat(stringify$2(id), " already exists")); + } + + var customTime = new CustomTime(this.body, util$2.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 + * [at]returns {boolean} True if the bar exists and is removed, false otherwise + */ + + }, { + key: "removeCustomTime", + value: function removeCustomTime(id) { + var _context15, + _this2 = this; + + var customTimes = filter$2(_context15 = this.customTimes).call(_context15, function (bar) { + return bar.options.id === id; + }); + + if (customTimes.length === 0) { + throw new Error("No custom time bar found with id ".concat(stringify$2(id))); + } + + forEach$3(customTimes).call(customTimes, function (customTime) { + var _context16, _context17, _context18, _context19; + + splice$2(_context16 = _this2.customTimes).call(_context16, indexOf$3(_context17 = _this2.customTimes).call(_context17, customTime), 1); + + splice$2(_context18 = _this2.components).call(_context18, indexOf$3(_context19 = _this2.components).call(_context19, customTime), 1); + + customTime.destroy(); + }); + } + /** + * Get the id's of the currently visible items. + * @returns {Array} The ids of the visible items + */ + + }, { + key: "getVisibleItems", + value: function getVisibleItems() { + return this.itemSet && this.itemSet.getVisibleItems() || []; + } + /** + * Get the id's of the currently visible groups. + * @returns {Array} The ids of the visible groups + */ + + }, { + key: "getVisibleGroups", + value: function getVisibleGroups() { + return this.itemSet && this.itemSet.getVisibleGroups() || []; + } + /** + * 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'. + * @param {function} [callback] a callback funtion to be executed at the end of this function + */ + + }, { + key: "fit", + value: function fit(options, callback) { + 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: animation + }, callback); + } + /** + * Calculate the data range of the items start and end dates + * [at]returns {{min: [Date], max: [Date]}} + * @protected + */ + + }, { + key: "getDataRange", + value: function getDataRange() { + // 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'. + * @param {function} [callback] a callback funtion to be executed at the end of this function + */ + + }, { + key: "setWindow", + value: function setWindow(start, end, options, callback) { + if (typeof arguments[2] == "function") { + callback = arguments[2]; + options = {}; + } + + var animation; + var range; + + if (arguments.length == 1) { + range = arguments[0]; + animation = range.animation !== undefined ? range.animation : true; + this.range.setRange(range.start, range.end, { + animation: animation + }); + } else if (arguments.length == 2 && typeof arguments[1] == "function") { + range = arguments[0]; + callback = arguments[1]; + animation = range.animation !== undefined ? range.animation : true; + this.range.setRange(range.start, range.end, { + animation: animation + }, callback); + } else { + animation = options && options.animation !== undefined ? options.animation : true; + this.range.setRange(start, end, { + animation: animation + }, callback); + } + } + /** + * 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'. + * @param {function} [callback] a callback funtion to be executed at the end of this function + */ + + }, { + key: "moveTo", + value: function moveTo(time, options, callback) { + if (typeof arguments[1] == "function") { + callback = arguments[1]; + options = {}; + } + + var interval = this.range.end - this.range.start; + var t = util$2.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: animation + }, callback); + } + /** + * Get the visible window + * @return {{start: Date, end: Date}} Visible range + */ + + }, { + key: "getWindow", + value: function getWindow() { + var range = this.range.getRange(); + return { + start: new Date(range.start), + end: new Date(range.end) + }; + } + /** + * Zoom in the window such that given time is centered on screen. + * @param {number} percentage - must be between [0..1] + * @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'. + * @param {function} [callback] a callback funtion to be executed at the end of this function + */ + + }, { + key: "zoomIn", + value: function zoomIn(percentage, options, callback) { + if (!percentage || percentage < 0 || percentage > 1) return; + + if (typeof arguments[1] == "function") { + callback = arguments[1]; + options = {}; + } + + var range = this.getWindow(); + var start = range.start.valueOf(); + var end = range.end.valueOf(); + var interval = end - start; + var newInterval = interval / (1 + percentage); + var distance = (interval - newInterval) / 2; + var newStart = start + distance; + var newEnd = end - distance; + this.setWindow(newStart, newEnd, options, callback); + } + /** + * Zoom out the window such that given time is centered on screen. + * @param {number} percentage - must be between [0..1] + * @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'. + * @param {function} [callback] a callback funtion to be executed at the end of this function + */ + + }, { + key: "zoomOut", + value: function zoomOut(percentage, options, callback) { + if (!percentage || percentage < 0 || percentage > 1) return; + + if (typeof arguments[1] == "function") { + callback = arguments[1]; + options = {}; + } + + var range = this.getWindow(); + var start = range.start.valueOf(); + var end = range.end.valueOf(); + var interval = end - start; + var newStart = start - interval * percentage / 2; + var newEnd = end + interval * percentage / 2; + this.setWindow(newStart, newEnd, options, callback); + } + /** + * Force a redraw. Can be overridden by implementations of Core + * + * Note: this function will be overridden on construction with a trottled version + */ + + }, { + key: "redraw", + value: function redraw() { + this._redraw(); + } + /** + * Redraw for internal use. Redraws all components. See also the public + * method redraw. + * @protected + */ + + }, { + key: "_redraw", + value: function _redraw() { + var _context20; + + this.redrawCount++; + var dom = this.dom; + if (!dom || !dom.container || dom.root.offsetWidth == 0) return; // when destroyed, or invisible + + var resized = false; + var options = this.options; + var props = this.props; + updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates); // update class names + + if (options.orientation == 'top') { + util$2.addClassName(dom.root, 'vis-top'); + util$2.removeClassName(dom.root, 'vis-bottom'); + } else { + util$2.removeClassName(dom.root, 'vis-top'); + util$2.addClassName(dom.root, 'vis-bottom'); + } + + if (options.rtl) { + util$2.addClassName(dom.root, 'vis-rtl'); + util$2.removeClassName(dom.root, 'vis-ltr'); + } else { + util$2.addClassName(dom.root, 'vis-ltr'); + util$2.removeClassName(dom.root, 'vis-rtl'); + } // update root width and height options + + + dom.root.style.maxHeight = util$2.option.asSize(options.maxHeight, ''); + dom.root.style.minHeight = util$2.option.asSize(options.minHeight, ''); + dom.root.style.width = util$2.option.asSize(options.width, ''); + var rootOffsetWidth = dom.root.offsetWidth; // calculate border widths + + props.border.left = 1; + props.border.right = 1; + props.border.top = 1; + props.border.bottom = 1; // 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 + props.border.top + props.border.bottom; + dom.root.style.height = util$2.option.asSize(options.height, "".concat(autoHeight, "px")); // calculate heights of the content panels + + props.root.height = dom.root.offsetHeight; + props.background.height = props.root.height; + var containerHeight = props.root.height - props.top.height - props.bottom.height; + props.centerContainer.height = containerHeight; + props.leftContainer.height = containerHeight; + props.rightContainer.height = props.leftContainer.height; // calculate the widths of the panels + + props.root.width = rootOffsetWidth; + props.background.width = props.root.width; + + if (!this.initialDrawDone) { + props.scrollbarWidth = util$2.getScrollBarWidth(); + } + + var leftContainerClientWidth = dom.leftContainer.clientWidth; + var rightContainerClientWidth = dom.rightContainer.clientWidth; + + if (options.verticalScroll) { + if (options.rtl) { + props.left.width = leftContainerClientWidth || -props.border.left; + props.right.width = rightContainerClientWidth + props.scrollbarWidth || -props.border.right; + } else { + props.left.width = leftContainerClientWidth + props.scrollbarWidth || -props.border.left; + props.right.width = rightContainerClientWidth || -props.border.right; + } + } else { + props.left.width = leftContainerClientWidth || -props.border.left; + props.right.width = rightContainerClientWidth || -props.border.right; + } + + this._setDOM(); // 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 + + + var offset = this._updateScrollTop(); // reposition the scrollable contents + + + if (options.orientation.item != 'top') { + offset += Math.max(props.centerContainer.height - props.center.height - props.border.top - props.border.bottom, 0); + } + + dom.center.style.transform = "translateY(".concat(offset, "px)"); // show shadows when vertical scrolling is available + + var visibilityTop = props.scrollTop == 0 ? 'hidden' : ''; + var visibilityBottom = props.scrollTop == 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; + + if (options.verticalScroll) { + dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll'; + dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll'; + dom.shadowTopRight.style.visibility = "hidden"; + dom.shadowBottomRight.style.visibility = "hidden"; + dom.shadowTopLeft.style.visibility = "hidden"; + dom.shadowBottomLeft.style.visibility = "hidden"; + dom.left.style.top = '0px'; + dom.right.style.top = '0px'; + } + + if (!options.verticalScroll || props.center.height < props.centerContainer.height) { + dom.left.style.top = "".concat(offset, "px"); + dom.right.style.top = "".concat(offset, "px"); + dom.rightContainer.className = dom.rightContainer.className.replace(new RegExp('(?:^|\\s)' + 'vis-vertical-scroll' + '(?:\\s|$)'), ' '); + dom.leftContainer.className = dom.leftContainer.className.replace(new RegExp('(?:^|\\s)' + 'vis-vertical-scroll' + '(?:\\s|$)'), ' '); + props.left.width = leftContainerClientWidth || -props.border.left; + props.right.width = rightContainerClientWidth || -props.border.right; + + this._setDOM(); + } // enable/disable vertical panning + + + var contentsOverflow = props.center.height > props.centerContainer.height; + this.hammer.get('pan').set({ + direction: contentsOverflow ? Hammer$1.DIRECTION_ALL : Hammer$1.DIRECTION_HORIZONTAL + }); // redraw all components + + forEach$3(_context20 = this.components).call(_context20, 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; + } //Emit public 'changed' event for UI updates, see issue #1592 + + + this.body.emitter.emit("changed"); + } + /** + * sets the basic DOM components needed for the timeline\graph2d + */ + + }, { + key: "_setDOM", + value: function _setDOM() { + var props = this.props; + var dom = this.dom; + props.leftContainer.width = props.left.width; + props.rightContainer.width = props.right.width; + var centerWidth = props.root.width - props.left.width - props.right.width; + props.center.width = centerWidth; + props.centerContainer.width = centerWidth; + props.top.width = centerWidth; + props.bottom.width = centerWidth; // resize the panels + + dom.background.style.height = "".concat(props.background.height, "px"); + dom.backgroundVertical.style.height = "".concat(props.background.height, "px"); + dom.backgroundHorizontal.style.height = "".concat(props.centerContainer.height, "px"); + dom.centerContainer.style.height = "".concat(props.centerContainer.height, "px"); + dom.leftContainer.style.height = "".concat(props.leftContainer.height, "px"); + dom.rightContainer.style.height = "".concat(props.rightContainer.height, "px"); + dom.background.style.width = "".concat(props.background.width, "px"); + dom.backgroundVertical.style.width = "".concat(props.centerContainer.width, "px"); + dom.backgroundHorizontal.style.width = "".concat(props.background.width, "px"); + dom.centerContainer.style.width = "".concat(props.center.width, "px"); + dom.top.style.width = "".concat(props.top.width, "px"); + dom.bottom.style.width = "".concat(props.bottom.width, "px"); // reposition the panels + + dom.background.style.left = '0'; + dom.background.style.top = '0'; + dom.backgroundVertical.style.left = "".concat(props.left.width + props.border.left, "px"); + dom.backgroundVertical.style.top = '0'; + dom.backgroundHorizontal.style.left = '0'; + dom.backgroundHorizontal.style.top = "".concat(props.top.height, "px"); + dom.centerContainer.style.left = "".concat(props.left.width, "px"); + dom.centerContainer.style.top = "".concat(props.top.height, "px"); + dom.leftContainer.style.left = '0'; + dom.leftContainer.style.top = "".concat(props.top.height, "px"); + dom.rightContainer.style.left = "".concat(props.left.width + props.center.width, "px"); + dom.rightContainer.style.top = "".concat(props.top.height, "px"); + dom.top.style.left = "".concat(props.left.width, "px"); + dom.top.style.top = '0'; + dom.bottom.style.left = "".concat(props.left.width, "px"); + dom.bottom.style.top = "".concat(props.top.height + props.centerContainer.height, "px"); + dom.center.style.left = '0'; + dom.left.style.left = '0'; + dom.right.style.left = '0'; + } + /** + * 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. + */ + + }, { + key: "setCurrentTime", + value: function setCurrentTime(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. + */ + + }, { + key: "getCurrentTime", + value: function getCurrentTime() { + 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 + */ + + }, { + key: "_toTime", + value: function _toTime(x) { + return 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 + */ + + }, { + key: "_toGlobalTime", + value: function _toGlobalTime(x) { + return 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 + */ + + }, { + key: "_toScreen", + value: function _toScreen(time) { + return 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 + */ + + }, { + key: "_toGlobalScreen", + value: function _toGlobalScreen(time) { + return 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 + */ + + }, { + key: "_initAutoResize", + value: function _initAutoResize() { + 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 + */ + + }, { + key: "_startAutoResize", + value: function _startAutoResize() { + 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) { + var rootOffsetHeight = me.dom.root.offsetHeight; + var rootOffsetWidth = me.dom.root.offsetWidth; // 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 (rootOffsetWidth != me.props.lastWidth || rootOffsetHeight != me.props.lastHeight) { + me.props.lastWidth = rootOffsetWidth; + me.props.lastHeight = rootOffsetHeight; + me.props.scrollbarWidth = util$2.getScrollBarWidth(); + me.body.emitter.emit('_change'); + } + } + }; // add event listener to window resize + + + util$2.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$1(this._onResize, 1000); + } + /** + * Stop watching for a resize of the frame. + * @private + */ + + }, { + key: "_stopAutoResize", + value: function _stopAutoResize() { + if (this.watchTimer) { + clearInterval(this.watchTimer); + this.watchTimer = undefined; + } // remove event listener on window.resize + + + if (this._onResize) { + util$2.removeEventListener(window, 'resize', this._onResize); + this._onResize = null; + } + } + /** + * Start moving the timeline vertically + * @param {Event} event + * @private + */ + + }, { + key: "_onTouch", + value: function _onTouch(event) { + // eslint-disable-line no-unused-vars + this.touch.allowDragging = true; + this.touch.initialScrollTop = this.props.scrollTop; + } + /** + * Start moving the timeline vertically + * @param {Event} event + * @private + */ + + }, { + key: "_onPinch", + value: function _onPinch(event) { + // eslint-disable-line no-unused-vars + this.touch.allowDragging = false; + } + /** + * Move the timeline vertically + * @param {Event} event + * @private + */ + + }, { + key: "_onDrag", + value: function _onDrag(event) { + if (!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.touch.allowDragging) return; + var delta = event.deltaY; + + var oldScrollTop = this._getScrollTop(); + + var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta); + + if (this.options.verticalScroll) { + this.dom.left.parentNode.scrollTop = -this.props.scrollTop; + this.dom.right.parentNode.scrollTop = -this.props.scrollTop; + } + + if (newScrollTop != oldScrollTop) { + this.emit("verticalDrag"); + } + } + /** + * Apply a scrollTop + * @param {number} scrollTop + * @returns {number} scrollTop Returns the applied scrollTop + * @private + */ + + }, { + key: "_setScrollTop", + value: function _setScrollTop(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 + */ + + }, { + key: "_updateScrollTop", + value: function _updateScrollTop() { + // 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; + + if (this.options.verticalScroll) { + this.dom.left.parentNode.scrollTop = -this.props.scrollTop; + this.dom.right.parentNode.scrollTop = -this.props.scrollTop; + } + + return this.props.scrollTop; + } + /** + * Get the current scrollTop + * @returns {number} scrollTop + * @private + */ + + }, { + key: "_getScrollTop", + value: function _getScrollTop() { + return this.props.scrollTop; + } + /** + * Load a configurator + * [at]returns {Object} + * @private + */ + + }, { + key: "_createConfigurator", + value: function _createConfigurator() { + throw new Error('Cannot invoke abstract method _createConfigurator'); + } + }]); + + return Core; +}(); // turn Core into an event emitter + + +emitterComponent(Core.prototype); + +/** + * A current time bar + */ + +var CurrentTime = +/*#__PURE__*/ +function (_Component) { + inherits$1(CurrentTime, _Component); + + /** + * @param {{range: Range, dom: Object, domProps: Object}} body + * @param {Object} [options] Available parameters: + * {Boolean} [showCurrentTime] + * {String} [alignCurrentTime] + * @constructor CurrentTime + * @extends Component + */ + function CurrentTime(body, options) { + var _context; + + var _this; + + classCallCheck$1(this, CurrentTime); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(CurrentTime).call(this)); + _this.body = body; // default options + + _this.defaultOptions = { + rtl: false, + showCurrentTime: true, + alignCurrentTime: undefined, + moment: moment$3, + locales: locales, + locale: 'en' + }; + _this.options = util$2.extend({}, _this.defaultOptions); + + _this.setOptions(options); + + _this.options.locales = util$2.extend({}, locales, _this.options.locales); + var defaultLocales = _this.defaultOptions.locales[_this.defaultOptions.locale]; + + forEach$3(_context = keys$3(_this.options.locales)).call(_context, function (locale) { + _this.options.locales[locale] = util$2.extend({}, defaultLocales, _this.options.locales[locale]); + }); + + _this.offset = 0; + + _this._create(); + + return _this; + } + /** + * Create the HTML DOM for the current time bar + * @private + */ + + + createClass$1(CurrentTime, [{ + key: "_create", + value: function _create() { + 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 + */ + + }, { + key: "destroy", + value: function destroy() { + 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] + * {String} [alignCurrentTime] + */ + + }, { + key: "setOptions", + value: function setOptions(options) { + if (options) { + // copy all options that we know + util$2.selectiveExtend(['rtl', 'showCurrentTime', 'alignCurrentTime', 'moment', 'locale', 'locales'], this.options, options); + } + } + /** + * Repaint the component + * @return {boolean} Returns true if the component is resized + */ + + }, { + key: "redraw", + value: function redraw() { + if (this.options.showCurrentTime) { + var _context2, _context3; + + 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(now$2() + this.offset); + + if (this.options.alignCurrentTime) { + now = now.startOf(this.options.alignCurrentTime); + } + + var x = this.body.util.toScreen(now); + var locale = this.options.locales[this.options.locale]; + + if (!locale) { + if (!this.warned) { + console.warn("WARNING: options.locales['".concat(this.options.locale, "'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization")); + this.warned = true; + } + + locale = this.options.locales['en']; // fall back on english when not available + } + + var title = concat$2(_context2 = concat$2(_context3 = "".concat(locale.current, " ")).call(_context3, locale.time, ": ")).call(_context2, now.format('dddd, MMMM Do YYYY, H:mm:ss')); + + title = title.charAt(0).toUpperCase() + title.substring(1); + + if (this.options.rtl) { + this.bar.style.transform = "translateX(".concat(x * -1, "px)"); + } else { + this.bar.style.transform = "translateX(".concat(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 + */ + + }, { + key: "start", + value: function start() { + var me = this; + /** + * Updates the current time. + */ + + 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$2(update, interval); + } + + update(); + } + /** + * Stop auto refreshing the current time bar + */ + + }, { + key: "stop", + value: function stop() { + 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. + */ + + }, { + key: "setCurrentTime", + value: function setCurrentTime(time) { + var t = util$2.convert(time, 'Date').valueOf(); + + var now = now$2(); + + this.offset = t - now; + this.redraw(); + } + /** + * Get the current time. + * @return {Date} Returns the current time. + */ + + }, { + key: "getCurrentTime", + value: function getCurrentTime() { + return new Date(now$2() + this.offset); + } + }]); + + return CurrentTime; +}(Component); + +var freezing = !fails(function () { + return Object.isExtensible(Object.preventExtensions({})); +}); + +var internalMetadata = createCommonjsModule$2(function (module) { + var defineProperty = objectDefineProperty.f; + var METADATA = uid('meta'); + var id = 0; + + var isExtensible = Object.isExtensible || function () { + return true; + }; + + var setMetadata = function (it) { + defineProperty(it, METADATA, { + value: { + objectID: 'O' + ++id, + // object ID + weakData: {} // weak collections IDs + + } + }); + }; + + var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject$1(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; // not necessary to add metadata + + if (!create) return 'E'; // add missing metadata + + setMetadata(it); // return object ID + } + + return it[METADATA].objectID; + }; + + var getWeakData = function (it, create) { + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; // not necessary to add metadata + + if (!create) return false; // add missing metadata + + setMetadata(it); // return the store of weak collections IDs + } + + return it[METADATA].weakData; + }; // add metadata on freeze-family methods calling + + + var onFreeze = function (it) { + if (freezing && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); + return it; + }; + + var meta = module.exports = { + REQUIRED: false, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze + }; + hiddenKeys[METADATA] = true; +}); +var internalMetadata_1 = internalMetadata.REQUIRED; +var internalMetadata_2 = internalMetadata.fastKey; +var internalMetadata_3 = internalMetadata.getWeakData; +var internalMetadata_4 = internalMetadata.onFreeze; + +var ITERATOR$2 = wellKnownSymbol('iterator'); +var ArrayPrototype$7 = Array.prototype; // check on default Array iterator + +var isArrayIteratorMethod = function (it) { + return it !== undefined && (iterators.Array === it || ArrayPrototype$7[ITERATOR$2] === it); +}; + +var ITERATOR$3 = wellKnownSymbol('iterator'); + +var getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR$3] || it['@@iterator'] || iterators[classof(it)]; +}; + +var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); + throw error; + } +}; + +var iterate_1 = createCommonjsModule$2(function (module) { + var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; + }; + + var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { + var boundFunction = bindContext(fn, that, AS_ENTRIES ? 2 : 1); + var iterator, iterFn, index, length, result, step; + + if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); // optimisation for array iterators + + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = toLength(iterable.length); length > index; index++) { + result = AS_ENTRIES ? boundFunction(anObject(step = iterable[index])[0], step[1]) : boundFunction(iterable[index]); + if (result && result instanceof Result) return result; + } + + return new Result(false); + } + + iterator = iterFn.call(iterable); + } + + while (!(step = iterator.next()).done) { + result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); + if (result && result instanceof Result) return result; + } + + return new Result(false); + }; + + iterate.stop = function (result) { + return new Result(true, result); + }; +}); + +var anInstance = function (it, Constructor, name) { + if (!(it instanceof Constructor)) { + throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); + } + + return it; +}; + +var defineProperty$9 = objectDefineProperty.f; +var forEach$4 = arrayIteration.forEach; +var setInternalState$3 = internalState.set; +var internalStateGetterFor = internalState.getterFor; + +var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { + var NativeConstructor = global_1[CONSTRUCTOR_NAME]; + var NativePrototype = NativeConstructor && NativeConstructor.prototype; + var ADDER = IS_MAP ? 'set' : 'add'; + var exported = {}; + var Constructor; + + if (!descriptors || typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + }))) { + // create collection constructor + Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); + internalMetadata.REQUIRED = true; + } else { + Constructor = wrapper(function (target, iterable) { + setInternalState$3(anInstance(target, Constructor, CONSTRUCTOR_NAME), { + type: CONSTRUCTOR_NAME, + collection: new NativeConstructor() + }); + if (iterable != undefined) iterate_1(iterable, target[ADDER], target, IS_MAP); + }); + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + forEach$4(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) hide(Constructor.prototype, KEY, function (a, b) { + var collection = getInternalState(this).collection; + if (!IS_ADDER && IS_WEAK && !isObject$1(a)) return KEY == 'get' ? undefined : false; + var result = collection[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + IS_WEAK || defineProperty$9(Constructor.prototype, 'size', { + get: function () { + return getInternalState(this).collection.size; + } + }); + } + + setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true); + exported[CONSTRUCTOR_NAME] = Constructor; + _export({ + global: true, + forced: true + }, exported); + if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + return Constructor; +}; + +var redefineAll = function (target, src, options) { + for (var key in src) { + if (options && options.unsafe && target[key]) target[key] = src[key];else redefine(target, key, src[key], options); + } + + return target; +}; + +var SPECIES$2 = wellKnownSymbol('species'); + +var setSpecies = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = objectDefineProperty.f; + + if (descriptors && Constructor && !Constructor[SPECIES$2]) { + defineProperty(Constructor, SPECIES$2, { + configurable: true, + get: function () { + return this; + } + }); + } +}; + +var defineProperty$a = objectDefineProperty.f; +var fastKey = internalMetadata.fastKey; +var setInternalState$4 = internalState.set; +var internalStateGetterFor$1 = internalState.getterFor; +var collectionStrong = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState$4(that, { + type: CONSTRUCTOR_NAME, + index: objectCreate(null), + first: undefined, + last: undefined, + size: 0 + }); + if (!descriptors) that.size = 0; + if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP); + }); + var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, index; // change existing entry + + if (entry) { + entry.value = value; // create new entry + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: undefined, + removed: false + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (descriptors) state.size++;else that.size++; // add to index + + if (index !== 'F') state.index[index] = entry; + } + + return that; + }; + + var getEntry = function (that, key) { + var state = getInternalState(that); // fast case + + var index = fastKey(key); + var entry; + if (index !== 'F') return state.index[index]; // frozen object case + + for (entry = state.first; entry; entry = entry.next) { + if (entry.key == key) return entry; + } + }; + + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + var that = this; + var state = getInternalState(that); + var data = state.index; + var entry = state.first; + + while (entry) { + entry.removed = true; + if (entry.previous) entry.previous = entry.previous.next = undefined; + delete data[entry.index]; + entry = entry.next; + } + + state.first = state.last = undefined; + if (descriptors) state.size = 0;else that.size = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first == entry) state.first = next; + if (state.last == entry) state.last = prev; + if (descriptors) state.size--;else that.size--; + } + + return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn + /* , that = undefined */ + ) { + var state = getInternalState(this); + var boundFunction = bindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); // revert to the last existing entry + + while (entry && entry.removed) entry = entry.previous; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(this, key); + } + }); + redefineAll(C.prototype, IS_MAP ? { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } : { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (descriptors) defineProperty$a(C.prototype, 'size', { + get: function () { + return getInternalState(this).size; + } + }); + return C; + }, + setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; + var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME); // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + + defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) { + setInternalState$4(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined + }); + }, function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; // revert to the last existing entry + + while (entry && entry.removed) entry = entry.previous; // get next entry + + + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + // or finish the iteration + state.target = undefined; + return { + value: undefined, + done: true + }; + } // return step by kind + + + if (kind == 'keys') return { + value: entry.key, + done: false + }; + if (kind == 'values') return { + value: entry.value, + done: false + }; + return { + value: [entry.key, entry.value], + done: false + }; + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 + + setSpecies(CONSTRUCTOR_NAME); + } +}; + +// https://tc39.github.io/ecma262/#sec-set-objects + + +var es_set = collection('Set', function (get) { + return function Set() { + return get(this, arguments.length ? arguments[0] : undefined); + }; +}, collectionStrong); + +var set$1 = path.Set; + +var set$2 = set$1; + +var set$3 = set$2; + +var $map = arrayIteration.map; // `Array.prototype.map` method +// https://tc39.github.io/ecma262/#sec-array.prototype.map +// with adding support of @@species + +_export({ + target: 'Array', + proto: true, + forced: !arrayMethodHasSpeciesSupport('map') +}, { + map: function map(callbackfn + /* , thisArg */ + ) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var map = entryVirtual('Array').map; + +var ArrayPrototype$8 = Array.prototype; + +var map_1 = function (it) { + var own = it.map; + return it === ArrayPrototype$8 || it instanceof Array && own === ArrayPrototype$8.map ? map : own; +}; + +var map$1 = map_1; + +var map$2 = map$1; + +var create$3 = create; + +var create$4 = create$3; + +var $find = arrayIteration.find; +var FIND = 'find'; +var SKIPS_HOLES = true; // Shouldn't skip holes + +if (FIND in []) Array(1)[FIND](function () { + SKIPS_HOLES = false; +}); // `Array.prototype.find` method +// https://tc39.github.io/ecma262/#sec-array.prototype.find + +_export({ + target: 'Array', + proto: true, + forced: SKIPS_HOLES +}, { + find: function find(callbackfn + /* , that = undefined */ + ) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + +var find = entryVirtual('Array').find; + +var ArrayPrototype$9 = Array.prototype; + +var find_1 = function (it) { + var own = it.find; + return it === ArrayPrototype$9 || it instanceof Array && own === ArrayPrototype$9.find ? find : own; +}; + +var find$1 = find_1; + +var find$2 = find$1; + +var getIterator = function (it) { + var iteratorMethod = getIteratorMethod(it); + + if (typeof iteratorMethod != 'function') { + throw TypeError(String(it) + ' is not iterable'); + } + + return anObject(iteratorMethod.call(it)); +}; + +var getIterator$1 = getIterator; + +var getIterator$2 = getIterator$1; + +var isArray$4 = isArray$1; + +var isArray$5 = isArray$4; + +function _arrayWithoutHoles$2(arr) { + if (isArray$5(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } +} + +var arrayWithoutHoles$2 = _arrayWithoutHoles$2; + +// https://tc39.github.io/ecma262/#sec-array.from + + +var arrayFrom = function from(arrayLike +/* , mapfn = undefined, thisArg = undefined */ +) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iteratorMethod = getIteratorMethod(O); + var length, result, step, iterator; + if (mapping) mapfn = bindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case + + if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = iteratorMethod.call(O); + result = new C(); + + for (; !(step = iterator.next()).done; index++) { + createProperty(result, index, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + result = new C(length); + + for (; length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + + result.length = index; + return result; +}; + +var ITERATOR$4 = wellKnownSymbol('iterator'); +var SAFE_CLOSING = false; + +try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { + done: !!called++ + }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + + iteratorWithReturn[ITERATOR$4] = function () { + return this; + }; // eslint-disable-next-line no-throw-literal + + + Array.from(iteratorWithReturn, function () { + throw 2; + }); +} catch (error) { + /* empty */ +} + +var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + + try { + var object = {}; + + object[ITERATOR$4] = function () { + return { + next: function () { + return { + done: ITERATION_SUPPORT = true + }; + } + }; + }; + + exec(object); + } catch (error) { + /* empty */ + } + + return ITERATION_SUPPORT; +}; + +var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + Array.from(iterable); +}); // `Array.from` method +// https://tc39.github.io/ecma262/#sec-array.from + +_export({ + target: 'Array', + stat: true, + forced: INCORRECT_ITERATION +}, { + from: arrayFrom +}); + +var from_1 = path.Array.from; + +var from_1$1 = from_1; + +var from_1$2 = from_1$1; + +var ITERATOR$5 = wellKnownSymbol('iterator'); + +var isIterable = function (it) { + var O = Object(it); + return O[ITERATOR$5] !== undefined || '@@iterator' in O // eslint-disable-next-line no-prototype-builtins + || iterators.hasOwnProperty(classof(O)); +}; + +var isIterable$1 = isIterable; + +var isIterable$2 = isIterable$1; + +function _iterableToArray$2(iter) { + if (isIterable$2(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return from_1$2(iter); +} + +var iterableToArray$2 = _iterableToArray$2; + +function _nonIterableSpread$2() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); +} + +var nonIterableSpread$2 = _nonIterableSpread$2; + +function _toConsumableArray$2(arr) { + return arrayWithoutHoles$2(arr) || iterableToArray$2(arr) || nonIterableSpread$2(); +} + +var toConsumableArray$2 = _toConsumableArray$2; + +var nativeAssign = Object.assign; // `Object.assign` method +// https://tc39.github.io/ecma262/#sec-object.assign +// should work with symbols and should have deterministic property order (V8 bug) + +var objectAssign = !nativeAssign || fails(function () { + var A = {}; + var B = {}; // eslint-disable-next-line no-undef + + var symbol = Symbol(); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { + B[chr] = chr; + }); + return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; +}) ? function assign(target, source) { + // eslint-disable-line no-unused-vars + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; + var propertyIsEnumerable = objectPropertyIsEnumerable.f; + + while (argumentsLength > index) { + var S = indexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + + while (length > j) { + key = keys[j++]; + if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key]; + } + } + + return T; +} : nativeAssign; + +// https://tc39.github.io/ecma262/#sec-object.assign + +_export({ + target: 'Object', + stat: true, + forced: Object.assign !== objectAssign +}, { + assign: objectAssign +}); + +var assign$2 = path.Object.assign; + +var assign$3 = assign$2; + +var assign$4 = assign$3; + +var $includes = arrayIncludes.includes; // `Array.prototype.includes` method +// https://tc39.github.io/ecma262/#sec-array.prototype.includes + +_export({ + target: 'Array', + proto: true +}, { + includes: function includes(el + /* , fromIndex = 0 */ + ) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + +var includes = entryVirtual('Array').includes; + +var MATCH = wellKnownSymbol('match'); // `IsRegExp` abstract operation +// https://tc39.github.io/ecma262/#sec-isregexp + +var isRegexp = function (it) { + var isRegExp; + return isObject$1(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp'); +}; + +var notARegexp = function (it) { + if (isRegexp(it)) { + throw TypeError("The method doesn't accept regular expressions"); + } + + return it; +}; + +var MATCH$1 = wellKnownSymbol('match'); + +var correctIsRegexpLogic = function (METHOD_NAME) { + var regexp = /./; + + try { + '/./'[METHOD_NAME](regexp); + } catch (e) { + try { + regexp[MATCH$1] = false; + return '/./'[METHOD_NAME](regexp); + } catch (f) { + /* empty */ + } + } + + return false; +}; + +// https://tc39.github.io/ecma262/#sec-string.prototype.includes + + +_export({ + target: 'String', + proto: true, + forced: !correctIsRegexpLogic('includes') +}, { + includes: function includes(searchString + /* , position = 0 */ + ) { + return !!~String(requireObjectCoercible(this)).indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var includes$1 = entryVirtual('String').includes; + +var ArrayPrototype$a = Array.prototype; +var StringPrototype$1 = String.prototype; + +var includes$2 = function (it) { + var own = it.includes; + if (it === ArrayPrototype$a || it instanceof Array && own === ArrayPrototype$a.includes) return includes; + + if (typeof it === 'string' || it === StringPrototype$1 || it instanceof String && own === StringPrototype$1.includes) { + return includes$1; + } + + return own; +}; + +var includes$3 = includes$2; + +var includes$4 = includes$3; + +var SPECIES$3 = wellKnownSymbol('species'); +var nativeSlice = [].slice; +var max$2 = Math.max; // `Array.prototype.slice` method +// https://tc39.github.io/ecma262/#sec-array.prototype.slice +// fallback for not array-like ES3 strings and DOM objects + +_export({ + target: 'Array', + proto: true, + forced: !arrayMethodHasSpeciesSupport('slice') +}, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + + var Constructor, result, n; + + if (isArray(O)) { + Constructor = O.constructor; // cross-realm fallback + + if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject$1(Constructor)) { + Constructor = Constructor[SPECIES$3]; + if (Constructor === null) Constructor = undefined; + } + + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + + result = new (Constructor === undefined ? Array : Constructor)(max$2(fin - k, 0)); + + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + + result.length = n; + return result; + } +}); + +var slice$2 = entryVirtual('Array').slice; + +var ArrayPrototype$b = Array.prototype; + +var slice_1 = function (it) { + var own = it.slice; + return it === ArrayPrototype$b || it instanceof Array && own === ArrayPrototype$b.slice ? slice$2 : own; +}; + +var slice$3 = slice_1; + +var slice$4 = slice$3; + +// 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 + */ + +function orderByStart(items) { + sort$2(items).call(items, 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 + */ + +function orderByEnd(items) { + sort$2(items).call(items, function (a, b) { + var aTime = 'end' in a.data ? a.data.end : a.data.start; + var 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 + * @param {function} shouldBailItemsRedrawFunction + * bailing function + * @return {boolean} shouldBail + */ + +function stack(items, margin, force, shouldBailItemsRedrawFunction) { + if (force) { + // reset top position of all items + for (var i = 0; i < items.length; i++) { + items[i].top = null; + } + } // calculate new, non-overlapping positions + + + for (var i = 0; i < items.length; i++) { + // eslint-disable-line no-redeclare + var item = items[i]; + + if (item.stack && item.top === null) { + // initialize top position + item.top = margin.axis; + var shouldBail = false; + + 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]; + shouldBail = shouldBailItemsRedrawFunction() || false; + + if (shouldBail) { + return true; + } + + if (other.top !== null && other !== item && other.stack && 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); + } + } + + return shouldBail; +} +/** + * Adjust vertical positions of the items within a single subgroup such that they + * don't overlap each other. + * @param {Item[]} items + * All items withina subgroup + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin + * Margins between items and between items and the axis. + * @param {subgroup} subgroup + * The subgroup that is being stacked + */ + +function substack(items, margin, subgroup) { + for (var i = 0; i < items.length; i++) { + items[i].top = null; + } // Set the initial height + + + var subgroupHeight = subgroup.height; // calculate new, non-overlapping positions + + for (i = 0; i < items.length; i++) { + var item = items[i]; + + if (item.stack && item.top === null) { + // initialize top position + item.top = item.baseTop; //margin.axis + item.baseTop; + + 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*/ + && 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; // + item.baseTop; + } + + if (item.top + item.height > subgroupHeight) { + subgroupHeight = item.top + item.height; + } + } while (collidingItem); + } + } // Set the new height + + + subgroup.height = subgroupHeight - subgroup.top + 0.5 * margin.item.vertical; +} +/** + * 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. + * @param {subgroups[]} subgroups + * All subgroups + * @param {boolean} isStackSubgroups + */ + +function nostack(items, margin, subgroups, isStackSubgroups) { + for (var i = 0; i < items.length; i++) { + if (items[i].data.subgroup == undefined) { + items[i].top = margin.item.vertical; + } else if (items[i].data.subgroup !== undefined && isStackSubgroups) { + var newTop = 0; + + 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; + subgroups[items[i].data.subgroup].top = newTop; + } + } + } + + items[i].top = newTop + 0.5 * margin.item.vertical; + } + } + + if (!isStackSubgroups) { + stackSubgroups(items, margin, subgroups); + } +} +/** + * Adjust vertical positions of the subgroups such that they don't overlap each + * other. + * @param {Array.} items + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin Margins between items and between items and the axis. + * @param {subgroups[]} subgroups + * All subgroups + */ + +function stackSubgroups(items, margin, subgroups) { + for (var subgroup in subgroups) { + if (subgroups.hasOwnProperty(subgroup)) { + subgroups[subgroup].top = 0; + + 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 otherSubgroup in subgroups) { + if (subgroups[otherSubgroup].top !== null && otherSubgroup !== subgroup && subgroups[subgroup].index > subgroups[otherSubgroup].index && collisionByTimes(subgroups[subgroup], subgroups[otherSubgroup])) { + collidingItem = subgroups[otherSubgroup]; + break; + } + } + + if (collidingItem != null) { + // There is a collision. Reposition the subgroups above the colliding element + subgroups[subgroup].top = collidingItem.top + collidingItem.height; + } + } while (collidingItem); + } + } + + for (var i = 0; i < items.length; i++) { + if (items[i].data.subgroup !== undefined) { + items[i].top = subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical; + } + } +} +/** + * Adjust vertical positions of the subgroups such that they don't overlap each + * other, then stacks the contents of each subgroup individually. + * @param {Item[]} subgroupItems + * All the items in a subgroup + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin + * Margins between items and between items and the axis. + * @param {subgroups[]} subgroups + * All subgroups + */ + +function stackSubgroupsWithInnerStack(subgroupItems, margin, subgroups) { + var doSubStack = false; // Run subgroups in their order (if any) + + var subgroupOrder = []; + + for (var subgroup in subgroups) { + if (subgroups[subgroup].hasOwnProperty("index")) { + subgroupOrder[subgroups[subgroup].index] = subgroup; + } else { + subgroupOrder.push(subgroup); + } + } + + for (var j = 0; j < subgroupOrder.length; j++) { + subgroup = subgroupOrder[j]; + + if (subgroups.hasOwnProperty(subgroup)) { + doSubStack = doSubStack || subgroups[subgroup].stack; + subgroups[subgroup].top = 0; + + for (var otherSubgroup in subgroups) { + if (subgroups[otherSubgroup].visible && subgroups[subgroup].index > subgroups[otherSubgroup].index) { + subgroups[subgroup].top += subgroups[otherSubgroup].height; + } + } + + var items = subgroupItems[subgroup]; + + for (var i = 0; i < items.length; i++) { + if (items[i].data.subgroup !== undefined) { + items[i].top = subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical; + + if (subgroups[subgroup].stack) { + items[i].baseTop = items[i].top; + } + } + } + + if (doSubStack && subgroups[subgroup].stack) { + substack(subgroupItems[subgroup], margin, subgroups[subgroup]); + } + } + } +} +/** + * 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 + */ + +function collision(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; + } +} +/** + * Test if the two provided objects collide + * The objects must have parameters start, end, top, and height. + * @param {Object} a The first Object + * @param {Object} b The second Object + * @return {boolean} true if a and b collide, else false + */ + +function collisionByTimes(a, b) { + return a.start <= b.start && a.end >= b.start && a.top < b.top + b.height && a.top + a.height > b.top || b.start <= a.start && b.end >= a.start && b.top < a.top + a.height && b.top + b.height > a.top; +} + +var stack$1 = /*#__PURE__*/Object.freeze({ + orderByStart: orderByStart, + orderByEnd: orderByEnd, + stack: stack, + substack: substack, + nostack: nostack, + stackSubgroups: stackSubgroups, + stackSubgroupsWithInnerStack: stackSubgroupsWithInnerStack, + collision: collision, + collisionByTimes: collisionByTimes +}); + +var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items + +var BACKGROUND = '__background__'; // reserved group id for background items without group + +var ReservedGroupIds = { + UNGROUPED: UNGROUPED, + BACKGROUND: BACKGROUND + /** + * @constructor Group + */ + +}; + +var Group = +/*#__PURE__*/ +function () { + /** + * @param {number | string} groupId + * @param {Object} data + * @param {ItemSet} itemSet + * @constructor Group + */ + function Group(groupId, data, itemSet) { + classCallCheck$1(this, Group); + + this.groupId = groupId; + this.subgroups = {}; + this.subgroupStack = {}; + this.subgroupStackAll = false; + this.subgroupVisibility = {}; + this.doInnerStack = false; + this.shouldBailStackItems = false; + this.subgroupIndex = 0; + this.subgroupOrderer = data && data.subgroupOrder; + this.itemSet = itemSet; + this.isVisible = null; + this.stackDirty = true; // if true, items will be restacked on next redraw + + if (data && data.nestedGroups) { + this.nestedGroups = data.nestedGroups; + + if (data.showNested == false) { + this.showNested = false; + } else { + this.showNested = true; + } + } + + if (data && data.subgroupStack) { + if (typeof data.subgroupStack === "boolean") { + this.doInnerStack = data.subgroupStack; + this.subgroupStackAll = data.subgroupStack; + } else { + // We might be doing stacking on specific sub groups, but only + // if at least one is set to do stacking + for (var key in data.subgroupStack) { + this.subgroupStack[key] = data.subgroupStack[key]; + this.doInnerStack = this.doInnerStack || data.subgroupStack[key]; + } + } + } + + if (data && data.heightMode) { + this.heightMode = data.heightMode; + } else { + this.heightMode = itemSet.options.groupHeightMode; + } + + this.nestedInGroup = null; + 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.itemsInRange = []; // items currently in range + + 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 + */ + + + createClass$1(Group, [{ + key: "_create", + value: function _create() { + 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['vis-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.style.position = 'absolute'; + 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 + */ + + }, { + key: "setData", + value: function setData(data) { + if (this.itemSet.groupTouchParams.isDragging) return; // update contents + + var content; + var templateFunction; + + if (data && data.subgroupVisibility) { + for (var key in data.subgroupVisibility) { + this.subgroupVisibility[key] = data.subgroupVisibility[key]; + } + } + + if (this.itemSet.options && this.itemSet.options.groupTemplate) { + var _context; + + templateFunction = bind$2(_context = this.itemSet.options.groupTemplate).call(_context, this); + content = templateFunction(data, this.dom.inner); + } else { + content = data && data.content; + } + + if (content instanceof Element) { + while (this.dom.inner.firstChild) { + this.dom.inner.removeChild(this.dom.inner.firstChild); + } + + this.dom.inner.appendChild(content); + } else if (content instanceof Object && content.isReactComponent) ; else if (content instanceof Object) { + templateFunction(data, this.dom.inner); + } 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$2.addClassName(this.dom.inner, 'vis-hidden'); + } else { + util$2.removeClassName(this.dom.inner, 'vis-hidden'); + } + + if (data && data.nestedGroups) { + if (!this.nestedGroups || this.nestedGroups != data.nestedGroups) { + this.nestedGroups = data.nestedGroups; + } + + if (data.showNested !== undefined || this.showNested === undefined) { + if (data.showNested == false) { + this.showNested = false; + } else { + this.showNested = true; + } + } + + util$2.addClassName(this.dom.label, 'vis-nesting-group'); + + if (this.showNested) { + util$2.removeClassName(this.dom.label, 'collapsed'); + util$2.addClassName(this.dom.label, 'expanded'); + } else { + util$2.removeClassName(this.dom.label, 'expanded'); + util$2.addClassName(this.dom.label, 'collapsed'); + } + } else if (this.nestedGroups) { + this.nestedGroups = null; + util$2.removeClassName(this.dom.label, 'collapsed'); + util$2.removeClassName(this.dom.label, 'expanded'); + util$2.removeClassName(this.dom.label, 'vis-nesting-group'); + } + + if (data && (data.treeLevel || data.nestedInGroup)) { + util$2.addClassName(this.dom.label, 'vis-nested-group'); + + if (data.treeLevel) { + util$2.addClassName(this.dom.label, 'vis-group-level-' + data.treeLevel); + } else { + // Nesting level is unknown, but we're sure it's at least 1 + util$2.addClassName(this.dom.label, 'vis-group-level-unknown-but-gte1'); + } + } else { + util$2.addClassName(this.dom.label, 'vis-group-level-0'); + } // update className + + + var className = data && data.className || null; + + if (className != this.className) { + if (this.className) { + util$2.removeClassName(this.dom.label, this.className); + util$2.removeClassName(this.dom.foreground, this.className); + util$2.removeClassName(this.dom.background, this.className); + util$2.removeClassName(this.dom.axis, this.className); + } + + util$2.addClassName(this.dom.label, className); + util$2.addClassName(this.dom.foreground, className); + util$2.addClassName(this.dom.background, className); + util$2.addClassName(this.dom.axis, className); + this.className = className; + } // update style + + + if (this.style) { + util$2.removeCssText(this.dom.label, this.style); + this.style = null; + } + + if (data && data.style) { + util$2.addCssText(this.dom.label, data.style); + this.style = data.style; + } + } + /** + * Get the width of the group label + * @return {number} width + */ + + }, { + key: "getLabelWidth", + value: function getLabelWidth() { + return this.props.label.width; + } + /** + * check if group has had an initial height hange + * @returns {boolean} + */ + + }, { + key: "_didMarkerHeightChange", + value: function _didMarkerHeightChange() { + var markerHeight = this.dom.marker.clientHeight; + + if (markerHeight != this.lastMarkerHeight) { + this.lastMarkerHeight = markerHeight; + var redrawQueue = {}; + var redrawQueueLength = 0; + + forEach$3(util$2).call(util$2, this.items, function (item, key) { + item.dirty = true; + + if (item.displayed) { + var returnQueue = true; + redrawQueue[key] = item.redraw(returnQueue); + redrawQueueLength = redrawQueue[key].length; + } + }); + + var needRedraw = redrawQueueLength > 0; + + if (needRedraw) { + var _loop = function _loop(i) { + forEach$3(util$2).call(util$2, redrawQueue, function (fns) { + fns[i](); + }); + }; + + // redraw all regular items + for (var i = 0; i < redrawQueueLength; i++) { + _loop(i); + } + } + + return true; + } else { + return false; + } + } + /** + * calculate group dimentions and position + * @param {number} pixels + */ + + }, { + key: "_calculateGroupSizeAndPosition", + value: function _calculateGroupSizeAndPosition() { + var _this$dom$foreground = this.dom.foreground, + offsetTop = _this$dom$foreground.offsetTop, + offsetLeft = _this$dom$foreground.offsetLeft, + offsetWidth = _this$dom$foreground.offsetWidth; + this.top = offsetTop; + this.right = offsetLeft; + this.width = offsetWidth; + } + /** + * checks if should bail redraw of items + * @returns {boolean} should bail + */ + + }, { + key: "_shouldBailItemsRedraw", + value: function _shouldBailItemsRedraw() { + var me = this; + var timeoutOptions = this.itemSet.options.onTimeout; + var bailOptions = { + relativeBailingTime: this.itemSet.itemsSettingTime, + bailTimeMs: timeoutOptions && timeoutOptions.timeoutMs, + userBailFunction: timeoutOptions && timeoutOptions.callback, + shouldBailStackItems: this.shouldBailStackItems + }; + var bail = null; + + if (!this.itemSet.initialDrawDone) { + if (bailOptions.shouldBailStackItems) { + return true; + } + + if (Math.abs(now$2() - new Date(bailOptions.relativeBailingTime)) > bailOptions.bailTimeMs) { + if (bailOptions.userBailFunction && this.itemSet.userContinueNotBail == null) { + bailOptions.userBailFunction(function (didUserContinue) { + me.itemSet.userContinueNotBail = didUserContinue; + bail = !didUserContinue; + }); + } else if (me.itemSet.userContinueNotBail == false) { + bail = true; + } else { + bail = false; + } + } + } + + return bail; + } + /** + * redraws items + * @param {boolean} forceRestack + * @param {boolean} lastIsVisible + * @param {number} margin + * @param {object} range + * @private + */ + + }, { + key: "_redrawItems", + value: function _redrawItems(forceRestack, lastIsVisible, margin, range) { + var _this = this; + + var restack = forceRestack || this.stackDirty || this.isVisible && !lastIsVisible; // if restacking, reposition visible items vertically + + if (restack) { + var _context2, _context3, _context4, _context5, _context6, _context7; + + var orderedItems = { + byEnd: filter$2(_context2 = this.orderedItems.byEnd).call(_context2, function (item) { + return !item.isCluster; + }), + byStart: filter$2(_context3 = this.orderedItems.byStart).call(_context3, function (item) { + return !item.isCluster; + }) + }; + var orderedClusters = { + byEnd: toConsumableArray$2(new set$3(filter$2(_context4 = map$2(_context5 = this.orderedItems.byEnd).call(_context5, function (item) { + return item.cluster; + })).call(_context4, function (item) { + return !!item; + }))), + byStart: toConsumableArray$2(new set$3(filter$2(_context6 = map$2(_context7 = this.orderedItems.byStart).call(_context7, function (item) { + return item.cluster; + })).call(_context6, function (item) { + return !!item; + }))) + /** + * Get all visible items in range + * @return {array} items + */ + + }; + + var getVisibleItems = function getVisibleItems() { + var _context8, _context9, _context10; + + var visibleItems = _this._updateItemsInRange(orderedItems, filter$2(_context8 = _this.visibleItems).call(_context8, function (item) { + return !item.isCluster; + }), range); + + var visibleClusters = _this._updateClustersInRange(orderedClusters, filter$2(_context9 = _this.visibleItems).call(_context9, function (item) { + return item.isCluster; + }), range); + + return concat$2(_context10 = []).call(_context10, toConsumableArray$2(visibleItems), toConsumableArray$2(visibleClusters)); + }; + /** + * Get visible items grouped by subgroup + * @param {function} orderFn An optional function to order items inside the subgroups + * @return {Object} + */ + + + var getVisibleItemsGroupedBySubgroup = function getVisibleItemsGroupedBySubgroup(orderFn) { + var visibleSubgroupsItems = {}; + + var _loop2 = function _loop2(subgroup) { + var _context11; + + var items = filter$2(_context11 = _this.visibleItems).call(_context11, function (item) { + return item.data.subgroup === subgroup; + }); + + visibleSubgroupsItems[subgroup] = orderFn ? sort$2(items).call(items, function (a, b) { + return orderFn(a.data, b.data); + }) : items; + }; + + for (var subgroup in _this.subgroups) { + _loop2(subgroup); + } + + return visibleSubgroupsItems; + }; + + if (typeof this.itemSet.options.order === 'function') { + // a custom order function + //show all items + var me = this; + + if (this.doInnerStack && this.itemSet.options.stackSubgroups) { + // Order the items within each subgroup + var visibleSubgroupsItems = getVisibleItemsGroupedBySubgroup(this.itemSet.options.order); + stackSubgroupsWithInnerStack(visibleSubgroupsItems, margin, this.subgroups); + this.visibleItems = getVisibleItems(); + + this._updateSubGroupHeights(margin); + } else { + var _context12, _context13, _context14, _context15; + + this.visibleItems = getVisibleItems(); + + this._updateSubGroupHeights(margin); // order all items and force a restacking + // order all items outside clusters and force a restacking + + + var customOrderedItems = sort$2(_context12 = filter$2(_context13 = slice$4(_context14 = this.visibleItems).call(_context14)).call(_context13, function (item) { + return item.isCluster || !item.isCluster && !item.cluster; + })).call(_context12, function (a, b) { + return me.itemSet.options.order(a.data, b.data); + }); + + this.shouldBailStackItems = stack(customOrderedItems, margin, true, bind$2(_context15 = this._shouldBailItemsRedraw).call(_context15, this)); + } + } else { + // no custom order function, lazy stacking + this.visibleItems = getVisibleItems(); + + this._updateSubGroupHeights(margin); + + if (this.itemSet.options.stack) { + if (this.doInnerStack && this.itemSet.options.stackSubgroups) { + var _visibleSubgroupsItems = getVisibleItemsGroupedBySubgroup(); + + stackSubgroupsWithInnerStack(_visibleSubgroupsItems, margin, this.subgroups); + } else { + var _context16; + + // TODO: ugly way to access options... + this.shouldBailStackItems = stack(this.visibleItems, margin, true, bind$2(_context16 = this._shouldBailItemsRedraw).call(_context16, this)); + } + } else { + // no stacking + nostack(this.visibleItems, margin, this.subgroups, this.itemSet.options.stackSubgroups); + } + } + + for (var i = 0; i < this.visibleItems.length; i++) { + this.visibleItems[i].repositionX(); + + if (this.subgroupVisibility[this.visibleItems[i].data.subgroup] !== undefined) { + if (!this.subgroupVisibility[this.visibleItems[i].data.subgroup]) { + this.visibleItems[i].hide(); + } + } + } + + if (this.itemSet.options.cluster) { + forEach$3(util$2).call(util$2, this.items, function (item) { + if (item.cluster && item.displayed) { + item.hide(); + } + }); + } + + if (this.shouldBailStackItems) { + this.itemSet.body.emitter.emit('destroyTimeline'); + } + + this.stackDirty = false; + } + } + /** + * check if group resized + * @param {boolean} resized + * @param {number} height + * @return {boolean} did resize + */ + + }, { + key: "_didResize", + value: function _didResize(resized, height) { + resized = util$2.updateProperty(this, 'height', height) || resized; // recalculate size of label + + var labelWidth = this.dom.inner.clientWidth; + var labelHeight = this.dom.inner.clientHeight; + resized = util$2.updateProperty(this.props.label, 'width', labelWidth) || resized; + resized = util$2.updateProperty(this.props.label, 'height', labelHeight) || resized; + return resized; + } + /** + * apply group height + * @param {number} height + */ + + }, { + key: "_applyGroupHeight", + value: function _applyGroupHeight(height) { + this.dom.background.style.height = "".concat(height, "px"); + this.dom.foreground.style.height = "".concat(height, "px"); + this.dom.label.style.height = "".concat(height, "px"); + } + /** + * update vertical position of items after they are re-stacked and the height of the group is calculated + * @param {number} margin + */ + + }, { + key: "_updateItemsVerticalPosition", + value: function _updateItemsVerticalPosition(margin) { + for (var i = 0, ii = this.visibleItems.length; i < ii; i++) { + var item = this.visibleItems[i]; + item.repositionY(margin); + + if (!this.isVisible && this.groupId != ReservedGroupIds.BACKGROUND) { + if (item.displayed) item.hide(); + } + } + } + /** + * Repaint this group + * @param {{start: number, end: number}} range + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin + * @param {boolean} [forceRestack=false] Force restacking of all items + * @param {boolean} [returnQueue=false] return the queue or if the group resized + * @return {boolean} Returns true if the group is resized or the redraw queue if returnQueue=true + */ + + }, { + key: "redraw", + value: function redraw(range, margin, forceRestack, returnQueue) { + var _this2 = this, + _context17, + _context18, + _context21, + _context23, + _context27; + + var resized = false; + var lastIsVisible = this.isVisible; + var height; + var queue = [function () { + forceRestack = _this2._didMarkerHeightChange.call(_this2) || forceRestack; + }, // recalculate the height of the subgroups + bind$2(_context17 = this._updateSubGroupHeights).call(_context17, this, margin), // calculate actual size and position + bind$2(_context18 = this._calculateGroupSizeAndPosition).call(_context18, this), function () { + var _context19; + + _this2.isVisible = bind$2(_context19 = _this2._isGroupVisible).call(_context19, _this2)(range, margin); + }, function () { + var _context20; + + bind$2(_context20 = _this2._redrawItems).call(_context20, _this2)(forceRestack, lastIsVisible, margin, range); + }, // update subgroups + bind$2(_context21 = this._updateSubgroupsSizes).call(_context21, this), function () { + var _context22; + + height = bind$2(_context22 = _this2._calculateHeight).call(_context22, _this2)(margin); + }, // calculate actual size and position again + bind$2(_context23 = this._calculateGroupSizeAndPosition).call(_context23, this), function () { + var _context24; + + resized = bind$2(_context24 = _this2._didResize).call(_context24, _this2)(resized, height); + }, function () { + var _context25; + + bind$2(_context25 = _this2._applyGroupHeight).call(_context25, _this2)(height); + }, function () { + var _context26; + + bind$2(_context26 = _this2._updateItemsVerticalPosition).call(_context26, _this2)(margin); + }, bind$2(_context27 = function _context27() { + if (!_this2.isVisible && _this2.height) { + resized = false; + } + + return resized; + }).call(_context27, this)]; + + if (returnQueue) { + return queue; + } else { + var result; + + forEach$3(queue).call(queue, function (fn) { + result = fn(); + }); + + return result; + } + } + /** + * recalculate the height of the subgroups + * + * @param {{item: timeline.Item}} margin + * @private + */ + + }, { + key: "_updateSubGroupHeights", + value: function _updateSubGroupHeights(margin) { + var _this3 = this; + + if (keys$3(this.subgroups).length > 0) { + var me = this; + + this._resetSubgroups(); + + forEach$3(util$2).call(util$2, 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 + margin.item.vertical); + me.subgroups[item.data.subgroup].visible = typeof _this3.subgroupVisibility[item.data.subgroup] === 'undefined' ? true : Boolean(_this3.subgroupVisibility[item.data.subgroup]); + } + }); + } + } + /** + * check if group is visible + * + * @param {timeline.Range} range + * @param {{axis: timeline.DataAxis}} margin + * @returns {boolean} is visible + * @private + */ + + }, { + key: "_isGroupVisible", + value: function _isGroupVisible(range, margin) { + return this.top <= range.body.domProps.centerContainer.height - range.body.domProps.scrollTop + margin.axis && this.top + this.height + margin.axis >= -range.body.domProps.scrollTop; + } + /** + * recalculate the height of the group + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin + * @returns {number} Returns the height + * @private + */ + + }, { + key: "_calculateHeight", + value: function _calculateHeight(margin) { + // recalculate the height of the group + var height; + var items; + + if (this.heightMode === 'fixed') { + items = util$2.toArray(this.items); + } else { + // default or 'auto' + items = this.visibleItems; + } + + if (items.length > 0) { + var min = items[0].top; + var max = items[0].top + items[0].height; + + forEach$3(util$2).call(util$2, items, 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; + + forEach$3(util$2).call(util$2, items, function (item) { + item.top -= offset; + }); + } + + height = Math.ceil(max + margin.item.vertical / 2); + + if (this.heightMode !== "fitItems") { + height = Math.max(height, this.props.label.height); + } + } else { + height = this.props.label.height; + } + + return height; + } + /** + * Show this group: attach to the DOM + */ + + }, { + key: "show", + value: function show() { + 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 + */ + + }, { + key: "hide", + value: function hide() { + 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 + */ + + }, { + key: "add", + value: function add(item) { + var _context28; + + this.items[item.id] = item; + item.setParent(this); + this.stackDirty = true; // add to + + if (item.data.subgroup !== undefined) { + this._addToSubgroup(item); + + this.orderSubgroups(); + } + + if (!includes$4(_context28 = this.visibleItems).call(_context28, item)) { + var range = this.itemSet.body.range; // TODO: not nice accessing the range like this + + this._checkIfVisible(item, this.visibleItems, range); + } + } + /** + * add item to subgroup + * @param {object} item + * @param {string} subgroupId + */ + + }, { + key: "_addToSubgroup", + value: function _addToSubgroup(item) { + var subgroupId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : item.data.subgroup; + + if (subgroupId != undefined && this.subgroups[subgroupId] === undefined) { + this.subgroups[subgroupId] = { + height: 0, + top: 0, + start: item.data.start, + end: item.data.end || item.data.start, + visible: false, + index: this.subgroupIndex, + items: [], + stack: this.subgroupStackAll || this.subgroupStack[subgroupId] || false + }; + this.subgroupIndex++; + } + + if (new Date(item.data.start) < new Date(this.subgroups[subgroupId].start)) { + this.subgroups[subgroupId].start = item.data.start; + } + + var itemEnd = item.data.end || item.data.start; + + if (new Date(itemEnd) > new Date(this.subgroups[subgroupId].end)) { + this.subgroups[subgroupId].end = itemEnd; + } + + this.subgroups[subgroupId].items.push(item); + } + /** + * update subgroup sizes + */ + + }, { + key: "_updateSubgroupsSizes", + value: function _updateSubgroupsSizes() { + var me = this; + + if (me.subgroups) { + var _loop3 = function _loop3(subgroup) { + var _context29; + + var initialEnd = me.subgroups[subgroup].items[0].data.end || me.subgroups[subgroup].items[0].data.start; + var newStart = me.subgroups[subgroup].items[0].data.start; + var newEnd = initialEnd - 1; + + forEach$3(_context29 = me.subgroups[subgroup].items).call(_context29, function (item) { + if (new Date(item.data.start) < new Date(newStart)) { + newStart = item.data.start; + } + + var itemEnd = item.data.end || item.data.start; + + if (new Date(itemEnd) > new Date(newEnd)) { + newEnd = itemEnd; + } + }); + + me.subgroups[subgroup].start = newStart; + me.subgroups[subgroup].end = new Date(newEnd - 1); // -1 to compensate for colliding end to start subgroups; + }; + + for (var subgroup in me.subgroups) { + _loop3(subgroup); + } + } + } + /** + * order subgroups + */ + + }, { + key: "orderSubgroups", + value: function orderSubgroups() { + 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] + }); + } + + sort$2(sortArray).call(sortArray, 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); + } + + sort$2(sortArray).call(sortArray, this.subgroupOrderer); + } + + if (sortArray.length > 0) { + for (var i = 0; i < sortArray.length; i++) { + this.subgroups[sortArray[i].subgroup].index = i; + } + } + } + } + /** + * add item to subgroup + */ + + }, { + key: "_resetSubgroups", + value: function _resetSubgroups() { + for (var subgroup in this.subgroups) { + if (this.subgroups.hasOwnProperty(subgroup)) { + this.subgroups[subgroup].visible = false; + this.subgroups[subgroup].height = 0; + } + } + } + /** + * Remove an item from the group + * @param {Item} item + */ + + }, { + key: "remove", + value: function remove(item) { + var _context30, _context31; + + delete this.items[item.id]; + item.setParent(null); + this.stackDirty = true; // remove from visible items + + var index = indexOf$3(_context30 = this.visibleItems).call(_context30, item); + + if (index != -1) splice$2(_context31 = this.visibleItems).call(_context31, index, 1); + + if (item.data.subgroup !== undefined) { + this._removeFromSubgroup(item); + + this.orderSubgroups(); + } + } + /** + * remove item from subgroup + * @param {object} item + * @param {string} subgroupId + */ + + }, { + key: "_removeFromSubgroup", + value: function _removeFromSubgroup(item) { + var subgroupId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : item.data.subgroup; + + if (subgroupId != undefined) { + var subgroup = this.subgroups[subgroupId]; + + if (subgroup) { + var _context32; + + var itemIndex = indexOf$3(_context32 = subgroup.items).call(_context32, item); // Check the item is actually in this subgroup. How should items not in the group be handled? + + + if (itemIndex >= 0) { + var _context33; + + splice$2(_context33 = subgroup.items).call(_context33, itemIndex, 1); + + if (!subgroup.items.length) { + delete this.subgroups[subgroupId]; + } else { + this._updateSubgroupsSizes(); + } + } + } + } + } + /** + * Remove an item from the corresponding DataSet + * @param {Item} item + */ + + }, { + key: "removeFromDataSet", + value: function removeFromDataSet(item) { + this.itemSet.removeItem(item.id); + } + /** + * Reorder the items + */ + + }, { + key: "order", + value: function order() { + var array = util$2.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 + }; + orderByStart(this.orderedItems.byStart); + 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[]} oldVisibleItems The previously visible items. + * @param {{start: number, end: number}} range Visible range + * @return {Item[]} visibleItems The new visible items. + * @private + */ + + }, { + key: "_updateItemsInRange", + value: function _updateItemsInRange(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 + + if (!this.isVisible && this.groupId != ReservedGroupIds.BACKGROUND) { + for (var i = 0; i < oldVisibleItems.length; i++) { + var item = oldVisibleItems[i]; + if (item.displayed) item.hide(); + } + + return visibleItems; + } + + var interval = (range.end - range.start) / 4; + var lowerBound = range.start - interval; + var upperBound = range.end + interval; // this function is used to do the binary search for items having start date only. + + var startSearchFunction = function startSearchFunction(value) { + if (value < lowerBound) { + return -1; + } else if (value <= upperBound) { + return 0; + } else { + return 1; + } + }; // this function is used to do the binary search for items having start and end dates (range). + + + var endSearchFunction = function endSearchFunction(value) { + if (value < lowerBound) { + return -1; + } else { + return 0; + } + }; // 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 (var _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$2.binarySearchCustom(orderedItems.byStart, startSearchFunction, '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 (var _i2 = 0; _i2 < orderedItems.byEnd.length; _i2++) { + this._checkIfVisibleWithReference(orderedItems.byEnd[_i2], visibleItems, visibleItemsLookup, range); + } + } else { + // we do a binary search for the items that have defined end times. + var initialPosByEnd = util$2.binarySearchCustom(orderedItems.byEnd, endSearchFunction, '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.start > upperBound; + }); + } + + var redrawQueue = {}; + var redrawQueueLength = 0; + + for (var _i3 = 0; _i3 < visibleItems.length; _i3++) { + var _item = visibleItems[_i3]; + + if (!_item.displayed) { + var returnQueue = true; + redrawQueue[_i3] = _item.redraw(returnQueue); + redrawQueueLength = redrawQueue[_i3].length; + } + } + + var needRedraw = redrawQueueLength > 0; + + if (needRedraw) { + var _loop4 = function _loop4(j) { + forEach$3(util$2).call(util$2, redrawQueue, function (fns) { + fns[j](); + }); + }; + + // redraw all regular items + for (var j = 0; j < redrawQueueLength; j++) { + _loop4(j); + } + } + + for (var _i4 = 0; _i4 < visibleItems.length; _i4++) { + visibleItems[_i4].repositionX(); + } + + return visibleItems; + } + /** + * trace visible items in group + * @param {number} initialPos + * @param {array} items + * @param {aray} visibleItems + * @param {object} visibleItemsLookup + * @param {function} breakCondition + */ + + }, { + key: "_traceVisible", + value: function _traceVisible(initialPos, items, visibleItems, visibleItemsLookup, breakCondition) { + if (initialPos != -1) { + for (var i = initialPos; i >= 0; i--) { + var item = items[i]; + + if (breakCondition(item)) { + break; + } else { + if (!(item.isCluster && !item.hasItems()) && !item.cluster) { + if (visibleItemsLookup[item.id] === undefined) { + visibleItemsLookup[item.id] = true; + visibleItems.push(item); + } + } + } + } + + for (var _i5 = initialPos + 1; _i5 < items.length; _i5++) { + var _item2 = items[_i5]; + + if (breakCondition(_item2)) { + break; + } else { + if (!(_item2.isCluster && !_item2.hasItems()) && !_item2.cluster) { + if (visibleItemsLookup[_item2.id] === undefined) { + visibleItemsLookup[_item2.id] = true; + visibleItems.push(_item2); + } + } + } + } + } + } + /** + * 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 + */ + + }, { + key: "_checkIfVisible", + value: function _checkIfVisible(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 {Object} visibleItemsLookup + * @param {{start:number, end:number}} range + * @private + */ + + }, { + key: "_checkIfVisibleWithReference", + value: function _checkIfVisibleWithReference(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(); + } + } + /** + * Update the visible items + * @param {array} orderedClusters + * @param {array} oldVisibleClusters + * @param {{start: number, end: number}} range + * @return {Item[]} visibleItems + * @private + */ + + }, { + key: "_updateClustersInRange", + value: function _updateClustersInRange(orderedClusters, oldVisibleClusters, range) { + // Clusters can overlap each other so we cannot use binary search here + var visibleClusters = []; + var visibleClustersLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems + + if (oldVisibleClusters.length > 0) { + for (var i = 0; i < oldVisibleClusters.length; i++) { + this._checkIfVisibleWithReference(oldVisibleClusters[i], visibleClusters, visibleClustersLookup, range); + } + } + + for (var _i6 = 0; _i6 < orderedClusters.byStart.length; _i6++) { + this._checkIfVisibleWithReference(orderedClusters.byStart[_i6], visibleClusters, visibleClustersLookup, range); + } + + for (var _i7 = 0; _i7 < orderedClusters.byEnd.length; _i7++) { + this._checkIfVisibleWithReference(orderedClusters.byEnd[_i7], visibleClusters, visibleClustersLookup, range); + } + + var redrawQueue = {}; + var redrawQueueLength = 0; + + for (var _i8 = 0; _i8 < visibleClusters.length; _i8++) { + var item = visibleClusters[_i8]; + + if (!item.displayed) { + var returnQueue = true; + redrawQueue[_i8] = item.redraw(returnQueue); + redrawQueueLength = redrawQueue[_i8].length; + } + } + + var needRedraw = redrawQueueLength > 0; + + if (needRedraw) { + // redraw all regular items + for (var j = 0; j < redrawQueueLength; j++) { + forEach$3(util$2).call(util$2, redrawQueue, function (fns) { + fns[j](); + }); + } + } + + for (var _i9 = 0; _i9 < visibleClusters.length; _i9++) { + visibleClusters[_i9].repositionX(); + } + + return visibleClusters; + } + /** + * change item subgroup + * @param {object} item + * @param {string} oldSubgroup + * @param {string} newSubgroup + */ + + }, { + key: "changeSubgroup", + value: function changeSubgroup(item, oldSubgroup, newSubgroup) { + this._removeFromSubgroup(item, oldSubgroup); + + this._addToSubgroup(item, newSubgroup); + + this.orderSubgroups(); + } + }]); + + return Group; +}(); + +/** + * @constructor BackgroundGroup + * @extends Group + */ + +var BackgroundGroup = +/*#__PURE__*/ +function (_Group) { + inherits$1(BackgroundGroup, _Group); + + /** + * @param {number | string} groupId + * @param {Object} data + * @param {ItemSet} itemSet + */ + function BackgroundGroup(groupId, data, itemSet) { + var _this; + + classCallCheck$1(this, BackgroundGroup); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(BackgroundGroup).call(this, groupId, data, itemSet)); // Group.call(this, groupId, data, itemSet); + + _this.width = 0; + _this.height = 0; + _this.top = 0; + _this.left = 0; + return _this; + } + /** + * Repaint this group + * @param {{start: number, end: number}} range + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin + * @param {boolean} [forceRestack=false] Force restacking of all items + * @return {boolean} Returns true if the group is resized + */ + + + createClass$1(BackgroundGroup, [{ + key: "redraw", + value: function redraw(range, margin, forceRestack) { + // eslint-disable-line no-unused-vars + var resized = false; + this.visibleItems = this._updateItemsInRange(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 + */ + + }, { + key: "show", + value: function show() { + if (!this.dom.background.parentNode) { + this.itemSet.dom.background.appendChild(this.dom.background); + } + } + }]); + + return BackgroundGroup; +}(Group); + +/** + * Item + */ + +var Item = +/*#__PURE__*/ +function () { + /** + * @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) { + var _context, + _this = this; + + classCallCheck$1(this, Item); + + this.id = null; + this.parent = null; + this.data = data; + this.dom = null; + this.conversion = conversion || {}; + this.defaultOptions = { + locales: locales, + locale: 'en' + }; + this.options = util$2.extend({}, this.defaultOptions, options); + this.options.locales = util$2.extend({}, locales, this.options.locales); + var defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale]; + + forEach$3(_context = keys$3(this.options.locales)).call(_context, function (locale) { + _this.options.locales[locale] = util$2.extend({}, defaultLocales, _this.options.locales[locale]); + }); + + this.selected = false; + this.displayed = false; + this.groupShowing = true; + this.selectable = options && options.selectable || false; + this.dirty = true; + this.top = null; + this.right = null; + this.left = null; + this.width = null; + this.height = null; + this.setSelectability(data); + this.editable = null; + + this._updateEditStatus(); + } + /** + * Select current item + */ + + + createClass$1(Item, [{ + key: "select", + value: function select() { + if (this.selectable) { + this.selected = true; + this.dirty = true; + if (this.displayed) this.redraw(); + } + } + /** + * Unselect current item + */ + + }, { + key: "unselect", + value: function unselect() { + 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 + */ + + }, { + key: "setData", + value: function setData(data) { + var groupChanged = data.group != undefined && this.data.group != data.group; + + if (groupChanged && this.parent != null) { + this.parent.itemSet._moveToGroup(this, data.group); + } + + this.setSelectability(data); + + if (this.parent) { + this.parent.stackDirty = true; + } + + var subGroupChanged = data.subgroup != undefined && this.data.subgroup != data.subgroup; + + if (subGroupChanged && this.parent != null) { + this.parent.changeSubgroup(this, this.data.subgroup, data.subgroup); + } + + this.data = data; + + this._updateEditStatus(); + + this.dirty = true; + if (this.displayed) this.redraw(); + } + /** + * Set whether the item can be selected. + * Can only be set/unset if the timeline's `selectable` configuration option is `true`. + * @param {Object} data `data` from `constructor` and `setData` + */ + + }, { + key: "setSelectability", + value: function setSelectability(data) { + if (data) { + this.selectable = typeof data.selectable === 'undefined' ? true : Boolean(data.selectable); + } + } + /** + * Set a parent for the item + * @param {Group} parent + */ + + }, { + key: "setParent", + value: function setParent(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 + * @param {timeline.Range} range with a timestamp for start and end + * @returns {boolean} True if visible + */ + + }, { + key: "isVisible", + value: function isVisible(range) { + // eslint-disable-line no-unused-vars + return false; + } + /** + * Show the Item in the DOM (when not already visible) + * @return {Boolean} changed + */ + + }, { + key: "show", + value: function show() { + return false; + } + /** + * Hide the Item from the DOM (when visible) + * @return {Boolean} changed + */ + + }, { + key: "hide", + value: function hide() { + return false; + } + /** + * Repaint the item + */ + + }, { + key: "redraw", + value: function redraw() {} // should be implemented by the item + + /** + * Reposition the Item horizontally + */ + + }, { + key: "repositionX", + value: function repositionX() {} // should be implemented by the item + + /** + * Reposition the Item vertically + */ + + }, { + key: "repositionY", + value: function repositionY() {} // should be implemented by the item + + /** + * Repaint a drag area on the center of the item when the item is selected + * @protected + */ + + }, { + key: "_repaintDragCenter", + value: function _repaintDragCenter() { + if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) { + var _context2, _context3, _context4; + + var me = this; // create and show drag area + + var dragCenter = document.createElement('div'); + dragCenter.className = 'vis-drag-center'; + dragCenter.dragCenterItem = this; + this.hammerDragCenter = new Hammer$1(dragCenter); + this.hammerDragCenter.on('tap', function (event) { + me.parent.itemSet.body.emitter.emit('click', { + event: event, + item: me.id + }); + }); + this.hammerDragCenter.on('doubletap', function (event) { + event.stopPropagation(); + + me.parent.itemSet._onUpdateItem(me); + + me.parent.itemSet.body.emitter.emit('doubleClick', { + event: event, + item: me.id + }); + }); + this.hammerDragCenter.on('panstart', bind$2(_context2 = me.parent.itemSet._onDragStart).call(_context2, me.parent.itemSet)); + this.hammerDragCenter.on('panmove', bind$2(_context3 = me.parent.itemSet._onDrag).call(_context3, me.parent.itemSet)); + this.hammerDragCenter.on('panend', bind$2(_context4 = me.parent.itemSet._onDragEnd).call(_context4, me.parent.itemSet)); + + if (this.dom.box) { + if (this.dom.dragLeft) { + this.dom.box.insertBefore(dragCenter, this.dom.dragLeft); + } else { + this.dom.box.appendChild(dragCenter); + } + } else if (this.dom.point) { + this.dom.point.appendChild(dragCenter); + } + + this.dom.dragCenter = dragCenter; + } else if (!this.selected && this.dom.dragCenter) { + // delete drag area + if (this.dom.dragCenter.parentNode) { + this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter); + } + + this.dom.dragCenter = null; + + if (this.hammerDragCenter) { + this.hammerDragCenter.destroy(); + this.hammerDragCenter = null; + } + } + } + /** + * Repaint a delete button on the top right of the item when the item is selected + * @param {HTMLElement} anchor + * @protected + */ + + }, { + key: "_repaintDeleteButton", + value: function _repaintDeleteButton(anchor) { + var editable = (this.options.editable.overrideItems || this.editable == null) && this.options.editable.remove || !this.options.editable.overrideItems && this.editable != null && this.editable.remove; + + 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'; + } + + var optionsLocale = this.options.locales[this.options.locale]; + + if (!optionsLocale) { + if (!this.warned) { + console.warn("WARNING: options.locales['".concat(this.options.locale, "'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization")); + this.warned = true; + } + + optionsLocale = this.options.locales['en']; // fall back on english when not available + } + + deleteButton.title = optionsLocale.deleteSelected; // TODO: be able to destroy the delete button + + this.hammerDeleteButton = new Hammer$1(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; + + if (this.hammerDeleteButton) { + this.hammerDeleteButton.destroy(); + this.hammerDeleteButton = null; + } + } + } + /** + * Repaint a onChange tooltip on the top right of the item when the item is selected + * @param {HTMLElement} anchor + * @protected + */ + + }, { + key: "_repaintOnItemUpdateTimeTooltip", + value: function _repaintOnItemUpdateTimeTooltip(anchor) { + if (!this.options.tooltipOnItemUpdateTime) return; + var editable = (this.options.editable.updateTime || this.data.editable === true) && this.data.editable !== false; + + if (this.selected && editable && !this.dom.onItemUpdateTimeTooltip) { + var onItemUpdateTimeTooltip = document.createElement('div'); + onItemUpdateTimeTooltip.className = 'vis-onUpdateTime-tooltip'; + anchor.appendChild(onItemUpdateTimeTooltip); + this.dom.onItemUpdateTimeTooltip = onItemUpdateTimeTooltip; + } else if (!this.selected && this.dom.onItemUpdateTimeTooltip) { + // remove button + if (this.dom.onItemUpdateTimeTooltip.parentNode) { + this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip); + } + + this.dom.onItemUpdateTimeTooltip = null; + } // position onChange tooltip + + + if (this.dom.onItemUpdateTimeTooltip) { + // only show when editing + this.dom.onItemUpdateTimeTooltip.style.visibility = this.parent.itemSet.touchParams.itemIsDragging ? 'visible' : 'hidden'; // position relative to item's content + + this.dom.onItemUpdateTimeTooltip.style.transform = 'translateX(-50%)'; + this.dom.onItemUpdateTimeTooltip.style.left = '50%'; // position above or below the item depending on the item's position in the window + + var tooltipOffset = 50; // TODO: should be tooltip height (depends on template) + + var scrollTop = this.parent.itemSet.body.domProps.scrollTop; // TODO: this.top for orientation:true is actually the items distance from the bottom... + // (should be this.bottom) + + var itemDistanceFromTop; + + if (this.options.orientation.item == 'top') { + itemDistanceFromTop = this.top; + } else { + itemDistanceFromTop = this.parent.height - this.top - this.height; + } + + var isCloseToTop = itemDistanceFromTop + this.parent.top - tooltipOffset < -scrollTop; + + if (isCloseToTop) { + this.dom.onItemUpdateTimeTooltip.style.bottom = ""; + this.dom.onItemUpdateTimeTooltip.style.top = "".concat(this.height + 2, "px"); + } else { + this.dom.onItemUpdateTimeTooltip.style.top = ""; + this.dom.onItemUpdateTimeTooltip.style.bottom = "".concat(this.height + 2, "px"); + } // handle tooltip content + + + var content; + var templateFunction; + + if (this.options.tooltipOnItemUpdateTime && this.options.tooltipOnItemUpdateTime.template) { + var _context5; + + templateFunction = bind$2(_context5 = this.options.tooltipOnItemUpdateTime.template).call(_context5, this); + content = templateFunction(this.data); + } else { + content = "start: ".concat(moment$3(this.data.start).format('MM/DD/YYYY hh:mm')); + + if (this.data.end) { + content += "
end: ".concat(moment$3(this.data.end).format('MM/DD/YYYY hh:mm')); + } + } + + this.dom.onItemUpdateTimeTooltip.innerHTML = content; + } + } + /** + * get item data + * @return {object} + * @private + */ + + }, { + key: "_getItemData", + value: function _getItemData() { + return this.parent.itemSet.itemsData.get(this.id); + } + /** + * Set HTML contents for the item + * @param {Element} element HTML element to fill with the contents + * @private + */ + + }, { + key: "_updateContents", + value: function _updateContents(element) { + var content; + var changed; + var templateFunction; + var itemVisibleFrameContent; + var visibleFrameTemplateFunction; + + var itemData = this._getItemData(); // get a clone of the data from the dataset + + + var frameElement = this.dom.box || this.dom.point; + var itemVisibleFrameContentElement = frameElement.getElementsByClassName('vis-item-visible-frame')[0]; + + if (this.options.visibleFrameTemplate) { + var _context6; + + visibleFrameTemplateFunction = bind$2(_context6 = this.options.visibleFrameTemplate).call(_context6, this); + itemVisibleFrameContent = visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement); + } else { + itemVisibleFrameContent = ''; + } + + if (itemVisibleFrameContentElement) { + if (itemVisibleFrameContent instanceof Object && !(itemVisibleFrameContent instanceof Element)) { + visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement); + } else { + changed = this._contentToString(this.itemVisibleFrameContent) !== this._contentToString(itemVisibleFrameContent); + + if (changed) { + // only replace the content when changed + if (itemVisibleFrameContent instanceof Element) { + itemVisibleFrameContentElement.innerHTML = ''; + itemVisibleFrameContentElement.appendChild(itemVisibleFrameContent); + } else if (itemVisibleFrameContent != undefined) { + itemVisibleFrameContentElement.innerHTML = itemVisibleFrameContent; + } else { + if (!(this.data.type == 'background' && this.data.content === undefined)) { + throw new Error("Property \"content\" missing in item ".concat(this.id)); + } + } + + this.itemVisibleFrameContent = itemVisibleFrameContent; + } + } + } + + if (this.options.template) { + var _context7; + + templateFunction = bind$2(_context7 = this.options.template).call(_context7, this); + content = templateFunction(itemData, element, this.data); + } else { + content = this.data.content; + } + + if (content instanceof Object && !(content instanceof Element)) { + templateFunction(itemData, element); + } else { + 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 ".concat(this.id)); + } + } + + this.content = content; + } + } + } + /** + * 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 + */ + + }, { + key: "_updateDataAttributes", + value: function _updateDataAttributes(element) { + if (this.options.dataAttributes && this.options.dataAttributes.length > 0) { + var attributes = []; + + if (isArray$3(this.options.dataAttributes)) { + attributes = this.options.dataAttributes; + } else if (this.options.dataAttributes == 'all') { + attributes = keys$3(this.data); + } else { + return; + } + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = getIterator$2(attributes), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var name = _step.value; + var value = this.data[name]; + + if (value != null) { + element.setAttribute("data-".concat(name), value); + } else { + element.removeAttribute("data-".concat(name)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + /** + * Update custom styles of the element + * @param {Element} element + * @private + */ + + }, { + key: "_updateStyle", + value: function _updateStyle(element) { + // remove old styles + if (this.style) { + util$2.removeCssText(element, this.style); + this.style = null; + } // append new styles + + + if (this.data.style) { + util$2.addCssText(element, this.data.style); + this.style = this.data.style; + } + } + /** + * Stringify the items contents + * @param {string | Element | undefined} content + * @returns {string | undefined} + * @private + */ + + }, { + key: "_contentToString", + value: function _contentToString(content) { + if (typeof content === 'string') return content; + if (content && 'outerHTML' in content) return content.outerHTML; + return content; + } + /** + * Update the editability of this item. + */ + + }, { + key: "_updateEditStatus", + value: function _updateEditStatus() { + if (this.options) { + if (typeof this.options.editable === 'boolean') { + this.editable = { + updateTime: this.options.editable, + updateGroup: this.options.editable, + remove: this.options.editable + }; + } else if (_typeof_1$2(this.options.editable) === 'object') { + this.editable = {}; + util$2.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, this.options.editable); + } + } // Item data overrides, except if options.editable.overrideItems is set. + + + if (!this.options || !this.options.editable || this.options.editable.overrideItems !== true) { + if (this.data) { + if (typeof this.data.editable === 'boolean') { + this.editable = { + updateTime: this.data.editable, + updateGroup: this.data.editable, + remove: this.data.editable + }; + } else if (_typeof_1$2(this.data.editable) === 'object') { + // TODO: in timeline.js 5.0, we should change this to not reset options from the timeline configuration. + // Basically just remove the next line... + this.editable = {}; + util$2.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, this.data.editable); + } + } + } + } + /** + * Return the width of the item left from its start date + * @return {number} + */ + + }, { + key: "getWidthLeft", + value: function getWidthLeft() { + return 0; + } + /** + * Return the width of the item right from the max of its start and end date + * @return {number} + */ + + }, { + key: "getWidthRight", + value: function getWidthRight() { + return 0; + } + /** + * Return the title of the item + * @return {string | undefined} + */ + + }, { + key: "getTitle", + value: function getTitle() { + if (this.options.tooltip && this.options.tooltip.template) { + var _context8; + + var templateFunction = bind$2(_context8 = this.options.tooltip.template).call(_context8, this); + + return templateFunction(this._getItemData(), this.data); + } + + return this.data.title; + } + }]); + + return Item; +}(); + +Item.prototype.stack = true; + +/** + * @constructor BoxItem + * @extends Item + */ + +var BoxItem = +/*#__PURE__*/ +function (_Item) { + inherits$1(BoxItem, _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) { + var _this; + + classCallCheck$1(this, BoxItem); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(BoxItem).call(this, data, conversion, options)); + _this.props = { + dot: { + width: 0, + height: 0 + }, + line: { + width: 0, + height: 0 + } + }; // validate data + + if (data) { + if (data.start == undefined) { + throw new Error("Property \"start\" missing in item ".concat(data)); + } + } + + return _this; + } + /** + * Check whether this item is visible inside given range + * @param {{start: number, end: number}} range with a timestamp for start and end + * @returns {boolean} True if visible + */ + + + createClass$1(BoxItem, [{ + key: "isVisible", + value: function isVisible(range) { + if (this.cluster) { + return false; + } // determine visibility + + + var isVisible; + var align = this.data.align || this.options.align; + var widthInMs = this.width * range.getMillisecondsPerPixel(); + + if (align == 'right') { + isVisible = this.data.start.getTime() > range.start && this.data.start.getTime() - widthInMs < range.end; + } else if (align == 'left') { + isVisible = this.data.start.getTime() + widthInMs > range.start && this.data.start.getTime() < range.end; + } else { + // default or 'center' + isVisible = this.data.start.getTime() + widthInMs / 2 > range.start && this.data.start.getTime() - widthInMs / 2 < range.end; + } + + return isVisible; + } + /** + * create DOM element + * @private + */ + + }, { + key: "_createDomElement", + value: function _createDomElement() { + if (!this.dom) { + // create DOM + this.dom = {}; // create main box + + this.dom.box = document.createElement('DIV'); // contents box (inside the background box). used for making margins + + this.dom.content = document.createElement('DIV'); + this.dom.content.className = 'vis-item-content'; + this.dom.box.appendChild(this.dom.content); // line to axis + + this.dom.line = document.createElement('DIV'); + this.dom.line.className = 'vis-line'; // dot on axis + + this.dom.dot = document.createElement('DIV'); + this.dom.dot.className = 'vis-dot'; // attach this item as attribute + + this.dom.box['vis-item'] = this; + this.dirty = true; + } + } + /** + * append DOM element + * @private + */ + + }, { + key: "_appendDomElement", + value: function _appendDomElement() { + if (!this.parent) { + throw new Error('Cannot redraw item: no parent attached'); + } + + if (!this.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(this.dom.box); + } + + if (!this.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(this.dom.line); + } + + if (!this.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(this.dom.dot); + } + + this.displayed = true; + } + /** + * update dirty DOM element + * @private + */ + + }, { + key: "_updateDirtyDomComponents", + value: function _updateDirtyDomComponents() { + // 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._updateDataAttributes(this.dom.box); + + this._updateStyle(this.dom.box); + + var editable = this.editable.updateTime || this.editable.updateGroup; // update class + + var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly'); + this.dom.box.className = "vis-item vis-box".concat(className); + this.dom.line.className = "vis-item vis-line".concat(className); + this.dom.dot.className = "vis-item vis-dot".concat(className); + } + } + /** + * get DOM components sizes + * @return {object} + * @private + */ + + }, { + key: "_getDomComponentsSizes", + value: function _getDomComponentsSizes() { + return { + previous: { + right: this.dom.box.style.right, + left: this.dom.box.style.left + }, + dot: { + height: this.dom.dot.offsetHeight, + width: this.dom.dot.offsetWidth + }, + line: { + width: this.dom.line.offsetWidth + }, + box: { + width: this.dom.box.offsetWidth, + height: this.dom.box.offsetHeight + } + }; + } + /** + * update DOM components sizes + * @param {object} sizes + * @private + */ + + }, { + key: "_updateDomComponentsSizes", + value: function _updateDomComponentsSizes(sizes) { + if (this.options.rtl) { + this.dom.box.style.right = "0px"; + } else { + this.dom.box.style.left = "0px"; + } // recalculate size + + + this.props.dot.height = sizes.dot.height; + this.props.dot.width = sizes.dot.width; + this.props.line.width = sizes.line.width; + this.width = sizes.box.width; + this.height = sizes.box.height; // restore previous position + + if (this.options.rtl) { + this.dom.box.style.right = sizes.previous.right; + } else { + this.dom.box.style.left = sizes.previous.left; + } + + this.dirty = false; + } + /** + * repaint DOM additionals + * @private + */ + + }, { + key: "_repaintDomAdditionals", + value: function _repaintDomAdditionals() { + this._repaintOnItemUpdateTimeTooltip(this.dom.box); + + this._repaintDragCenter(); + + this._repaintDeleteButton(this.dom.box); + } + /** + * Repaint the item + * @param {boolean} [returnQueue=false] return the queue + * @return {boolean} the redraw queue if returnQueue=true + */ + + }, { + key: "redraw", + value: function redraw(returnQueue) { + var _context, + _context2, + _context3, + _this2 = this, + _context5; + + var sizes; + var queue = [// create item DOM + bind$2(_context = this._createDomElement).call(_context, this), // append DOM to parent DOM + bind$2(_context2 = this._appendDomElement).call(_context2, this), // update dirty DOM + bind$2(_context3 = this._updateDirtyDomComponents).call(_context3, this), function () { + if (_this2.dirty) { + sizes = _this2._getDomComponentsSizes(); + } + }, function () { + if (_this2.dirty) { + var _context4; + + bind$2(_context4 = _this2._updateDomComponentsSizes).call(_context4, _this2)(sizes); + } + }, // repaint DOM additionals + bind$2(_context5 = this._repaintDomAdditionals).call(_context5, this)]; + + if (returnQueue) { + return queue; + } else { + var result; + + forEach$3(queue).call(queue, function (fn) { + result = fn(); + }); + + return result; + } + } + /** + * Show the item in the DOM (when not already visible). The items DOM will + * be created when needed. + * @param {boolean} [returnQueue=false] whether to return a queue of functions to execute instead of just executing them + * @return {boolean} the redraw queue if returnQueue=true + */ + + }, { + key: "show", + value: function show(returnQueue) { + if (!this.displayed) { + return this.redraw(returnQueue); + } + } + /** + * Hide the item from the DOM (when visible) + */ + + }, { + key: "hide", + value: function hide() { + if (this.displayed) { + var dom = this.dom; + if (dom.box.parentNode) dom.box.remove(); + if (dom.line.parentNode) dom.line.remove(); + if (dom.dot.parentNode) dom.dot.remove(); + this.displayed = false; + } + } + /** + * Reposition the item XY + */ + + }, { + key: "repositionXY", + value: function repositionXY() { + var rtl = this.options.rtl; + + var repositionXY = function repositionXY(element, x, y) { + var _context6; + + var rtl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + if (x === undefined && y === undefined) return; // If rtl invert the number. + + var directionX = rtl ? x * -1 : x; //no y. translate x + + if (y === undefined) { + element.style.transform = "translateX(".concat(directionX, "px)"); + return; + } //no x. translate y + + + if (x === undefined) { + element.style.transform = "translateY(".concat(y, "px)"); + return; + } + + element.style.transform = concat$2(_context6 = "translate(".concat(directionX, "px, ")).call(_context6, y, "px)"); + }; + + repositionXY(this.dom.box, this.boxX, this.boxY, rtl); + repositionXY(this.dom.dot, this.dotX, this.dotY, rtl); + repositionXY(this.dom.line, this.lineX, this.lineY, rtl); + } + /** + * Reposition the item horizontally + * @Override + */ + + }, { + key: "repositionX", + value: function repositionX() { + var start = this.conversion.toScreen(this.data.start); + var align = this.data.align === undefined ? this.options.align : this.data.align; + var lineWidth = this.props.line.width; + var dotWidth = this.props.dot.width; + + if (align == 'right') { + // calculate right position of the box + this.boxX = start - this.width; + this.lineX = start - lineWidth; + this.dotX = start - lineWidth / 2 - dotWidth / 2; + } else if (align == 'left') { + // calculate left position of the box + this.boxX = start; + this.lineX = start; + this.dotX = start + lineWidth / 2 - dotWidth / 2; + } else { + // default or 'center' + this.boxX = start - this.width / 2; + this.lineX = this.options.rtl ? start - lineWidth : start - lineWidth / 2; + this.dotX = start - dotWidth / 2; + } + + if (this.options.rtl) this.right = this.boxX;else this.left = this.boxX; + this.repositionXY(); + } + /** + * Reposition the item vertically + * @Override + */ + + }, { + key: "repositionY", + value: function repositionY() { + var orientation = this.options.orientation.item; + var lineStyle = this.dom.line.style; + + if (orientation == 'top') { + var lineHeight = this.parent.top + this.top + 1; + this.boxY = this.top || 0; + lineStyle.height = "".concat(lineHeight, "px"); + lineStyle.bottom = ''; + lineStyle.top = '0'; + } 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; + + this.boxY = this.parent.height - this.top - (this.height || 0); + lineStyle.height = "".concat(_lineHeight, "px"); + lineStyle.top = ''; + lineStyle.bottom = '0'; + } + + this.dotY = -this.props.dot.height / 2; + this.repositionXY(); + } + /** + * Return the width of the item left from its start date + * @return {number} + */ + + }, { + key: "getWidthLeft", + value: function getWidthLeft() { + return this.width / 2; + } + /** + * Return the width of the item right from its start date + * @return {number} + */ + + }, { + key: "getWidthRight", + value: function getWidthRight() { + return this.width / 2; + } + }]); + + return BoxItem; +}(Item); + +/** + * @constructor PointItem + * @extends Item + */ + +var PointItem = +/*#__PURE__*/ +function (_Item) { + inherits$1(PointItem, _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) { + var _this; + + classCallCheck$1(this, PointItem); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(PointItem).call(this, data, conversion, options)); + _this.props = { + dot: { + top: 0, + width: 0, + height: 0 + }, + content: { + height: 0, + marginLeft: 0, + marginRight: 0 + } + }; // validate data + + if (data) { + if (data.start == undefined) { + throw new Error("Property \"start\" missing in item ".concat(data)); + } + } + + return _this; + } + /** + * Check whether this item is visible inside given range + * @param {{start: number, end: number}} range with a timestamp for start and end + * @returns {boolean} True if visible + */ + + + createClass$1(PointItem, [{ + key: "isVisible", + value: function isVisible(range) { + if (this.cluster) { + return false; + } // determine visibility + + + var widthInMs = this.width * range.getMillisecondsPerPixel(); + return this.data.start.getTime() + widthInMs > range.start && this.data.start < range.end; + } + /** + * create DOM element + * @private + */ + + }, { + key: "_createDomElement", + value: function _createDomElement() { + if (!this.dom) { + // create DOM + this.dom = {}; // background box + + this.dom.point = document.createElement('div'); // className is updated in redraw() + // contents box, right from the dot + + this.dom.content = document.createElement('div'); + this.dom.content.className = 'vis-item-content'; + this.dom.point.appendChild(this.dom.content); // dot at start + + this.dom.dot = document.createElement('div'); + this.dom.point.appendChild(this.dom.dot); // attach this item as attribute + + this.dom.point['vis-item'] = this; + this.dirty = true; + } + } + /** + * append DOM element + * @private + */ + + }, { + key: "_appendDomElement", + value: function _appendDomElement() { + if (!this.parent) { + throw new Error('Cannot redraw item: no parent attached'); + } + + if (!this.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(this.dom.point); + } + + this.displayed = true; + } + /** + * update dirty DOM components + * @private + */ + + }, { + key: "_updateDirtyDomComponents", + value: function _updateDirtyDomComponents() { + // 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._updateDataAttributes(this.dom.point); + + this._updateStyle(this.dom.point); + + var editable = this.editable.updateTime || this.editable.updateGroup; // update class + + var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly'); + this.dom.point.className = "vis-item vis-point".concat(className); + this.dom.dot.className = "vis-item vis-dot".concat(className); + } + } + /** + * get DOM component sizes + * @return {object} + * @private + */ + + }, { + key: "_getDomComponentsSizes", + value: function _getDomComponentsSizes() { + return { + dot: { + width: this.dom.dot.offsetWidth, + height: this.dom.dot.offsetHeight + }, + content: { + width: this.dom.content.offsetWidth, + height: this.dom.content.offsetHeight + }, + point: { + width: this.dom.point.offsetWidth, + height: this.dom.point.offsetHeight + } + }; + } + /** + * update DOM components sizes + * @param {array} sizes + * @private + */ + + }, { + key: "_updateDomComponentsSizes", + value: function _updateDomComponentsSizes(sizes) { + // recalculate size of dot and contents + this.props.dot.width = sizes.dot.width; + this.props.dot.height = sizes.dot.height; + this.props.content.height = sizes.content.height; // resize contents + + if (this.options.rtl) { + this.dom.content.style.marginRight = "".concat(2 * this.props.dot.width, "px"); + } else { + this.dom.content.style.marginLeft = "".concat(2 * this.props.dot.width, "px"); + } //this.dom.content.style.marginRight = ... + 'px'; // TODO: margin right + // recalculate size + + + this.width = sizes.point.width; + this.height = sizes.point.height; // reposition the dot + + this.dom.dot.style.top = "".concat((this.height - this.props.dot.height) / 2, "px"); + var dotWidth = this.props.dot.width; + var translateX = this.options.rtl ? dotWidth / 2 * -1 : dotWidth / 2; + this.dom.dot.style.transform = "translateX(".concat(translateX, "px"); + this.dirty = false; + } + /** + * Repain DOM additionals + * @private + */ + + }, { + key: "_repaintDomAdditionals", + value: function _repaintDomAdditionals() { + this._repaintOnItemUpdateTimeTooltip(this.dom.point); + + this._repaintDragCenter(); + + this._repaintDeleteButton(this.dom.point); + } + /** + * Repaint the item + * @param {boolean} [returnQueue=false] return the queue + * @return {boolean} the redraw queue if returnQueue=true + */ + + }, { + key: "redraw", + value: function redraw(returnQueue) { + var _context, + _context2, + _context3, + _this2 = this, + _context5; + + var sizes; + var queue = [// create item DOM + bind$2(_context = this._createDomElement).call(_context, this), // append DOM to parent DOM + bind$2(_context2 = this._appendDomElement).call(_context2, this), // update dirty DOM + bind$2(_context3 = this._updateDirtyDomComponents).call(_context3, this), function () { + if (_this2.dirty) { + sizes = _this2._getDomComponentsSizes(); + } + }, function () { + if (_this2.dirty) { + var _context4; + + bind$2(_context4 = _this2._updateDomComponentsSizes).call(_context4, _this2)(sizes); + } + }, // repaint DOM additionals + bind$2(_context5 = this._repaintDomAdditionals).call(_context5, this)]; + + if (returnQueue) { + return queue; + } else { + var result; + + forEach$3(queue).call(queue, function (fn) { + result = fn(); + }); + + return result; + } + } + /** + * Reposition XY + */ + + }, { + key: "repositionXY", + value: function repositionXY() { + var rtl = this.options.rtl; + + var repositionXY = function repositionXY(element, x, y) { + var _context6; + + var rtl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + if (x === undefined && y === undefined) return; // If rtl invert the number. + + var directionX = rtl ? x * -1 : x; //no y. translate x + + if (y === undefined) { + element.style.transform = "translateX(".concat(directionX, "px)"); + return; + } //no x. translate y + + + if (x === undefined) { + element.style.transform = "translateY(".concat(y, "px)"); + return; + } + + element.style.transform = concat$2(_context6 = "translate(".concat(directionX, "px, ")).call(_context6, y, "px)"); + }; + + repositionXY(this.dom.point, this.pointX, this.pointY, rtl); + } + /** + * Show the item in the DOM (when not already visible). The items DOM will + * be created when needed. + * @param {boolean} [returnQueue=false] whether to return a queue of functions to execute instead of just executing them + * @return {boolean} the redraw queue if returnQueue=true + */ + + }, { + key: "show", + value: function show(returnQueue) { + if (!this.displayed) { + return this.redraw(returnQueue); + } + } + /** + * Hide the item from the DOM (when visible) + */ + + }, { + key: "hide", + value: function hide() { + if (this.displayed) { + if (this.dom.point.parentNode) { + this.dom.point.parentNode.removeChild(this.dom.point); + } + + this.displayed = false; + } + } + /** + * Reposition the item horizontally + * @Override + */ + + }, { + key: "repositionX", + value: function repositionX() { + var start = this.conversion.toScreen(this.data.start); + this.pointX = start; + + if (this.options.rtl) { + this.right = start - this.props.dot.width; + } else { + this.left = start - this.props.dot.width; + } + + this.repositionXY(); + } + /** + * Reposition the item vertically + * @Override + */ + + }, { + key: "repositionY", + value: function repositionY() { + var orientation = this.options.orientation.item; + + if (orientation == 'top') { + this.pointY = this.top; + } else { + this.pointY = this.parent.height - this.top - this.height; + } + + this.repositionXY(); + } + /** + * Return the width of the item left from its start date + * @return {number} + */ + + }, { + key: "getWidthLeft", + value: function getWidthLeft() { + return this.props.dot.width; + } + /** + * Return the width of the item right from its start date + * @return {number} + */ + + }, { + key: "getWidthRight", + value: function getWidthRight() { + return this.props.dot.width; + } + }]); + + return PointItem; +}(Item); + +/** + * @constructor RangeItem + * @extends Item + */ + +var RangeItem = +/*#__PURE__*/ +function (_Item) { + inherits$1(RangeItem, _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) { + var _this; + + classCallCheck$1(this, RangeItem); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(RangeItem).call(this, 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 ".concat(data.id)); + } + + if (data.end == undefined) { + throw new Error("Property \"end\" missing in item ".concat(data.id)); + } + } + + return _this; + } + /** + * Check whether this item is visible inside given range + * + * @param {timeline.Range} range with a timestamp for start and end + * @returns {boolean} True if visible + */ + + + createClass$1(RangeItem, [{ + key: "isVisible", + value: function isVisible(range) { + if (this.cluster) { + return false; + } // determine visibility + + + return this.data.start < range.end && this.data.end > range.start; + } + /** + * create DOM elements + * @private + */ + + }, { + key: "_createDomElement", + value: function _createDomElement() { + if (!this.dom) { + // create DOM + this.dom = {}; // background box + + this.dom.box = document.createElement('div'); // className is updated in redraw() + // frame box (to prevent the item contents from overflowing) + + this.dom.frame = document.createElement('div'); + this.dom.frame.className = 'vis-item-overflow'; + this.dom.box.appendChild(this.dom.frame); // visible frame box (showing the frame that is always visible) + + this.dom.visibleFrame = document.createElement('div'); + this.dom.visibleFrame.className = 'vis-item-visible-frame'; + this.dom.box.appendChild(this.dom.visibleFrame); // contents box + + this.dom.content = document.createElement('div'); + this.dom.content.className = 'vis-item-content'; + this.dom.frame.appendChild(this.dom.content); // attach this item as attribute + + this.dom.box['vis-item'] = this; + this.dirty = true; + } + } + /** + * append element to DOM + * @private + */ + + }, { + key: "_appendDomElement", + value: function _appendDomElement() { + if (!this.parent) { + throw new Error('Cannot redraw item: no parent attached'); + } + + if (!this.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(this.dom.box); + } + + this.displayed = true; + } + /** + * update dirty DOM components + * @private + */ + + }, { + key: "_updateDirtyDomComponents", + value: function _updateDirtyDomComponents() { + // update dirty DOM. 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._updateDataAttributes(this.dom.box); + + this._updateStyle(this.dom.box); + + var editable = this.editable.updateTime || this.editable.updateGroup; // update class + + var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly'); + this.dom.box.className = this.baseClassName + className; // 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'; + } + } + /** + * get DOM component sizes + * @return {object} + * @private + */ + + }, { + key: "_getDomComponentsSizes", + value: function _getDomComponentsSizes() { + // determine from css whether this box has overflow + this.overflow = window.getComputedStyle(this.dom.frame).overflow !== 'hidden'; + this.whiteSpace = window.getComputedStyle(this.dom.content).whiteSpace !== 'nowrap'; + return { + content: { + width: this.dom.content.offsetWidth + }, + box: { + height: this.dom.box.offsetHeight + } + }; + } + /** + * update DOM component sizes + * @param {array} sizes + * @private + */ + + }, { + key: "_updateDomComponentsSizes", + value: function _updateDomComponentsSizes(sizes) { + this.props.content.width = sizes.content.width; + this.height = sizes.box.height; + this.dom.content.style.maxWidth = ''; + this.dirty = false; + } + /** + * repaint DOM additional components + * @private + */ + + }, { + key: "_repaintDomAdditionals", + value: function _repaintDomAdditionals() { + this._repaintOnItemUpdateTimeTooltip(this.dom.box); + + this._repaintDeleteButton(this.dom.box); + + this._repaintDragCenter(); + + this._repaintDragLeft(); + + this._repaintDragRight(); + } + /** + * Repaint the item + * @param {boolean} [returnQueue=false] return the queue + * @return {boolean} the redraw queue if returnQueue=true + */ + + }, { + key: "redraw", + value: function redraw(returnQueue) { + var _context, + _context2, + _context3, + _this2 = this, + _context6; + + var sizes; + var queue = [// create item DOM + bind$2(_context = this._createDomElement).call(_context, this), // append DOM to parent DOM + bind$2(_context2 = this._appendDomElement).call(_context2, this), // update dirty DOM + bind$2(_context3 = this._updateDirtyDomComponents).call(_context3, this), function () { + if (_this2.dirty) { + var _context4; + + sizes = bind$2(_context4 = _this2._getDomComponentsSizes).call(_context4, _this2)(); + } + }, function () { + if (_this2.dirty) { + var _context5; + + bind$2(_context5 = _this2._updateDomComponentsSizes).call(_context5, _this2)(sizes); + } + }, // repaint DOM additionals + bind$2(_context6 = this._repaintDomAdditionals).call(_context6, this)]; + + if (returnQueue) { + return queue; + } else { + var result; + + forEach$3(queue).call(queue, function (fn) { + result = fn(); + }); + + return result; + } + } + /** + * Show the item in the DOM (when not already visible). The items DOM will + * be created when needed. + * @param {boolean} [returnQueue=false] whether to return a queue of functions to execute instead of just executing them + * @return {boolean} the redraw queue if returnQueue=true + */ + + }, { + key: "show", + value: function show(returnQueue) { + if (!this.displayed) { + return this.redraw(returnQueue); + } + } + /** + * Hide the item from the DOM (when visible) + */ + + }, { + key: "hide", + value: function hide() { + 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 + */ + + }, { + key: "repositionX", + value: function repositionX(limitSize) { + var parentWidth = this.parent.width; + var start = this.conversion.toScreen(this.data.start); + var end = this.conversion.toScreen(this.data.end); + var align = this.data.align === undefined ? this.options.align : this.data.align; + var contentStartPosition; + var contentWidth; // limit the width of the range, as browsers cannot draw very wide divs + // unless limitSize: false is explicitly set in item data + + if (this.data.limitSize !== false && (limitSize === undefined || limitSize === true)) { + if (start < -parentWidth) { + start = -parentWidth; + } + + if (end > 2 * parentWidth) { + end = 2 * parentWidth; + } + } //round to 3 decimals to compensate floating-point values rounding + + + var boxWidth = Math.max(Math.round((end - start) * 1000) / 1000, 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.transform = "translateX(".concat(this.right * -1, "px)"); + } else { + this.dom.box.style.transform = "translateX(".concat(this.left, "px)"); + } + + this.dom.box.style.width = "".concat(boxWidth, "px"); + + if (this.whiteSpace) { + this.height = this.dom.box.offsetHeight; + } + + switch (align) { + case 'left': + this.dom.content.style.transform = 'translateX(0)'; + break; + + case 'right': + if (this.options.rtl) { + var translateX = Math.max(boxWidth - contentWidth, 0) * -1; + this.dom.content.style.transform = "translateX(".concat(translateX, "px)"); + } else { + this.dom.content.style.transform = "translateX(".concat(Math.max(boxWidth - contentWidth, 0), "px)"); + } + + break; + + case 'center': + if (this.options.rtl) { + var _translateX = Math.max((boxWidth - contentWidth) / 2, 0) * -1; + + this.dom.content.style.transform = "translateX(".concat(_translateX, "px)"); + } else { + this.dom.content.style.transform = "translateX(".concat(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) { + var _translateX2 = contentStartPosition * -1; + + this.dom.content.style.transform = "translateX(".concat(_translateX2, "px)"); + } else { + this.dom.content.style.transform = "translateX(".concat(contentStartPosition, "px)"); // this.dom.content.style.width = `calc(100% - ${contentStartPosition}px)`; + } + + } + } + /** + * Reposition the item vertically + * @Override + */ + + }, { + key: "repositionY", + value: function repositionY() { + var orientation = this.options.orientation.item; + var box = this.dom.box; + + if (orientation == 'top') { + box.style.top = "".concat(this.top, "px"); + } else { + box.style.top = "".concat(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 + */ + + }, { + key: "_repaintDragLeft", + value: function _repaintDragLeft() { + if ((this.selected || this.options.itemsAlwaysDraggable.range) && 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.options.itemsAlwaysDraggable.range && 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 + */ + + }, { + key: "_repaintDragRight", + value: function _repaintDragRight() { + if ((this.selected || this.options.itemsAlwaysDraggable.range) && 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.options.itemsAlwaysDraggable.range && this.dom.dragRight) { + // delete drag area + if (this.dom.dragRight.parentNode) { + this.dom.dragRight.parentNode.removeChild(this.dom.dragRight); + } + + this.dom.dragRight = null; + } + } + }]); + + return RangeItem; +}(Item); + +RangeItem.prototype.baseClassName = 'vis-item vis-range'; + +/** + * @constructor BackgroundItem + * @extends Item + */ + +var BackgroundItem = +/*#__PURE__*/ +function (_Item) { + inherits$1(BackgroundItem, _Item); + + /** + * @constructor BackgroundItem + * @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) { + var _this; + + classCallCheck$1(this, BackgroundItem); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(BackgroundItem).call(this, 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 ".concat(data.id)); + } + + if (data.end == undefined) { + throw new Error("Property \"end\" missing in item ".concat(data.id)); + } + } + + return _this; + } + /** + * Check whether this item is visible inside given range + * @param {timeline.Range} range with a timestamp for start and end + * @returns {boolean} True if visible + */ + + + createClass$1(BackgroundItem, [{ + key: "isVisible", + value: function isVisible(range) { + // determine visibility + return this.data.start < range.end && this.data.end > range.start; + } + /** + * create DOM element + * @private + */ + + }, { + key: "_createDomElement", + value: function _createDomElement() { + if (!this.dom) { + // create DOM + this.dom = {}; // background box + + this.dom.box = document.createElement('div'); // className is updated in redraw() + // frame box (to prevent the item contents from overflowing + + this.dom.frame = document.createElement('div'); + this.dom.frame.className = 'vis-item-overflow'; + this.dom.box.appendChild(this.dom.frame); // contents box + + this.dom.content = document.createElement('div'); + this.dom.content.className = 'vis-item-content'; + this.dom.frame.appendChild(this.dom.content); // Note: we do NOT attach this item as attribute to the DOM, + // such that background items cannot be selected + //this.dom.box['vis-item'] = this; + + this.dirty = true; + } + } + /** + * append DOM element + * @private + */ + + }, { + key: "_appendDomElement", + value: function _appendDomElement() { + if (!this.parent) { + throw new Error('Cannot redraw item: no parent attached'); + } + + if (!this.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(this.dom.box); + } + + this.displayed = true; + } + /** + * update DOM Dirty components + * @private + */ + + }, { + key: "_updateDirtyDomComponents", + value: function _updateDirtyDomComponents() { + // update dirty DOM. 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._updateDataAttributes(this.dom.content); + + this._updateStyle(this.dom.box); // update class + + + var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : ''); + this.dom.box.className = this.baseClassName + className; + } + } + /** + * get DOM components sizes + * @return {object} + * @private + */ + + }, { + key: "_getDomComponentsSizes", + value: function _getDomComponentsSizes() { + // determine from css whether this box has overflow + this.overflow = window.getComputedStyle(this.dom.content).overflow !== 'hidden'; + return { + content: { + width: this.dom.content.offsetWidth + } + }; + } + /** + * update DOM components sizes + * @param {object} sizes + * @private + */ + + }, { + key: "_updateDomComponentsSizes", + value: function _updateDomComponentsSizes(sizes) { + // recalculate size + this.props.content.width = sizes.content.width; + this.height = 0; // set height zero, so this item will be ignored when stacking items + + this.dirty = false; + } + /** + * repaint DOM additionals + * @private + */ + + }, { + key: "_repaintDomAdditionals", + value: function _repaintDomAdditionals() {} + /** + * Repaint the item + * @param {boolean} [returnQueue=false] return the queue + * @return {boolean} the redraw result or the redraw queue if returnQueue=true + */ + + }, { + key: "redraw", + value: function redraw(returnQueue) { + var _context, + _context2, + _context3, + _this2 = this, + _context6; + + var sizes; + var queue = [// create item DOM + bind$2(_context = this._createDomElement).call(_context, this), // append DOM to parent DOM + bind$2(_context2 = this._appendDomElement).call(_context2, this), bind$2(_context3 = this._updateDirtyDomComponents).call(_context3, this), function () { + if (_this2.dirty) { + var _context4; + + sizes = bind$2(_context4 = _this2._getDomComponentsSizes).call(_context4, _this2)(); + } + }, function () { + if (_this2.dirty) { + var _context5; + + bind$2(_context5 = _this2._updateDomComponentsSizes).call(_context5, _this2)(sizes); + } + }, // repaint DOM additionals + bind$2(_context6 = this._repaintDomAdditionals).call(_context6, this)]; + + if (returnQueue) { + return queue; + } else { + var result; + + forEach$3(queue).call(queue, function (fn) { + result = fn(); + }); + + return result; + } + } + /** + * Reposition the item vertically + * @Override + */ + + }, { + key: "repositionY", + value: function repositionY(margin) { + // eslint-disable-line no-unused-vars + var height; + var orientation = this.options.orientation.item; // 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; + this.dom.box.style.height = "".concat(this.parent.subgroups[itemSubgroup].height, "px"); + + if (orientation == 'top') { + this.dom.box.style.top = "".concat(this.parent.top + this.parent.subgroups[itemSubgroup].top, "px"); + } else { + this.dom.box.style.top = "".concat(this.parent.top + this.parent.height - this.parent.subgroups[itemSubgroup].top - this.parent.subgroups[itemSubgroup].height, "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.bottom = orientation == 'bottom' ? '0' : ''; + this.dom.box.style.top = orientation == 'top' ? '0' : ''; + } else { + height = this.parent.height; // same alignment for items when orientation is top or bottom + + this.dom.box.style.top = "".concat(this.parent.top, "px"); + this.dom.box.style.bottom = ''; + } + } + + this.dom.box.style.height = "".concat(height, "px"); + } + }]); + + return BackgroundItem; +}(Item); + +BackgroundItem.prototype.baseClassName = 'vis-item vis-background'; +BackgroundItem.prototype.stack = 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; + +/** + * Popup is a class to create a popup window with some text + */ + +var Popup = +/*#__PURE__*/ +function () { + /** + * @param {Element} container The container object. + * @param {string} overflowMethod How the popup should act to overflowing ('flip', 'cap' or 'none') + */ + function Popup(container, overflowMethod) { + classCallCheck$1(this, Popup); + + this.container = container; + this.overflowMethod = overflowMethod || 'cap'; + this.x = 0; + this.y = 0; + this.padding = 5; + this.hidden = false; // create the frame + + this.frame = document.createElement('div'); + this.frame.className = 'vis-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$1(Popup, [{ + key: "setPosition", + value: function setPosition(x, y) { + this.x = _parseInt$3(x); + this.y = _parseInt$3(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 left = 0, + top = 0; + + if (this.overflowMethod == 'flip' || this.overflowMethod == 'none') { + var isLeft = false, + isTop = true; // Where around the position it's located + + if (this.overflowMethod == 'flip') { + if (this.y - height < this.padding) { + isTop = false; + } + + if (this.x + width > maxWidth - this.padding) { + isLeft = true; + } + } + + if (isLeft) { + left = this.x - width; + } else { + left = this.x; + } + + if (isTop) { + top = this.y - height; + } else { + top = this.y; + } + } else { + // this.overflowMethod == 'cap' + top = this.y - height; + + if (top + height + this.padding > maxHeight) { + top = maxHeight - height - this.padding; + } + + if (top < this.padding) { + top = this.padding; + } + + 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.left = "0"; + this.frame.style.top = "0"; + this.frame.style.visibility = "hidden"; + } + /** + * Remove the popup window + */ + + }, { + key: "destroy", + value: function destroy() { + this.frame.parentNode.removeChild(this.frame); // Remove element from DOM + } + }]); + + return Popup; +}(); + +var $every = arrayIteration.every; // `Array.prototype.every` method +// https://tc39.github.io/ecma262/#sec-array.prototype.every + +_export({ + target: 'Array', + proto: true, + forced: sloppyArrayMethod('every') +}, { + every: function every(callbackfn + /* , thisArg */ + ) { + return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var every = entryVirtual('Array').every; + +var ArrayPrototype$c = Array.prototype; + +var every_1 = function (it) { + var own = it.every; + return it === ArrayPrototype$c || it instanceof Array && own === ArrayPrototype$c.every ? every : own; +}; + +var every$1 = every_1; + +var every$2 = every$1; + +var propertyIsEnumerable = objectPropertyIsEnumerable.f; // `Object.{ entries, values }` methods implementation + +var createMethod$4 = function (TO_ENTRIES) { + return function (it) { + var O = toIndexedObject(it); + var keys = objectKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + + while (length > i) { + key = keys[i++]; + + if (!descriptors || propertyIsEnumerable.call(O, key)) { + result.push(TO_ENTRIES ? [key, O[key]] : O[key]); + } + } + + return result; + }; +}; + +var objectToArray = { + // `Object.entries` method + // https://tc39.github.io/ecma262/#sec-object.entries + entries: createMethod$4(true), + // `Object.values` method + // https://tc39.github.io/ecma262/#sec-object.values + values: createMethod$4(false) +}; + +var $values = objectToArray.values; // `Object.values` method +// https://tc39.github.io/ecma262/#sec-object.values + +_export({ + target: 'Object', + stat: true +}, { + values: function values(O) { + return $values(O); + } +}); + +var values = path.Object.values; + +var values$1 = values; + +var values$2 = values$1; + +var createMethod$5 = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction(callbackfn); + var O = toObject(that); + var self = indexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + + index += i; + + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + + for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + + return memo; + }; +}; + +var arrayReduce = { + // `Array.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduce + left: createMethod$5(false), + // `Array.prototype.reduceRight` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright + right: createMethod$5(true) +}; + +var $reduce = arrayReduce.left; // `Array.prototype.reduce` method +// https://tc39.github.io/ecma262/#sec-array.prototype.reduce + +_export({ + target: 'Array', + proto: true, + forced: sloppyArrayMethod('reduce') +}, { + reduce: function reduce(callbackfn + /* , initialValue */ + ) { + return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +var reduce = entryVirtual('Array').reduce; + +var ArrayPrototype$d = Array.prototype; + +var reduce_1 = function (it) { + var own = it.reduce; + return it === ArrayPrototype$d || it instanceof Array && own === ArrayPrototype$d.reduce ? reduce : own; +}; + +var reduce$1 = reduce_1; + +var reduce$2 = reduce$1; + +/** + * ClusterItem + */ + +var ClusterItem = +/*#__PURE__*/ +function (_Item) { + inherits$1(ClusterItem, _Item); + + /** + * @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 ClusterItem(data, conversion, options) { + var _this; + + classCallCheck$1(this, ClusterItem); + + var modifiedOptions = assign$4({}, { + fitOnDoubleClick: true + }, options, { + editable: false + }); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(ClusterItem).call(this, data, conversion, modifiedOptions)); + _this.props = { + content: { + width: 0, + height: 0 + } + }; + + if (!data || data.uiItems == undefined) { + throw new Error('Property "uiItems" missing in item ' + data.id); + } + + _this.id = util$2.randomUUID(); + _this.group = data.group; + + _this._setupRange(); + + _this.emitter = _this.data.eventEmitter; + _this.range = _this.data.range; + _this.attached = false; + _this.isCluster = true; + _this.data.isCluster = true; + return _this; + } + /** + * check if there are items + * @return {boolean} + */ + + + createClass$1(ClusterItem, [{ + key: "hasItems", + value: function hasItems() { + return this.data.uiItems && this.data.uiItems.length && this.attached; + } + /** + * set UI items + * @param {array} items + */ + + }, { + key: "setUiItems", + value: function setUiItems(items) { + this.detach(); + this.data.uiItems = items; + + this._setupRange(); + + this.attach(); + } + /** + * check is visible + * @param {object} range + * @return {boolean} + */ + + }, { + key: "isVisible", + value: function isVisible(range) { + var rangeWidth = this.data.end ? this.data.end - this.data.start : 0; + var widthInMs = this.width * range.getMillisecondsPerPixel(); + var end = Math.max(rangeWidth, this.data.start.getTime() + widthInMs); + return this.data.start < range.end && end > range.start && this.hasItems(); + } + /** + * get cluster data + * @return {object} + */ + + }, { + key: "getData", + value: function getData() { + return { + isCluster: true, + id: this.id, + items: this.data.items || [], + data: this.data + }; + } + /** + * redraw cluster item + * @param {boolean} returnQueue + * @return {boolean} + */ + + }, { + key: "redraw", + value: function redraw(returnQueue) { + var _context, _context2, _context3, _context4, _context5, _context7; + + var sizes; + var queue = [// create item DOM + bind$2(_context = this._createDomElement).call(_context, this), // append DOM to parent DOM + bind$2(_context2 = this._appendDomElement).call(_context2, this), // update dirty DOM + bind$2(_context3 = this._updateDirtyDomComponents).call(_context3, this), bind$2(_context4 = function _context4() { + if (this.dirty) { + sizes = this._getDomComponentsSizes(); + } + }).call(_context4, this), bind$2(_context5 = function _context5() { + if (this.dirty) { + var _context6; + + bind$2(_context6 = this._updateDomComponentsSizes).call(_context6, this)(sizes); + } + }).call(_context5, this), // repaint DOM additionals + bind$2(_context7 = this._repaintDomAdditionals).call(_context7, this)]; + + if (returnQueue) { + return queue; + } else { + var result; + + forEach$3(queue).call(queue, function (fn) { + result = fn(); + }); + + return result; + } + } + /** + * show cluster item + */ + + }, { + key: "show", + value: function show() { + if (!this.displayed) { + this.redraw(); + } + } + /** + * Hide the item from the DOM (when visible) + */ + + }, { + key: "hide", + value: function hide() { + if (this.displayed) { + var dom = this.dom; + + if (dom.box.parentNode) { + dom.box.parentNode.removeChild(dom.box); + } + + if (this.options.showStipes) { + if (dom.line.parentNode) { + dom.line.parentNode.removeChild(dom.line); + } + + if (dom.dot.parentNode) { + dom.dot.parentNode.removeChild(dom.dot); + } + } + + this.displayed = false; + } + } + /** + * reposition item x axis + */ + + }, { + key: "repositionX", + value: function repositionX() { + var start = this.conversion.toScreen(this.data.start); + var end = this.data.end ? this.conversion.toScreen(this.data.end) : 0; + + if (end) { + this.repositionXWithRanges(start, end); + } else { + var align = this.data.align === undefined ? this.options.align : this.data.align; + this.repositionXWithoutRanges(start, align); + } + + if (this.options.showStipes) { + this.dom.line.style.display = this._isStipeVisible() ? 'block' : 'none'; + this.dom.dot.style.display = this._isStipeVisible() ? 'block' : 'none'; + + if (this._isStipeVisible()) { + this.repositionStype(start, end); + } + } + } + /** + * reposition item stype + * @param {date} start + * @param {date} end + */ + + }, { + key: "repositionStype", + value: function repositionStype(start, end) { + this.dom.line.style.display = 'block'; + this.dom.dot.style.display = 'block'; + var lineOffsetWidth = this.dom.line.offsetWidth; + var dotOffsetWidth = this.dom.dot.offsetWidth; + + if (end) { + var lineOffset = lineOffsetWidth + start + (end - start) / 2; + var dotOffset = lineOffset - dotOffsetWidth / 2; + var lineOffsetDirection = this.options.rtl ? lineOffset * -1 : lineOffset; + var dotOffsetDirection = this.options.rtl ? dotOffset * -1 : dotOffset; + this.dom.line.style.transform = "translateX(".concat(lineOffsetDirection, ")px"); + this.dom.dot.style.transform = "translateX(".concat(dotOffsetDirection, "px)"); + } else { + var _lineOffsetDirection = this.options.rtl ? start * -1 : start; + + var _dotOffsetDirection = this.options.rtl ? (start - dotOffsetWidth / 2) * -1 : start - dotOffsetWidth / 2; + + this.dom.line.style.transform = "".concat(_lineOffsetDirection, "px"); + this.dom.dot.style.transform = "".concat(_dotOffsetDirection, "px"); + } + } + /** + * reposition x without ranges + * @param {date} start + * @param {string} align + */ + + }, { + key: "repositionXWithoutRanges", + value: function repositionXWithoutRanges(start, 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'; + } else { + this.left = start - this.width; // reposition box, line, and dot + + this.dom.box.style.left = this.left + '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'; + } else { + this.left = start; // reposition box, line, and dot + + this.dom.box.style.left = this.left + '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'; + } else { + this.left = start - this.width / 2; // reposition box, line, and dot + + this.dom.box.style.left = this.left + 'px'; + } + } + } + /** + * reposition x with ranges + * @param {date} start + * @param {date} end + */ + + }, { + key: "repositionXWithRanges", + value: function repositionXWithRanges(start, end) { + var boxWidth = Math.round(Math.max(end - start + 0.5, 1)); + + if (this.options.rtl) { + this.right = start; + } else { + this.left = start; + } + + this.width = Math.max(boxWidth, this.minWidth || 0); + + 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'; + } + /** + * reposition item y axis + */ + + }, { + key: "repositionY", + value: function repositionY() { + var orientation = this.options.orientation.item; + var box = this.dom.box; + + if (orientation == 'top') { + box.style.top = (this.top || 0) + 'px'; + } else { + // orientation 'bottom' + box.style.top = (this.parent.height - this.top - this.height || 0) + 'px'; + } + + if (this.options.showStipes) { + if (orientation == 'top') { + this.dom.line.style.top = '0'; + this.dom.line.style.height = this.parent.top + this.top + 1 + 'px'; + this.dom.line.style.bottom = ''; + } else { + // orientation 'bottom' + var itemSetHeight = this.parent.itemSet.props.height; + var lineHeight = itemSetHeight - this.parent.top - this.parent.height + this.top; + this.dom.line.style.top = itemSetHeight - lineHeight + 'px'; + this.dom.line.style.bottom = '0'; + } + + this.dom.dot.style.top = -this.dom.dot.offsetHeight / 2 + 'px'; + } + } + /** + * get width left + * @return {number} + */ + + }, { + key: "getWidthLeft", + value: function getWidthLeft() { + return this.width / 2; + } + /** + * get width right + * @return {number} + */ + + }, { + key: "getWidthRight", + value: function getWidthRight() { + return this.width / 2; + } + /** + * move cluster item + */ + + }, { + key: "move", + value: function move() { + this.repositionX(); + this.repositionY(); + } + /** + * attach + */ + + }, { + key: "attach", + value: function attach() { + var _context8; + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = getIterator$2(this.data.uiItems), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + item.cluster = this; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + this.data.items = map$2(_context8 = this.data.uiItems).call(_context8, function (item) { + return item.data; + }); + this.attached = true; + this.dirty = true; + } + /** + * detach + * @param {boolean} detachFromParent + * @return {void} + */ + + }, { + key: "detach", + value: function detach() { + var detachFromParent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (!this.hasItems()) { + return; + } + + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = getIterator$2(this.data.uiItems), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var item = _step2.value; + delete item.cluster; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + this.attached = false; + + if (detachFromParent && this.group) { + this.group.remove(this); + this.group = null; + } + + this.data.items = []; + this.dirty = true; + } + /** + * handle on double click + */ + + }, { + key: "_onDoubleClick", + value: function _onDoubleClick() { + this._fit(); + } + /** + * set range + */ + + }, { + key: "_setupRange", + value: function _setupRange() { + var _context9, _context10, _context11; + + var stats = map$2(_context9 = this.data.uiItems).call(_context9, function (item) { + return { + start: item.data.start.valueOf(), + end: item.data.end ? item.data.end.valueOf() : item.data.start.valueOf() + }; + }); + + this.data.min = Math.min.apply(Math, toConsumableArray$2(map$2(stats).call(stats, function (s) { + return Math.min(s.start, s.end || s.start); + }))); + this.data.max = Math.max.apply(Math, toConsumableArray$2(map$2(stats).call(stats, function (s) { + return Math.max(s.start, s.end || s.start); + }))); + + var centers = map$2(_context10 = this.data.uiItems).call(_context10, function (item) { + return item.center; + }); + + var avg = reduce$2(centers).call(centers, function (sum, value) { + return sum + value; + }, 0) / this.data.uiItems.length; + + if (some$2(_context11 = this.data.uiItems).call(_context11, function (item) { + return item.data.end; + })) { + // contains ranges + this.data.start = new Date(this.data.min); + this.data.end = new Date(this.data.max); + } else { + this.data.start = new Date(avg); + this.data.end = null; + } + } + /** + * get UI items + * @return {array} + */ + + }, { + key: "_getUiItems", + value: function _getUiItems() { + var _this2 = this; + + if (this.data.uiItems && this.data.uiItems.length) { + var _context12; + + return filter$2(_context12 = this.data.uiItems).call(_context12, function (item) { + return item.cluster === _this2; + }); + } + + return []; + } + /** + * create DOM element + */ + + }, { + key: "_createDomElement", + value: function _createDomElement() { + if (!this.dom) { + // create DOM + this.dom = {}; // create main box + + this.dom.box = document.createElement('DIV'); // contents box (inside the background box). used for making margins + + this.dom.content = document.createElement('DIV'); + this.dom.content.className = 'vis-item-content'; + this.dom.box.appendChild(this.dom.content); + + if (this.options.showStipes) { + // line to axis + this.dom.line = document.createElement('DIV'); + this.dom.line.className = 'vis-cluster-line'; + this.dom.line.style.display = 'none'; // dot on axis + + this.dom.dot = document.createElement('DIV'); + this.dom.dot.className = 'vis-cluster-dot'; + this.dom.dot.style.display = 'none'; + } + + if (this.options.fitOnDoubleClick) { + var _context13; + + this.dom.box.ondblclick = bind$2(_context13 = ClusterItem.prototype._onDoubleClick).call(_context13, this); + } // attach this item as attribute + + + this.dom.box['vis-item'] = this; + this.dirty = true; + } + } + /** + * append element to DOM + */ + + }, { + key: "_appendDomElement", + value: function _appendDomElement() { + if (!this.parent) { + throw new Error('Cannot redraw item: no parent attached'); + } + + if (!this.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(this.dom.box); + } + + var background = this.parent.dom.background; + + if (this.options.showStipes) { + if (!this.dom.line.parentNode) { + if (!background) throw new Error('Cannot redraw item: parent has no background container element'); + background.appendChild(this.dom.line); + } + + if (!this.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(this.dom.dot); + } + } + + this.displayed = true; + } + /** + * update dirty DOM components + */ + + }, { + key: "_updateDirtyDomComponents", + value: function _updateDirtyDomComponents() { + // 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._updateDataAttributes(this.dom.box); + + this._updateStyle(this.dom.box); // update class + + + var className = this.baseClassName + ' ' + (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + ' vis-readonly'; + this.dom.box.className = 'vis-item ' + className; + + if (this.options.showStipes) { + this.dom.line.className = 'vis-item vis-cluster-line ' + (this.selected ? ' vis-selected' : ''); + this.dom.dot.className = 'vis-item vis-cluster-dot ' + (this.selected ? ' vis-selected' : ''); + } + + if (this.data.end) { + // 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'; + } + } + } + /** + * get DOM components sizes + * @return {object} + */ + + }, { + key: "_getDomComponentsSizes", + value: function _getDomComponentsSizes() { + return { + previous: { + right: this.dom.box.style.right, + left: this.dom.box.style.left + }, + box: { + width: this.dom.box.offsetWidth, + height: this.dom.box.offsetHeight + } + }; + } + /** + * update DOM components sizes + * @param {object} sizes + */ + + }, { + key: "_updateDomComponentsSizes", + value: function _updateDomComponentsSizes(sizes) { + if (this.options.rtl) { + this.dom.box.style.right = "0px"; + } else { + this.dom.box.style.left = "0px"; + } // recalculate size + + + if (!this.data.end) { + this.width = sizes.box.width; + } else { + this.minWidth = sizes.box.width; + } + + this.height = sizes.box.height; // restore previous position + + if (this.options.rtl) { + this.dom.box.style.right = sizes.previous.right; + } else { + this.dom.box.style.left = sizes.previous.left; + } + + this.dirty = false; + } + /** + * repaint DOM additional components + */ + + }, { + key: "_repaintDomAdditionals", + value: function _repaintDomAdditionals() { + this._repaintOnItemUpdateTimeTooltip(this.dom.box); + } + /** + * check is stripe visible + * @return {number} + * @private + */ + + }, { + key: "_isStipeVisible", + value: function _isStipeVisible() { + return this.minWidth >= this.width || !this.data.end; + } + /** + * get fit range + * @return {object} + * @private + */ + + }, { + key: "_getFitRange", + value: function _getFitRange() { + var offset = 0.05 * (this.data.max - this.data.min) / 2; + return { + fitStart: this.data.min - offset, + fitEnd: this.data.max + offset + }; + } + /** + * fit + * @private + */ + + }, { + key: "_fit", + value: function _fit() { + if (this.emitter) { + var _this$_getFitRange = this._getFitRange(), + fitStart = _this$_getFitRange.fitStart, + fitEnd = _this$_getFitRange.fitEnd; + + var fitArgs = { + start: new Date(fitStart), + end: new Date(fitEnd), + animation: true + }; + this.emitter.emit('fit', fitArgs); + } + } + /** + * get item data + * @return {object} + * @private + */ + + }, { + key: "_getItemData", + value: function _getItemData() { + return this.data; + } + }]); + + return ClusterItem; +}(Item); + +ClusterItem.prototype.baseClassName = 'vis-item vis-range vis-cluster'; + +var UNGROUPED$1 = '__ungrouped__'; // reserved group id for ungrouped items + +var BACKGROUND$1 = '__background__'; // reserved group id for background items without group + +var ReservedGroupIds$1 = { + UNGROUPED: UNGROUPED$1, + BACKGROUND: BACKGROUND$1 + /** + * An Cluster generator generates cluster items + */ + +}; + +var ClusterGenerator = +/*#__PURE__*/ +function () { + /** + * @param {ItemSet} itemSet itemsSet instance + * @constructor ClusterGenerator + */ + function ClusterGenerator(itemSet) { + classCallCheck$1(this, ClusterGenerator); + + this.itemSet = itemSet; + this.groups = {}; + this.cache = {}; + this.cache[-1] = []; + } + /** + * @param {Object} itemData 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 + * @return {Object} newItem + */ + + + createClass$1(ClusterGenerator, [{ + key: "createClusterItem", + value: function createClusterItem(itemData, conversion, options) { + var newItem = new ClusterItem(itemData, conversion, options); + return newItem; + } + /** + * Set the items to be clustered. + * This will clear cached clusters. + * @param {Item[]} items + * @param {Object} [options] Available options: + * {boolean} applyOnChangedLevel + * If true (default), the changed data is applied + * as soon the cluster level changes. If false, + * The changed data is applied immediately + */ + + }, { + key: "setItems", + value: function setItems(items, options) { + this.items = items || []; + this.dataChanged = true; + this.applyOnChangedLevel = false; + + if (options && options.applyOnChangedLevel) { + this.applyOnChangedLevel = options.applyOnChangedLevel; + } + } + /** + * Update the current data set: clear cache, and recalculate the clustering for + * the current level + */ + + }, { + key: "updateData", + value: function updateData() { + this.dataChanged = true; + this.applyOnChangedLevel = false; + } + /** + * Cluster the items which are too close together + * @param {array} oldClusters + * @param {number} scale The scale of the current window : (windowWidth / (endDate - startDate)) + * @param {{maxItems: number, clusterCriteria: function, titleTemplate: string}} options + * @return {array} clusters + */ + + }, { + key: "getClusters", + value: function getClusters(oldClusters, scale, options) { + var _ref = typeof options === "boolean" ? {} : options, + maxItems = _ref.maxItems, + clusterCriteria = _ref.clusterCriteria; + + if (!clusterCriteria) { + clusterCriteria = function clusterCriteria() { + return true; + }; + } + + maxItems = maxItems || 1; + var level = -1; + var granularity = 2; + var timeWindow = 0; + + if (scale > 0) { + if (scale >= 1) { + return []; + } + + level = Math.abs(Math.round(Math.log(100 / scale) / Math.log(granularity))); + timeWindow = Math.abs(Math.pow(granularity, level)); + } // clear the cache when and re-generate groups the data when needed. + + + if (this.dataChanged) { + var levelChanged = level != this.cacheLevel; + var applyDataNow = this.applyOnChangedLevel ? levelChanged : true; + + if (applyDataNow) { + this._dropLevelsCache(); + + this._filterData(); + } + } + + this.cacheLevel = level; + var clusters = this.cache[level]; + + if (!clusters) { + clusters = []; + + for (var groupName in this.groups) { + if (this.groups.hasOwnProperty(groupName)) { + var items = this.groups[groupName]; + var iMax = items.length; + var i = 0; + + while (i < iMax) { + // find all items around current item, within the timeWindow + var item = items[i]; + var neighbors = 1; // start at 1, to include itself) + // loop through items left from the current item + + var j = i - 1; + + while (j >= 0 && item.center - items[j].center < timeWindow / 2) { + if (!items[j].cluster && clusterCriteria(item.data, items[j].data)) { + neighbors++; + } + + j--; + } // loop through items right from the current item + + + var k = i + 1; + + while (k < items.length && items[k].center - item.center < timeWindow / 2) { + if (clusterCriteria(item.data, items[k].data)) { + neighbors++; + } + + k++; + } // loop through the created clusters + + + var l = clusters.length - 1; + + while (l >= 0 && item.center - clusters[l].center < timeWindow) { + if (item.group == clusters[l].group && clusterCriteria(item.data, clusters[l].data)) { + neighbors++; + } + + l--; + } // aggregate until the number of items is within maxItems + + + if (neighbors > maxItems) { + // too busy in this window. + var num = neighbors - maxItems + 1; + var clusterItems = []; // append the items to the cluster, + // and calculate the average start for the cluster + + var m = i; + + while (clusterItems.length < num && m < items.length) { + if (clusterCriteria(items[m].data, items[m].data)) { + clusterItems.push(items[m]); + } + + m++; + } + + var groupId = this.itemSet.getGroupId(item.data); + var group = this.itemSet.groups[groupId] || this.itemSet.groups[ReservedGroupIds$1.UNGROUPED]; + + var cluster = this._getClusterForItems(clusterItems, group, oldClusters, options); + + clusters.push(cluster); + i += num; + } else { + delete item.cluster; + i += 1; + } + } + } + } + + this.cache[level] = clusters; + } + + return clusters; + } + /** + * Filter the items per group. + * @private + */ + + }, { + key: "_filterData", + value: function _filterData() { + // filter per group + var groups = {}; + this.groups = groups; // split the items per group + + for (var _i = 0, _Object$values = values$2(this.items); _i < _Object$values.length; _i++) { + var item = _Object$values[_i]; + // put the item in the correct group + var groupName = item.parent ? item.parent.groupId : ''; + var group = groups[groupName]; + + if (!group) { + group = []; + groups[groupName] = group; + } + + group.push(item); // calculate the center of the item + + if (item.data.start) { + if (item.data.end) { + // range + item.center = (item.data.start.valueOf() + item.data.end.valueOf()) / 2; + } else { + // box, dot + item.center = item.data.start.valueOf(); + } + } + } // sort the items per group + + + for (var currentGroupName in groups) { + if (groups.hasOwnProperty(currentGroupName)) { + var _context; + + sort$2(_context = groups[currentGroupName]).call(_context, function (a, b) { + return a.center - b.center; + }); + } + } + + this.dataChanged = false; + } + /** + * Create new cluster or return existing + * @private + * @param {array} clusterItems + * @param {object} group + * @param {array} oldClusters + * @param {object} options + * @returns {object} cluster + */ + + }, { + key: "_getClusterForItems", + value: function _getClusterForItems(clusterItems, group, oldClusters, options) { + var _context2; + + var oldClustersLookup = map$2(_context2 = oldClusters || []).call(_context2, function (cluster) { + var _context3; + + return { + cluster: cluster, + itemsIds: new set$3(map$2(_context3 = cluster.data.uiItems).call(_context3, function (item) { + return item.id; + })) + }; + }); + + var cluster; + + if (oldClustersLookup.length) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + var _loop = function _loop() { + var oldClusterData = _step.value; + + if (oldClusterData.itemsIds.size === clusterItems.length && every$2(clusterItems).call(clusterItems, function (clusterItem) { + return oldClusterData.itemsIds.has(clusterItem.id); + })) { + cluster = oldClusterData.cluster; + return "break"; + } + }; + + for (var _iterator = getIterator$2(oldClustersLookup), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ret = _loop(); + + if (_ret === "break") break; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + if (cluster) { + cluster.setUiItems(clusterItems); + + if (cluster.group !== group) { + if (cluster.group) { + cluster.group.remove(cluster); + } + + if (group) { + group.add(cluster); + cluster.group = group; + } + } + + return cluster; + } + + var titleTemplate = options.titleTemplate || ''; + var conversion = { + toScreen: this.itemSet.body.util.toScreen, + toTime: this.itemSet.body.util.toTime + }; + var clusterContent = '
' + clusterItems.length + '
'; + var title = titleTemplate.replace(/{count}/, clusterItems.length); + + var clusterOptions = assign$4({}, options, this.itemSet.options); + + var data = { + 'content': clusterContent, + 'title': title, + 'group': group, + 'uiItems': clusterItems, + 'eventEmitter': this.itemSet.body.emitter, + 'range': this.itemSet.body.range + }; + cluster = this.createClusterItem(data, conversion, clusterOptions); + + if (group) { + group.add(cluster); + cluster.group = group; + } + + cluster.attach(); + return cluster; + } + /** + * Drop cache + * @private + */ + + }, { + key: "_dropLevelsCache", + value: function _dropLevelsCache() { + this.cache = {}; + this.cacheLevel = -1; + this.cache[this.cacheLevel] = []; + } + }]); + + return ClusterGenerator; +}(); + +var UNGROUPED$2 = '__ungrouped__'; // reserved group id for ungrouped items + +var BACKGROUND$2 = '__background__'; // reserved group id for background items without group + +var ItemSet = +/*#__PURE__*/ +function (_Component) { + inherits$1(ItemSet, _Component); + + /** + * @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) { + var _this; + + classCallCheck$1(this, ItemSet); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(ItemSet).call(this)); + _this.body = body; + _this.defaultOptions = { + type: null, + // 'box', 'point', 'range', 'background' + orientation: { + item: 'bottom' // item orientation: 'top' or 'bottom' + + }, + align: 'auto', + // alignment of box items + stack: true, + stackSubgroups: true, + groupOrderSwap: function groupOrderSwap(fromGroup, toGroup, groups) { + // eslint-disable-line no-unused-vars + var targetOrder = toGroup.order; + toGroup.order = fromGroup.order; + fromGroup.order = targetOrder; + }, + groupOrder: 'order', + selectable: true, + multiselect: false, + itemsAlwaysDraggable: { + item: false, + range: false + }, + editable: { + updateTime: false, + updateGroup: false, + add: false, + remove: false, + overrideItems: false + }, + groupEditable: { + order: false, + add: false, + remove: false + }, + snap: TimeStep.snap, + // Only called when `objectData.target === 'item'. + onDropObjectOnItem: function onDropObjectOnItem(objectData, item, callback) { + callback(item); + }, + 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 + }, + showTooltips: true, + tooltip: { + followMouse: false, + overflowMethod: 'flip', + delay: 500 + }, + tooltipOnItemUpdateTime: false + }; // options is shared by this ItemSet and all its items + + _this.options = util$2.extend({}, _this.defaultOptions); + _this.options.rtl = options.rtl; + _this.options.onTimeout = options.onTimeout; // 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 = assertThisInitialized$1(_this); + + _this.itemsData = null; // DataSet + + _this.groupsData = null; // DataSet + + _this.itemsSettingTime = null; + _this.initialItemSetDrawn = false; + _this.userContinueNotBail = null; + _this.sequentialSelection = false; // listeners for the DataSet of the items + + _this.itemListeners = { + 'add': function add(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onAdd(params.items); + + if (me.options.cluster) { + me.clusterGenerator.setItems(me.items, { + applyOnChangedLevel: false + }); + } + + me.redraw(); + }, + 'update': function update(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onUpdate(params.items); + + if (me.options.cluster) { + me.clusterGenerator.setItems(me.items, { + applyOnChangedLevel: false + }); + } + + me.redraw(); + }, + 'remove': function remove(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onRemove(params.items); + + if (me.options.cluster) { + me.clusterGenerator.setItems(me.items, { + applyOnChangedLevel: false + }); + } + + me.redraw(); + } + }; // listeners for the DataSet of the groups + + _this.groupListeners = { + 'add': function add(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onAddGroups(params.items); + + if (me.groupsData && me.groupsData.length > 0) { + var _context; + + var groupsData = me.groupsData.getDataSet(); + + forEach$3(_context = groupsData.get()).call(_context, function (groupData) { + if (groupData.nestedGroups) { + var _context2; + + if (groupData.showNested != false) { + groupData.showNested = true; + } + + var updatedGroups = []; + + forEach$3(_context2 = groupData.nestedGroups).call(_context2, function (nestedGroupId) { + var updatedNestedGroup = groupsData.get(nestedGroupId); + + if (!updatedNestedGroup) { + return; + } + + updatedNestedGroup.nestedInGroup = groupData.id; + + if (groupData.showNested == false) { + updatedNestedGroup.visible = false; + } + + updatedGroups = concat$2(updatedGroups).call(updatedGroups, updatedNestedGroup); + }); + + groupsData.update(updatedGroups, senderId); + } + }); + } + }, + 'update': function update(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onUpdateGroups(params.items); + }, + 'remove': function remove(event, params, senderId) { + // eslint-disable-line no-unused-vars + 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.popup = null; + _this.popupTimer = null; + _this.touchParams = {}; // stores properties while dragging + + _this.groupTouchParams = { + group: null, + isDragging: false + }; // create the HTML DOM + + _this._create(); + + _this.setOptions(options); + + _this.clusters = []; + return _this; + } + /** + * Create the HTML DOM for the ItemSet + */ + + + createClass$1(ItemSet, [{ + key: "_create", + value: function _create() { + var _this2 = this, + _context3, + _context4, + _context5, + _context6, + _context7, + _context8, + _context9, + _context10, + _context11, + _context12, + _context13, + _context14, + _context15, + _context16, + _context17; + + var frame = document.createElement('div'); + frame.className = 'vis-itemset'; + frame['vis-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$2, null, this); + backgroundGroup.show(); + this.groups[BACKGROUND$2] = 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$1(this.body.dom.centerContainer); // drag items when selected + + this.hammer.on('hammer.input', function (event) { + if (event.isFirst) { + _this2._onTouch(event); + } + }); + this.hammer.on('panstart', bind$2(_context3 = this._onDragStart).call(_context3, this)); + this.hammer.on('panmove', bind$2(_context4 = this._onDrag).call(_context4, this)); + this.hammer.on('panend', bind$2(_context5 = this._onDragEnd).call(_context5, this)); + this.hammer.get('pan').set({ + threshold: 5, + direction: Hammer$1.ALL + }); // single select (or unselect) when tapping an item + + this.hammer.on('tap', bind$2(_context6 = this._onSelectItem).call(_context6, this)); // multi select when holding mouse/touch, or on ctrl+click + + this.hammer.on('press', bind$2(_context7 = this._onMultiSelectItem).call(_context7, this)); // add item on doubletap + + this.hammer.on('doubletap', bind$2(_context8 = this._onAddItem).call(_context8, this)); + + if (this.options.rtl) { + this.groupHammer = new Hammer$1(this.body.dom.rightContainer); + } else { + this.groupHammer = new Hammer$1(this.body.dom.leftContainer); + } + + this.groupHammer.on('tap', bind$2(_context9 = this._onGroupClick).call(_context9, this)); + this.groupHammer.on('panstart', bind$2(_context10 = this._onGroupDragStart).call(_context10, this)); + this.groupHammer.on('panmove', bind$2(_context11 = this._onGroupDrag).call(_context11, this)); + this.groupHammer.on('panend', bind$2(_context12 = this._onGroupDragEnd).call(_context12, this)); + this.groupHammer.get('pan').set({ + threshold: 5, + direction: Hammer$1.DIRECTION_VERTICAL + }); + this.body.dom.centerContainer.addEventListener('mouseover', bind$2(_context13 = this._onMouseOver).call(_context13, this)); + this.body.dom.centerContainer.addEventListener('mouseout', bind$2(_context14 = this._onMouseOut).call(_context14, this)); + this.body.dom.centerContainer.addEventListener('mousemove', bind$2(_context15 = this._onMouseMove).call(_context15, this)); // right-click on timeline + + this.body.dom.centerContainer.addEventListener('contextmenu', bind$2(_context16 = this._onDragEnd).call(_context16, this)); + this.body.dom.centerContainer.addEventListener('mousewheel', bind$2(_context17 = this._onMouseWheel).call(_context17, this)); // 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. + */ + + }, { + key: "setOptions", + value: function setOptions(options) { + var _this3 = this; + + if (options) { + var _context18, _context20; + + // copy all options that we know + var fields = ['type', 'rtl', 'align', 'order', 'stack', 'stackSubgroups', 'selectable', 'multiselect', 'sequentialSelection', 'multiselectPerGroup', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'visibleFrameTemplate', 'hide', 'snap', 'groupOrderSwap', 'showTooltips', 'tooltip', 'tooltipOnItemUpdateTime', 'groupHeightMode', 'onTimeout']; + util$2.selectiveExtend(fields, this.options, options); + + if ('itemsAlwaysDraggable' in options) { + if (typeof options.itemsAlwaysDraggable === 'boolean') { + this.options.itemsAlwaysDraggable.item = options.itemsAlwaysDraggable; + this.options.itemsAlwaysDraggable.range = false; + } else if (_typeof_1$2(options.itemsAlwaysDraggable) === 'object') { + util$2.selectiveExtend(['item', 'range'], this.options.itemsAlwaysDraggable, options.itemsAlwaysDraggable); // only allow range always draggable when item is always draggable as well + + if (!this.options.itemsAlwaysDraggable.item) { + this.options.itemsAlwaysDraggable.range = false; + } + } + } + + if ('sequentialSelection' in options) { + if (typeof options.sequentialSelection === 'boolean') { + this.options.sequentialSelection = options.sequentialSelection; + } + } + + if ('orientation' in options) { + if (typeof options.orientation === 'string') { + this.options.orientation.item = options.orientation === 'top' ? 'top' : 'bottom'; + } else if (_typeof_1$2(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_1$2(options.margin) === 'object') { + util$2.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_1$2(options.margin.item) === 'object') { + util$2.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item); + } + } + } + } + + forEach$3(_context18 = ['locale', 'locales']).call(_context18, function (key) { + if (key in options) { + _this3.options[key] = options[key]; + } + }); + + 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; + this.options.editable.overrideItems = false; + } else if (_typeof_1$2(options.editable) === 'object') { + util$2.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove', 'overrideItems'], 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_1$2(options.groupEditable) === 'object') { + util$2.selectiveExtend(['order', 'add', 'remove'], this.options.groupEditable, options.groupEditable); + } + } // callback functions + + + var addCallback = function addCallback(name) { + var fn = options[name]; + + if (fn) { + if (!(typeof fn === 'function')) { + var _context19; + + throw new Error(concat$2(_context19 = "option ".concat(name, " must be a function ")).call(_context19, name, "(item, callback)")); + } + + _this3.options[name] = fn; + } + }; + + forEach$3(_context20 = ['onDropObjectOnItem', 'onAdd', 'onUpdate', 'onRemove', 'onMove', 'onMoving', 'onAddGroup', 'onMoveGroup', 'onRemoveGroup']).call(_context20, addCallback); + + if (options.cluster) { + assign$4(this.options, { + cluster: options.cluster + }); + + if (!this.clusterGenerator) { + this.clusterGenerator = new ClusterGenerator(this); + } + + this.clusterGenerator.setItems(this.items, { + applyOnChangedLevel: false + }); + this.markDirty({ + refreshItems: true, + restackGroups: true + }); + this.redraw(); + } else if (this.clusterGenerator) { + this._detachAllClusters(); + + this.clusters = []; + this.clusterGenerator = null; + this.options.cluster = undefined; + this.markDirty({ + refreshItems: true, + restackGroups: true + }); + this.redraw(); + } else { + // 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] + */ + + }, { + key: "markDirty", + value: function markDirty(options) { + this.groupIds = []; + + if (options) { + if (options.refreshItems) { + forEach$3(util$2).call(util$2, this.items, function (item) { + item.dirty = true; + if (item.displayed) item.redraw(); + }); + } + + if (options.restackGroups) { + forEach$3(util$2).call(util$2, this.groups, function (group, key) { + if (key === BACKGROUND$2) return; + group.stackDirty = true; + }); + } + } + } + /** + * Destroy the ItemSet + */ + + }, { + key: "destroy", + value: function destroy() { + this.clearPopupTimer(); + this.hide(); + this.setItems(null); + this.setGroups(null); + this.hammer && this.hammer.destroy(); + this.groupHammer && this.groupHammer.destroy(); + this.hammer = null; + this.body = null; + this.conversion = null; + } + /** + * Hide the component from the DOM + */ + + }, { + key: "hide", + value: function hide() { + // 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). + */ + + }, { + key: "show", + value: function show() { + // 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) { + if (this.options.rtl) { + this.body.dom.right.appendChild(this.dom.labelSet); + } else { + this.body.dom.left.appendChild(this.dom.labelSet); + } + } + } + /** + * Activates the popup timer to show the given popup after a fixed time. + * @param {Popup} popup + */ + + }, { + key: "setPopupTimer", + value: function setPopupTimer(popup) { + this.clearPopupTimer(); + + if (popup) { + var delay = this.options.tooltip.delay || typeof this.options.tooltip.delay === 'number' ? this.options.tooltip.delay : 500; + this.popupTimer = setTimeout$2(function () { + popup.show(); + }, delay); + } + } + /** + * Clears the popup timer for the tooltip. + */ + + }, { + key: "clearPopupTimer", + value: function clearPopupTimer() { + if (this.popupTimer != null) { + clearTimeout(this.popupTimer); + this.popupTimer = null; + } + } + /** + * 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. + */ + + }, { + key: "setSelection", + value: function setSelection(ids) { + var _context21; + + if (ids == undefined) { + ids = []; + } + + if (!isArray$3(ids)) { + ids = [ids]; + } + + var idsToDeselect = filter$2(_context21 = this.selection).call(_context21, function (id) { + return indexOf$3(ids).call(ids, id) === -1; + }); // unselect currently selected items + + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = getIterator$2(idsToDeselect), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var selectedId = _step.value; + var item = this.getItemById(selectedId); + + if (item) { + item.unselect(); + } + } // select items + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + this.selection = toConsumableArray$2(ids); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = getIterator$2(ids), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var id = _step2.value; + + var _item2 = this.getItemById(id); + + if (_item2) { + _item2.select(); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + /** + * Get the selected items by their id + * @return {Array} ids The ids of the selected items + */ + + }, { + key: "getSelection", + value: function getSelection() { + var _context22; + + return concat$2(_context22 = this.selection).call(_context22, []); + } + /** + * Get the id's of the currently visible items. + * @returns {Array} The ids of the visible items + */ + + }, { + key: "getVisibleItems", + value: function getVisibleItems() { + var range = this.body.range.getRange(); + var right; + var left; + + if (this.options.rtl) { + right = this.body.util.toScreen(range.start); + left = this.body.util.toScreen(range.end); + } else { + left = this.body.util.toScreen(range.start); + 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.isVisible ? group.visibleItems : []; // filter the "raw" set with visibleItems into a set which is really + // visible by pixels + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = getIterator$2(rawVisibleItems), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var item = _step3.value; + + // 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); + } + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + } + + return ids; + } + /** + * Get the id's of the currently visible groups. + * @returns {Array} The ids of the visible groups + */ + + }, { + key: "getVisibleGroups", + value: function getVisibleGroups() { + var ids = []; + + for (var groupId in this.groups) { + if (this.groups.hasOwnProperty(groupId)) { + var group = this.groups[groupId]; + + if (group.isVisible) { + ids.push(groupId); + } + } + } + + return ids; + } + /** + * get item by id + * @param {string} id + * @return {object} item + */ + + }, { + key: "getItemById", + value: function getItemById(id) { + var _context23; + + return this.items[id] || find$2(_context23 = this.clusters).call(_context23, function (cluster) { + return cluster.id === id; + }); + } + /** + * Deselect a selected item + * @param {string | number} id + * @private + */ + + }, { + key: "_deselect", + value: function _deselect(id) { + var selection = this.selection; + + for (var i = 0, ii = selection.length; i < ii; i++) { + if (selection[i] == id) { + // non-strict comparison! + splice$2(selection).call(selection, i, 1); + + break; + } + } + } + /** + * Repaint the component + * @return {boolean} Returns true if the component is resized + */ + + }, { + key: "redraw", + value: function redraw() { + var _this4 = this; + + var margin = this.options.margin; + var range = this.body.range; + var asSize = util$2.option.asSize; + var options = this.options; + var orientation = options.orientation.item; + var resized = false; + var 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'; + + if (this.options.cluster) { + this._clusterItems(); + } // 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; + var scrolled = range.start != this.lastRangeStart; + var changedStackOption = options.stack != this.lastStack; + var changedStackSubgroupsOption = options.stackSubgroups != this.lastStackSubgroups; + var forceRestack = zoomed || scrolled || changedStackOption || changedStackSubgroupsOption; + this.lastVisibleInterval = visibleInterval; + this.lastRangeStart = range.start; + this.lastStack = options.stack; + this.lastStackSubgroups = options.stackSubgroups; + this.props.lastWidth = this.props.width; + + 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$2].redraw(range, nonFirstMargin, forceRestack); + var redrawQueue = {}; + var redrawQueueLength = 0; // collect redraw functions + + forEach$3(util$2).call(util$2, this.groups, function (group, key) { + if (key === BACKGROUND$2) return; + var groupMargin = group == firstGroup ? firstMargin : nonFirstMargin; + var returnQueue = true; + redrawQueue[key] = group.redraw(range, groupMargin, forceRestack, returnQueue); + redrawQueueLength = redrawQueue[key].length; + }); + + var needRedraw = redrawQueueLength > 0; + + if (needRedraw) { + (function () { + var redrawResults = {}; + + var _loop = function _loop(i) { + forEach$3(util$2).call(util$2, redrawQueue, function (fns, key) { + redrawResults[key] = fns[i](); + }); + }; + + for (var i = 0; i < redrawQueueLength; i++) { + _loop(i); + } // redraw all regular groups + + + forEach$3(util$2).call(util$2, _this4.groups, function (group, key) { + if (key === BACKGROUND$2) return; + var groupResized = redrawResults[key]; + resized = groupResized || resized; + height += group.height; + }); + + height = Math.max(height, minHeight); + })(); + } + + height = Math.max(height, minHeight); // 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'; + } + + this.initialItemSetDrawn = true; // 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 + */ + + }, { + key: "_firstGroup", + value: function _firstGroup() { + 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$2]; + return firstGroup || null; + } + /** + * Create or delete the group holding all ungrouped items. This group is used when + * there are no groups specified. + * @protected + */ + + }, { + key: "_updateUngrouped", + value: function _updateUngrouped() { + var ungrouped = this.groups[UNGROUPED$2]; + var item; + var itemId; + + if (this.groupsData) { + // remove the group holding all ungrouped items + if (ungrouped) { + ungrouped.hide(); + delete this.groups[UNGROUPED$2]; + + 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$2] = 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 + */ + + }, { + key: "getLabelSet", + value: function getLabelSet() { + return this.dom.labelSet; + } + /** + * Set items + * @param {vis.DataSet | null} items + */ + + }, { + key: "setItems", + value: function setItems(items) { + this.itemsSettingTime = new Date(); + var me = this; + var ids; + var 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 + forEach$3(util$2).call(util$2, 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; + + forEach$3(util$2).call(util$2, 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} + */ + + }, { + key: "getItems", + value: function getItems() { + return this.itemsData; + } + /** + * Set groups + * @param {vis.DataSet} groups + */ + + }, { + key: "setGroups", + value: function setGroups(groups) { + var me = this; + var ids; // unsubscribe from current dataset + + if (this.groupsData) { + forEach$3(util$2).call(util$2, 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) { + var _context24; + + // go over all groups nesting + var groupsData = this.groupsData; + + if (this.groupsData instanceof DataView) { + groupsData = this.groupsData.getDataSet(); + } + + forEach$3(_context24 = groupsData.get()).call(_context24, function (group) { + if (group.nestedGroups) { + var _context25; + + forEach$3(_context25 = group.nestedGroups).call(_context25, function (nestedGroupId) { + var updatedNestedGroup = groupsData.get(nestedGroupId); + updatedNestedGroup.nestedInGroup = group.id; + + if (group.showNested == false) { + updatedNestedGroup.visible = false; + } + + groupsData.update(updatedNestedGroup); + }); + } + }); // subscribe to new dataset + + + var id = this.id; + + forEach$3(util$2).call(util$2, 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(); + + if (this.options.cluster) { + this.clusterGenerator.updateData(); + + this._clusterItems(); + + this.markDirty({ + refreshItems: true, + restackGroups: true + }); + } + + this.body.emitter.emit('_change', { + queue: true + }); + } + /** + * Get the current groups + * @returns {vis.DataSet | null} groups + */ + + }, { + key: "getGroups", + value: function getGroups() { + return this.groupsData; + } + /** + * Remove an item by its id + * @param {string | number} id + */ + + }, { + key: "removeItem", + value: function removeItem(id) { + var item = this.itemsData.get(id); + var 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 + */ + + }, { + key: "_getType", + value: function _getType(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 + */ + + }, { + key: "getGroupId", + value: function getGroupId(itemData) { + var type = this._getType(itemData); + + if (type == 'background' && itemData.group == undefined) { + return BACKGROUND$2; + } else { + return this.groupsData ? itemData.group : UNGROUPED$2; + } + } + /** + * Handle updated items + * @param {number[]} ids + * @protected + */ + + }, { + key: "_onUpdate", + value: function _onUpdate(ids) { + var _this5 = this; + + var me = this; + + forEach$3(ids).call(ids, function (id) { + var itemData = me.itemsData.get(id, me.itemOptions); + var item = me.items[id]; + var type = itemData ? me._getType(itemData) : null; + 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 && itemData) { + // 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) { + _this5.selection.push(id); + + item.select(); + } + } else { + throw new TypeError("Unknown item type \"".concat(type, "\"")); + } + } + }); + + this._order(); + + if (this.options.cluster) { + this.clusterGenerator.setItems(this.items, { + applyOnChangedLevel: false + }); + + this._clusterItems(); + } + + this.body.emitter.emit('_change', { + queue: true + }); + } + /** + * Handle removed items + * @param {number[]} ids + * @protected + */ + + }, { + key: "_onRemove", + value: function _onRemove(ids) { + var count = 0; + var me = this; + + forEach$3(ids).call(ids, function (id) { + var item = me.items[id]; + + if (item) { + count++; + + me._removeItem(item); + } + }); + + if (count) { + // update order + this._order(); + + this.body.emitter.emit('_change', { + queue: true + }); + } + } + /** + * Update the order of item in all groups + * @private + */ + + }, { + key: "_order", + value: function _order() { + // reorder the items in all groups + // TODO: optimization: only reorder groups affected by the changed items + forEach$3(util$2).call(util$2, this.groups, function (group) { + group.order(); + }); + } + /** + * Handle updated groups + * @param {number[]} ids + * @private + */ + + }, { + key: "_onUpdateGroups", + value: function _onUpdateGroups(ids) { + this._onAddGroups(ids); + } + /** + * Handle changed groups (added or updated) + * @param {number[]} ids + * @private + */ + + }, { + key: "_onAddGroups", + value: function _onAddGroups(ids) { + var me = this; + + forEach$3(ids).call(ids, function (id) { + var groupData = me.groupsData.get(id); + var group = me.groups[id]; + + if (!group) { + // check for reserved ids + if (id == UNGROUPED$2 || id == BACKGROUND$2) { + throw new Error("Illegal group id. ".concat(id, " is a reserved id.")); + } + + var groupOptions = create$4(me.options); + + util$2.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 + */ + + }, { + key: "_onRemoveGroups", + value: function _onRemoveGroups(ids) { + var groups = this.groups; + + forEach$3(ids).call(ids, function (id) { + var group = groups[id]; + + if (group) { + group.hide(); + delete groups[id]; + } + }); + + if (this.options.cluster) { + this.clusterGenerator.updateData(); + + this._clusterItems(); + } + + this.markDirty({ + restackGroups: !!this.options.cluster + }); + this.body.emitter.emit('_change', { + queue: true + }); + } + /** + * Reorder the groups if needed + * @return {boolean} changed + * @private + */ + + }, { + key: "_orderGroups", + value: function _orderGroups() { + if (this.groupsData) { + // reorder the groups + var groupIds = this.groupsData.getIds({ + order: this.options.groupOrder + }); + groupIds = this._orderNestedGroups(groupIds); + var changed = !util$2.equalArray(groupIds, this.groupIds); + + if (changed) { + // hide all groups, removes them from the DOM + var groups = this.groups; + + forEach$3(groupIds).call(groupIds, function (groupId) { + groups[groupId].hide(); + }); // show the groups again, attach them to the DOM in correct order + + + forEach$3(groupIds).call(groupIds, function (groupId) { + groups[groupId].show(); + }); + + this.groupIds = groupIds; + } + + return changed; + } else { + return false; + } + } + /** + * Reorder the nested groups + * + * @param {Array.} groupIds + * @returns {Array.} + * @private + */ + + }, { + key: "_orderNestedGroups", + value: function _orderNestedGroups(groupIds) { + var _this6 = this; + + /** + * Recursively order nested groups + * + * @param {ItemSet} t + * @param {Array.} groupIds + * @returns {Array.} + * @private + */ + function getOrderedNestedGroups(t, groupIds) { + var result = []; + + forEach$3(groupIds).call(groupIds, function (groupId) { + result.push(groupId); + var groupData = t.groupsData.get(groupId); + + if (groupData.nestedGroups) { + var _context26; + + var nestedGroupIds = map$2(_context26 = t.groupsData.get({ + filter: function filter(nestedGroup) { + return nestedGroup.nestedInGroup == groupId; + }, + order: t.options.groupOrder + })).call(_context26, function (nestedGroup) { + return nestedGroup.id; + }); + + result = concat$2(result).call(result, getOrderedNestedGroups(t, nestedGroupIds)); + } + }); + + return result; + } + + var topGroupIds = filter$2(groupIds).call(groupIds, function (groupId) { + return !_this6.groupsData.get(groupId).nestedInGroup; + }); + + return getOrderedNestedGroups(this, topGroupIds); + } + /** + * Add a new item + * @param {Item} item + * @private + */ + + }, { + key: "_addItem", + value: function _addItem(item) { + this.items[item.id] = item; // add to group + + var groupId = this.getGroupId(item.data); + var group = this.groups[groupId]; + + if (!group) { + item.groupShowing = false; + } else if (group && group.data && group.data.showNested) { + item.groupShowing = true; + } + + if (group) group.add(item); + } + /** + * Update an existing item + * @param {Item} item + * @param {Object} itemData + * @private + */ + + }, { + key: "_updateItem", + value: function _updateItem(item, itemData) { + // update the items data (will redraw the item when displayed) + item.setData(itemData); + var groupId = this.getGroupId(item.data); + var group = this.groups[groupId]; + + if (!group) { + item.groupShowing = false; + } else if (group && group.data && group.data.showNested) { + item.groupShowing = true; + } + } + /** + * 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 + */ + + }, { + key: "_removeItem", + value: function _removeItem(item) { + var _context27, _context28; + + // remove from DOM + item.hide(); // remove from items + + delete this.items[item.id]; // remove from selection + + var index = indexOf$3(_context27 = this.selection).call(_context27, item.id); + + if (index != -1) splice$2(_context28 = this.selection).call(_context28, index, 1); // remove from group + + item.parent && item.parent.remove(item); // remove Tooltip from DOM + + if (this.popup != null) { + this.popup.hide(); + } + } + /** + * Create an array containing all items being a range (having an end date) + * @param {Array.} array + * @returns {Array} + * @private + */ + + }, { + key: "_constructByEndArray", + value: function _constructByEndArray(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 + */ + + }, { + key: "_onTouch", + value: function _onTouch(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 + * @returns {number} index / groupId + * @private + */ + + }, { + key: "_getGroupIndex", + value: function _getGroupIndex(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 + */ + + }, { + key: "_onDragStart", + value: function _onDragStart(event) { + var _this7 = this; + + if (this.touchParams.itemIsDragging) { + return; + } + + var item = this.touchParams.item || null; + var me = this; + var props; + + if (item && (item.selected || this.options.itemsAlwaysDraggable.item)) { + if (this.options.editable.overrideItems && !this.options.editable.updateTime && !this.options.editable.updateGroup) { + return; + } // override options.editable + + + if (item.editable != null && !item.editable.updateTime && !item.editable.updateGroup && !this.options.editable.overrideItems) { + return; + } + + var dragLeftItem = this.touchParams.dragLeftItem; + var dragRightItem = this.touchParams.dragRightItem; + this.touchParams.itemIsDragging = true; + this.touchParams.selectedItem = item; + + 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 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); + } else { + if (this.groupIds.length < 1) { + // Mitigates a race condition if _onDragStart() is + // called after markDirty() without redraw() being called between. + this.redraw(); + } + + var baseGroupIndex = this._getGroupIndex(item.data.group); + + var itemsToDrag = this.options.itemsAlwaysDraggable.item && !item.selected ? [item.id] : this.getSelection(); + this.touchParams.itemProps = map$2(itemsToDrag).call(itemsToDrag, 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: _this7._cloneItemData(item.data) + }; + }); + } + + 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 + */ + + }, { + key: "_onDragStartAddItem", + value: function _onDragStartAddItem(event) { + var snap = this.options.snap || null; + var frameRect = this.dom.frame.getBoundingClientRect(); // plus (if rtl) 10 to compensate for the drag starting as soon as you've moved 10px + + var x = this.options.rtl ? frameRect.right - event.center.x + 10 : event.center.x - frameRect.left - 10; + 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$2.randomUUID(); + itemData[this.itemsData._idProp] = 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); + + this.touchParams.selectedItem = 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 + */ + + }, { + key: "_onDrag", + value: function _onDrag(event) { + var _this8 = this; + + if (this.popup != null && this.options.showTooltips && !this.popup.hidden) { + // this.popup.hide(); + var container = this.body.dom.centerContainer; + var containerRect = container.getBoundingClientRect(); + this.popup.setPosition(event.center.x - containerRect.left + container.offsetLeft, event.center.y - containerRect.top + container.offsetTop); + this.popup.show(); // redraw + } + + if (this.touchParams.itemProps) { + var _context29; + + event.stopPropagation(); + var me = this; + var snap = this.options.snap || null; + var domRootOffsetLeft = this.body.dom.root.offsetLeft; + var xOffset = this.options.rtl ? domRootOffsetLeft + this.body.domProps.right.width : domRootOffsetLeft + 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 = (this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateGroup || !this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.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 + + + forEach$3(_context29 = this.touchParams.itemProps).call(_context29, function (props) { + var current = me.body.util.toTime(event.center.x - xOffset); + var initial = me.body.util.toTime(props.initialX - xOffset); + var offset; + var initialStart; + var initialEnd; + var start; + var end; + + if (_this8.options.rtl) { + offset = -(current - initial); // ms + } else { + offset = current - initial; // ms + } + + var itemData = _this8._cloneItemData(props.item.data); // clone the data + + + if (props.item.editable != null && !props.item.editable.updateTime && !props.item.editable.updateGroup && !me.options.editable.overrideItems) { + return; + } + + var updateTimeAllowed = (_this8.options.editable.overrideItems || selectedItem.editable == null) && _this8.options.editable.updateTime || !_this8.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateTime; + + if (updateTimeAllowed) { + if (props.dragLeft) { + // drag left side of a range item + if (_this8.options.rtl) { + if (itemData.end != undefined) { + initialEnd = util$2.convert(props.data.end, 'Date'); + 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) { + initialStart = util$2.convert(props.data.start, 'Date'); + 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 (_this8.options.rtl) { + if (itemData.start != undefined) { + initialStart = util$2.convert(props.data.start, 'Date'); + 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) { + initialEnd = util$2.convert(props.data.end, 'Date'); + 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) { + initialStart = util$2.convert(props.data.start, 'Date').valueOf(); + start = new Date(initialStart + offset); + + if (itemData.end != undefined) { + initialEnd = util$2.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; + } + } + } + } + + 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 = _this8._cloneItemData(itemData); // convert start and end to the correct type + + me.options.onMoving(itemData, function (itemData) { + if (itemData) { + props.item.setData(_this8._cloneItemData(itemData, 'Date')); + } + }); + }); + + this.body.emitter.emit('_change'); + } + } + /** + * Move an item to another group + * @param {Item} item + * @param {string | number} groupId + * @private + */ + + }, { + key: "_moveToGroup", + value: function _moveToGroup(item, groupId) { + var group = this.groups[groupId]; + + if (group && group.groupId != item.data.group) { + var oldGroup = item.parent; + oldGroup.remove(item); + oldGroup.order(); + item.data.group = group.groupId; + group.add(item); + group.order(); + } + } + /** + * End of dragging selected items + * @param {Event} event + * @private + */ + + }, { + key: "_onDragEnd", + value: function _onDragEnd(event) { + var _this9 = this; + + this.touchParams.itemIsDragging = false; + + if (this.touchParams.itemProps) { + event.stopPropagation(); + var me = this; + var dataset = this.itemsData.getDataSet(); + var itemProps = this.touchParams.itemProps; + this.touchParams.itemProps = null; + + forEach$3(itemProps).call(itemProps, 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.body.emitter.emit('_change'); + }); + } else { + // update existing item + var itemData = _this9._cloneItemData(props.item.data); // convert start and end to the correct type + + + me.options.onMove(itemData, function (itemData) { + if (itemData) { + // apply changes + itemData[dataset._idProp] = id; // ensure the item contains its id (can be undefined) + + dataset.update(itemData); + } else { + // restore original values + props.item.setData(props.data); + me.body.emitter.emit('_change'); + } + }); + } + }); + } + } + /** + * On group click + * @param {Event} event + * @private + */ + + }, { + key: "_onGroupClick", + value: function _onGroupClick(event) { + var _this10 = this; + + var group = this.groupFromTarget(event); + + setTimeout$2(function () { + _this10.toggleGroupShowNested(group); + }, 1); + } + /** + * Toggle show nested + * @param {object} group + * @param {boolean} force + */ + + }, { + key: "toggleGroupShowNested", + value: function toggleGroupShowNested(group) { + var _context30; + + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + if (!group || !group.nestedGroups) return; + var groupsData = this.groupsData.getDataSet(); + + if (force != undefined) { + group.showNested = !!force; + } else { + group.showNested = !group.showNested; + } + + var nestingGroup = groupsData.get(group.groupId); + nestingGroup.showNested = group.showNested; + var fullNestedGroups = group.nestedGroups; + var nextLevel = fullNestedGroups; + + while (nextLevel.length > 0) { + var current = nextLevel; + nextLevel = []; + + for (var i = 0; i < current.length; i++) { + var node = groupsData.get(current[i]); + + if (node.nestedGroups) { + nextLevel = concat$2(nextLevel).call(nextLevel, node.nestedGroups); + } + } + + if (nextLevel.length > 0) { + fullNestedGroups = concat$2(fullNestedGroups).call(fullNestedGroups, nextLevel); + } + } + + var nestedGroups = map$2(_context30 = groupsData.get(fullNestedGroups)).call(_context30, function (nestedGroup) { + if (nestedGroup.visible == undefined) { + nestedGroup.visible = true; + } + + nestedGroup.visible = !!nestingGroup.showNested; + return nestedGroup; + }); + + groupsData.update(concat$2(nestedGroups).call(nestedGroups, nestingGroup)); + + if (nestingGroup.showNested) { + util$2.removeClassName(group.dom.label, 'collapsed'); + util$2.addClassName(group.dom.label, 'expanded'); + } else { + util$2.removeClassName(group.dom.label, 'expanded'); + util$2.addClassName(group.dom.label, 'collapsed'); + } + } + /** + * Toggle group drag classname + * @param {object} group + */ + + }, { + key: "toggleGroupDragClassName", + value: function toggleGroupDragClassName(group) { + group.dom.label.classList.toggle('vis-group-is-dragging'); + group.dom.foreground.classList.toggle('vis-group-is-dragging'); + } + /** + * on drag start + * @param {Event} event + * @return {void} + * @private + */ + + }, { + key: "_onGroupDragStart", + value: function _onGroupDragStart(event) { + if (this.groupTouchParams.isDragging) return; + + if (this.options.groupEditable.order) { + this.groupTouchParams.group = this.groupFromTarget(event); + + if (this.groupTouchParams.group) { + event.stopPropagation(); + this.groupTouchParams.isDragging = true; + this.toggleGroupDragClassName(this.groupTouchParams.group); + this.groupTouchParams.originalOrder = this.groupsData.getIds({ + order: this.options.groupOrder + }); + } + } + } + /** + * on drag + * @param {Event} event + * @return {void} + * @private + */ + + }, { + key: "_onGroupDrag", + value: function _onGroupDrag(event) { + if (this.options.groupEditable.order && this.groupTouchParams.group) { + event.stopPropagation(); + var groupsData = this.groupsData; + + if (this.groupsData instanceof DataView) { + groupsData = this.groupsData.getDataSet(); + } // 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 targetGroup = group.dom.foreground.getBoundingClientRect(); + var draggedGroupHeight = this.groupTouchParams.group.height; + + if (movingUp) { + // skip swapping the groups when the dragged group is not below clientY afterwards + if (targetGroup.top + draggedGroupHeight < clientY) { + return; + } + } else { + var targetGroupHeight = group.height; // skip swapping the groups when the dragged group is not below clientY afterwards + + if (targetGroup.top + targetGroupHeight - draggedGroupHeight > clientY) { + return; + } + } + } + + if (group && group != this.groupTouchParams.group) { + var _targetGroup = groupsData.get(group.groupId); + + var draggedGroup = groupsData.get(this.groupTouchParams.group.groupId); // switch groups + + if (draggedGroup && _targetGroup) { + this.options.groupOrderSwap(draggedGroup, _targetGroup, groupsData); + groupsData.update(draggedGroup); + groupsData.update(_targetGroup); + } // fetch current order of groups + + + var newOrder = groupsData.getIds({ + order: this.options.groupOrder + }); // in case of changes since _onGroupDragStart + + if (!util$2.equalArray(newOrder, this.groupTouchParams.originalOrder)) { + 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; + } // if dragged group was move downwards everything above should have an offset + else if (origOrder[curPos + orgOffset] == draggedId) { + orgOffset = 1; + } // 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 = indexOf$3(newOrder).call(newOrder, 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++; + } + } + } + } + } + } + /** + * on drag end + * @param {Event} event + * @return {void} + * @private + */ + + }, { + key: "_onGroupDragEnd", + value: function _onGroupDragEnd(event) { + this.groupTouchParams.isDragging = false; + + 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$2.extend({}, dataset.get(id)); // clone the data + + me.options.onMoveGroup(groupData, function (groupData) { + if (groupData) { + // apply changes + groupData[dataset._idProp] = 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$2.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 = indexOf$3(newOrder).call(newOrder, origOrder[curPos]); + + var switchGroup = dataset.get(newOrder[curPos]); + var shouldBeGroup = dataset.get(origOrder[curPos]); + me.options.groupOrderSwap(switchGroup, shouldBeGroup, dataset); + dataset.update(switchGroup); + dataset.update(shouldBeGroup); + var switchGroupId = newOrder[curPos]; + newOrder[curPos] = origOrder[curPos]; + newOrder[slippedPosition] = switchGroupId; + curPos++; + } + } + } + }); + me.body.emitter.emit('groupDragged', { + groupId: id + }); + this.toggleGroupDragClassName(this.groupTouchParams.group); + this.groupTouchParams.group = null; + } + } + /** + * Handle selecting/deselecting an item when tapping it + * @param {Event} event + * @private + */ + + }, { + key: "_onSelectItem", + value: function _onSelectItem(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.selectable ? [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 hovering an item + * @param {Event} event + * @private + */ + + }, { + key: "_onMouseOver", + value: function _onMouseOver(event) { + var item = this.itemFromTarget(event); + if (!item) return; // Item we just left + + var related = this.itemFromRelatedTarget(event); + + if (item === related) { + // We haven't changed item, just element in the item + return; + } + + var title = item.getTitle(); + + if (this.options.showTooltips && title) { + if (this.popup == null) { + this.popup = new Popup(this.body.dom.root, this.options.tooltip.overflowMethod || 'flip'); + } + + this.popup.setText(title); + var container = this.body.dom.centerContainer; + var containerRect = container.getBoundingClientRect(); + this.popup.setPosition(event.clientX - containerRect.left + container.offsetLeft, event.clientY - containerRect.top + container.offsetTop); + this.setPopupTimer(this.popup); + } else { + // Hovering over item without a title, hide popup + // Needed instead of _just_ in _onMouseOut due to #2572 + this.clearPopupTimer(); + + if (this.popup != null) { + this.popup.hide(); + } + } + + this.body.emitter.emit('itemover', { + item: item.id, + event: event + }); + } + /** + * on mouse start + * @param {Event} event + * @return {void} + * @private + */ + + }, { + key: "_onMouseOut", + value: function _onMouseOut(event) { + var item = this.itemFromTarget(event); + if (!item) return; // Item we are going to + + var related = this.itemFromRelatedTarget(event); + + if (item === related) { + // We aren't changing item, just element in the item + return; + } + + this.clearPopupTimer(); + + if (this.popup != null) { + this.popup.hide(); + } + + this.body.emitter.emit('itemout', { + item: item.id, + event: event + }); + } + /** + * on mouse move + * @param {Event} event + * @return {void} + * @private + */ + + }, { + key: "_onMouseMove", + value: function _onMouseMove(event) { + var item = this.itemFromTarget(event); + if (!item) return; + + if (this.popupTimer != null) { + // restart timer + this.setPopupTimer(this.popup); + } + + if (this.options.showTooltips && this.options.tooltip.followMouse && this.popup && !this.popup.hidden) { + var container = this.body.dom.centerContainer; + var containerRect = container.getBoundingClientRect(); + this.popup.setPosition(event.clientX - containerRect.left + container.offsetLeft, event.clientY - containerRect.top + container.offsetTop); + this.popup.show(); // Redraw + } + } + /** + * Handle mousewheel + * @param {Event} event The event + * @private + */ + + }, { + key: "_onMouseWheel", + value: function _onMouseWheel(event) { + if (this.touchParams.itemIsDragging) { + this._onDragEnd(event); + } + } + /** + * Handle updates of an item on double tap + * @param {timeline.Item} item The item + * @private + */ + + }, { + key: "_onUpdateItem", + value: function _onUpdateItem(item) { + if (!this.options.selectable) return; + if (!this.options.editable.updateTime) return; + if (!this.options.editable.updateGroup) return; + var me = this; + + if (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); + } + }); + } + } + /** + * Handle drop event of data on item + * Only called when `objectData.target === 'item'. + * @param {Event} event The event + * @private + */ + + }, { + key: "_onDropObjectOnItem", + value: function _onDropObjectOnItem(event) { + var item = this.itemFromTarget(event); + var objectData = JSON.parse(event.dataTransfer.getData("text")); + this.options.onDropObjectOnItem(objectData, item); + } + /** + * Handle creation of an item on double tap or drop of a drag event + * @param {Event} event The event + * @private + */ + + }, { + key: "_onAddItem", + value: function _onAddItem(event) { + if (!this.options.selectable) return; + if (!this.options.editable.add) return; + var me = this; + var snap = this.options.snap || null; // add item + + var frameRect = this.dom.frame.getBoundingClientRect(); + var x = this.options.rtl ? frameRect.right - event.center.x : event.center.x - frameRect.left; + var start = this.body.util.toTime(x); + var scale = this.body.util.getScale(); + var step = this.body.util.getStep(); + var end; + var newItemData; + + if (event.type == 'drop') { + newItemData = JSON.parse(event.dataTransfer.getData("text")); + newItemData.content = newItemData.content ? newItemData.content : 'new item'; + newItemData.start = newItemData.start ? newItemData.start : snap ? snap(start, scale, step) : start; + newItemData.type = newItemData.type || 'box'; + newItemData[this.itemsData._idProp] = newItemData.id || util$2.randomUUID(); + + if (newItemData.type == 'range' && !newItemData.end) { + end = this.body.util.toTime(x + this.props.width / 5); + newItemData.end = snap ? snap(end, scale, step) : end; + } + } else { + newItemData = { + start: snap ? snap(start, scale, step) : start, + content: 'new item' + }; + newItemData[this.itemsData._idProp] = util$2.randomUUID(); // when default type is a range, add a default end date to the new item + + if (this.options.type === 'range') { + end = this.body.util.toTime(x + this.props.width / 5); + newItemData.end = snap ? snap(end, scale, step) : end; + } + } + + 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); + + if (event.type == 'drop') { + me.setSelection([item.id]); + } // TODO: need to trigger a redraw? + + } + }); + } + /** + * Handle selecting/deselecting multiple items when holding an item + * @param {Event} event + * @private + */ + + }, { + key: "_onMultiSelectItem", + value: function _onMultiSelectItem(event) { + var _this11 = this; + + 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.sequentialSelection) && 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 = indexOf$3(selection).call(selection, item.id); + + if (index == -1) { + // item is not yet selected -> select it + selection.push(item.id); + } else { + // item is already selected -> deselect it + splice$2(selection).call(selection, index, 1); + } + } + + var filteredSelection = filter$2(selection).call(selection, function (item) { + return _this11.getItemById(item).selectable; + }); + + this.setSelection(filteredSelection); + this.body.emitter.emit('select', { + items: this.getSelection(), + event: event + }); + } + } + /** + * Calculate the time range of a list of items + * @param {Array.} itemsData + * @return {{min: Date, max: Date}} Returns the range of the provided items + * @private + */ + + }, { + key: "itemFromElement", + + /** + * Find an item from an element: + * searches for the attribute 'vis-item' in the element's tree + * @param {HTMLElement} element + * @return {Item | null} item + */ + value: function itemFromElement(element) { + var cur = element; + + while (cur) { + if (cur.hasOwnProperty('vis-item')) { + return cur['vis-item']; + } + + cur = cur.parentNode; + } + + return null; + } + /** + * Find an item from an event target: + * searches for the attribute 'vis-item' in the event target's element tree + * @param {Event} event + * @return {Item | null} item + */ + + }, { + key: "itemFromTarget", + value: function itemFromTarget(event) { + return this.itemFromElement(event.target); + } + /** + * Find an item from an event's related target: + * searches for the attribute 'vis-item' in the related target's element tree + * @param {Event} event + * @return {Item | null} item + */ + + }, { + key: "itemFromRelatedTarget", + value: function itemFromRelatedTarget(event) { + return this.itemFromElement(event.relatedTarget); + } + /** + * Find the Group from an event target: + * searches for the attribute 'vis-group' in the event target's element tree + * @param {Event} event + * @return {Group | null} group + */ + + }, { + key: "groupFromTarget", + value: function groupFromTarget(event) { + var clientY = event.center ? event.center.y : event.clientY; + var groupIds = this.groupIds; + + if (groupIds.length <= 0 && this.groupsData) { + groupIds = this.groupsData.getIds({ + order: this.options.groupOrder + }); + } + + for (var i = 0; i < groupIds.length; i++) { + var groupId = groupIds[i]; + var group = this.groups[groupId]; + var foreground = group.dom.foreground; + var foregroundRect = foreground.getBoundingClientRect(); + + if (clientY >= foregroundRect.top && clientY < foregroundRect.top + foreground.offsetHeight) { + return group; + } + + if (this.options.orientation.item === 'top') { + if (i === this.groupIds.length - 1 && clientY > foregroundRect.top) { + return group; + } + } else { + if (i === 0 && clientY < foregroundRect.top + foreground.offset) { + return group; + } + } + } + + return null; + } + /** + * Find the ItemSet from an event target: + * searches for the attribute 'vis-itemset' in the event target's element tree + * @param {Event} event + * @return {ItemSet | null} item + */ + + }, { + key: "_cloneItemData", + + /** + * 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 + */ + value: function _cloneItemData(itemData, type) { + var clone = util$2.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$2.convert(clone.start, type && type.start || 'Date'); + } + + if (clone.end != undefined) { + clone.end = util$2.convert(clone.end, type && type.end || 'Date'); + } + + return clone; + } + /** + * cluster items + * @return {void} + * @private + */ + + }, { + key: "_clusterItems", + value: function _clusterItems() { + if (!this.options.cluster) { + return; + } + + var _this$body$range$conv = this.body.range.conversion(this.body.domProps.center.width), + scale = _this$body$range$conv.scale; + + var clusters = this.clusterGenerator.getClusters(this.clusters, scale, this.options.cluster); + + if (this.clusters != clusters) { + this._detachAllClusters(); + + if (clusters) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = getIterator$2(clusters), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var cluster = _step4.value; + cluster.attach(); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + this.clusters = clusters; + } + + this._updateClusters(clusters); + } + } + /** + * detach all cluster items + * @private + */ + + }, { + key: "_detachAllClusters", + value: function _detachAllClusters() { + if (this.options.cluster) { + if (this.clusters && this.clusters.length) { + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = getIterator$2(this.clusters), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var cluster = _step5.value; + cluster.detach(); + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + } + } + } + /** + * update clusters + * @param {array} clusters + * @private + */ + + }, { + key: "_updateClusters", + value: function _updateClusters(clusters) { + if (this.clusters && this.clusters.length) { + var _context31; + + var newClustersIds = new set$3(map$2(clusters).call(clusters, function (cluster) { + return cluster.id; + })); + + var clustersToUnselect = filter$2(_context31 = this.clusters).call(_context31, function (cluster) { + return !newClustersIds.has(cluster.id); + }); + + var selectionChanged = false; + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + for (var _iterator6 = getIterator$2(clustersToUnselect), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var _context32; + + var cluster = _step6.value; + + var selectedIdx = indexOf$3(_context32 = this.selection).call(_context32, cluster.id); + + if (selectedIdx !== -1) { + var _context33; + + cluster.unselect(); + + splice$2(_context33 = this.selection).call(_context33, selectedIdx, 1); + + selectionChanged = true; + } + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return != null) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + + if (selectionChanged) { + var newSelection = this.getSelection(); + this.body.emitter.emit('select', { + items: newSelection, + event: event + }); + } + } + + this.clusters = clusters || []; + } + }], [{ + key: "_getItemRange", + value: function _getItemRange(itemsData) { + var max = null; + var min = null; + + forEach$3(itemsData).call(itemsData, 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 + }; + } + }, { + key: "itemSetFromTarget", + value: function itemSetFromTarget(event) { + var target = event.target; + + while (target) { + if (target.hasOwnProperty('vis-itemset')) { + return target['vis-itemset']; + } + + target = target.parentNode; + } + + return null; + } + }]); + + return ItemSet; +}(Component); // available item types will be registered here + + +ItemSet.types = { + background: BackgroundItem, + box: BoxItem, + range: RangeItem, + point: PointItem +}; +/** + * Handle added items + * @param {number[]} ids + * @protected + */ + +ItemSet.prototype._onAdd = ItemSet.prototype._onUpdate; + +var errorFound = false; +var allOptions; +var printStyle = 'background: #FFeeee; color: #dd0000'; +/** + * Used to validate options. + */ + +var Validator = +/*#__PURE__*/ +function () { + /** + * @ignore + */ + function Validator() { + classCallCheck$1(this, Validator); + } + /** + * Main function to be called + * @param {Object} options + * @param {Object} referenceOptions + * @param {Object} subObject + * @returns {boolean} + * @static + */ + + + createClass$1(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 {Object} options + * @param {Object} referenceOptions + * @param {array} path | where to look for the actual option + * @static + */ + + }, { + 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 {string} option + * @param {Object} options + * @param {Object} referenceOptions + * @param {array} path | where to look for the actual option + * @static + */ + + }, { + key: "check", + value: function check(option, options, referenceOptions, path) { + if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) { + Validator.getSuggestion(option, referenceOptions, path); + return; + } + + var referenceOption = option; + var is_object = true; + + if (referenceOptions[option] === undefined && referenceOptions.__any__ !== undefined) { + // NOTE: This only triggers if the __any__ is in the top level of the options object. + // THAT'S A REALLY BAD PLACE TO ALLOW IT!!!! + // TODO: Examine if needed, remove if possible + // __any__ is a wildcard. Any value is accepted and will be further analysed by reference. + referenceOption = '__any__'; // if the any-subgroup is not a predefined object in the configurator, + // we do not look deeper into the object. + + is_object = Validator.getType(options[option]) === 'object'; + } + + var refOptionObj = referenceOptions[referenceOption]; + + if (is_object && refOptionObj.__type__ !== undefined) { + refOptionObj = refOptionObj.__type__; + } + + Validator.checkFields(option, options, referenceOptions, referenceOption, refOptionObj, 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} refOptionObj | This is the type object from the reference options + * @param {Array} path | where in the object is the option + * @static + */ + + }, { + key: "checkFields", + value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) { + var log = function log(message) { + console.log('%c' + message + Validator.printLocation(path, option), printStyle); + }; + + 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' && indexOf$3(refOptionType).call(refOptionType, options[option]) === -1) { + log('Invalid option detected in "' + option + '".' + ' Allowed values are:' + Validator.print(refOptionType) + ' not "' + options[option] + '". '); + errorFound = true; + } else if (optionType === 'object' && referenceOption !== "__any__") { + path = util$2.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 + log('Invalid type received for "' + option + '". Expected: ' + Validator.print(keys$3(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"'); + errorFound = true; + } + } + /** + * + * @param {Object|boolean|number|string|Array.|Date|Node|Moment|undefined|null} object + * @returns {string} + * @static + */ + + }, { + key: "getType", + value: function getType(object) { + var type = _typeof_1$2(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 (isArray$3(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; + } + /** + * @param {string} option + * @param {Object} options + * @param {Array.} path + * @static + */ + + }, { + 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; + var msg; + + if (localSearch.indexMatch !== undefined) { + msg = ' in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was incomplete? Did you mean: "' + localSearch.indexMatch + '"?\n\n'; + } else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) { + msg = ' in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch, ''); + } else if (localSearch.distance <= localSearchThreshold) { + msg = '. Did you mean "' + localSearch.closestMatch + '"?' + Validator.printLocation(localSearch.path, option); + } else { + msg = '. Did you mean one of these: ' + Validator.print(keys$3(options)) + Validator.printLocation(path, option); + } + + console.log('%cUnknown option detected: "' + option + '"' + msg, printStyle); + errorFound = true; + } + /** + * traverse the options in search for a match. + * @param {string} option + * @param {Object} options + * @param {Array} path | where to look for the actual option + * @param {boolean} [recursive=false] + * @returns {{closestMatch: string, path: Array, distance: number}} + * @static + */ + + }, { + key: "findInOptions", + value: function findInOptions(option, options, path) { + var recursive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var min = 1e9; + var closestMatch = ''; + var closestMatchPath = []; + var lowerCaseOption = option.toLowerCase(); + var indexMatch = undefined; + + for (var op in options) { + // eslint-disable-line guard-for-in + var distance = void 0; + + if (options[op].__type__ !== undefined && recursive === true) { + var result = Validator.findInOptions(option, options[op], util$2.copyAndExtendArray(path, op)); + + if (min > result.distance) { + closestMatch = result.closestMatch; + closestMatchPath = result.path; + min = result.distance; + indexMatch = result.indexMatch; + } + } else { + var _context; + + if (indexOf$3(_context = op.toLowerCase()).call(_context, lowerCaseOption) !== -1) { + indexMatch = op; + } + + distance = Validator.levenshteinDistance(option, op); + + if (min > distance) { + closestMatch = op; + closestMatchPath = util$2.copyArray(path); + min = distance; + } + } + } + + return { + closestMatch: closestMatch, + path: closestMatchPath, + distance: min, + indexMatch: indexMatch + }; + } + /** + * @param {Array.} path + * @param {Object} option + * @param {string} prefix + * @returns {String} + * @static + */ + + }, { + key: "printLocation", + value: function printLocation(path, option) { + var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Problem value found at: \n'; + 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'; + } + /** + * @param {Object} options + * @returns {String} + * @static + */ + + }, { + key: "print", + value: function print(options) { + return stringify$2(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. + * + * @param {string} a + * @param {string} b + * @returns {Array.>}} + * @static + */ + + }, { + 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; +}(); + +/** + * 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 bool = '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$4 = 'moment'; +var any = 'any'; +var allOptions$1 = { + configure: { + enabled: { + 'boolean': bool + }, + filter: { + 'boolean': bool, + 'function': 'function' + }, + container: { + dom: dom + }, + __type__: { + object: object, + 'boolean': bool, + 'function': 'function' + } + }, + //globals : + align: { + string: string + }, + alignCurrentTime: { + string: string, + 'undefined': 'undefined' + }, + rtl: { + 'boolean': bool, + 'undefined': 'undefined' + }, + rollingMode: { + follow: { + 'boolean': bool + }, + offset: { + number: number, + 'undefined': 'undefined' + }, + __type__: { + object: object + } + }, + onTimeout: { + timeoutMs: { + number: number + }, + callback: { + 'function': 'function' + }, + __type__: { + object: object + } + }, + verticalScroll: { + 'boolean': bool, + 'undefined': 'undefined' + }, + horizontalScroll: { + 'boolean': bool, + 'undefined': 'undefined' + }, + autoResize: { + 'boolean': bool + }, + throttleRedraw: { + number: number + }, + // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511 + clickToUse: { + 'boolean': bool + }, + dataAttributes: { + string: string, + array: array + }, + editable: { + add: { + 'boolean': bool, + 'undefined': 'undefined' + }, + remove: { + 'boolean': bool, + 'undefined': 'undefined' + }, + updateGroup: { + 'boolean': bool, + 'undefined': 'undefined' + }, + updateTime: { + 'boolean': bool, + 'undefined': 'undefined' + }, + overrideItems: { + 'boolean': bool, + 'undefined': 'undefined' + }, + __type__: { + 'boolean': bool, + object: object + } + }, + end: { + number: number, + date: date, + string: string, + moment: moment$4 + }, + 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' + }, + week: { + string: string, + 'undefined': 'undefined' + }, + month: { + string: string, + 'undefined': 'undefined' + }, + year: { + string: string, + 'undefined': 'undefined' + }, + __type__: { + object: object, + 'function': 'function' + } + }, + 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' + }, + week: { + string: string, + 'undefined': 'undefined' + }, + month: { + string: string, + 'undefined': 'undefined' + }, + year: { + string: string, + 'undefined': 'undefined' + }, + __type__: { + object: object, + 'function': 'function' + } + }, + __type__: { + object: object + } + }, + moment: { + 'function': 'function' + }, + groupHeightMode: { + string: string + }, + groupOrder: { + string: string, + 'function': 'function' + }, + groupEditable: { + add: { + 'boolean': bool, + 'undefined': 'undefined' + }, + remove: { + 'boolean': bool, + 'undefined': 'undefined' + }, + order: { + 'boolean': bool, + 'undefined': 'undefined' + }, + __type__: { + 'boolean': bool, + object: object + } + }, + groupOrderSwap: { + 'function': 'function' + }, + height: { + string: string, + number: number + }, + hiddenDates: { + start: { + date: date, + number: number, + string: string, + moment: moment$4 + }, + end: { + date: date, + number: number, + string: string, + moment: moment$4 + }, + repeat: { + string: string + }, + __type__: { + object: object, + array: array + } + }, + itemsAlwaysDraggable: { + item: { + 'boolean': bool, + 'undefined': 'undefined' + }, + range: { + 'boolean': bool, + 'undefined': 'undefined' + }, + __type__: { + 'boolean': bool, + object: object + } + }, + limitSize: { + 'boolean': bool + }, + 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$4 + }, + maxHeight: { + number: number, + string: string + }, + maxMinorChars: { + number: number + }, + min: { + date: date, + number: number, + string: string, + moment: moment$4 + }, + minHeight: { + number: number, + string: string + }, + moveable: { + 'boolean': bool + }, + multiselect: { + 'boolean': bool + }, + multiselectPerGroup: { + 'boolean': bool + }, + onAdd: { + 'function': 'function' + }, + onDropObjectOnItem: { + 'function': 'function' + }, + onUpdate: { + 'function': 'function' + }, + onMove: { + 'function': 'function' + }, + onMoving: { + 'function': 'function' + }, + onRemove: { + 'function': 'function' + }, + onAddGroup: { + 'function': 'function' + }, + onMoveGroup: { + 'function': 'function' + }, + onRemoveGroup: { + 'function': 'function' + }, + onInitialDrawComplete: { + 'function': 'function' + }, + order: { + 'function': 'function' + }, + orientation: { + axis: { + string: string, + 'undefined': 'undefined' + }, + item: { + string: string, + 'undefined': 'undefined' + }, + __type__: { + string: string, + object: object + } + }, + selectable: { + 'boolean': bool + }, + sequentialSelection: { + 'boolean': bool + }, + showCurrentTime: { + 'boolean': bool + }, + showMajorLabels: { + 'boolean': bool + }, + showMinorLabels: { + 'boolean': bool + }, + stack: { + 'boolean': bool + }, + stackSubgroups: { + 'boolean': bool + }, + cluster: { + maxItems: { + 'number': number, + 'undefined': 'undefined' + }, + titleTemplate: { + 'string': string, + 'undefined': 'undefined' + }, + clusterCriteria: { + 'function': 'function', + 'undefined': 'undefined' + }, + showStipes: { + 'boolean': bool, + 'undefined': 'undefined' + }, + fitOnDoubleClick: { + 'boolean': bool, + 'undefined': 'undefined' + }, + __type__: { + 'boolean': bool, + object: object + } + }, + snap: { + 'function': 'function', + 'null': 'null' + }, + start: { + date: date, + number: number, + string: string, + moment: moment$4 + }, + template: { + 'function': 'function' + }, + loadingScreenTemplate: { + 'function': 'function' + }, + groupTemplate: { + 'function': 'function' + }, + visibleFrameTemplate: { + string: string, + 'function': 'function' + }, + showTooltips: { + 'boolean': bool + }, + tooltip: { + followMouse: { + 'boolean': bool + }, + overflowMethod: { + 'string': ['cap', 'flip', 'none'] + }, + delay: { + number: number + }, + template: { + 'function': 'function' + }, + __type__: { + object: object + } + }, + tooltipOnItemUpdateTime: { + template: { + 'function': 'function' + }, + __type__: { + 'boolean': bool, + object: object + } + }, + timeAxis: { + scale: { + string: string, + 'undefined': 'undefined' + }, + step: { + number: number, + 'undefined': 'undefined' + }, + __type__: { + object: object + } + }, + type: { + string: string + }, + width: { + string: string, + number: number + }, + preferZoom: { + 'boolean': bool + }, + zoomable: { + 'boolean': bool + }, + zoomKey: { + string: ['ctrlKey', 'altKey', 'shiftKey', 'metaKey', ''] + }, + zoomFriction: { + number: number + }, + zoomMax: { + number: number + }, + zoomMin: { + number: number + }, + __type__: { + object: object + } +}; +var configureOptions = { + global: { + align: ['center', 'left', 'right'], + alignCurrentTime: ['none', 'year', 'month', 'quarter', 'week', 'isoWeek', 'day', 'date', 'hour', 'minute', 'second'], + direction: false, + autoResize: true, + 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', + week: 'w', + 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', + week: 'MMMM YYYY', + month: 'YYYY', + year: '' + } + }, + groupHeightMode: ['auto', 'fixed', 'fitItems'], + //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'] + }, + preferZoom: false, + selectable: true, + showCurrentTime: false, + showMajorLabels: true, + showMinorLabels: true, + stack: true, + stackSubgroups: true, + cluster: false, + //snap: {'function': 'function', nada}, + start: '', + //template: {'function': 'function'}, + //timeAxis: { + // scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'], + // step: [1, 1, 10, 1] + //}, + showTooltips: true, + tooltip: { + followMouse: false, + overflowMethod: 'flip', + delay: [500, 0, 99999, 100] + }, + tooltipOnItemUpdateTime: false, + type: ['box', 'point', 'range', 'background'], + width: '100%', + zoomable: true, + zoomKey: ['ctrlKey', 'altKey', 'shiftKey', 'metaKey', ''], + zoomMax: [315360000000000, 10, 315360000000000, 1], + zoomMin: [10, 10, 315360000000000, 1] + } +}; + +// https://tc39.github.io/ecma262/#sec-array.prototype.fill + + +var arrayFill = function fill(value +/* , start = 0, end = @length */ +) { + var O = toObject(this); + var length = toLength(O.length); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + + while (endPos > index) O[index++] = value; + + return O; +}; + +// https://tc39.github.io/ecma262/#sec-array.prototype.fill + +_export({ + target: 'Array', + proto: true +}, { + fill: arrayFill +}); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + +var fill = entryVirtual('Array').fill; + +var ArrayPrototype$e = Array.prototype; + +var fill_1 = function (it) { + var own = it.fill; + return it === ArrayPrototype$e || it instanceof Array && own === ArrayPrototype$e.fill ? fill : own; +}; + +var fill$1 = fill_1; + +var fill$2 = fill$1; + +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' +}; +/** + * @param {number} [pixelRatio=1] + */ + +var ColorPicker = +/*#__PURE__*/ +function () { + /** + * @param {number} [pixelRatio=1] + */ + function ColorPicker() { + var pixelRatio = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + + classCallCheck$1(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 {Element} container + */ + + + createClass$1(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 {function} 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 {function} 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."); + } + } + /** + * + * @param {string} color + * @returns {String} + * @private + */ + + }, { + key: "_isColorString", + value: function _isColorString(color) { + if (typeof color === 'string') { + return htmlColors[color]; + } + } + /** + * Set the color of the colorPicker + * Supported formats: + * 'red' --> HTML color string + * '#ffffff' --> hex string + * 'rgb(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 {string|Object} color + * @param {boolean} [setInitial=true] + */ + + }, { + key: "setColor", + value: function setColor(color) { + var setInitial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (color === 'none') { + return; + } + + var rgba; // if a html color shorthand is used, convert to hex + + var htmlColor = this._isColorString(color); + + if (htmlColor !== undefined) { + color = htmlColor; + } // check format + + + if (util$2.isString(color) === true) { + if (util$2.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$2.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$2.isValidHex(color) === true) { + var rgbObj = util$2.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: " + stringify$2(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 {boolean} [storePrevious=true] + * @private + */ + + }, { + key: "_hide", + value: function _hide() { + var _this = this; + + var storePrevious = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + // store the previous color for next time; + if (storePrevious === true) { + this.previousColor = util$2.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$2(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 {Object} rgba + * @param {boolean} [setInitial=true] + * @private + */ + + }, { + key: "_setColor", + value: function _setColor(rgba) { + var setInitial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + // store the initial color + if (setInitial === true) { + this.initialColor = util$2.extend({}, rgba); + } + + this.color = rgba; + var hsv = util$2.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 {number} value + * @private + */ + + }, { + key: "_setOpacity", + value: function _setOpacity(value) { + this.color.a = value / 100; + + this._updatePicker(this.color); + } + /** + * bound to brightness control + * @param {number} value + * @private + */ + + }, { + key: "_setBrightness", + value: function _setBrightness(value) { + var hsv = util$2.RGBToHSV(this.color.r, this.color.g, this.color.b); + hsv.v = value / 100; + var rgba = util$2.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 {Object} rgba + * @private + */ + + }, { + key: "_updatePicker", + value: function _updatePicker() { + var rgba = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.color; + var hsv = util$2.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); + + fill$2(ctx).call(ctx); + + 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() { + var _context, _context2, _context3, _context4; + + 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'; + } // TODO: Add some error handling and remove this lint exception + catch (err) {} // eslint-disable-line no-empty + + + 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'; + } // TODO: Add some error handling and remove this lint exception + catch (err) {} // eslint-disable-line no-empty + + + 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 = bind$2(_context = this._hide).call(_context, this, false); + this.applyButton = document.createElement("div"); + this.applyButton.className = "vis-button vis-apply"; + this.applyButton.innerHTML = 'apply'; + this.applyButton.onclick = bind$2(_context2 = this._apply).call(_context2, this); + this.saveButton = document.createElement("div"); + this.saveButton.className = "vis-button vis-save"; + this.saveButton.innerHTML = 'save'; + this.saveButton.onclick = bind$2(_context3 = this._save).call(_context3, this); + this.loadButton = document.createElement("div"); + this.loadButton.className = "vis-button vis-load"; + this.loadButton.innerHTML = 'load last'; + this.loadButton.onclick = bind$2(_context4 = this._loadLast).call(_context4, 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$1(this.colorPickerCanvas); + this.hammer.get('pinch').set({ + enable: true + }); + 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, y, hue, sat; + 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; + + 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$2.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} event The 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$2.RGBToHSV(this.color.r, this.color.g, this.color.b); + hsv.h = h; + hsv.s = s; + var rgba = util$2.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; +}(); + +/** + * 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 + */ + +var Configurator = +/*#__PURE__*/ +function () { + /** + * @param {Object} parentModule | the location where parentModule.setOptions() can be called + * @param {Object} defaultContainer | the default container of the module + * @param {Object} configureOptions | the fully configured and predefined options set found in allOptions.js + * @param {number} pixelRatio | canvas pixel ratio + */ + function Configurator(parentModule, defaultContainer, configureOptions) { + var pixelRatio = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + + classCallCheck$1(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$2.extend(this.options, this.defaultOptions); + this.configureOptions = configureOptions; + this.moduleOptions = {}; + this.domElements = []; + this.popupDiv = {}; + this.popupLimit = 5; + this.popupHistory = {}; + this.colorPicker = new ColorPicker(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 {Object} options + */ + + + createClass$1(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_1$2(options) === 'object') { + if (options == null) { + throw new TypeError('options cannot be null'); + } + + if (options.container !== undefined) { + this.options.container = options.container; + } + + if (filter$2(options) !== undefined) { + this.options.filter = filter$2(options); + } + + 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 (filter$2(this.options) === false) { + enabled = false; + } + + this.options.enabled = enabled; + } + + this._clean(); + } + /** + * + * @param {Object} moduleOptions + */ + + }, { + 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() { + this._clean(); + + this.changedOptions = []; + + var filter = filter$2(this.options); + + 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 || indexOf$3(filter).call(filter, 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++; + } + } + + this._makeButton(); + + 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 {Array} path | where to look for the actual option + * @param {Array.} domElements + * @returns {number} + * @private + */ + + }, { + key: "_makeItem", + value: function _makeItem(path) { + if (this.allowCreation === true) { + var item = document.createElement('div'); + item.className = 'vis-configuration vis-config-item vis-config-s' + path.length; + + for (var _len = arguments.length, domElements = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + domElements[_key - 1] = arguments[_key]; + } + + forEach$3(domElements).call(domElements, function (element) { + item.appendChild(element); + }); + + this.domElements.push(item); + return this.domElements.length; + } + + return 0; + } + /** + * header for major subjects + * @param {string} 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 {string} name + * @param {array} path | where to look for the actual option + * @param {string} objectLabel + * @returns {HTMLElement} + * @private + */ + + }, { + key: "_makeLabel", + value: function _makeLabel(name, path) { + var objectLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var div = document.createElement('div'); + div.className = 'vis-configuration vis-config-label vis-config-s' + path.length; + + if (objectLabel === true) { + div.innerHTML = '' + name + ':'; + } else { + div.innerHTML = name + ':'; + } + + return div; + } + /** + * make a dropdown list for multiple possible string optoins + * @param {Array.} arr + * @param {number} value + * @param {array} path | where to look for the actual option + * @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 (indexOf$3(arr).call(arr, value) !== -1) { + selectedValue = indexOf$3(arr).call(arr, 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 {Array.} arr + * @param {number} value + * @param {array} path | where to look for the actual option + * @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; + } // TODO: Add some error handling and remove this lint exception + catch (err) {} // eslint-disable-line no-empty + + + 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 = Number(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); + } + } + /** + * make a button object + * @private + */ + + }, { + key: "_makeButton", + value: function _makeButton() { + var _this = this; + + if (this.options.showButton === true) { + 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); + } + } + /** + * prepare the popup + * @param {string} string + * @param {number} index + * @private + */ + + }, { + key: "_setupPopup", + value: function _setupPopup(string, index) { + var _this2 = 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 () { + _this2._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 _this3 = 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$2(function () { + _this3.popupDiv.html.style.opacity = 0; + }, 1500); + this.popupDiv.deleteTimeout = setTimeout$2(function () { + _this3._removePopup(); + }, 1800); + } + } + /** + * make a checkbox for boolean options. + * @param {number} defaultValue + * @param {number} value + * @param {array} path | where to look for the actual option + * @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_1$2(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 {number} defaultValue + * @param {number} value + * @param {array} path | where to look for the actual option + * @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 {Array.} arr + * @param {number} value + * @param {array} path | where to look for the actual option + * @private + */ + + }, { + key: "_makeColorField", + value: function _makeColorField(arr, value, path) { + var _this4 = 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 () { + _this4._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 {number} value + * @param {HTMLElement} div + * @param {array} path | where to look for the actual option + * @private + */ + + }, { + key: "_showColorPicker", + value: function _showColorPicker(value, div, path) { + var _this5 = 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; + + _this5._update(colorString, path); + }); // on close of the colorpicker, restore the callback. + + this.colorPicker.setCloseCallback(function () { + div.onclick = function () { + _this5._showColorPicker(value, div, path); + }; + }); + } + /** + * parse an object and draw the correct items + * @param {Object} obj + * @param {array} [path=[]] | where to look for the actual option + * @param {boolean} [checkOnly=false] + * @returns {boolean} + * @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 ? arguments[2] : false; + var show = false; + + var filter = filter$2(this.options); + + var visibleInSet = false; + + for (var subObj in obj) { + if (obj.hasOwnProperty(subObj)) { + show = true; + var item = obj[subObj]; + var newPath = util$2.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 (indexOf$3(path).call(path, '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$2.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 {Array.} arr + * @param {number} value + * @param {array} path | where to look for the actual option + * @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 {number} value + * @param {array} path | where to look for the actual option + * @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); + } + /** + * + * @param {string|Boolean} value + * @param {Array.} path + * @param {{}} optionsObj + * @returns {{}} + * @private + */ + + }, { + 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; + } + /** + * @private + */ + + }, { + key: "_printOptions", + value: function _printOptions() { + var options = this.getOptions(); + this.optionsContainer.innerHTML = '
var options = ' + stringify$2(options, null, 2) + '
'; + } + /** + * + * @returns {{}} options + */ + + }, { + 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; +}(); + +/** + * Create a timeline visualization + * @extends Core + */ + +var Timeline = +/*#__PURE__*/ +function (_Core) { + inherits$1(Timeline, _Core); + + /** + * @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 Timeline + */ + function Timeline(container, items, groups, options) { + var _context2, _context3, _context4, _context5, _context6, _context7, _context8; + + var _this; + + classCallCheck$1(this, Timeline); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(Timeline).call(this)); + _this.initTime = new Date(); + _this.itemsDone = false; + + if (!(assertThisInitialized$1(_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 (!(isArray$3(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) { + var forthArgument = options; + options = groups; + groups = forthArgument; + } // TODO: REMOVE THIS in the next MAJOR release + // see https://github.com/almende/vis/issues/2511 + + + if (options && options.throttleRedraw) { + console.warn("Timeline option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release."); + } + + var me = assertThisInitialized$1(_this); + + _this.defaultOptions = { + autoResize: true, + orientation: { + axis: 'bottom', + // axis orientation: 'bottom', 'top', or 'both' + item: 'bottom' // not relevant + + }, + moment: moment$3 + }; + _this.options = util$2.deepExtend({}, _this.defaultOptions); // Create the DOM, props, and emitter + + _this._create(container); + + if (!options || options && typeof options.rtl == "undefined") { + _this.dom.root.style.visibility = 'hidden'; + var directionFromDom; + var domNode = _this.dom.root; + + while (!directionFromDom && domNode) { + directionFromDom = window.getComputedStyle(domNode, null).direction; + domNode = domNode.parentElement; + } + + _this.options.rtl = directionFromDom && directionFromDom.toLowerCase() == "rtl"; + } else { + _this.options.rtl = options.rtl; + } + + if (options) { + if (options.rollingMode) { + _this.options.rollingMode = options.rollingMode; + } + + if (options.onInitialDrawComplete) { + _this.options.onInitialDrawComplete = options.onInitialDrawComplete; + } + + if (options.onTimeout) { + _this.options.onTimeout = options.onTimeout; + } + + if (options.loadingScreenTemplate) { + _this.options.loadingScreenTemplate = options.loadingScreenTemplate; + } + } // Prepare loading screen + + + var loadingScreenFragment = document.createElement('div'); + + if (_this.options.loadingScreenTemplate) { + var _context; + + var templateFunction = bind$2(_context = _this.options.loadingScreenTemplate).call(_context, assertThisInitialized$1(_this)); + + var loadingScreen = templateFunction(_this.dom.loadingScreen); + + if (loadingScreen instanceof Object && !(loadingScreen instanceof Element)) { + templateFunction(loadingScreenFragment); + } else { + if (loadingScreen instanceof Element) { + loadingScreenFragment.innerHTML = ''; + loadingScreenFragment.appendChild(loadingScreen); + } else if (loadingScreen != undefined) { + loadingScreenFragment.innerHTML = loadingScreen; + } + } + } + + _this.dom.loadingScreen.appendChild(loadingScreenFragment); // all components listed here will be repainted automatically + + + _this.components = []; + _this.body = { + dom: _this.dom, + domProps: _this.props, + emitter: { + on: bind$2(_context2 = _this.on).call(_context2, assertThisInitialized$1(_this)), + off: bind$2(_context3 = _this.off).call(_context3, assertThisInitialized$1(_this)), + emit: bind$2(_context4 = _this.emit).call(_context4, assertThisInitialized$1(_this)) + }, + hiddenDates: [], + util: { + getScale: function getScale() { + return me.timeAxis.step.scale; + }, + getStep: function getStep() { + return me.timeAxis.step.step; + }, + toScreen: bind$2(_context5 = me._toScreen).call(_context5, me), + toGlobalScreen: bind$2(_context6 = me._toGlobalScreen).call(_context6, me), + // this refers to the root.width + toTime: bind$2(_context7 = me._toTime).call(_context7, me), + toGlobalTime: bind$2(_context8 = me._toGlobalTime).call(_context8, me) + } + }; // range + + _this.range = new Range(_this.body, _this.options); + + _this.components.push(_this.range); + + _this.body.range = _this.range; // time axis + + _this.timeAxis = new TimeAxis(_this.body, _this.options); + _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.options); + + _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.dom.root.onclick = function (event) { + me.emit('click', me.getEventProperties(event)); + }; + + _this.dom.root.ondblclick = function (event) { + me.emit('doubleClick', me.getEventProperties(event)); + }; + + _this.dom.root.oncontextmenu = function (event) { + me.emit('contextmenu', me.getEventProperties(event)); + }; + + _this.dom.root.onmouseover = function (event) { + me.emit('mouseOver', me.getEventProperties(event)); + }; + + if (window.PointerEvent) { + _this.dom.root.onpointerdown = function (event) { + me.emit('mouseDown', me.getEventProperties(event)); + }; + + _this.dom.root.onpointermove = function (event) { + me.emit('mouseMove', me.getEventProperties(event)); + }; + + _this.dom.root.onpointerup = function (event) { + me.emit('mouseUp', me.getEventProperties(event)); + }; + } else { + _this.dom.root.onmousemove = function (event) { + me.emit('mouseMove', me.getEventProperties(event)); + }; + + _this.dom.root.onmousedown = function (event) { + me.emit('mouseDown', me.getEventProperties(event)); + }; + + _this.dom.root.onmouseup = function (event) { + me.emit('mouseUp', me.getEventProperties(event)); + }; + } //Single time autoscale/fit + + + _this.initialFitDone = false; + + _this.on('changed', function () { + if (me.itemsData == null) return; + + if (!me.initialFitDone && !me.options.rollingMode) { + me.initialFitDone = 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 + }); + } + } + + if (!me.initialDrawDone && (me.initialRangeChangeDone || !me.options.start && !me.options.end || me.options.rollingMode)) { + me.initialDrawDone = true; + me.itemSet.initialDrawDone = true; + me.dom.root.style.visibility = 'visible'; + me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen); + + if (me.options.onInitialDrawComplete) { + setTimeout$2(function () { + return me.options.onInitialDrawComplete(); + }, 0); + } + } + }); + + _this.on('destroyTimeline', function () { + me.destroy(); + }); // apply options + + + if (options) { + _this.setOptions(options); + } + + _this.body.emitter.on('fit', function (args) { + _this._onFit(args); + + _this.redraw(); + }); // 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(); + + return _this; + } + /** + * Load a configurator + * @return {Object} + * @private + */ + + + createClass$1(Timeline, [{ + key: "_createConfigurator", + value: function _createConfigurator() { + return new Configurator(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 + */ + + }, { + key: "redraw", + value: function redraw() { + this.itemSet && this.itemSet.markDirty({ + refreshItems: true + }); + + this._redraw(); + } + /** + * Remove an item from the group + * @param {object} options + */ + + }, { + key: "setOptions", + value: function setOptions(options) { + // validate options + var errorFound = Validator.validate(options, allOptions$1); + + 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 + */ + + }, { + key: "setItems", + value: function setItems(items) { + this.itemsDone = false; // 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 + */ + + }, { + key: "setGroups", + value: function setGroups(groups) { + // convert to type DataSet when needed + var newDataSet; + + if (!groups) { + newDataSet = null; + } else { + var filter = function filter(group) { + return group.visible !== false; + }; + + if (groups instanceof DataSet || groups instanceof DataView) { + newDataSet = new DataView(groups, { + filter: filter + }); + } else { + // turn an array into a dataset + newDataSet = new DataSet(filter$2(groups).call(groups, filter)); + } + } + + 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 + */ + + }, { + key: "setData", + value: function setData(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. + */ + + }, { + key: "setSelection", + value: function setSelection(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 + */ + + }, { + key: "getSelection", + value: function getSelection() { + 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'. + * `zoom: boolean` + * If true (default), the timeline will + * zoom on the element after focus it. + */ + + }, { + key: "focus", + value: function focus(id, options) { + if (!this.itemsData || id == undefined) return; + var ids = isArray$3(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; + + forEach$3(itemsData).call(itemsData, 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) { + var me = this; // Use the first item for the vertical focus + + var item = this.itemSet.items[ids[0]]; + var startPos = this._getScrollTop() * -1; + var initialVerticalScroll = null; // Setup a handler for each frame of the vertical scroll + + var verticalAnimationFrame = function verticalAnimationFrame(ease, willDraw, done) { + var verticalScroll = getItemVerticalScroll(me, item); + + if (verticalScroll === false) { + return; // We don't need to scroll, so do nothing + } + + if (!initialVerticalScroll) { + initialVerticalScroll = verticalScroll; + } + + if (initialVerticalScroll.itemTop == verticalScroll.itemTop && !initialVerticalScroll.shouldScroll) { + return; // We don't need to scroll, so do nothing + } else if (initialVerticalScroll.itemTop != verticalScroll.itemTop && verticalScroll.shouldScroll) { + // The redraw shifted elements, so reset the animation to correct + initialVerticalScroll = verticalScroll; + startPos = me._getScrollTop() * -1; + } + + var from = startPos; + var to = initialVerticalScroll.scrollOffset; + var scrollTop = done ? to : from + (to - from) * ease; + + me._setScrollTop(-scrollTop); + + if (!willDraw) { + me._redraw(); + } + }; // Enforces the final vertical scroll position + + + var setFinalVerticalPosition = function setFinalVerticalPosition() { + var finalVerticalScroll = getItemVerticalScroll(me, item); + + if (finalVerticalScroll.shouldScroll && finalVerticalScroll.itemTop != initialVerticalScroll.itemTop) { + me._setScrollTop(-finalVerticalScroll.scrollOffset); + + me._redraw(); + } + }; // Perform one last check at the end to make sure the final vertical + // position is correct + + + var finalVerticalCallback = function finalVerticalCallback() { + // Double check we ended at the proper scroll position + setFinalVerticalPosition(); // Let the redraw settle and finalize the position. + + setTimeout$2(setFinalVerticalPosition, 100); + }; // calculate the new middle and interval for the window + + + var zoom = options && options.zoom !== undefined ? options.zoom : true; + var middle = (start + end) / 2; + var interval = zoom ? (end - start) * 1.1 : Math.max(this.range.end - this.range.start, (end - start) * 1.1); + var animation = options && options.animation !== undefined ? options.animation : true; + + if (!animation) { + // We aren't animating so set a default so that the final callback forces the vertical location + initialVerticalScroll = { + shouldScroll: false, + scrollOffset: -1, + itemTop: -1 + }; + } + + this.range.setRange(middle - interval / 2, middle + interval / 2, { + animation: animation + }, finalVerticalCallback, verticalAnimationFrame); + } + } + /** + * 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'. + * @param {function} [callback] + */ + + }, { + key: "fit", + value: function fit(options, callback) { + 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 + }, callback); + } else { + // exactly fit the items (plus a small margin) + range = this.getItemRange(); + this.range.setRange(range.min, range.max, { + animation: animation + }, callback); + } + } + /** + * Determine the range of the items, taking into account their actual width + * and a margin of 10 pixels on both sides. + * + * @returns {{min: Date, max: Date}} + */ + + }, { + key: "getItemRange", + value: function getItemRange() { + var _this2 = 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 = max - min; // ms + + if (interval <= 0) { + interval = 10; + } + + var factor = interval / this.props.center.width; + var redrawQueue = {}; + var redrawQueueLength = 0; // collect redraw functions + + forEach$3(util$2).call(util$2, this.itemSet.items, function (item, key) { + if (item.groupShowing) { + var returnQueue = true; + redrawQueue[key] = item.redraw(returnQueue); + redrawQueueLength = redrawQueue[key].length; + } + }); + + var needRedraw = redrawQueueLength > 0; + + if (needRedraw) { + var _loop = function _loop(i) { + forEach$3(util$2).call(util$2, redrawQueue, function (fns) { + fns[i](); + }); + }; + + // redraw all regular items + for (var i = 0; i < redrawQueueLength; i++) { + _loop(i); + } + } // calculate the date of the left side and right side of the items given + + + forEach$3(util$2).call(util$2, this.itemSet.items, function (item) { + var start = getStart(item); + var end = getEnd(item); + var startSide; + var endSide; + + if (_this2.options.rtl) { + startSide = start - (item.getWidthRight() + 10) * factor; + endSide = end + (item.getWidthLeft() + 10) * factor; + } else { + startSide = start - (item.getWidthLeft() + 10) * factor; + endSide = end + (item.getWidthRight() + 10) * factor; + } + + if (startSide < min) { + min = startSide; + minItem = item; + } + + if (endSide > max) { + max = endSide; + maxItem = item; + } + }); + + if (minItem && maxItem) { + var lhs = minItem.getWidthLeft() + 10; + var rhs = maxItem.getWidthRight() + 10; + var 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, max: Date}} + */ + + }, { + key: "getDataRange", + value: function getDataRange() { + var min = null; + var max = null; + var dataset = this.itemsData && this.itemsData.getDataSet(); + + if (dataset) { + forEach$3(dataset).call(dataset, function (item) { + var start = util$2.convert(item.start, 'Date').valueOf(); + var end = util$2.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. + */ + + }, { + key: "getEventProperties", + value: function getEventProperties(event) { + var clientX = event.center ? event.center.x : event.clientX; + var clientY = event.center ? event.center.y : event.clientY; + var centerContainerRect = this.dom.centerContainer.getBoundingClientRect(); + var x = this.options.rtl ? centerContainerRect.right - clientX : clientX - centerContainerRect.left; + var y = clientY - centerContainerRect.top; + 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$2.getTarget(event); + var what = null; + + if (item != null) { + what = 'item'; + } else if (customTime != null) { + what = 'custom-time'; + } else if (util$2.hasParent(element, this.timeAxis.dom.foreground)) { + what = 'axis'; + } else if (this.timeAxis2 && util$2.hasParent(element, this.timeAxis2.dom.foreground)) { + what = 'axis'; + } else if (util$2.hasParent(element, this.itemSet.dom.labelSet)) { + what = 'group-label'; + } else if (util$2.hasParent(element, this.currentTime.bar)) { + what = 'current-time'; + } else if (util$2.hasParent(element, this.dom.center)) { + what = 'background'; + } + + return { + event: event, + item: item ? item.id : null, + isCluster: item ? !!item.isCluster : false, + items: item ? item.items || [] : null, + group: group ? group.groupId : null, + customTime: customTime ? customTime.options.id : 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 + }; + } + /** + * Toggle Timeline rolling mode + */ + + }, { + key: "toggleRollingMode", + value: function toggleRollingMode() { + if (this.range.rolling) { + this.range.stopRolling(); + } else { + if (this.options.rollingMode == undefined) { + this.setOptions(this.options); + } + + this.range.startRolling(); + } + } + /** + * redraw + * @private + */ + + }, { + key: "_redraw", + value: function _redraw() { + Core.prototype._redraw.call(this); + } + /** + * on fit callback + * @param {object} args + * @private + */ + + }, { + key: "_onFit", + value: function _onFit(args) { + var start = args.start, + end = args.end, + animation = args.animation; + + if (!end) { + this.moveTo(start.valueOf(), { + animation: animation + }); + } else { + this.range.setRange(start, end, { + animation: animation + }); + } + } + }]); + + return Timeline; +}(Core); + +function getStart(item) { + return util$2.convert(item.data.start, 'Date').valueOf(); +} +/** + * + * @param {timeline.Item} item + * @returns {number} + */ + + +function getEnd(item) { + var end = item.data.end != undefined ? item.data.end : item.data.start; + return util$2.convert(end, 'Date').valueOf(); +} +/** + * @param {vis.Timeline} timeline + * @param {timeline.Item} item + * @return {{shouldScroll: bool, scrollOffset: number, itemTop: number}} + */ + + +function getItemVerticalScroll(timeline, item) { + if (!item.parent) { + // The item no longer exists, so ignore this focus. + return false; + } + + var itemsetHeight = timeline.options.rtl ? timeline.props.rightContainer.height : timeline.props.leftContainer.height; + var contentHeight = timeline.props.center.height; + var group = item.parent; + var offset = group.top; + var shouldScroll = true; + var orientation = timeline.timeAxis.options.orientation.axis; + + var itemTop = function itemTop() { + if (orientation == "bottom") { + return group.height - item.top - item.height; + } else { + return item.top; + } + }; + + var currentScrollHeight = timeline._getScrollTop() * -1; + var targetOffset = offset + itemTop(); + var height = item.height; + + if (targetOffset < currentScrollHeight) { + if (offset + itemsetHeight <= offset + itemTop() + height) { + offset += itemTop() - timeline.itemSet.options.margin.item.vertical; + } + } else if (targetOffset + height > currentScrollHeight + itemsetHeight) { + offset += itemTop() + height - itemsetHeight + timeline.itemSet.options.margin.item.vertical; + } else { + shouldScroll = false; + } + + offset = Math.min(offset, contentHeight - itemsetHeight); + return { + shouldScroll: shouldScroll, + scrollOffset: offset, + itemTop: targetOffset + }; +} + +/** DataScale */ +var DataScale = +/*#__PURE__*/ +function () { + /** + * + * @param {number} start + * @param {number} end + * @param {boolean} autoScaleStart + * @param {boolean} autoScaleEnd + * @param {number} containerHeight + * @param {number} majorCharHeight + * @param {boolean} zeroAlign + * @param {function} formattingFunction + * @constructor DataScale + */ + function DataScale(start, end, autoScaleStart, autoScaleEnd, containerHeight, majorCharHeight) { + var zeroAlign = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false; + var formattingFunction = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false; + + classCallCheck$1(this, DataScale); + + 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(); + } + } + /** + * set chart height + * @param {number} majorCharHeight + */ + + + createClass$1(DataScale, [{ + key: "setCharHeight", + value: function setCharHeight(majorCharHeight) { + this.majorCharHeight = majorCharHeight; + } + /** + * set height + * @param {number} containerHeight + */ + + }, { + key: "setHeight", + value: function setHeight(containerHeight) { + this.containerHeight = containerHeight; + } + /** + * determine scale + */ + + }, { + key: "determineScale", + value: function determineScale() { + 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; + } + } + } + /** + * returns if value is major + * @param {number} value + * @returns {boolean} + */ + + }, { + key: "is_major", + value: function is_major(value) { + return value % (this.magnitudefactor * this.majorSteps[this.minorStepIdx]) === 0; + } + /** + * returns step size + * @returns {number} + */ + + }, { + key: "getStep", + value: function getStep() { + return this.magnitudefactor * this.minorSteps[this.minorStepIdx]; + } + /** + * returns first major + * @returns {number} + */ + + }, { + key: "getFirstMajor", + value: function getFirstMajor() { + var majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx]; + return this.convertValue(this._start + (majorStep - this._start % majorStep) % majorStep); + } + /** + * returns first major + * @param {date} current + * @returns {date} formatted date + */ + + }, { + key: "formatValue", + value: function formatValue(current) { + var returnValue = current.toPrecision(5); + + if (typeof this.formattingFunction === 'function') { + returnValue = this.formattingFunction(current); + } + + if (typeof returnValue === 'number') { + return "".concat(returnValue); + } else if (typeof returnValue === 'string') { + return returnValue; + } else { + return current.toPrecision(5); + } + } + /** + * returns lines + * @returns {object} lines + */ + + }, { + key: "getLines", + value: function getLines() { + 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; + } + /** + * follow scale + * @param {object} other + */ + + }, { + key: "followScale", + value: function followScale(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) ; 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 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; + } + } + /** + * convert value + * @param {number} value + * @returns {number} + */ + + }, { + key: "convertValue", + value: function convertValue(value) { + return this.containerHeight - (value - this._start) * this.scale; + } + /** + * returns screen to value + * @param {number} pixels + * @returns {number} + */ + + }, { + key: "screenToValue", + value: function screenToValue(pixels) { + return (this.containerHeight - pixels) / this.scale + this._start; + } + }]); + + return DataScale; +}(); + +/** A horizontal time axis */ + +var DataAxis = +/*#__PURE__*/ +function (_Component) { + inherits$1(DataAxis, _Component); + + /** + * @param {Object} body + * @param {Object} [options] See DataAxis.setOptions for the available + * options. + * @param {SVGElement} svg + * @param {timeline.LineGraph.options} linegraphOptions + * @constructor DataAxis + * @extends Component + */ + function DataAxis(body, options, svg, linegraphOptions) { + var _this; + + classCallCheck$1(this, DataAxis); + + _this = possibleConstructorReturn$1(this, getPrototypeOf$4(DataAxis).call(this)); + _this.id = util$2.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 "".concat(_parseFloat$3(value.toPrecision(3))); + }, + title: { + text: undefined, + style: undefined + } + }, + right: { + range: { + min: undefined, + max: undefined + }, + format: function format(value) { + return "".concat(_parseFloat$3(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$2.extend({}, _this.defaultOptions); + _this.conversionFactor = 1; + + _this.setOptions(options); + + _this.width = Number("".concat(_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(); + + if (_this.scale == undefined) { + _this._redrawLabels(); + } + + _this.framework = { + svg: _this.svg, + svgElements: _this.svgElements, + options: _this.options, + groups: _this.groups + }; + + var me = assertThisInitialized$1(_this); + + _this.body.emitter.on("verticalDrag", function () { + me.dom.lineContainer.style.top = "".concat(me.body.domProps.scrollTop, "px"); + }); + + return _this; + } + /** + * Adds group to data axis + * @param {string} label + * @param {object} graphOptions + */ + + + createClass$1(DataAxis, [{ + key: "addGroup", + value: function addGroup(label, graphOptions) { + if (!this.groups.hasOwnProperty(label)) { + this.groups[label] = graphOptions; + } + + this.amountOfGroups += 1; + } + /** + * updates group of data axis + * @param {string} label + * @param {object} graphOptions + */ + + }, { + key: "updateGroup", + value: function updateGroup(label, graphOptions) { + if (!this.groups.hasOwnProperty(label)) { + this.amountOfGroups += 1; + } + + this.groups[label] = graphOptions; + } + /** + * removes group of data axis + * @param {string} label + */ + + }, { + key: "removeGroup", + value: function removeGroup(label) { + if (this.groups.hasOwnProperty(label)) { + delete this.groups[label]; + this.amountOfGroups -= 1; + } + } + /** + * sets options + * @param {object} options + */ + + }, { + key: "setOptions", + value: function setOptions(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$2.selectiveDeepExtend(fields, this.options, options); + this.minWidth = Number("".concat(this.options.width).replace("px", "")); + + if (redraw === true && this.dom.frame) { + this.hide(); + this.show(); + } + } + } + /** + * Create the HTML DOM for the DataAxis + */ + + }, { + key: "_create", + value: function _create() { + 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.dom.lineContainer.style.visibility = 'visible'; + this.dom.lineContainer.style.display = 'block'; // 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); + } + /** + * redraws groups icons + */ + + }, { + key: "_redrawGroupIcons", + value: function _redrawGroupIcons() { + 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 = keys$3(this.groups); + + sort$2(groupArray).call(groupArray, function (a, b) { + return a < b ? -1 : 1; + }); + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = getIterator$2(groupArray), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var groupId = _step.value; + + 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; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + cleanupElements(this.svgElements); + this.iconsRemoved = false; + } + /** + * Cleans up icons + */ + + }, { + key: "_cleanupIcons", + value: function _cleanupIcons() { + if (this.iconsRemoved === false) { + prepareElements(this.svgElements); + cleanupElements(this.svgElements); + this.iconsRemoved = true; + } + } + /** + * Create the HTML DOM for the DataAxis + */ + + }, { + key: "show", + value: function show() { + this.hidden = false; + + if (!this.dom.frame.parentNode) { + if (this.options.orientation === 'left') { + this.body.dom.left.appendChild(this.dom.frame); + } else { + this.body.dom.right.appendChild(this.dom.frame); + } + } + + if (!this.dom.lineContainer.parentNode) { + this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer); + } + + this.dom.lineContainer.style.display = 'block'; + } + /** + * Create the HTML DOM for the DataAxis + */ + + }, { + key: "hide", + value: function hide() { + this.hidden = true; + + if (this.dom.frame.parentNode) { + this.dom.frame.parentNode.removeChild(this.dom.frame); + } + + this.dom.lineContainer.style.display = 'none'; + } + /** + * Set a range (start and end) + * @param {number} start + * @param {number} end + */ + + }, { + key: "setRange", + value: function setRange(start, end) { + this.range.start = start; + this.range.end = end; + } + /** + * Repaint the component + * @return {boolean} Returns true if the component is resized + */ + + }, { + key: "redraw", + value: function redraw() { + var resized = false; + var activeGroups = 0; // Make sure the line container adheres to the vertical scrolling. + + this.dom.lineContainer.style.top = "".concat(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 = "".concat(this.height, "px"); + this.width = this.options.visible === true ? Number("".concat(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; + var backgroundHorizontalOffsetWidth = this.body.dom.backgroundHorizontal.offsetWidth; // 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 = backgroundHorizontalOffsetWidth - this.lineOffset - this.width + 2 * this.options.minorLinesOffset; + props.minorLineHeight = 1; + props.majorLineWidth = backgroundHorizontalOffsetWidth - 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 = "".concat(this.width, "px"); + frame.style.height = "".concat(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 = "".concat(this.width, "px"); + frame.style.height = "".concat(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 + * + * @returns {boolean} + * @private + */ + + }, { + key: "_redrawLabels", + value: function _redrawLabels() { + var _this2 = this; + + var resized = false; + prepareElements(this.DOMelements.lines); + 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); + this.dom.lineContainer.style.display = 'none'; + } else { + this.dom.lineContainer.style.display = 'block'; + } //Is updated in side-effect of _redrawLabel(): + + + this.maxLabelSize = 0; + var lines = this.scale.getLines(); + + forEach$3(lines).call(lines, function (line) { + var y = line.y; + var isMajor = line.major; + + if (_this2.options['showMinorLabels'] && isMajor === false) { + _this2._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-minor', _this2.props.minorCharHeight); + } + + if (isMajor) { + if (y >= 0) { + _this2._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-major', _this2.props.majorCharHeight); + } + } + + if (_this2.master === true) { + if (isMajor) { + _this2._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-major', _this2.options.majorLinesOffset, _this2.props.majorLineWidth); + } else { + _this2._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-minor', _this2.options.minorLinesOffset, _this2.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 = "".concat(this.width, "px"); + cleanupElements(this.DOMelements.lines); + 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 = "".concat(this.width, "px"); + cleanupElements(this.DOMelements.lines); + cleanupElements(this.DOMelements.labels); + this.redraw(); + resized = true; + } else { + cleanupElements(this.DOMelements.lines); + cleanupElements(this.DOMelements.labels); + resized = false; + } + + return resized; + } + /** + * converts value + * @param {number} value + * @returns {number} converted number + */ + + }, { + key: "convertValue", + value: function convertValue(value) { + return this.scale.convertValue(value); + } + /** + * converts value + * @param {number} x + * @returns {number} screen value + */ + + }, { + key: "screenToValue", + value: function screenToValue(x) { + return this.scale.screenToValue(x); + } + /** + * Create a label for the axis at position x + * + * @param {number} y + * @param {string} text + * @param {'top'|'right'|'bottom'|'left'} orientation + * @param {string} className + * @param {number} characterHeight + * @private + */ + + }, { + key: "_redrawLabel", + value: function _redrawLabel(y, text, orientation, className, characterHeight) { + // reuse redundant label + var label = 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 = "-".concat(this.options.labelOffsetX, "px"); + label.style.textAlign = "right"; + } else { + label.style.right = "-".concat(this.options.labelOffsetX, "px"); + label.style.textAlign = "left"; + } + + label.style.top = "".concat(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 {number} y + * @param {'top'|'right'|'bottom'|'left'} orientation + * @param {string} className + * @param {number} offset + * @param {number} width + */ + + }, { + key: "_redrawLine", + value: function _redrawLine(y, orientation, className, offset, width) { + if (this.master === true) { + var line = getDOMElement('div', this.DOMelements.lines, this.dom.lineContainer); //this.dom.redundant.lines.shift(); + + line.className = className; + line.innerHTML = ''; + + if (orientation === 'left') { + line.style.left = "".concat(this.width - offset, "px"); + } else { + line.style.right = "".concat(this.width - offset, "px"); + } + + line.style.width = "".concat(width, "px"); + line.style.top = "".concat(y, "px"); + } + } + /** + * Create a title for the axis + * @private + * @param {'top'|'right'|'bottom'|'left'} orientation + */ + + }, { + key: "_redrawTitle", + value: function _redrawTitle(orientation) { + 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 = getDOMElement('div', this.DOMelements.title, this.dom.frame); + title.className = "vis-y-axis vis-title vis-".concat(orientation); + title.innerHTML = this.options[orientation].title.text; // Add style - if provided + + if (this.options[orientation].title.style !== undefined) { + util$2.addCssText(title, this.options[orientation].title.style); + } + + if (orientation === 'left') { + title.style.left = "".concat(this.props.titleCharHeight, "px"); + } else { + title.style.right = "".concat(this.props.titleCharHeight, "px"); + } + + title.style.width = "".concat(this.height, "px"); + } // we need to clean up in case we did not use all elements. + + + 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 + */ + + }, { + key: "_calculateCharSize", + value: function _calculateCharSize() { + // 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); + } + } + }]); + + return DataAxis; +}(Component); + +/** + * + * @param {number | string} groupId + * @param {Object} options // TODO: Describe options + * + * @constructor Points + */ + +function Points(groupId, options) {} // eslint-disable-line no-unused-vars + +/** + * draw the data points + * + * @param {Array} dataset + * @param {GraphGroup} group + * @param {Object} framework | SVG DOM element + * @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. + 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_1$2(callbackResult) === 'object') { + 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 outline = 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 + + drawPoint(x + 0.5 * iconWidth, y, getGroupTemplate(group), framework.svgElements, framework.svg); +}; +/** + * + * @param {vis.Group} group + * @param {any} callbackResult + * @returns {{style: *, styles: (*|string), size: *, className: *}} + */ + + +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 + }; +} +/** + * + * @param {Object} framework | SVG DOM element + * @param {vis.Group} group + * @returns {function} + */ + + +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; +} + +/** + * + * @param {vis.GraphGroup.id} groupId + * @param {Object} options // TODO: Describe options + * @constructor Bargraph + */ + +function Bargraph(groupId, options) {// eslint-disable-line no-unused-vars +} + +Bargraph.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) { + var fillHeight = iconHeight * 0.5; + var outline = 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); + drawBar(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, barWidth, bar1Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style); + 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 + }; + drawPoint(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, groupTemplate, framework.svgElements, framework.svg); + drawPoint(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, groupTemplate, framework.svgElements, framework.svg); + } +}; +/** + * draw a bar graph + * + * @param {Array.} groupIds + * @param {Object} processedGroupData + * @param {{svg: Object, svgElements: Array., options: Object, groups: Array.}} framework + */ + + +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_end: processedGroupData[groupIds[i]][j].screen_end, + screen_y: processedGroupData[groupIds[i]][j].screen_y, + x: processedGroupData[groupIds[i]][j].x, + end: processedGroupData[groupIds[i]][j].end, + 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 + + + sort$2(combinedData).call(combinedData, 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); + + 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); + } + } + + var dataWidth = drawData.width; + var start = combinedData[i].screen_x; // are we drawing explicit boxes? (we supplied an end value) + + if (combinedData[i].screen_end != undefined) { + dataWidth = combinedData[i].screen_end - combinedData[i].screen_x; + start += dataWidth * 0.5; + } else { + start += drawData.offset; + } + + drawBar(start, combinedData[i].screen_y - heightOffset, dataWidth, 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 {Object} intersections + * @param {Array.} 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 {number} coreDistance + * @param {vis.Group} group + * @param {number} 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 + sort$2(combinedData).call(combinedData, 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 + }; +}; + +/** + * + * @param {vis.GraphGroup.id} groupId + * @param {Object} options // TODO: Describe options + * @constructor Line + */ + +function Line(groupId, options) {// eslint-disable-line no-unused-vars +} + +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 = 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 = 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 = 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 + }; + 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 = 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 {Array.} pathArray + * @param {vis.Group} group + * @param {{svg: Object, svgElements: Array., options: Object, groups: Array.}} framework + */ + + +Line.draw = function (pathArray, group, framework) { + if (pathArray != null && pathArray != undefined) { + var path = 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; + var i; + + if (inverse) { + for (i = pathArray.length - 2; i > 0; i--) { + d += pathArray[i][0] + "," + pathArray[i][1] + " "; + } + } else { + for (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 {Array.} 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 {Array.} data + * @param {vis.GraphGroup} 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 {Array.} 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; +}; + +/** + * /** + * @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 GraphGroup + */ + +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$2.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 (sort$2(this.options) == true) { + util$2.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 {number} pos + */ + + +GraphGroup.prototype.setZeroPosition = function (pos) { + this.zeroPosition = pos; +}; +/** + * set the options of the graph group over the default options. + * @param {Object} options + */ + + +GraphGroup.prototype.setOptions = function (options) { + if (options !== undefined) { + var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'zIndex', 'excludeFromStacking', 'excludeFromLegend']; + util$2.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$2.mergeOptions(this.options, options, 'interpolation'); + util$2.mergeOptions(this.options, options, 'drawPoints'); + util$2.mergeOptions(this.options, options, 'shaded'); + + if (options.interpolation) { + if (_typeof_1$2(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 {vis.Group} 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 {number} iconWidth + * @param {number} iconHeight + * @param {{svg: (*|Element), svgElements: Object, options: Object, groups: Array.}} framework + * @param {number} x + * @param {number} y + * @returns {{icon: (*|Element), label: (*|string), orientation: *}} + */ + + +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": + Line.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": + Bargraph.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 + }; +}; + +/** + * Legend for Graph2d + * + * @param {vis.Graph2d.body} body + * @param {vis.Graph2d.options} options + * @param {number} side + * @param {vis.LineGraph.options} linegraphOptions + * @constructor Legend + * @extends Component + */ + +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$2.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). + */ + + +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$2.selectiveDeepExtend(fields, this.options, options); +}; + +Legend.prototype.redraw = function () { + var activeGroups = 0; + + var groupArray = keys$3(this.groups); + + sort$2(groupArray).call(groupArray, 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 (i = 0; i < groupArray.length; i++) { + groupId = groupArray[i]; + + if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) { + content += this.groups[groupId].content + '
'; + } + } + + 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 = keys$3(this.groups); + + sort$2(groupArray).call(groupArray, function (a, b) { + return a < b ? -1 : 1; + }); // this resets the elements so the order is maintained + + + 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; + } + } + } +}; + +var UNGROUPED$3 = '__ungrouped__'; // reserved group id for ungrouped items + +/** + * This is the constructor of the LineGraph. It requires a Timeline body and options. + * + * @param {vis.Timeline.body} body + * @param {Object} options + * @constructor LineGraph + * @extends Component + */ + +function LineGraph(body, options) { + this.id = util$2.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$2.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) { + // eslint-disable-line no-unused-vars + me._onAdd(params.items); + }, + 'update': function update(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onUpdate(params.items); + }, + 'remove': function remove(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onRemove(params.items); + } + }; // listeners for the DataSet of the groups + + this.groupListeners = { + 'add': function add(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onAddGroups(params.items); + }, + 'update': function update(event, params, senderId) { + // eslint-disable-line no-unused-vars + me._onUpdateGroups(params.items); + }, + 'remove': function remove(event, params, senderId) { + // eslint-disable-line no-unused-vars + 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$2.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$3((options.graphHeight + '').replace("px", '')) < this.body.domProps.centerContainer.height) { + this.updateSVGheight = true; + } + } + + util$2.selectiveDeepExtend(fields, this.options, options); + util$2.mergeOptions(this.options, options, 'interpolation'); + util$2.mergeOptions(this.options, options, 'drawPoints'); + util$2.mergeOptions(this.options, options, 'shaded'); + util$2.mergeOptions(this.options, options, 'legend'); + + if (options.interpolation) { + if (_typeof_1$2(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$3)) { + this.groups[UNGROUPED$3].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). + */ + + +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 + forEach$3(util$2).call(util$2, 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; + + forEach$3(util$2).call(util$2, 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) { + forEach$3(util$2).call(util$2, 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; + + forEach$3(util$2).call(util$2, 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(ids); +}; + +LineGraph.prototype._onAdd = function (ids) { + this._onUpdate(ids); +}; + +LineGraph.prototype._onRemove = function (ids) { + this._onUpdate(ids); +}; + +LineGraph.prototype._onUpdateGroups = function (groupIds) { + this._updateAllGroupData(null, groupIds); +}; + +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 {vis.GraphGroup.id} 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 {vis.GraphGroup} group + * @param {vis.GraphGroup.id} 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. + * + * @param {Array} ids + * @param {Array} groupIds + * @private + */ + + +LineGraph.prototype._updateAllGroupData = function (ids, groupIds) { + if (this.itemsData != null) { + var groupsContent = {}; + var items = this.itemsData.get(); + var fieldId = this.itemsData._idProp; + var idMap = {}; + + if (ids) { + map$2(ids).call(ids, function (id) { + idMap[id] = id; + }); + } //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$3; + } + + groupCounts.hasOwnProperty(groupId) ? groupCounts[groupId]++ : groupCounts[groupId] = 1; + } //Pre-load arrays from existing groups if items are not changed (not in ids) + + + var existingItemsMap = {}; + + if (!groupIds && ids) { + for (groupId in this.groups) { + if (this.groups.hasOwnProperty(groupId)) { + group = this.groups[groupId]; + var existing_items = group.getItems(); + groupsContent[groupId] = filter$2(existing_items).call(existing_items, function (item) { + existingItemsMap[item[fieldId]] = item[fieldId]; + return item[fieldId] !== idMap[item[fieldId]]; + }); + var newLength = groupCounts[groupId]; + groupCounts[groupId] -= groupsContent[groupId].length; + + if (groupsContent[groupId].length < newLength) { + groupsContent[groupId][newLength - 1] = {}; + } + } + } + } //Now insert data into the arrays. + + + for (i = 0; i < items.length; i++) { + item = items[i]; + groupId = item.group; + + if (groupId === null || groupId === undefined) { + groupId = UNGROUPED$3; + } + + if (!groupIds && ids && item[fieldId] !== idMap[item[fieldId]] && existingItemsMap.hasOwnProperty(item[fieldId])) { + continue; + } + + if (!groupsContent.hasOwnProperty(groupId)) { + groupsContent[groupId] = new Array(groupCounts[groupId]); + } //Copy data (because of unmodifiable DataView input. + + + var extended = util$2.bridgeObject(item); + extended.x = util$2.convert(item.x, 'Date'); + extended.end = util$2.convert(item.end, 'Date'); + extended.orginalY = item.y; //real Y + + extended.y = Number(item.y); + extended[fieldId] = item[fieldId]; + var index = groupsContent[groupId].length - groupCounts[groupId]--; + groupsContent[groupId][index] = extended; + } //Make sure all groups are present, to allow removal of old groups + + + for (groupId in this.groups) { + if (this.groups.hasOwnProperty(groupId)) { + if (!groupsContent.hasOwnProperty(groupId)) { + groupsContent[groupId] = new Array(0); + } + } + } //Update legendas, style and axis + + + for (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) { + var _context; + + this.svg.style.width = util$2.option.asSize(3 * this.props.width); + this.svg.style.left = util$2.option.asSize(-this.props.width); // if the height of the graph is set as proportional, change the height of the svg + + if (indexOf$3(_context = this.options.height + '').call(_context, "%") != -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$2.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. + * + * @returns {boolean} + * @private + */ + + +LineGraph.prototype._updateGraph = function () { + // reset the svg elements + 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) { + 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]] = Line.calcPath(dataset, group); + } + + if (group.options.shaded.orientation === "group") { + var subGroupId = group.options.shaded.groupId; + + if (indexOf$3(groupIds).call(groupIds, subGroupId) === -1) { + console.log(group.id + ": Unknown shading group target given:" + subGroupId); + continue; + } + + if (!paths.hasOwnProperty(subGroupId)) { + paths[subGroupId] = Line.calcPath(groupsData[subGroupId], this.groups[subGroupId]); + } + + Line.drawShading(paths[groupIds[i]], group, paths[subGroupId], this.framework); + } else { + Line.drawShading(paths[groupIds[i]], group, undefined, this.framework); + } + } + } // draw the groups, calculating paths if still necessary. + + + Bargraph.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]] = Line.calcPath(groupsData[groupIds[i]], group); + } + + Line.draw(paths[groupIds[i]], group, this.framework); + // eslint-disable-line no-fallthrough + + case "point": // eslint-disable-line no-fallthrough + + 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 + // eslint-disable-line no-fallthrough + + default: //do nothing... + + } + } + } + } + } // cleanup unused svg elements + + + 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 (sort$2(group.options) == true) { + var dateComparator = function dateComparator(a, b) { + return a.getTime() == b.getTime() ? 0 : a < b ? -1 : 1; + }; + + var first = Math.max(0, util$2.binarySearchValue(itemsData, minDate, 'x', 'before', dateComparator)); + var last = Math.min(itemsData.length, util$2.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 {Array.} groupIds + * @param {vis.DataSet} 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. + //TODO: This assumes sorted data, but that's not guaranteed! + + 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]] = splice$2(sampledData).call(sampledData, 0, Math.round(amountOfPoints / increment)); + } + } + } + } +}; +/** + * + * @param {Array.} groupIds + * @param {vis.DataSet} 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 = concat$2(combinedDataLeft).call(combinedDataLeft, groupData); + } else { + combinedDataRight = concat$2(combinedDataRight).call(combinedDataRight, groupData); + } + } 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. + + + Bargraph.getStackedYRange(combinedDataLeft, groupRanges, groupIds, '__barStackLeft', 'left'); + Bargraph.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 + * @returns {boolean} resized + * @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 (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 (i = 0; i < tempGroups.length; i++) { + if (indexOf$3(groupIds).call(groupIds, tempGroups[i]) != -1) { + splice$2(groupIds).call(groupIds, indexOf$3(groupIds).call(groupIds, 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 + * @param {vis.DataAxis} axis + * @returns {boolean} + * @private + */ + + +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 {Array.} datapoints + * @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 + + if (datapoints[i].end != undefined) { + datapoints[i].screen_end = toScreen(datapoints[i].end) + this.props.width; + } else { + datapoints[i].screen_end = undefined; + } + } +}; +/** + * 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 {Array.} datapoints + * @param {vis.GraphGroup} group + * @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))); +}; + +/** + * 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$1 = 'string'; +var bool$1 = 'boolean'; +var number$1 = 'number'; +var array$1 = 'array'; +var date$1 = 'date'; +var object$1 = 'object'; // should only be in a __type__ property + +var dom$1 = 'dom'; +var moment$5 = 'moment'; +var any$1 = 'any'; +var allOptions$2 = { + configure: { + enabled: { + 'boolean': bool$1 + }, + filter: { + 'boolean': bool$1, + 'function': 'function' + }, + container: { + dom: dom$1 + }, + __type__: { + object: object$1, + 'boolean': bool$1, + 'function': 'function' + } + }, + //globals : + alignCurrentTime: { + string: string$1, + 'undefined': 'undefined' + }, + yAxisOrientation: { + string: ['left', 'right'] + }, + defaultGroup: { + string: string$1 + }, + sort: { + 'boolean': bool$1 + }, + sampling: { + 'boolean': bool$1 + }, + stack: { + 'boolean': bool$1 + }, + graphHeight: { + string: string$1, + number: number$1 + }, + shaded: { + enabled: { + 'boolean': bool$1 + }, + orientation: { + string: ['bottom', 'top', 'zero', 'group'] + }, + // top, bottom, zero, group + groupId: { + object: object$1 + }, + __type__: { + 'boolean': bool$1, + object: object$1 + } + }, + style: { + string: ['line', 'bar', 'points'] + }, + // line, bar + barChart: { + width: { + number: number$1 + }, + minWidth: { + number: number$1 + }, + sideBySide: { + 'boolean': bool$1 + }, + align: { + string: ['left', 'center', 'right'] + }, + __type__: { + object: object$1 + } + }, + interpolation: { + enabled: { + 'boolean': bool$1 + }, + parametrization: { + string: ['centripetal', 'chordal', 'uniform'] + }, + // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5) + alpha: { + number: number$1 + }, + __type__: { + object: object$1, + 'boolean': bool$1 + } + }, + drawPoints: { + enabled: { + 'boolean': bool$1 + }, + onRender: { + 'function': 'function' + }, + size: { + number: number$1 + }, + style: { + string: ['square', 'circle'] + }, + // square, circle + __type__: { + object: object$1, + 'boolean': bool$1, + 'function': 'function' + } + }, + dataAxis: { + showMinorLabels: { + 'boolean': bool$1 + }, + showMajorLabels: { + 'boolean': bool$1 + }, + icons: { + 'boolean': bool$1 + }, + width: { + string: string$1, + number: number$1 + }, + visible: { + 'boolean': bool$1 + }, + alignZeros: { + 'boolean': bool$1 + }, + left: { + range: { + min: { + number: number$1, + 'undefined': 'undefined' + }, + max: { + number: number$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + format: { + 'function': 'function' + }, + title: { + text: { + string: string$1, + number: number$1, + 'undefined': 'undefined' + }, + style: { + string: string$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + __type__: { + object: object$1 + } + }, + right: { + range: { + min: { + number: number$1, + 'undefined': 'undefined' + }, + max: { + number: number$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + format: { + 'function': 'function' + }, + title: { + text: { + string: string$1, + number: number$1, + 'undefined': 'undefined' + }, + style: { + string: string$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + __type__: { + object: object$1 + } + }, + __type__: { + object: object$1 + } + }, + legend: { + enabled: { + 'boolean': bool$1 + }, + icons: { + 'boolean': bool$1 + }, + left: { + visible: { + 'boolean': bool$1 + }, + position: { + string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] + }, + __type__: { + object: object$1 + } + }, + right: { + visible: { + 'boolean': bool$1 + }, + position: { + string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] + }, + __type__: { + object: object$1 + } + }, + __type__: { + object: object$1, + 'boolean': bool$1 + } + }, + groups: { + visibility: { + any: any$1 + }, + __type__: { + object: object$1 + } + }, + autoResize: { + 'boolean': bool$1 + }, + throttleRedraw: { + number: number$1 + }, + // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511 + clickToUse: { + 'boolean': bool$1 + }, + end: { + number: number$1, + date: date$1, + string: string$1, + moment: moment$5 + }, + format: { + minorLabels: { + millisecond: { + string: string$1, + 'undefined': 'undefined' + }, + second: { + string: string$1, + 'undefined': 'undefined' + }, + minute: { + string: string$1, + 'undefined': 'undefined' + }, + hour: { + string: string$1, + 'undefined': 'undefined' + }, + weekday: { + string: string$1, + 'undefined': 'undefined' + }, + day: { + string: string$1, + 'undefined': 'undefined' + }, + week: { + string: string$1, + 'undefined': 'undefined' + }, + month: { + string: string$1, + 'undefined': 'undefined' + }, + quarter: { + string: string$1, + 'undefined': 'undefined' + }, + year: { + string: string$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + majorLabels: { + millisecond: { + string: string$1, + 'undefined': 'undefined' + }, + second: { + string: string$1, + 'undefined': 'undefined' + }, + minute: { + string: string$1, + 'undefined': 'undefined' + }, + hour: { + string: string$1, + 'undefined': 'undefined' + }, + weekday: { + string: string$1, + 'undefined': 'undefined' + }, + day: { + string: string$1, + 'undefined': 'undefined' + }, + week: { + string: string$1, + 'undefined': 'undefined' + }, + month: { + string: string$1, + 'undefined': 'undefined' + }, + quarter: { + string: string$1, + 'undefined': 'undefined' + }, + year: { + string: string$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + __type__: { + object: object$1 + } + }, + moment: { + 'function': 'function' + }, + height: { + string: string$1, + number: number$1 + }, + hiddenDates: { + start: { + date: date$1, + number: number$1, + string: string$1, + moment: moment$5 + }, + end: { + date: date$1, + number: number$1, + string: string$1, + moment: moment$5 + }, + repeat: { + string: string$1 + }, + __type__: { + object: object$1, + array: array$1 + } + }, + locale: { + string: string$1 + }, + locales: { + __any__: { + any: any$1 + }, + __type__: { + object: object$1 + } + }, + max: { + date: date$1, + number: number$1, + string: string$1, + moment: moment$5 + }, + maxHeight: { + number: number$1, + string: string$1 + }, + maxMinorChars: { + number: number$1 + }, + min: { + date: date$1, + number: number$1, + string: string$1, + moment: moment$5 + }, + minHeight: { + number: number$1, + string: string$1 + }, + moveable: { + 'boolean': bool$1 + }, + multiselect: { + 'boolean': bool$1 + }, + orientation: { + string: string$1 + }, + showCurrentTime: { + 'boolean': bool$1 + }, + showMajorLabels: { + 'boolean': bool$1 + }, + showMinorLabels: { + 'boolean': bool$1 + }, + start: { + date: date$1, + number: number$1, + string: string$1, + moment: moment$5 + }, + timeAxis: { + scale: { + string: string$1, + 'undefined': 'undefined' + }, + step: { + number: number$1, + 'undefined': 'undefined' + }, + __type__: { + object: object$1 + } + }, + width: { + string: string$1, + number: number$1 + }, + zoomable: { + 'boolean': bool$1 + }, + zoomKey: { + string: ['ctrlKey', 'altKey', 'metaKey', ''] + }, + zoomMax: { + number: number$1 + }, + zoomMin: { + number: number$1 + }, + zIndex: { + number: number$1 + }, + __type__: { + object: object$1 + } +}; +var configureOptions$1 = { + global: { + alignCurrentTime: ['none', 'year', 'month', 'quarter', 'week', 'isoWeek', 'day', 'date', 'hour', 'minute', 'second'], + //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, + clickToUse: false, + end: '', + format: { + minorLabels: { + millisecond: 'SSS', + second: 's', + minute: 'HH:mm', + hour: 'HH:mm', + weekday: 'ddd D', + day: 'D', + week: 'w', + month: 'MMM', + quarter: '[Q]Q', + 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', + week: 'MMMM YYYY', + month: 'YYYY', + quarter: '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 + } +}; + +/** + * Create a timeline visualization + * @param {HTMLElement} container + * @param {vis.DataSet | Array} [items] + * @param {vis.DataSet | Array | vis.DataView | Object} [groups] + * @param {Object} [options] See Graph2d.setOptions for the available options. + * @constructor Graph2d + * @extends Core + */ + +function Graph2d(container, items, groups, options) { + var _context, _context2, _context3, _context4, _context5, _context6, _context7; + + // if the third element is options, the forth is groups (optionally); + if (!(isArray$3(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) { + var forthArgument = options; + options = groups; + groups = forthArgument; + } // TODO: REMOVE THIS in the next MAJOR release + // see https://github.com/almende/vis/issues/2511 + + + if (options && options.throttleRedraw) { + console.warn("Graph2d option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release."); + } + + 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$3, + width: null, + height: null, + maxHeight: null, + minHeight: null + }; + this.options = util$2.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: bind$2(_context = this.on).call(_context, this), + off: bind$2(_context2 = this.off).call(_context2, this), + emit: bind$2(_context3 = this.emit).call(_context3, this) + }, + hiddenDates: [], + util: { + toScreen: bind$2(_context4 = me._toScreen).call(_context4, me), + toGlobalScreen: bind$2(_context5 = me._toGlobalScreen).call(_context5, me), + // this refers to the root.width + toTime: bind$2(_context6 = me._toTime).call(_context6, me), + toGlobalTime: bind$2(_context7 = me._toGlobalTime).call(_context7, 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)); + }; //Single time autoscale/fit + + + this.initialFitDone = false; + this.on('changed', function () { + if (me.itemsData == null) return; + + if (!me.initialFitDone && !me.options.rollingMode) { + me.initialFitDone = 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 + }); + } + } + + if (!me.initialDrawDone && (me.initialRangeChangeDone || !me.options.start && !me.options.end || me.options.rollingMode)) { + me.initialDrawDone = true; + me.dom.root.style.visibility = 'visible'; + me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen); + + if (me.options.onInitialDrawComplete) { + setTimeout$2(function () { + return me.options.onInitialDrawComplete(); + }, 0); + } + } + }); // 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 = Validator.validate(options, allOptions$2); + + 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 {vis.GraphGroup.id} groupId + * @param {number} width + * @param {number} height + * @returns {{icon: SVGElement, label: string, orientation: string}|string} + */ + + +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 {vis.GraphGroup.id} groupId + * @returns {boolean} + */ + + +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$2.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$2.getAbsoluteLeft(this.dom.centerContainer); + var y = clientY - util$2.getAbsoluteTop(this.dom.centerContainer); + + var time = this._toTime(x); + + var customTime = CustomTime.customTimeFromTarget(event); + var element = util$2.getTarget(event); + var what = null; + + if (util$2.hasParent(element, this.timeAxis.dom.foreground)) { + what = 'axis'; + } else if (this.timeAxis2 && util$2.hasParent(element, this.timeAxis2.dom.foreground)) { + what = 'axis'; + } else if (util$2.hasParent(element, this.linegraph.yAxisLeft.dom.frame)) { + what = 'data-axis'; + } else if (util$2.hasParent(element, this.linegraph.yAxisRight.dom.frame)) { + what = 'data-axis'; + } else if (util$2.hasParent(element, this.linegraph.legendLeft.dom.frame)) { + what = 'legend'; + } else if (util$2.hasParent(element, this.linegraph.legendRight.dom.frame)) { + what = 'legend'; + } else if (customTime != null) { + what = 'custom-time'; + } else if (util$2.hasParent(element, this.currentTime.bar)) { + what = 'current-time'; + } else if (util$2.hasParent(element, this.dom.center)) { + what = 'background'; + } + + var value = []; + var yAxisLeft = this.linegraph.yAxisLeft; + var yAxisRight = this.linegraph.yAxisRight; + + if (!yAxisLeft.hidden && this.itemsData.length > 0) { + value.push(yAxisLeft.screenToValue(y)); + } + + if (!yAxisRight.hidden && this.itemsData.length > 0) { + value.push(yAxisRight.screenToValue(y)); + } + + return { + event: event, + customTime: customTime ? customTime.options.id : 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, + value: value + }; +}; +/** + * Load a configurator + * @return {Object} + * @private + */ + + +Graph2d.prototype._createConfigurator = function () { + return new Configurator(this, this.dom.container, configureOptions$1); +}; + +// utils +var defaultLanguage = getNavigatorLanguage(); +moment$3.locale(defaultLanguage); +var timeline = { + Core: Core, + DateUtil: DateUtil, + Range: Range, + stack: stack$1, + TimeStep: TimeStep, + components: { + items: { + Item: Item, + BackgroundItem: BackgroundItem, + BoxItem: BoxItem, + PointItem: PointItem, + RangeItem: RangeItem + }, + BackgroundGroup: BackgroundGroup, + Component: Component, + CurrentTime: CurrentTime, + CustomTime: CustomTime, + DataAxis: DataAxis, + DataScale: DataScale, + GraphGroup: GraphGroup, + Group: Group, + ItemSet: ItemSet, + Legend: Legend, + LineGraph: LineGraph, + TimeAxis: TimeAxis + } +}; +var index = { + util: util, + DOMutil: DOMutil, + DataSet: DataSet, + DataView: DataView, + Queue: Queue, + Timeline: Timeline, + Graph2d: Graph2d, + timeline: timeline, + moment: moment$3, + Hammer: Hammer$1, + keycharm: keycharm +}; + +export default index; +export { DOMutil, DataSet, DataView, Graph2d, Hammer$1 as Hammer, Queue, Timeline, keycharm, moment$3 as moment, timeline, util }; +//# sourceMappingURL=vis-timeline-graph2d.esm.js.map diff --git a/includes/js/vis/dist/vis-timeline-graph2d.esm.js.map b/includes/js/vis/dist/vis-timeline-graph2d.esm.js.map new file mode 100644 index 0000000..f37eccf --- /dev/null +++ b/includes/js/vis/dist/vis-timeline-graph2d.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vis-timeline-graph2d.esm.js","sources":["../node_modules/vis-util/dist/esm.js","../lib/DOMutil.js","../node_modules/vis-data/dist/esm.js","../node_modules/core-js-pure/internals/fails.js","../node_modules/core-js-pure/internals/classof-raw.js","../node_modules/core-js-pure/internals/indexed-object.js","../node_modules/core-js-pure/internals/require-object-coercible.js","../node_modules/core-js-pure/internals/to-indexed-object.js","../node_modules/core-js-pure/internals/iterators.js","../node_modules/core-js-pure/internals/global.js","../node_modules/core-js-pure/internals/descriptors.js","../node_modules/core-js-pure/internals/is-object.js","../node_modules/core-js-pure/internals/document-create-element.js","../node_modules/core-js-pure/internals/ie8-dom-define.js","../node_modules/core-js-pure/internals/an-object.js","../node_modules/core-js-pure/internals/to-primitive.js","../node_modules/core-js-pure/internals/object-define-property.js","../node_modules/core-js-pure/internals/create-property-descriptor.js","../node_modules/core-js-pure/internals/hide.js","../node_modules/core-js-pure/internals/set-global.js","../node_modules/core-js-pure/internals/shared.js","../node_modules/core-js-pure/internals/function-to-string.js","../node_modules/core-js-pure/internals/native-weak-map.js","../node_modules/core-js-pure/internals/has.js","../node_modules/core-js-pure/internals/uid.js","../node_modules/core-js-pure/internals/shared-key.js","../node_modules/core-js-pure/internals/hidden-keys.js","../node_modules/core-js-pure/internals/internal-state.js","../node_modules/core-js-pure/internals/object-property-is-enumerable.js","../node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","../node_modules/core-js-pure/internals/is-forced.js","../node_modules/core-js-pure/internals/path.js","../node_modules/core-js-pure/internals/a-function.js","../node_modules/core-js-pure/internals/bind-context.js","../node_modules/core-js-pure/internals/export.js","../node_modules/core-js-pure/internals/to-object.js","../node_modules/core-js-pure/internals/correct-prototype-getter.js","../node_modules/core-js-pure/internals/object-get-prototype-of.js","../node_modules/core-js-pure/internals/native-symbol.js","../node_modules/core-js-pure/internals/well-known-symbol.js","../node_modules/core-js-pure/internals/iterators-core.js","../node_modules/core-js-pure/internals/to-integer.js","../node_modules/core-js-pure/internals/to-length.js","../node_modules/core-js-pure/internals/to-absolute-index.js","../node_modules/core-js-pure/internals/array-includes.js","../node_modules/core-js-pure/internals/object-keys-internal.js","../node_modules/core-js-pure/internals/enum-bug-keys.js","../node_modules/core-js-pure/internals/object-keys.js","../node_modules/core-js-pure/internals/object-define-properties.js","../node_modules/core-js-pure/internals/get-built-in.js","../node_modules/core-js-pure/internals/html.js","../node_modules/core-js-pure/internals/object-create.js","../node_modules/core-js-pure/internals/classof.js","../node_modules/core-js-pure/internals/object-to-string.js","../node_modules/core-js-pure/internals/set-to-string-tag.js","../node_modules/core-js-pure/internals/create-iterator-constructor.js","../node_modules/core-js-pure/internals/a-possible-prototype.js","../node_modules/core-js-pure/internals/object-set-prototype-of.js","../node_modules/core-js-pure/internals/redefine.js","../node_modules/core-js-pure/internals/define-iterator.js","../node_modules/core-js-pure/modules/es.array.iterator.js","../node_modules/core-js-pure/internals/dom-iterables.js","../node_modules/core-js-pure/modules/web.dom-collections.iterator.js","../node_modules/core-js-pure/internals/is-array.js","../node_modules/core-js-pure/internals/array-species-create.js","../node_modules/core-js-pure/internals/array-iteration.js","../node_modules/core-js-pure/internals/sloppy-array-method.js","../node_modules/core-js-pure/internals/array-for-each.js","../node_modules/core-js-pure/modules/es.array.for-each.js","../node_modules/core-js-pure/internals/entry-virtual.js","../node_modules/core-js-pure/es/array/virtual/for-each.js","../node_modules/core-js-pure/stable/array/virtual/for-each.js","../node_modules/core-js-pure/stable/instance/for-each.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","../node_modules/core-js-pure/internals/array-method-has-species-support.js","../node_modules/core-js-pure/modules/es.array.filter.js","../node_modules/core-js-pure/es/array/virtual/filter.js","../node_modules/core-js-pure/es/instance/filter.js","../node_modules/core-js-pure/stable/instance/filter.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","../node_modules/core-js-pure/internals/user-agent.js","../node_modules/core-js-pure/modules/web.timers.js","../node_modules/core-js-pure/stable/set-timeout.js","../node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js","../node_modules/core-js-pure/internals/function-bind.js","../node_modules/core-js-pure/modules/es.function.bind.js","../node_modules/core-js-pure/es/function/virtual/bind.js","../node_modules/core-js-pure/es/instance/bind.js","../node_modules/core-js-pure/stable/instance/bind.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js","../node_modules/core-js-pure/modules/es.array.is-array.js","../node_modules/core-js-pure/es/array/is-array.js","../node_modules/core-js-pure/stable/array/is-array.js","../node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","../node_modules/@babel/runtime-corejs3/helpers/classCallCheck.js","../node_modules/core-js-pure/modules/es.object.define-property.js","../node_modules/core-js-pure/es/object/define-property.js","../node_modules/core-js-pure/features/object/define-property.js","../node_modules/@babel/runtime-corejs3/core-js/object/define-property.js","../node_modules/@babel/runtime-corejs3/helpers/createClass.js","../node_modules/core-js-pure/internals/wrapped-well-known-symbol.js","../node_modules/core-js-pure/internals/define-well-known-symbol.js","../node_modules/core-js-pure/modules/es.symbol.iterator.js","../node_modules/core-js-pure/internals/string-multibyte.js","../node_modules/core-js-pure/modules/es.string.iterator.js","../node_modules/core-js-pure/es/symbol/iterator.js","../node_modules/core-js-pure/features/symbol/iterator.js","../node_modules/@babel/runtime-corejs3/core-js/symbol/iterator.js","../node_modules/core-js-pure/internals/create-property.js","../node_modules/core-js-pure/modules/es.array.concat.js","../node_modules/core-js-pure/internals/object-get-own-property-names.js","../node_modules/core-js-pure/internals/object-get-own-property-names-external.js","../node_modules/core-js-pure/internals/object-get-own-property-symbols.js","../node_modules/core-js-pure/modules/es.symbol.js","../node_modules/core-js-pure/modules/es.symbol.async-iterator.js","../node_modules/core-js-pure/modules/es.symbol.has-instance.js","../node_modules/core-js-pure/modules/es.symbol.is-concat-spreadable.js","../node_modules/core-js-pure/modules/es.symbol.match.js","../node_modules/core-js-pure/modules/es.symbol.match-all.js","../node_modules/core-js-pure/modules/es.symbol.replace.js","../node_modules/core-js-pure/modules/es.symbol.search.js","../node_modules/core-js-pure/modules/es.symbol.species.js","../node_modules/core-js-pure/modules/es.symbol.split.js","../node_modules/core-js-pure/modules/es.symbol.to-primitive.js","../node_modules/core-js-pure/modules/es.symbol.to-string-tag.js","../node_modules/core-js-pure/modules/es.symbol.unscopables.js","../node_modules/core-js-pure/modules/es.math.to-string-tag.js","../node_modules/core-js-pure/modules/es.json.to-string-tag.js","../node_modules/core-js-pure/es/symbol/index.js","../node_modules/core-js-pure/modules/esnext.symbol.async-dispose.js","../node_modules/core-js-pure/modules/esnext.symbol.dispose.js","../node_modules/core-js-pure/modules/esnext.symbol.observable.js","../node_modules/core-js-pure/modules/esnext.symbol.pattern-match.js","../node_modules/core-js-pure/modules/esnext.symbol.replace-all.js","../node_modules/core-js-pure/features/symbol/index.js","../node_modules/@babel/runtime-corejs3/core-js/symbol.js","../node_modules/@babel/runtime-corejs3/helpers/typeof.js","../node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","../node_modules/@babel/runtime-corejs3/helpers/possibleConstructorReturn.js","../node_modules/core-js-pure/modules/es.object.get-prototype-of.js","../node_modules/core-js-pure/es/object/get-prototype-of.js","../node_modules/core-js-pure/features/object/get-prototype-of.js","../node_modules/@babel/runtime-corejs3/core-js/object/get-prototype-of.js","../node_modules/core-js-pure/modules/es.object.set-prototype-of.js","../node_modules/core-js-pure/es/object/set-prototype-of.js","../node_modules/core-js-pure/features/object/set-prototype-of.js","../node_modules/@babel/runtime-corejs3/core-js/object/set-prototype-of.js","../node_modules/@babel/runtime-corejs3/helpers/getPrototypeOf.js","../node_modules/core-js-pure/modules/es.object.create.js","../node_modules/core-js-pure/es/object/create.js","../node_modules/core-js-pure/features/object/create.js","../node_modules/@babel/runtime-corejs3/core-js/object/create.js","../node_modules/@babel/runtime-corejs3/helpers/setPrototypeOf.js","../node_modules/@babel/runtime-corejs3/helpers/inherits.js","../node_modules/moment/moment.js","../lib/module/moment.js","../node_modules/core-js-pure/stable/object/define-property.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js","../node_modules/core-js-pure/modules/es.object.define-properties.js","../node_modules/core-js-pure/es/object/define-properties.js","../node_modules/core-js-pure/stable/object/define-properties.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.js","../node_modules/core-js-pure/internals/own-keys.js","../node_modules/core-js-pure/modules/es.object.get-own-property-descriptors.js","../node_modules/core-js-pure/es/object/get-own-property-descriptors.js","../node_modules/core-js-pure/stable/object/get-own-property-descriptors.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js","../node_modules/core-js-pure/modules/es.object.get-own-property-descriptor.js","../node_modules/core-js-pure/es/object/get-own-property-descriptor.js","../node_modules/core-js-pure/stable/object/get-own-property-descriptor.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js","../node_modules/core-js-pure/es/object/get-own-property-symbols.js","../node_modules/core-js-pure/stable/object/get-own-property-symbols.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js","../node_modules/core-js-pure/modules/es.object.keys.js","../node_modules/core-js-pure/es/object/keys.js","../node_modules/core-js-pure/stable/object/keys.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","../node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","../lib/util.js","../node_modules/core-js-pure/internals/whitespaces.js","../node_modules/core-js-pure/internals/string-trim.js","../node_modules/core-js-pure/internals/parse-float.js","../node_modules/core-js-pure/modules/es.parse-float.js","../node_modules/core-js-pure/es/parse-float.js","../node_modules/core-js-pure/stable/parse-float.js","../node_modules/@babel/runtime-corejs3/core-js-stable/parse-float.js","../node_modules/core-js-pure/modules/es.date.now.js","../node_modules/core-js-pure/es/date/now.js","../node_modules/core-js-pure/stable/date/now.js","../node_modules/@babel/runtime-corejs3/core-js-stable/date/now.js","../node_modules/core-js-pure/es/json/stringify.js","../node_modules/core-js-pure/stable/json/stringify.js","../node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js","../node_modules/core-js-pure/es/array/virtual/concat.js","../node_modules/core-js-pure/es/instance/concat.js","../node_modules/core-js-pure/stable/instance/concat.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","../lib/timeline/component/Component.js","../node_modules/core-js-pure/modules/es.array.sort.js","../node_modules/core-js-pure/es/array/virtual/sort.js","../node_modules/core-js-pure/es/instance/sort.js","../node_modules/core-js-pure/stable/instance/sort.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js","../node_modules/core-js-pure/internals/string-repeat.js","../node_modules/core-js-pure/modules/es.string.repeat.js","../node_modules/core-js-pure/es/string/virtual/repeat.js","../node_modules/core-js-pure/es/instance/repeat.js","../node_modules/core-js-pure/stable/instance/repeat.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/repeat.js","../lib/timeline/DateUtil.js","../lib/timeline/Range.js","../node_modules/core-js-pure/stable/set-interval.js","../node_modules/@babel/runtime-corejs3/core-js-stable/set-interval.js","../node_modules/core-js-pure/modules/es.array.some.js","../node_modules/core-js-pure/es/array/virtual/some.js","../node_modules/core-js-pure/es/instance/some.js","../node_modules/core-js-pure/stable/instance/some.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js","../node_modules/core-js-pure/modules/es.array.splice.js","../node_modules/core-js-pure/es/array/virtual/splice.js","../node_modules/core-js-pure/es/instance/splice.js","../node_modules/core-js-pure/stable/instance/splice.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/splice.js","../node_modules/core-js-pure/modules/es.array.index-of.js","../node_modules/core-js-pure/es/array/virtual/index-of.js","../node_modules/core-js-pure/es/instance/index-of.js","../node_modules/core-js-pure/stable/instance/index-of.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","../node_modules/emitter-component/index.js","../node_modules/propagating-hammerjs/propagating.js","../node_modules/@egjs/hammerjs/dist/hammer.esm.js","../lib/module/hammer.js","../lib/hammerUtil.js","../node_modules/core-js-pure/internals/parse-int.js","../node_modules/core-js-pure/modules/es.parse-int.js","../node_modules/core-js-pure/es/parse-int.js","../node_modules/core-js-pure/stable/parse-int.js","../node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.js","../lib/timeline/TimeStep.js","../lib/timeline/component/TimeAxis.js","../node_modules/keycharm/keycharm.js","../lib/shared/Activator.js","../node_modules/moment/locale/it.js","../node_modules/moment/locale/nl.js","../node_modules/moment/locale/de.js","../node_modules/moment/locale/fr.js","../node_modules/moment/locale/es.js","../node_modules/moment/locale/uk.js","../node_modules/moment/locale/ru.js","../node_modules/moment/locale/ja.js","../lib/timeline/locales.js","../lib/timeline/component/CustomTime.js","../lib/timeline/Core.js","../lib/timeline/component/CurrentTime.js","../node_modules/core-js-pure/internals/freezing.js","../node_modules/core-js-pure/internals/internal-metadata.js","../node_modules/core-js-pure/internals/is-array-iterator-method.js","../node_modules/core-js-pure/internals/get-iterator-method.js","../node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js","../node_modules/core-js-pure/internals/iterate.js","../node_modules/core-js-pure/internals/an-instance.js","../node_modules/core-js-pure/internals/collection.js","../node_modules/core-js-pure/internals/redefine-all.js","../node_modules/core-js-pure/internals/set-species.js","../node_modules/core-js-pure/internals/collection-strong.js","../node_modules/core-js-pure/modules/es.set.js","../node_modules/core-js-pure/es/set/index.js","../node_modules/core-js-pure/stable/set/index.js","../node_modules/@babel/runtime-corejs3/core-js-stable/set.js","../node_modules/core-js-pure/modules/es.array.map.js","../node_modules/core-js-pure/es/array/virtual/map.js","../node_modules/core-js-pure/es/instance/map.js","../node_modules/core-js-pure/stable/instance/map.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","../node_modules/core-js-pure/stable/object/create.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js","../node_modules/core-js-pure/modules/es.array.find.js","../node_modules/core-js-pure/es/array/virtual/find.js","../node_modules/core-js-pure/es/instance/find.js","../node_modules/core-js-pure/stable/instance/find.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js","../node_modules/core-js-pure/internals/get-iterator.js","../node_modules/core-js-pure/features/get-iterator.js","../node_modules/@babel/runtime-corejs3/core-js/get-iterator.js","../node_modules/core-js-pure/features/array/is-array.js","../node_modules/@babel/runtime-corejs3/core-js/array/is-array.js","../node_modules/@babel/runtime-corejs3/helpers/arrayWithoutHoles.js","../node_modules/core-js-pure/internals/array-from.js","../node_modules/core-js-pure/internals/check-correctness-of-iteration.js","../node_modules/core-js-pure/modules/es.array.from.js","../node_modules/core-js-pure/es/array/from.js","../node_modules/core-js-pure/features/array/from.js","../node_modules/@babel/runtime-corejs3/core-js/array/from.js","../node_modules/core-js-pure/internals/is-iterable.js","../node_modules/core-js-pure/features/is-iterable.js","../node_modules/@babel/runtime-corejs3/core-js/is-iterable.js","../node_modules/@babel/runtime-corejs3/helpers/iterableToArray.js","../node_modules/@babel/runtime-corejs3/helpers/nonIterableSpread.js","../node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js","../node_modules/core-js-pure/internals/object-assign.js","../node_modules/core-js-pure/modules/es.object.assign.js","../node_modules/core-js-pure/es/object/assign.js","../node_modules/core-js-pure/stable/object/assign.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js","../node_modules/core-js-pure/modules/es.array.includes.js","../node_modules/core-js-pure/es/array/virtual/includes.js","../node_modules/core-js-pure/internals/is-regexp.js","../node_modules/core-js-pure/internals/not-a-regexp.js","../node_modules/core-js-pure/internals/correct-is-regexp-logic.js","../node_modules/core-js-pure/modules/es.string.includes.js","../node_modules/core-js-pure/es/string/virtual/includes.js","../node_modules/core-js-pure/es/instance/includes.js","../node_modules/core-js-pure/stable/instance/includes.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","../node_modules/core-js-pure/modules/es.array.slice.js","../node_modules/core-js-pure/es/array/virtual/slice.js","../node_modules/core-js-pure/es/instance/slice.js","../node_modules/core-js-pure/stable/instance/slice.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","../lib/timeline/Stack.js","../lib/timeline/component/Group.js","../lib/timeline/component/BackgroundGroup.js","../lib/timeline/component/item/Item.js","../lib/timeline/component/item/BoxItem.js","../lib/timeline/component/item/PointItem.js","../lib/timeline/component/item/RangeItem.js","../lib/timeline/component/item/BackgroundItem.js","../lib/shared/Popup.js","../node_modules/core-js-pure/modules/es.array.every.js","../node_modules/core-js-pure/es/array/virtual/every.js","../node_modules/core-js-pure/es/instance/every.js","../node_modules/core-js-pure/stable/instance/every.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/every.js","../node_modules/core-js-pure/internals/object-to-array.js","../node_modules/core-js-pure/modules/es.object.values.js","../node_modules/core-js-pure/es/object/values.js","../node_modules/core-js-pure/stable/object/values.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/values.js","../node_modules/core-js-pure/internals/array-reduce.js","../node_modules/core-js-pure/modules/es.array.reduce.js","../node_modules/core-js-pure/es/array/virtual/reduce.js","../node_modules/core-js-pure/es/instance/reduce.js","../node_modules/core-js-pure/stable/instance/reduce.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","../lib/timeline/component/item/ClusterItem.js","../lib/timeline/component/ClusterGenerator.js","../lib/timeline/component/ItemSet.js","../lib/shared/Validator.js","../lib/timeline/optionsTimeline.js","../node_modules/core-js-pure/internals/array-fill.js","../node_modules/core-js-pure/modules/es.array.fill.js","../node_modules/core-js-pure/es/array/virtual/fill.js","../node_modules/core-js-pure/es/instance/fill.js","../node_modules/core-js-pure/stable/instance/fill.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/fill.js","../lib/shared/ColorPicker.js","../lib/shared/Configurator.js","../lib/timeline/Timeline.js","../lib/timeline/component/DataScale.js","../lib/timeline/component/DataAxis.js","../lib/timeline/component/graph2d_types/points.js","../lib/timeline/component/graph2d_types/bar.js","../lib/timeline/component/graph2d_types/line.js","../lib/timeline/component/GraphGroup.js","../lib/timeline/component/Legend.js","../lib/timeline/component/LineGraph.js","../lib/timeline/optionsGraph2d.js","../lib/timeline/Graph2d.js","../index.js"],"sourcesContent":["function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar defineProperty = _defineProperty;\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nvar arrayWithoutHoles = _arrayWithoutHoles;\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nvar iterableToArray = _iterableToArray;\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nvar nonIterableSpread = _nonIterableSpread;\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nvar toConsumableArray = _toConsumableArray;\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar _typeof_1 = createCommonjsModule(function (module) {\n function _typeof2(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof2 = function _typeof2(obj) {\n return typeof obj;\n };\n } else {\n _typeof2 = function _typeof2(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof2(obj);\n }\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n }\n\n module.exports = _typeof;\n});\n\nvar moment = createCommonjsModule(function (module, exports) {\n\n (function (global, factory) {\n module.exports = factory() ;\n })(commonjsGlobal, function () {\n\n var hookCallback;\n\n function hooks() {\n return hookCallback.apply(null, arguments);\n } // This is done to register the method called with moment()\n // without creating circular dependencies.\n\n\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n\n for (k in obj) {\n if (obj.hasOwnProperty(k)) {\n return false;\n }\n }\n\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [],\n i;\n\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n\n return m._pf;\n }\n\n var some;\n\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);\n\n if (m._strict) {\n isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n\n return m._isValid;\n }\n\n function createInvalid(flags) {\n var m = createUTC(NaN);\n\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n } // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n\n\n var momentProperties = hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false; // Moment prototype object\n\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n\n if (!this.isValid()) {\n this._d = new Date(NaN);\n } // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n\n\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment(obj) {\n return obj instanceof Moment || obj != null && obj._isAMomentObject != null;\n }\n\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n } // compare two arrays, return the number of differences\n\n\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {\n diffs++;\n }\n }\n\n return diffs + lengthDiff;\n }\n\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n\n if (firstTime) {\n var args = [];\n var arg;\n\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n\n args.push(arg);\n }\n\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + new Error().stack);\n firstTime = false;\n }\n\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n function set(config) {\n var prop, i;\n\n for (i in config) {\n prop = config[i];\n\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n\n this._config = config; // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n\n this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\\d{1,2}/.source);\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L'\n };\n\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate() {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years'\n };\n\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);\n }\n\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias(unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [];\n\n for (var u in unitsObj) {\n units.push({\n unit: u,\n priority: priorities[u]\n });\n }\n\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n 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;\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n var formatFunctions = {};\n var formatTokenFunctions = {}; // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n\n if (token) {\n formatTokenFunctions[token] = func;\n }\n\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n\n return output;\n };\n } // format date using native date object\n\n\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n\n var match2 = /\\d\\d/; // 00 - 99\n\n var match3 = /\\d{3}/; // 000 - 999\n\n var match4 = /\\d{4}/; // 0000 - 9999\n\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n\n var match1to2 = /\\d\\d?/; // 0 - 99\n\n var match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\n\n var match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\n\n var match1to3 = /\\d{1,3}/; // 0 - 999\n\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n\n var matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n\n var matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i;\n var regexes = {};\n\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n\n\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken(token, callback) {\n var i,\n func = callback;\n\n if (typeof token === 'string') {\n token = [token];\n }\n\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n var WEEK = 7;\n var WEEKDAY = 8; // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n });\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES\n\n addUnitAlias('year', 'y'); // PRIORITIES\n\n addUnitPriority('year', 1); // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n }); // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n } // HOOKS\n\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n }; // MOMENTS\n\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get(mom, unit) {\n return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n }\n\n function set$1(mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));\n } else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n } // MOMENTS\n\n\n function stringGet(units) {\n units = normalizeUnits(units);\n\n if (isFunction(this[units])) {\n return this[units]();\n }\n\n return this;\n }\n\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n\n return this;\n }\n\n function mod(n, x) {\n return (n % x + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;\n } // FORMATTING\n\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n }); // ALIASES\n\n addUnitAlias('month', 'M'); // PRIORITY\n\n addUnitPriority('month', 8); // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid.\n\n\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n }); // LOCALES\n\n var MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months) ? this._months : this._months['standalone'];\n }\n\n return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];\n }\n\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n } // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n\n\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n } // test the regex\n\n\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n } // MOMENTS\n\n\n function setMonth(mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value); // TODO: Another silent failure?\n\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n\n return mom;\n }\n\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n\n var defaultMonthsShortRegex = matchWord;\n\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n\n return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n\n var defaultMonthsRegex = matchWord;\n\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n\n return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;\n }\n }\n\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom;\n\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n } // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n\n\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date; // the date constructor remaps years 0-99 to 1900-1999\n\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate(y) {\n var date; // the Date.UTC function remaps years 0-99 to 1900-1999\n\n if (y < 100 && y >= 0) {\n var args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset\n\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n } // start-of-first-week - start-of-year\n\n\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n return -fwdlw + fwd - 1;\n } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n\n\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n } // FORMATTING\n\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W'); // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5); // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n }); // HELPERS\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow: 0,\n // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 6th is the first week of the year.\n\n };\n\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear() {\n return this._week.doy;\n } // MOMENTS\n\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n } // FORMATTING\n\n\n addFormatToken('d', 0, 'do', 'day');\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E'); // PRIORITY\n\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11); // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid\n\n\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n }); // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n\n return isNaN(input) ? null : input;\n } // LOCALES\n\n\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];\n return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n\n function localeWeekdaysShort(m) {\n return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n\n function localeWeekdaysMin(m) {\n return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._weekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._weekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$', 'i');\n }\n\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n } // test the regex\n\n\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n } // MOMENTS\n\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n } // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n var defaultWeekdaysRegex = matchWord;\n\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n\n return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n var defaultWeekdaysShortRegex = matchWord;\n\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n\n return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n var defaultWeekdaysMinRegex = matchWord;\n\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n\n return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n } // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n\n\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n } // FORMATTING\n\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false); // ALIASES\n\n addUnitAlias('hour', 'h'); // PRIORITY\n\n addUnitPriority('hour', 13); // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n }); // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n } // MOMENTS\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n\n\n var getSetHour = makeGetSet('Hours', true);\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n week: defaultLocaleWeek,\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n meridiemParse: defaultLocaleMeridiemParse\n }; // internal storage for locale config files\n\n var locales = {};\n var localeFamilies = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n } // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n\n\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }\n\n function loadLocale(name) {\n var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node\n\n if (!locales[name] && 'object' !== 'undefined' && module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n var aliasedRequire = commonjsRequire;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {}\n }\n\n return locales[name];\n } // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n\n\n function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n\n if (locales[name] != null) {\n 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 ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n }\n\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n } // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n\n\n getSetGlobalLocale(name);\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig; // MERGE\n\n tmpLocale = loadLocale(name);\n\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale; // backwards compat for now: also set the locale\n\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n\n return locales[name];\n } // returns locale data\n\n\n function getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n\n if (locale) {\n return locale;\n }\n\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow(m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n 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;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n } // Pick the first defined of two or three arguments.\n\n\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n\n if (b != null) {\n return b;\n }\n\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n } // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n\n\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays\n\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n } //if the day of the year is set, figure out what it is\n\n\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n } // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n\n\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n } // Zero out whatever was not defaulted, including time\n\n\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n } // Check for 24:00:00.000\n\n\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n } // check for mismatching day of week\n\n\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n w = config._w;\n\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n var curWeek = weekOfYear(createLocal(), dow, doy);\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week.\n\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n } // iso 8601 regex\n // 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)\n\n\n 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)?)?$/;\n 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)?)?$/;\n var tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n 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\n ['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\n\n 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/]];\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i; // date from iso format\n\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n } // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n\n\n var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;\n\n function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s.replace(/\\([^)]*\\)|[\\n\\t]/g, ' ').replace(/(\\s\\s+)/g, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();\n\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n\n return true;\n }\n\n var obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60\n };\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10);\n var m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n } // date and time from ref 2822 format\n\n\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i));\n\n if (match) {\n var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);\n\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n config._d = createUTCDate.apply(null, config._a);\n\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n } // date from iso format or fallback\n\n\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n } // Final attempt, use Input Fallback\n\n\n hooks.createFromInputFallback(config);\n }\n\n hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }); // constant that refers to the ISO standard\n\n hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form\n\n\n hooks.RFC_2822 = function () {}; // date from string and format string\n\n\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }\n\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n\n if (isPm && hour < 12) {\n hour += 12;\n }\n\n if (!isPm && hour === 12) {\n hour = 0;\n }\n\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n } // date from string and array of format strings\n\n\n function configFromStringAndArray(config) {\n var tempConfig, bestMoment, scoreToBeat, i, currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n } // if there is any input that was not parsed add a penalty for that format\n\n\n currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens\n\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n configFromArray(config);\n }\n\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || format === undefined && input === '') {\n return createInvalid({\n nullInput: true\n });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {\n input = undefined;\n } // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n\n\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n return createFromConfig(c);\n }\n\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n });\n var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }); // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n\n function pickBy(fn, moments) {\n var res, i;\n\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n\n if (!moments.length) {\n return createLocal();\n }\n\n res = moments[0];\n\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n\n return res;\n } // TODO: Use [].sort instead?\n\n\n function min() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isBefore', args);\n }\n\n function max() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n\n function isDurationValid(m) {\n for (var key in m) {\n if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n\n var unitHasDecimal = false;\n\n for (var i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove\n\n this._milliseconds = +milliseconds + seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n\n this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n\n this._months = +months + quarters * 3 + years * 12;\n this._data = {};\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n } // FORMATTING\n\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', ''); // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n }); // HELPERS\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n } // Return a moment from input, that is local/utc/zone equivalent to model.\n\n\n function cloneWithOffset(input, model) {\n var res, diff;\n\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api.\n\n res._d.setTime(res._d.valueOf() + diff);\n\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n } // HOOKS\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n\n\n hooks.updateOffset = function () {}; // MOMENTS\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n\n\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n\n this._offset = input;\n this._isUTC = true;\n\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n\n return this;\n }\n\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n\n return this;\n }\n\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n\n input = input ? createLocal(input).utcOffset() : 0;\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime() {\n return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();\n }\n\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n } // ASP.NET json date format regex\n\n\n var aspNetRegex = /^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n\n 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)?)?$/;\n\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign)\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it\n\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n res.months = other.month() - base.month() + (other.year() - base.year()) * 12;\n\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n\n if (!(base.isValid() && other.isValid())) {\n return {\n milliseconds: 0,\n months: 0\n };\n }\n\n other = cloneWithOffset(other, base);\n\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n } // TODO: remove 'name' arg after deprecation is removed\n\n\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp; //invert the arguments, but complain about it\n\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add');\n var subtract = createAdder(-1, 'subtract');\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';\n }\n\n function calendar$1(time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n\n function clone() {\n return new Moment(this);\n }\n\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n\n units = normalizeUnits(units) || 'millisecond';\n\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n\n units = normalizeUnits(units) || 'millisecond';\n\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));\n }\n\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n\n units = normalizeUnits(units) || 'millisecond';\n\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n\n case 'month':\n output = monthDiff(this, that);\n break;\n\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n\n case 'second':\n output = (this - that) / 1e3;\n break;\n // 1000\n\n case 'minute':\n output = (this - that) / 6e4;\n break;\n // 1000 * 60\n\n case 'hour':\n output = (this - that) / 36e5;\n break;\n // 1000 * 60 * 60\n\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break;\n // 1000 * 60 * 60 * 24, negate dst\n\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break;\n // 1000 * 60 * 60 * 24 * 7, negate dst\n\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff(a, b) {\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month\n\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month\n\n adjust = (b - anchor) / (anchor2 - anchor);\n } //check for negative zero, return zero if negative zero\n\n\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n\n var utc = keepOffset !== true;\n var m = utc ? this.clone().utc() : this;\n\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));\n }\n }\n\n return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n\n\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n\n var func = 'moment';\n var zone = '';\n\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n\n var prefix = '[' + func + '(\"]';\n var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n to: this,\n from: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n from: this,\n to: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n } // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n\n\n function locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n\n return this;\n }\n }\n\n var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n });\n\n function localeData() {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000;\n var MS_PER_MINUTE = 60 * MS_PER_SECOND;\n var MS_PER_HOUR = 60 * MS_PER_MINUTE;\n var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970):\n\n function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf(units) {\n var time;\n units = normalizeUnits(units);\n\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3, 1);\n break;\n\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday());\n break;\n\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));\n break;\n\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);\n break;\n\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf(units) {\n var time;\n units = normalizeUnits(units);\n\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;\n break;\n\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;\n break;\n\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;\n break;\n\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n\n case 'hour':\n time = this._d.valueOf();\n time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;\n break;\n\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate() {\n return new Date(this.valueOf());\n }\n\n function toArray() {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2() {\n return isValid(this);\n }\n\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n } // FORMATTING\n\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG'); // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1); // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n }); // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);\n }\n\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n } // FORMATTING\n\n\n addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES\n\n addUnitAlias('quarter', 'Q'); // PRIORITY\n\n addUnitPriority('quarter', 7); // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n }); // MOMENTS\n\n function getSetQuarter(input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n } // FORMATTING\n\n\n addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES\n\n addUnitAlias('date', 'D'); // PRIORITY\n\n addUnitPriority('date', 9); // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;\n });\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n }); // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD'); // PRIORITY\n\n addUnitPriority('dayOfYear', 4); // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n }); // HELPERS\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n } // FORMATTING\n\n\n addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES\n\n addUnitAlias('minute', 'm'); // PRIORITY\n\n addUnitPriority('minute', 14); // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE); // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false); // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES\n\n addUnitAlias('second', 's'); // PRIORITY\n\n addUnitPriority('second', 15); // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND); // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false); // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n }); // ALIASES\n\n addUnitAlias('millisecond', 'ms'); // PRIORITY\n\n addUnitPriority('millisecond', 16); // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n var token;\n\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n } // MOMENTS\n\n\n var getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat(string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1(format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n\n return out;\n } // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n\n\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n\n return out;\n }\n\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';\n return number + output;\n }\n }); // Side effect imports\n\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n var mathAbs = Math.abs;\n\n function abs() {\n var data = this._data;\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n return this;\n }\n\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n return duration._bubble();\n } // supports only 2.0-style add(1, 's') or add(duration)\n\n\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n } // supports only 2.0-style subtract(1, 's') or subtract(duration)\n\n\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble() {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n\n if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n } // The following code bubbles up values, see the tests for\n // examples of what that means.\n\n\n data.milliseconds = milliseconds % 1000;\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n days += absFloor(hours / 24); // convert days to months\n\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year\n\n years = absFloor(months / 12);\n months %= 12;\n data.days = days;\n data.months = months;\n data.years = years;\n return this;\n }\n\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n\n var days;\n var months;\n var milliseconds = this._milliseconds;\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n\n switch (units) {\n case 'month':\n return months;\n\n case 'quarter':\n return months / 3;\n\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n\n case 'day':\n return days + milliseconds / 864e5;\n\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n } // TODO: Use this.as('ms')?\n\n\n function valueOf$1() {\n if (!this.isValid()) {\n return NaN;\n }\n\n return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;\n }\n\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asQuarters = makeAs('Q');\n var asYears = makeAs('y');\n\n function clone$1() {\n return createDuration(this);\n }\n\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks() {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n ss: 44,\n // a few seconds to seconds\n s: 45,\n // seconds to minute\n m: 45,\n // minutes to hour\n h: 22,\n // hours to day\n d: 26,\n // days to month\n M: 11 // months to year\n\n }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1(posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n var a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', 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];\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n } // This function allows you to set the rounding function for relative time strings\n\n\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n\n return false;\n } // This function allows you to set a threshold for relative time strings\n\n\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n\n if (limit === undefined) {\n return thresholds[threshold];\n }\n\n thresholds[threshold] = limit;\n\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n\n return true;\n }\n\n function humanize(withSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years; // 3600 seconds -> 60 minutes -> 1 hour\n\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60; // 12 months -> 1 year\n\n years = absFloor(months / 12);\n months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n var totalSign = total < 0 ? '-' : '';\n var ymSign = sign(this._months) !== sign(total) ? '-' : '';\n var daysSign = sign(this._days) !== sign(total) ? '-' : '';\n var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : '');\n }\n\n var proto$2 = Duration.prototype;\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang; // Side effect imports\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf'); // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n }); // Side effect imports\n\n hooks.version = '2.24.0';\n setHookCallback(createLocal);\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats\n\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',\n // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',\n // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',\n // \n DATE: 'YYYY-MM-DD',\n // \n TIME: 'HH:mm',\n // \n TIME_SECONDS: 'HH:mm:ss',\n // \n TIME_MS: 'HH:mm:ss.SSS',\n // \n WEEK: 'GGGG-[W]WW',\n // \n MONTH: 'YYYY-MM' // \n\n };\n return hooks;\n });\n});\n\n// Maps for number <-> hex string conversion\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; i++) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n/**\n * Represent binary UUID into it's string representation.\n *\n * @param buf - Buffer containing UUID bytes.\n * @param offset - Offset from the start of the buffer where the UUID is saved (not needed if the buffer starts with the UUID).\n *\n * @returns String representation of the UUID.\n */\n\n\nfunction stringifyUUID(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n 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++]];\n}\n/**\n * Generate 16 random bytes to be used as a base for UUID.\n *\n * @ignore\n */\n\n\nvar random = function () {\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n // Moderately fast, high quality\n var _rnds8 = new Uint8Array(16);\n\n return function whatwgRNG() {\n crypto.getRandomValues(_rnds8);\n return _rnds8;\n };\n } // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random().\n // It's fast, but is of unspecified quality.\n\n\n var _rnds = new Array(16);\n\n return function () {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) {\n r = Math.random() * 0x100000000;\n }\n\n _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return _rnds;\n }; // uuid.js\n //\n // Copyright (c) 2010-2012 Robert Kieffer\n // MIT License - http://opensource.org/licenses/mit-license.php\n // Unique ID creation requires a high quality random # generator. We feature\n // detect to determine the best RNG source, normalizing to a function that\n // returns 128-bits of randomness, since that's what's usually required\n // return require('./rng');\n}();\n\nvar byteToHex$1 = [];\n\nfor (var i$1 = 0; i$1 < 256; i$1++) {\n byteToHex$1[i$1] = (i$1 + 0x100).toString(16).substr(1);\n} // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n// random #'s we need to init node and clockseq\n\n\nvar seedBytes = random(); // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n\nvar defaultNodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; // Per 4.2.2, randomize (14 bit) clockseq\n\nvar defaultClockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; // Previous uuid creation time\n/**\n * UUIDv4 options.\n */\n\n/**\n * Generate UUIDv4\n *\n * @param options - Options to be used instead of default generated values.\n * String 'binary' is a shorthand for uuid4({}, new Array(16)).\n * @param buf - If present the buffer will be filled with the generated UUID.\n * @param offset - Offset of the UUID from the start of the buffer.\n *\n * @returns UUIDv4\n */\n\n\nfunction uuid4() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var buf = arguments.length > 1 ? arguments[1] : undefined;\n var offset = arguments.length > 2 ? arguments[2] : undefined; // Deprecated - 'format' argument, as supported in v1.2\n\n var i = buf && offset || 0;\n\n if (typeof options === 'string') {\n buf = options === 'binary' ? new Array(16) : undefined;\n options = {};\n }\n\n var rnds = options.random || (options.rng || random)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n for (var ii = 0; ii < 16; ii++) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || stringifyUUID(rnds);\n} // Rollup will complain about mixing default and named exports in UMD build,\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'\n// code from http://momentjs.com/\n\nvar ASPDateRegex = /^\\/?Date\\((-?\\d+)/i; // Hex color\n\nvar fullHexRE = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;\nvar shortHexRE = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n/**\n * Hue, Saturation, Value.\n */\n\n/**\n * Test whether given object is a number\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if number, false otherwise.\n */\nfunction isNumber(value) {\n return value instanceof Number || typeof value === 'number';\n}\n/**\n * Remove everything in the DOM object\n *\n * @param DOMobject - Node whose child nodes will be recursively deleted.\n */\n\nfunction recursiveDOMDelete(DOMobject) {\n if (DOMobject) {\n while (DOMobject.hasChildNodes() === true) {\n var child = DOMobject.firstChild;\n\n if (child) {\n recursiveDOMDelete(child);\n DOMobject.removeChild(child);\n }\n }\n }\n}\n/**\n * Test whether given object is a string\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if string, false otherwise.\n */\n\nfunction isString(value) {\n return value instanceof String || typeof value === 'string';\n}\n/**\n * Test whether given object is a object (not primitive or null).\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if not null object, false otherwise.\n */\n\nfunction isObject(value) {\n return _typeof_1(value) === 'object' && value !== null;\n}\n/**\n * Test whether given object is a Date, or a String containing a Date\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if Date instance or string date representation, false otherwise.\n */\n\nfunction isDate(value) {\n if (value instanceof Date) {\n return true;\n } else if (isString(value)) {\n // test whether this string contains a date\n var match = ASPDateRegex.exec(value);\n\n if (match) {\n return true;\n } else if (!isNaN(Date.parse(value))) {\n return true;\n }\n }\n\n return false;\n}\n/**\n * Test whether given object is a Moment date.\n * @TODO: This is basically a workaround, if Moment was imported property it wouldn't necessary as moment.isMoment is a TS type guard.\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if Moment instance, false otherwise.\n */\n\nfunction isMoment(value) {\n return moment.isMoment(value);\n}\n/**\n * Copy property from b to a if property present in a.\n * If property in b explicitly set to null, delete it if `allowDeletion` set.\n *\n * Internal helper routine, should not be exported. Not added to `exports` for that reason.\n *\n * @param a - Target object.\n * @param b - Source object.\n * @param prop - Name of property to copy from b to a.\n * @param allowDeletion if true, delete property in a if explicitly set to null in b\n */\n\nfunction copyOrDelete(a, b, prop, allowDeletion) {\n var doDeletion = false;\n\n if (allowDeletion === true) {\n doDeletion = b[prop] === null && a[prop] !== undefined;\n }\n\n if (doDeletion) {\n delete a[prop];\n } else {\n a[prop] = b[prop]; // Remember, this is a reference copy!\n }\n}\n/**\n * Fill an object with a possibly partially defined other object.\n *\n * Only copies values for the properties already present in a.\n * That means an object is not created on a property if only the b object has it.\n *\n * @param a - The object that will have it's properties updated.\n * @param b - The object with property updates.\n * @param allowDeletion - if true, delete properties in a that are explicitly set to null in b\n */\n\n\nfunction fillIfDefined(a, b) {\n var allowDeletion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n // NOTE: iteration of properties of a\n // NOTE: prototype properties iterated over as well\n for (var prop in a) {\n if (b[prop] !== undefined) {\n if (b[prop] === null || _typeof_1(b[prop]) !== 'object') {\n // Note: typeof null === 'object'\n copyOrDelete(a, b, prop, allowDeletion);\n } else {\n var aProp = a[prop];\n var bProp = b[prop];\n\n if (isObject(aProp) && isObject(bProp)) {\n fillIfDefined(aProp, bProp, allowDeletion);\n }\n }\n }\n }\n}\n/**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n *\n * @param target - The target object to copy to.\n * @param source - The source object from which to copy properties.\n *\n * @return The target object.\n */\n\nvar extend = Object.assign;\n/**\n * Extend object a with selected properties of object b or a series of objects\n * Only properties with defined values are copied\n *\n * @param props - Properties to be copied to a.\n * @param a - The target.\n * @param others - The sources.\n *\n * @returns Argument a.\n */\n\nfunction selectiveExtend(props, a) {\n if (!Array.isArray(props)) {\n throw new Error('Array with property names expected as first argument');\n }\n\n for (var _len = arguments.length, others = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n others[_key - 2] = arguments[_key];\n }\n\n for (var _i = 0, _others = others; _i < _others.length; _i++) {\n var other = _others[_i];\n\n for (var p = 0; p < props.length; p++) {\n var prop = props[p];\n\n if (other && Object.prototype.hasOwnProperty.call(other, prop)) {\n a[prop] = other[prop];\n }\n }\n }\n\n return a;\n}\n/**\n * Extend object a with selected properties of object b.\n * Only properties with defined values are copied.\n *\n * **Note:** Previous version of this routine implied that multiple source objects\n * could be used; however, the implementation was **wrong**.\n * Since multiple (>1) sources weren't used anywhere in the `vis.js` code,\n * this has been removed\n *\n * @param props - Names of first-level properties to copy over.\n * @param a - Target object.\n * @param b - Source object.\n * @param allowDeletion - If true, delete property in a if explicitly set to null in b.\n *\n * @returns Argument a.\n */\n\nfunction selectiveDeepExtend(props, a, b) {\n var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n\n for (var p = 0; p < props.length; p++) {\n var prop = props[p];\n\n if (Object.prototype.hasOwnProperty.call(b, prop)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n\n if (a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop], false, allowDeletion);\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend');\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n }\n }\n\n return a;\n}\n/**\n * Extend object `a` with properties of object `b`, ignoring properties which are explicitly\n * specified to be excluded.\n *\n * The properties of `b` are considered for copying.\n * Properties which are themselves objects are are also extended.\n * Only properties with defined values are copied\n *\n * @param propsToExclude - Names of properties which should *not* be copied.\n * @param a - Object to extend.\n * @param b - Object to take properties from for extension.\n * @param allowDeletion - If true, delete properties in a that are explicitly set to null in b.\n *\n * @returns Argument a.\n */\n\nfunction selectiveNotDeepExtend(propsToExclude, a, b) {\n var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n // TODO: add support for Arrays to deepExtend\n // NOTE: array properties have an else-below; apparently, there is a problem here.\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n\n for (var prop in b) {\n if (!Object.prototype.hasOwnProperty.call(b, prop)) {\n continue;\n } // Handle local properties only\n\n\n if (propsToExclude.indexOf(prop) !== -1) {\n continue;\n } // In exclusion list, skip\n\n\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n\n if (a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]); // NOTE: allowDeletion not propagated!\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n } else if (Array.isArray(b[prop])) {\n a[prop] = [];\n\n for (var i = 0; i < b[prop].length; i++) {\n a[prop].push(b[prop][i]);\n }\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n }\n\n return a;\n}\n/**\n * Deep extend an object a with the properties of object b\n *\n * @param a - Target object.\n * @param b - Source object.\n * @param protoExtend - If true, the prototype values will also be extended\n * (ie. the options objects that inherit from others will also get the inherited options).\n * @param allowDeletion - If true, the values of fields that are null will be deleted.\n *\n * @returns Argument a.\n */\n\nfunction deepExtend(a, b) {\n var protoExtend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n for (var prop in b) {\n if (Object.prototype.hasOwnProperty.call(b, prop) || protoExtend === true) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n\n if (a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop], protoExtend); // NOTE: allowDeletion not propagated!\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n } else if (Array.isArray(b[prop])) {\n a[prop] = [];\n\n for (var i = 0; i < b[prop].length; i++) {\n a[prop].push(b[prop][i]);\n }\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n }\n }\n\n return a;\n}\n/**\n * Test whether all elements in two arrays are equal.\n *\n * @param a - First array.\n * @param b - Second array.\n *\n * @returns True if both arrays have the same length and same elements (1 = '1').\n */\n\nfunction equalArray(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0, len = a.length; i < len; i++) {\n if (a[i] != b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Convert an object into another type\n *\n * @param object - Value of unknown type.\n * @param type - Name of the desired type.\n *\n * @returns Object in the desired type.\n * @throws Error\n */\nfunction convert(object, type) {\n var match;\n\n if (object === undefined) {\n return undefined;\n }\n\n if (object === null) {\n return null;\n }\n\n if (!type) {\n return object;\n }\n\n if (!(typeof type === 'string') && !(type instanceof String)) {\n throw new Error('Type must be a string');\n } //noinspection FallthroughInSwitchStatementJS\n\n\n switch (type) {\n case 'boolean':\n case 'Boolean':\n return Boolean(object);\n\n case 'number':\n case 'Number':\n if (isString(object) && !isNaN(Date.parse(object))) {\n return moment(object).valueOf();\n } else {\n // @TODO: I don't think that Number and String constructors are a good idea.\n // This could also fail if the object doesn't have valueOf method or if it's redefined.\n // For example: Object.create(null) or { valueOf: 7 }.\n return Number(object.valueOf());\n }\n\n case 'string':\n case 'String':\n return String(object);\n\n case 'Date':\n if (isNumber(object)) {\n return new Date(object);\n }\n\n if (object instanceof Date) {\n return new Date(object.valueOf());\n } else if (isMoment(object)) {\n return new Date(object.valueOf());\n }\n\n if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])); // parse number\n } else {\n return moment(new Date(object)).toDate(); // parse string\n }\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type Date');\n }\n\n case 'Moment':\n if (isNumber(object)) {\n return moment(object);\n }\n\n if (object instanceof Date) {\n return moment(object.valueOf());\n } else if (isMoment(object)) {\n return moment(object);\n }\n\n if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n if (match) {\n // object is an ASP date\n return moment(Number(match[1])); // parse number\n } else {\n return moment(object); // parse string\n }\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type Date');\n }\n\n case 'ISODate':\n if (isNumber(object)) {\n return new Date(object);\n } else if (object instanceof Date) {\n return object.toISOString();\n } else if (isMoment(object)) {\n return object.toDate().toISOString();\n } else if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])).toISOString(); // parse number\n } else {\n return moment(object).format(); // ISO 8601\n }\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type ISODate');\n }\n\n case 'ASPDate':\n if (isNumber(object)) {\n return '/Date(' + object + ')/';\n } else if (object instanceof Date || isMoment(object)) {\n return '/Date(' + object.valueOf() + ')/';\n } else if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n var _value;\n\n if (match) {\n // object is an ASP date\n _value = new Date(Number(match[1])).valueOf(); // parse number\n } else {\n _value = new Date(object).valueOf(); // parse string\n }\n\n return '/Date(' + _value + ')/';\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type ASPDate');\n }\n\n default:\n var never = type;\n throw new Error(\"Unknown type \".concat(never));\n }\n}\n/**\n * Get the type of an object, for example exports.getType([]) returns 'Array'\n *\n * @param object - Input value of unknown type.\n *\n * @returns Detected type.\n */\n\nfunction getType(object) {\n var type = _typeof_1(object);\n\n if (type === 'object') {\n if (object === null) {\n return 'null';\n }\n\n if (object instanceof Boolean) {\n return 'Boolean';\n }\n\n if (object instanceof Number) {\n return 'Number';\n }\n\n if (object instanceof String) {\n return 'String';\n }\n\n if (Array.isArray(object)) {\n return 'Array';\n }\n\n if (object instanceof Date) {\n return 'Date';\n }\n\n return 'Object';\n }\n\n if (type === 'number') {\n return 'Number';\n }\n\n if (type === 'boolean') {\n return 'Boolean';\n }\n\n if (type === 'string') {\n return 'String';\n }\n\n if (type === undefined) {\n return 'undefined';\n }\n\n return type;\n}\n\n/**\n * Used to extend an array and copy it. This is used to propagate paths recursively.\n *\n * @param arr - First part.\n * @param newValue - The value to be aadded into the array.\n *\n * @returns A new array with all items from arr and newValue (which is last).\n */\nfunction copyAndExtendArray(arr, newValue) {\n return [].concat(toConsumableArray(arr), [newValue]);\n}\n/**\n * Used to extend an array and copy it. This is used to propagate paths recursively.\n *\n * @param arr - The array to be copied.\n *\n * @returns Shallow copy of arr.\n */\n\nfunction copyArray(arr) {\n return arr.slice();\n}\n/**\n * Retrieve the absolute left value of a DOM element\n *\n * @param elem - A dom element, for example a div.\n *\n * @returns The absolute left position of this element in the browser page.\n */\n\nfunction getAbsoluteLeft(elem) {\n return elem.getBoundingClientRect().left;\n}\n/**\n * Retrieve the absolute right value of a DOM element\n *\n * @param elem - A dom element, for example a div.\n *\n * @returns The absolute right position of this element in the browser page.\n */\n\nfunction getAbsoluteRight(elem) {\n return elem.getBoundingClientRect().right;\n}\n/**\n * Retrieve the absolute top value of a DOM element\n *\n * @param elem - A dom element, for example a div.\n *\n * @returns The absolute top position of this element in the browser page.\n */\n\nfunction getAbsoluteTop(elem) {\n return elem.getBoundingClientRect().top;\n}\n/**\n * Add a className to the given elements style.\n *\n * @param elem - The element to which the classes will be added.\n * @param classNames - Space separated list of classes.\n */\n\nfunction addClassName(elem, classNames) {\n var classes = elem.className.split(' ');\n var newClasses = classNames.split(' ');\n classes = classes.concat(newClasses.filter(function (className) {\n return classes.indexOf(className) < 0;\n }));\n elem.className = classes.join(' ');\n}\n/**\n * Remove a className from the given elements style.\n *\n * @param elem - The element from which the classes will be removed.\n * @param classNames - Space separated list of classes.\n */\n\nfunction removeClassName(elem, classNames) {\n var classes = elem.className.split(' ');\n var oldClasses = classNames.split(' ');\n classes = classes.filter(function (className) {\n return oldClasses.indexOf(className) < 0;\n });\n elem.className = classes.join(' ');\n}\n\n/**\n * For each method for both arrays and objects.\n * In case of an array, the built-in Array.forEach() is applied (**No, it's not!**).\n * In case of an Object, the method loops over all properties of the object.\n *\n * @param object - An Object or Array to be iterated over.\n * @param callback - Array.forEach-like callback.\n */\nfunction forEach(object, callback) {\n if (Array.isArray(object)) {\n // array\n var len = object.length;\n\n for (var i = 0; i < len; i++) {\n callback(object[i], i, object);\n }\n } else {\n // object\n for (var _key2 in object) {\n if (Object.prototype.hasOwnProperty.call(object, _key2)) {\n callback(object[_key2], _key2, object);\n }\n }\n }\n}\n/**\n * Convert an object into an array: all objects properties are put into the array. The resulting array is unordered.\n *\n * @param o - Object that contains the properties and methods.\n *\n * @returns An array of unordered values.\n */\n\nvar toArray = Object.values;\n/**\n * Update a property in an object\n *\n * @param object - The object whose property will be updated.\n * @param key - Name of the property to be updated.\n * @param value - The new value to be assigned.\n *\n * @returns Whether the value was updated (true) or already strictly the same in the original object (false).\n */\n\nfunction updateProperty(object, key, value) {\n if (object[key] !== value) {\n object[key] = value;\n return true;\n } else {\n return false;\n }\n}\n/**\n * Throttle the given function to be only executed once per animation frame.\n *\n * @param fn - The original function.\n *\n * @returns The throttled function.\n */\n\nfunction throttle(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n requestAnimationFrame(function () {\n scheduled = false;\n fn();\n });\n }\n };\n}\n/**\n * Add and event listener. Works for all browsers.\n *\n * @param element - The element to bind the event listener to.\n * @param action - Same as Element.addEventListener(action, —, —).\n * @param listener - Same as Element.addEventListener(—, listener, —).\n * @param useCapture - Same as Element.addEventListener(—, —, useCapture).\n */\n\nfunction addEventListener(element, action, listener, useCapture) {\n if (element.addEventListener) {\n if (useCapture === undefined) {\n useCapture = false;\n }\n\n if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {\n action = 'DOMMouseScroll'; // For Firefox\n }\n\n element.addEventListener(action, listener, useCapture);\n } else {\n element.attachEvent('on' + action, listener); // IE browsers\n }\n}\n/**\n * Remove an event listener from an element\n *\n * @param element - The element to bind the event listener to.\n * @param action - Same as Element.removeEventListener(action, —, —).\n * @param listener - Same as Element.removeEventListener(—, listener, —).\n * @param useCapture - Same as Element.removeEventListener(—, —, useCapture).\n */\n\nfunction removeEventListener(element, action, listener, useCapture) {\n if (element.removeEventListener) {\n // non-IE browsers\n if (useCapture === undefined) {\n useCapture = false;\n }\n\n if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {\n action = 'DOMMouseScroll'; // For Firefox\n }\n\n element.removeEventListener(action, listener, useCapture);\n } else {\n element.detachEvent('on' + action, listener); // IE browsers\n }\n}\n/**\n * Cancels the event's default action if it is cancelable, without stopping further propagation of the event.\n *\n * @param event - The event whose default action should be prevented.\n */\n\nfunction preventDefault(event) {\n if (!event) {\n event = window.event;\n }\n\n if (!event) ; else if (event.preventDefault) {\n event.preventDefault(); // non-IE browsers\n } else {\n event.returnValue = false; // IE browsers\n }\n}\n/**\n * Get HTML element which is the target of the event.\n *\n * @param event - The event.\n *\n * @returns The element or null if not obtainable.\n */\n\nfunction getTarget() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.event;\n // code from http://www.quirksmode.org/js/events_properties.html\n // @TODO: EventTarget can be almost anything, is it okay to return only Elements?\n var target = null;\n\n if (!event) ; else if (event.target) {\n target = event.target;\n } else if (event.srcElement) {\n target = event.srcElement;\n }\n\n if (!(target instanceof Element)) {\n return null;\n }\n\n if (target.nodeType != null && target.nodeType == 3) {\n // defeat Safari bug\n target = target.parentNode;\n\n if (!(target instanceof Element)) {\n return null;\n }\n }\n\n return target;\n}\n/**\n * Check if given element contains given parent somewhere in the DOM tree\n *\n * @param element - The element to be tested.\n * @param parent - The ancestor (not necessarily parent) of the element.\n *\n * @returns True if parent is an ancestor of the element, false otherwise.\n */\n\nfunction hasParent(element, parent) {\n var elem = element;\n\n while (elem) {\n if (elem === parent) {\n return true;\n } else if (elem.parentNode) {\n elem = elem.parentNode;\n } else {\n return false;\n }\n }\n\n return false;\n}\nvar option = {\n /**\n * Convert a value into a boolean.\n *\n * @param value - Value to be converted intoboolean, a function will be executed as (() => unknown).\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\n *\n * @returns Corresponding boolean value, if none then the default value, if none then null.\n */\n asBoolean: function asBoolean(value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (value != null) {\n return value != false;\n }\n\n return defaultValue || null;\n },\n\n /**\n * Convert a value into a number.\n *\n * @param value - Value to be converted intonumber, a function will be executed as (() => unknown).\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\n *\n * @returns Corresponding **boxed** number value, if none then the default value, if none then null.\n */\n asNumber: function asNumber(value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (value != null) {\n return Number(value) || defaultValue || null;\n }\n\n return defaultValue || null;\n },\n\n /**\n * Convert a value into a string.\n *\n * @param value - Value to be converted intostring, a function will be executed as (() => unknown).\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\n *\n * @returns Corresponding **boxed** string value, if none then the default value, if none then null.\n */\n asString: function asString(value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (value != null) {\n return String(value);\n }\n\n return defaultValue || null;\n },\n\n /**\n * Convert a value into a size.\n *\n * @param value - Value to be converted intosize, a function will be executed as (() => unknown).\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\n *\n * @returns Corresponding string value (number + 'px'), if none then the default value, if none then null.\n */\n asSize: function asSize(value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (isString(value)) {\n return value;\n } else if (isNumber(value)) {\n return value + 'px';\n } else {\n return defaultValue || null;\n }\n },\n\n /**\n * Convert a value into a DOM Element.\n *\n * @param value - Value to be converted into DOM Element, a function will be executed as (() => unknown).\n * @param defaultValue - If the value or the return value of the function == null then this will be returned.\n *\n * @returns The DOM Element, if none then the default value, if none then null.\n */\n asElement: function asElement(value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n return value || defaultValue || null;\n }\n};\n/**\n * Convert hex color string into RGB color object.\n * http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb\n *\n * @param hex - Hex color string (3 or 6 digits, with or without #).\n *\n * @returns RGB color object.\n */\n\nfunction hexToRGB(hex) {\n var result;\n\n switch (hex.length) {\n case 3:\n case 4:\n result = shortHexRE.exec(hex);\n return result ? {\n r: parseInt(result[1] + result[1], 16),\n g: parseInt(result[2] + result[2], 16),\n b: parseInt(result[3] + result[3], 16)\n } : null;\n\n case 6:\n case 7:\n result = fullHexRE.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n\n default:\n return null;\n }\n}\n/**\n * This function takes string color in hex or RGB format and adds the opacity, RGBA is passed through unchanged.\n *\n * @param color - The color string (hex, RGB, RGBA).\n * @param opacity - The new opacity.\n *\n * @returns RGBA string, for example 'rgba(255, 0, 127, 0.3)'.\n */\n\nfunction overrideOpacity(color, opacity) {\n if (color.indexOf('rgba') !== -1) {\n return color;\n } else if (color.indexOf('rgb') !== -1) {\n var rgb = color.substr(color.indexOf('(') + 1).replace(')', '').split(',');\n return 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + opacity + ')';\n } else {\n var _rgb = hexToRGB(color);\n\n if (_rgb == null) {\n return color;\n } else {\n return 'rgba(' + _rgb.r + ',' + _rgb.g + ',' + _rgb.b + ',' + opacity + ')';\n }\n }\n}\n/**\n * Convert RGB <0, 255> into hex color string.\n *\n * @param red - Red channel.\n * @param green - Green channel.\n * @param blue - Blue channel.\n *\n * @returns Hex color string (for example: '#0acdc0').\n */\n\nfunction RGBToHex(red, green, blue) {\n return '#' + ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1);\n}\n\n/**\n * Parse a color property into an object with border, background, and highlight colors\n *\n * @param inputColor - Shorthand color string or input color object.\n * @param defaultColor - Full color object to fill in missing values in inputColor.\n *\n * @returns Color object.\n */\nfunction parseColor(inputColor, defaultColor) {\n if (isString(inputColor)) {\n var colorStr = inputColor;\n\n if (isValidRGB(colorStr)) {\n var rgb = colorStr.substr(4).substr(0, colorStr.length - 5).split(',').map(function (value) {\n return parseInt(value);\n });\n colorStr = RGBToHex(rgb[0], rgb[1], rgb[2]);\n }\n\n if (isValidHex(colorStr) === true) {\n var hsv = hexToHSV(colorStr);\n var lighterColorHSV = {\n h: hsv.h,\n s: hsv.s * 0.8,\n v: Math.min(1, hsv.v * 1.02)\n };\n var darkerColorHSV = {\n h: hsv.h,\n s: Math.min(1, hsv.s * 1.25),\n v: hsv.v * 0.8\n };\n var darkerColorHex = HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);\n var lighterColorHex = HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);\n return {\n background: colorStr,\n border: darkerColorHex,\n highlight: {\n background: lighterColorHex,\n border: darkerColorHex\n },\n hover: {\n background: lighterColorHex,\n border: darkerColorHex\n }\n };\n } else {\n return {\n background: colorStr,\n border: colorStr,\n highlight: {\n background: colorStr,\n border: colorStr\n },\n hover: {\n background: colorStr,\n border: colorStr\n }\n };\n }\n } else {\n if (defaultColor) {\n var color = {\n background: inputColor.background || defaultColor.background,\n border: inputColor.border || defaultColor.border,\n highlight: isString(inputColor.highlight) ? {\n border: inputColor.highlight,\n background: inputColor.highlight\n } : {\n background: inputColor.highlight && inputColor.highlight.background || defaultColor.highlight.background,\n border: inputColor.highlight && inputColor.highlight.border || defaultColor.highlight.border\n },\n hover: isString(inputColor.hover) ? {\n border: inputColor.hover,\n background: inputColor.hover\n } : {\n border: inputColor.hover && inputColor.hover.border || defaultColor.hover.border,\n background: inputColor.hover && inputColor.hover.background || defaultColor.hover.background\n }\n };\n return color;\n } else {\n var _color = {\n background: inputColor.background || undefined,\n border: inputColor.border || undefined,\n highlight: isString(inputColor.highlight) ? {\n border: inputColor.highlight,\n background: inputColor.highlight\n } : {\n background: inputColor.highlight && inputColor.highlight.background || undefined,\n border: inputColor.highlight && inputColor.highlight.border || undefined\n },\n hover: isString(inputColor.hover) ? {\n border: inputColor.hover,\n background: inputColor.hover\n } : {\n border: inputColor.hover && inputColor.hover.border || undefined,\n background: inputColor.hover && inputColor.hover.background || undefined\n }\n };\n return _color;\n }\n }\n}\n/**\n * Convert RGB <0, 255> into HSV object.\n * http://www.javascripter.net/faq/rgb2hsv.htm\n *\n * @param red - Red channel.\n * @param green - Green channel.\n * @param blue - Blue channel.\n *\n * @returns HSV color object.\n */\n\nfunction RGBToHSV(red, green, blue) {\n red = red / 255;\n green = green / 255;\n blue = blue / 255;\n var minRGB = Math.min(red, Math.min(green, blue));\n var maxRGB = Math.max(red, Math.max(green, blue)); // Black-gray-white\n\n if (minRGB === maxRGB) {\n return {\n h: 0,\n s: 0,\n v: minRGB\n };\n } // Colors other than black-gray-white:\n\n\n var d = red === minRGB ? green - blue : blue === minRGB ? red - green : blue - red;\n var h = red === minRGB ? 3 : blue === minRGB ? 1 : 5;\n var hue = 60 * (h - d / (maxRGB - minRGB)) / 360;\n var saturation = (maxRGB - minRGB) / maxRGB;\n var value = maxRGB;\n return {\n h: hue,\n s: saturation,\n v: value\n };\n}\nvar cssUtil = {\n // split a string with css styles into an object with key/values\n split: function split(cssText) {\n var styles = {};\n cssText.split(';').forEach(function (style) {\n if (style.trim() != '') {\n var parts = style.split(':');\n\n var _key3 = parts[0].trim();\n\n var _value2 = parts[1].trim();\n\n styles[_key3] = _value2;\n }\n });\n return styles;\n },\n // build a css text string from an object with key/values\n join: function join(styles) {\n return Object.keys(styles).map(function (key) {\n return key + ': ' + styles[key];\n }).join('; ');\n }\n};\n/**\n * Append a string with css styles to an element\n *\n * @param element - The element that will receive new styles.\n * @param cssText - The styles to be appended.\n */\n\nfunction addCssText(element, cssText) {\n var currentStyles = cssUtil.split(element.style.cssText);\n var newStyles = cssUtil.split(cssText);\n\n var styles = _objectSpread({}, currentStyles, {}, newStyles);\n\n element.style.cssText = cssUtil.join(styles);\n}\n/**\n * Remove a string with css styles from an element\n *\n * @param element - The element from which styles should be removed.\n * @param cssText - The styles to be removed.\n */\n\nfunction removeCssText(element, cssText) {\n var styles = cssUtil.split(element.style.cssText);\n var removeStyles = cssUtil.split(cssText);\n\n for (var _key4 in removeStyles) {\n if (Object.prototype.hasOwnProperty.call(removeStyles, _key4)) {\n delete styles[_key4];\n }\n }\n\n element.style.cssText = cssUtil.join(styles);\n}\n/**\n * Convert HSV <0, 1> into RGB color object.\n * https://gist.github.com/mjijackson/5311256\n *\n * @param h - Hue\n * @param s - Saturation\n * @param v - Value\n *\n * @returns RGB color object.\n */\n\nfunction HSVToRGB(h, s, v) {\n var r;\n var g;\n var b;\n var i = Math.floor(h * 6);\n var f = h * 6 - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0:\n r = v, g = t, b = p;\n break;\n\n case 1:\n r = q, g = v, b = p;\n break;\n\n case 2:\n r = p, g = v, b = t;\n break;\n\n case 3:\n r = p, g = q, b = v;\n break;\n\n case 4:\n r = t, g = p, b = v;\n break;\n\n case 5:\n r = v, g = p, b = q;\n break;\n }\n\n return {\n r: Math.floor(r * 255),\n g: Math.floor(g * 255),\n b: Math.floor(b * 255)\n };\n}\n/**\n * Convert HSV <0, 1> into hex color string.\n *\n * @param h - Hue\n * @param s - Saturation\n * @param v - Value\n *\n * @returns Hex color string.\n */\n\nfunction HSVToHex(h, s, v) {\n var rgb = HSVToRGB(h, s, v);\n return RGBToHex(rgb.r, rgb.g, rgb.b);\n}\n/**\n * Convert hex color string into HSV <0, 1>.\n *\n * @param hex - Hex color string.\n *\n * @returns HSV color object.\n */\n\nfunction hexToHSV(hex) {\n var rgb = hexToRGB(hex);\n\n if (!rgb) {\n throw new TypeError(\"'\".concat(hex, \"' is not a valid color.\"));\n }\n\n return RGBToHSV(rgb.r, rgb.g, rgb.b);\n}\n/**\n * Validate hex color string.\n *\n * @param hex - Unknown string that may contain a color.\n *\n * @returns True if the string is valid, false otherwise.\n */\n\nfunction isValidHex(hex) {\n var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\n return isOk;\n}\n/**\n * Validate RGB color string.\n *\n * @param rgb - Unknown string that may contain a color.\n *\n * @returns True if the string is valid, false otherwise.\n */\n\nfunction isValidRGB(rgb) {\n rgb = rgb.replace(' ', '');\n var isOk = /rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)/i.test(rgb);\n return isOk;\n}\n/**\n * Validate RGBA color string.\n *\n * @param rgba - Unknown string that may contain a color.\n *\n * @returns True if the string is valid, false otherwise.\n */\n\nfunction isValidRGBA(rgba) {\n rgba = rgba.replace(' ', '');\n var isOk = /rgba\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3}),(0?.{1,3})\\)/i.test(rgba);\n return isOk;\n}\n/**\n * This recursively redirects the prototype of JSON objects to the referenceObject.\n * This is used for default options.\n *\n * @param fields - Names of properties to be bridged.\n * @param referenceObject - The original object.\n *\n * @returns A new object inheriting from the referenceObject.\n */\n\nfunction selectiveBridgeObject(fields, referenceObject) {\n if (referenceObject !== null && _typeof_1(referenceObject) === 'object') {\n // !!! typeof null === 'object'\n var objectTo = Object.create(referenceObject);\n\n for (var i = 0; i < fields.length; i++) {\n if (Object.prototype.hasOwnProperty.call(referenceObject, fields[i])) {\n if (_typeof_1(referenceObject[fields[i]]) == 'object') {\n objectTo[fields[i]] = bridgeObject(referenceObject[fields[i]]);\n }\n }\n }\n\n return objectTo;\n } else {\n return null;\n }\n}\n\n/**\n * This recursively redirects the prototype of JSON objects to the referenceObject.\n * This is used for default options.\n *\n * @param referenceObject - The original object.\n *\n * @returns The Element if the referenceObject is an Element, or a new object inheriting from the referenceObject.\n */\nfunction bridgeObject(referenceObject) {\n if (referenceObject === null || _typeof_1(referenceObject) !== 'object') {\n return null;\n }\n\n if (referenceObject instanceof Element) {\n // Avoid bridging DOM objects\n return referenceObject;\n }\n\n var objectTo = Object.create(referenceObject);\n\n for (var i in referenceObject) {\n if (Object.prototype.hasOwnProperty.call(referenceObject, i)) {\n if (_typeof_1(referenceObject[i]) == 'object') {\n objectTo[i] = bridgeObject(referenceObject[i]);\n }\n }\n }\n\n return objectTo;\n}\n/**\n * This method provides a stable sort implementation, very fast for presorted data.\n *\n * @param a - The array to be sorted (in-place).\n * @param compare - An order comparator.\n *\n * @returns The argument a.\n */\n\nfunction insertSort(a, compare) {\n for (var i = 0; i < a.length; i++) {\n var k = a[i];\n var j = void 0;\n\n for (j = i; j > 0 && compare(k, a[j - 1]) < 0; j--) {\n a[j] = a[j - 1];\n }\n\n a[j] = k;\n }\n\n return a;\n}\n/**\n * This is used to set the options of subobjects in the options object.\n *\n * A requirement of these subobjects is that they have an 'enabled' element\n * which is optional for the user but mandatory for the program.\n *\n * The added value here of the merge is that option 'enabled' is set as required.\n *\n * @param mergeTarget - Either this.options or the options used for the groups.\n * @param options - Options.\n * @param option - Option key in the options argument.\n * @param globalOptions - Global options, passed in to determine value of option 'enabled'.\n */\n\nfunction mergeOptions(mergeTarget, options, option) {\n var globalOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n // Local helpers\n var isPresent = function isPresent(obj) {\n return obj !== null && obj !== undefined;\n };\n\n var isObject = function isObject(obj) {\n return obj !== null && _typeof_1(obj) === 'object';\n }; // https://stackoverflow.com/a/34491287/1223531\n\n\n var isEmpty = function isEmpty(obj) {\n for (var x in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, x)) {\n return false;\n }\n }\n\n return true;\n }; // Guards\n\n\n if (!isObject(mergeTarget)) {\n throw new Error('Parameter mergeTarget must be an object');\n }\n\n if (!isObject(options)) {\n throw new Error('Parameter options must be an object');\n }\n\n if (!isPresent(option)) {\n throw new Error('Parameter option must have a value');\n }\n\n if (!isObject(globalOptions)) {\n throw new Error('Parameter globalOptions must be an object');\n } //\n // Actual merge routine, separated from main logic\n // Only a single level of options is merged. Deeper levels are ref'd. This may actually be an issue.\n //\n\n\n var doMerge = function doMerge(target, options, option) {\n if (!isObject(target[option])) {\n target[option] = {};\n }\n\n var src = options[option];\n var dst = target[option];\n\n for (var prop in src) {\n if (Object.prototype.hasOwnProperty.call(src, prop)) {\n dst[prop] = src[prop];\n }\n }\n }; // Local initialization\n\n\n var srcOption = options[option];\n var globalPassed = isObject(globalOptions) && !isEmpty(globalOptions);\n var globalOption = globalPassed ? globalOptions[option] : undefined;\n var globalEnabled = globalOption ? globalOption.enabled : undefined; /////////////////////////////////////////\n // Main routine\n /////////////////////////////////////////\n\n if (srcOption === undefined) {\n return; // Nothing to do\n }\n\n if (typeof srcOption === 'boolean') {\n if (!isObject(mergeTarget[option])) {\n mergeTarget[option] = {};\n }\n\n mergeTarget[option].enabled = srcOption;\n return;\n }\n\n if (srcOption === null && !isObject(mergeTarget[option])) {\n // If possible, explicit copy from globals\n if (isPresent(globalOption)) {\n mergeTarget[option] = Object.create(globalOption);\n } else {\n return; // Nothing to do\n }\n }\n\n if (!isObject(srcOption)) {\n return;\n } //\n // Ensure that 'enabled' is properly set. It is required internally\n // Note that the value from options will always overwrite the existing value\n //\n\n\n var enabled = true; // default value\n\n if (srcOption.enabled !== undefined) {\n enabled = srcOption.enabled;\n } else {\n // Take from globals, if present\n if (globalEnabled !== undefined) {\n enabled = globalOption.enabled;\n }\n }\n\n doMerge(mergeTarget, options, option);\n mergeTarget[option].enabled = enabled;\n}\n\n/**\n * This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses\n * this function will then iterate in both directions over this sorted list to find all visible items.\n *\n * @param orderedItems - Items ordered by start\n * @param comparator - -1 is lower, 0 is equal, 1 is higher\n * @param field - Property name on an item (i.e. item[field]).\n * @param field2 - Second property name on an item (i.e. item[field][field2]).\n *\n * @returns Index of the found item or -1 if nothing was found.\n */\nfunction binarySearchCustom(orderedItems, comparator, field, field2) {\n var maxIterations = 10000;\n var iteration = 0;\n var low = 0;\n var high = orderedItems.length - 1;\n\n while (low <= high && iteration < maxIterations) {\n var middle = Math.floor((low + high) / 2);\n var item = orderedItems[middle];\n\n var _value3 = field2 === undefined ? item[field] : item[field][field2];\n\n var searchResult = comparator(_value3);\n\n if (searchResult == 0) {\n // jihaa, found a visible item!\n return middle;\n } else if (searchResult == -1) {\n // it is too small --> increase low\n low = middle + 1;\n } else {\n // it is too big --> decrease high\n high = middle - 1;\n }\n\n iteration++;\n }\n\n return -1;\n}\n/**\n * This function does a binary search for a specific value in a sorted array. If it does not exist but is in between of\n * two values, we return either the one before or the one after, depending on user input\n * If it is found, we return the index, else -1.\n *\n * @param orderedItems - Sorted array.\n * @param target - The searched value.\n * @param field - Name of the property in items to be searched.\n * @param sidePreference - If the target is between two values, should the index of the before or the after be returned?\n * @param comparator - An optional comparator, returning -1, 0, 1 for <, ===, >.\n *\n * @returns The index of found value or -1 if nothing was found.\n */\n\nfunction binarySearchValue(orderedItems, target, field, sidePreference, comparator) {\n var maxIterations = 10000;\n var iteration = 0;\n var low = 0;\n var high = orderedItems.length - 1;\n var prevValue;\n var value;\n var nextValue;\n var middle;\n comparator = comparator != undefined ? comparator : function (a, b) {\n return a == b ? 0 : a < b ? -1 : 1;\n };\n\n while (low <= high && iteration < maxIterations) {\n // get a new guess\n middle = Math.floor(0.5 * (high + low));\n prevValue = orderedItems[Math.max(0, middle - 1)][field];\n value = orderedItems[middle][field];\n nextValue = orderedItems[Math.min(orderedItems.length - 1, middle + 1)][field];\n\n if (comparator(value, target) == 0) {\n // we found the target\n return middle;\n } else if (comparator(prevValue, target) < 0 && comparator(value, target) > 0) {\n // target is in between of the previous and the current\n return sidePreference == 'before' ? Math.max(0, middle - 1) : middle;\n } else if (comparator(value, target) < 0 && comparator(nextValue, target) > 0) {\n // target is in between of the current and the next\n return sidePreference == 'before' ? middle : Math.min(orderedItems.length - 1, middle + 1);\n } else {\n // didnt find the target, we need to change our boundaries.\n if (comparator(value, target) < 0) {\n // it is too small --> increase low\n low = middle + 1;\n } else {\n // it is too big --> decrease high\n high = middle - 1;\n }\n }\n\n iteration++;\n } // didnt find anything. Return -1.\n\n\n return -1;\n}\n/*\n * Easing Functions.\n * Only considering the t value for the range [0, 1] => [0, 1].\n *\n * Inspiration: from http://gizma.com/easing/\n * https://gist.github.com/gre/1650294\n */\n\nvar easingFunctions = {\n /**\n * no easing, no acceleration\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n linear: function linear(t) {\n return t;\n },\n\n /**\n * accelerating from zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInQuad: function easeInQuad(t) {\n return t * t;\n },\n\n /**\n * decelerating to zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeOutQuad: function easeOutQuad(t) {\n return t * (2 - t);\n },\n\n /**\n * acceleration until halfway, then deceleration\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInOutQuad: function easeInOutQuad(t) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n },\n\n /**\n * accelerating from zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInCubic: function easeInCubic(t) {\n return t * t * t;\n },\n\n /**\n * decelerating to zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeOutCubic: function easeOutCubic(t) {\n return --t * t * t + 1;\n },\n\n /**\n * acceleration until halfway, then deceleration\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInOutCubic: function easeInOutCubic(t) {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n },\n\n /**\n * accelerating from zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInQuart: function easeInQuart(t) {\n return t * t * t * t;\n },\n\n /**\n * decelerating to zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeOutQuart: function easeOutQuart(t) {\n return 1 - --t * t * t * t;\n },\n\n /**\n * acceleration until halfway, then deceleration\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInOutQuart: function easeInOutQuart(t) {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;\n },\n\n /**\n * accelerating from zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInQuint: function easeInQuint(t) {\n return t * t * t * t * t;\n },\n\n /**\n * decelerating to zero velocity\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeOutQuint: function easeOutQuint(t) {\n return 1 + --t * t * t * t * t;\n },\n\n /**\n * acceleration until halfway, then deceleration\n *\n * @param t - Time.\n *\n * @returns Value at time t.\n */\n easeInOutQuint: function easeInOutQuint(t) {\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;\n }\n};\n/**\n * Experimentaly compute the width of the scrollbar for this browser.\n *\n * @returns The width in pixels.\n */\n\nfunction getScrollBarWidth() {\n var inner = document.createElement('p');\n inner.style.width = '100%';\n inner.style.height = '200px';\n var outer = document.createElement('div');\n outer.style.position = 'absolute';\n outer.style.top = '0px';\n outer.style.left = '0px';\n outer.style.visibility = 'hidden';\n outer.style.width = '200px';\n outer.style.height = '150px';\n outer.style.overflow = 'hidden';\n outer.appendChild(inner);\n document.body.appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n document.body.removeChild(outer);\n return w1 - w2;\n} // @TODO: This doesn't work properly.\n// It works only for single property objects,\n// otherwise it combines all of the types in a union.\n// export function topMost (\n// pile: Record[],\n// accessors: K1 | [K1]\n// ): undefined | V1\n// export function topMost (\n// pile: Record>[],\n// accessors: [K1, K2]\n// ): undefined | V1 | V2\n// export function topMost (\n// pile: Record>>[],\n// accessors: [K1, K2, K3]\n// ): undefined | V1 | V2 | V3\n\n/**\n * Get the top most property value from a pile of objects.\n *\n * @param pile - Array of objects, no required format.\n * @param accessors - Array of property names (e.g. object['foo']['bar'] → ['foo', 'bar']).\n *\n * @returns Value of the property with given accessors path from the first pile item where it's not undefined.\n */\n\nfunction topMost(pile, accessors) {\n var candidate;\n\n if (!Array.isArray(accessors)) {\n accessors = [accessors];\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = pile[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var member = _step.value;\n\n if (member) {\n candidate = member[accessors[0]];\n\n for (var i = 1; i < accessors.length; i++) {\n if (candidate) {\n candidate = candidate[accessors[i]];\n }\n }\n\n if (typeof candidate !== 'undefined') {\n break;\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return candidate;\n}\n\nvar util = /*#__PURE__*/Object.freeze({\n isNumber: isNumber,\n recursiveDOMDelete: recursiveDOMDelete,\n isString: isString,\n isObject: isObject,\n isDate: isDate,\n isMoment: isMoment,\n fillIfDefined: fillIfDefined,\n extend: extend,\n selectiveExtend: selectiveExtend,\n selectiveDeepExtend: selectiveDeepExtend,\n selectiveNotDeepExtend: selectiveNotDeepExtend,\n deepExtend: deepExtend,\n equalArray: equalArray,\n convert: convert,\n getType: getType,\n copyAndExtendArray: copyAndExtendArray,\n copyArray: copyArray,\n getAbsoluteLeft: getAbsoluteLeft,\n getAbsoluteRight: getAbsoluteRight,\n getAbsoluteTop: getAbsoluteTop,\n addClassName: addClassName,\n removeClassName: removeClassName,\n forEach: forEach,\n toArray: toArray,\n updateProperty: updateProperty,\n throttle: throttle,\n addEventListener: addEventListener,\n removeEventListener: removeEventListener,\n preventDefault: preventDefault,\n getTarget: getTarget,\n hasParent: hasParent,\n option: option,\n hexToRGB: hexToRGB,\n overrideOpacity: overrideOpacity,\n RGBToHex: RGBToHex,\n parseColor: parseColor,\n RGBToHSV: RGBToHSV,\n addCssText: addCssText,\n removeCssText: removeCssText,\n HSVToRGB: HSVToRGB,\n HSVToHex: HSVToHex,\n hexToHSV: hexToHSV,\n isValidHex: isValidHex,\n isValidRGB: isValidRGB,\n isValidRGBA: isValidRGBA,\n selectiveBridgeObject: selectiveBridgeObject,\n bridgeObject: bridgeObject,\n insertSort: insertSort,\n mergeOptions: mergeOptions,\n binarySearchCustom: binarySearchCustom,\n binarySearchValue: binarySearchValue,\n easingFunctions: easingFunctions,\n getScrollBarWidth: getScrollBarWidth,\n topMost: topMost,\n randomUUID: uuid4\n});\n\n// New API (tree shakeable).\n\nexport default util;\nexport { HSVToHex, HSVToRGB, RGBToHSV, RGBToHex, addClassName, addCssText, addEventListener, binarySearchCustom, binarySearchValue, bridgeObject, convert, copyAndExtendArray, copyArray, deepExtend, easingFunctions, equalArray, extend, fillIfDefined, forEach, getAbsoluteLeft, getAbsoluteRight, getAbsoluteTop, getScrollBarWidth, getTarget, getType, hasParent, hexToHSV, hexToRGB, insertSort, isDate, isMoment, isNumber, isObject, isString, isValidHex, isValidRGB, isValidRGBA, mergeOptions, option, overrideOpacity, parseColor, preventDefault, uuid4 as randomUUID, recursiveDOMDelete, removeClassName, removeCssText, removeEventListener, selectiveBridgeObject, selectiveDeepExtend, selectiveExtend, selectiveNotDeepExtend, throttle, toArray, topMost, updateProperty };\n","// DOM utility methods\n\n/**\n * this prepares the JSON container for allocating SVG elements\n * @param {Object} JSONcontainer\n * @private\n */\nexport function prepareElements(JSONcontainer) {\n // cleanup the redundant svgElements;\n for (var elementType in JSONcontainer) {\n if (JSONcontainer.hasOwnProperty(elementType)) {\n JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;\n JSONcontainer[elementType].used = [];\n }\n }\n}\n\n/**\n * this cleans up all the unused SVG elements. By asking for the parentNode, we only need to supply the JSON container from\n * which to remove the redundant elements.\n *\n * @param {Object} JSONcontainer\n * @private\n */\nexport function cleanupElements(JSONcontainer) {\n // cleanup the redundant svgElements;\n for (var elementType in JSONcontainer) {\n if (JSONcontainer.hasOwnProperty(elementType)) {\n if (JSONcontainer[elementType].redundant) {\n for (var i = 0; i < JSONcontainer[elementType].redundant.length; i++) {\n JSONcontainer[elementType].redundant[i].parentNode.removeChild(JSONcontainer[elementType].redundant[i]);\n }\n JSONcontainer[elementType].redundant = [];\n }\n }\n }\n}\n\n/**\n * Ensures that all elements are removed first up so they can be recreated cleanly\n * @param {Object} JSONcontainer\n */\nexport function resetElements(JSONcontainer) {\n prepareElements(JSONcontainer);\n cleanupElements(JSONcontainer);\n prepareElements(JSONcontainer);\n}\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param {string} elementType\n * @param {Object} JSONcontainer\n * @param {Object} svgContainer\n * @returns {Element}\n * @private\n */\nexport function getSVGElement(elementType, JSONcontainer, svgContainer) {\n var element;\n // allocate SVG element, if it doesnt yet exist, create one.\n if (JSONcontainer.hasOwnProperty(elementType)) { // this element has been created before\n // check if there is an redundant element\n if (JSONcontainer[elementType].redundant.length > 0) {\n element = JSONcontainer[elementType].redundant[0];\n JSONcontainer[elementType].redundant.shift();\n }\n else {\n // create a new element and add it to the SVG\n element = document.createElementNS('http://www.w3.org/2000/svg', elementType);\n svgContainer.appendChild(element);\n }\n }\n else {\n // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n element = document.createElementNS('http://www.w3.org/2000/svg', elementType);\n JSONcontainer[elementType] = {used: [], redundant: []};\n svgContainer.appendChild(element);\n }\n JSONcontainer[elementType].used.push(element);\n return element;\n}\n\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param {string} elementType\n * @param {Object} JSONcontainer\n * @param {Element} DOMContainer\n * @param {Element} insertBefore\n * @returns {*}\n */\nexport function getDOMElement(elementType, JSONcontainer, DOMContainer, insertBefore) {\n var element;\n // allocate DOM element, if it doesnt yet exist, create one.\n if (JSONcontainer.hasOwnProperty(elementType)) { // this element has been created before\n // check if there is an redundant element\n if (JSONcontainer[elementType].redundant.length > 0) {\n element = JSONcontainer[elementType].redundant[0];\n JSONcontainer[elementType].redundant.shift();\n }\n else {\n // create a new element and add it to the SVG\n element = document.createElement(elementType);\n if (insertBefore !== undefined) {\n DOMContainer.insertBefore(element, insertBefore);\n }\n else {\n DOMContainer.appendChild(element);\n }\n }\n }\n else {\n // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n element = document.createElement(elementType);\n JSONcontainer[elementType] = {used: [], redundant: []};\n if (insertBefore !== undefined) {\n DOMContainer.insertBefore(element, insertBefore);\n }\n else {\n DOMContainer.appendChild(element);\n }\n }\n JSONcontainer[elementType].used.push(element);\n return element;\n}\n\n\n\n\n/**\n * Draw a point object. This is a separate function because it can also be called by the legend.\n * The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions\n * as well.\n *\n * @param {number} x\n * @param {number} y\n * @param {Object} groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' }\n * @param {Object} JSONcontainer\n * @param {Object} svgContainer\n * @param {Object} labelObj\n * @returns {vis.PointItem}\n */\nexport function drawPoint(x, y, groupTemplate, JSONcontainer, svgContainer, labelObj) {\n var point;\n if (groupTemplate.style == 'circle') {\n point = getSVGElement('circle', JSONcontainer, svgContainer);\n point.setAttributeNS(null, \"cx\", x);\n point.setAttributeNS(null, \"cy\", y);\n point.setAttributeNS(null, \"r\", 0.5 * groupTemplate.size);\n }\n else {\n point = getSVGElement('rect', JSONcontainer, svgContainer);\n point.setAttributeNS(null, \"x\", x - 0.5 * groupTemplate.size);\n point.setAttributeNS(null, \"y\", y - 0.5 * groupTemplate.size);\n point.setAttributeNS(null, \"width\", groupTemplate.size);\n point.setAttributeNS(null, \"height\", groupTemplate.size);\n }\n\n if (groupTemplate.styles !== undefined) {\n point.setAttributeNS(null, \"style\", groupTemplate.styles);\n }\n point.setAttributeNS(null, \"class\", groupTemplate.className + \" vis-point\");\n //handle label\n\n\n if (labelObj) {\n var label = getSVGElement('text', JSONcontainer, svgContainer);\n if (labelObj.xOffset) {\n x = x + labelObj.xOffset;\n }\n\n if (labelObj.yOffset) {\n y = y + labelObj.yOffset;\n }\n if (labelObj.content) {\n label.textContent = labelObj.content;\n }\n\n if (labelObj.className) {\n label.setAttributeNS(null, \"class\", labelObj.className + \" vis-label\");\n }\n label.setAttributeNS(null, \"x\", x);\n label.setAttributeNS(null, \"y\", y);\n }\n\n return point;\n}\n\n/**\n * draw a bar SVG element centered on the X coordinate\n *\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {string} className\n * @param {Object} JSONcontainer\n * @param {Object} svgContainer\n * @param {string} style\n */\nexport function drawBar (x, y, width, height, className, JSONcontainer, svgContainer, style) {\n if (height != 0) {\n if (height < 0) {\n height *= -1;\n y -= height;\n }\n var rect = getSVGElement('rect',JSONcontainer, svgContainer);\n rect.setAttributeNS(null, \"x\", x - 0.5 * width);\n rect.setAttributeNS(null, \"y\", y);\n rect.setAttributeNS(null, \"width\", width);\n rect.setAttributeNS(null, \"height\", height);\n rect.setAttributeNS(null, \"class\", className);\n if (style) {\n rect.setAttributeNS(null, \"style\", style);\n }\n }\n}\n\n/**\n * get default language\n * @returns {string}\n */\nexport function getNavigatorLanguage() {\n if (!navigator) return 'en';\n if (navigator.languages && navigator.languages.length) {\n return navigator.languages;\n } else {\n return navigator.userLanguage || navigator.language || navigator.browserLanguage || 'en';\n }\n}\n","/** \n * vis-data - data\n * http://visjs.org/\n * \n * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.\n * \n * @version 6.1.0\n * @date 2019-07-16T13:37:00Z\n * \n * @copyright (c) 2011-2017 Almende B.V, http://almende.com\n * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs\n * \n * @license \n * vis.js is dual licensed under both\n * \n * 1. The Apache 2.0 License\n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * and\n * \n * 2. The MIT License\n * http://opensource.org/licenses/MIT\n * \n * vis.js may be distributed under either license.\n */\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar defineProperty = _defineProperty;\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar _typeof_1 = createCommonjsModule(function (module) {\n function _typeof2(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof2 = function _typeof2(obj) {\n return typeof obj;\n };\n } else {\n _typeof2 = function _typeof2(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof2(obj);\n }\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n }\n\n module.exports = _typeof;\n});\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nvar classCallCheck = _classCallCheck;\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nvar createClass = _createClass;\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nvar assertThisInitialized = _assertThisInitialized;\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof_1(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nvar possibleConstructorReturn = _possibleConstructorReturn;\n\nvar getPrototypeOf = createCommonjsModule(function (module) {\n function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n module.exports = _getPrototypeOf;\n});\n\nvar setPrototypeOf = createCommonjsModule(function (module) {\n function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n module.exports = _setPrototypeOf;\n});\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nvar inherits = _inherits;\n\n// Maps for number <-> hex string conversion\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; i++) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n/**\n * Represent binary UUID into it's string representation.\n *\n * @param buf - Buffer containing UUID bytes.\n * @param offset - Offset from the start of the buffer where the UUID is saved (not needed if the buffer starts with the UUID).\n *\n * @returns String representation of the UUID.\n */\n\n\nfunction stringifyUUID(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n 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++]];\n}\n/**\n * Generate 16 random bytes to be used as a base for UUID.\n *\n * @ignore\n */\n\n\nvar random = function () {\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n // Moderately fast, high quality\n var _rnds8 = new Uint8Array(16);\n\n return function whatwgRNG() {\n crypto.getRandomValues(_rnds8);\n return _rnds8;\n };\n } // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random().\n // It's fast, but is of unspecified quality.\n\n\n var _rnds = new Array(16);\n\n return function () {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) {\n r = Math.random() * 0x100000000;\n }\n\n _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return _rnds;\n }; // uuid.js\n //\n // Copyright (c) 2010-2012 Robert Kieffer\n // MIT License - http://opensource.org/licenses/mit-license.php\n // Unique ID creation requires a high quality random # generator. We feature\n // detect to determine the best RNG source, normalizing to a function that\n // returns 128-bits of randomness, since that's what's usually required\n // return require('./rng');\n}();\n\nvar byteToHex$1 = [];\n\nfor (var i$1 = 0; i$1 < 256; i$1++) {\n byteToHex$1[i$1] = (i$1 + 0x100).toString(16).substr(1);\n} // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n// random #'s we need to init node and clockseq\n\n\nvar seedBytes = random(); // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n\nvar defaultNodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; // Per 4.2.2, randomize (14 bit) clockseq\n\nvar defaultClockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; // Previous uuid creation time\n/**\n * UUIDv4 options.\n */\n\n/**\n * Generate UUIDv4\n *\n * @param options - Options to be used instead of default generated values.\n * String 'binary' is a shorthand for uuid4({}, new Array(16)).\n * @param buf - If present the buffer will be filled with the generated UUID.\n * @param offset - Offset of the UUID from the start of the buffer.\n *\n * @returns UUIDv4\n */\n\n\nfunction uuid4() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var buf = arguments.length > 1 ? arguments[1] : undefined;\n var offset = arguments.length > 2 ? arguments[2] : undefined; // Deprecated - 'format' argument, as supported in v1.2\n\n var i = buf && offset || 0;\n\n if (typeof options === 'string') {\n buf = options === 'binary' ? new Array(16) : undefined;\n options = {};\n }\n\n var rnds = options.random || (options.rng || random)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n for (var ii = 0; ii < 16; ii++) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || stringifyUUID(rnds);\n} // Rollup will complain about mixing default and named exports in UMD build,\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction commonjsRequire() {\n throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nfunction createCommonjsModule$1(fn, module) {\n return module = {\n exports: {}\n }, fn(module, module.exports), module.exports;\n}\n\nvar moment = createCommonjsModule$1(function (module, exports) {\n (function (global, factory) {\n module.exports = factory();\n })(commonjsGlobal, function () {\n var hookCallback;\n\n function hooks() {\n return hookCallback.apply(null, arguments);\n } // This is done to register the method called with moment()\n // without creating circular dependencies.\n\n\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n\n for (k in obj) {\n if (obj.hasOwnProperty(k)) {\n return false;\n }\n }\n\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [],\n i;\n\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n\n return m._pf;\n }\n\n var some;\n\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);\n\n if (m._strict) {\n isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n\n return m._isValid;\n }\n\n function createInvalid(flags) {\n var m = createUTC(NaN);\n\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n } // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n\n\n var momentProperties = hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false; // Moment prototype object\n\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n\n if (!this.isValid()) {\n this._d = new Date(NaN);\n } // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n\n\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment(obj) {\n return obj instanceof Moment || obj != null && obj._isAMomentObject != null;\n }\n\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n } // compare two arrays, return the number of differences\n\n\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {\n diffs++;\n }\n }\n\n return diffs + lengthDiff;\n }\n\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n\n if (firstTime) {\n var args = [];\n var arg;\n\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n\n args.push(arg);\n }\n\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + new Error().stack);\n firstTime = false;\n }\n\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n function set(config) {\n var prop, i;\n\n for (i in config) {\n prop = config[i];\n\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n\n this._config = config; // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n\n this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\\d{1,2}/.source);\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L'\n };\n\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate() {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years'\n };\n\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);\n }\n\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias(unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [];\n\n for (var u in unitsObj) {\n units.push({\n unit: u,\n priority: priorities[u]\n });\n }\n\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n 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;\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n var formatFunctions = {};\n var formatTokenFunctions = {}; // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n\n if (token) {\n formatTokenFunctions[token] = func;\n }\n\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n\n return output;\n };\n } // format date using native date object\n\n\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n\n var match2 = /\\d\\d/; // 00 - 99\n\n var match3 = /\\d{3}/; // 000 - 999\n\n var match4 = /\\d{4}/; // 0000 - 9999\n\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n\n var match1to2 = /\\d\\d?/; // 0 - 99\n\n var match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\n\n var match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\n\n var match1to3 = /\\d{1,3}/; // 0 - 999\n\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n\n var matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n\n var matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i;\n var regexes = {};\n\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n\n\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken(token, callback) {\n var i,\n func = callback;\n\n if (typeof token === 'string') {\n token = [token];\n }\n\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n var WEEK = 7;\n var WEEKDAY = 8; // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n });\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES\n\n addUnitAlias('year', 'y'); // PRIORITIES\n\n addUnitPriority('year', 1); // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n }); // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n } // HOOKS\n\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n }; // MOMENTS\n\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get(mom, unit) {\n return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n }\n\n function set$1(mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));\n } else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n } // MOMENTS\n\n\n function stringGet(units) {\n units = normalizeUnits(units);\n\n if (isFunction(this[units])) {\n return this[units]();\n }\n\n return this;\n }\n\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n\n return this;\n }\n\n function mod(n, x) {\n return (n % x + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;\n } // FORMATTING\n\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n }); // ALIASES\n\n addUnitAlias('month', 'M'); // PRIORITY\n\n addUnitPriority('month', 8); // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid.\n\n\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n }); // LOCALES\n\n var MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months) ? this._months : this._months['standalone'];\n }\n\n return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];\n }\n\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n } // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n\n\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n } // test the regex\n\n\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n } // MOMENTS\n\n\n function setMonth(mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value); // TODO: Another silent failure?\n\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n\n return mom;\n }\n\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n\n var defaultMonthsShortRegex = matchWord;\n\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n\n return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n\n var defaultMonthsRegex = matchWord;\n\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n\n return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;\n }\n }\n\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom;\n\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n } // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n\n\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date; // the date constructor remaps years 0-99 to 1900-1999\n\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate(y) {\n var date; // the Date.UTC function remaps years 0-99 to 1900-1999\n\n if (y < 100 && y >= 0) {\n var args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset\n\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n } // start-of-first-week - start-of-year\n\n\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n return -fwdlw + fwd - 1;\n } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n\n\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n } // FORMATTING\n\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W'); // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5); // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n }); // HELPERS\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow: 0,\n // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 6th is the first week of the year.\n\n };\n\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear() {\n return this._week.doy;\n } // MOMENTS\n\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n } // FORMATTING\n\n\n addFormatToken('d', 0, 'do', 'day');\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E'); // PRIORITY\n\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11); // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid\n\n\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n }); // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n\n return isNaN(input) ? null : input;\n } // LOCALES\n\n\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];\n return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n\n function localeWeekdaysShort(m) {\n return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n\n function localeWeekdaysMin(m) {\n return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._weekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._weekdaysParse, llc);\n\n if (ii !== -1) {\n return ii;\n }\n\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$', 'i');\n }\n\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n } // test the regex\n\n\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n } // MOMENTS\n\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n } // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n var defaultWeekdaysRegex = matchWord;\n\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n\n return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n var defaultWeekdaysShortRegex = matchWord;\n\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n\n return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n var defaultWeekdaysMinRegex = matchWord;\n\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n\n return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n } // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n\n\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n } // FORMATTING\n\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false); // ALIASES\n\n addUnitAlias('hour', 'h'); // PRIORITY\n\n addUnitPriority('hour', 13); // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n }); // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n } // MOMENTS\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n\n\n var getSetHour = makeGetSet('Hours', true);\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n week: defaultLocaleWeek,\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n meridiemParse: defaultLocaleMeridiemParse\n }; // internal storage for locale config files\n\n var locales = {};\n var localeFamilies = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n } // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n\n\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }\n\n function loadLocale(name) {\n var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node\n\n if (!locales[name] && 'object' !== 'undefined' && module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n var aliasedRequire = commonjsRequire;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {}\n }\n\n return locales[name];\n } // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n\n\n function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n\n if (locales[name] != null) {\n 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 ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n }\n\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n } // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n\n\n getSetGlobalLocale(name);\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig; // MERGE\n\n tmpLocale = loadLocale(name);\n\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale; // backwards compat for now: also set the locale\n\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n\n return locales[name];\n } // returns locale data\n\n\n function getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n\n if (locale) {\n return locale;\n }\n\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow(m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n 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;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n } // Pick the first defined of two or three arguments.\n\n\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n\n if (b != null) {\n return b;\n }\n\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n } // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n\n\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays\n\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n } //if the day of the year is set, figure out what it is\n\n\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n } // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n\n\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n } // Zero out whatever was not defaulted, including time\n\n\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n } // Check for 24:00:00.000\n\n\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n } // check for mismatching day of week\n\n\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n w = config._w;\n\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n var curWeek = weekOfYear(createLocal(), dow, doy);\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week.\n\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n } // iso 8601 regex\n // 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)\n\n\n 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)?)?$/;\n 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)?)?$/;\n var tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n 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\n ['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\n\n 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/]];\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i; // date from iso format\n\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n } // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n\n\n var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;\n\n function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s.replace(/\\([^)]*\\)|[\\n\\t]/g, ' ').replace(/(\\s\\s+)/g, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();\n\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n\n return true;\n }\n\n var obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60\n };\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10);\n var m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n } // date and time from ref 2822 format\n\n\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i));\n\n if (match) {\n var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);\n\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n config._d = createUTCDate.apply(null, config._a);\n\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n } // date from iso format or fallback\n\n\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n } // Final attempt, use Input Fallback\n\n\n hooks.createFromInputFallback(config);\n }\n\n hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }); // constant that refers to the ISO standard\n\n hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form\n\n\n hooks.RFC_2822 = function () {}; // date from string and format string\n\n\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }\n\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n\n if (isPm && hour < 12) {\n hour += 12;\n }\n\n if (!isPm && hour === 12) {\n hour = 0;\n }\n\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n } // date from string and array of format strings\n\n\n function configFromStringAndArray(config) {\n var tempConfig, bestMoment, scoreToBeat, i, currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n } // if there is any input that was not parsed add a penalty for that format\n\n\n currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens\n\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n configFromArray(config);\n }\n\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || format === undefined && input === '') {\n return createInvalid({\n nullInput: true\n });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {\n input = undefined;\n } // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n\n\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n return createFromConfig(c);\n }\n\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n });\n var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }); // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n\n function pickBy(fn, moments) {\n var res, i;\n\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n\n if (!moments.length) {\n return createLocal();\n }\n\n res = moments[0];\n\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n\n return res;\n } // TODO: Use [].sort instead?\n\n\n function min() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isBefore', args);\n }\n\n function max() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n\n function isDurationValid(m) {\n for (var key in m) {\n if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n\n var unitHasDecimal = false;\n\n for (var i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove\n\n this._milliseconds = +milliseconds + seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n\n this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n\n this._months = +months + quarters * 3 + years * 12;\n this._data = {};\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n } // FORMATTING\n\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', ''); // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n }); // HELPERS\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n } // Return a moment from input, that is local/utc/zone equivalent to model.\n\n\n function cloneWithOffset(input, model) {\n var res, diff;\n\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api.\n\n res._d.setTime(res._d.valueOf() + diff);\n\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n } // HOOKS\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n\n\n hooks.updateOffset = function () {}; // MOMENTS\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n\n\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n\n this._offset = input;\n this._isUTC = true;\n\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n\n return this;\n }\n\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n\n return this;\n }\n\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n\n input = input ? createLocal(input).utcOffset() : 0;\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime() {\n return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();\n }\n\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n } // ASP.NET json date format regex\n\n\n var aspNetRegex = /^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n\n 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)?)?$/;\n\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign)\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it\n\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n res.months = other.month() - base.month() + (other.year() - base.year()) * 12;\n\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n\n if (!(base.isValid() && other.isValid())) {\n return {\n milliseconds: 0,\n months: 0\n };\n }\n\n other = cloneWithOffset(other, base);\n\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n } // TODO: remove 'name' arg after deprecation is removed\n\n\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp; //invert the arguments, but complain about it\n\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add');\n var subtract = createAdder(-1, 'subtract');\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';\n }\n\n function calendar$1(time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n\n function clone() {\n return new Moment(this);\n }\n\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n\n units = normalizeUnits(units) || 'millisecond';\n\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n\n units = normalizeUnits(units) || 'millisecond';\n\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));\n }\n\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n\n units = normalizeUnits(units) || 'millisecond';\n\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n\n case 'month':\n output = monthDiff(this, that);\n break;\n\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n\n case 'second':\n output = (this - that) / 1e3;\n break;\n // 1000\n\n case 'minute':\n output = (this - that) / 6e4;\n break;\n // 1000 * 60\n\n case 'hour':\n output = (this - that) / 36e5;\n break;\n // 1000 * 60 * 60\n\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break;\n // 1000 * 60 * 60 * 24, negate dst\n\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break;\n // 1000 * 60 * 60 * 24 * 7, negate dst\n\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff(a, b) {\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month\n\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month\n\n adjust = (b - anchor) / (anchor2 - anchor);\n } //check for negative zero, return zero if negative zero\n\n\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n\n var utc = keepOffset !== true;\n var m = utc ? this.clone().utc() : this;\n\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));\n }\n }\n\n return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n\n\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n\n var func = 'moment';\n var zone = '';\n\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n\n var prefix = '[' + func + '(\"]';\n var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n to: this,\n from: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n from: this,\n to: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n } // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n\n\n function locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n\n return this;\n }\n }\n\n var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n });\n\n function localeData() {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000;\n var MS_PER_MINUTE = 60 * MS_PER_SECOND;\n var MS_PER_HOUR = 60 * MS_PER_MINUTE;\n var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970):\n\n function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf(units) {\n var time;\n units = normalizeUnits(units);\n\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3, 1);\n break;\n\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday());\n break;\n\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));\n break;\n\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);\n break;\n\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf(units) {\n var time;\n units = normalizeUnits(units);\n\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;\n break;\n\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;\n break;\n\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;\n break;\n\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n\n case 'hour':\n time = this._d.valueOf();\n time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;\n break;\n\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate() {\n return new Date(this.valueOf());\n }\n\n function toArray() {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2() {\n return isValid(this);\n }\n\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n } // FORMATTING\n\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG'); // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1); // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n }); // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);\n }\n\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n } // FORMATTING\n\n\n addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES\n\n addUnitAlias('quarter', 'Q'); // PRIORITY\n\n addUnitPriority('quarter', 7); // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n }); // MOMENTS\n\n function getSetQuarter(input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n } // FORMATTING\n\n\n addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES\n\n addUnitAlias('date', 'D'); // PRIORITY\n\n addUnitPriority('date', 9); // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;\n });\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n }); // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD'); // PRIORITY\n\n addUnitPriority('dayOfYear', 4); // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n }); // HELPERS\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n } // FORMATTING\n\n\n addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES\n\n addUnitAlias('minute', 'm'); // PRIORITY\n\n addUnitPriority('minute', 14); // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE); // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false); // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES\n\n addUnitAlias('second', 's'); // PRIORITY\n\n addUnitPriority('second', 15); // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND); // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false); // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n }); // ALIASES\n\n addUnitAlias('millisecond', 'ms'); // PRIORITY\n\n addUnitPriority('millisecond', 16); // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n var token;\n\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n } // MOMENTS\n\n\n var getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat(string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1(format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n\n return out;\n } // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n\n\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n\n return out;\n }\n\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';\n return number + output;\n }\n }); // Side effect imports\n\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n var mathAbs = Math.abs;\n\n function abs() {\n var data = this._data;\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n return this;\n }\n\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n return duration._bubble();\n } // supports only 2.0-style add(1, 's') or add(duration)\n\n\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n } // supports only 2.0-style subtract(1, 's') or subtract(duration)\n\n\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble() {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n\n if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n } // The following code bubbles up values, see the tests for\n // examples of what that means.\n\n\n data.milliseconds = milliseconds % 1000;\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n days += absFloor(hours / 24); // convert days to months\n\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year\n\n years = absFloor(months / 12);\n months %= 12;\n data.days = days;\n data.months = months;\n data.years = years;\n return this;\n }\n\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n\n var days;\n var months;\n var milliseconds = this._milliseconds;\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n\n switch (units) {\n case 'month':\n return months;\n\n case 'quarter':\n return months / 3;\n\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n\n case 'day':\n return days + milliseconds / 864e5;\n\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n } // TODO: Use this.as('ms')?\n\n\n function valueOf$1() {\n if (!this.isValid()) {\n return NaN;\n }\n\n return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;\n }\n\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asQuarters = makeAs('Q');\n var asYears = makeAs('y');\n\n function clone$1() {\n return createDuration(this);\n }\n\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks() {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n ss: 44,\n // a few seconds to seconds\n s: 45,\n // seconds to minute\n m: 45,\n // minutes to hour\n h: 22,\n // hours to day\n d: 26,\n // days to month\n M: 11 // months to year\n\n }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1(posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n var a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', 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];\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n } // This function allows you to set the rounding function for relative time strings\n\n\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n\n return false;\n } // This function allows you to set a threshold for relative time strings\n\n\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n\n if (limit === undefined) {\n return thresholds[threshold];\n }\n\n thresholds[threshold] = limit;\n\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n\n return true;\n }\n\n function humanize(withSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years; // 3600 seconds -> 60 minutes -> 1 hour\n\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60; // 12 months -> 1 year\n\n years = absFloor(months / 12);\n months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n var totalSign = total < 0 ? '-' : '';\n var ymSign = sign(this._months) !== sign(total) ? '-' : '';\n var daysSign = sign(this._days) !== sign(total) ? '-' : '';\n var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : '');\n }\n\n var proto$2 = Duration.prototype;\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang; // Side effect imports\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf'); // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n }); // Side effect imports\n\n hooks.version = '2.24.0';\n setHookCallback(createLocal);\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats\n\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',\n // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',\n // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',\n // \n DATE: 'YYYY-MM-DD',\n // \n TIME: 'HH:mm',\n // \n TIME_SECONDS: 'HH:mm:ss',\n // \n TIME_MS: 'HH:mm:ss.SSS',\n // \n WEEK: 'GGGG-[W]WW',\n // \n MONTH: 'YYYY-MM' // \n\n };\n return hooks;\n });\n}); // Maps for number <-> hex string conversion\n\nvar byteToHex$2 = [];\n\nfor (var i$2 = 0; i$2 < 256; i$2++) {\n byteToHex$2[i$2] = (i$2 + 0x100).toString(16).substr(1);\n}\n/**\n * Generate 16 random bytes to be used as a base for UUID.\n *\n * @ignore\n */\n\n\nvar random$1 = function () {\n if (typeof crypto !== 'undefined' && crypto.getRandomValues) {\n // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n // Moderately fast, high quality\n var _rnds8 = new Uint8Array(16);\n\n return function whatwgRNG() {\n crypto.getRandomValues(_rnds8);\n return _rnds8;\n };\n } // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random().\n // It's fast, but is of unspecified quality.\n\n\n var _rnds = new Array(16);\n\n return function () {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) {\n r = Math.random() * 0x100000000;\n }\n\n _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return _rnds;\n }; // uuid.js\n //\n // Copyright (c) 2010-2012 Robert Kieffer\n // MIT License - http://opensource.org/licenses/mit-license.php\n // Unique ID creation requires a high quality random # generator. We feature\n // detect to determine the best RNG source, normalizing to a function that\n // returns 128-bits of randomness, since that's what's usually required\n // return require('./rng');\n}();\n\nvar byteToHex$1$1 = [];\n\nfor (var i$1$1 = 0; i$1$1 < 256; i$1$1++) {\n byteToHex$1$1[i$1$1] = (i$1$1 + 0x100).toString(16).substr(1);\n} // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n// random #'s we need to init node and clockseq\n\n\nvar seedBytes$1 = random$1(); // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n\nvar defaultNodeId$1 = [seedBytes$1[0] | 0x01, seedBytes$1[1], seedBytes$1[2], seedBytes$1[3], seedBytes$1[4], seedBytes$1[5]]; // Per 4.2.2, randomize (14 bit) clockseq\n\nvar defaultClockseq$1 = (seedBytes$1[6] << 8 | seedBytes$1[7]) & 0x3fff; // Previous uuid creation time\n// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'\n// code from http://momentjs.com/\n\n\nvar ASPDateRegex = /^\\/?Date\\((-?\\d+)/i; // Hex color\n/**\n * Hue, Saturation, Value.\n */\n\n/**\n * Test whether given object is a number\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if number, false otherwise.\n */\n\nfunction isNumber(value) {\n return value instanceof Number || typeof value === 'number';\n}\n/**\n * Test whether given object is a string\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if string, false otherwise.\n */\n\n\nfunction isString(value) {\n return value instanceof String || typeof value === 'string';\n}\n/**\n * Test whether given object is a Moment date.\n * @TODO: This is basically a workaround, if Moment was imported property it wouldn't necessary as moment.isMoment is a TS type guard.\n *\n * @param value - Input value of unknown type.\n *\n * @returns True if Moment instance, false otherwise.\n */\n\n\nfunction isMoment(value) {\n return moment.isMoment(value);\n}\n/**\n * Convert an object into another type\n *\n * @param object - Value of unknown type.\n * @param type - Name of the desired type.\n *\n * @returns Object in the desired type.\n * @throws Error\n */\n\n\nfunction convert(object, type) {\n var match;\n\n if (object === undefined) {\n return undefined;\n }\n\n if (object === null) {\n return null;\n }\n\n if (!type) {\n return object;\n }\n\n if (!(typeof type === 'string') && !(type instanceof String)) {\n throw new Error('Type must be a string');\n } //noinspection FallthroughInSwitchStatementJS\n\n\n switch (type) {\n case 'boolean':\n case 'Boolean':\n return Boolean(object);\n\n case 'number':\n case 'Number':\n if (isString(object) && !isNaN(Date.parse(object))) {\n return moment(object).valueOf();\n } else {\n // @TODO: I don't think that Number and String constructors are a good idea.\n // This could also fail if the object doesn't have valueOf method or if it's redefined.\n // For example: Object.create(null) or { valueOf: 7 }.\n return Number(object.valueOf());\n }\n\n case 'string':\n case 'String':\n return String(object);\n\n case 'Date':\n if (isNumber(object)) {\n return new Date(object);\n }\n\n if (object instanceof Date) {\n return new Date(object.valueOf());\n } else if (isMoment(object)) {\n return new Date(object.valueOf());\n }\n\n if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])); // parse number\n } else {\n return moment(new Date(object)).toDate(); // parse string\n }\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type Date');\n }\n\n case 'Moment':\n if (isNumber(object)) {\n return moment(object);\n }\n\n if (object instanceof Date) {\n return moment(object.valueOf());\n } else if (isMoment(object)) {\n return moment(object);\n }\n\n if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n if (match) {\n // object is an ASP date\n return moment(Number(match[1])); // parse number\n } else {\n return moment(object); // parse string\n }\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type Date');\n }\n\n case 'ISODate':\n if (isNumber(object)) {\n return new Date(object);\n } else if (object instanceof Date) {\n return object.toISOString();\n } else if (isMoment(object)) {\n return object.toDate().toISOString();\n } else if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])).toISOString(); // parse number\n } else {\n return moment(object).format(); // ISO 8601\n }\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type ISODate');\n }\n\n case 'ASPDate':\n if (isNumber(object)) {\n return '/Date(' + object + ')/';\n } else if (object instanceof Date) {\n return '/Date(' + object.valueOf() + ')/';\n } else if (isString(object)) {\n match = ASPDateRegex.exec(object);\n\n var _value;\n\n if (match) {\n // object is an ASP date\n _value = new Date(Number(match[1])).valueOf(); // parse number\n } else {\n _value = new Date(object).valueOf(); // parse string\n }\n\n return '/Date(' + _value + ')/';\n } else {\n throw new Error('Cannot convert object of type ' + getType(object) + ' to type ASPDate');\n }\n\n default:\n var never = type;\n throw new Error(\"Unknown type \".concat(never));\n }\n}\n/**\n * Get the type of an object, for example exports.getType([]) returns 'Array'\n *\n * @param object - Input value of unknown type.\n *\n * @returns Detected type.\n */\n\n\nfunction getType(object) {\n var type = _typeof(object);\n\n if (type === 'object') {\n if (object === null) {\n return 'null';\n }\n\n if (object instanceof Boolean) {\n return 'Boolean';\n }\n\n if (object instanceof Number) {\n return 'Number';\n }\n\n if (object instanceof String) {\n return 'String';\n }\n\n if (Array.isArray(object)) {\n return 'Array';\n }\n\n if (object instanceof Date) {\n return 'Date';\n }\n\n return 'Object';\n }\n\n if (type === 'number') {\n return 'Number';\n }\n\n if (type === 'boolean') {\n return 'Boolean';\n }\n\n if (type === 'string') {\n return 'String';\n }\n\n if (type === undefined) {\n return 'undefined';\n }\n\n return type;\n}\n\n/**\r\n * Determine whether a value can be used as an id.\r\n *\r\n * @param value - Input value of unknown type.\r\n *\r\n * @returns True if the value is valid id, false otherwise.\r\n */\nfunction isId(value) {\n return typeof value === 'string' || typeof value === 'number';\n}\n\n/**\r\n * A queue.\r\n *\r\n * @typeParam T - The type of method names to be replaced by queued versions.\r\n */\nvar Queue =\n/*#__PURE__*/\nfunction () {\n /**\r\n * Construct a new Queue.\r\n *\r\n * @param options - Queue configuration.\r\n */\n function Queue(options) {\n classCallCheck(this, Queue);\n\n this._queue = [];\n this._timeout = null;\n this._extended = null; // options\n\n this.delay = null;\n this.max = Infinity;\n this.setOptions(options);\n }\n /**\r\n * Update the configuration of the queue.\r\n *\r\n * @param options - Queue configuration.\r\n */\n\n\n createClass(Queue, [{\n key: \"setOptions\",\n value: function setOptions(options) {\n if (options && typeof options.delay !== 'undefined') {\n this.delay = options.delay;\n }\n\n if (options && typeof options.max !== 'undefined') {\n this.max = options.max;\n }\n\n this._flushIfNeeded();\n }\n /**\r\n * Extend an object with queuing functionality.\r\n * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.\r\n *\r\n * @param object - The object to be extended.\r\n * @param options - Additional options.\r\n *\r\n * @returns The created queue.\r\n */\n\n }, {\n key: \"destroy\",\n\n /**\r\n * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.\r\n */\n value: function destroy() {\n this.flush();\n\n if (this._extended) {\n var object = this._extended.object;\n var methods = this._extended.methods;\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n\n if (method.original) {\n object[method.name] = method.original;\n } else {\n // @TODO: better solution?\n delete object[method.name];\n }\n }\n\n this._extended = null;\n }\n }\n /**\r\n * Replace a method on an object with a queued version.\r\n *\r\n * @param object - Object having the method.\r\n * @param method - The method name.\r\n */\n\n }, {\n key: \"replace\",\n value: function replace(object, method) {\n var me = this;\n var original = object[method];\n\n if (!original) {\n throw new Error('Method ' + method + ' undefined');\n }\n\n object[method] = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // add this call to the queue\n me.queue({\n args: args,\n fn: original,\n context: this\n });\n };\n }\n /**\r\n * Queue a call.\r\n *\r\n * @param entry - The function or entry to be queued.\r\n */\n\n }, {\n key: \"queue\",\n value: function queue(entry) {\n if (typeof entry === 'function') {\n this._queue.push({\n fn: entry\n });\n } else {\n this._queue.push(entry);\n }\n\n this._flushIfNeeded();\n }\n /**\r\n * Check whether the queue needs to be flushed.\r\n */\n\n }, {\n key: \"_flushIfNeeded\",\n value: function _flushIfNeeded() {\n var _this = this;\n\n // flush when the maximum is exceeded.\n if (this._queue.length > this.max) {\n this.flush();\n } // flush after a period of inactivity when a delay is configured\n\n\n if (this._timeout != null) {\n clearTimeout(this._timeout);\n this._timeout = null;\n }\n\n if (this.queue.length > 0 && typeof this.delay === 'number') {\n this._timeout = setTimeout(function () {\n _this.flush();\n }, this.delay);\n }\n }\n /**\r\n * Flush all queued calls\r\n */\n\n }, {\n key: \"flush\",\n value: function flush() {\n this._queue.splice(0).forEach(function (entry) {\n entry.fn.apply(entry.context || entry.fn, entry.args || []);\n });\n }\n }], [{\n key: \"extend\",\n value: function extend(object, options) {\n var queue = new Queue(options);\n\n if (object.flush !== undefined) {\n throw new Error('Target object already has a property flush');\n }\n\n object.flush = function () {\n queue.flush();\n };\n\n var methods = [{\n name: 'flush',\n original: undefined\n }];\n\n if (options && options.replace) {\n for (var i = 0; i < options.replace.length; i++) {\n var name = options.replace[i];\n methods.push({\n name: name,\n // @TODO: better solution?\n original: object[name]\n }); // @TODO: better solution?\n\n queue.replace(object, name);\n }\n }\n\n queue._extended = {\n object: object,\n methods: methods\n };\n return queue;\n }\n }]);\n\n return Queue;\n}();\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nvar arrayWithoutHoles = _arrayWithoutHoles;\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nvar iterableToArray = _iterableToArray;\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nvar nonIterableSpread = _nonIterableSpread;\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nvar toConsumableArray = _toConsumableArray;\n\n/**\r\n * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]].\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n */\nvar DataSetPart =\n/*#__PURE__*/\nfunction () {\n function DataSetPart() {\n classCallCheck(this, DataSetPart);\n\n this._subscribers = {\n '*': [],\n add: [],\n remove: [],\n update: []\n };\n /**\r\n * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).\r\n */\n\n this.subscribe = DataSetPart.prototype.on;\n /**\r\n * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).\r\n */\n\n this.unsubscribe = DataSetPart.prototype.off;\n }\n /**\r\n * Trigger an event\r\n *\r\n * @param event - Event name.\r\n * @param payload - Event payload.\r\n * @param senderId - Id of the sender.\r\n */\n\n\n createClass(DataSetPart, [{\n key: \"_trigger\",\n value: function _trigger(event, payload, senderId) {\n if (event === '*') {\n throw new Error('Cannot trigger event *');\n }\n\n var subscribers = [].concat(toConsumableArray(this._subscribers[event]), toConsumableArray(this._subscribers['*']));\n\n for (var i = 0, len = subscribers.length; i < len; i++) {\n var subscriber = subscribers[i];\n\n if (subscriber.callback) {\n subscriber.callback(event, payload, senderId != null ? senderId : null);\n }\n }\n }\n /**\r\n * Subscribe to an event, add an event listener.\r\n *\r\n * @param event - Event name.\r\n * @param callback - Callback method.\r\n */\n\n }, {\n key: \"on\",\n value: function on(event, callback) {\n this._subscribers[event].push({\n callback: callback\n });\n }\n /**\r\n * Unsubscribe from an event, remove an event listener.\r\n *\r\n * @remarks If the same callback was subscribed more than once **all** occurences will be removed.\r\n *\r\n * @param event - Event name.\r\n * @param callback - Callback method.\r\n */\n\n }, {\n key: \"off\",\n value: function off(event, callback) {\n this._subscribers[event] = this._subscribers[event].filter(function (listener) {\n return listener.callback !== callback;\n });\n }\n }]);\n\n return DataSetPart;\n}();\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n/**\r\n * # DataSet\r\n *\r\n * Vis.js comes with a flexible DataSet, which can be used to hold and manipulate unstructured data and listen for changes in the data. The DataSet is key/value based. Data items can be added, updated and removed from the DataSet, and one can subscribe to changes in the DataSet. The data in the DataSet can be filtered and ordered, and fields (like dates) can be converted to a specific type. Data can be normalized when appending it to the DataSet as well.\r\n *\r\n * ## Example\r\n *\r\n * The following example shows how to use a DataSet.\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * var options = {};\r\n * var data = new vis.DataSet(options);\r\n *\r\n * // add items\r\n * // note that the data items can contain different properties and data formats\r\n * data.add([\r\n * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},\r\n * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},\r\n * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},\r\n * {id: 4, text: 'item 4'}\r\n * ]);\r\n *\r\n * // subscribe to any change in the DataSet\r\n * data.on('*', function (event, properties, senderId) {\r\n * console.log('event', event, properties);\r\n * });\r\n *\r\n * // update an existing item\r\n * data.update({id: 2, group: 1});\r\n *\r\n * // remove an item\r\n * data.remove(4);\r\n *\r\n * // get all ids\r\n * var ids = data.getIds();\r\n * console.log('ids', ids);\r\n *\r\n * // get a specific item\r\n * var item1 = data.get(1);\r\n * console.log('item1', item1);\r\n *\r\n * // retrieve a filtered subset of the data\r\n * var items = data.get({\r\n * filter: function (item) {\r\n * return item.group == 1;\r\n * }\r\n * });\r\n * console.log('filtered items', items);\r\n *\r\n * // retrieve formatted items\r\n * var items = data.get({\r\n * fields: ['id', 'date'],\r\n * type: {\r\n * date: 'ISODate'\r\n * }\r\n * });\r\n * console.log('formatted items', items);\r\n * ```\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n */\n\nvar DataSet =\n/*#__PURE__*/\nfunction (_DataSetPart) {\n inherits(DataSet, _DataSetPart);\n\n /**\r\n * Construct a new DataSet.\r\n *\r\n * @param data - Initial data or options.\r\n * @param options - Options (type error if data is also options).\r\n */\n function DataSet(data, options) {\n var _this;\n\n classCallCheck(this, DataSet);\n\n _this = possibleConstructorReturn(this, getPrototypeOf(DataSet).call(this)); // correctly read optional arguments\n\n if (data && !Array.isArray(data)) {\n options = data;\n data = [];\n }\n\n _this._options = options || {};\n _this._data = Object.create({}); // map with data indexed by id\n\n _this.length = 0; // number of items in the DataSet\n\n _this._idProp = _this._options.fieldId || 'id'; // name of the field containing id\n\n _this._type = {}; // internal field types (NOTE: this can differ from this._options.type)\n // all variants of a Date are internally stored as Date, so we can convert\n // from everything to everything (also from ISODate to Number for example)\n\n if (_this._options.type) {\n var fields = Object.keys(_this._options.type);\n\n for (var i = 0, len = fields.length; i < len; i++) {\n var field = fields[i];\n var value = _this._options.type[field];\n\n if (value == 'Date' || value == 'ISODate' || value == 'ASPDate') {\n _this._type[field] = 'Date';\n } else {\n _this._type[field] = value;\n }\n }\n } // add initial data when provided\n\n\n if (data && data.length) {\n _this.add(data);\n }\n\n _this.setOptions(options);\n\n return _this;\n }\n /**\r\n * Set new options.\r\n *\r\n * @param options - The new options.\r\n */\n\n\n createClass(DataSet, [{\n key: \"setOptions\",\n value: function setOptions(options) {\n if (options && options.queue !== undefined) {\n if (options.queue === false) {\n // delete queue if loaded\n if (this._queue) {\n this._queue.destroy();\n\n delete this._queue;\n }\n } else {\n // create queue and update its options\n if (!this._queue) {\n this._queue = Queue.extend(this, {\n replace: ['add', 'update', 'remove']\n });\n }\n\n if (options.queue && _typeof_1(options.queue) === 'object') {\n this._queue.setOptions(options.queue);\n }\n }\n }\n }\n /**\r\n * Add a data item or an array with items.\r\n *\r\n * After the items are added to the DataSet, the DataSet will trigger an event `add`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\r\n *\r\n * ## Example\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet()\r\n *\r\n * // add items\r\n * const ids = data.add([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { text: 'item without an id' }\r\n * ])\r\n *\r\n * console.log(ids) // [1, 2, '']\r\n * ```\r\n *\r\n * @param data - Items to be added (ids will be generated if missing).\r\n * @param senderId - Sender id.\r\n *\r\n * @returns addedIds - Array with the ids (generated if not present) of the added items.\r\n *\r\n * @throws When an item with the same id as any of the added items already exists.\r\n */\n\n }, {\n key: \"add\",\n value: function add(data, senderId) {\n var addedIds = [];\n var id;\n\n if (Array.isArray(data)) {\n // Array\n for (var i = 0, len = data.length; i < len; i++) {\n id = this._addItem(data[i]);\n addedIds.push(id);\n }\n } else if (data && _typeof_1(data) === 'object') {\n // Single item\n id = this._addItem(data);\n addedIds.push(id);\n } else {\n throw new Error('Unknown dataType');\n }\n\n if (addedIds.length) {\n this._trigger('add', {\n items: addedIds\n }, senderId);\n }\n\n return addedIds;\n }\n /**\r\n * Update existing items. When an item does not exist, it will be created\r\n *\r\n * The provided properties will be merged in the existing item. When an item does not exist, it will be created.\r\n *\r\n * After the items are updated, the DataSet will trigger an event `add` for the added items, and an event `update`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\r\n *\r\n * ## Example\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { id: 3, text: 'item 3' }\r\n * ])\r\n *\r\n * // update items\r\n * const ids = data.update([\r\n * { id: 2, text: 'item 2 (updated)' },\r\n * { id: 4, text: 'item 4 (new)' }\r\n * ])\r\n *\r\n * console.log(ids) // [2, 4]\r\n * ```\r\n *\r\n * @param data - Items to be updated (if the id is already present) or added (if the id is missing).\r\n * @param senderId - Sender id.\r\n *\r\n * @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items.\r\n *\r\n * @throws When the supplied data is neither an item nor an array of items.\r\n */\n\n }, {\n key: \"update\",\n value: function update(data, senderId) {\n var _this2 = this;\n\n var addedIds = [];\n var updatedIds = [];\n var oldData = [];\n var updatedData = [];\n var idProp = this._idProp;\n\n var addOrUpdate = function addOrUpdate(item) {\n var origId = item[idProp];\n\n if (origId != null && _this2._data[origId]) {\n var fullItem = item; // it has an id, therefore it is a fullitem\n\n var oldItem = Object.assign({}, _this2._data[origId]); // update item\n\n var id = _this2._updateItem(fullItem);\n\n updatedIds.push(id);\n updatedData.push(fullItem);\n oldData.push(oldItem);\n } else {\n // add new item\n var _id = _this2._addItem(item);\n\n addedIds.push(_id);\n }\n };\n\n if (Array.isArray(data)) {\n // Array\n for (var i = 0, len = data.length; i < len; i++) {\n if (data[i] && _typeof_1(data[i]) === 'object') {\n addOrUpdate(data[i]);\n } else {\n console.warn('Ignoring input item, which is not an object at index ' + i);\n }\n }\n } else if (data && _typeof_1(data) === 'object') {\n // Single item\n addOrUpdate(data);\n } else {\n throw new Error('Unknown dataType');\n }\n\n if (addedIds.length) {\n this._trigger('add', {\n items: addedIds\n }, senderId);\n }\n\n if (updatedIds.length) {\n var props = {\n items: updatedIds,\n oldData: oldData,\n data: updatedData\n }; // TODO: remove deprecated property 'data' some day\n //Object.defineProperty(props, 'data', {\n // 'get': (function() {\n // 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');\n // return updatedData;\n // }).bind(this)\n //});\n\n this._trigger('update', props, senderId);\n }\n\n return addedIds.concat(updatedIds);\n }\n /** @inheritdoc */\n\n }, {\n key: \"get\",\n value: function get(first, second) {\n // @TODO: Woudn't it be better to split this into multiple methods?\n // parse the arguments\n var id = undefined;\n var ids = undefined;\n var options = undefined;\n\n if (isId(first)) {\n // get(id [, options])\n id = first;\n options = second;\n } else if (Array.isArray(first)) {\n // get(ids [, options])\n ids = first;\n options = second;\n } else {\n // get([, options])\n options = first;\n } // determine the return type\n\n\n var returnType = options && options.returnType === 'Object' ? 'Object' : 'Array'; // @TODO: WTF is this? Or am I missing something?\n // var returnType\n // if (options && options.returnType) {\n // var allowedValues = ['Array', 'Object']\n // returnType =\n // allowedValues.indexOf(options.returnType) == -1\n // ? 'Array'\n // : options.returnType\n // } else {\n // returnType = 'Array'\n // }\n // build options\n\n var type = options && options.type || this._options.type;\n var filter = options && options.filter;\n var items = [];\n var item = null;\n var itemIds = null;\n var itemId = null; // convert items\n\n if (id != null) {\n // return a single item\n item = this._getItem(id, type);\n\n if (item && filter && !filter(item)) {\n item = null;\n }\n } else if (ids != null) {\n // return a subset of items\n for (var i = 0, len = ids.length; i < len; i++) {\n item = this._getItem(ids[i], type);\n\n if (item != null && (!filter || filter(item))) {\n items.push(item);\n }\n }\n } else {\n // return all items\n itemIds = Object.keys(this._data);\n\n for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {\n itemId = itemIds[_i];\n item = this._getItem(itemId, type);\n\n if (item != null && (!filter || filter(item))) {\n items.push(item);\n }\n }\n } // order the results\n\n\n if (options && options.order && id == undefined) {\n this._sort(items, options.order);\n } // filter fields of the items\n\n\n if (options && options.fields) {\n var fields = options.fields;\n\n if (id != undefined && item != null) {\n item = this._filterFields(item, fields);\n } else {\n for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) {\n items[_i2] = this._filterFields(items[_i2], fields);\n }\n }\n } // return the results\n\n\n if (returnType == 'Object') {\n var result = {};\n\n for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {\n var resultant = items[_i3]; // @TODO: Shoudn't this be this._fieldId?\n // result[resultant.id] = resultant\n\n var _id2 = resultant[this._idProp];\n result[_id2] = resultant;\n }\n\n return result;\n } else {\n if (id != null) {\n // a single item\n return item;\n } else {\n // just return our array\n return items;\n }\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"getIds\",\n value: function getIds(options) {\n var data = this._data;\n var filter = options && options.filter;\n var order = options && options.order;\n var type = options && options.type || this._options.type;\n var itemIds = Object.keys(data);\n var ids = [];\n var item;\n var items;\n\n if (filter) {\n // get filtered items\n if (order) {\n // create ordered list\n items = [];\n\n for (var i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n item = this._getItem(id, type);\n\n if (filter(item)) {\n items.push(item);\n }\n }\n\n this._sort(items, order);\n\n for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) {\n ids.push(items[_i4][this._idProp]);\n }\n } else {\n // create unordered list\n for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {\n var _id3 = itemIds[_i5];\n item = this._getItem(_id3, type);\n\n if (filter(item)) {\n ids.push(item[this._idProp]);\n }\n }\n }\n } else {\n // get all items\n if (order) {\n // create an ordered list\n items = [];\n\n for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {\n var _id4 = itemIds[_i6];\n items.push(data[_id4]);\n }\n\n this._sort(items, order);\n\n for (var _i7 = 0, _len7 = items.length; _i7 < _len7; _i7++) {\n ids.push(items[_i7][this._idProp]);\n }\n } else {\n // create unordered list\n for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {\n var _id5 = itemIds[_i8];\n item = data[_id5];\n ids.push(item[this._idProp]);\n }\n }\n }\n\n return ids;\n }\n /** @inheritdoc */\n\n }, {\n key: \"getDataSet\",\n value: function getDataSet() {\n return this;\n }\n /** @inheritdoc */\n\n }, {\n key: \"forEach\",\n value: function forEach(callback, options) {\n var filter = options && options.filter;\n var type = options && options.type || this._options.type;\n var data = this._data;\n var itemIds = Object.keys(data);\n\n if (options && options.order) {\n // execute forEach on ordered list\n var items = this.get(options);\n\n for (var i = 0, len = items.length; i < len; i++) {\n var item = items[i];\n var id = item[this._idProp];\n callback(item, id);\n }\n } else {\n // unordered\n for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {\n var _id6 = itemIds[_i9];\n\n var _item = this._getItem(_id6, type);\n\n if (!filter || filter(_item)) {\n callback(_item, _id6);\n }\n }\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"map\",\n value: function map(callback, options) {\n var filter = options && options.filter;\n var type = options && options.type || this._options.type;\n var mappedItems = [];\n var data = this._data;\n var itemIds = Object.keys(data); // convert and filter items\n\n for (var i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n\n var item = this._getItem(id, type);\n\n if (!filter || filter(item)) {\n mappedItems.push(callback(item, id));\n }\n } // order items\n\n\n if (options && options.order) {\n this._sort(mappedItems, options.order);\n }\n\n return mappedItems;\n }\n /**\r\n * Filter the fields of an item.\r\n *\r\n * @param item - The item whose fields should be filtered.\r\n * @param fields - The names of the fields that will be kept.\r\n *\r\n * @typeParam K - Field name type.\r\n *\r\n * @returns The item without any additional fields.\r\n */\n\n }, {\n key: \"_filterFields\",\n value: function _filterFields(item, fields) {\n if (!item) {\n // item is null\n return item;\n }\n\n return (Array.isArray(fields) ? // Use the supplied array\n fields : // Use the keys of the supplied object\n Object.keys(fields)).reduce(function (filteredItem, field) {\n filteredItem[field] = item[field];\n return filteredItem;\n }, {});\n }\n /**\r\n * Sort the provided array with items.\r\n *\r\n * @param items - Items to be sorted in place.\r\n * @param order - A field name or custom sort function.\r\n *\r\n * @typeParam T - The type of the items in the items array.\r\n */\n\n }, {\n key: \"_sort\",\n value: function _sort(items, order) {\n if (typeof order === 'string') {\n // order by provided field name\n var name = order; // field name\n\n items.sort(function (a, b) {\n // @TODO: How to treat missing properties?\n var av = a[name];\n var bv = b[name];\n return av > bv ? 1 : av < bv ? -1 : 0;\n });\n } else if (typeof order === 'function') {\n // order by sort function\n items.sort(order);\n } else {\n // TODO: extend order by an Object {field:string, direction:string}\n // where direction can be 'asc' or 'desc'\n throw new TypeError('Order must be a function or a string');\n }\n }\n /**\r\n * Remove an item or multiple items by “reference” (only the id is used) or by id.\r\n *\r\n * The method ignores removal of non-existing items, and returns an array containing the ids of the items which are actually removed from the DataSet.\r\n *\r\n * After the items are removed, the DataSet will trigger an event `remove` for the removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\r\n *\r\n * ## Example\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { id: 3, text: 'item 3' }\r\n * ])\r\n *\r\n * // remove items\r\n * const ids = data.remove([2, { id: 3 }, 4])\r\n *\r\n * console.log(ids) // [2, 3]\r\n * ```\r\n *\r\n * @param id - One or more items or ids of items to be removed.\r\n * @param senderId - Sender id.\r\n *\r\n * @returns The ids of the removed items.\r\n */\n\n }, {\n key: \"remove\",\n value: function remove(id, senderId) {\n var removedIds = [];\n var removedItems = []; // force everything to be an array for simplicity\n\n var ids = Array.isArray(id) ? id : [id];\n\n for (var i = 0, len = ids.length; i < len; i++) {\n var item = this._remove(ids[i]);\n\n if (item) {\n var itemId = item[this._idProp];\n\n if (itemId != null) {\n removedIds.push(itemId);\n removedItems.push(item);\n }\n }\n }\n\n if (removedIds.length) {\n this._trigger('remove', {\n items: removedIds,\n oldData: removedItems\n }, senderId);\n }\n\n return removedIds;\n }\n /**\r\n * Remove an item by its id or reference.\r\n *\r\n * @param id - Id of an item or the item itself.\r\n *\r\n * @returns The removed item if removed, null otherwise.\r\n */\n\n }, {\n key: \"_remove\",\n value: function _remove(id) {\n // @TODO: It origianlly returned the item although the docs say id.\n // The code expects the item, so probably an error in the docs.\n var ident; // confirm the id to use based on the args type\n\n if (isId(id)) {\n ident = id;\n } else if (id && _typeof_1(id) === 'object') {\n ident = id[this._idProp]; // look for the identifier field using ._idProp\n } // do the removing if the item is found\n\n\n if (ident != null && this._data[ident]) {\n var item = this._data[ident];\n delete this._data[ident];\n --this.length;\n return item;\n }\n\n return null;\n }\n /**\r\n * Clear the entire data set.\r\n *\r\n * After the items are removed, the [[DataSet]] will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\r\n *\r\n * @param senderId - Sender id.\r\n *\r\n * @returns removedIds - The ids of all removed items.\r\n */\n\n }, {\n key: \"clear\",\n value: function clear(senderId) {\n var ids = Object.keys(this._data);\n var items = [];\n\n for (var i = 0, len = ids.length; i < len; i++) {\n items.push(this._data[ids[i]]);\n }\n\n this._data = {};\n this.length = 0;\n\n this._trigger('remove', {\n items: ids,\n oldData: items\n }, senderId);\n\n return ids;\n }\n /**\r\n * Find the item with maximum value of a specified field.\r\n *\r\n * @param field - Name of the property that should be searched for max value.\r\n *\r\n * @returns Item containing max value, or null if no items.\r\n */\n\n }, {\n key: \"max\",\n value: function max(field) {\n var data = this._data;\n var itemIds = Object.keys(data);\n var max = null;\n var maxField = null;\n\n for (var i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n var item = data[id];\n var itemField = item[field];\n\n if (itemField != null && (maxField == null || itemField > maxField)) {\n max = item;\n maxField = itemField;\n }\n }\n\n return max;\n }\n /**\r\n * Find the item with minimum value of a specified field.\r\n *\r\n * @param field - Name of the property that should be searched for min value.\r\n *\r\n * @returns Item containing min value, or null if no items.\r\n */\n\n }, {\n key: \"min\",\n value: function min(field) {\n var data = this._data;\n var itemIds = Object.keys(data);\n var min = null;\n var minField = null;\n\n for (var i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n var item = data[id];\n var itemField = item[field];\n\n if (itemField != null && (minField == null || itemField < minField)) {\n min = item;\n minField = itemField;\n }\n }\n\n return min;\n }\n /**\r\n * Find all distinct values of a specified field\r\n *\r\n * @param prop - The property name whose distinct values should be returned.\r\n *\r\n * @returns Unordered array containing all distinct values. Items without specified property are ignored.\r\n */\n\n }, {\n key: \"distinct\",\n value: function distinct(prop) {\n var data = this._data;\n var itemIds = Object.keys(data);\n var values = [];\n var fieldType = this._options.type && this._options.type[prop] || null;\n var count = 0;\n\n for (var i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n var item = data[id];\n var value = item[prop];\n var exists = false;\n\n for (var j = 0; j < count; j++) {\n if (values[j] == value) {\n exists = true;\n break;\n }\n }\n\n if (!exists && value !== undefined) {\n values[count] = value;\n count++;\n }\n }\n\n if (fieldType) {\n for (var _i10 = 0, _len10 = values.length; _i10 < _len10; _i10++) {\n values[_i10] = convert(values[_i10], fieldType);\n }\n }\n\n return values;\n }\n /**\r\n * Add a single item. Will fail when an item with the same id already exists.\r\n *\r\n * @param item - A new item to be added.\r\n *\r\n * @returns Added item's id. An id is generated when it is not present in the item.\r\n */\n\n }, {\n key: \"_addItem\",\n value: function _addItem(item) {\n var id = item[this._idProp];\n\n if (id != null) {\n // check whether this id is already taken\n if (this._data[id]) {\n // item already exists\n throw new Error('Cannot add item: item with id ' + id + ' already exists');\n }\n } else {\n // generate an id\n id = uuid4();\n item[this._idProp] = id;\n }\n\n var d = {};\n var fields = Object.keys(item);\n\n for (var i = 0, len = fields.length; i < len; i++) {\n var field = fields[i];\n var fieldType = this._type[field]; // type may be undefined\n\n d[field] = convert(item[field], fieldType);\n }\n\n this._data[id] = d;\n this.length++;\n return id;\n }\n /**\r\n * Get an item. Fields can be converted to a specific type\r\n *\r\n * @param id - Id of the requested item.\r\n * @param types - Property name to type name object map of type converstions.\r\n *\r\n * @returns The item, optionally after type conversion.\r\n */\n\n }, {\n key: \"_getItem\",\n value: function _getItem(id, types) {\n // @TODO: I have no idea how to type this.\n // get the item from the dataset\n var raw = this._data[id];\n\n if (!raw) {\n return null;\n } // convert the items field types\n\n\n var converted;\n var fields = Object.keys(raw);\n\n if (types) {\n converted = {};\n\n for (var i = 0, len = fields.length; i < len; i++) {\n var field = fields[i];\n var value = raw[field];\n converted[field] = convert(value, types[field]);\n }\n } else {\n // no field types specified, no converting needed\n converted = _objectSpread({}, raw);\n }\n\n if (converted[this._idProp] == null) {\n converted[this._idProp] = raw.id;\n }\n\n return converted;\n }\n /**\r\n * Update a single item: merge with existing item.\r\n * Will fail when the item has no id, or when there does not exist an item with the same id.\r\n *\r\n * @param item - The new item\r\n *\r\n * @returns The id of the updated item.\r\n */\n\n }, {\n key: \"_updateItem\",\n value: function _updateItem(item) {\n var id = item[this._idProp];\n\n if (id == null) {\n throw new Error('Cannot update item: item has no id (item: ' + JSON.stringify(item) + ')');\n }\n\n var d = this._data[id];\n\n if (!d) {\n // item doesn't exist\n throw new Error('Cannot update item: no item with id ' + id + ' found');\n } // merge with current item\n\n\n var fields = Object.keys(item);\n\n for (var i = 0, len = fields.length; i < len; i++) {\n var field = fields[i];\n var fieldType = this._type[field] // type may be undefined\n ;\n d[field] = convert(item[field], fieldType);\n }\n\n return id;\n }\n }]);\n\n return DataSet;\n}(DataSetPart);\n\n/**\r\n * DataView\r\n *\r\n * A DataView offers a filtered and/or formatted view on a DataSet. One can subscribe to changes in a DataView, and easily get filtered or formatted data without having to specify filters and field types all the time.\r\n *\r\n * ## Example\r\n * ```javascript\r\n * // create a DataSet\r\n * var data = new vis.DataSet();\r\n * data.add([\r\n * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},\r\n * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},\r\n * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},\r\n * {id: 4, text: 'item 4'}\r\n * ]);\r\n *\r\n * // create a DataView\r\n * // the view will only contain items having a property group with value 1,\r\n * // and will only output fields id, text, and date.\r\n * var view = new vis.DataView(data, {\r\n * filter: function (item) {\r\n * return (item.group == 1);\r\n * },\r\n * fields: ['id', 'text', 'date']\r\n * });\r\n *\r\n * // subscribe to any change in the DataView\r\n * view.on('*', function (event, properties, senderId) {\r\n * console.log('event', event, properties);\r\n * });\r\n *\r\n * // update an item in the data set\r\n * data.update({id: 2, group: 1});\r\n *\r\n * // get all ids in the view\r\n * var ids = view.getIds();\r\n * console.log('ids', ids); // will output [1, 2]\r\n *\r\n * // get all items in the view\r\n * var items = view.get();\r\n * ```\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n */\n\nvar DataView =\n/*#__PURE__*/\nfunction (_DataSetPart) {\n inherits(DataView, _DataSetPart);\n\n /**\r\n * Create a DataView.\r\n *\r\n * @param data - The instance containing data (directly or indirectly).\r\n * @param options - Options to configure this data view.\r\n */\n function DataView(data, options) {\n var _this;\n\n classCallCheck(this, DataView);\n\n _this = possibleConstructorReturn(this, getPrototypeOf(DataView).call(this));\n /** @inheritdoc */\n\n _this.length = 0;\n _this._ids = {}; // ids of the items currently in memory (just contains a boolean true)\n\n _this._options = options || {};\n _this.listener = _this._onEvent.bind(assertThisInitialized(_this));\n\n _this.setData(data);\n\n return _this;\n } // TODO: implement a function .config() to dynamically update things like configured filter\n // and trigger changes accordingly\n\n /**\r\n * Set a data source for the view.\r\n *\r\n * @param data - The instance containing data (directly or indirectly).\r\n */\n\n\n createClass(DataView, [{\n key: \"setData\",\n value: function setData(data) {\n if (this._data) {\n // unsubscribe from current dataset\n if (this._data.off) {\n this._data.off('*', this.listener);\n } // trigger a remove of all items in memory\n\n\n var ids = this._data.getIds({\n filter: this._options.filter\n });\n\n var items = this._data.get(ids);\n\n this._ids = {};\n this.length = 0;\n\n this._trigger('remove', {\n items: ids,\n oldData: items\n });\n }\n\n if (data != null) {\n this._data = data; // trigger an add of all added items\n\n var _ids = this._data.getIds({\n filter: this._options.filter\n });\n\n for (var i = 0, len = _ids.length; i < len; i++) {\n var id = _ids[i];\n this._ids[id] = true;\n }\n\n this.length = _ids.length;\n\n this._trigger('add', {\n items: _ids\n });\n } else {\n this._data = new DataSet();\n } // subscribe to new dataset\n\n\n if (this._data.on) {\n this._data.on('*', this.listener);\n }\n }\n /**\r\n * Refresh the DataView.\r\n * Useful when the DataView has a filter function containing a variable parameter.\r\n */\n\n }, {\n key: \"refresh\",\n value: function refresh() {\n var ids = this._data.getIds({\n filter: this._options.filter\n });\n\n var oldIds = Object.keys(this._ids);\n var newIds = {};\n var addedIds = [];\n var removedIds = [];\n var removedItems = []; // check for additions\n\n for (var i = 0, len = ids.length; i < len; i++) {\n var id = ids[i];\n newIds[id] = true;\n\n if (!this._ids[id]) {\n addedIds.push(id);\n this._ids[id] = true;\n }\n } // check for removals\n\n\n for (var _i = 0, _len = oldIds.length; _i < _len; _i++) {\n var _id = oldIds[_i];\n\n var item = this._data.get(_id);\n\n if (item == null) {\n // @TODO: Investigate.\n // Doesn't happen during tests or examples.\n // Is it really impossible or could it eventually happen?\n // How to handle it if it does? The types guarantee non-nullable items.\n console.error('If you see this, report it please.');\n } else if (!newIds[_id]) {\n removedIds.push(_id);\n removedItems.push(item);\n delete this._ids[_id];\n }\n }\n\n this.length += addedIds.length - removedIds.length; // trigger events\n\n if (addedIds.length) {\n this._trigger('add', {\n items: addedIds\n });\n }\n\n if (removedIds.length) {\n this._trigger('remove', {\n items: removedIds,\n oldData: removedItems\n });\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"get\",\n value: function get(first, second) {\n if (this._data == null) {\n return null;\n } // parse the arguments\n\n\n var ids = null;\n var options;\n\n if (isId(first) || Array.isArray(first)) {\n ids = first;\n options = second;\n } else {\n options = first;\n } // extend the options with the default options and provided options\n\n\n var viewOptions = Object.assign({}, this._options, options); // create a combined filter method when needed\n\n var thisFilter = this._options.filter;\n var optionsFilter = options && options.filter;\n\n if (thisFilter && optionsFilter) {\n viewOptions.filter = function (item) {\n return thisFilter(item) && optionsFilter(item);\n };\n }\n\n if (ids == null) {\n return this._data.get(viewOptions);\n } else {\n return this._data.get(ids, viewOptions);\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"getIds\",\n value: function getIds(options) {\n if (this._data.length) {\n var defaultFilter = this._options.filter;\n var optionsFilter = options != null ? options.filter : null;\n var filter;\n\n if (optionsFilter) {\n if (defaultFilter) {\n filter = function filter(item) {\n return defaultFilter(item) && optionsFilter(item);\n };\n } else {\n filter = optionsFilter;\n }\n } else {\n filter = defaultFilter;\n }\n\n return this._data.getIds({\n filter: filter,\n order: options && options.order\n });\n } else {\n return [];\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"forEach\",\n value: function forEach(callback, options) {\n if (this._data) {\n var defaultFilter = this._options.filter;\n var optionsFilter = options && options.filter;\n var filter;\n\n if (optionsFilter) {\n if (defaultFilter) {\n filter = function filter(item) {\n return defaultFilter(item) && optionsFilter(item);\n };\n } else {\n filter = optionsFilter;\n }\n } else {\n filter = defaultFilter;\n }\n\n this._data.forEach(callback, {\n filter: filter,\n order: options && options.order\n });\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"map\",\n value: function map(callback, options) {\n if (this._data) {\n var defaultFilter = this._options.filter;\n var optionsFilter = options && options.filter;\n var filter;\n\n if (optionsFilter) {\n if (defaultFilter) {\n filter = function filter(item) {\n return defaultFilter(item) && optionsFilter(item);\n };\n } else {\n filter = optionsFilter;\n }\n } else {\n filter = defaultFilter;\n }\n\n return this._data.map(callback, {\n filter: filter,\n order: options && options.order\n });\n } else {\n return [];\n }\n }\n /** @inheritdoc */\n\n }, {\n key: \"getDataSet\",\n value: function getDataSet() {\n return this._data.getDataSet();\n }\n /**\r\n * 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.\r\n *\r\n * @param event - The name of the event.\r\n * @param params - Parameters of the event.\r\n * @param senderId - Id supplied by the sender.\r\n */\n\n }, {\n key: \"_onEvent\",\n value: function _onEvent(event, params, senderId) {\n if (!params || !params.items || !this._data) {\n return;\n }\n\n var ids = params.items;\n var addedIds = [];\n var updatedIds = [];\n var removedIds = [];\n var oldItems = [];\n var updatedItems = [];\n var removedItems = [];\n\n switch (event) {\n case 'add':\n // filter the ids of the added items\n for (var i = 0, len = ids.length; i < len; i++) {\n var id = ids[i];\n var item = this.get(id);\n\n if (item) {\n this._ids[id] = true;\n addedIds.push(id);\n }\n }\n\n break;\n\n case 'update':\n // determine the event from the views viewpoint: an updated\n // item can be added, updated, or removed from this view.\n for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {\n var _id2 = ids[_i2];\n\n var _item = this.get(_id2);\n\n if (_item) {\n if (this._ids[_id2]) {\n updatedIds.push(_id2);\n updatedItems.push(params.data[_i2]);\n oldItems.push(params.oldData[_i2]);\n } else {\n this._ids[_id2] = true;\n addedIds.push(_id2);\n }\n } else {\n if (this._ids[_id2]) {\n delete this._ids[_id2];\n removedIds.push(_id2);\n removedItems.push(params.oldData[_i2]);\n }\n }\n }\n\n break;\n\n case 'remove':\n // filter the ids of the removed items\n for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) {\n var _id3 = ids[_i3];\n\n if (this._ids[_id3]) {\n delete this._ids[_id3];\n removedIds.push(_id3);\n removedItems.push(params.oldData[_i3]);\n }\n }\n\n break;\n }\n\n this.length += addedIds.length - removedIds.length;\n\n if (addedIds.length) {\n this._trigger('add', {\n items: addedIds\n }, senderId);\n }\n\n if (updatedIds.length) {\n this._trigger('update', {\n items: updatedIds,\n oldData: oldItems,\n data: updatedItems\n }, senderId);\n }\n\n if (removedIds.length) {\n this._trigger('remove', {\n items: removedIds,\n oldData: removedItems\n }, senderId);\n }\n }\n }]);\n\n return DataView;\n}(DataSetPart);\n\nvar index = {\n DataSet: DataSet,\n DataView: DataView,\n Queue: Queue\n};\n\nexport default index;\nexport { DataSet, DataView, Queue };\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","module.exports = {};\n","var O = 'object';\nvar check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == O && globalThis) ||\n check(typeof window == O && window) ||\n check(typeof self == O && self) ||\n check(typeof global == O && global) ||\n // eslint-disable-next-line no-new-func\n Function('return this')();\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var global = require('../internals/global');\nvar hide = require('../internals/hide');\n\nmodule.exports = function (key, value) {\n try {\n hide(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\nvar IS_PURE = require('../internals/is-pure');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.2.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n","var shared = require('../internals/shared');\n\nmodule.exports = shared('native-function-to-string', Function.toString);\n","var global = require('../internals/global');\nvar nativeFunctionToString = require('../internals/function-to-string');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap));\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","module.exports = {};\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar hide = require('../internals/hide');\nvar objectHas = require('../internals/has');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = new WeakMap();\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n hide(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","module.exports = {};\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/bind-context');\nvar hide = require('../internals/hide');\nvar has = require('../internals/has');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof NativeConstructor) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return NativeConstructor.apply(this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n hide(resultProperty, 'sham', true);\n }\n\n target[key] = resultProperty;\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!has(path, VIRTUAL_PROTOTYPE)) hide(path, VIRTUAL_PROTOTYPE, {});\n // export virtual prototype methods\n path[VIRTUAL_PROTOTYPE][key] = sourceProperty;\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) hide(targetPrototype, key, sourceProperty);\n }\n }\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nvar Symbol = global.Symbol;\nvar store = shared('wks');\n\nmodule.exports = function (name) {\n return store[name] || (store[name] = NATIVE_SYMBOL && Symbol[name]\n || (NATIVE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar hide = require('../internals/hide');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar PROTOTYPE = 'prototype';\nvar Empty = function () { /* empty */ };\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var length = enumBugKeys.length;\n var lt = '<';\n var script = 'script';\n var gt = '>';\n var js = 'java' + script + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n iframe.src = String(js);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];\n return createDict();\n};\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n\nhiddenKeys[IE_PROTO] = true;\n","var classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","'use strict';\nvar classof = require('../internals/classof');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = String(test) !== '[object z]' ? function toString() {\n return '[object ' + classof(this) + ']';\n} : test.toString;\n","var defineProperty = require('../internals/object-define-property').f;\nvar hide = require('../internals/hide');\nvar has = require('../internals/has');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar METHOD_REQUIRED = toString !== ({}).toString;\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!has(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && METHOD_REQUIRED) hide(target, 'toString', toString);\n }\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var hide = require('../internals/hide');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else hide(target, key, value);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar hide = require('../internals/hide');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n hide(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n hide(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","require('./es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar hide = require('../internals/hide');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG]) {\n hide(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.github.io/ecma262/#sec-isarray\nmodule.exports = Array.isArray || function isArray(arg) {\n return classof(arg) == 'Array';\n};\n","var isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.github.io/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);\n};\n","var bind = require('../internals/bind-context');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = [].push;\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push.call(target, value); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6)\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !method || !fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.foreach\nmodule.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n} : [].forEach;\n","'use strict';\nvar $ = require('../internals/export');\nvar forEach = require('../internals/array-for-each');\n\n// `Array.prototype.forEach` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n$({ target: 'Array', proto: true, forced: [].forEach != forEach }, {\n forEach: forEach\n});\n","var path = require('../internals/path');\n\nmodule.exports = function (CONSTRUCTOR) {\n return path[CONSTRUCTOR + 'Prototype'];\n};\n","require('../../../modules/es.array.for-each');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').forEach;\n","module.exports = require('../../../es/array/virtual/for-each');\n","require('../../modules/web.dom-collections.iterator');\nvar forEach = require('../array/virtual/for-each');\nvar classof = require('../../internals/classof');\nvar ArrayPrototype = Array.prototype;\n\nvar DOMIterables = {\n DOMTokenList: true,\n NodeList: true\n};\n\nmodule.exports = function (it) {\n var own = it.forEach;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach)\n // eslint-disable-next-line no-prototype-builtins\n || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/for-each\");","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n return !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\n// `Array.prototype.filter` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.filter');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').filter;\n","var filter = require('../array/virtual/filter');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.filter;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filter) ? filter : own;\n};\n","module.exports = require('../../es/instance/filter');\n","module.exports = require(\"core-js-pure/stable/instance/filter\");","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\nvar userAgent = require('../internals/user-agent');\n\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\n\nvar wrap = function (scheduler) {\n return function (handler, timeout /* , ...arguments */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : undefined;\n return scheduler(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);\n } : handler, timeout);\n };\n};\n\n// ie9- setTimeout & setInterval additional parameters fix\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers\n$({ global: true, bind: true, forced: MSIE }, {\n // `setTimeout` method\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\n setTimeout: wrap(global.setTimeout),\n // `setInterval` method\n // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\n setInterval: wrap(global.setInterval)\n});\n","require('../modules/web.timers');\n\nmodule.exports = require('../internals/path').setTimeout;\n","module.exports = require(\"core-js-pure/stable/set-timeout\");","'use strict';\nvar aFunction = require('../internals/a-function');\nvar isObject = require('../internals/is-object');\n\nvar slice = [].slice;\nvar factories = {};\n\nvar construct = function (C, argsLength, args) {\n if (!(argsLength in factories)) {\n for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');\n } return factories[argsLength](C, args);\n};\n\n// `Function.prototype.bind` method implementation\n// https://tc39.github.io/ecma262/#sec-function.prototype.bind\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = slice.call(arguments, 1);\n var boundFunction = function bound(/* args... */) {\n var args = partArgs.concat(slice.call(arguments));\n return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);\n };\n if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;\n return boundFunction;\n};\n","var $ = require('../internals/export');\nvar bind = require('../internals/function-bind');\n\n// `Function.prototype.bind` method\n// https://tc39.github.io/ecma262/#sec-function.prototype.bind\n$({ target: 'Function', proto: true }, {\n bind: bind\n});\n","require('../../../modules/es.function.bind');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Function').bind;\n","var bind = require('../function/virtual/bind');\n\nvar FunctionPrototype = Function.prototype;\n\nmodule.exports = function (it) {\n var own = it.bind;\n return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own;\n};\n","module.exports = require('../../es/instance/bind');\n","module.exports = require(\"core-js-pure/stable/instance/bind\");","var $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\n\n// `Array.isArray` method\n// https://tc39.github.io/ecma262/#sec-array.isarray\n$({ target: 'Array', stat: true }, {\n isArray: isArray\n});\n","require('../../modules/es.array.is-array');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Array.isArray;\n","module.exports = require('../../es/array/is-array');\n","module.exports = require(\"core-js-pure/stable/array/is-array\");","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar objectDefinePropertyModile = require('../internals/object-define-property');\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\n$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {\n defineProperty: objectDefinePropertyModile.f\n});\n","require('../../modules/es.object.define-property');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n","module.exports = require('../../es/object/define-property');\n","module.exports = require(\"core-js-pure/features/object/define-property\");","var _Object$defineProperty = require(\"../core-js/object/define-property\");\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n\n _Object$defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","exports.f = require('../internals/well-known-symbol');\n","var path = require('../internals/path');\nvar has = require('../internals/has');\nvar wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","require('../../modules/es.symbol.iterator');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nvar WrappedWellKnownSymbolModule = require('../../internals/wrapped-well-known-symbol');\n\nmodule.exports = WrappedWellKnownSymbolModule.f('iterator');\n","module.exports = require('../../es/symbol/iterator');\n","module.exports = require(\"core-js-pure/features/symbol/iterator\");","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPrimitive(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\n\nvar IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, forced: FORCED }, {\n concat: function concat(arg) { // eslint-disable-line no-unused-vars\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = toLength(E.length);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertynames\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names').f;\n\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return nativeGetOwnPropertyNames(it);\n } catch (error) {\n return windowNames.slice();\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]'\n ? getWindowNames(it)\n : nativeGetOwnPropertyNames(toIndexedObject(it));\n};\n","exports.f = Object.getOwnPropertySymbols;\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar hide = require('../internals/hide');\nvar redefine = require('../internals/redefine');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol');\nvar defineWellKnownSymbol = require('../internals/define-well-known-symbol');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar JSON = global.JSON;\nvar nativeJSONStringify = JSON && JSON.stringify;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\nvar WellKnownSymbolsStore = shared('wks');\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar isSymbol = NATIVE_SYMBOL && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return Object(it) instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPrimitive(P, true);\n anObject(Attributes);\n if (has(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPrimitive(V, true);\n var enumerable = nativePropertyIsEnumerable.call(this, P);\n if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPrimitive(P, true);\n if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {\n result.push(AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.github.io/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n nativeDefineProperty($Symbol[PROTOTYPE], 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n}\n\n$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n // `Symbol.for` method\n // https://tc39.github.io/ecma262/#sec-symbol.for\n 'for': function (key) {\n var string = String(key);\n if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = $Symbol(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n },\n // `Symbol.keyFor` method\n // https://tc39.github.io/ecma262/#sec-symbol.keyfor\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');\n if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n },\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.github.io/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.github.io/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.github.io/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames,\n // `Object.getOwnPropertySymbols` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\n$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return getOwnPropertySymbolsModule.f(toObject(it));\n }\n});\n\n// `JSON.stringify` method behavior with symbols\n// https://tc39.github.io/ecma262/#sec-json.stringify\nJSON && $({ target: 'JSON', stat: true, forced: !NATIVE_SYMBOL || fails(function () {\n var symbol = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n return nativeJSONStringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || nativeJSONStringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || nativeJSONStringify(Object(symbol)) != '{}';\n}) }, {\n stringify: function stringify(it) {\n var args = [it];\n var index = 1;\n var replacer, $replacer;\n while (arguments.length > index) args.push(arguments[index++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return nativeJSONStringify.apply(JSON, args);\n }\n});\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive\nif (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.hasInstance` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.hasinstance\ndefineWellKnownSymbol('hasInstance');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.isConcatSpreadable` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable\ndefineWellKnownSymbol('isConcatSpreadable');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.match` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.match\ndefineWellKnownSymbol('match');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.matchAll` well-known symbol\ndefineWellKnownSymbol('matchAll');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.replace` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.replace\ndefineWellKnownSymbol('replace');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.search` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.search\ndefineWellKnownSymbol('search');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.species` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.species\ndefineWellKnownSymbol('species');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.split` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.split\ndefineWellKnownSymbol('split');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.toPrimitive` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.toprimitive\ndefineWellKnownSymbol('toPrimitive');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.unscopables` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.unscopables\ndefineWellKnownSymbol('unscopables');\n","var setToStringTag = require('../internals/set-to-string-tag');\n\n// Math[@@toStringTag] property\n// https://tc39.github.io/ecma262/#sec-math-@@tostringtag\nsetToStringTag(Math, 'Math', true);\n","var global = require('../internals/global');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.github.io/ecma262/#sec-json-@@tostringtag\nsetToStringTag(global.JSON, 'JSON', true);\n","require('../../modules/es.array.concat');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.symbol');\nrequire('../../modules/es.symbol.async-iterator');\nrequire('../../modules/es.symbol.description');\nrequire('../../modules/es.symbol.has-instance');\nrequire('../../modules/es.symbol.is-concat-spreadable');\nrequire('../../modules/es.symbol.iterator');\nrequire('../../modules/es.symbol.match');\nrequire('../../modules/es.symbol.match-all');\nrequire('../../modules/es.symbol.replace');\nrequire('../../modules/es.symbol.search');\nrequire('../../modules/es.symbol.species');\nrequire('../../modules/es.symbol.split');\nrequire('../../modules/es.symbol.to-primitive');\nrequire('../../modules/es.symbol.to-string-tag');\nrequire('../../modules/es.symbol.unscopables');\nrequire('../../modules/es.math.to-string-tag');\nrequire('../../modules/es.json.to-string-tag');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Symbol;\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.asyncDispose` well-known symbol\n// https://github.com/tc39/proposal-using-statement\ndefineWellKnownSymbol('asyncDispose');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.dispose` well-known symbol\n// https://github.com/tc39/proposal-using-statement\ndefineWellKnownSymbol('dispose');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.observable` well-known symbol\n// https://github.com/tc39/proposal-observable\ndefineWellKnownSymbol('observable');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.patternMatch` well-known symbol\n// https://github.com/tc39/proposal-pattern-matching\ndefineWellKnownSymbol('patternMatch');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.replaceAll` well-known symbol\n// https://tc39.github.io/proposal-string-replaceall/\ndefineWellKnownSymbol('replaceAll');\n","module.exports = require('../../es/symbol');\n\nrequire('../../modules/esnext.symbol.async-dispose');\nrequire('../../modules/esnext.symbol.dispose');\nrequire('../../modules/esnext.symbol.observable');\nrequire('../../modules/esnext.symbol.pattern-match');\nrequire('../../modules/esnext.symbol.replace-all');\n","module.exports = require(\"core-js-pure/features/symbol\");","var _Symbol$iterator = require(\"../core-js/symbol/iterator\");\n\nvar _Symbol = require(\"../core-js/symbol\");\n\nfunction _typeof(obj) {\n if (typeof _Symbol === \"function\" && typeof _Symbol$iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof _Symbol === \"function\" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","require('../../modules/es.object.get-prototype-of');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.getPrototypeOf;\n","module.exports = require('../../es/object/get-prototype-of');\n","module.exports = require(\"core-js-pure/features/object/get-prototype-of\");","var $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n","require('../../modules/es.object.set-prototype-of');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.setPrototypeOf;\n","module.exports = require('../../es/object/set-prototype-of');\n","module.exports = require(\"core-js-pure/features/object/set-prototype-of\");","var _Object$getPrototypeOf = require(\"../core-js/object/get-prototype-of\");\n\nvar _Object$setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nfunction _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _Object$getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || _Object$getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar create = require('../internals/object-create');\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n create: create\n});\n","require('../../modules/es.object.create');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nmodule.exports = function create(P, D) {\n return Object.create(P, D);\n};\n","module.exports = require('../../es/object/create');\n","module.exports = require(\"core-js-pure/features/object/create\");","var _Object$setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nfunction _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = _Object$setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var _Object$create = require(\"../core-js/object/create\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = _Object$create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","//! moment.js\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks () {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback (callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return (Object.getOwnPropertyNames(obj).length === 0);\n } else {\n var k;\n for (k in obj) {\n if (obj.hasOwnProperty(k)) {\n return false;\n }\n }\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null,\n rfc2822 : false,\n weekdayMismatch : false\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n }\n else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid (flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false;\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n }\n\n function absFloor (number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false &&\n (typeof console !== 'undefined') && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [];\n var arg;\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n function set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' + (/\\d{1,2}/).source);\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig), prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i, res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n };\n\n function calendar (key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate () {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal (number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n ss : '%d seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n };\n\n function relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (isFunction(output)) ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n }\n\n function pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [];\n for (var u in unitsObj) {\n units.push({unit: u, priority: priorities[u]});\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n 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;\n\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n var formatFunctions = {};\n\n var formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '', i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n var match2 = /\\d\\d/; // 00 - 99\n var match3 = /\\d{3}/; // 000 - 999\n var match4 = /\\d{4}/; // 0000 - 9999\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n var match1to2 = /\\d\\d?/; // 0 - 99\n var match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\n var match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\n var match1to3 = /\\d{1,3}/; // 0 - 999\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n var matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n var matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i;\n\n var regexes = {};\n\n function addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n var WEEK = 7;\n var WEEKDAY = 8;\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PRIORITIES\n\n addUnitPriority('year', 1);\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear () {\n return isLeapYear(this.year());\n }\n\n function makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get (mom, unit) {\n return mom.isValid() ?\n mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n }\n\n function set$1 (mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));\n }\n else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n }\n\n // MOMENTS\n\n function stringGet (units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n\n function stringSet (units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n function mod(n, x) {\n return ((n % x) + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PRIORITY\n\n addUnitPriority('month', 8);\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n function localeMonths (m, format) {\n if (!m) {\n return isArray(this._months) ? this._months :\n this._months['standalone'];\n }\n return isArray(this._months) ? this._months[m.month()] :\n this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n function localeMonthsShort (m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort :\n this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] :\n this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i, ii, mom, llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth (mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n }\n\n var defaultMonthsShortRegex = matchWord;\n function monthsShortRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n\n var defaultMonthsRegex = matchWord;\n function monthsRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n }\n\n function computeMonthsParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n\n function createDate (y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate (y) {\n var date;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n var args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear, resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek, resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 6th is the first week of the year.\n };\n\n function localeFirstDayOfWeek () {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear () {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays (ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n function localeWeekdays (m, format) {\n var weekdays = isArray(this._weekdays) ? this._weekdays :\n this._weekdays[(m && m !== true && this._weekdays.isFormat.test(format)) ? 'format' : 'standalone'];\n return (m === true) ? shiftWeekdays(weekdays, this._week.dow)\n : (m) ? weekdays[m.day()] : weekdays;\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n function localeWeekdaysShort (m) {\n return (m === true) ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n : (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n function localeWeekdaysMin (m) {\n return (m === true) ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n : (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i, ii, mom, llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse (weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n var defaultWeekdaysRegex = matchWord;\n function weekdaysRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n var defaultWeekdaysShortRegex = matchWord;\n function weekdaysShortRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n var defaultWeekdaysMinRegex = matchWord;\n function weekdaysMinRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n\n function computeWeekdaysParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom, minp, shortp, longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n function meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PRIORITY\n addUnitPriority('hour', 13);\n\n // PARSING\n\n function matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n function localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n\n // MOMENTS\n\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n var getSetHour = makeGetSet('Hours', true);\n\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse\n };\n\n // internal storage for locale config files\n var locales = {};\n var localeFamilies = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n\n function loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n var aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {}\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale (name, config) {\n if (config !== null) {\n var locale, parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale, tmpLocale, parentConfig = baseConfig;\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray (config) {\n var i, date, input = [], currentDate, expectedWeekday, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n var curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // iso 8601 regex\n // 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)\n 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)?)?$/;\n 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)?)?$/;\n\n var tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\n var isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/]\n ];\n\n // iso time formats and regexes\n var isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n ];\n\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n // date from iso format\n function configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;\n\n function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n var result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10)\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s.replace(/\\([^)]*\\)|[\\n\\t]/g, ' ').replace(/(\\s\\s+)/g, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n\n var obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60\n };\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10);\n var m = hm % 100, h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i));\n if (match) {\n var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from iso format or fallback\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged and will be removed in an upcoming major release. Please refer to ' +\n 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n\n function meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n\n configFromArray(config);\n }\n\n function createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if ((isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n var prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +(new Date());\n };\n\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n\n function isDurationValid(m) {\n for (var key in m) {\n if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n\n var unitHasDecimal = false;\n for (var i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration (obj) {\n return obj instanceof Duration;\n }\n\n function absRound (number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // FORMATTING\n\n function offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ?\n 0 :\n parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset (input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset () {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n }\n else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset (input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted () {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal () {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset () {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc () {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/;\n\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n 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)?)?$/;\n\n function createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n w : parseIso(match[4], sign),\n d : parseIso(match[5], sign),\n h : parseIso(match[6], sign),\n m : parseIso(match[7], sign),\n s : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {milliseconds: 0, months: 0};\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add');\n var subtract = createAdder(-1, 'subtract');\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n }\n\n function calendar$1 (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n\n function clone () {\n return new Moment(this);\n }\n\n function isAfter (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween (from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) &&\n (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));\n }\n\n function isSame (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n\n function isSameOrAfter (input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore (input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff (input, units, asFloat) {\n var that,\n zoneDelta,\n output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year': output = monthDiff(this, that) / 12; break;\n case 'month': output = monthDiff(this, that); break;\n case 'quarter': output = monthDiff(this, that) / 3; break;\n case 'second': output = (this - that) / 1e3; break; // 1000\n case 'minute': output = (this - that) / 6e4; break; // 1000 * 60\n case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60\n case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst\n case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst\n default: output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true;\n var m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format (inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow (withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow (withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData () {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000;\n var MS_PER_MINUTE = 60 * MS_PER_SECOND;\n var MS_PER_HOUR = 60 * MS_PER_MINUTE;\n var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf (units) {\n var time;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3, 1);\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday());\n break;\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf (units) {\n var time;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;\n break;\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf () {\n return this._d.valueOf() - ((this._offset || 0) * 60000);\n }\n\n function unix () {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate () {\n return new Date(this.valueOf());\n }\n\n function toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function toJSON () {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2 () {\n return isValid(this);\n }\n\n function parsingFlags () {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt () {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy);\n }\n\n function getSetISOWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n\n function getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PRIORITY\n\n addUnitPriority('quarter', 7);\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PRIORITY\n addUnitPriority('date', 9);\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ?\n (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :\n locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PRIORITY\n\n addUnitPriority('minute', 14);\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PRIORITY\n\n addUnitPriority('second', 15);\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n // MOMENTS\n\n var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\n function createUnix (input) {\n return createLocal(input * 1000);\n }\n\n function createInZone () {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat (string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1 (format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl (format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths (format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort (format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n });\n\n // Side effect imports\n\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n\n var mathAbs = Math.abs;\n\n function abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1 (duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as (units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month': return months;\n case 'quarter': return months / 3;\n case 'year': return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function valueOf$1 () {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asQuarters = makeAs('Q');\n var asYears = makeAs('y');\n\n function clone$1 () {\n return createDuration(this);\n }\n\n function get$2 (units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks () {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n ss: 44, // a few seconds to seconds\n s : 45, // seconds to minute\n m : 45, // minutes to hour\n h : 22, // hours to day\n d : 26, // days to month\n M : 11 // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1 (posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds <= thresholds.ss && ['s', seconds] ||\n seconds < thresholds.s && ['ss', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize (withSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return ((x > 0) - (x < 0)) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n var totalSign = total < 0 ? '-' : '';\n var ymSign = sign(this._months) !== sign(total) ? '-' : '';\n var daysSign = sign(this._days) !== sign(total) ? '-' : '';\n var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n return totalSign + 'P' +\n (Y ? ymSign + Y + 'Y' : '') +\n (M ? ymSign + M + 'M' : '') +\n (D ? daysSign + D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? hmsSign + h + 'H' : '') +\n (m ? hmsSign + m + 'M' : '') +\n (s ? hmsSign + s + 'S' : '');\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang;\n\n // Side effect imports\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n // Side effect imports\n\n\n hooks.version = '2.24.0';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // \n DATE: 'YYYY-MM-DD', // \n TIME: 'HH:mm', // \n TIME_SECONDS: 'HH:mm:ss', // \n TIME_MS: 'HH:mm:ss.SSS', // \n WEEK: 'GGGG-[W]WW', // \n MONTH: 'YYYY-MM' // \n };\n\n return hooks;\n\n})));\n","// first check if moment.js is already loaded in the browser window, if so,\n// use this instance. Else, load via commonjs.\nmodule.exports = (typeof window !== 'undefined') && window['moment'] || require('moment');","module.exports = require('../../es/object/define-property');\n","module.exports = require(\"core-js-pure/stable/object/define-property\");","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperties = require('../internals/object-define-properties');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\n$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {\n defineProperties: defineProperties\n});\n","require('../../modules/es.object.define-properties');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperties = module.exports = function defineProperties(T, D) {\n return Object.defineProperties(T, D);\n};\n\nif (Object.defineProperties.sham) defineProperties.sham = true;\n","module.exports = require('../../es/object/define-properties');\n","module.exports = require(\"core-js-pure/stable/object/define-properties\");","var getBuiltIn = require('../internals/get-built-in');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;\n};\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar ownKeys = require('../internals/own-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar createProperty = require('../internals/create-property');\n\n// `Object.getOwnPropertyDescriptors` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIndexedObject(object);\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n var keys = ownKeys(O);\n var result = {};\n var index = 0;\n var key, descriptor;\n while (keys.length > index) {\n descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);\n if (descriptor !== undefined) createProperty(result, key, descriptor);\n }\n return result;\n }\n});\n","require('../../modules/es.object.get-own-property-descriptors');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.getOwnPropertyDescriptors;\n","module.exports = require('../../es/object/get-own-property-descriptors');\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-descriptors\");","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });\nvar FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\n$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {\n return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);\n }\n});\n","require('../../modules/es.object.get-own-property-descriptor');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {\n return Object.getOwnPropertyDescriptor(it, key);\n};\n\nif (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;\n","module.exports = require('../../es/object/get-own-property-descriptor');\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-descriptor\");","require('../../modules/es.symbol');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.getOwnPropertySymbols;\n","module.exports = require('../../es/object/get-own-property-symbols');\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-symbols\");","var $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar nativeKeys = require('../internals/object-keys');\nvar fails = require('../internals/fails');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n","require('../../modules/es.object.keys');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.keys;\n","module.exports = require('../../es/object/keys');\n","module.exports = require(\"core-js-pure/stable/object/keys\");","var _Object$defineProperty = require(\"../core-js/object/define-property\");\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n _Object$defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","// utility functions\n\nexport * from \"vis-util\";\nimport * as util from \"vis-util\";\nimport { getType, isNumber, isString } from \"vis-util\";\n\nimport moment from \"moment\";\n\n// parse ASP.Net Date pattern,\n// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'\n// code from http://momentjs.com/\nconst ASPDateRegex = /^\\/?Date\\((-?\\d+)/i;\n\n/**\n * Convert an object into another type\n *\n * @param object - Value of unknown type.\n * @param type - Name of the desired type.\n *\n * @returns Object in the desired type.\n * @throws Error\n */\nexport function convert(object, type) {\n let match;\n\n if (object === undefined) {\n return undefined;\n }\n if (object === null) {\n return null;\n }\n\n if (!type) {\n return object;\n }\n if (!(typeof type === \"string\") && !(type instanceof String)) {\n throw new Error(\"Type must be a string\");\n }\n\n //noinspection FallthroughInSwitchStatementJS\n switch (type) {\n case \"boolean\":\n case \"Boolean\":\n return Boolean(object);\n\n case \"number\":\n case \"Number\":\n if (isString(object) && !isNaN(Date.parse(object))) {\n return moment(object).valueOf();\n } else {\n // @TODO: I don't think that Number and String constructors are a good idea.\n // This could also fail if the object doesn't have valueOf method or if it's redefined.\n // For example: Object.create(null) or { valueOf: 7 }.\n return Number(object.valueOf());\n }\n case \"string\":\n case \"String\":\n return String(object);\n\n case \"Date\":\n if (isNumber(object)) {\n return new Date(object);\n }\n if (object instanceof Date) {\n return new Date(object.valueOf());\n } else if (moment.isMoment(object)) {\n return new Date(object.valueOf());\n }\n if (isString(object)) {\n match = ASPDateRegex.exec(object);\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])); // parse number\n } else {\n return moment(new Date(object)).toDate(); // parse string\n }\n } else {\n throw new Error(\n \"Cannot convert object of type \" + getType(object) + \" to type Date\"\n );\n }\n\n case \"Moment\":\n if (isNumber(object)) {\n return moment(object);\n }\n if (object instanceof Date) {\n return moment(object.valueOf());\n } else if (moment.isMoment(object)) {\n return moment(object);\n }\n if (isString(object)) {\n match = ASPDateRegex.exec(object);\n if (match) {\n // object is an ASP date\n return moment(Number(match[1])); // parse number\n } else {\n return moment(object); // parse string\n }\n } else {\n throw new Error(\n \"Cannot convert object of type \" + getType(object) + \" to type Date\"\n );\n }\n\n case \"ISODate\":\n if (isNumber(object)) {\n return new Date(object);\n } else if (object instanceof Date) {\n return object.toISOString();\n } else if (moment.isMoment(object)) {\n return object.toDate().toISOString();\n } else if (isString(object)) {\n match = ASPDateRegex.exec(object);\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])).toISOString(); // parse number\n } else {\n return moment(object).format(); // ISO 8601\n }\n } else {\n throw new Error(\n \"Cannot convert object of type \" +\n getType(object) +\n \" to type ISODate\"\n );\n }\n\n case \"ASPDate\":\n if (isNumber(object)) {\n return \"/Date(\" + object + \")/\";\n } else if (object instanceof Date || moment.isMoment(object)) {\n return \"/Date(\" + object.valueOf() + \")/\";\n } else if (isString(object)) {\n match = ASPDateRegex.exec(object);\n let value;\n if (match) {\n // object is an ASP date\n value = new Date(Number(match[1])).valueOf(); // parse number\n } else {\n value = new Date(object).valueOf(); // parse string\n }\n return \"/Date(\" + value + \")/\";\n } else {\n throw new Error(\n \"Cannot convert object of type \" +\n getType(object) +\n \" to type ASPDate\"\n );\n }\n\n default:\n throw new Error(`Unknown type ${type}`);\n }\n}\n\nexport default {\n ...util,\n convert\n};\n","// a string of all valid unicode whitespaces\n// eslint-disable-next-line max-len\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var requireObjectCoercible = require('../internals/require-object-coercible');\nvar whitespaces = require('../internals/whitespaces');\n\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = String(requireObjectCoercible($this));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.github.io/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","var global = require('../internals/global');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar nativeParseFloat = global.parseFloat;\nvar FORCED = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity;\n\n// `parseFloat` method\n// https://tc39.github.io/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(String(string));\n var result = nativeParseFloat(trimmedString);\n return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;\n} : nativeParseFloat;\n","var $ = require('../internals/export');\nvar parseFloatImplementation = require('../internals/parse-float');\n\n// `parseFloat` method\n// https://tc39.github.io/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != parseFloatImplementation }, {\n parseFloat: parseFloatImplementation\n});\n","require('../modules/es.parse-float');\nvar path = require('../internals/path');\n\nmodule.exports = path.parseFloat;\n","module.exports = require('../es/parse-float');\n","module.exports = require(\"core-js-pure/stable/parse-float\");","var $ = require('../internals/export');\n\n// `Date.now` method\n// https://tc39.github.io/ecma262/#sec-date.now\n$({ target: 'Date', stat: true }, {\n now: function now() {\n return new Date().getTime();\n }\n});\n","require('../../modules/es.date.now');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Date.now;\n","module.exports = require('../../es/date/now');\n","module.exports = require(\"core-js-pure/stable/date/now\");","var core = require('../../internals/path');\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\n\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n","module.exports = require('../../es/json/stringify');\n","module.exports = require(\"core-js-pure/stable/json/stringify\");","require('../../../modules/es.array.concat');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').concat;\n","var concat = require('../array/virtual/concat');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.concat;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.concat) ? concat : own;\n};\n","module.exports = require('../../es/instance/concat');\n","module.exports = require(\"core-js-pure/stable/instance/concat\");","import util from '../../util';\n\n/** Prototype for visual components */\nexport default class Component {\n /**\n * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} [body]\n * @param {Object} [options]\n */\n constructor(body, options) { // eslint-disable-line no-unused-vars\n this.options = null;\n this.props = null;\n }\n\n /**\n * Set options for the component. The new options will be merged into the\n * current options.\n * @param {Object} options\n */\n setOptions(options) {\n if (options) {\n util.extend(this.options, options);\n }\n }\n\n /**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\n redraw() {\n // should be implemented by the component\n return false;\n }\n\n /**\n * Destroy the component. Cleanup DOM and event listeners\n */\n destroy() {\n // should be implemented by the component\n }\n\n /**\n * Test whether the component is resized since the last time _isResized() was\n * called.\n * @return {Boolean} Returns true if the component is resized\n * @protected\n */\n _isResized() {\n const resized = (\n this.props._previousWidth !== this.props.width ||\n this.props._previousHeight !== this.props.height\n );\n\n this.props._previousWidth = this.props.width;\n this.props._previousHeight = this.props.height;\n\n return resized;\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\nvar nativeSort = [].sort;\nvar test = [1, 2, 3];\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar SLOPPY_METHOD = sloppyArrayMethod('sort');\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD;\n\n// `Array.prototype.sort` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? nativeSort.call(toObject(this))\n : nativeSort.call(toObject(this), aFunction(comparefn));\n }\n});\n","require('../../../modules/es.array.sort');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').sort;\n","var sort = require('../array/virtual/sort');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.sort;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.sort) ? sort : own;\n};\n","module.exports = require('../../es/instance/sort');\n","module.exports = require(\"core-js-pure/stable/instance/sort\");","'use strict';\nvar toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.repeat` method implementation\n// https://tc39.github.io/ecma262/#sec-string.prototype.repeat\nmodule.exports = ''.repeat || function repeat(count) {\n var str = String(requireObjectCoercible(this));\n var result = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","var $ = require('../internals/export');\nvar repeat = require('../internals/string-repeat');\n\n// `String.prototype.repeat` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.repeat\n$({ target: 'String', proto: true }, {\n repeat: repeat\n});\n","require('../../../modules/es.string.repeat');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('String').repeat;\n","var repeat = require('../string/virtual/repeat');\n\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.repeat;\n return typeof it === 'string' || it === StringPrototype\n || (it instanceof String && own === StringPrototype.repeat) ? repeat : own;\n};\n","module.exports = require('../../es/instance/repeat');\n","module.exports = require(\"core-js-pure/stable/instance/repeat\");","\n/**\n * used in Core to convert the options into a volatile variable\n * \n * @param {function} moment\n * @param {Object} body\n * @param {Array | Object} hiddenDates\n * @returns {number}\n */\nexport function convertHiddenOptions(moment, body, hiddenDates) {\n if (hiddenDates && !Array.isArray(hiddenDates)) {\n return convertHiddenOptions(moment, body, [hiddenDates])\n }\n\n body.hiddenDates = [];\n if (hiddenDates) {\n if (Array.isArray(hiddenDates) == true) {\n for (let i = 0; i < hiddenDates.length; i++) {\n if (hiddenDates[i].repeat === undefined) {\n const dateItem = {};\n dateItem.start = moment(hiddenDates[i].start).toDate().valueOf();\n dateItem.end = moment(hiddenDates[i].end).toDate().valueOf();\n body.hiddenDates.push(dateItem);\n }\n }\n body.hiddenDates.sort((a, b) => a.start - b.start); // sort by start time\n }\n }\n}\n\n/**\n * create new entrees for the repeating hidden dates\n *\n * @param {function} moment\n * @param {Object} body\n * @param {Array | Object} hiddenDates\n * @returns {null}\n */\nexport function updateHiddenDates(moment, body, hiddenDates) {\n if (hiddenDates && !Array.isArray(hiddenDates)) {\n return updateHiddenDates(moment, body, [hiddenDates])\n }\n\n if (hiddenDates && body.domProps.centerContainer.width !== undefined) {\n convertHiddenOptions(moment, body, hiddenDates);\n\n const start = moment(body.range.start);\n const end = moment(body.range.end);\n\n const totalRange = (body.range.end - body.range.start);\n const pixelTime = totalRange / body.domProps.centerContainer.width;\n\n for (let i = 0; i < hiddenDates.length; i++) {\n if (hiddenDates[i].repeat !== undefined) {\n const startDate = moment(hiddenDates[i].start);\n let endDate = moment(hiddenDates[i].end);\n\n if (startDate._d == \"Invalid Date\") {\n throw new Error(`Supplied start date is not valid: ${hiddenDates[i].start}`);\n }\n if (endDate._d == \"Invalid Date\") {\n throw new Error(`Supplied end date is not valid: ${hiddenDates[i].end}`);\n }\n\n const duration = endDate - startDate;\n if (duration >= 4 * pixelTime) {\n\n let offset = 0;\n const runUntil = end.clone();\n switch (hiddenDates[i].repeat) {\n case \"daily\": // case of time\n if (startDate.day() != endDate.day()) {\n offset = 1;\n }\n startDate.dayOfYear(start.dayOfYear());\n startDate.year(start.year());\n startDate.subtract(7,'days');\n\n endDate.dayOfYear(start.dayOfYear());\n endDate.year(start.year());\n endDate.subtract(7 - offset,'days');\n\n runUntil.add(1, 'weeks');\n break;\n case \"weekly\": {\n const dayOffset = endDate.diff(startDate,'days');\n const day = startDate.day();\n\n // set the start date to the range.start\n startDate.date(start.date());\n startDate.month(start.month());\n startDate.year(start.year());\n endDate = startDate.clone();\n\n // force\n startDate.day(day);\n endDate.day(day);\n endDate.add(dayOffset,'days');\n\n startDate.subtract(1,'weeks');\n endDate.subtract(1,'weeks');\n\n runUntil.add(1, 'weeks');\n break;\n }\n case \"monthly\":\n if (startDate.month() != endDate.month()) {\n offset = 1;\n }\n startDate.month(start.month());\n startDate.year(start.year());\n startDate.subtract(1,'months');\n\n endDate.month(start.month());\n endDate.year(start.year());\n endDate.subtract(1,'months');\n endDate.add(offset,'months');\n\n runUntil.add(1, 'months');\n break;\n case \"yearly\":\n if (startDate.year() != endDate.year()) {\n offset = 1;\n }\n startDate.year(start.year());\n startDate.subtract(1,'years');\n endDate.year(start.year());\n endDate.subtract(1,'years');\n endDate.add(offset,'years');\n\n runUntil.add(1, 'years');\n break;\n default:\n console.log(\"Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:\", hiddenDates[i].repeat);\n return;\n }\n while (startDate < runUntil) {\n body.hiddenDates.push({start: startDate.valueOf(), end: endDate.valueOf()});\n switch (hiddenDates[i].repeat) {\n case \"daily\":\n startDate.add(1, 'days');\n endDate.add(1, 'days');\n break;\n case \"weekly\":\n startDate.add(1, 'weeks');\n endDate.add(1, 'weeks');\n break;\n case \"monthly\":\n startDate.add(1, 'months');\n endDate.add(1, 'months');\n break;\n case \"yearly\":\n startDate.add(1, 'y');\n endDate.add(1, 'y');\n break;\n default:\n console.log(\"Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:\", hiddenDates[i].repeat);\n return;\n }\n }\n body.hiddenDates.push({start: startDate.valueOf(), end: endDate.valueOf()});\n }\n }\n }\n // remove duplicates, merge where possible\n removeDuplicates(body);\n // ensure the new positions are not on hidden dates\n const startHidden = getIsHidden(body.range.start, body.hiddenDates);\n const endHidden = getIsHidden(body.range.end,body.hiddenDates);\n let rangeStart = body.range.start;\n let rangeEnd = body.range.end;\n if (startHidden.hidden == true) {rangeStart = body.range.startToFront == true ? startHidden.startDate - 1 : startHidden.endDate + 1;}\n if (endHidden.hidden == true) {rangeEnd = body.range.endToFront == true ? endHidden.startDate - 1 : endHidden.endDate + 1;}\n if (startHidden.hidden == true || endHidden.hidden == true) {\n body.range._applyRange(rangeStart, rangeEnd);\n }\n }\n\n}\n\n/**\n * remove duplicates from the hidden dates list. Duplicates are evil. They mess everything up.\n * Scales with N^2\n *\n * @param {Object} body\n */\nexport function removeDuplicates(body) {\n const hiddenDates = body.hiddenDates;\n const safeDates = [];\n for (var i = 0; i < hiddenDates.length; i++) {\n for (let j = 0; j < hiddenDates.length; j++) {\n if (i != j && hiddenDates[j].remove != true && hiddenDates[i].remove != true) {\n // j inside i\n if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {\n hiddenDates[j].remove = true;\n }\n // j start inside i\n else if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].start <= hiddenDates[i].end) {\n hiddenDates[i].end = hiddenDates[j].end;\n hiddenDates[j].remove = true;\n }\n // j end inside i\n else if (hiddenDates[j].end >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {\n hiddenDates[i].start = hiddenDates[j].start;\n hiddenDates[j].remove = true;\n }\n }\n }\n }\n\n for (i = 0; i < hiddenDates.length; i++) {\n if (hiddenDates[i].remove !== true) {\n safeDates.push(hiddenDates[i]);\n }\n }\n\n body.hiddenDates = safeDates;\n body.hiddenDates.sort((a, b) => a.start - b.start); // sort by start time\n}\n\n/**\n * Prints dates to console\n * @param {array} dates\n */\nexport function printDates(dates) {\n for (let i =0; i < dates.length; i++) {\n console.log(i, new Date(dates[i].start),new Date(dates[i].end), dates[i].start, dates[i].end, dates[i].remove);\n }\n}\n\n/**\n * Used in TimeStep to avoid the hidden times.\n * @param {function} moment\n * @param {TimeStep} timeStep\n * @param {Date} previousTime\n */\nexport function stepOverHiddenDates(moment, timeStep, previousTime) {\n let stepInHidden = false;\n const currentValue = timeStep.current.valueOf();\n for (let i = 0; i < timeStep.hiddenDates.length; i++) {\n const startDate = timeStep.hiddenDates[i].start;\n var endDate = timeStep.hiddenDates[i].end;\n if (currentValue >= startDate && currentValue < endDate) {\n stepInHidden = true;\n break;\n }\n }\n\n if (stepInHidden == true && currentValue < timeStep._end.valueOf() && currentValue != previousTime) {\n const prevValue = moment(previousTime);\n const newValue = moment(endDate);\n //check if the next step should be major\n if (prevValue.year() != newValue.year()) {timeStep.switchedYear = true;}\n else if (prevValue.month() != newValue.month()) {timeStep.switchedMonth = true;}\n else if (prevValue.dayOfYear() != newValue.dayOfYear()) {timeStep.switchedDay = true;}\n\n timeStep.current = newValue;\n }\n}\n\n///**\n// * Used in TimeStep to avoid the hidden times.\n// * @param timeStep\n// * @param previousTime\n// */\n//checkFirstStep = function(timeStep) {\n// var stepInHidden = false;\n// var currentValue = timeStep.current.valueOf();\n// for (var i = 0; i < timeStep.hiddenDates.length; i++) {\n// var startDate = timeStep.hiddenDates[i].start;\n// var endDate = timeStep.hiddenDates[i].end;\n// if (currentValue >= startDate && currentValue < endDate) {\n// stepInHidden = true;\n// break;\n// }\n// }\n//\n// if (stepInHidden == true && currentValue <= timeStep._end.valueOf()) {\n// var newValue = moment(endDate);\n// timeStep.current = newValue.toDate();\n// }\n//};\n\n/**\n * replaces the Core toScreen methods\n *\n * @param {timeline.Core} Core\n * @param {Date} time\n * @param {number} width\n * @returns {number}\n */\nexport function toScreen(Core, time, width) {\n let conversion;\n if (Core.body.hiddenDates.length == 0) {\n conversion = Core.range.conversion(width);\n return (time.valueOf() - conversion.offset) * conversion.scale;\n } else {\n const hidden = getIsHidden(time, Core.body.hiddenDates);\n if (hidden.hidden == true) {\n time = hidden.startDate;\n }\n\n const duration = getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);\n if (time < Core.range.start) {\n conversion = Core.range.conversion(width, duration);\n const hiddenBeforeStart = getHiddenDurationBeforeStart(Core.body.hiddenDates, time, conversion.offset);\n time = Core.options.moment(time).toDate().valueOf();\n time = time + hiddenBeforeStart;\n return -(conversion.offset - time.valueOf()) * conversion.scale;\n \n } else if (time > Core.range.end) {\n const rangeAfterEnd = {start: Core.range.start, end: time};\n time = correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, rangeAfterEnd, time);\n conversion = Core.range.conversion(width, duration);\n return (time.valueOf() - conversion.offset) * conversion.scale;\n\n } else {\n time = correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, Core.range, time);\n conversion = Core.range.conversion(width, duration);\n return (time.valueOf() - conversion.offset) * conversion.scale;\n }\n }\n }\n\n/**\n * Replaces the core toTime methods\n *\n * @param {timeline.Core} Core\n * @param {number} x\n * @param {number} width\n * @returns {Date}\n */\nexport function toTime(Core, x, width) {\n if (Core.body.hiddenDates.length == 0) {\n const conversion = Core.range.conversion(width);\n return new Date(x / conversion.scale + conversion.offset);\n }\n else {\n const hiddenDuration = getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);\n const totalDuration = Core.range.end - Core.range.start - hiddenDuration;\n const partialDuration = totalDuration * x / width;\n const accumulatedHiddenDuration = getAccumulatedHiddenDuration(Core.body.hiddenDates, Core.range, partialDuration);\n\n return new Date(accumulatedHiddenDuration + partialDuration + Core.range.start);\n }\n}\n\n/**\n * Support function\n *\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {number} start\n * @param {number} end\n * @returns {number}\n */\nexport function getHiddenDurationBetween(hiddenDates, start, end) {\n let duration = 0;\n for (let i = 0; i < hiddenDates.length; i++) {\n const startDate = hiddenDates[i].start;\n const endDate = hiddenDates[i].end;\n // if time after the cutout, and the\n if (startDate >= start && endDate < end) {\n duration += endDate - startDate;\n }\n }\n return duration;\n}\n\n/**\n * Support function\n *\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {number} start\n * @param {number} end\n * @returns {number}\n */\nexport function getHiddenDurationBeforeStart(hiddenDates, start, end) {\n let duration = 0;\n for (let i = 0; i < hiddenDates.length; i++) {\n const startDate = hiddenDates[i].start;\n const endDate = hiddenDates[i].end;\n\n if (startDate >= start && endDate <= end) {\n duration += endDate - startDate;\n }\n }\n return duration;\n}\n\n/**\n * Support function\n * @param {function} moment\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {{start: number, end: number}} range\n * @param {Date} time\n * @returns {number}\n */\nexport function correctTimeForHidden(moment, hiddenDates, range, time) {\n time = moment(time).toDate().valueOf();\n time -= getHiddenDurationBefore(moment, hiddenDates,range,time);\n return time;\n}\n\n/**\n * Support function\n * @param {function} moment\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {{start: number, end: number}} range\n * @param {Date} time\n * @returns {number}\n */\nexport function getHiddenDurationBefore(moment, hiddenDates, range, time) {\n let timeOffset = 0;\n time = moment(time).toDate().valueOf();\n\n for (let i = 0; i < hiddenDates.length; i++) {\n const startDate = hiddenDates[i].start;\n const endDate = hiddenDates[i].end;\n // if time after the cutout, and the\n if (startDate >= range.start && endDate < range.end) {\n if (time >= endDate) {\n timeOffset += (endDate - startDate);\n }\n }\n }\n return timeOffset;\n}\n\n/**\n * sum the duration from start to finish, including the hidden duration,\n * until the required amount has been reached, return the accumulated hidden duration\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {{start: number, end: number}} range\n * @param {number} [requiredDuration=0]\n * @returns {number}\n */\nexport function getAccumulatedHiddenDuration(hiddenDates, range, requiredDuration) {\n let hiddenDuration = 0;\n let duration = 0;\n let previousPoint = range.start;\n //printDates(hiddenDates)\n for (let i = 0; i < hiddenDates.length; i++) {\n const startDate = hiddenDates[i].start;\n const endDate = hiddenDates[i].end;\n // if time after the cutout, and the\n if (startDate >= range.start && endDate < range.end) {\n duration += startDate - previousPoint;\n previousPoint = endDate;\n if (duration >= requiredDuration) {\n break;\n }\n else {\n hiddenDuration += endDate - startDate;\n }\n }\n }\n\n return hiddenDuration;\n}\n\n/**\n * used to step over to either side of a hidden block. Correction is disabled on tablets, might be set to true\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {Date} time\n * @param {number} direction\n * @param {boolean} correctionEnabled\n * @returns {Date|number}\n */\nexport function snapAwayFromHidden(hiddenDates, time, direction, correctionEnabled) {\n const isHidden = getIsHidden(time, hiddenDates);\n if (isHidden.hidden == true) {\n if (direction < 0) {\n if (correctionEnabled == true) {\n return isHidden.startDate - (isHidden.endDate - time) - 1;\n }\n else {\n return isHidden.startDate - 1;\n }\n }\n else {\n if (correctionEnabled == true) {\n return isHidden.endDate + (time - isHidden.startDate) + 1;\n }\n else {\n return isHidden.endDate + 1;\n }\n }\n }\n else {\n return time;\n }\n\n}\n\n/**\n * Check if a time is hidden\n *\n * @param {Date} time\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @returns {{hidden: boolean, startDate: Window.start, endDate: *}}\n */\nexport function getIsHidden(time, hiddenDates) {\n for (let i = 0; i < hiddenDates.length; i++) {\n var startDate = hiddenDates[i].start;\n var endDate = hiddenDates[i].end;\n\n if (time >= startDate && time < endDate) { // if the start is entering a hidden zone\n return {hidden: true, startDate, endDate};\n }\n }\n return {hidden: false, startDate, endDate};\n}\n","import util from '../util';\nimport moment from '../module/moment';\nimport Component from './component/Component';\nimport * as DateUtil from './DateUtil';\n\n/**\n * A Range controls a numeric range with a start and end value.\n * The Range adjusts the range based on mouse events or programmatic changes,\n * and triggers events when the range is changing or has been changed.\n */\nexport default class Range extends Component {\n /**\n * @param {{dom: Object, domProps: Object, emitter: Emitter}} body\n * @param {Object} [options] See description at Range.setOptions\n * @constructor Range\n * @extends Component\n */\n constructor(body, options) {\n super();\n const now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);\n const start = now.clone().add(-3, 'days').valueOf();\n const end = now.clone().add(3, 'days').valueOf(); \n this.millisecondsPerPixelCache = undefined;\n \n if(options === undefined) {\n this.start = start;\n this.end = end;\n } else {\n this.start = options.start || start;\n this.end = options.end || end\n }\n\n this.rolling = false;\n\n this.body = body;\n this.deltaDifference = 0;\n this.scaleOffset = 0;\n this.startToFront = false;\n this.endToFront = true;\n\n // default options\n this.defaultOptions = {\n rtl: false,\n start: null,\n end: null,\n moment,\n direction: 'horizontal', // 'horizontal' or 'vertical'\n moveable: true,\n zoomable: true,\n min: null,\n max: null,\n zoomMin: 10, // milliseconds\n zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000, // milliseconds\n rollingMode: {\n follow: false,\n offset: 0.5\n }\n };\n this.options = util.extend({}, this.defaultOptions);\n this.props = {\n touch: {}\n };\n this.animationTimer = null;\n\n // drag listeners for dragging\n this.body.emitter.on('panstart', this._onDragStart.bind(this));\n this.body.emitter.on('panmove', this._onDrag.bind(this));\n this.body.emitter.on('panend', this._onDragEnd.bind(this));\n\n // mouse wheel for zooming\n this.body.emitter.on('mousewheel', this._onMouseWheel.bind(this));\n\n // pinch to zoom\n this.body.emitter.on('touch', this._onTouch.bind(this));\n this.body.emitter.on('pinch', this._onPinch.bind(this));\n\n // on click of rolling mode button\n this.body.dom.rollingModeBtn.addEventListener('click', this.startRolling.bind(this));\n\n this.setOptions(options);\n }\n\n /**\n * Set options for the range controller\n * @param {Object} options Available options:\n * {number | Date | String} start Start date for the range\n * {number | Date | String} end End date for the range\n * {number} min Minimum value for start\n * {number} max Maximum value for end\n * {number} zoomMin Set a minimum value for\n * (end - start).\n * {number} zoomMax Set a maximum value for\n * (end - start).\n * {boolean} moveable Enable moving of the range\n * by dragging. True by default\n * {boolean} zoomable Enable zooming of the range\n * by pinching/scrolling. True by default\n */\n setOptions(options) {\n if (options) {\n // copy the options that we know\n const fields = [\n 'animation', 'direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable',\n 'moment', 'activate', 'hiddenDates', 'zoomKey', 'zoomFriction', 'rtl', 'showCurrentTime', 'rollingMode', 'horizontalScroll'\n ];\n util.selectiveExtend(fields, this.options, options);\n\n if (options.rollingMode && options.rollingMode.follow) {\n this.startRolling();\n }\n if ('start' in options || 'end' in options) {\n // apply a new range. both start and end are optional\n this.setRange(options.start, options.end);\n }\n }\n }\n\n /**\n * Start auto refreshing the current time bar\n */\n startRolling() {\n const me = this;\n\n /**\n * Updates the current time.\n */\n function update () {\n me.stopRolling();\n me.rolling = true;\n\n\n let interval = me.end - me.start;\n const t = util.convert(new Date(), 'Date').valueOf();\n const rollingModeOffset = me.options.rollingMode && me.options.rollingMode.offset || 0.5\n\n const start = t - interval * (rollingModeOffset);\n const end = t + interval * (1 - rollingModeOffset);\n\n const options = {\n animation: false\n };\n me.setRange(start, end, options);\n\n // determine interval to refresh\n const scale = me.conversion(me.body.domProps.center.width).scale;\n interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.body.dom.rollingModeBtn.style.visibility = \"hidden\";\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }\n\n update();\n }\n\n /**\n * Stop auto refreshing the current time bar\n */\n stopRolling() {\n if (this.currentTimeTimer !== undefined) {\n clearTimeout(this.currentTimeTimer);\n this.rolling = false;\n this.body.dom.rollingModeBtn.style.visibility = \"visible\";\n }\n }\n\n /**\n * Set a new start and end range\n * @param {Date | number | string} start\n * @param {Date | number | string} end\n * @param {Object} options Available options:\n * {boolean | {duration: number, easingFunction: string}} [animation=false]\n * If true, the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * {boolean} [byUser=false]\n * {Event} event Mouse event\n * @param {Function} callback a callback function to be executed at the end of this function \n * @param {Function} frameCallback a callback function executed each frame of the range animation.\n * The callback will be passed three parameters:\n * {number} easeCoefficient an easing coefficent\n * {boolean} willDraw If true the caller will redraw after the callback completes\n * {boolean} done If true then animation is ending after the current frame\n * @return {void}\n */\n setRange(start, end, options, callback, frameCallback) {\n if (!options) {\n options = {};\n }\n if (options.byUser !== true) {\n options.byUser = false;\n }\n const me = this;\n const finalStart = start != undefined ? util.convert(start, 'Date').valueOf() : null;\n const finalEnd = end != undefined ? util.convert(end, 'Date').valueOf() : null;\n this._cancelAnimation();\n this.millisecondsPerPixelCache = undefined;\n\n if (options.animation) { // true or an Object\n const initStart = this.start;\n const initEnd = this.end;\n const duration = (typeof options.animation === 'object' && 'duration' in options.animation) ? options.animation.duration : 500;\n const easingName = (typeof options.animation === 'object' && 'easingFunction' in options.animation) ? options.animation.easingFunction : 'easeInOutQuad';\n const easingFunction = util.easingFunctions[easingName];\n if (!easingFunction) {\n throw new Error(`Unknown easing function ${JSON.stringify(easingName)}. Choose from: ${Object.keys(util.easingFunctions).join(', ')}`);\n }\n\n const initTime = Date.now();\n let anyChanged = false;\n\n const next = () => {\n if (!me.props.touch.dragging) {\n const now = Date.now();\n const time = now - initTime;\n const ease = easingFunction(time / duration);\n const done = time > duration;\n const s = (done || finalStart === null) ? finalStart : initStart + (finalStart - initStart) * ease;\n const e = (done || finalEnd === null) ? finalEnd : initEnd + (finalEnd - initEnd) * ease;\n\n changed = me._applyRange(s, e);\n DateUtil.updateHiddenDates(me.options.moment, me.body, me.options.hiddenDates);\n anyChanged = anyChanged || changed;\n\n const params = {\n start: new Date(me.start), \n end: new Date(me.end), \n byUser: options.byUser,\n event: options.event\n };\n\n if (frameCallback) { frameCallback(ease, changed, done); }\n\n if (changed) { \n me.body.emitter.emit('rangechange', params);\n }\n\n if (done) {\n if (anyChanged) {\n me.body.emitter.emit('rangechanged', params);\n if (callback) { return callback() }\n }\n }\n else {\n // animate with as high as possible frame rate, leave 20 ms in between\n // each to prevent the browser from blocking\n me.animationTimer = setTimeout(next, 20);\n }\n }\n };\n\n return next();\n }\n else {\n var changed = this._applyRange(finalStart, finalEnd);\n DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);\n if (changed) {\n const params = {\n start: new Date(this.start), \n end: new Date(this.end), \n byUser: options.byUser, \n event: options.event\n };\n\n this.body.emitter.emit('rangechange', params);\n clearTimeout( me.timeoutID );\n me.timeoutID = setTimeout( () => {\n me.body.emitter.emit('rangechanged', params);\n }, 200 );\n if (callback) { return callback() }\n }\n }\n }\n\n /**\n * Get the number of milliseconds per pixel.\n *\n * @returns {undefined|number}\n */\n getMillisecondsPerPixel() {\n if (this.millisecondsPerPixelCache === undefined) {\n this.millisecondsPerPixelCache = (this.end - this.start) / this.body.dom.center.clientWidth;\n }\n return this.millisecondsPerPixelCache;\n }\n\n /**\n * Stop an animation\n * @private\n */\n _cancelAnimation() {\n if (this.animationTimer) {\n clearTimeout(this.animationTimer);\n this.animationTimer = null;\n }\n }\n\n /**\n * Set a new start and end range. This method is the same as setRange, but\n * does not trigger a range change and range changed event, and it returns\n * true when the range is changed\n * @param {number} [start]\n * @param {number} [end]\n * @return {boolean} changed\n * @private\n */\n _applyRange(start, end) {\n let newStart = (start != null) ? util.convert(start, 'Date').valueOf() : this.start;\n let newEnd = (end != null) ? util.convert(end, 'Date').valueOf() : this.end;\n const max = (this.options.max != null) ? util.convert(this.options.max, 'Date').valueOf() : null;\n const min = (this.options.min != null) ? util.convert(this.options.min, 'Date').valueOf() : null;\n let diff;\n\n // check for valid number\n if (isNaN(newStart) || newStart === null) {\n throw new Error(`Invalid start \"${start}\"`);\n }\n if (isNaN(newEnd) || newEnd === null) {\n throw new Error(`Invalid end \"${end}\"`);\n }\n\n // prevent end < start\n if (newEnd < newStart) {\n newEnd = newStart;\n }\n\n // prevent start < min\n if (min !== null) {\n if (newStart < min) {\n diff = (min - newStart);\n newStart += diff;\n newEnd += diff;\n\n // prevent end > max\n if (max != null) {\n if (newEnd > max) {\n newEnd = max;\n }\n }\n }\n }\n\n // prevent end > max\n if (max !== null) {\n if (newEnd > max) {\n diff = (newEnd - max);\n newStart -= diff;\n newEnd -= diff;\n\n // prevent start < min\n if (min != null) {\n if (newStart < min) {\n newStart = min;\n }\n }\n }\n }\n\n // prevent (end-start) < zoomMin\n if (this.options.zoomMin !== null) {\n let zoomMin = parseFloat(this.options.zoomMin);\n if (zoomMin < 0) {\n zoomMin = 0;\n }\n if ((newEnd - newStart) < zoomMin) {\n // compensate for a scale of 0.5 ms\n const compensation = 0.5;\n if ((this.end - this.start) === zoomMin && newStart >= this.start - compensation && newEnd <= this.end) {\n // ignore this action, we are already zoomed to the minimum\n newStart = this.start;\n newEnd = this.end;\n }\n else {\n // zoom to the minimum\n diff = (zoomMin - (newEnd - newStart));\n newStart -= diff / 2;\n newEnd += diff / 2;\n }\n }\n }\n\n // prevent (end-start) > zoomMax\n if (this.options.zoomMax !== null) {\n let zoomMax = parseFloat(this.options.zoomMax);\n if (zoomMax < 0) {\n zoomMax = 0;\n }\n\n if ((newEnd - newStart) > zoomMax) {\n if ((this.end - this.start) === zoomMax && newStart < this.start && newEnd > this.end) {\n // ignore this action, we are already zoomed to the maximum\n newStart = this.start;\n newEnd = this.end;\n }\n else {\n // zoom to the maximum\n diff = ((newEnd - newStart) - zoomMax);\n newStart += diff / 2;\n newEnd -= diff / 2;\n }\n }\n }\n\n const changed = (this.start != newStart || this.end != newEnd);\n\n // 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)\n if (!((newStart >= this.start && newStart <= this.end) || (newEnd >= this.start && newEnd <= this.end)) &&\n !((this.start >= newStart && this.start <= newEnd) || (this.end >= newStart && this.end <= newEnd) )) {\n this.body.emitter.emit('checkRangedItems');\n }\n\n this.start = newStart;\n this.end = newEnd;\n return changed;\n }\n\n /**\n * Retrieve the current range.\n * @return {Object} An object with start and end properties\n */\n getRange() {\n return {\n start: this.start,\n end: this.end\n };\n }\n\n /**\n * Calculate the conversion offset and scale for current range, based on\n * the provided width\n * @param {number} width\n * @param {number} [totalHidden=0]\n * @returns {{offset: number, scale: number}} conversion\n */\n conversion(width, totalHidden) {\n return Range.conversion(this.start, this.end, width, totalHidden);\n }\n\n /**\n * Static method to calculate the conversion offset and scale for a range,\n * based on the provided start, end, and width\n * @param {number} start\n * @param {number} end\n * @param {number} width\n * @param {number} [totalHidden=0]\n * @returns {{offset: number, scale: number}} conversion\n */\n static conversion(start, end, width, totalHidden) {\n if (totalHidden === undefined) {\n totalHidden = 0;\n }\n if (width != 0 && (end - start != 0)) {\n return {\n offset: start,\n scale: width / (end - start - totalHidden)\n }\n }\n else {\n return {\n offset: 0,\n scale: 1\n };\n }\n }\n\n /**\n * Start dragging horizontally or vertically\n * @param {Event} event\n * @private\n */\n _onDragStart(event) {\n this.deltaDifference = 0;\n this.previousDelta = 0;\n\n // only allow dragging when configured as movable\n if (!this.options.moveable) return;\n\n // only start dragging when the mouse is inside the current range\n if (!this._isInsideRange(event)) return;\n\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.props.touch.allowDragging) return;\n\n this.stopRolling();\n\n this.props.touch.start = this.start;\n this.props.touch.end = this.end;\n this.props.touch.dragging = true;\n\n if (this.body.dom.root) {\n this.body.dom.root.style.cursor = 'move';\n }\n }\n\n /**\n * Perform dragging operation\n * @param {Event} event\n * @private\n */\n _onDrag(event) {\n if (!event) return;\n\n if (!this.props.touch.dragging) return;\n\n // only allow dragging when configured as movable\n if (!this.options.moveable) return;\n\n // TODO: this may be redundant in hammerjs2\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.props.touch.allowDragging) return;\n\n const direction = this.options.direction;\n validateDirection(direction);\n let delta = (direction == 'horizontal') ? event.deltaX : event.deltaY;\n delta -= this.deltaDifference;\n let interval = (this.props.touch.end - this.props.touch.start);\n\n // normalize dragging speed if cutout is in between.\n const duration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);\n interval -= duration;\n\n const width = (direction == 'horizontal') ? this.body.domProps.center.width : this.body.domProps.center.height;\n let diffRange;\n if (this.options.rtl) {\n diffRange = delta / width * interval;\n } else {\n diffRange = -delta / width * interval;\n }\n\n const newStart = this.props.touch.start + diffRange;\n const newEnd = this.props.touch.end + diffRange;\n\n // snapping times away from hidden zones\n const safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, this.previousDelta-delta, true);\n const safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, this.previousDelta-delta, true);\n if (safeStart != newStart || safeEnd != newEnd) {\n this.deltaDifference += delta;\n this.props.touch.start = safeStart;\n this.props.touch.end = safeEnd;\n this._onDrag(event);\n return;\n }\n\n this.previousDelta = delta;\n this._applyRange(newStart, newEnd);\n\n\n const startDate = new Date(this.start);\n const endDate = new Date(this.end);\n\n // fire a rangechange event\n this.body.emitter.emit('rangechange', {\n start: startDate,\n end: endDate,\n byUser: true,\n event\n });\n\n // fire a panmove event\n this.body.emitter.emit('panmove');\n }\n\n /**\n * Stop dragging operation\n * @param {event} event\n * @private\n */\n _onDragEnd(event) {\n if (!this.props.touch.dragging) return;\n\n // only allow dragging when configured as movable\n if (!this.options.moveable) return;\n\n // TODO: this may be redundant in hammerjs2\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.props.touch.allowDragging) return;\n\n this.props.touch.dragging = false;\n if (this.body.dom.root) {\n this.body.dom.root.style.cursor = 'auto';\n }\n\n // fire a rangechanged event\n this.body.emitter.emit('rangechanged', {\n start: new Date(this.start),\n end: new Date(this.end),\n byUser: true,\n event\n });\n }\n\n /**\n * Event handler for mouse wheel event, used to zoom\n * Code from http://adomas.org/javascript-mouse-wheel/\n * @param {Event} event\n * @private\n */\n _onMouseWheel(event) {\n // retrieve delta\n let delta = 0;\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta / 120;\n } else if (event.detail) { /* Mozilla case. */\n // In Mozilla, sign of delta is different than in IE.\n // Also, delta is multiple of 3.\n delta = -event.detail / 3;\n } else if (event.deltaY) {\n delta = -event.deltaY / 3;\n } \n\n // don't allow zoom when the according key is pressed and the zoomKey option or not zoomable but movable\n if ((this.options.zoomKey && !event[this.options.zoomKey] && this.options.zoomable) \n || (!this.options.zoomable && this.options.moveable)) {\n return;\n }\n\n // only allow zooming when configured as zoomable and moveable\n if (!(this.options.zoomable && this.options.moveable)) return;\n \n // only zoom when the mouse is inside the current range\n if (!this._isInsideRange(event)) return;\n\n // If delta is nonzero, handle it.\n // Basically, delta is now positive if wheel was scrolled up,\n // and negative, if wheel was scrolled down.\n if (delta) {\n // perform the zoom action. Delta is normally 1 or -1\n\n // adjust a negative delta such that zooming in with delta 0.1\n // equals zooming out with a delta -0.1\n\n const zoomFriction = this.options.zoomFriction || 5;\n let scale;\n if (delta < 0) {\n scale = 1 - (delta / zoomFriction);\n }\n else {\n scale = 1 / (1 + (delta / zoomFriction)) ;\n }\n\n // calculate center, the date to zoom around\n let pointerDate;\n if (this.rolling) {\n const rollingModeOffset = this.options.rollingMode && this.options.rollingMode.offset || 0.5;\n pointerDate = this.start + ((this.end - this.start) * rollingModeOffset);\n } else {\n const pointer = this.getPointer({x: event.clientX, y: event.clientY}, this.body.dom.center);\n pointerDate = this._pointerToDate(pointer);\n }\n this.zoom(scale, pointerDate, delta, event);\n\n // Prevent default actions caused by mouse wheel\n // (else the page and timeline both scroll)\n event.preventDefault();\n }\n }\n\n /**\n * Start of a touch gesture\n * @param {Event} event\n * @private\n */\n _onTouch(event) { // eslint-disable-line no-unused-vars\n this.props.touch.start = this.start;\n this.props.touch.end = this.end;\n this.props.touch.allowDragging = true;\n this.props.touch.center = null;\n this.scaleOffset = 0;\n this.deltaDifference = 0;\n // Disable the browser default handling of this event.\n util.preventDefault(event);\n }\n\n /**\n * Handle pinch event\n * @param {Event} event\n * @private\n */\n _onPinch(event) {\n // only allow zooming when configured as zoomable and moveable\n if (!(this.options.zoomable && this.options.moveable)) return;\n\n // Disable the browser default handling of this event.\n util.preventDefault(event);\n\n this.props.touch.allowDragging = false;\n\n if (!this.props.touch.center) {\n this.props.touch.center = this.getPointer(event.center, this.body.dom.center);\n }\n\n this.stopRolling();\n\n const scale = 1 / (event.scale + this.scaleOffset);\n const centerDate = this._pointerToDate(this.props.touch.center);\n\n const hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);\n const hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, centerDate);\n const hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;\n\n // calculate new start and end\n let newStart = (centerDate - hiddenDurationBefore) + (this.props.touch.start - (centerDate - hiddenDurationBefore)) * scale;\n let newEnd = (centerDate + hiddenDurationAfter) + (this.props.touch.end - (centerDate + hiddenDurationAfter)) * scale;\n\n // snapping times away from hidden zones\n this.startToFront = 1 - scale <= 0; // used to do the right auto correction with periodic hidden times\n this.endToFront = scale - 1 <= 0; // used to do the right auto correction with periodic hidden times\n\n const safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, 1 - scale, true);\n const safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, scale - 1, true);\n if (safeStart != newStart || safeEnd != newEnd) {\n this.props.touch.start = safeStart;\n this.props.touch.end = safeEnd;\n this.scaleOffset = 1 - event.scale;\n newStart = safeStart;\n newEnd = safeEnd;\n }\n\n const options = {\n animation: false,\n byUser: true,\n event\n };\n this.setRange(newStart, newEnd, options);\n\n this.startToFront = false; // revert to default\n this.endToFront = true; // revert to default\n }\n\n /**\n * Test whether the mouse from a mouse event is inside the visible window,\n * between the current start and end date\n * @param {Object} event\n * @return {boolean} Returns true when inside the visible window\n * @private\n */\n _isInsideRange(event) {\n // calculate the time where the mouse is, check whether inside\n // and no scroll action should happen.\n const clientX = event.center ? event.center.x : event.clientX;\n const centerContainerRect = this.body.dom.centerContainer.getBoundingClientRect();\n const x = this.options.rtl ? clientX - centerContainerRect.left : centerContainerRect.right - clientX;\n const time = this.body.util.toTime(x);\n\n return time >= this.start && time <= this.end;\n }\n\n /**\n * Helper function to calculate the center date for zooming\n * @param {{x: number, y: number}} pointer\n * @return {number} date\n * @private\n */\n _pointerToDate(pointer) {\n let conversion;\n const direction = this.options.direction;\n\n validateDirection(direction);\n\n if (direction == 'horizontal') {\n return this.body.util.toTime(pointer.x).valueOf();\n }\n else {\n const height = this.body.domProps.center.height;\n conversion = this.conversion(height);\n return pointer.y / conversion.scale + conversion.offset;\n }\n }\n\n /**\n * Get the pointer location relative to the location of the dom element\n * @param {{x: number, y: number}} touch\n * @param {Element} element HTML DOM element\n * @return {{x: number, y: number}} pointer\n * @private\n */\n getPointer(touch, element) {\n const elementRect = element.getBoundingClientRect();\n if (this.options.rtl) {\n return {\n x: elementRect.right - touch.x,\n y: touch.y - elementRect.top\n };\n } else {\n return {\n x: touch.x - elementRect.left,\n y: touch.y - elementRect.top\n };\n }\n }\n\n /**\n * Zoom the range the given scale in or out. Start and end date will\n * be adjusted, and the timeline will be redrawn. You can optionally give a\n * date around which to zoom.\n * For example, try scale = 0.9 or 1.1\n * @param {number} scale Scaling factor. Values above 1 will zoom out,\n * values below 1 will zoom in.\n * @param {number} [center] Value representing a date around which will\n * be zoomed.\n * @param {number} delta\n * @param {Event} event\n */\n zoom(scale, center, delta, event) {\n // if centerDate is not provided, take it half between start Date and end Date\n if (center == null) {\n center = (this.start + this.end) / 2;\n }\n\n const hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);\n const hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, center);\n const hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;\n\n // calculate new start and end\n let newStart = (center-hiddenDurationBefore) + (this.start - (center-hiddenDurationBefore)) * scale;\n let newEnd = (center+hiddenDurationAfter) + (this.end - (center+hiddenDurationAfter)) * scale;\n\n // snapping times away from hidden zones\n this.startToFront = delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times\n this.endToFront = -delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times\n const safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, delta, true);\n const safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, -delta, true);\n if (safeStart != newStart || safeEnd != newEnd) {\n newStart = safeStart;\n newEnd = safeEnd;\n }\n\n const options = {\n animation: false,\n byUser: true,\n event\n };\n this.setRange(newStart, newEnd, options);\n\n this.startToFront = false; // revert to default\n this.endToFront = true; // revert to default\n }\n\n /**\n * Move the range with a given delta to the left or right. Start and end\n * value will be adjusted. For example, try delta = 0.1 or -0.1\n * @param {number} delta Moving amount. Positive value will move right,\n * negative value will move left\n */\n move(delta) {\n // zoom start Date and end Date relative to the centerDate\n const diff = (this.end - this.start);\n\n // apply new values\n const newStart = this.start + diff * delta;\n const newEnd = this.end + diff * delta;\n\n // TODO: reckon with min and max range\n\n this.start = newStart;\n this.end = newEnd;\n }\n\n /**\n * Move the range to a new center point\n * @param {number} moveTo New center point of the range\n */\n moveTo(moveTo) {\n const center = (this.start + this.end) / 2;\n\n const diff = center - moveTo;\n\n // calculate new start and end\n const newStart = this.start - diff;\n const newEnd = this.end - diff;\n\n const options = {\n animation: false,\n byUser: true,\n event: null\n };\n this.setRange(newStart, newEnd, options);\n }\n}\n\n/**\n * Test whether direction has a valid value\n * @param {string} direction 'horizontal' or 'vertical'\n */\nfunction validateDirection (direction) {\n if (direction != 'horizontal' && direction != 'vertical') {\n throw new TypeError(`Unknown direction \"${direction}\". Choose \"horizontal\" or \"vertical\".`);\n }\n}\n","require('../modules/web.timers');\n\nmodule.exports = require('../internals/path').setInterval;\n","module.exports = require(\"core-js-pure/stable/set-interval\");","'use strict';\nvar $ = require('../internals/export');\nvar $some = require('../internals/array-iteration').some;\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\n// `Array.prototype.some` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.some\n$({ target: 'Array', proto: true, forced: sloppyArrayMethod('some') }, {\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.some');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').some;\n","var some = require('../array/virtual/some');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.some;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.some) ? some : own;\n};\n","module.exports = require('../../es/instance/some');\n","module.exports = require(\"core-js-pure/stable/instance/some\");","'use strict';\nvar $ = require('../internals/export');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toObject = require('../internals/to-object');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar createProperty = require('../internals/create-property');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar max = Math.max;\nvar min = Math.min;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';\n\n// `Array.prototype.splice` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.splice\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, {\n splice: function splice(start, deleteCount /* , ...items */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var actualStart = toAbsoluteIndex(start, len);\n var argumentsLength = arguments.length;\n var insertCount, actualDeleteCount, A, k, from, to;\n if (argumentsLength === 0) {\n insertCount = actualDeleteCount = 0;\n } else if (argumentsLength === 1) {\n insertCount = 0;\n actualDeleteCount = len - actualStart;\n } else {\n insertCount = argumentsLength - 2;\n actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);\n }\n if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {\n throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);\n }\n A = arraySpeciesCreate(O, actualDeleteCount);\n for (k = 0; k < actualDeleteCount; k++) {\n from = actualStart + k;\n if (from in O) createProperty(A, k, O[from]);\n }\n A.length = actualDeleteCount;\n if (insertCount < actualDeleteCount) {\n for (k = actualStart; k < len - actualDeleteCount; k++) {\n from = k + actualDeleteCount;\n to = k + insertCount;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];\n } else if (insertCount > actualDeleteCount) {\n for (k = len - actualDeleteCount; k > actualStart; k--) {\n from = k + actualDeleteCount - 1;\n to = k + insertCount - 1;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n }\n for (k = 0; k < insertCount; k++) {\n O[k + actualStart] = arguments[k + 2];\n }\n O.length = len - actualDeleteCount + insertCount;\n return A;\n }\n});\n","require('../../../modules/es.array.splice');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').splice;\n","var splice = require('../array/virtual/splice');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.splice;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.splice) ? splice : own;\n};\n","module.exports = require('../../es/instance/splice');\n","module.exports = require(\"core-js-pure/stable/instance/splice\");","'use strict';\nvar $ = require('../internals/export');\nvar $indexOf = require('../internals/array-includes').indexOf;\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\nvar nativeIndexOf = [].indexOf;\n\nvar NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;\nvar SLOPPY_METHOD = sloppyArrayMethod('indexOf');\n\n// `Array.prototype.indexOf` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? nativeIndexOf.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.index-of');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').indexOf;\n","var indexOf = require('../array/virtual/index-of');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.indexOf;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.indexOf) ? indexOf : own;\n};\n","module.exports = require('../../es/instance/index-of');\n","module.exports = require(\"core-js-pure/stable/instance/index-of\");","\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks[event] = this._callbacks[event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n var self = this;\n this._callbacks = this._callbacks || {};\n\n function on() {\n self.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks[event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks[event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks[event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks[event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","'use strict';\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n window.propagating = factory();\n }\n}(function () {\n var _firstTarget = null; // singleton, will contain the target element where the touch event started\n\n /**\n * Extend an Hammer.js instance with event propagation.\n *\n * Features:\n * - Events emitted by hammer will propagate in order from child to parent\n * elements.\n * - Events are extended with a function `event.stopPropagation()` to stop\n * propagation to parent elements.\n * - An option `preventDefault` to stop all default browser behavior.\n *\n * Usage:\n * var hammer = propagatingHammer(new Hammer(element));\n * var hammer = propagatingHammer(new Hammer(element), {preventDefault: true});\n *\n * @param {Hammer.Manager} hammer An hammer instance.\n * @param {Object} [options] Available options:\n * - `preventDefault: true | false | 'mouse' | 'touch' | 'pen'`.\n * Enforce preventing the default browser behavior.\n * Cannot be set to `false`.\n * @return {Hammer.Manager} Returns the same hammer instance with extended\n * functionality\n */\n return function propagating(hammer, options) {\n var _options = options || {\n preventDefault: false\n };\n\n if (hammer.Manager) {\n // This looks like the Hammer constructor.\n // Overload the constructors with our own.\n var Hammer = hammer;\n\n var PropagatingHammer = function(element, options) {\n var o = Object.create(_options);\n if (options) Hammer.assign(o, options);\n return propagating(new Hammer(element, o), o);\n };\n Hammer.assign(PropagatingHammer, Hammer);\n\n PropagatingHammer.Manager = function (element, options) {\n var o = Object.create(_options);\n if (options) Hammer.assign(o, options);\n return propagating(new Hammer.Manager(element, o), o);\n };\n\n return PropagatingHammer;\n }\n\n // create a wrapper object which will override the functions\n // `on`, `off`, `destroy`, and `emit` of the hammer instance\n var wrapper = Object.create(hammer);\n\n // attach to DOM element\n var element = hammer.element;\n\n if(!element.hammer) element.hammer = [];\n element.hammer.push(wrapper);\n\n // register an event to catch the start of a gesture and store the\n // target in a singleton\n hammer.on('hammer.input', function (event) {\n if (_options.preventDefault === true || (_options.preventDefault === event.pointerType)) {\n event.preventDefault();\n }\n if (event.isFirst) {\n _firstTarget = event.target;\n }\n });\n\n /** @type {Object.>} */\n wrapper._handlers = {};\n\n /**\n * Register a handler for one or multiple events\n * @param {String} events A space separated string with events\n * @param {function} handler A callback function, called as handler(event)\n * @returns {Hammer.Manager} Returns the hammer instance\n */\n wrapper.on = function (events, handler) {\n // register the handler\n split(events).forEach(function (event) {\n var _handlers = wrapper._handlers[event];\n if (!_handlers) {\n wrapper._handlers[event] = _handlers = [];\n\n // register the static, propagated handler\n hammer.on(event, propagatedHandler);\n }\n _handlers.push(handler);\n });\n\n return wrapper;\n };\n\n /**\n * Unregister a handler for one or multiple events\n * @param {String} events A space separated string with events\n * @param {function} [handler] Optional. The registered handler. If not\n * provided, all handlers for given events\n * are removed.\n * @returns {Hammer.Manager} Returns the hammer instance\n */\n wrapper.off = function (events, handler) {\n // unregister the handler\n split(events).forEach(function (event) {\n var _handlers = wrapper._handlers[event];\n if (_handlers) {\n _handlers = handler ? _handlers.filter(function (h) {\n return h !== handler;\n }) : [];\n\n if (_handlers.length > 0) {\n wrapper._handlers[event] = _handlers;\n }\n else {\n // remove static, propagated handler\n hammer.off(event, propagatedHandler);\n delete wrapper._handlers[event];\n }\n }\n });\n\n return wrapper;\n };\n\n /**\n * Emit to the event listeners\n * @param {string} eventType\n * @param {Event} event\n */\n wrapper.emit = function(eventType, event) {\n _firstTarget = event.target;\n hammer.emit(eventType, event);\n };\n\n wrapper.destroy = function () {\n // Detach from DOM element\n var hammers = hammer.element.hammer;\n var idx = hammers.indexOf(wrapper);\n if(idx !== -1) hammers.splice(idx,1);\n if(!hammers.length) delete hammer.element.hammer;\n\n // clear all handlers\n wrapper._handlers = {};\n\n // call original hammer destroy\n hammer.destroy();\n };\n\n // split a string with space separated words\n function split(events) {\n return events.match(/[^ ]+/g);\n }\n\n /**\n * A static event handler, applying event propagation.\n * @param {Object} event\n */\n function propagatedHandler(event) {\n // let only a single hammer instance handle this event\n if (event.type !== 'hammer.input') {\n // it is possible that the same srcEvent is used with multiple hammer events,\n // we keep track on which events are handled in an object _handled\n if (!event.srcEvent._handled) {\n event.srcEvent._handled = {};\n }\n\n if (event.srcEvent._handled[event.type]) {\n return;\n }\n else {\n event.srcEvent._handled[event.type] = true;\n }\n }\n\n // attach a stopPropagation function to the event\n var stopped = false;\n event.stopPropagation = function () {\n stopped = true;\n };\n\n //wrap the srcEvent's stopPropagation to also stop hammer propagation:\n var srcStop = event.srcEvent.stopPropagation.bind(event.srcEvent);\n if(typeof srcStop == \"function\") {\n event.srcEvent.stopPropagation = function(){\n srcStop();\n event.stopPropagation();\n }\n }\n\n // attach firstTarget property to the event\n event.firstTarget = _firstTarget;\n\n // propagate over all elements (until stopped)\n var elem = _firstTarget;\n while (elem && !stopped) {\n var elemHammer = elem.hammer;\n if(elemHammer){\n var _handlers;\n for(var k = 0; k < elemHammer.length; k++){\n _handlers = elemHammer[k]._handlers[event.type];\n if(_handlers) for (var i = 0; i < _handlers.length && !stopped; i++) {\n _handlers[i](event);\n }\n }\n }\n elem = elem.parentNode;\n }\n }\n\n return wrapper;\n };\n}));\n","/*! Hammer.JS - v2.0.17-rc - 2019-12-16\n * http://naver.github.io/egjs\n *\n * Forked By Naver egjs\n * Copyright (c) hammerjs\n * Licensed under the MIT license */\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n/**\n * @private\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\n\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\nvar assign$1 = assign;\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = typeof document === \"undefined\" ? {\n style: {}\n} : document.createElement('div');\nvar TYPE_FUNCTION = 'function';\nvar round = Math.round,\n abs = Math.abs;\nvar now = Date.now;\n\n/**\n * @private\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\n\nfunction prefixed(obj, property) {\n var prefix;\n var prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n var i = 0;\n\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = prefix ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n\n i++;\n }\n\n return undefined;\n}\n\n/* eslint-disable no-new-func, no-nested-ternary */\nvar win;\n\nif (typeof window === \"undefined\") {\n // window is undefined in node.js\n win = {};\n} else {\n win = window;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n\n var touchMap = {};\n var cssSupports = win.CSS && win.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\n\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\nvar SUPPORT_TOUCH = 'ontouchstart' in win;\nvar SUPPORT_POINTER_EVENTS = prefixed(win, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\nvar COMPUTE_INTERVAL = 25;\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * @private\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * @private\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\n\nfunction boolOrFn(val, args) {\n if (typeof val === TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n\n return val;\n}\n\n/**\n * @private\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * @private\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\n\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n } // pan-x OR pan-y\n\n\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n } // manipulation\n\n\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\n/**\n * @private\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\n\nvar TouchAction =\n/*#__PURE__*/\nfunction () {\n function TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n }\n /**\n * @private\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n\n\n var _proto = TouchAction.prototype;\n\n _proto.set = function set(value) {\n // find out the touch-action by the event handlers\n if (value === TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n\n this.actions = value.toLowerCase().trim();\n };\n /**\n * @private\n * just re-set the touchAction value\n */\n\n\n _proto.update = function update() {\n this.set(this.manager.options.touchAction);\n };\n /**\n * @private\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n\n\n _proto.compute = function compute() {\n var actions = [];\n each(this.manager.recognizers, function (recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n };\n /**\n * @private\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n\n\n _proto.preventDefaults = function preventDefaults(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection; // if the touch action did prevented once this session\n\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n // do not prevent defaults if this is a tap gesture\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {\n return this.preventSrc(srcEvent);\n }\n };\n /**\n * @private\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n\n\n _proto.preventSrc = function preventSrc(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n };\n\n return TouchAction;\n}();\n\n/**\n * @private\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node === parent) {\n return true;\n }\n\n node = node.parentNode;\n }\n\n return false;\n}\n\n/**\n * @private\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\n\nfunction getCenter(pointers) {\n var pointersLength = pointers.length; // no need to loop when only one touch\n\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0;\n var y = 0;\n var i = 0;\n\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * @private\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\n\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * @private\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\n\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n\n var x = p2[props[0]] - p1[props[0]];\n var y = p2[props[1]] - p1[props[1]];\n return Math.sqrt(x * x + y * y);\n}\n\n/**\n * @private\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\n\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n\n var x = p2[props[0]] - p1[props[0]];\n var y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * @private\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\n\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session;\n // jscs throwing error on defalut destructured values and without defaults tests fail\n\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * @private\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * @private\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\n\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\n/**\n * @private\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\n\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * @private\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\n\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input;\n var deltaTime = input.timeStamp - last.timeStamp;\n var velocity;\n var velocityX;\n var velocityY;\n var direction;\n\n if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = abs(v.x) > abs(v.y) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n* @private\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\n\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length; // store the first input to calculate the distance and direction\n\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n } // to compute scale and rotation we need to store the multiple touches\n\n\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput,\n firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;\n computeIntervalInputData(session, input); // find the correct target\n\n var target = manager.element;\n var srcEvent = input.srcEvent;\n var srcEventTarget;\n\n if (srcEvent.composedPath) {\n srcEventTarget = srcEvent.composedPath()[0];\n } else if (srcEvent.path) {\n srcEventTarget = srcEvent.path[0];\n } else {\n srcEventTarget = srcEvent.target;\n }\n\n if (hasParent(srcEventTarget, target)) {\n target = srcEventTarget;\n }\n\n input.target = target;\n}\n\n/**\n * @private\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\n\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;\n var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n } // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n\n\n input.eventType = eventType; // compute scale, rotation etc\n\n computeInputData(manager, input); // emit secret event\n\n manager.emit('hammer.input', input);\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * @private\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * @private\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\n\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function (type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * @private\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\n\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function (type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * @private\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return doc.defaultView || doc.parentWindow || window;\n}\n\n/**\n * @private\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\n\nvar Input =\n/*#__PURE__*/\nfunction () {\n function Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n\n this.domHandler = function (ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n }\n /**\n * @private\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n\n\n var _proto = Input.prototype;\n\n _proto.handler = function handler() {};\n /**\n * @private\n * bind the events\n */\n\n\n _proto.init = function init() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n };\n /**\n * @private\n * unbind the events\n */\n\n\n _proto.destroy = function destroy() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n };\n\n return Input;\n}();\n\n/**\n * @private\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n\n while (i < src.length) {\n if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {\n // do not use === here, test fails\n return i;\n }\n\n i++;\n }\n\n return -1;\n }\n}\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n}; // in IE10 the pointer types is defined as an enum\n\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n\n};\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive\n\nif (win.MSPointerEvent && !win.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n/**\n * @private\n * Pointer events input\n * @constructor\n * @extends Input\n */\n\n\nvar PointerEventInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(PointerEventInput, _Input);\n\n function PointerEventInput() {\n var _this;\n\n var proto = PointerEventInput.prototype;\n proto.evEl = POINTER_ELEMENT_EVENTS;\n proto.evWin = POINTER_WINDOW_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.store = _this.manager.session.pointerEvents = [];\n return _this;\n }\n /**\n * @private\n * handle mouse events\n * @param {Object} ev\n */\n\n\n var _proto = PointerEventInput.prototype;\n\n _proto.handler = function handler(ev) {\n var store = this.store;\n var removePointer = false;\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n var isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store\n\n var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down\n\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n } // it not found, so the pointer hasn't been down (so it's probably a hover)\n\n\n if (storeIndex < 0) {\n return;\n } // update the event in the store\n\n\n store[storeIndex] = ev;\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n };\n\n return PointerEventInput;\n}(Input);\n\n/**\n * @private\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * @private\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\n\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function (a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n/**\n * @private\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\n\nvar TouchInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(TouchInput, _Input);\n\n function TouchInput() {\n var _this;\n\n TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS;\n\n return _this;\n }\n\n var _proto = TouchInput.prototype;\n\n _proto.handler = function handler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n };\n\n return TouchInput;\n}(Input);\n\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds; // when there is only one touch, the process can be simplified\n\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i;\n var targetTouches;\n var changedTouches = toArray(ev.changedTouches);\n var changedTargetTouches = [];\n var target = this.target; // get target touches from touches\n\n targetTouches = allTouches.filter(function (touch) {\n return hasParent(touch.target, target);\n }); // collect touches\n\n if (type === INPUT_START) {\n i = 0;\n\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n } // filter changed touches to only contain touches that exist in the collected target ids\n\n\n i = 0;\n\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n } // cleanup removed touches\n\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n/**\n * @private\n * Mouse events input\n * @constructor\n * @extends Input\n */\n\nvar MouseInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(MouseInput, _Input);\n\n function MouseInput() {\n var _this;\n\n var proto = MouseInput.prototype;\n proto.evEl = MOUSE_ELEMENT_EVENTS;\n proto.evWin = MOUSE_WINDOW_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.pressed = false; // mousedown state\n\n return _this;\n }\n /**\n * @private\n * handle mouse events\n * @param {Object} ev\n */\n\n\n var _proto = MouseInput.prototype;\n\n _proto.handler = function handler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down\n\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n } // mouse must be down\n\n\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n };\n\n return MouseInput;\n}(Input);\n\n/**\n * @private\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction setLastTouch(eventData) {\n var _eventData$changedPoi = eventData.changedPointers,\n touch = _eventData$changedPoi[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {\n x: touch.clientX,\n y: touch.clientY\n };\n var lts = this.lastTouches;\n this.lastTouches.push(lastTouch);\n\n var removeLastTouch = function removeLastTouch() {\n var i = lts.indexOf(lastTouch);\n\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX;\n var y = eventData.srcEvent.clientY;\n\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x);\n var dy = Math.abs(y - t.y);\n\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n\n return false;\n}\n\nvar TouchMouseInput =\n/*#__PURE__*/\nfunction () {\n var TouchMouseInput =\n /*#__PURE__*/\n function (_Input) {\n _inheritsLoose(TouchMouseInput, _Input);\n\n function TouchMouseInput(_manager, callback) {\n var _this;\n\n _this = _Input.call(this, _manager, callback) || this;\n\n _this.handler = function (manager, inputEvent, inputData) {\n var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;\n var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n } // when we're in a touch event, record touches to de-dupe synthetic mouse event\n\n\n if (isTouch) {\n recordTouches.call(_assertThisInitialized(_assertThisInitialized(_this)), inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized(_assertThisInitialized(_this)), inputData)) {\n return;\n }\n\n _this.callback(manager, inputEvent, inputData);\n };\n\n _this.touch = new TouchInput(_this.manager, _this.handler);\n _this.mouse = new MouseInput(_this.manager, _this.handler);\n _this.primaryTouch = null;\n _this.lastTouches = [];\n return _this;\n }\n /**\n * @private\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n\n\n var _proto = TouchMouseInput.prototype;\n\n /**\n * @private\n * remove the event listeners\n */\n _proto.destroy = function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n };\n\n return TouchMouseInput;\n }(Input);\n\n return TouchMouseInput;\n}();\n\n/**\n * @private\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\n\nfunction createInputInstance(manager) {\n var Type; // let inputClass = manager.options.inputClass;\n\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n\n return new Type(manager, inputHandler);\n}\n\n/**\n * @private\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\n\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n\n return false;\n}\n\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * @private\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * @private\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n\n if (manager) {\n return manager.get(otherRecognizer);\n }\n\n return otherRecognizer;\n}\n\n/**\n * @private\n * get a usable string, used as event postfix\n * @param {constant} state\n * @returns {String} state\n */\n\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n\n return '';\n}\n\n/**\n * @private\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\n\n/**\n * @private\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\n\nvar Recognizer =\n/*#__PURE__*/\nfunction () {\n function Recognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n this.options = _extends({\n enable: true\n }, options);\n this.id = uniqueId();\n this.manager = null; // default is enable true\n\n this.state = STATE_POSSIBLE;\n this.simultaneous = {};\n this.requireFail = [];\n }\n /**\n * @private\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n\n\n var _proto = Recognizer.prototype;\n\n _proto.set = function set(options) {\n assign$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state\n\n this.manager && this.manager.touchAction.update();\n return this;\n };\n /**\n * @private\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.recognizeWith = function recognizeWith(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n\n return this;\n };\n /**\n * @private\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n };\n /**\n * @private\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.requireFailure = function requireFailure(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n\n return this;\n };\n /**\n * @private\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n\n\n _proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n\n return this;\n };\n /**\n * @private\n * has require failures boolean\n * @returns {boolean}\n */\n\n\n _proto.hasRequireFailures = function hasRequireFailures() {\n return this.requireFail.length > 0;\n };\n /**\n * @private\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n\n\n _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n };\n /**\n * @private\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n\n\n _proto.emit = function emit(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n } // 'panstart' and 'panmove'\n\n\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) {\n // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n } // panend and pancancel\n\n\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n };\n /**\n * @private\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n\n\n _proto.tryEmit = function tryEmit(input) {\n if (this.canEmit()) {\n return this.emit(input);\n } // it's failing anyway\n\n\n this.state = STATE_FAILED;\n };\n /**\n * @private\n * can we emit?\n * @returns {boolean}\n */\n\n\n _proto.canEmit = function canEmit() {\n var i = 0;\n\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n\n i++;\n }\n\n return true;\n };\n /**\n * @private\n * update the recognizer\n * @param {Object} inputData\n */\n\n\n _proto.recognize = function recognize(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign$1({}, inputData); // is is enabled and allow recognizing?\n\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n } // reset when we've reached the end\n\n\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone); // the recognizer has recognized a gesture\n // so trigger an event\n\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n };\n /**\n * @private\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {constant} STATE\n */\n\n /* jshint ignore:start */\n\n\n _proto.process = function process(inputData) {};\n /* jshint ignore:end */\n\n /**\n * @private\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n\n\n _proto.getTouchAction = function getTouchAction() {};\n /**\n * @private\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n\n\n _proto.reset = function reset() {};\n\n return Recognizer;\n}();\n\n/**\n * @private\n * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\n\nvar TapRecognizer =\n/*#__PURE__*/\nfunction (_Recognizer) {\n _inheritsLoose(TapRecognizer, _Recognizer);\n\n function TapRecognizer(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Recognizer.call(this, _extends({\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300,\n // max time between the multi-tap taps\n time: 250,\n // max time of the pointer to be down (like finger on the screen)\n threshold: 9,\n // a minimal movement is ok, but keep it low\n posThreshold: 10\n }, options)) || this; // previous time and center,\n // used for tap counting\n\n _this.pTime = false;\n _this.pCenter = false;\n _this._timer = null;\n _this._input = null;\n _this.count = 0;\n return _this;\n }\n\n var _proto = TapRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_MANIPULATION];\n };\n\n _proto.process = function process(input) {\n var _this2 = this;\n\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n this.reset();\n\n if (input.eventType & INPUT_START && this.count === 0) {\n return this.failTimeout();\n } // we only allow little movement\n // and we've reached an end event, so a tap is possible\n\n\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType !== INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input; // if tap count matches we have recognized it,\n // else it has began recognizing...\n\n var tapCount = this.count % options.taps;\n\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeout(function () {\n _this2.state = STATE_RECOGNIZED;\n\n _this2.tryEmit();\n }, options.interval);\n return STATE_BEGAN;\n }\n }\n }\n\n return STATE_FAILED;\n };\n\n _proto.failTimeout = function failTimeout() {\n var _this3 = this;\n\n this._timer = setTimeout(function () {\n _this3.state = STATE_FAILED;\n }, this.options.interval);\n return STATE_FAILED;\n };\n\n _proto.reset = function reset() {\n clearTimeout(this._timer);\n };\n\n _proto.emit = function emit() {\n if (this.state === STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n };\n\n return TapRecognizer;\n}(Recognizer);\n\n/**\n * @private\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\n\nvar AttrRecognizer =\n/*#__PURE__*/\nfunction (_Recognizer) {\n _inheritsLoose(AttrRecognizer, _Recognizer);\n\n function AttrRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _Recognizer.call(this, _extends({\n pointers: 1\n }, options)) || this;\n }\n /**\n * @private\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n\n\n var _proto = AttrRecognizer.prototype;\n\n _proto.attrTest = function attrTest(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n };\n /**\n * @private\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n\n\n _proto.process = function process(input) {\n var state = this.state;\n var eventType = input.eventType;\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED\n\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n\n return state | STATE_CHANGED;\n }\n\n return STATE_FAILED;\n };\n\n return AttrRecognizer;\n}(Recognizer);\n\n/**\n * @private\n * direction cons to string\n * @param {constant} direction\n * @returns {String}\n */\n\nfunction directionStr(direction) {\n if (direction === DIRECTION_DOWN) {\n return 'down';\n } else if (direction === DIRECTION_UP) {\n return 'up';\n } else if (direction === DIRECTION_LEFT) {\n return 'left';\n } else if (direction === DIRECTION_RIGHT) {\n return 'right';\n }\n\n return '';\n}\n\n/**\n * @private\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar PanRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(PanRecognizer, _AttrRecognizer);\n\n function PanRecognizer(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _AttrRecognizer.call(this, _extends({\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n }, options)) || this;\n _this.pX = null;\n _this.pY = null;\n return _this;\n }\n\n var _proto = PanRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n var direction = this.options.direction;\n var actions = [];\n\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n\n return actions;\n };\n\n _proto.directionTest = function directionTest(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY; // lock to axis?\n\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x !== this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y !== this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n };\n\n _proto.attrTest = function attrTest(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call\n this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));\n };\n\n _proto.emit = function emit(input) {\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n\n _AttrRecognizer.prototype.emit.call(this, input);\n };\n\n return PanRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar SwipeRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(SwipeRecognizer, _AttrRecognizer);\n\n function SwipeRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _AttrRecognizer.call(this, _extends({\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n }, options)) || this;\n }\n\n var _proto = SwipeRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n };\n\n _proto.attrTest = function attrTest(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return _AttrRecognizer.prototype.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;\n };\n\n _proto.emit = function emit(input) {\n var direction = directionStr(input.offsetDirection);\n\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n };\n\n return SwipeRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar PinchRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(PinchRecognizer, _AttrRecognizer);\n\n function PinchRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _AttrRecognizer.call(this, _extends({\n event: 'pinch',\n threshold: 0,\n pointers: 2\n }, options)) || this;\n }\n\n var _proto = PinchRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_NONE];\n };\n\n _proto.attrTest = function attrTest(input) {\n return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n };\n\n _proto.emit = function emit(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n\n _AttrRecognizer.prototype.emit.call(this, input);\n };\n\n return PinchRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\n\nvar RotateRecognizer =\n/*#__PURE__*/\nfunction (_AttrRecognizer) {\n _inheritsLoose(RotateRecognizer, _AttrRecognizer);\n\n function RotateRecognizer(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _AttrRecognizer.call(this, _extends({\n event: 'rotate',\n threshold: 0,\n pointers: 2\n }, options)) || this;\n }\n\n var _proto = RotateRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_NONE];\n };\n\n _proto.attrTest = function attrTest(input) {\n return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n };\n\n return RotateRecognizer;\n}(AttrRecognizer);\n\n/**\n * @private\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\n\nvar PressRecognizer =\n/*#__PURE__*/\nfunction (_Recognizer) {\n _inheritsLoose(PressRecognizer, _Recognizer);\n\n function PressRecognizer(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Recognizer.call(this, _extends({\n event: 'press',\n pointers: 1,\n time: 251,\n // minimal time of the pointer to be pressed\n threshold: 9\n }, options)) || this;\n _this._timer = null;\n _this._input = null;\n return _this;\n }\n\n var _proto = PressRecognizer.prototype;\n\n _proto.getTouchAction = function getTouchAction() {\n return [TOUCH_ACTION_AUTO];\n };\n\n _proto.process = function process(input) {\n var _this2 = this;\n\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n this._input = input; // we only allow little movement\n // and we've reached an end event, so a tap is possible\n\n if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeout(function () {\n _this2.state = STATE_RECOGNIZED;\n\n _this2.tryEmit();\n }, options.time);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n\n return STATE_FAILED;\n };\n\n _proto.reset = function reset() {\n clearTimeout(this._timer);\n };\n\n _proto.emit = function emit(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && input.eventType & INPUT_END) {\n this.manager.emit(this.options.event + \"up\", input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n };\n\n return PressRecognizer;\n}(Recognizer);\n\nvar defaults = {\n /**\n * @private\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * @private\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @private\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * @private\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * @private\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * @private\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * @private\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: \"none\",\n\n /**\n * @private\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: \"none\",\n\n /**\n * @private\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: \"none\",\n\n /**\n * @private\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: \"none\",\n\n /**\n * @private\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: \"none\",\n\n /**\n * @private\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: \"rgba(0,0,0,0)\"\n }\n};\n/**\n * @private\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * This is separated with other defaults because of tree-shaking.\n * @type {Array}\n */\n\nvar preset = [[RotateRecognizer, {\n enable: false\n}], [PinchRecognizer, {\n enable: false\n}, ['rotate']], [SwipeRecognizer, {\n direction: DIRECTION_HORIZONTAL\n}], [PanRecognizer, {\n direction: DIRECTION_HORIZONTAL\n}, ['swipe']], [TapRecognizer], [TapRecognizer, {\n event: 'doubletap',\n taps: 2\n}, ['tap']], [PressRecognizer]];\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n/**\n * @private\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\n\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n\n if (!element.style) {\n return;\n }\n\n var prop;\n each(manager.options.cssProps, function (value, name) {\n prop = prefixed(element.style, name);\n\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || \"\";\n }\n });\n\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n/**\n * @private\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\n\n\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent(\"Event\");\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n/**\n* @private\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\n\n\nvar Manager =\n/*#__PURE__*/\nfunction () {\n function Manager(element, options) {\n var _this = this;\n\n this.options = assign$1({}, defaults, options || {});\n this.options.inputTarget = this.options.inputTarget || element;\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n toggleCssProps(this, true);\n each(this.options.recognizers, function (item) {\n var recognizer = _this.add(new item[0](item[1]));\n\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n }\n /**\n * @private\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n\n\n var _proto = Manager.prototype;\n\n _proto.set = function set(options) {\n assign$1(this.options, options); // Options that need a little more setup\n\n if (options.touchAction) {\n this.touchAction.update();\n }\n\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n\n return this;\n };\n /**\n * @private\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n\n\n _proto.stop = function stop(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n };\n /**\n * @private\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n\n\n _proto.recognize = function recognize(inputData) {\n var session = this.session;\n\n if (session.stopped) {\n return;\n } // run the touch-action polyfill\n\n\n this.touchAction.preventDefaults(inputData);\n var recognizer;\n var recognizers = this.recognizers; // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n\n var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized\n // or when we're in a new session\n\n if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {\n session.curRecognizer = null;\n curRecognizer = null;\n }\n\n var i = 0;\n\n while (i < recognizers.length) {\n recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer === curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) {\n // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n\n\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n session.curRecognizer = recognizer;\n curRecognizer = recognizer;\n }\n\n i++;\n }\n };\n /**\n * @private\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n\n\n _proto.get = function get(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event === recognizer) {\n return recognizers[i];\n }\n }\n\n return null;\n };\n /**\n * @private add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n\n\n _proto.add = function add(recognizer) {\n if (invokeArrayArg(recognizer, \"add\", this)) {\n return this;\n } // remove existing\n\n\n var existing = this.get(recognizer.options.event);\n\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n this.touchAction.update();\n return recognizer;\n };\n /**\n * @private\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n\n\n _proto.remove = function remove(recognizer) {\n if (invokeArrayArg(recognizer, \"remove\", this)) {\n return this;\n }\n\n var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists\n\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, targetRecognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n };\n /**\n * @private\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n\n\n _proto.on = function on(events, handler) {\n if (events === undefined || handler === undefined) {\n return this;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function (event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n };\n /**\n * @private unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n\n\n _proto.off = function off(events, handler) {\n if (events === undefined) {\n return this;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function (event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n };\n /**\n * @private emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n\n\n _proto.emit = function emit(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n } // no handlers, so skip it all\n\n\n var handlers = this.handlers[event] && this.handlers[event].slice();\n\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n\n data.preventDefault = function () {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n };\n /**\n * @private\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n\n\n _proto.destroy = function destroy() {\n this.element && toggleCssProps(this, false);\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n };\n\n return Manager;\n}();\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n/**\n * @private\n * Touch events input\n * @constructor\n * @extends Input\n */\n\nvar SingleTouchInput =\n/*#__PURE__*/\nfunction (_Input) {\n _inheritsLoose(SingleTouchInput, _Input);\n\n function SingleTouchInput() {\n var _this;\n\n var proto = SingleTouchInput.prototype;\n proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n _this = _Input.apply(this, arguments) || this;\n _this.started = false;\n return _this;\n }\n\n var _proto = SingleTouchInput.prototype;\n\n _proto.handler = function handler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?\n\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state\n\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n };\n\n return SingleTouchInput;\n}(Input);\n\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\n/**\n * @private\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = \"DEPRECATED METHOD: \" + name + \"\\n\" + message + \" AT \\n\";\n return function () {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '').replace(/^\\s+at\\s+/gm, '').replace(/^Object.\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n var log = window.console && (window.console.warn || window.console.log);\n\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n\n return method.apply(this, arguments);\n };\n}\n\n/**\n * @private\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\n\nvar extend = deprecate(function (dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n\n while (i < keys.length) {\n if (!merge || merge && dest[keys[i]] === undefined) {\n dest[keys[i]] = src[keys[i]];\n }\n\n i++;\n }\n\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * @private\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\n\nvar merge = deprecate(function (dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * @private\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\n\nfunction inherit(child, base, properties) {\n var baseP = base.prototype;\n var childP;\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign$1(childP, properties);\n }\n}\n\n/**\n * @private\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * @private\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\n\nvar Hammer =\n/*#__PURE__*/\nfunction () {\n var Hammer =\n /**\n * @private\n * @const {string}\n */\n function Hammer(element, options) {\n if (options === void 0) {\n options = {};\n }\n\n return new Manager(element, _extends({\n recognizers: preset.concat()\n }, options));\n };\n\n Hammer.VERSION = \"2.0.17-rc\";\n Hammer.DIRECTION_ALL = DIRECTION_ALL;\n Hammer.DIRECTION_DOWN = DIRECTION_DOWN;\n Hammer.DIRECTION_LEFT = DIRECTION_LEFT;\n Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT;\n Hammer.DIRECTION_UP = DIRECTION_UP;\n Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;\n Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL;\n Hammer.DIRECTION_NONE = DIRECTION_NONE;\n Hammer.DIRECTION_DOWN = DIRECTION_DOWN;\n Hammer.INPUT_START = INPUT_START;\n Hammer.INPUT_MOVE = INPUT_MOVE;\n Hammer.INPUT_END = INPUT_END;\n Hammer.INPUT_CANCEL = INPUT_CANCEL;\n Hammer.STATE_POSSIBLE = STATE_POSSIBLE;\n Hammer.STATE_BEGAN = STATE_BEGAN;\n Hammer.STATE_CHANGED = STATE_CHANGED;\n Hammer.STATE_ENDED = STATE_ENDED;\n Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED;\n Hammer.STATE_CANCELLED = STATE_CANCELLED;\n Hammer.STATE_FAILED = STATE_FAILED;\n Hammer.Manager = Manager;\n Hammer.Input = Input;\n Hammer.TouchAction = TouchAction;\n Hammer.TouchInput = TouchInput;\n Hammer.MouseInput = MouseInput;\n Hammer.PointerEventInput = PointerEventInput;\n Hammer.TouchMouseInput = TouchMouseInput;\n Hammer.SingleTouchInput = SingleTouchInput;\n Hammer.Recognizer = Recognizer;\n Hammer.AttrRecognizer = AttrRecognizer;\n Hammer.Tap = TapRecognizer;\n Hammer.Pan = PanRecognizer;\n Hammer.Swipe = SwipeRecognizer;\n Hammer.Pinch = PinchRecognizer;\n Hammer.Rotate = RotateRecognizer;\n Hammer.Press = PressRecognizer;\n Hammer.on = addEventListeners;\n Hammer.off = removeEventListeners;\n Hammer.each = each;\n Hammer.merge = merge;\n Hammer.extend = extend;\n Hammer.bindFn = bindFn;\n Hammer.assign = assign$1;\n Hammer.inherit = inherit;\n Hammer.bindFn = bindFn;\n Hammer.prefixed = prefixed;\n Hammer.toArray = toArray;\n Hammer.inArray = inArray;\n Hammer.uniqueArray = uniqueArray;\n Hammer.splitStr = splitStr;\n Hammer.boolOrFn = boolOrFn;\n Hammer.hasParent = hasParent;\n Hammer.addEventListeners = addEventListeners;\n Hammer.removeEventListeners = removeEventListeners;\n Hammer.defaults = assign$1({}, defaults, {\n preset: preset\n });\n return Hammer;\n}();\n\n// style loader but by script tag, not by the loader.\n\nvar defaults$1 = Hammer.defaults;\n\nexport default Hammer;\nexport { INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, STATE_POSSIBLE, STATE_BEGAN, STATE_CHANGED, STATE_ENDED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_FAILED, DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL, Manager, Input, TouchAction, TouchInput, MouseInput, PointerEventInput, TouchMouseInput, SingleTouchInput, Recognizer, AttrRecognizer, TapRecognizer as Tap, PanRecognizer as Pan, SwipeRecognizer as Swipe, PinchRecognizer as Pinch, RotateRecognizer as Rotate, PressRecognizer as Press, addEventListeners as on, removeEventListeners as off, each, merge, extend, assign$1 as assign, inherit, bindFn, prefixed, toArray, inArray, uniqueArray, splitStr, boolOrFn, hasParent, addEventListeners, removeEventListeners, defaults$1 as defaults };\n//# sourceMappingURL=hammer.esm.js.map\n","import PropagatingHammer from 'propagating-hammerjs';\nimport Hammer from '@egjs/hammerjs';\n\n/**\n * Setup a mock hammer.js object, for unit testing.\n *\n * Inspiration: https://github.com/uber/deck.gl/pull/658\n *\n * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}\n */\nfunction hammerMock() {\n const noop = () => {};\n\n return {\n on: noop,\n off: noop,\n destroy: noop,\n emit: noop,\n\n get(m) {\t//eslint-disable-line no-unused-vars\n return {\n set: noop\n };\n }\n };\n}\n\nlet modifiedHammer\n\nif (typeof window !== 'undefined') {\n const OurHammer = window['Hammer'] || Hammer;\n modifiedHammer = PropagatingHammer(OurHammer, {\n preventDefault: 'mouse'\n });\n} else {\n modifiedHammer = () => // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.\n hammerMock()\n}\n\nexport default modifiedHammer;\n","/**\n * Register a touch event, taking place before a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\nexport function onTouch (hammer, callback) {\n callback.inputHandler = function (event) {\n if (event.isFirst) {\n callback(event);\n }\n };\n\n hammer.on('hammer.input', callback.inputHandler);\n}\n\n/**\n * Register a release event, taking place after a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n * @returns {*}\n */\nexport function onRelease (hammer, callback) {\n callback.inputHandler = function (event) {\n if (event.isFinal) {\n callback(event);\n }\n };\n\n return hammer.on('hammer.input', callback.inputHandler);\n}\n\n\n/**\n * Unregister a touch event, taking place before a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\nexport function offTouch (hammer, callback) {\n hammer.off('hammer.input', callback.inputHandler);\n}\n\n/**\n * Unregister a release event, taking place before a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\n\nexport const offRelease = offTouch;\n\n/**\n * Hack the PinchRecognizer such that it doesn't prevent default behavior\n * for vertical panning.\n *\n * Yeah ... this is quite a hack ... see https://github.com/hammerjs/hammer.js/issues/932\n *\n * @param {Hammer.Pinch} pinchRecognizer\n * @return {Hammer.Pinch} returns the pinchRecognizer\n */\nexport function disablePreventDefaultVertically (pinchRecognizer) {\n const TOUCH_ACTION_PAN_Y = 'pan-y';\n\n pinchRecognizer.getTouchAction = function() {\n // default method returns [TOUCH_ACTION_NONE]\n return [TOUCH_ACTION_PAN_Y];\n };\n\n return pinchRecognizer;\n}\n","var global = require('../internals/global');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar nativeParseInt = global.parseInt;\nvar hex = /^[+-]?0[Xx]/;\nvar FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;\n\n// `parseInt` method\n// https://tc39.github.io/ecma262/#sec-parseint-string-radix\nmodule.exports = FORCED ? function parseInt(string, radix) {\n var S = trim(String(string));\n return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));\n} : nativeParseInt;\n","var $ = require('../internals/export');\nvar parseIntImplementation = require('../internals/parse-int');\n\n// `parseInt` method\n// https://tc39.github.io/ecma262/#sec-parseint-string-radix\n$({ global: true, forced: parseInt != parseIntImplementation }, {\n parseInt: parseIntImplementation\n});\n","require('../modules/es.parse-int');\nvar path = require('../internals/path');\n\nmodule.exports = path.parseInt;\n","module.exports = require('../es/parse-int');\n","module.exports = require(\"core-js-pure/stable/parse-int\");","import moment from '../module/moment';\nimport * as DateUtil from './DateUtil';\nimport util from '../util';\n\n/**\n * The class TimeStep is an iterator for dates. You provide a start date and an\n * end date. The class itself determines the best scale (step size) based on the\n * provided start Date, end Date, and minimumStep.\n *\n * If minimumStep is provided, the step size is chosen as close as possible\n * to the minimumStep but larger than minimumStep. If minimumStep is not\n * provided, the scale is set to 1 DAY.\n * The minimumStep should correspond with the onscreen size of about 6 characters\n *\n * Alternatively, you can set a scale by hand.\n * After creation, you can initialize the class by executing first(). Then you\n * can iterate from the start date to the end date via next(). You can check if\n * the end date is reached with the function hasNext(). After each step, you can\n * retrieve the current date via getCurrent().\n * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,\n * days, to years.\n *\n * Version: 1.2\n *\n */\nclass TimeStep {\n /**\n * @param {Date} [start] The start date, for example new Date(2010, 9, 21)\n * or new Date(2010, 9, 21, 23, 45, 00)\n * @param {Date} [end] The end date\n * @param {number} [minimumStep] Optional. Minimum step size in milliseconds\n * @param {Date|Array.} [hiddenDates] Optional.\n * @param {{showMajorLabels: boolean}} [options] Optional.\n * @constructor TimeStep\n */\n constructor(start, end, minimumStep, hiddenDates, options) {\n this.moment = (options && options.moment) || moment;\n\n // variables\n this.current = this.moment();\n this._start = this.moment();\n this._end = this.moment();\n\n this.autoScale = true;\n this.scale = 'day';\n this.step = 1;\n\n // initialize the range\n this.setRange(start, end, minimumStep);\n\n // hidden Dates options\n this.switchedDay = false;\n this.switchedMonth = false;\n this.switchedYear = false;\n if (Array.isArray(hiddenDates)) {\n this.hiddenDates = hiddenDates;\n }\n else if (hiddenDates != undefined) {\n this.hiddenDates = [hiddenDates];\n }\n else {\n this.hiddenDates = [];\n }\n\n this.format = TimeStep.FORMAT; // default formatting\n this.options = options ? options : {};\n\n }\n\n /**\n * Set custom constructor function for moment. Can be used to set dates\n * to UTC or to set a utcOffset.\n * @param {function} moment\n */\n setMoment(moment) {\n this.moment = moment;\n\n // update the date properties, can have a new utcOffset\n this.current = this.moment(this.current.valueOf());\n this._start = this.moment(this._start.valueOf());\n this._end = this.moment(this._end.valueOf());\n }\n\n /**\n * Set custom formatting for the minor an major labels of the TimeStep.\n * Both `minorLabels` and `majorLabels` are an Object with properties:\n * 'millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'.\n * @param {{minorLabels: Object, majorLabels: Object}} format\n */\n setFormat(format) {\n const defaultFormat = util.deepExtend({}, TimeStep.FORMAT);\n this.format = util.deepExtend(defaultFormat, format);\n }\n\n /**\n * Set a new range\n * If minimumStep is provided, the step size is chosen as close as possible\n * to the minimumStep but larger than minimumStep. If minimumStep is not\n * provided, the scale is set to 1 DAY.\n * The minimumStep should correspond with the onscreen size of about 6 characters\n * @param {Date} [start] The start date and time.\n * @param {Date} [end] The end date and time.\n * @param {int} [minimumStep] Optional. Minimum step size in milliseconds\n */\n setRange(start, end, minimumStep) {\n if (!(start instanceof Date) || !(end instanceof Date)) {\n throw \"No legal start or end date in method setRange\";\n }\n\n this._start = (start != undefined) ? this.moment(start.valueOf()) : Date.now();\n this._end = (end != undefined) ? this.moment(end.valueOf()) : Date.now();\n\n if (this.autoScale) {\n this.setMinimumStep(minimumStep);\n }\n }\n\n /**\n * Set the range iterator to the start date.\n */\n start() {\n this.current = this._start.clone();\n this.roundToMinor();\n }\n\n /**\n * Round the current date to the first minor date value\n * This must be executed once when the current date is set to start Date\n */\n roundToMinor() {\n // round to floor\n // to prevent year & month scales rounding down to the first day of week we perform this separately\n if (this.scale == 'week') {\n this.current.weekday(0);\n }\n // IMPORTANT: we have no breaks in this switch! (this is no bug)\n // noinspection FallThroughInSwitchStatementJS\n switch (this.scale) {\n case 'year':\n this.current.year(this.step * Math.floor(this.current.year() / this.step));\n this.current.month(0);\n case 'month': this.current.date(1); // eslint-disable-line no-fallthrough\n case 'week': // eslint-disable-line no-fallthrough\n case 'day': // eslint-disable-line no-fallthrough\n case 'weekday': this.current.hours(0); // eslint-disable-line no-fallthrough\n case 'hour': this.current.minutes(0); // eslint-disable-line no-fallthrough\n case 'minute': this.current.seconds(0); // eslint-disable-line no-fallthrough\n case 'second': this.current.milliseconds(0); // eslint-disable-line no-fallthrough\n //case 'millisecond': // nothing to do for milliseconds\n }\n\n if (this.step != 1) {\n // round down to the first minor value that is a multiple of the current step size\n let priorCurrent = this.current.clone();\n switch (this.scale) { \n case 'millisecond': this.current.subtract(this.current.milliseconds() % this.step, 'milliseconds'); break;\n case 'second': this.current.subtract(this.current.seconds() % this.step, 'seconds'); break;\n case 'minute': this.current.subtract(this.current.minutes() % this.step, 'minutes'); break;\n case 'hour': this.current.subtract(this.current.hours() % this.step, 'hours'); break;\n case 'weekday': // intentional fall through\n case 'day': this.current.subtract((this.current.date() - 1) % this.step, 'day'); break;\n case 'week': this.current.subtract(this.current.week() % this.step, 'week'); break;\n case 'month': this.current.subtract(this.current.month() % this.step, 'month'); break;\n case 'year': this.current.subtract(this.current.year() % this.step, 'year'); break;\n default: break;\n }\n if (!priorCurrent.isSame(this.current)) {\n this.current = this.moment(DateUtil.snapAwayFromHidden(this.hiddenDates, this.current.valueOf(), -1, true));\n }\n }\n }\n\n /**\n * Check if the there is a next step\n * @return {boolean} true if the current date has not passed the end date\n */\n hasNext() {\n return (this.current.valueOf() <= this._end.valueOf());\n }\n\n /**\n * Do the next step\n */\n next() {\n const prev = this.current.valueOf();\n\n // Two cases, needed to prevent issues with switching daylight savings\n // (end of March and end of October)\n switch (this.scale) {\n case 'millisecond': this.current.add(this.step, 'millisecond'); break;\n case 'second': this.current.add(this.step, 'second'); break;\n case 'minute': this.current.add(this.step, 'minute'); break;\n case 'hour':\n this.current.add(this.step, 'hour');\n\n if (this.current.month() < 6) {\n this.current.subtract(this.current.hours() % this.step, 'hour');\n } else {\n if (this.current.hours() % this.step !== 0) {\n this.current.add(this.step - this.current.hours() % this.step, 'hour');\n }\n }\n break;\n case 'weekday': // intentional fall through\n case 'day': this.current.add(this.step, 'day'); break;\n case 'week':\n if (this.current.weekday() !== 0){ // we had a month break not correlating with a week's start before\n this.current.weekday(0); // switch back to week cycles\n this.current.add(this.step, 'week');\n } else if(this.options.showMajorLabels === false) {\n this.current.add(this.step, 'week'); // the default case\n } else { // first day of the week\n const nextWeek = this.current.clone();\n nextWeek.add(1, 'week');\n if(nextWeek.isSame(this.current, 'month')){ // is the first day of the next week in the same month?\n this.current.add(this.step, 'week'); // the default case\n } else { // inject a step at each first day of the month\n this.current.add(this.step, 'week');\n this.current.date(1);\n }\n }\n break;\n case 'month': this.current.add(this.step, 'month'); break;\n case 'year': this.current.add(this.step, 'year'); break;\n default: break;\n }\n\n if (this.step != 1) {\n // round down to the correct major value\n switch (this.scale) {\n case 'millisecond': if(this.current.milliseconds() > 0 && this.current.milliseconds() < this.step) this.current.milliseconds(0); break;\n case 'second': if(this.current.seconds() > 0 && this.current.seconds() < this.step) this.current.seconds(0); break;\n case 'minute': if(this.current.minutes() > 0 && this.current.minutes() < this.step) this.current.minutes(0); break;\n case 'hour': if(this.current.hours() > 0 && this.current.hours() < this.step) this.current.hours(0); break;\n case 'weekday': // intentional fall through\n case 'day': if(this.current.date() < this.step+1) this.current.date(1); break;\n case 'week': if(this.current.week() < this.step) this.current.week(1); break; // week numbering starts at 1, not 0\n case 'month': if(this.current.month() < this.step) this.current.month(0); break;\n case 'year': break; // nothing to do for year\n default: break;\n }\n }\n\n // safety mechanism: if current time is still unchanged, move to the end\n if (this.current.valueOf() == prev) {\n this.current = this._end.clone();\n }\n\n // Reset switches for year, month and day. Will get set to true where appropriate in DateUtil.stepOverHiddenDates\n this.switchedDay = false;\n this.switchedMonth = false;\n this.switchedYear = false;\n\n DateUtil.stepOverHiddenDates(this.moment, this, prev);\n }\n\n /**\n * Get the current datetime\n * @return {Moment} current The current date\n */\n getCurrent() {\n return this.current.clone();\n }\n\n /**\n * Set a custom scale. Autoscaling will be disabled.\n * For example setScale('minute', 5) will result\n * in minor steps of 5 minutes, and major steps of an hour.\n *\n * @param {{scale: string, step: number}} params\n * An object containing two properties:\n * - A string 'scale'. Choose from 'millisecond', 'second',\n * 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'.\n * - A number 'step'. A step size, by default 1.\n * Choose for example 1, 2, 5, or 10.\n */\n setScale(params) {\n if (params && typeof params.scale == 'string') {\n this.scale = params.scale;\n this.step = params.step > 0 ? params.step : 1;\n this.autoScale = false;\n }\n }\n\n /**\n * Enable or disable autoscaling\n * @param {boolean} enable If true, autoascaling is set true\n */\n setAutoScale(enable) {\n this.autoScale = enable;\n }\n\n /**\n * Automatically determine the scale that bests fits the provided minimum step\n * @param {number} [minimumStep] The minimum step size in milliseconds\n */\n setMinimumStep(minimumStep) {\n if (minimumStep == undefined) {\n return;\n }\n\n //var b = asc + ds;\n\n const stepYear = (1000 * 60 * 60 * 24 * 30 * 12);\n const stepMonth = (1000 * 60 * 60 * 24 * 30);\n const stepDay = (1000 * 60 * 60 * 24);\n const stepHour = (1000 * 60 * 60);\n const stepMinute = (1000 * 60);\n const stepSecond = (1000);\n const stepMillisecond= (1);\n\n // find the smallest step that is larger than the provided minimumStep\n if (stepYear*1000 > minimumStep) {this.scale = 'year'; this.step = 1000;}\n if (stepYear*500 > minimumStep) {this.scale = 'year'; this.step = 500;}\n if (stepYear*100 > minimumStep) {this.scale = 'year'; this.step = 100;}\n if (stepYear*50 > minimumStep) {this.scale = 'year'; this.step = 50;}\n if (stepYear*10 > minimumStep) {this.scale = 'year'; this.step = 10;}\n if (stepYear*5 > minimumStep) {this.scale = 'year'; this.step = 5;}\n if (stepYear > minimumStep) {this.scale = 'year'; this.step = 1;}\n if (stepMonth*3 > minimumStep) {this.scale = 'month'; this.step = 3;}\n if (stepMonth > minimumStep) {this.scale = 'month'; this.step = 1;}\n if (stepDay*7 > minimumStep) {this.scale = 'week'; this.step = 1;}\n if (stepDay*2 > minimumStep) {this.scale = 'day'; this.step = 2;}\n if (stepDay > minimumStep) {this.scale = 'day'; this.step = 1;}\n if (stepDay/2 > minimumStep) {this.scale = 'weekday'; this.step = 1;}\n if (stepHour*4 > minimumStep) {this.scale = 'hour'; this.step = 4;}\n if (stepHour > minimumStep) {this.scale = 'hour'; this.step = 1;}\n if (stepMinute*15 > minimumStep) {this.scale = 'minute'; this.step = 15;}\n if (stepMinute*10 > minimumStep) {this.scale = 'minute'; this.step = 10;}\n if (stepMinute*5 > minimumStep) {this.scale = 'minute'; this.step = 5;}\n if (stepMinute > minimumStep) {this.scale = 'minute'; this.step = 1;}\n if (stepSecond*15 > minimumStep) {this.scale = 'second'; this.step = 15;}\n if (stepSecond*10 > minimumStep) {this.scale = 'second'; this.step = 10;}\n if (stepSecond*5 > minimumStep) {this.scale = 'second'; this.step = 5;}\n if (stepSecond > minimumStep) {this.scale = 'second'; this.step = 1;}\n if (stepMillisecond*200 > minimumStep) {this.scale = 'millisecond'; this.step = 200;}\n if (stepMillisecond*100 > minimumStep) {this.scale = 'millisecond'; this.step = 100;}\n if (stepMillisecond*50 > minimumStep) {this.scale = 'millisecond'; this.step = 50;}\n if (stepMillisecond*10 > minimumStep) {this.scale = 'millisecond'; this.step = 10;}\n if (stepMillisecond*5 > minimumStep) {this.scale = 'millisecond'; this.step = 5;}\n if (stepMillisecond > minimumStep) {this.scale = 'millisecond'; this.step = 1;}\n }\n\n /**\n * Snap a date to a rounded value.\n * The snap intervals are dependent on the current scale and step.\n * Static function\n * @param {Date} date the date to be snapped.\n * @param {string} scale Current scale, can be 'millisecond', 'second',\n * 'minute', 'hour', 'weekday, 'day', 'week', 'month', 'year'.\n * @param {number} step Current step (1, 2, 4, 5, ...\n * @return {Date} snappedDate\n */\n static snap(date, scale, step) {\n const clone = moment(date);\n\n if (scale == 'year') {\n const year = clone.year() + Math.round(clone.month() / 12);\n clone.year(Math.round(year / step) * step);\n clone.month(0);\n clone.date(0);\n clone.hours(0);\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'month') {\n if (clone.date() > 15) {\n clone.date(1);\n clone.add(1, 'month');\n // important: first set Date to 1, after that change the month.\n }\n else {\n clone.date(1);\n }\n\n clone.hours(0);\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'week') {\n if (clone.weekday() > 2) { // doing it the momentjs locale aware way\n clone.weekday(0);\n clone.add(1, 'week');\n }\n else {\n clone.weekday(0);\n }\n\n clone.hours(0);\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'day') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 5:\n case 2:\n clone.hours(Math.round(clone.hours() / 24) * 24); break;\n default:\n clone.hours(Math.round(clone.hours() / 12) * 12); break;\n }\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'weekday') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 5:\n case 2:\n clone.hours(Math.round(clone.hours() / 12) * 12); break;\n default:\n clone.hours(Math.round(clone.hours() / 6) * 6); break;\n }\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'hour') {\n switch (step) {\n case 4:\n clone.minutes(Math.round(clone.minutes() / 60) * 60); break;\n default:\n clone.minutes(Math.round(clone.minutes() / 30) * 30); break;\n }\n clone.seconds(0);\n clone.milliseconds(0);\n } else if (scale == 'minute') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 15:\n case 10:\n clone.minutes(Math.round(clone.minutes() / 5) * 5);\n clone.seconds(0);\n break;\n case 5:\n clone.seconds(Math.round(clone.seconds() / 60) * 60); break;\n default:\n clone.seconds(Math.round(clone.seconds() / 30) * 30); break;\n }\n clone.milliseconds(0);\n }\n else if (scale == 'second') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 15:\n case 10:\n clone.seconds(Math.round(clone.seconds() / 5) * 5);\n clone.milliseconds(0);\n break;\n case 5:\n clone.milliseconds(Math.round(clone.milliseconds() / 1000) * 1000); break;\n default:\n clone.milliseconds(Math.round(clone.milliseconds() / 500) * 500); break;\n }\n }\n else if (scale == 'millisecond') {\n const _step = step > 5 ? step / 2 : 1;\n clone.milliseconds(Math.round(clone.milliseconds() / _step) * _step);\n }\n\n return clone;\n }\n\n /**\n * Check if the current value is a major value (for example when the step\n * is DAY, a major value is each first day of the MONTH)\n * @return {boolean} true if current date is major, else false.\n */\n isMajor() {\n if (this.switchedYear == true) {\n switch (this.scale) {\n case 'year':\n case 'month':\n case 'week':\n case 'weekday':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n case 'millisecond':\n return true;\n default:\n return false;\n }\n }\n else if (this.switchedMonth == true) {\n switch (this.scale) {\n case 'week':\n case 'weekday':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n case 'millisecond':\n return true;\n default:\n return false;\n }\n }\n else if (this.switchedDay == true) {\n switch (this.scale) {\n case 'millisecond':\n case 'second':\n case 'minute':\n case 'hour':\n return true;\n default:\n return false;\n }\n }\n\n const date = this.moment(this.current);\n switch (this.scale) {\n case 'millisecond':\n return (date.milliseconds() == 0);\n case 'second':\n return (date.seconds() == 0);\n case 'minute':\n return (date.hours() == 0) && (date.minutes() == 0);\n case 'hour':\n return (date.hours() == 0);\n case 'weekday': // intentional fall through\n case 'day':\n return (date.date() == 1);\n case 'week':\n return (date.date() == 1);\n case 'month':\n return (date.month() == 0);\n case 'year':\n return false;\n default:\n return false;\n }\n }\n\n /**\n * Returns formatted text for the minor axislabel, depending on the current\n * date and the scale. For example when scale is MINUTE, the current time is\n * formatted as \"hh:mm\".\n * @param {Date} [date=this.current] custom date. if not provided, current date is taken\n * @returns {String}\n */\n getLabelMinor(date) {\n if (date == undefined) {\n date = this.current;\n }\n if (date instanceof Date) {\n date = this.moment(date)\n }\n\n if (typeof(this.format.minorLabels) === \"function\") {\n return this.format.minorLabels(date, this.scale, this.step);\n }\n\n const format = this.format.minorLabels[this.scale];\n // noinspection FallThroughInSwitchStatementJS\n switch (this.scale) {\n case 'week':\n // Don't draw the minor label if this date is the first day of a month AND if it's NOT the start of the week.\n // The 'date' variable may actually be the 'next' step when called from TimeAxis' _repaintLabels.\n if(date.date() === 1 && date.weekday() !== 0){\n return \"\";\n }\n default: // eslint-disable-line no-fallthrough\n return (format && format.length > 0) ? this.moment(date).format(format) : '';\n }\n }\n\n /**\n * Returns formatted text for the major axis label, depending on the current\n * date and the scale. For example when scale is MINUTE, the major scale is\n * hours, and the hour will be formatted as \"hh\".\n * @param {Date} [date=this.current] custom date. if not provided, current date is taken\n * @returns {String}\n */\n getLabelMajor(date) {\n if (date == undefined) {\n date = this.current;\n }\n if (date instanceof Date) {\n date = this.moment(date)\n }\n\n if (typeof(this.format.majorLabels) === \"function\") {\n return this.format.majorLabels(date, this.scale, this.step);\n }\n\n const format = this.format.majorLabels[this.scale];\n return (format && format.length > 0) ? this.moment(date).format(format) : '';\n }\n\n /**\n * get class name\n * @return {string} class name\n */\n getClassName() {\n const _moment = this.moment;\n const m = this.moment(this.current);\n const current = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function\n const step = this.step;\n const classNames = [];\n\n /**\n *\n * @param {number} value\n * @returns {String}\n */\n function even(value) {\n return (value / step % 2 == 0) ? ' vis-even' : ' vis-odd';\n }\n\n /**\n *\n * @param {Date} date\n * @returns {String}\n */\n function today(date) {\n if (date.isSame(Date.now(), 'day')) {\n return ' vis-today';\n }\n if (date.isSame(_moment().add(1, 'day'), 'day')) {\n return ' vis-tomorrow';\n }\n if (date.isSame(_moment().add(-1, 'day'), 'day')) {\n return ' vis-yesterday';\n }\n return '';\n }\n\n /**\n *\n * @param {Date} date\n * @returns {String}\n */\n function currentWeek(date) {\n return date.isSame(Date.now(), 'week') ? ' vis-current-week' : '';\n }\n\n /**\n *\n * @param {Date} date\n * @returns {String}\n */\n function currentMonth(date) {\n return date.isSame(Date.now(), 'month') ? ' vis-current-month' : '';\n }\n\n /**\n *\n * @param {Date} date\n * @returns {String}\n */\n function currentYear(date) {\n return date.isSame(Date.now(), 'year') ? ' vis-current-year' : '';\n }\n\n switch (this.scale) {\n case 'millisecond':\n classNames.push(today(current));\n classNames.push(even(current.milliseconds()));\n break;\n case 'second':\n classNames.push(today(current));\n classNames.push(even(current.seconds()));\n break;\n case 'minute':\n classNames.push(today(current));\n classNames.push(even(current.minutes()));\n break;\n case 'hour':\n classNames.push(`vis-h${current.hours()}${this.step == 4 ? '-h' + (current.hours() + 4) : ''}`);\n classNames.push(today(current));\n classNames.push(even(current.hours()));\n break;\n case 'weekday':\n classNames.push(`vis-${current.format('dddd').toLowerCase()}`);\n classNames.push(today(current));\n classNames.push(currentWeek(current));\n classNames.push(even(current.date()));\n break;\n case 'day':\n classNames.push(`vis-day${current.date()}`);\n classNames.push(`vis-${current.format('MMMM').toLowerCase()}`);\n classNames.push(today(current));\n classNames.push(currentMonth(current));\n classNames.push(this.step <= 2 ? today(current) : '');\n classNames.push(this.step <= 2 ? `vis-${current.format('dddd').toLowerCase()}` : '');\n classNames.push(even(current.date() - 1));\n break;\n case 'week':\n classNames.push(`vis-week${current.format('w')}`);\n classNames.push(currentWeek(current));\n classNames.push(even(current.week()));\n break;\n case 'month':\n classNames.push(`vis-${current.format('MMMM').toLowerCase()}`);\n classNames.push(currentMonth(current));\n classNames.push(even(current.month()));\n break;\n case 'year':\n classNames.push(`vis-year${current.year()}`);\n classNames.push(currentYear(current));\n classNames.push(even(current.year()));\n break;\n }\n return classNames.filter(String).join(\" \");\n }\n}\n\n// Time formatting\nTimeStep.FORMAT = {\n minorLabels: {\n millisecond:'SSS',\n second: 's',\n minute: 'HH:mm',\n hour: 'HH:mm',\n weekday: 'ddd D',\n day: 'D',\n week: 'w',\n month: 'MMM',\n year: 'YYYY'\n },\n majorLabels: {\n millisecond:'HH:mm:ss',\n second: 'D MMMM HH:mm',\n minute: 'ddd D MMMM',\n hour: 'ddd D MMMM',\n weekday: 'MMMM YYYY',\n day: 'MMMM YYYY',\n week: 'MMMM YYYY',\n month: 'YYYY',\n year: ''\n }\n};\n\nexport default TimeStep;\n","import util from '../../util';\nimport Component from'./Component';\nimport TimeStep from '../TimeStep';\nimport * as DateUtil from '../DateUtil';\nimport moment from '../../module/moment';\n\nimport './css/timeaxis.css';\n\n/** A horizontal time axis */\nclass TimeAxis extends Component {\n/**\n * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body\n * @param {Object} [options] See TimeAxis.setOptions for the available\n * options.\n * @constructor TimeAxis\n * @extends Component\n */\n constructor(body, options) {\n super();\n this.dom = {\n foreground: null,\n lines: [],\n majorTexts: [],\n minorTexts: [],\n redundant: {\n lines: [],\n majorTexts: [],\n minorTexts: []\n }\n };\n this.props = {\n range: {\n start: 0,\n end: 0,\n minimumStep: 0\n },\n lineTop: 0\n };\n\n this.defaultOptions = {\n orientation: {\n axis: 'bottom'\n }, // axis orientation: 'top' or 'bottom'\n showMinorLabels: true,\n showMajorLabels: true,\n maxMinorChars: 7,\n format: TimeStep.FORMAT,\n moment,\n timeAxis: null\n };\n this.options = util.extend({}, this.defaultOptions);\n\n this.body = body;\n\n // create the HTML DOM\n this._create();\n\n this.setOptions(options);\n }\n\n /**\n * Set options for the TimeAxis.\n * Parameters will be merged in current options.\n * @param {Object} options Available options:\n * {string} [orientation.axis]\n * {boolean} [showMinorLabels]\n * {boolean} [showMajorLabels]\n */\n setOptions(options) {\n if (options) {\n // copy all options that we know\n util.selectiveExtend([\n 'showMinorLabels',\n 'showMajorLabels',\n 'maxMinorChars',\n 'hiddenDates',\n 'timeAxis',\n 'moment',\n 'rtl'\n ], this.options, options);\n\n // deep copy the format options\n util.selectiveDeepExtend(['format'], this.options, options);\n\n if ('orientation' in options) {\n if (typeof options.orientation === 'string') {\n this.options.orientation.axis = options.orientation;\n }\n else if (typeof options.orientation === 'object' && 'axis' in options.orientation) {\n this.options.orientation.axis = options.orientation.axis;\n }\n }\n\n // apply locale to moment.js\n // TODO: not so nice, this is applied globally to moment.js\n if ('locale' in options) {\n if (typeof moment.locale === 'function') {\n // moment.js 2.8.1+\n moment.locale(options.locale);\n }\n else {\n moment.lang(options.locale);\n }\n }\n }\n }\n\n /**\n * Create the HTML DOM for the TimeAxis\n */\n _create() {\n this.dom.foreground = document.createElement('div');\n this.dom.background = document.createElement('div');\n\n this.dom.foreground.className = 'vis-time-axis vis-foreground';\n this.dom.background.className = 'vis-time-axis vis-background';\n }\n\n /**\n * Destroy the TimeAxis\n */\n destroy() {\n // remove from DOM\n if (this.dom.foreground.parentNode) {\n this.dom.foreground.parentNode.removeChild(this.dom.foreground);\n }\n if (this.dom.background.parentNode) {\n this.dom.background.parentNode.removeChild(this.dom.background);\n }\n\n this.body = null;\n }\n\n /**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\n redraw() {\n const props = this.props;\n const foreground = this.dom.foreground;\n const background = this.dom.background;\n\n // determine the correct parent DOM element (depending on option orientation)\n const parent = (this.options.orientation.axis == 'top') ? this.body.dom.top : this.body.dom.bottom;\n const parentChanged = (foreground.parentNode !== parent);\n\n // calculate character width and height\n this._calculateCharSize();\n\n // TODO: recalculate sizes only needed when parent is resized or options is changed\n const showMinorLabels = this.options.showMinorLabels && this.options.orientation.axis !== 'none';\n const showMajorLabels = this.options.showMajorLabels && this.options.orientation.axis !== 'none';\n\n // determine the width and height of the elemens for the axis\n props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;\n props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;\n props.height = props.minorLabelHeight + props.majorLabelHeight;\n props.width = foreground.offsetWidth;\n\n props.minorLineHeight = this.body.domProps.root.height - props.majorLabelHeight -\n (this.options.orientation.axis == 'top' ? this.body.domProps.bottom.height : this.body.domProps.top.height);\n props.minorLineWidth = 1; // TODO: really calculate width\n props.majorLineHeight = props.minorLineHeight + props.majorLabelHeight;\n props.majorLineWidth = 1; // TODO: really calculate width\n\n // take foreground and background offline while updating (is almost twice as fast)\n const foregroundNextSibling = foreground.nextSibling;\n const backgroundNextSibling = background.nextSibling;\n foreground.parentNode && foreground.parentNode.removeChild(foreground);\n background.parentNode && background.parentNode.removeChild(background);\n\n foreground.style.height = `${this.props.height}px`;\n\n this._repaintLabels();\n\n // put DOM online again (at the same place)\n if (foregroundNextSibling) {\n parent.insertBefore(foreground, foregroundNextSibling);\n }\n else {\n parent.appendChild(foreground)\n }\n if (backgroundNextSibling) {\n this.body.dom.backgroundVertical.insertBefore(background, backgroundNextSibling);\n }\n else {\n this.body.dom.backgroundVertical.appendChild(background)\n }\n return this._isResized() || parentChanged;\n }\n\n /**\n * Repaint major and minor text labels and vertical grid lines\n * @private\n */\n _repaintLabels() {\n const orientation = this.options.orientation.axis;\n\n // calculate range and step (step such that we have space for 7 characters per label)\n const start = util.convert(this.body.range.start, 'Number');\n const end = util.convert(this.body.range.end, 'Number');\n const timeLabelsize = this.body.util.toTime((this.props.minorCharWidth || 10) * this.options.maxMinorChars).valueOf();\n let minimumStep = timeLabelsize - DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this.body.range, timeLabelsize);\n minimumStep -= this.body.util.toTime(0).valueOf();\n\n const step = new TimeStep(new Date(start), new Date(end), minimumStep, this.body.hiddenDates, this.options);\n step.setMoment(this.options.moment);\n if (this.options.format) {\n step.setFormat(this.options.format);\n }\n if (this.options.timeAxis) {\n step.setScale(this.options.timeAxis);\n }\n this.step = step;\n\n // Move all DOM elements to a \"redundant\" list, where they\n // can be picked for re-use, and clear the lists with lines and texts.\n // At the end of the function _repaintLabels, left over elements will be cleaned up\n const dom = this.dom;\n dom.redundant.lines = dom.lines;\n dom.redundant.majorTexts = dom.majorTexts;\n dom.redundant.minorTexts = dom.minorTexts;\n dom.lines = [];\n dom.majorTexts = [];\n dom.minorTexts = [];\n\n let current;\n let next;\n let x;\n let xNext;\n let isMajor;\n let showMinorGrid;\n let width = 0;\n let prevWidth;\n let line;\n let xFirstMajorLabel = undefined;\n let count = 0;\n const MAX = 1000;\n let className;\n\n step.start();\n next = step.getCurrent();\n xNext = this.body.util.toScreen(next);\n while (step.hasNext() && count < MAX) {\n count++;\n\n isMajor = step.isMajor();\n className = step.getClassName();\n\n current = next;\n x = xNext;\n\n step.next();\n next = step.getCurrent();\n xNext = this.body.util.toScreen(next);\n\n prevWidth = width;\n width = xNext - x;\n switch (step.scale) {\n case 'week': showMinorGrid = true; break;\n default: showMinorGrid = (width >= prevWidth * 0.4); break; // prevent displaying of the 31th of the month on a scale of 5 days\n }\n\n if (this.options.showMinorLabels && showMinorGrid) {\n var label = this._repaintMinorText(x, step.getLabelMinor(current), orientation, className);\n label.style.width = `${width}px`; // set width to prevent overflow\n }\n\n if (isMajor && this.options.showMajorLabels) {\n if (x > 0) {\n if (xFirstMajorLabel == undefined) {\n xFirstMajorLabel = x;\n }\n label = this._repaintMajorText(x, step.getLabelMajor(current), orientation, className);\n }\n line = this._repaintMajorLine(x, width, orientation, className);\n }\n else { // minor line\n if (showMinorGrid) {\n line = this._repaintMinorLine(x, width, orientation, className);\n }\n else {\n if (line) {\n // adjust the width of the previous grid\n line.style.width = `${parseInt(line.style.width) + width}px`;\n }\n }\n }\n }\n\n if (count === MAX && !warnedForOverflow) {\n console.warn(`Something is wrong with the Timeline scale. Limited drawing of grid lines to ${MAX} lines.`);\n warnedForOverflow = true;\n }\n\n // create a major label on the left when needed\n if (this.options.showMajorLabels) {\n const leftTime = this.body.util.toTime(0); // upper bound estimation\n const leftText = step.getLabelMajor(leftTime);\n const widthText = leftText.length * (this.props.majorCharWidth || 10) + 10;\n\n if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) {\n this._repaintMajorText(0, leftText, orientation, className);\n }\n }\n\n // Cleanup leftover DOM elements from the redundant list\n util.forEach(this.dom.redundant, arr => {\n while (arr.length) {\n const elem = arr.pop();\n if (elem && elem.parentNode) {\n elem.parentNode.removeChild(elem);\n }\n }\n });\n }\n\n /**\n * Create a minor label for the axis at position x\n * @param {number} x\n * @param {string} text\n * @param {string} orientation \"top\" or \"bottom\" (default)\n * @param {string} className\n * @return {Element} Returns the HTML element of the created label\n * @private\n */\n _repaintMinorText(x, text, orientation, className) {\n // reuse redundant label\n let label = this.dom.redundant.minorTexts.shift();\n\n if (!label) {\n // create new label\n const content = document.createTextNode('');\n label = document.createElement('div');\n label.appendChild(content);\n this.dom.foreground.appendChild(label);\n }\n this.dom.minorTexts.push(label);\n label.innerHTML = text;\n\n\n let y = (orientation == 'top') ? this.props.majorLabelHeight : 0;\n this._setXY(label, x, y);\n\n label.className = `vis-text vis-minor ${className}`;\n //label.title = title; // TODO: this is a heavy operation\n\n return label;\n }\n\n /**\n * Create a Major label for the axis at position x\n * @param {number} x\n * @param {string} text\n * @param {string} orientation \"top\" or \"bottom\" (default)\n * @param {string} className\n * @return {Element} Returns the HTML element of the created label\n * @private\n */\n _repaintMajorText(x, text, orientation, className) {\n // reuse redundant label\n let label = this.dom.redundant.majorTexts.shift();\n\n if (!label) {\n // create label\n const content = document.createElement('div');\n label = document.createElement('div');\n label.appendChild(content);\n this.dom.foreground.appendChild(label);\n }\n\n label.childNodes[0].innerHTML = text;\n label.className = `vis-text vis-major ${className}`;\n //label.title = title; // TODO: this is a heavy operation\n\n let y = (orientation == 'top') ? 0 : this.props.minorLabelHeight;\n this._setXY(label, x, y);\n\n this.dom.majorTexts.push(label);\n return label;\n }\n\n /**\n * sets xy\n * @param {string} label\n * @param {number} x\n * @param {number} y\n * @private\n */\n _setXY(label, x, y) {\n // If rtl is true, inverse x.\n const directionX = this.options.rtl ? (x * -1) : x;\n label.style.transform = `translate(${directionX}px, ${y}px)`;\n }\n\n /**\n * Create a minor line for the axis at position x\n * @param {number} left\n * @param {number} width\n * @param {string} orientation \"top\" or \"bottom\" (default)\n * @param {string} className\n * @return {Element} Returns the created line\n * @private\n */\n _repaintMinorLine(left, width, orientation, className) {\n // reuse redundant line\n let line = this.dom.redundant.lines.shift();\n if (!line) {\n // create vertical line\n line = document.createElement('div');\n this.dom.background.appendChild(line);\n }\n this.dom.lines.push(line);\n\n const props = this.props;\n \n line.style.width = `${width}px`;\n line.style.height = `${props.minorLineHeight}px`;\n\n let y = (orientation == 'top') ? props.majorLabelHeight : this.body.domProps.top.height;\n let x = left - props.minorLineWidth / 2;\n\n this._setXY(line, x, y);\n line.className = `vis-grid ${this.options.rtl ? 'vis-vertical-rtl' : 'vis-vertical'} vis-minor ${className}`;\n\n return line;\n }\n\n /**\n * Create a Major line for the axis at position x\n * @param {number} left\n * @param {number} width\n * @param {string} orientation \"top\" or \"bottom\" (default)\n * @param {string} className\n * @return {Element} Returns the created line\n * @private\n */\n _repaintMajorLine(left, width, orientation, className) {\n // reuse redundant line\n let line = this.dom.redundant.lines.shift();\n if (!line) {\n // create vertical line\n line = document.createElement('div');\n this.dom.background.appendChild(line);\n }\n this.dom.lines.push(line);\n\n const props = this.props;\n \n line.style.width = `${width}px`;\n line.style.height = `${props.majorLineHeight}px`;\n\n let y = (orientation == 'top') ? 0 : this.body.domProps.top.height;\n let x = left - props.majorLineWidth / 2;\n\n this._setXY(line, x, y);\n line.className = `vis-grid ${this.options.rtl ? 'vis-vertical-rtl' : 'vis-vertical'} vis-major ${className}`;\n\n return line;\n }\n\n /**\n * Determine the size of text on the axis (both major and minor axis).\n * The size is calculated only once and then cached in this.props.\n * @private\n */\n _calculateCharSize() {\n // Note: We calculate char size with every redraw. Size may change, for\n // example when any of the timelines parents had display:none for example.\n\n // determine the char width and height on the minor axis\n if (!this.dom.measureCharMinor) {\n this.dom.measureCharMinor = document.createElement('DIV');\n this.dom.measureCharMinor.className = 'vis-text vis-minor vis-measure';\n this.dom.measureCharMinor.style.position = 'absolute';\n\n this.dom.measureCharMinor.appendChild(document.createTextNode('0'));\n this.dom.foreground.appendChild(this.dom.measureCharMinor);\n }\n this.props.minorCharHeight = this.dom.measureCharMinor.clientHeight;\n this.props.minorCharWidth = this.dom.measureCharMinor.clientWidth;\n\n // determine the char width and height on the major axis\n if (!this.dom.measureCharMajor) {\n this.dom.measureCharMajor = document.createElement('DIV');\n this.dom.measureCharMajor.className = 'vis-text vis-major vis-measure';\n this.dom.measureCharMajor.style.position = 'absolute';\n\n this.dom.measureCharMajor.appendChild(document.createTextNode('0'));\n this.dom.foreground.appendChild(this.dom.measureCharMajor);\n }\n this.props.majorCharHeight = this.dom.measureCharMajor.clientHeight;\n this.props.majorCharWidth = this.dom.measureCharMajor.clientWidth;\n }\n}\n\n\nvar warnedForOverflow = false;\n\nexport default TimeAxis;\n","\"use strict\";\r\n/**\r\n * Created by Alex on 11/6/2014.\r\n */\r\n\r\n// https://github.com/umdjs/umd/blob/master/returnExports.js#L40-L60\r\n// if the module has no dependencies, the above pattern can be simplified to\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define([], factory);\r\n } else if (typeof exports === 'object') {\r\n // Node. Does not work with strict CommonJS, but\r\n // only CommonJS-like environments that support module.exports,\r\n // like Node.\r\n module.exports = factory();\r\n } else {\r\n // Browser globals (root is window)\r\n root.keycharm = factory();\r\n }\r\n}(this, function () {\r\n\r\n function keycharm(options) {\r\n var preventDefault = options && options.preventDefault || false;\r\n\r\n var container = options && options.container || window;\r\n\r\n var _exportFunctions = {};\r\n var _bound = {keydown:{}, keyup:{}};\r\n var _keys = {};\r\n var i;\r\n\r\n // a - z\r\n for (i = 97; i <= 122; i++) {_keys[String.fromCharCode(i)] = {code:65 + (i - 97), shift: false};}\r\n // A - Z\r\n for (i = 65; i <= 90; i++) {_keys[String.fromCharCode(i)] = {code:i, shift: true};}\r\n // 0 - 9\r\n for (i = 0; i <= 9; i++) {_keys['' + i] = {code:48 + i, shift: false};}\r\n // F1 - F12\r\n for (i = 1; i <= 12; i++) {_keys['F' + i] = {code:111 + i, shift: false};}\r\n // num0 - num9\r\n for (i = 0; i <= 9; i++) {_keys['num' + i] = {code:96 + i, shift: false};}\r\n\r\n // numpad misc\r\n _keys['num*'] = {code:106, shift: false};\r\n _keys['num+'] = {code:107, shift: false};\r\n _keys['num-'] = {code:109, shift: false};\r\n _keys['num/'] = {code:111, shift: false};\r\n _keys['num.'] = {code:110, shift: false};\r\n // arrows\r\n _keys['left'] = {code:37, shift: false};\r\n _keys['up'] = {code:38, shift: false};\r\n _keys['right'] = {code:39, shift: false};\r\n _keys['down'] = {code:40, shift: false};\r\n // extra keys\r\n _keys['space'] = {code:32, shift: false};\r\n _keys['enter'] = {code:13, shift: false};\r\n _keys['shift'] = {code:16, shift: undefined};\r\n _keys['esc'] = {code:27, shift: false};\r\n _keys['backspace'] = {code:8, shift: false};\r\n _keys['tab'] = {code:9, shift: false};\r\n _keys['ctrl'] = {code:17, shift: false};\r\n _keys['alt'] = {code:18, shift: false};\r\n _keys['delete'] = {code:46, shift: false};\r\n _keys['pageup'] = {code:33, shift: false};\r\n _keys['pagedown'] = {code:34, shift: false};\r\n // symbols\r\n _keys['='] = {code:187, shift: false};\r\n _keys['-'] = {code:189, shift: false};\r\n _keys[']'] = {code:221, shift: false};\r\n _keys['['] = {code:219, shift: false};\r\n\r\n\r\n\r\n var down = function(event) {handleEvent(event,'keydown');};\r\n var up = function(event) {handleEvent(event,'keyup');};\r\n\r\n // handle the actualy bound key with the event\r\n var handleEvent = function(event,type) {\r\n if (_bound[type][event.keyCode] !== undefined) {\r\n var bound = _bound[type][event.keyCode];\r\n for (var i = 0; i < bound.length; i++) {\r\n if (bound[i].shift === undefined) {\r\n bound[i].fn(event);\r\n }\r\n else if (bound[i].shift == true && event.shiftKey == true) {\r\n bound[i].fn(event);\r\n }\r\n else if (bound[i].shift == false && event.shiftKey == false) {\r\n bound[i].fn(event);\r\n }\r\n }\r\n\r\n if (preventDefault == true) {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n // bind a key to a callback\r\n _exportFunctions.bind = function(key, callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n if (_keys[key] === undefined) {\r\n throw new Error(\"unsupported key: \" + key);\r\n }\r\n if (_bound[type][_keys[key].code] === undefined) {\r\n _bound[type][_keys[key].code] = [];\r\n }\r\n _bound[type][_keys[key].code].push({fn:callback, shift:_keys[key].shift});\r\n };\r\n\r\n\r\n // bind all keys to a call back (demo purposes)\r\n _exportFunctions.bindAll = function(callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n for (var key in _keys) {\r\n if (_keys.hasOwnProperty(key)) {\r\n _exportFunctions.bind(key,callback,type);\r\n }\r\n }\r\n };\r\n\r\n // get the key label from an event\r\n _exportFunctions.getKey = function(event) {\r\n for (var key in _keys) {\r\n if (_keys.hasOwnProperty(key)) {\r\n if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) {\r\n return key;\r\n }\r\n else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) {\r\n return key;\r\n }\r\n else if (event.keyCode == _keys[key].code && key == 'shift') {\r\n return key;\r\n }\r\n }\r\n }\r\n return \"unknown key, currently not supported\";\r\n };\r\n\r\n // unbind either a specific callback from a key or all of them (by leaving callback undefined)\r\n _exportFunctions.unbind = function(key, callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n if (_keys[key] === undefined) {\r\n throw new Error(\"unsupported key: \" + key);\r\n }\r\n if (callback !== undefined) {\r\n var newBindings = [];\r\n var bound = _bound[type][_keys[key].code];\r\n if (bound !== undefined) {\r\n for (var i = 0; i < bound.length; i++) {\r\n if (!(bound[i].fn == callback && bound[i].shift == _keys[key].shift)) {\r\n newBindings.push(_bound[type][_keys[key].code][i]);\r\n }\r\n }\r\n }\r\n _bound[type][_keys[key].code] = newBindings;\r\n }\r\n else {\r\n _bound[type][_keys[key].code] = [];\r\n }\r\n };\r\n\r\n // reset all bound variables.\r\n _exportFunctions.reset = function() {\r\n _bound = {keydown:{}, keyup:{}};\r\n };\r\n\r\n // unbind all listeners and reset all variables.\r\n _exportFunctions.destroy = function() {\r\n _bound = {keydown:{}, keyup:{}};\r\n container.removeEventListener('keydown', down, true);\r\n container.removeEventListener('keyup', up, true);\r\n };\r\n\r\n // create listeners.\r\n container.addEventListener('keydown',down,true);\r\n container.addEventListener('keyup',up,true);\r\n\r\n // return the public functions.\r\n return _exportFunctions;\r\n }\r\n\r\n return keycharm;\r\n}));\r\n\r\n\r\n","import keycharm from 'keycharm';\nimport Emitter from 'emitter-component';\nimport Hammer from '../module/hammer';\nimport util from '../util';\n\nimport './activator.css';\n\n/**\n * Turn an element into an clickToUse element.\n * When not active, the element has a transparent overlay. When the overlay is\n * clicked, the mode is changed to active.\n * When active, the element is displayed with a blue border around it, and\n * the interactive contents of the element can be used. When clicked outside\n * the element, the elements mode is changed to inactive.\n * @param {Element} container\n * @constructor Activator\n */\nfunction Activator(container) {\n this.active = false;\n\n this.dom = {\n container: container\n };\n\n this.dom.overlay = document.createElement('div');\n this.dom.overlay.className = 'vis-overlay';\n\n this.dom.container.appendChild(this.dom.overlay);\n\n this.hammer = Hammer(this.dom.overlay);\n this.hammer.on('tap', this._onTapOverlay.bind(this));\n\n // block all touch events (except tap)\n var me = this;\n var events = [\n 'tap', 'doubletap', 'press',\n 'pinch',\n 'pan', 'panstart', 'panmove', 'panend'\n ];\n events.forEach(function (event) {\n me.hammer.on(event, function (event) {\n event.stopPropagation();\n });\n });\n\n // attach a click event to the window, in order to deactivate when clicking outside the timeline\n if (document && document.body) {\n this.onClick = function (event) {\n if (!_hasParent(event.target, container)) {\n me.deactivate();\n }\n };\n document.body.addEventListener('click', this.onClick);\n }\n\n if (this.keycharm !== undefined) {\n this.keycharm.destroy();\n }\n this.keycharm = keycharm();\n\n // keycharm listener only bounded when active)\n this.escListener = this.deactivate.bind(this);\n}\n\n// turn into an event emitter\nEmitter(Activator.prototype);\n\n// The currently active activator\nActivator.current = null;\n\n/**\n * Destroy the activator. Cleans up all created DOM and event listeners\n */\nActivator.prototype.destroy = function () {\n this.deactivate();\n\n // remove dom\n this.dom.overlay.parentNode.removeChild(this.dom.overlay);\n\n // remove global event listener\n if (this.onClick) {\n document.body.removeEventListener('click', this.onClick);\n }\n // remove keycharm\n if (this.keycharm !== undefined) {\n this.keycharm.destroy();\n }\n this.keycharm = null;\n // cleanup hammer instances\n this.hammer.destroy();\n this.hammer = null;\n // FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory)\n};\n\n/**\n * Activate the element\n * Overlay is hidden, element is decorated with a blue shadow border\n */\nActivator.prototype.activate = function () {\n // we allow only one active activator at a time\n if (Activator.current) {\n Activator.current.deactivate();\n }\n Activator.current = this;\n\n this.active = true;\n this.dom.overlay.style.display = 'none';\n util.addClassName(this.dom.container, 'vis-active');\n\n this.emit('change');\n this.emit('activate');\n\n // ugly hack: bind ESC after emitting the events, as the Network rebinds all\n // keyboard events on a 'change' event\n this.keycharm.bind('esc', this.escListener);\n};\n\n/**\n * Deactivate the element\n * Overlay is displayed on top of the element\n */\nActivator.prototype.deactivate = function () {\n this.active = false;\n this.dom.overlay.style.display = '';\n util.removeClassName(this.dom.container, 'vis-active');\n this.keycharm.unbind('esc', this.escListener);\n\n this.emit('change');\n this.emit('deactivate');\n};\n\n/**\n * Handle a tap event: activate the container\n * @param {Event} event The event\n * @private\n */\nActivator.prototype._onTapOverlay = function (event) {\n // activate the container\n this.activate();\n event.stopPropagation();\n};\n\n/**\n * Test whether the element has the requested parent element somewhere in\n * its chain of parent nodes.\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @returns {boolean} Returns true when the parent is found somewhere in the\n * chain of parent nodes.\n * @private\n */\nfunction _hasParent(element, parent) {\n while (element) {\n if (element === parent) {\n return true\n }\n element = element.parentNode;\n }\n return false;\n}\n\nexport default Activator;\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n var it = moment.defineLocale('it', {\n months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),\n weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Oggi alle] LT',\n nextDay: '[Domani alle] LT',\n nextWeek: 'dddd [alle] LT',\n lastDay: '[Ieri alle] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[la scorsa] dddd [alle] LT';\n default:\n return '[lo scorso] dddd [alle] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : function (s) {\n return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;\n },\n past : '%s fa',\n s : 'alcuni secondi',\n ss : '%d secondi',\n m : 'un minuto',\n mm : '%d minuti',\n h : 'un\\'ora',\n hh : '%d ore',\n d : 'un giorno',\n dd : '%d giorni',\n M : 'un mese',\n MM : '%d mesi',\n y : 'un anno',\n yy : '%d anni'\n },\n dayOfMonthOrdinalParse : /\\d{1,2}º/,\n ordinal: '%dº',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return it;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\n var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];\n var monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\n var nl = moment.defineLocale('nl', {\n months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n monthsShort : function (m, format) {\n if (!m) {\n return monthsShortWithDots;\n } else if (/-MMM-/.test(format)) {\n return monthsShortWithoutDots[m.month()];\n } else {\n return monthsShortWithDots[m.month()];\n }\n },\n\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,\n monthsShortStrictRegex: /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n monthsParse : monthsParse,\n longMonthsParse : monthsParse,\n shortMonthsParse : monthsParse,\n\n weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD-MM-YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[vandaag om] LT',\n nextDay: '[morgen om] LT',\n nextWeek: 'dddd [om] LT',\n lastDay: '[gisteren om] LT',\n lastWeek: '[afgelopen] dddd [om] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'over %s',\n past : '%s geleden',\n s : 'een paar seconden',\n ss : '%d seconden',\n m : 'één minuut',\n mm : '%d minuten',\n h : 'één uur',\n hh : '%d uur',\n d : 'één dag',\n dd : '%d dagen',\n M : 'één maand',\n MM : '%d maanden',\n y : 'één jaar',\n yy : '%d jaar'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n ordinal : function (number) {\n return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return nl;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 'm': ['eine Minute', 'einer Minute'],\n 'h': ['eine Stunde', 'einer Stunde'],\n 'd': ['ein Tag', 'einem Tag'],\n 'dd': [number + ' Tage', number + ' Tagen'],\n 'M': ['ein Monat', 'einem Monat'],\n 'MM': [number + ' Monate', number + ' Monaten'],\n 'y': ['ein Jahr', 'einem Jahr'],\n 'yy': [number + ' Jahre', number + ' Jahren']\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n\n var de = moment.defineLocale('de', {\n months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n monthsParseExact : true,\n weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY HH:mm',\n LLLL : 'dddd, D. MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]'\n },\n relativeTime : {\n future : 'in %s',\n past : 'vor %s',\n s : 'ein paar Sekunden',\n ss : '%d Sekunden',\n m : processRelativeTime,\n mm : '%d Minuten',\n h : processRelativeTime,\n hh : '%d Stunden',\n d : processRelativeTime,\n dd : processRelativeTime,\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return de;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n var fr = moment.defineLocale('fr', {\n months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n monthsParseExact : true,\n weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Aujourd’hui à] LT',\n nextDay : '[Demain à] LT',\n nextWeek : 'dddd [à] LT',\n lastDay : '[Hier à] LT',\n lastWeek : 'dddd [dernier à] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'dans %s',\n past : 'il y a %s',\n s : 'quelques secondes',\n ss : '%d secondes',\n m : 'une minute',\n mm : '%d minutes',\n h : 'une heure',\n hh : '%d heures',\n d : 'un jour',\n dd : '%d jours',\n M : 'un mois',\n MM : '%d mois',\n y : 'un an',\n yy : '%d ans'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|)/,\n ordinal : function (number, period) {\n switch (period) {\n // TODO: Return 'e' when day of month > 1. Move this case inside\n // block for masculine words below.\n // See https://github.com/moment/moment/issues/3375\n case 'D':\n return number + (number === 1 ? 'er' : '');\n\n // Words with masculine grammatical gender: mois, trimestre, jour\n default:\n case 'M':\n case 'Q':\n case 'DDD':\n case 'd':\n return number + (number === 1 ? 'er' : 'e');\n\n // Words with feminine grammatical gender: semaine\n case 'w':\n case 'W':\n return number + (number === 1 ? 're' : 'e');\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return fr;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\n var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];\n var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n var es = moment.defineLocale('es', {\n months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n monthsShort : function (m, format) {\n if (!m) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[m.month()];\n } else {\n return monthsShortDot[m.month()];\n }\n },\n monthsRegex : monthsRegex,\n monthsShortRegex : monthsRegex,\n monthsStrictRegex : /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex : /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse : monthsParse,\n longMonthsParse : monthsParse,\n shortMonthsParse : monthsParse,\n weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D [de] MMMM [de] YYYY',\n LLL : 'D [de] MMMM [de] YYYY H:mm',\n LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'\n },\n calendar : {\n sameDay : function () {\n return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n nextDay : function () {\n return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n nextWeek : function () {\n return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n lastDay : function () {\n return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n lastWeek : function () {\n return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'en %s',\n past : 'hace %s',\n s : 'unos segundos',\n ss : '%d segundos',\n m : 'un minuto',\n mm : '%d minutos',\n h : 'una hora',\n hh : '%d horas',\n d : 'un día',\n dd : '%d días',\n M : 'un mes',\n MM : '%d meses',\n y : 'un año',\n yy : '%d años'\n },\n dayOfMonthOrdinalParse : /\\d{1,2}º/,\n ordinal : '%dº',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return es;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n function plural(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n 'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',\n 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',\n 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',\n 'dd': 'день_дні_днів',\n 'MM': 'місяць_місяці_місяців',\n 'yy': 'рік_роки_років'\n };\n if (key === 'm') {\n return withoutSuffix ? 'хвилина' : 'хвилину';\n }\n else if (key === 'h') {\n return withoutSuffix ? 'година' : 'годину';\n }\n else {\n return number + ' ' + plural(format[key], +number);\n }\n }\n function weekdaysCaseReplace(m, format) {\n var weekdays = {\n 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),\n 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),\n 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')\n };\n\n if (m === true) {\n return weekdays['nominative'].slice(1, 7).concat(weekdays['nominative'].slice(0, 1));\n }\n if (!m) {\n return weekdays['nominative'];\n }\n\n var nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n 'accusative' :\n ((/\\[?(?:минулої|наступної)? ?\\] ?dddd/).test(format) ?\n 'genitive' :\n 'nominative');\n return weekdays[nounCase][m.day()];\n }\n function processHoursFunction(str) {\n return function () {\n return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n };\n }\n\n var uk = moment.defineLocale('uk', {\n months : {\n 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),\n 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')\n },\n monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),\n weekdays : weekdaysCaseReplace,\n weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY р.',\n LLL : 'D MMMM YYYY р., HH:mm',\n LLLL : 'dddd, D MMMM YYYY р., HH:mm'\n },\n calendar : {\n sameDay: processHoursFunction('[Сьогодні '),\n nextDay: processHoursFunction('[Завтра '),\n lastDay: processHoursFunction('[Вчора '),\n nextWeek: processHoursFunction('[У] dddd ['),\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n case 3:\n case 5:\n case 6:\n return processHoursFunction('[Минулої] dddd [').call(this);\n case 1:\n case 2:\n case 4:\n return processHoursFunction('[Минулого] dddd [').call(this);\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'за %s',\n past : '%s тому',\n s : 'декілька секунд',\n ss : relativeTimeWithPlural,\n m : relativeTimeWithPlural,\n mm : relativeTimeWithPlural,\n h : 'годину',\n hh : relativeTimeWithPlural,\n d : 'день',\n dd : relativeTimeWithPlural,\n M : 'місяць',\n MM : relativeTimeWithPlural,\n y : 'рік',\n yy : relativeTimeWithPlural\n },\n // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n meridiemParse: /ночі|ранку|дня|вечора/,\n isPM: function (input) {\n return /^(дня|вечора)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ночі';\n } else if (hour < 12) {\n return 'ранку';\n } else if (hour < 17) {\n return 'дня';\n } else {\n return 'вечора';\n }\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(й|го)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n case 'w':\n case 'W':\n return number + '-й';\n case 'D':\n return number + '-го';\n default:\n return number;\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 7th is the first week of the year.\n }\n });\n\n return uk;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n function plural(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n 'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',\n 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n 'hh': 'час_часа_часов',\n 'dd': 'день_дня_дней',\n 'MM': 'месяц_месяца_месяцев',\n 'yy': 'год_года_лет'\n };\n if (key === 'm') {\n return withoutSuffix ? 'минута' : 'минуту';\n }\n else {\n return number + ' ' + plural(format[key], +number);\n }\n }\n var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];\n\n // http://new.gramota.ru/spravka/rules/139-prop : § 103\n // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637\n // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753\n var ru = moment.defineLocale('ru', {\n months : {\n format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),\n standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')\n },\n monthsShort : {\n // по CLDR именно \"июл.\" и \"июн.\", но какой смысл менять букву на точку ?\n format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),\n standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')\n },\n weekdays : {\n standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),\n format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),\n isFormat: /\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\\] ?dddd/\n },\n weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n monthsParse : monthsParse,\n longMonthsParse : monthsParse,\n shortMonthsParse : monthsParse,\n\n // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки\n monthsRegex: /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n // копия предыдущего\n monthsShortRegex: /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n // полные названия с падежами\n monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,\n\n // Выражение, которое соотвествует только сокращённым формам\n monthsShortStrictRegex: /^(янв\\.|февр?\\.|мар[т.]|апр\\.|ма[яй]|июн[ья.]|июл[ья.]|авг\\.|сент?\\.|окт\\.|нояб?\\.|дек\\.)/i,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY г.',\n LLL : 'D MMMM YYYY г., H:mm',\n LLLL : 'dddd, D MMMM YYYY г., H:mm'\n },\n calendar : {\n sameDay: '[Сегодня, в] LT',\n nextDay: '[Завтра, в] LT',\n lastDay: '[Вчера, в] LT',\n nextWeek: function (now) {\n if (now.week() !== this.week()) {\n switch (this.day()) {\n case 0:\n return '[В следующее] dddd, [в] LT';\n case 1:\n case 2:\n case 4:\n return '[В следующий] dddd, [в] LT';\n case 3:\n case 5:\n case 6:\n return '[В следующую] dddd, [в] LT';\n }\n } else {\n if (this.day() === 2) {\n return '[Во] dddd, [в] LT';\n } else {\n return '[В] dddd, [в] LT';\n }\n }\n },\n lastWeek: function (now) {\n if (now.week() !== this.week()) {\n switch (this.day()) {\n case 0:\n return '[В прошлое] dddd, [в] LT';\n case 1:\n case 2:\n case 4:\n return '[В прошлый] dddd, [в] LT';\n case 3:\n case 5:\n case 6:\n return '[В прошлую] dddd, [в] LT';\n }\n } else {\n if (this.day() === 2) {\n return '[Во] dddd, [в] LT';\n } else {\n return '[В] dddd, [в] LT';\n }\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'через %s',\n past : '%s назад',\n s : 'несколько секунд',\n ss : relativeTimeWithPlural,\n m : relativeTimeWithPlural,\n mm : relativeTimeWithPlural,\n h : 'час',\n hh : relativeTimeWithPlural,\n d : 'день',\n dd : relativeTimeWithPlural,\n M : 'месяц',\n MM : relativeTimeWithPlural,\n y : 'год',\n yy : relativeTimeWithPlural\n },\n meridiemParse: /ночи|утра|дня|вечера/i,\n isPM : function (input) {\n return /^(дня|вечера)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ночи';\n } else if (hour < 12) {\n return 'утра';\n } else if (hour < 17) {\n return 'дня';\n } else {\n return 'вечера';\n }\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(й|го|я)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n return number + '-й';\n case 'D':\n return number + '-го';\n case 'w':\n case 'W':\n return number + '-я';\n default:\n return number;\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return ru;\n\n})));\n","//! moment.js locale configuration\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n\n var ja = moment.defineLocale('ja', {\n months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n weekdaysShort : '日_月_火_水_木_金_土'.split('_'),\n weekdaysMin : '日_月_火_水_木_金_土'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY/MM/DD',\n LL : 'YYYY年M月D日',\n LLL : 'YYYY年M月D日 HH:mm',\n LLLL : 'YYYY年M月D日 dddd HH:mm',\n l : 'YYYY/MM/DD',\n ll : 'YYYY年M月D日',\n lll : 'YYYY年M月D日 HH:mm',\n llll : 'YYYY年M月D日(ddd) HH:mm'\n },\n meridiemParse: /午前|午後/i,\n isPM : function (input) {\n return input === '午後';\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return '午前';\n } else {\n return '午後';\n }\n },\n calendar : {\n sameDay : '[今日] LT',\n nextDay : '[明日] LT',\n nextWeek : function (now) {\n if (now.week() < this.week()) {\n return '[来週]dddd LT';\n } else {\n return 'dddd LT';\n }\n },\n lastDay : '[昨日] LT',\n lastWeek : function (now) {\n if (this.week() < now.week()) {\n return '[先週]dddd LT';\n } else {\n return 'dddd LT';\n }\n },\n sameElse : 'L'\n },\n dayOfMonthOrdinalParse : /\\d{1,2}日/,\n ordinal : function (number, period) {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return number + '日';\n default:\n return number;\n }\n },\n relativeTime : {\n future : '%s後',\n past : '%s前',\n s : '数秒',\n ss : '%d秒',\n m : '1分',\n mm : '%d分',\n h : '1時間',\n hh : '%d時間',\n d : '1日',\n dd : '%d日',\n M : '1ヶ月',\n MM : '%dヶ月',\n y : '1年',\n yy : '%d年'\n }\n });\n\n return ja;\n\n})));\n","\n// English\nconst en = {\n current: 'current',\n time: 'time',\n deleteSelected: 'Delete selected',\n};\nconst en_EN = en;\nconst en_US = en;\n\n// Italiano\nimport 'moment/locale/it';\nconst it = {\n current: 'attuale',\n time: 'tempo',\n deleteSelected: 'Cancella la selezione',\n};\nconst it_IT = it;\nconst it_CH = it;\n\n// Dutch\nimport 'moment/locale/nl';\nconst nl = {\n current: 'huidige',\n time: 'tijd',\n deleteSelected: 'Selectie verwijderen'\n};\nconst nl_NL = nl;\nconst nl_BE = nl;\n\n// German\nimport 'moment/locale/de';\nconst de = {\n current: 'Aktuelle',\n time: 'Zeit',\n deleteSelected: 'L\\u00f6sche Auswahl',\n};\nconst de_DE = de;\n\n// French\nimport 'moment/locale/fr';\nconst fr = {\n current: 'actuel',\n time: 'heure',\n deleteSelected: 'Effacer la selection',\n};\nconst fr_FR = fr;\nconst fr_CA = fr;\nconst fr_BE = fr;\n\n// Espanol\nimport 'moment/locale/es';\nconst es = {\n current: 'corriente',\n time: 'hora',\n deleteSelected: 'Eliminar selecci\\u00f3n',\n};\nconst es_ES = es;\n\n// Ukrainian\nimport 'moment/locale/uk';\nconst uk = {\n current: 'поточний',\n time: 'час',\n deleteSelected: 'Видалити обране',\n};\nconst uk_UA = uk;\n\n// Russian\nimport 'moment/locale/ru';\nconst ru = {\n current: 'текущее',\n time: 'время',\n deleteSelected: 'Удалить выбранное',\n};\nconst ru_RU = ru;\n\n// Japanese\nimport 'moment/locale/ja';\nconst ja = {\n current: '現在',\n time: '時刻',\n deleteSelected: '選択されたものを削除',\n};\nconst ja_JP = ja;\n\nconst locales = {\n en,\n en_EN,\n en_US,\n it,\n it_IT,\n it_CH,\n nl,\n nl_NL,\n nl_BE,\n de,\n de_DE,\n fr,\n fr_FR,\n fr_CA,\n fr_BE,\n es,\n es_ES,\n uk,\n uk_UA,\n ru,\n ru_RU,\n ja,\n ja_JP,\n}\n\nexport default locales","import Hammer from '../../module/hammer';\nimport util from '../../util';\nimport Component from './Component';\nimport moment from '../../module/moment';\nimport locales from '../locales';\n\nimport './css/customtime.css';\n\n/** A custom time bar */\nclass CustomTime extends Component {\n /**\n * @param {{range: Range, dom: Object}} body\n * @param {Object} [options] Available parameters:\n * {number | string} id\n * {string} locales\n * {string} locale\n * @constructor CustomTime\n * @extends Component\n */\n constructor(body, options) {\n super()\n this.body = body;\n\n // default options\n this.defaultOptions = {\n moment,\n locales,\n locale: 'en',\n id: undefined,\n title: undefined\n };\n this.options = util.extend({}, this.defaultOptions);\n this.setOptions(options);\n this.options.locales = util.extend({}, locales, this.options.locales);\n const defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale];\n Object.keys(this.options.locales).forEach(locale => {\n this.options.locales[locale] = util.extend(\n {},\n defaultLocales,\n this.options.locales[locale]\n );\n });\n\n if (options && options.time) {\n this.customTime = options.time;\n } else {\n this.customTime = new Date();\n }\n\n this.eventParams = {}; // stores state parameters while dragging the bar\n\n // create the DOM\n this._create();\n }\n\n /**\n * Set options for the component. Options will be merged in current options.\n * @param {Object} options Available parameters:\n * {number | string} id\n * {string} locales\n * {string} locale\n */\n setOptions(options) {\n if (options) {\n // copy all options that we know\n util.selectiveExtend(['moment', 'locale', 'locales', 'id', 'title', 'rtl'], this.options, options);\n }\n }\n\n /**\n * Create the DOM for the custom time\n * @private\n */\n _create() {\n const bar = document.createElement('div');\n bar['custom-time'] = this;\n bar.className = `vis-custom-time ${this.options.id || ''}`;\n bar.style.position = 'absolute';\n bar.style.top = '0px';\n bar.style.height = '100%';\n this.bar = bar;\n\n const drag = document.createElement('div');\n drag.style.position = 'relative';\n drag.style.top = '0px';\n if(this.options.rtl) {\n drag.style.right = '-10px';\n } else {\n drag.style.left = '-10px';\n }\n drag.style.height = '100%';\n drag.style.width = '20px';\n\n /**\n *\n * @param {WheelEvent} e\n */\n function onMouseWheel (e) {\n this.body.range._onMouseWheel(e);\n }\n\n if (drag.addEventListener) {\n // IE9, Chrome, Safari, Opera\n drag.addEventListener(\"mousewheel\", onMouseWheel.bind(this), false);\n // Firefox\n drag.addEventListener(\"DOMMouseScroll\", onMouseWheel.bind(this), false);\n } else {\n // IE 6/7/8\n drag.attachEvent(\"onmousewheel\", onMouseWheel.bind(this));\n }\n\n bar.appendChild(drag);\n // attach event listeners\n this.hammer = new Hammer(drag);\n this.hammer.on('panstart', this._onDragStart.bind(this));\n this.hammer.on('panmove', this._onDrag.bind(this));\n this.hammer.on('panend', this._onDragEnd.bind(this));\n this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_ALL});\n }\n\n /**\n * Destroy the CustomTime bar\n */\n destroy() {\n this.hide();\n\n this.hammer.destroy();\n this.hammer = null;\n\n this.body = null;\n }\n\n /**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\n redraw() {\n const parent = this.body.dom.backgroundVertical;\n if (this.bar.parentNode != parent) {\n // attach to the dom\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n parent.appendChild(this.bar);\n }\n\n const x = this.body.util.toScreen(this.customTime);\n\n let locale = this.options.locales[this.options.locale];\n if (!locale) {\n if (!this.warned) {\n console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`);\n this.warned = true;\n }\n locale = this.options.locales['en']; // fall back on english when not available\n }\n\n let title = this.options.title;\n // To hide the title completely use empty string ''.\n if (title === undefined) {\n title = `${locale.time}: ${this.options.moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss')}`;\n title = title.charAt(0).toUpperCase() + title.substring(1);\n } else if (typeof title === \"function\") {\n title = title.call(this.customTime);\n }\n\n this.options.rtl ? this.bar.style.right = `${x}px` : this.bar.style.left = `${x}px`;\n this.bar.title = title;\n\n return false;\n }\n\n /**\n * Remove the CustomTime from the DOM\n */\n hide() {\n // remove the line from the DOM\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n }\n\n /**\n * Set custom time.\n * @param {Date | number | string} time\n */\n setCustomTime(time) {\n this.customTime = util.convert(time, 'Date');\n this.redraw();\n }\n\n /**\n * Retrieve the current custom time.\n * @return {Date} customTime\n */\n getCustomTime() {\n return new Date(this.customTime.valueOf());\n }\n\n /**\n * Set custom marker.\n * @param {string} [title] Title of the custom marker\n * @param {boolean} [editable] Make the custom marker editable.\n */\n setCustomMarker(title, editable) {\n const marker = document.createElement('div');\n marker.className = `vis-custom-time-marker`;\n marker.innerHTML = title;\n marker.style.position = 'absolute';\n\n if (editable) {\n marker.setAttribute('contenteditable', 'true');\n marker.addEventListener('pointerdown', function () {\n marker.focus();\n });\n marker.addEventListener('input', this._onMarkerChange.bind(this));\n // The editable div element has no change event, so here emulates the change event.\n marker.title = title;\n marker.addEventListener('blur', function (event) {\n if (this.title != event.target.innerHTML) {\n this._onMarkerChanged(event);\n this.title = event.target.innerHTML;\n }\n }.bind(this));\n }\n\n this.bar.appendChild(marker);\n }\n\n /**\n * Set custom title.\n * @param {Date | number | string} title\n */\n setCustomTitle(title) {\n this.options.title = title;\n }\n\n /**\n * Start moving horizontally\n * @param {Event} event\n * @private\n */\n _onDragStart(event) {\n this.eventParams.dragging = true;\n this.eventParams.customTime = this.customTime;\n\n event.stopPropagation();\n }\n\n /**\n * Perform moving operating.\n * @param {Event} event\n * @private\n */\n _onDrag(event) {\n if (!this.eventParams.dragging) return;\n\n let deltaX = this.options.rtl ? (-1) * event.deltaX : event.deltaX;\n\n const x = this.body.util.toScreen(this.eventParams.customTime) + deltaX;\n const time = this.body.util.toTime(x);\n\n this.setCustomTime(time);\n\n // fire a timechange event\n this.body.emitter.emit('timechange', {\n id: this.options.id,\n time: new Date(this.customTime.valueOf()),\n event\n });\n\n event.stopPropagation();\n }\n\n /**\n * Stop moving operating.\n * @param {Event} event\n * @private\n */\n _onDragEnd(event) {\n if (!this.eventParams.dragging) return;\n\n // fire a timechanged event\n this.body.emitter.emit('timechanged', {\n id: this.options.id,\n time: new Date(this.customTime.valueOf()),\n event\n });\n\n event.stopPropagation();\n }\n\n /**\n * Perform input operating.\n * @param {Event} event\n * @private\n */\n _onMarkerChange(event) {\n this.body.emitter.emit('markerchange', {\n id: this.options.id,\n title: event.target.innerHTML,\n event\n });\n \n event.stopPropagation();\n }\n\n /**\n * Perform change operating.\n * @param {Event} event\n * @private\n */\n _onMarkerChanged(event) {\n this.body.emitter.emit('markerchanged', {\n id: this.options.id,\n title: event.target.innerHTML,\n event\n });\n\n event.stopPropagation();\n }\n\n /**\n * Find a custom time from an event target:\n * searches for the attribute 'custom-time' in the event target's element tree\n * @param {Event} event\n * @return {CustomTime | null} customTime\n */\n static customTimeFromTarget(event) {\n let target = event.target;\n while (target) {\n if (target.hasOwnProperty('custom-time')) {\n return target['custom-time'];\n }\n target = target.parentNode;\n }\n\n return null;\n }\n}\n\nexport default CustomTime;\n","import Emitter from 'emitter-component';\nimport Hammer from '../module/hammer';\nimport * as hammerUtil from '../hammerUtil';\nimport util from '../util';\nimport TimeAxis from './component/TimeAxis';\nimport Activator from '../shared/Activator';\nimport * as DateUtil from './DateUtil';\nimport CustomTime from './component/CustomTime';\n\nimport './component/css/animation.css';\nimport './component/css/currenttime.css';\nimport './component/css/panel.css';\nimport './component/css/pathStyles.css';\nimport './component/css/timeline.css';\nimport '../shared/bootstrap.css';\n\n/**\n * Create a timeline visualization\n * @constructor Core\n */\nclass Core {\n /**\n * Create the main DOM for the Core: a root panel containing left, right,\n * top, bottom, content, and background panel.\n * @param {Element} container The container element where the Core will\n * be attached.\n * @protected\n */\n _create(container) {\n this.dom = {};\n\n this.dom.container = container;\n this.dom.container.style.position = 'relative';\n\n this.dom.root = document.createElement('div');\n this.dom.background = document.createElement('div');\n this.dom.backgroundVertical = document.createElement('div');\n this.dom.backgroundHorizontal = document.createElement('div');\n this.dom.centerContainer = document.createElement('div');\n this.dom.leftContainer = document.createElement('div');\n this.dom.rightContainer = document.createElement('div');\n this.dom.center = document.createElement('div');\n this.dom.left = document.createElement('div');\n this.dom.right = document.createElement('div');\n this.dom.top = document.createElement('div');\n this.dom.bottom = document.createElement('div');\n this.dom.shadowTop = document.createElement('div');\n this.dom.shadowBottom = document.createElement('div');\n this.dom.shadowTopLeft = document.createElement('div');\n this.dom.shadowBottomLeft = document.createElement('div');\n this.dom.shadowTopRight = document.createElement('div');\n this.dom.shadowBottomRight = document.createElement('div');\n this.dom.rollingModeBtn = document.createElement('div');\n this.dom.loadingScreen = document.createElement('div');\n\n this.dom.root.className = 'vis-timeline';\n this.dom.background.className = 'vis-panel vis-background';\n this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical';\n this.dom.backgroundHorizontal.className = 'vis-panel vis-background vis-horizontal';\n this.dom.centerContainer.className = 'vis-panel vis-center';\n this.dom.leftContainer.className = 'vis-panel vis-left';\n this.dom.rightContainer.className = 'vis-panel vis-right';\n this.dom.top.className = 'vis-panel vis-top';\n this.dom.bottom.className = 'vis-panel vis-bottom';\n this.dom.left.className = 'vis-content';\n this.dom.center.className = 'vis-content';\n this.dom.right.className = 'vis-content';\n this.dom.shadowTop.className = 'vis-shadow vis-top';\n this.dom.shadowBottom.className = 'vis-shadow vis-bottom';\n this.dom.shadowTopLeft.className = 'vis-shadow vis-top';\n this.dom.shadowBottomLeft.className = 'vis-shadow vis-bottom';\n this.dom.shadowTopRight.className = 'vis-shadow vis-top';\n this.dom.shadowBottomRight.className = 'vis-shadow vis-bottom';\n this.dom.rollingModeBtn.className = 'vis-rolling-mode-btn';\n this.dom.loadingScreen.className = 'vis-loading-screen';\n\n this.dom.root.appendChild(this.dom.background);\n this.dom.root.appendChild(this.dom.backgroundVertical);\n this.dom.root.appendChild(this.dom.backgroundHorizontal);\n this.dom.root.appendChild(this.dom.centerContainer);\n this.dom.root.appendChild(this.dom.leftContainer);\n this.dom.root.appendChild(this.dom.rightContainer);\n this.dom.root.appendChild(this.dom.top);\n this.dom.root.appendChild(this.dom.bottom);\n this.dom.root.appendChild(this.dom.rollingModeBtn);\n\n this.dom.centerContainer.appendChild(this.dom.center);\n this.dom.leftContainer.appendChild(this.dom.left);\n this.dom.rightContainer.appendChild(this.dom.right);\n this.dom.centerContainer.appendChild(this.dom.shadowTop);\n this.dom.centerContainer.appendChild(this.dom.shadowBottom);\n this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);\n this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);\n this.dom.rightContainer.appendChild(this.dom.shadowTopRight);\n this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);\n \n // size properties of each of the panels\n this.props = {\n root: {},\n background: {},\n centerContainer: {},\n leftContainer: {},\n rightContainer: {},\n center: {},\n left: {},\n right: {},\n top: {},\n bottom: {},\n border: {},\n scrollTop: 0,\n scrollTopMin: 0\n };\n\n this.on('rangechange', () => {\n if (this.initialDrawDone === true) {\n this._redraw();\n }\n });\n this.on('rangechanged', () => {\n if (!this.initialRangeChangeDone) {\n this.initialRangeChangeDone = true;\n }\n });\n this.on('touch', this._onTouch.bind(this));\n this.on('panmove', this._onDrag.bind(this));\n\n const me = this;\n this._origRedraw = this._redraw.bind(this);\n this._redraw = util.throttle(this._origRedraw);\n\n this.on('_change', properties => {\n if (me.itemSet && me.itemSet.initialItemSetDrawn && properties && properties.queue == true) {\n me._redraw()\n } else {\n me._origRedraw();\n }\n });\n\n // create event listeners for all interesting events, these events will be\n // emitted via emitter\n this.hammer = new Hammer(this.dom.root);\n const pinchRecognizer = this.hammer.get('pinch').set({enable: true});\n pinchRecognizer && hammerUtil.disablePreventDefaultVertically(pinchRecognizer);\n this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_ALL});\n this.listeners = {};\n\n const events = [\n 'tap', 'doubletap', 'press',\n 'pinch',\n 'pan', 'panstart', 'panmove', 'panend'\n // TODO: cleanup\n //'touch', 'pinch',\n //'tap', 'doubletap', 'hold',\n //'dragstart', 'drag', 'dragend',\n //'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox\n ];\n events.forEach(type => {\n const listener = event => {\n if (me.isActive()) {\n me.emit(type, event);\n }\n };\n me.hammer.on(type, listener);\n me.listeners[type] = listener;\n });\n\n // emulate a touch event (emitted before the start of a pan, pinch, tap, or press)\n hammerUtil.onTouch(this.hammer, event => {\n me.emit('touch', event);\n });\n\n // emulate a release event (emitted after a pan, pinch, tap, or press)\n hammerUtil.onRelease(this.hammer, event => {\n me.emit('release', event);\n });\n\n /**\n *\n * @param {WheelEvent} event\n */\n function onMouseWheel(event) {\n\n // Reasonable default wheel deltas\n const LINE_HEIGHT = 40;\n const PAGE_HEIGHT = 800;\n\n if (this.isActive()) {\n this.emit('mousewheel', event);\n }\n\n // deltaX and deltaY normalization from jquery.mousewheel.js\n let deltaX = 0;\n let deltaY = 0;\n\n // Old school scrollwheel delta\n if ( 'detail' in event ) { deltaY = event.detail * -1; }\n if ( 'wheelDelta' in event ) { deltaY = event.wheelDelta; }\n if ( 'wheelDeltaY' in event ) { deltaY = event.wheelDeltaY; }\n if ( 'wheelDeltaX' in event ) { deltaX = event.wheelDeltaX * -1; }\n\n // Firefox < 17 horizontal scrolling related to DOMMouseScroll event\n if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {\n deltaX = deltaY * -1;\n deltaY = 0;\n }\n\n // New school wheel delta (wheel event)\n if ( 'deltaY' in event ) {\n deltaY = event.deltaY * -1;\n }\n if ( 'deltaX' in event ) {\n deltaX = event.deltaX;\n }\n\n // Normalize deltas\n if (event.deltaMode) {\n if (event.deltaMode === 1) { // delta in LINE units\n deltaX *= LINE_HEIGHT;\n deltaY *= LINE_HEIGHT;\n } else { // delta in PAGE units\n deltaX *= LINE_HEIGHT;\n deltaY *= PAGE_HEIGHT;\n }\n }\n // Prevent scrolling when zooming (no zoom key, or pressing zoom key)\n if (this.options.preferZoom) {\n if (!this.options.zoomKey || event[this.options.zoomKey]) return;\n } else {\n if (this.options.zoomKey && event[this.options.zoomKey]) return\n }\n // Don't preventDefault if you can't scroll\n if (!this.options.verticalScroll && !this.options.horizontalScroll) return;\n\n if (this.options.verticalScroll && Math.abs(deltaY) >= Math.abs(deltaX)) {\n const current = this.props.scrollTop;\n const adjusted = current + deltaY;\n\n if (this.isActive()) {\n const newScrollTop = this._setScrollTop(adjusted);\n\n if (newScrollTop !== current) {\n this._redraw();\n this.emit('scroll', event);\n\n // Prevent default actions caused by mouse wheel\n // (else the page and timeline both scroll)\n event.preventDefault();\n }\n }\n } else if (this.options.horizontalScroll) {\n const delta = Math.abs(deltaX) >= Math.abs(deltaY) ? deltaX : deltaY;\n\n // calculate a single scroll jump relative to the range scale\n const diff = (delta / 120) * (this.range.end - this.range.start) / 20;\n // calculate new start and end\n const newStart = this.range.start + diff;\n const newEnd = this.range.end + diff;\n\n const options = {\n animation: false,\n byUser: true,\n event\n };\n this.range.setRange(newStart, newEnd, options);\n\n event.preventDefault();\n }\n }\n\n // Add modern wheel event listener\n const wheelType = \"onwheel\" in document.createElement(\"div\") ? \"wheel\" : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? \"mousewheel\" : // Webkit and IE support at least \"mousewheel\"\n \n // DOMMouseScroll - Older Firefox versions use \"DOMMouseScroll\"\n // onmousewheel - All the use \"onmousewheel\"\n this.dom.centerContainer.addEventListener ? \"DOMMouseScroll\" : \"onmousewheel\"\n this.dom.top.addEventListener ? \"DOMMouseScroll\" : \"onmousewheel\"\n this.dom.bottom.addEventListener ? \"DOMMouseScroll\" : \"onmousewheel\"\n this.dom.centerContainer.addEventListener(wheelType, onMouseWheel.bind(this), false);\n this.dom.top.addEventListener(wheelType, onMouseWheel.bind(this), false);\n this.dom.bottom.addEventListener(wheelType, onMouseWheel.bind(this), false);\n\n\n /**\n *\n * @param {scroll} event\n */\n function onMouseScrollSide(event) {\n if (!me.options.verticalScroll) return;\n event.preventDefault();\n if (me.isActive()) {\n const adjusted = -event.target.scrollTop;\n me._setScrollTop(adjusted);\n me._redraw();\n me.emit('scrollSide', event);\n }\n }\n\n this.dom.left.parentNode.addEventListener('scroll', onMouseScrollSide.bind(this));\n this.dom.right.parentNode.addEventListener('scroll', onMouseScrollSide.bind(this));\n\n let itemAddedToTimeline = false;\n\n /**\n *\n * @param {dragover} event\n * @returns {boolean}\n */\n function handleDragOver(event) {\n if (event.preventDefault) {\n me.emit('dragover', me.getEventProperties(event));\n event.preventDefault(); // Necessary. Allows us to drop.\n }\n\n // make sure your target is a timeline element\n if (!(event.target.className.indexOf(\"timeline\") > -1)) return;\n\n // make sure only one item is added every time you're over the timeline\n if (itemAddedToTimeline) return;\n\n event.dataTransfer.dropEffect = 'move'; \n itemAddedToTimeline = true;\n return false;\n }\n\n /**\n *\n * @param {drop} event\n * @returns {boolean}\n */\n function handleDrop(event) {\n // prevent redirect to blank page - Firefox\n if(event.preventDefault) { event.preventDefault(); }\n if(event.stopPropagation) { event.stopPropagation(); }\n // return when dropping non-timeline items\n try {\n var itemData = JSON.parse(event.dataTransfer.getData(\"text\"))\n if (!itemData || !itemData.content) return\n } catch (err) {\n return false;\n }\n\n itemAddedToTimeline = false;\n event.center = {\n x: event.clientX,\n y: event.clientY\n };\n\n if (itemData.target !== 'item') {\n me.itemSet._onAddItem(event);\n } else {\n me.itemSet._onDropObjectOnItem(event);\n }\n me.emit('drop', me.getEventProperties(event))\n return false;\n }\n\n this.dom.center.addEventListener('dragover', handleDragOver.bind(this), false);\n this.dom.center.addEventListener('drop', handleDrop.bind(this), false);\n\n this.customTimes = [];\n\n // store state information needed for touch events\n this.touch = {};\n\n this.redrawCount = 0;\n this.initialDrawDone = false;\n this.initialRangeChangeDone = false;\n\n // attach the root panel to the provided container\n if (!container) throw new Error('No container provided');\n container.appendChild(this.dom.root);\n container.appendChild(this.dom.loadingScreen);\n }\n\n /**\n * Set options. Options will be passed to all components loaded in the Timeline.\n * @param {Object} [options]\n * {String} orientation\n * Vertical orientation for the Timeline,\n * can be 'bottom' (default) or 'top'.\n * {string | number} width\n * Width for the timeline, a number in pixels or\n * a css string like '1000px' or '75%'. '100%' by default.\n * {string | number} height\n * Fixed height for the Timeline, a number in pixels or\n * a css string like '400px' or '75%'. If undefined,\n * The Timeline will automatically size such that\n * its contents fit.\n * {string | number} minHeight\n * Minimum height for the Timeline, a number in pixels or\n * a css string like '400px' or '75%'.\n * {string | number} maxHeight\n * Maximum height for the Timeline, a number in pixels or\n * a css string like '400px' or '75%'.\n * {number | Date | string} start\n * Start date for the visible window\n * {number | Date | string} end\n * End date for the visible window\n */\n setOptions(options) {\n if (options) {\n // copy the known options\n const fields = [\n 'width', 'height', 'minHeight', 'maxHeight', 'autoResize',\n 'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates',\n 'locale', 'locales', 'moment', 'preferZoom', 'rtl', 'zoomKey', 'horizontalScroll', 'verticalScroll'\n ];\n util.selectiveExtend(fields, this.options, options); \n\n this.dom.rollingModeBtn.style.visibility = 'hidden';\n\n if (this.options.rtl) {\n this.dom.container.style.direction = \"rtl\";\n this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical-rtl'; \n }\n\n if (this.options.verticalScroll) {\n if (this.options.rtl) {\n this.dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll';\n } else {\n this.dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll';\n }\n }\n\n if (typeof this.options.orientation !== 'object') {\n this.options.orientation = {item:undefined,axis:undefined};\n }\n if ('orientation' in options) {\n if (typeof options.orientation === 'string') {\n this.options.orientation = {\n item: options.orientation,\n axis: options.orientation\n };\n }\n else if (typeof options.orientation === 'object') {\n if ('item' in options.orientation) {\n this.options.orientation.item = options.orientation.item;\n }\n if ('axis' in options.orientation) {\n this.options.orientation.axis = options.orientation.axis;\n }\n }\n }\n\n if (this.options.orientation.axis === 'both') {\n if (!this.timeAxis2) {\n const timeAxis2 = this.timeAxis2 = new TimeAxis(this.body);\n timeAxis2.setOptions = options => {\n const _options = options ? util.extend({}, options) : {};\n _options.orientation = 'top'; // override the orientation option, always top\n TimeAxis.prototype.setOptions.call(timeAxis2, _options);\n };\n this.components.push(timeAxis2);\n }\n }\n else {\n if (this.timeAxis2) {\n const index = this.components.indexOf(this.timeAxis2);\n if (index !== -1) {\n this.components.splice(index, 1);\n }\n this.timeAxis2.destroy();\n this.timeAxis2 = null;\n }\n }\n\n // if the graph2d's drawPoints is a function delegate the callback to the onRender property\n if (typeof options.drawPoints == 'function') {\n options.drawPoints = {\n onRender: options.drawPoints\n };\n }\n\n if ('hiddenDates' in this.options) {\n DateUtil.convertHiddenOptions(this.options.moment, this.body, this.options.hiddenDates);\n }\n\n if ('clickToUse' in options) {\n if (options.clickToUse) {\n if (!this.activator) {\n this.activator = new Activator(this.dom.root);\n }\n }\n else {\n if (this.activator) {\n this.activator.destroy();\n delete this.activator;\n }\n }\n }\n\n // enable/disable autoResize\n this._initAutoResize();\n }\n\n // propagate options to all components\n this.components.forEach(component => component.setOptions(options));\n\n // enable/disable configure\n if ('configure' in options) {\n if (!this.configurator) {\n this.configurator = this._createConfigurator();\n }\n\n this.configurator.setOptions(options.configure);\n\n // collect the settings of all components, and pass them to the configuration system\n const appliedOptions = util.deepExtend({}, this.options);\n this.components.forEach(component => {\n util.deepExtend(appliedOptions, component.options);\n });\n this.configurator.setModuleOptions({global: appliedOptions});\n }\n\n this._redraw();\n }\n\n /**\n * Returns true when the Timeline is active.\n * @returns {boolean}\n */\n isActive() {\n return !this.activator || this.activator.active;\n }\n\n /**\n * Destroy the Core, clean up all DOM elements and event listeners.\n */\n destroy() {\n // unbind datasets\n this.setItems(null);\n this.setGroups(null);\n\n // remove all event listeners\n this.off();\n\n // stop checking for changed size\n this._stopAutoResize();\n\n // remove from DOM\n if (this.dom.root.parentNode) {\n this.dom.root.parentNode.removeChild(this.dom.root);\n }\n this.dom = null;\n\n // remove Activator\n if (this.activator) {\n this.activator.destroy();\n delete this.activator;\n }\n\n // cleanup hammer touch events\n for (const event in this.listeners) {\n if (this.listeners.hasOwnProperty(event)) {\n delete this.listeners[event];\n }\n }\n this.listeners = null;\n this.hammer && this.hammer.destroy();\n this.hammer = null;\n\n // give all components the opportunity to cleanup\n this.components.forEach(component => component.destroy());\n\n this.body = null;\n }\n\n /**\n * Set a custom time bar\n * @param {Date} time\n * @param {number} [id=undefined] Optional id of the custom time bar to be adjusted.\n */\n setCustomTime(time, id) {\n const customTimes = this.customTimes.filter(component => id === component.options.id);\n\n if (customTimes.length === 0) {\n throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`)\n }\n\n if (customTimes.length > 0) {\n customTimes[0].setCustomTime(time);\n }\n }\n\n /**\n * Retrieve the current custom time.\n * @param {number} [id=undefined] Id of the custom time bar.\n * @return {Date | undefined} customTime\n */\n getCustomTime(id) {\n const customTimes = this.customTimes.filter(component => component.options.id === id);\n\n if (customTimes.length === 0) {\n throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`)\n }\n return customTimes[0].getCustomTime();\n }\n\n /**\n * Set a custom marker for the custom time bar.\n * @param {string} [title] Title of the custom marker.\n * @param {number} [id=undefined] Id of the custom marker.\n * @param {boolean} [editable=false] Make the custom marker editable.\n */\n setCustomTimeMarker(title, id, editable) {\n const customTimes = this.customTimes.filter(component => component.options.id === id);\n\n if (customTimes.length === 0) {\n throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`)\n }\n if (customTimes.length > 0) {\n customTimes[0].setCustomMarker(title, editable);\n }\n }\n\n /**\n * Set a custom title for the custom time bar.\n * @param {string} [title] Custom title\n * @param {number} [id=undefined] Id of the custom time bar.\n * @returns {*}\n */\n setCustomTimeTitle(title, id) {\n const customTimes = this.customTimes.filter(component => component.options.id === id);\n\n if (customTimes.length === 0) {\n throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`)\n }\n if (customTimes.length > 0) {\n return customTimes[0].setCustomTitle(title);\n }\n }\n\n /**\n * Retrieve meta information from an event.\n * Should be overridden by classes extending Core\n * @param {Event} event\n * @return {Object} An object with related information.\n */\n getEventProperties(event) {\n return { event };\n }\n\n /**\n * Add custom vertical bar\n * @param {Date | string | number} [time] A Date, unix timestamp, or\n * ISO date string. Time point where\n * the new bar should be placed.\n * If not provided, `new Date()` will\n * be used.\n * @param {number | string} [id=undefined] Id of the new bar. Optional\n * @return {number | string} Returns the id of the new bar\n */\n addCustomTime(time, id) {\n const timestamp = time !== undefined\n ? util.convert(time, 'Date').valueOf()\n : new Date();\n\n const exists = this.customTimes.some(customTime => customTime.options.id === id);\n if (exists) {\n throw new Error(`A custom time with id ${JSON.stringify(id)} already exists`);\n }\n\n const customTime = new CustomTime(this.body, util.extend({}, this.options, {\n time : timestamp,\n id\n }));\n\n this.customTimes.push(customTime);\n this.components.push(customTime);\n this._redraw();\n\n return id;\n }\n\n /**\n * Remove previously added custom bar\n * @param {int} id ID of the custom bar to be removed\n * [at]returns {boolean} True if the bar exists and is removed, false otherwise\n */\n removeCustomTime(id) {\n const customTimes = this.customTimes.filter(bar => bar.options.id === id);\n\n if (customTimes.length === 0) {\n throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`)\n }\n\n customTimes.forEach(customTime => {\n this.customTimes.splice(this.customTimes.indexOf(customTime), 1);\n this.components.splice(this.components.indexOf(customTime), 1);\n customTime.destroy();\n })\n }\n\n /**\n * Get the id's of the currently visible items.\n * @returns {Array} The ids of the visible items\n */\n getVisibleItems() {\n return this.itemSet && this.itemSet.getVisibleItems() || [];\n }\n\n /**\n * Get the id's of the currently visible groups.\n * @returns {Array} The ids of the visible groups\n */\n getVisibleGroups() {\n return this.itemSet && this.itemSet.getVisibleGroups() || [];\n }\n\n /**\n * Set Core window such that it fits all items\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {function} [callback] a callback funtion to be executed at the end of this function\n */\n fit(options, callback) {\n const range = this.getDataRange();\n\n // skip range set if there is no min and max date\n if (range.min === null && range.max === null) {\n return;\n }\n\n // apply a margin of 1% left and right of the data\n const interval = range.max - range.min;\n const min = new Date(range.min.valueOf() - interval * 0.01);\n const max = new Date(range.max.valueOf() + interval * 0.01);\n const animation = (options && options.animation !== undefined) ? options.animation : true;\n this.range.setRange(min, max, { animation }, callback);\n }\n\n /**\n * Calculate the data range of the items start and end dates\n * [at]returns {{min: [Date], max: [Date]}}\n * @protected\n */\n getDataRange() {\n // must be implemented by Timeline and Graph2d\n throw new Error('Cannot invoke abstract method getDataRange');\n }\n\n /**\n * Set the visible window. Both parameters are optional, you can change only\n * start or only end. Syntax:\n *\n * TimeLine.setWindow(start, end)\n * TimeLine.setWindow(start, end, options)\n * TimeLine.setWindow(range)\n *\n * Where start and end can be a Date, number, or string, and range is an\n * object with properties start and end.\n *\n * @param {Date | number | string | Object} [start] Start date of visible window\n * @param {Date | number | string} [end] End date of visible window\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {function} [callback] a callback funtion to be executed at the end of this function\n */\n setWindow(start, end, options, callback) {\n if (typeof arguments[2] == \"function\") {\n callback = arguments[2];\n options = {};\n }\n let animation;\n let range;\n if (arguments.length == 1) {\n range = arguments[0];\n animation = (range.animation !== undefined) ? range.animation : true;\n this.range.setRange(range.start, range.end, { animation });\n }\n else if (arguments.length == 2 && typeof arguments[1] == \"function\") {\n range = arguments[0];\n callback = arguments[1];\n animation = (range.animation !== undefined) ? range.animation : true;\n this.range.setRange(range.start, range.end, { animation }, callback);\n }\n else {\n animation = (options && options.animation !== undefined) ? options.animation : true;\n this.range.setRange(start, end, { animation }, callback);\n }\n }\n\n /**\n * Move the window such that given time is centered on screen.\n * @param {Date | number | string} time\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {function} [callback] a callback funtion to be executed at the end of this function\n */\n moveTo(time, options, callback) {\n if (typeof arguments[1] == \"function\") {\n callback = arguments[1];\n options = {};\n }\n const interval = this.range.end - this.range.start;\n const t = util.convert(time, 'Date').valueOf();\n\n const start = t - interval / 2;\n const end = t + interval / 2;\n const animation = (options && options.animation !== undefined) ? options.animation : true;\n\n this.range.setRange(start, end, { animation }, callback);\n }\n\n /**\n * Get the visible window\n * @return {{start: Date, end: Date}} Visible range\n */\n getWindow() {\n const range = this.range.getRange();\n return {\n start: new Date(range.start),\n end: new Date(range.end)\n };\n }\n\n /**\n * Zoom in the window such that given time is centered on screen.\n * @param {number} percentage - must be between [0..1]\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {function} [callback] a callback funtion to be executed at the end of this function\n */\n zoomIn(percentage, options, callback) {\n if (!percentage || percentage < 0 || percentage > 1) return;\n if (typeof arguments[1] == \"function\") {\n callback = arguments[1];\n options = {};\n }\n const range = this.getWindow();\n const start = range.start.valueOf();\n const end = range.end.valueOf();\n const interval = end - start;\n const newInterval = interval / (1 + percentage);\n const distance = (interval - newInterval) / 2;\n const newStart = start + distance;\n const newEnd = end - distance;\n\n this.setWindow(newStart, newEnd, options, callback);\n }\n\n /**\n * Zoom out the window such that given time is centered on screen.\n * @param {number} percentage - must be between [0..1]\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {function} [callback] a callback funtion to be executed at the end of this function\n */\n zoomOut(percentage, options, callback) {\n if (!percentage || percentage < 0 || percentage > 1) return\n if (typeof arguments[1] == \"function\") {\n callback = arguments[1];\n options = {};\n }\n const range = this.getWindow();\n const start = range.start.valueOf();\n const end = range.end.valueOf();\n const interval = end - start;\n const newStart = start - interval * percentage / 2;\n const newEnd = end + interval * percentage / 2;\n\n this.setWindow(newStart, newEnd, options, callback);\n }\n\n /**\n * Force a redraw. Can be overridden by implementations of Core\n *\n * Note: this function will be overridden on construction with a trottled version\n */\n redraw() {\n this._redraw();\n }\n\n /**\n * Redraw for internal use. Redraws all components. See also the public\n * method redraw.\n * @protected\n */\n _redraw() {\n this.redrawCount++;\n const dom = this.dom;\n \n if (!dom || !dom.container || dom.root.offsetWidth == 0) return; // when destroyed, or invisible\n \n let resized = false;\n const options = this.options;\n const props = this.props;\n\n DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);\n\n // update class names\n if (options.orientation == 'top') {\n util.addClassName(dom.root, 'vis-top');\n util.removeClassName(dom.root, 'vis-bottom');\n }\n else {\n util.removeClassName(dom.root, 'vis-top');\n util.addClassName(dom.root, 'vis-bottom');\n }\n\n if (options.rtl) {\n util.addClassName(dom.root, 'vis-rtl');\n util.removeClassName(dom.root, 'vis-ltr');\n } else {\n util.addClassName(dom.root, 'vis-ltr');\n util.removeClassName(dom.root, 'vis-rtl');\n }\n\n // update root width and height options\n dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');\n dom.root.style.minHeight = util.option.asSize(options.minHeight, '');\n dom.root.style.width = util.option.asSize(options.width, '');\n const rootOffsetWidth = dom.root.offsetWidth;\n\n // calculate border widths\n props.border.left = 1\n props.border.right = 1\n props.border.top = 1\n props.border.bottom = 1\n\n // calculate the heights. If any of the side panels is empty, we set the height to\n // minus the border width, such that the border will be invisible\n props.center.height = dom.center.offsetHeight;\n props.left.height = dom.left.offsetHeight;\n props.right.height = dom.right.offsetHeight;\n props.top.height = dom.top.clientHeight || -props.border.top;\n props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;\n\n // TODO: compensate borders when any of the panels is empty.\n\n // apply auto height\n // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)\n const contentHeight = Math.max(props.left.height, props.center.height, props.right.height);\n const autoHeight = props.top.height + contentHeight + props.bottom.height + props.border.top + props.border.bottom;\n dom.root.style.height = util.option.asSize(options.height, `${autoHeight}px`);\n\n // calculate heights of the content panels\n props.root.height = dom.root.offsetHeight;\n props.background.height = props.root.height;\n const containerHeight = props.root.height - props.top.height - props.bottom.height;\n props.centerContainer.height = containerHeight;\n props.leftContainer.height = containerHeight;\n props.rightContainer.height = props.leftContainer.height;\n\n // calculate the widths of the panels\n props.root.width = rootOffsetWidth;\n props.background.width = props.root.width;\n\n if (!this.initialDrawDone) {\n props.scrollbarWidth = util.getScrollBarWidth();\n }\n\n const leftContainerClientWidth = dom.leftContainer.clientWidth;\n const rightContainerClientWidth = dom.rightContainer.clientWidth;\n\n if (options.verticalScroll) {\n if (options.rtl) {\n props.left.width = leftContainerClientWidth || -props.border.left;\n props.right.width = rightContainerClientWidth + props.scrollbarWidth || -props.border.right;\n } else {\n props.left.width = leftContainerClientWidth + props.scrollbarWidth || -props.border.left;\n props.right.width = rightContainerClientWidth || -props.border.right;\n }\n } else {\n props.left.width = leftContainerClientWidth || -props.border.left;\n props.right.width = rightContainerClientWidth || -props.border.right;\n }\n\n this._setDOM();\n\n // update the scrollTop, feasible range for the offset can be changed\n // when the height of the Core or of the contents of the center changed\n let offset = this._updateScrollTop();\n\n // reposition the scrollable contents\n if (options.orientation.item != 'top') {\n offset += Math.max(props.centerContainer.height - props.center.height -\n props.border.top - props.border.bottom, 0);\n }\n dom.center.style.transform = `translateY(${offset}px)`;\n\n // show shadows when vertical scrolling is available\n const visibilityTop = props.scrollTop == 0 ? 'hidden' : '';\n const visibilityBottom = props.scrollTop == props.scrollTopMin ? 'hidden' : '';\n dom.shadowTop.style.visibility = visibilityTop;\n dom.shadowBottom.style.visibility = visibilityBottom;\n dom.shadowTopLeft.style.visibility = visibilityTop;\n dom.shadowBottomLeft.style.visibility = visibilityBottom;\n dom.shadowTopRight.style.visibility = visibilityTop;\n dom.shadowBottomRight.style.visibility = visibilityBottom;\n\n if (options.verticalScroll) {\n dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll';\n dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll';\n\n dom.shadowTopRight.style.visibility = \"hidden\";\n dom.shadowBottomRight.style.visibility = \"hidden\";\n dom.shadowTopLeft.style.visibility = \"hidden\";\n dom.shadowBottomLeft.style.visibility = \"hidden\";\n\n dom.left.style.top = '0px';\n dom.right.style.top = '0px';\n }\n\n if (!options.verticalScroll || props.center.height < props.centerContainer.height) {\n dom.left.style.top = `${offset}px`;\n dom.right.style.top = `${offset}px`;\n dom.rightContainer.className = dom.rightContainer.className.replace(new RegExp('(?:^|\\\\s)'+ 'vis-vertical-scroll' + '(?:\\\\s|$)'), ' ');\n dom.leftContainer.className = dom.leftContainer.className.replace(new RegExp('(?:^|\\\\s)'+ 'vis-vertical-scroll' + '(?:\\\\s|$)'), ' ');\n props.left.width = leftContainerClientWidth || -props.border.left;\n props.right.width = rightContainerClientWidth || -props.border.right;\n this._setDOM();\n }\n\n // enable/disable vertical panning\n const contentsOverflow = props.center.height > props.centerContainer.height;\n this.hammer.get('pan').set({\n direction: contentsOverflow ? Hammer.DIRECTION_ALL : Hammer.DIRECTION_HORIZONTAL\n });\n\n // redraw all components\n this.components.forEach(component => {\n resized = component.redraw() || resized;\n });\n const MAX_REDRAW = 5;\n if (resized) {\n if (this.redrawCount < MAX_REDRAW) {\n this.body.emitter.emit('_change');\n return;\n }\n else {\n console.log('WARNING: infinite loop in redraw?');\n }\n } else {\n this.redrawCount = 0;\n }\n\n //Emit public 'changed' event for UI updates, see issue #1592\n this.body.emitter.emit(\"changed\");\n }\n\n /**\n * sets the basic DOM components needed for the timeline\\graph2d\n */\n _setDOM() {\n const props = this.props;\n const dom = this.dom;\n\n props.leftContainer.width = props.left.width;\n props.rightContainer.width = props.right.width;\n const centerWidth = props.root.width - props.left.width - props.right.width;\n props.center.width = centerWidth;\n props.centerContainer.width = centerWidth;\n props.top.width = centerWidth;\n props.bottom.width = centerWidth;\n\n // resize the panels\n dom.background.style.height = `${props.background.height}px`;\n dom.backgroundVertical.style.height = `${props.background.height}px`;\n dom.backgroundHorizontal.style.height = `${props.centerContainer.height}px`;\n dom.centerContainer.style.height = `${props.centerContainer.height}px`;\n dom.leftContainer.style.height = `${props.leftContainer.height}px`;\n dom.rightContainer.style.height = `${props.rightContainer.height}px`;\n\n dom.background.style.width = `${props.background.width}px`;\n dom.backgroundVertical.style.width = `${props.centerContainer.width}px`;\n dom.backgroundHorizontal.style.width = `${props.background.width}px`;\n dom.centerContainer.style.width = `${props.center.width}px`;\n dom.top.style.width = `${props.top.width}px`;\n dom.bottom.style.width = `${props.bottom.width}px`;\n\n // reposition the panels\n dom.background.style.left = '0';\n dom.background.style.top = '0';\n dom.backgroundVertical.style.left = `${props.left.width + props.border.left}px`;\n dom.backgroundVertical.style.top = '0';\n dom.backgroundHorizontal.style.left = '0';\n dom.backgroundHorizontal.style.top = `${props.top.height}px`;\n dom.centerContainer.style.left = `${props.left.width}px`;\n dom.centerContainer.style.top = `${props.top.height}px`;\n dom.leftContainer.style.left = '0';\n dom.leftContainer.style.top = `${props.top.height}px`;\n dom.rightContainer.style.left = `${props.left.width + props.center.width}px`;\n dom.rightContainer.style.top = `${props.top.height}px`;\n dom.top.style.left = `${props.left.width}px`;\n dom.top.style.top = '0';\n dom.bottom.style.left = `${props.left.width}px`;\n dom.bottom.style.top = `${props.top.height + props.centerContainer.height}px`;\n dom.center.style.left = '0';\n dom.left.style.left = '0';\n dom.right.style.left = '0';\n }\n\n /**\n * Set a current time. This can be used for example to ensure that a client's\n * time is synchronized with a shared server time.\n * Only applicable when option `showCurrentTime` is true.\n * @param {Date | string | number} time A Date, unix timestamp, or\n * ISO date string.\n */\n setCurrentTime(time) {\n if (!this.currentTime) {\n throw new Error('Option showCurrentTime must be true');\n }\n\n this.currentTime.setCurrentTime(time);\n }\n\n /**\n * Get the current time.\n * Only applicable when option `showCurrentTime` is true.\n * @return {Date} Returns the current time.\n */\n getCurrentTime() {\n if (!this.currentTime) {\n throw new Error('Option showCurrentTime must be true');\n }\n\n return this.currentTime.getCurrentTime();\n }\n\n /**\n * Convert a position on screen (pixels) to a datetime\n * @param {int} x Position on the screen in pixels\n * @return {Date} time The datetime the corresponds with given position x\n * @protected\n * TODO: move this function to Range\n */\n _toTime(x) {\n return DateUtil.toTime(this, x, this.props.center.width);\n }\n\n /**\n * Convert a position on the global screen (pixels) to a datetime\n * @param {int} x Position on the screen in pixels\n * @return {Date} time The datetime the corresponds with given position x\n * @protected\n * TODO: move this function to Range\n */\n _toGlobalTime(x) {\n return DateUtil.toTime(this, x, this.props.root.width);\n //var conversion = this.range.conversion(this.props.root.width);\n //return new Date(x / conversion.scale + conversion.offset);\n }\n\n /**\n * Convert a datetime (Date object) into a position on the screen\n * @param {Date} time A date\n * @return {int} x The position on the screen in pixels which corresponds\n * with the given date.\n * @protected\n * TODO: move this function to Range\n */\n _toScreen(time) {\n return DateUtil.toScreen(this, time, this.props.center.width);\n }\n\n /**\n * Convert a datetime (Date object) into a position on the root\n * This is used to get the pixel density estimate for the screen, not the center panel\n * @param {Date} time A date\n * @return {int} x The position on root in pixels which corresponds\n * with the given date.\n * @protected\n * TODO: move this function to Range\n */\n _toGlobalScreen(time) {\n return DateUtil.toScreen(this, time, this.props.root.width);\n //var conversion = this.range.conversion(this.props.root.width);\n //return (time.valueOf() - conversion.offset) * conversion.scale;\n }\n\n /**\n * Initialize watching when option autoResize is true\n * @private\n */\n _initAutoResize() {\n if (this.options.autoResize == true) {\n this._startAutoResize();\n }\n else {\n this._stopAutoResize();\n }\n }\n\n /**\n * Watch for changes in the size of the container. On resize, the Panel will\n * automatically redraw itself.\n * @private\n */\n _startAutoResize() {\n const me = this;\n\n this._stopAutoResize();\n\n this._onResize = () => {\n if (me.options.autoResize != true) {\n // stop watching when the option autoResize is changed to false\n me._stopAutoResize();\n return;\n }\n\n if (me.dom.root) {\n const rootOffsetHeight = me.dom.root.offsetHeight;\n const rootOffsetWidth = me.dom.root.offsetWidth;\n // check whether the frame is resized\n // Note: we compare offsetWidth here, not clientWidth. For some reason,\n // IE does not restore the clientWidth from 0 to the actual width after\n // changing the timeline's container display style from none to visible\n if ((rootOffsetWidth != me.props.lastWidth) ||\n (rootOffsetHeight != me.props.lastHeight)) {\n me.props.lastWidth = rootOffsetWidth;\n me.props.lastHeight = rootOffsetHeight;\n me.props.scrollbarWidth = util.getScrollBarWidth();\n\n me.body.emitter.emit('_change');\n }\n }\n };\n\n // add event listener to window resize\n util.addEventListener(window, 'resize', this._onResize);\n\n //Prevent initial unnecessary redraw\n if (me.dom.root) {\n me.props.lastWidth = me.dom.root.offsetWidth;\n me.props.lastHeight = me.dom.root.offsetHeight;\n }\n\n this.watchTimer = setInterval(this._onResize, 1000);\n }\n\n /**\n * Stop watching for a resize of the frame.\n * @private\n */\n _stopAutoResize() {\n if (this.watchTimer) {\n clearInterval(this.watchTimer);\n this.watchTimer = undefined;\n }\n\n // remove event listener on window.resize\n if (this._onResize) {\n util.removeEventListener(window, 'resize', this._onResize);\n this._onResize = null;\n }\n }\n\n /**\n * Start moving the timeline vertically\n * @param {Event} event\n * @private\n */\n _onTouch(event) { // eslint-disable-line no-unused-vars\n this.touch.allowDragging = true;\n this.touch.initialScrollTop = this.props.scrollTop;\n }\n\n /**\n * Start moving the timeline vertically\n * @param {Event} event\n * @private\n */\n _onPinch(event) { // eslint-disable-line no-unused-vars\n this.touch.allowDragging = false;\n }\n\n /**\n * Move the timeline vertically\n * @param {Event} event\n * @private\n */\n _onDrag(event) {\n if (!event) return\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.touch.allowDragging) return;\n\n const delta = event.deltaY;\n\n const oldScrollTop = this._getScrollTop();\n const newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);\n\n if (this.options.verticalScroll) {\n this.dom.left.parentNode.scrollTop = -this.props.scrollTop;\n this.dom.right.parentNode.scrollTop = -this.props.scrollTop;\n }\n\n if (newScrollTop != oldScrollTop) {\n this.emit(\"verticalDrag\");\n }\n }\n\n /**\n * Apply a scrollTop\n * @param {number} scrollTop\n * @returns {number} scrollTop Returns the applied scrollTop\n * @private\n */\n _setScrollTop(scrollTop) {\n this.props.scrollTop = scrollTop;\n this._updateScrollTop();\n return this.props.scrollTop;\n }\n\n /**\n * Update the current scrollTop when the height of the containers has been changed\n * @returns {number} scrollTop Returns the applied scrollTop\n * @private\n */\n _updateScrollTop() {\n // recalculate the scrollTopMin\n const scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero\n if (scrollTopMin != this.props.scrollTopMin) {\n // in case of bottom orientation, change the scrollTop such that the contents\n // do not move relative to the time axis at the bottom\n if (this.options.orientation.item != 'top') {\n this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin);\n }\n this.props.scrollTopMin = scrollTopMin;\n }\n\n // limit the scrollTop to the feasible scroll range\n if (this.props.scrollTop > 0) this.props.scrollTop = 0;\n if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;\n\n if (this.options.verticalScroll) {\n this.dom.left.parentNode.scrollTop = -this.props.scrollTop;\n this.dom.right.parentNode.scrollTop = -this.props.scrollTop;\n }\n\n return this.props.scrollTop;\n }\n\n /**\n * Get the current scrollTop\n * @returns {number} scrollTop\n * @private\n */\n _getScrollTop() {\n return this.props.scrollTop;\n }\n\n /**\n * Load a configurator\n * [at]returns {Object}\n * @private\n */\n _createConfigurator() {\n throw new Error('Cannot invoke abstract method _createConfigurator');\n }\n}\n\n// turn Core into an event emitter\nEmitter(Core.prototype);\n\nexport default Core;\n","import util from '../../util';\nimport Component from './Component';\nimport moment from '../../module/moment';\nimport locales from '../locales';\n\n/**\n * A current time bar\n */\nclass CurrentTime extends Component {\n/**\n * @param {{range: Range, dom: Object, domProps: Object}} body\n * @param {Object} [options] Available parameters:\n * {Boolean} [showCurrentTime]\n * {String} [alignCurrentTime]\n * @constructor CurrentTime\n * @extends Component\n */\n constructor(body, options) {\n super()\n this.body = body;\n\n // default options\n this.defaultOptions = {\n rtl: false,\n showCurrentTime: true,\n alignCurrentTime: undefined,\n\n moment,\n locales,\n locale: 'en'\n };\n this.options = util.extend({}, this.defaultOptions);\n this.setOptions(options);\n this.options.locales = util.extend({}, locales, this.options.locales);\n const defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale];\n Object.keys(this.options.locales).forEach(locale => {\n this.options.locales[locale] = util.extend(\n {},\n defaultLocales,\n this.options.locales[locale]\n );\n });\n this.offset = 0;\n\n this._create();\n\n }\n\n /**\n * Create the HTML DOM for the current time bar\n * @private\n */\n _create() {\n const bar = document.createElement('div');\n bar.className = 'vis-current-time';\n bar.style.position = 'absolute';\n bar.style.top = '0px';\n bar.style.height = '100%';\n\n this.bar = bar;\n }\n\n /**\n * Destroy the CurrentTime bar\n */\n destroy() {\n this.options.showCurrentTime = false;\n this.redraw(); // will remove the bar from the DOM and stop refreshing\n\n this.body = null;\n }\n\n /**\n * Set options for the component. Options will be merged in current options.\n * @param {Object} options Available parameters:\n * {boolean} [showCurrentTime]\n * {String} [alignCurrentTime]\n */\n setOptions(options) {\n if (options) {\n // copy all options that we know\n util.selectiveExtend(['rtl', 'showCurrentTime', 'alignCurrentTime', 'moment', 'locale', 'locales'], this.options, options);\n }\n }\n\n /**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\n redraw() {\n if (this.options.showCurrentTime) {\n const parent = this.body.dom.backgroundVertical;\n if (this.bar.parentNode != parent) {\n // attach to the dom\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n parent.appendChild(this.bar);\n\n this.start();\n }\n\n let now = this.options.moment(Date.now() + this.offset);\n\n if (this.options.alignCurrentTime) {\n now = now.startOf(this.options.alignCurrentTime);\n }\n\n const x = this.body.util.toScreen(now);\n\n let locale = this.options.locales[this.options.locale];\n if (!locale) {\n if (!this.warned) {\n console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`);\n this.warned = true;\n }\n locale = this.options.locales['en']; // fall back on english when not available\n }\n let title = `${locale.current} ${locale.time}: ${now.format('dddd, MMMM Do YYYY, H:mm:ss')}`;\n title = title.charAt(0).toUpperCase() + title.substring(1);\n\n if (this.options.rtl) {\n this.bar.style.transform = `translateX(${x * -1}px)`;\n } else {\n this.bar.style.transform = `translateX(${x}px)`;\n }\n this.bar.title = title;\n }\n else {\n // remove the line from the DOM\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n this.stop();\n }\n\n return false;\n }\n\n /**\n * Start auto refreshing the current time bar\n */\n start() {\n const me = this;\n\n /**\n * Updates the current time.\n */\n function update () {\n me.stop();\n\n // determine interval to refresh\n const scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n let interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.redraw();\n me.body.emitter.emit('currentTimeTick');\n\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }\n\n update();\n }\n\n /**\n * Stop auto refreshing the current time bar\n */\n stop() {\n if (this.currentTimeTimer !== undefined) {\n clearTimeout(this.currentTimeTimer);\n delete this.currentTimeTimer;\n }\n }\n\n /**\n * Set a current time. This can be used for example to ensure that a client's\n * time is synchronized with a shared server time.\n * @param {Date | string | number} time A Date, unix timestamp, or\n * ISO date string.\n */\n setCurrentTime(time) {\n const t = util.convert(time, 'Date').valueOf();\n const now = Date.now();\n this.offset = t - now;\n this.redraw();\n }\n\n /**\n * Get the current time.\n * @return {Date} Returns the current time.\n */\n getCurrentTime() {\n return new Date(Date.now() + this.offset);\n }\n}\n\nexport default CurrentTime;\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n return Object.isExtensible(Object.preventExtensions({}));\n});\n","var hiddenKeys = require('../internals/hidden-keys');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar defineProperty = require('../internals/object-define-property').f;\nvar uid = require('../internals/uid');\nvar FREEZING = require('../internals/freezing');\n\nvar METADATA = uid('meta');\nvar id = 0;\n\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\n\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, { value: {\n objectID: 'O' + ++id, // object ID\n weakData: {} // weak collections IDs\n } });\n};\n\nvar fastKey = function (it, create) {\n // return a primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMetadata(it);\n // return object ID\n } return it[METADATA].objectID;\n};\n\nvar getWeakData = function (it, create) {\n if (!has(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMetadata(it);\n // return the store of weak collections IDs\n } return it[METADATA].weakData;\n};\n\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar meta = module.exports = {\n REQUIRED: false,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\n\nhiddenKeys[METADATA] = true;\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var anObject = require('../internals/an-object');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) anObject(returnMethod.call(iterator));\n throw error;\n }\n};\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {\n var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);\n var iterator, iterFn, index, length, result, step;\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = AS_ENTRIES\n ? boundFunction(anObject(step = iterable[index])[0], step[1])\n : boundFunction(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n while (!(step = iterator.next()).done) {\n result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n};\n\niterate.stop = function (result) {\n return new Result(true, result);\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","'use strict';\nvar $ = require('./export');\nvar global = require('../internals/global');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar fails = require('../internals/fails');\nvar hide = require('../internals/hide');\nvar iterate = require('../internals/iterate');\nvar anInstance = require('../internals/an-instance');\nvar isObject = require('../internals/is-object');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar defineProperty = require('../internals/object-define-property').f;\nvar forEach = require('../internals/array-iteration').forEach;\nvar DESCRIPTORS = require('../internals/descriptors');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var ADDER = IS_MAP ? 'set' : 'add';\n var exported = {};\n var Constructor;\n\n if (!DESCRIPTORS || typeof NativeConstructor != 'function'\n || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))\n ) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.REQUIRED = true;\n } else {\n Constructor = wrapper(function (target, iterable) {\n setInternalState(anInstance(target, Constructor, CONSTRUCTOR_NAME), {\n type: CONSTRUCTOR_NAME,\n collection: new NativeConstructor()\n });\n if (iterable != undefined) iterate(iterable, target[ADDER], target, IS_MAP);\n });\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) hide(Constructor.prototype, KEY, function (a, b) {\n var collection = getInternalState(this).collection;\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = collection[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n });\n\n IS_WEAK || defineProperty(Constructor.prototype, 'size', {\n get: function () {\n return getInternalState(this).collection.size;\n }\n });\n }\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: true }, exported);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else redefine(target, key, src[key], options);\n } return target;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar create = require('../internals/object-create');\nvar redefineAll = require('../internals/redefine-all');\nvar bind = require('../internals/bind-context');\nvar anInstance = require('../internals/an-instance');\nvar iterate = require('../internals/iterate');\nvar defineIterator = require('../internals/define-iterator');\nvar setSpecies = require('../internals/set-species');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fastKey = require('../internals/internal-metadata').fastKey;\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, CONSTRUCTOR_NAME);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);\n });\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key) return entry;\n }\n };\n\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first == entry) state.first = next;\n if (state.last == entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n redefineAll(C.prototype, IS_MAP ? {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineProperty(C.prototype, 'size', {\n get: function () {\n return getInternalState(this).size;\n }\n });\n return C;\n },\n setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = undefined;\n return { value: undefined, done: true };\n }\n // return step by kind\n if (kind == 'keys') return { value: entry.key, done: false };\n if (kind == 'values') return { value: entry.value, done: false };\n return { value: [entry.key, entry.value], done: false };\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Set` constructor\n// https://tc39.github.io/ecma262/#sec-set-objects\nmodule.exports = collection('Set', function (get) {\n return function Set() { return get(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","require('../../modules/es.set');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Set;\n","module.exports = require('../../es/set');\n","module.exports = require(\"core-js-pure/stable/set\");","'use strict';\nvar $ = require('../internals/export');\nvar $map = require('../internals/array-iteration').map;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\n// `Array.prototype.map` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.map\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, {\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.map');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').map;\n","var map = require('../array/virtual/map');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.map;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.map) ? map : own;\n};\n","module.exports = require('../../es/instance/map');\n","module.exports = require(\"core-js-pure/stable/instance/map\");","module.exports = require('../../es/object/create');\n","module.exports = require(\"core-js-pure/stable/object/create\");","'use strict';\nvar $ = require('../internals/export');\nvar $find = require('../internals/array-iteration').find;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\nvar FIND = 'find';\nvar SKIPS_HOLES = true;\n\n// Shouldn't skip holes\nif (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.find` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.find\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND);\n","require('../../../modules/es.array.find');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').find;\n","var find = require('../array/virtual/find');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.find;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.find) ? find : own;\n};\n","module.exports = require('../../es/instance/find');\n","module.exports = require(\"core-js-pure/stable/instance/find\");","var anObject = require('../internals/an-object');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = function (it) {\n var iteratorMethod = getIteratorMethod(it);\n if (typeof iteratorMethod != 'function') {\n throw TypeError(String(it) + ' is not iterable');\n } return anObject(iteratorMethod.call(it));\n};\n","require('../modules/web.dom-collections.iterator');\nrequire('../modules/es.string.iterator');\n\nmodule.exports = require('../internals/get-iterator');\n","module.exports = require(\"core-js-pure/features/get-iterator\");","module.exports = require('../../es/array/is-array');\n","module.exports = require(\"core-js-pure/features/array/is-array\");","var _Array$isArray = require(\"../core-js/array/is-array\");\n\nfunction _arrayWithoutHoles(arr) {\n if (_Array$isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nmodule.exports = _arrayWithoutHoles;","'use strict';\nvar bind = require('../internals/bind-context');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\n// `Array.from` method implementation\n// https://tc39.github.io/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iteratorMethod = getIteratorMethod(O);\n var length, result, step, iterator;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = iteratorMethod.call(O);\n result = new C();\n for (;!(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping\n ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true)\n : step.value\n );\n }\n } else {\n length = toLength(O.length);\n result = new C(length);\n for (;length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var $ = require('../internals/export');\nvar from = require('../internals/array-from');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\n\nvar INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {\n Array.from(iterable);\n});\n\n// `Array.from` method\n// https://tc39.github.io/ecma262/#sec-array.from\n$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {\n from: from\n});\n","require('../../modules/es.string.iterator');\nrequire('../../modules/es.array.from');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Array.from;\n","module.exports = require('../../es/array/from');\n","module.exports = require(\"core-js-pure/features/array/from\");","var classof = require('../internals/classof');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n // eslint-disable-next-line no-prototype-builtins\n || Iterators.hasOwnProperty(classof(O));\n};\n","require('../modules/web.dom-collections.iterator');\nrequire('../modules/es.string.iterator');\n\nmodule.exports = require('../internals/is-iterable');\n","module.exports = require(\"core-js-pure/features/is-iterable\");","var _Array$from = require(\"../core-js/array/from\");\n\nvar _isIterable = require(\"../core-js/is-iterable\");\n\nfunction _iterableToArray(iter) {\n if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return _Array$from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\nvar nativeAssign = Object.assign;\n\n// `Object.assign` method\n// https://tc39.github.io/ecma262/#sec-object.assign\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !nativeAssign || fails(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : nativeAssign;\n","var $ = require('../internals/export');\nvar assign = require('../internals/object-assign');\n\n// `Object.assign` method\n// https://tc39.github.io/ecma262/#sec-object.assign\n$({ target: 'Object', stat: true, forced: Object.assign !== assign }, {\n assign: assign\n});\n","require('../../modules/es.object.assign');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.assign;\n","module.exports = require('../../es/object/assign');\n","module.exports = require(\"core-js-pure/stable/object/assign\");","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","require('../../../modules/es.array.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').includes;\n","var isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.github.io/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');\n};\n","var isRegExp = require('../internals/is-regexp');\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (e) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (f) { /* empty */ }\n } return false;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\n// `String.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~String(requireObjectCoercible(this))\n .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.string.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('String').includes;\n","var arrayIncludes = require('../array/virtual/includes');\nvar stringIncludes = require('../string/virtual/includes');\n\nvar ArrayPrototype = Array.prototype;\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.includes;\n if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.includes)) return arrayIncludes;\n if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) {\n return stringIncludes;\n } return own;\n};\n","module.exports = require('../../es/instance/includes');\n","module.exports = require(\"core-js-pure/stable/instance/includes\");","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","require('../../../modules/es.array.slice');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').slice;\n","var slice = require('../array/virtual/slice');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.slice;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.slice) ? slice : own;\n};\n","module.exports = require('../../es/instance/slice');\n","module.exports = require(\"core-js-pure/stable/instance/slice\");","// Utility functions for ordering and stacking of items\nconst EPSILON = 0.001; // used when checking collisions, to prevent round-off errors\n\n/**\n * Order items by their start data\n * @param {Item[]} items\n */\nexport function orderByStart(items) {\n items.sort((a, b) => a.data.start - b.data.start);\n}\n\n/**\n * Order items by their end date. If they have no end date, their start date\n * is used.\n * @param {Item[]} items\n */\nexport function orderByEnd(items) {\n items.sort((a, b) => {\n const aTime = ('end' in a.data) ? a.data.end : a.data.start;\n const bTime = ('end' in b.data) ? b.data.end : b.data.start;\n\n return aTime - bTime;\n });\n}\n\n/**\n * Adjust vertical positions of the items such that they don't overlap each\n * other.\n * @param {Item[]} items\n * All visible items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n * @param {boolean} [force=false]\n * If true, all items will be repositioned. If false (default), only\n * items having a top===null will be re-stacked\n * @param {function} shouldBailItemsRedrawFunction\n * bailing function\n * @return {boolean} shouldBail\n */\nexport function stack(items, margin, force, shouldBailItemsRedrawFunction) {\n if (force) {\n // reset top position of all items\n for (var i = 0; i < items.length; i++) {\n items[i].top = null;\n }\n }\n\n // calculate new, non-overlapping positions\n for (var i = 0; i < items.length; i++) { // eslint-disable-line no-redeclare\n const item = items[i];\n if (item.stack && item.top === null) {\n // initialize top position\n item.top = margin.axis;\n var shouldBail = false;\n\n do {\n // TODO: optimize checking for overlap. when there is a gap without items,\n // you only need to check for items from the next item on, not from zero\n var collidingItem = null;\n for (let j = 0, jj = items.length; j < jj; j++) {\n const other = items[j];\n shouldBail = shouldBailItemsRedrawFunction() || false;\n\n if (shouldBail) { return true; }\n\n if (other.top !== null && other !== item && other.stack && collision(item, other, margin.item, other.options.rtl)) {\n collidingItem = other;\n break;\n }\n }\n\n if (collidingItem != null) {\n // There is a collision. Reposition the items above the colliding element\n item.top = collidingItem.top + collidingItem.height + margin.item.vertical;\n }\n } while (collidingItem);\n }\n }\n return shouldBail;\n}\n\n/**\n * Adjust vertical positions of the items within a single subgroup such that they \n * don't overlap each other.\n * @param {Item[]} items\n * All items withina subgroup\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n * @param {subgroup} subgroup\n * The subgroup that is being stacked \n */\nexport function substack(items, margin, subgroup) {\n for (var i = 0; i < items.length; i++) {\n items[i].top = null;\n }\n\n // Set the initial height\n let subgroupHeight = subgroup.height;\n\n // calculate new, non-overlapping positions\n for (i = 0; i < items.length; i++) {\n const item = items[i];\n\n if (item.stack && item.top === null) {\n // initialize top position\n item.top = item.baseTop;//margin.axis + item.baseTop;\n\n do {\n // TODO: optimize checking for overlap. when there is a gap without items,\n // you only need to check for items from the next item on, not from zero\n var collidingItem = null;\n for (let j = 0, jj = items.length; j < jj; j++) {\n const other = items[j];\n if (other.top !== null && other !== item /*&& other.stack*/ && collision(item, other, margin.item, other.options.rtl)) {\n collidingItem = other;\n break;\n }\n }\n\n if (collidingItem != null) {\n // There is a collision. Reposition the items above the colliding element\n item.top = collidingItem.top + collidingItem.height + margin.item.vertical;// + item.baseTop;\n }\n\n if (item.top + item.height > subgroupHeight) {\n subgroupHeight = item.top + item.height;\n }\n } while (collidingItem);\n }\n }\n\n // Set the new height\n subgroup.height = subgroupHeight - subgroup.top + 0.5 * margin.item.vertical;\n}\n\n/**\n * Adjust vertical positions of the items without stacking them\n * @param {Item[]} items\n * All visible items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n * @param {subgroups[]} subgroups\n * All subgroups\n * @param {boolean} isStackSubgroups\n */\nexport function nostack(items, margin, subgroups, isStackSubgroups) {\n for (let i = 0; i < items.length; i++) {\n if (items[i].data.subgroup == undefined) {\n items[i].top = margin.item.vertical;\n } else if (items[i].data.subgroup !== undefined && isStackSubgroups) {\n let newTop = 0;\n for (const subgroup in subgroups) {\n if (subgroups.hasOwnProperty(subgroup)) {\n if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroups[items[i].data.subgroup].index) {\n newTop += subgroups[subgroup].height;\n subgroups[items[i].data.subgroup].top = newTop;\n }\n }\n }\n items[i].top = newTop + 0.5 * margin.item.vertical;\n }\n }\n if (!isStackSubgroups) {\n stackSubgroups(items, margin, subgroups)\n }\n}\n\n/**\n * Adjust vertical positions of the subgroups such that they don't overlap each\n * other.\n * @param {Array.} items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin Margins between items and between items and the axis.\n * @param {subgroups[]} subgroups\n * All subgroups\n */\nexport function stackSubgroups(items, margin, subgroups) {\n for (const subgroup in subgroups) {\n if (subgroups.hasOwnProperty(subgroup)) {\n\n\n subgroups[subgroup].top = 0;\n do {\n // TODO: optimize checking for overlap. when there is a gap without items,\n // you only need to check for items from the next item on, not from zero\n var collidingItem = null;\n for (const otherSubgroup in subgroups) {\n if (subgroups[otherSubgroup].top !== null && otherSubgroup !== subgroup && subgroups[subgroup].index > subgroups[otherSubgroup].index && collisionByTimes(subgroups[subgroup], subgroups[otherSubgroup])) {\n collidingItem = subgroups[otherSubgroup];\n break;\n }\n }\n\n if (collidingItem != null) {\n // There is a collision. Reposition the subgroups above the colliding element\n subgroups[subgroup].top = collidingItem.top + collidingItem.height;\n }\n } while (collidingItem);\n }\n }\n for (let i = 0; i < items.length; i++) {\n if (items[i].data.subgroup !== undefined) {\n items[i].top = subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical;\n }\n }\n}\n\n/**\n * Adjust vertical positions of the subgroups such that they don't overlap each\n * other, then stacks the contents of each subgroup individually.\n * @param {Item[]} subgroupItems\n * All the items in a subgroup\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n * @param {subgroups[]} subgroups\n * All subgroups \n */\nexport function stackSubgroupsWithInnerStack(subgroupItems, margin, subgroups) {\n let doSubStack = false;\n \n // Run subgroups in their order (if any)\n const subgroupOrder = [];\n\n for(var subgroup in subgroups) {\n if (subgroups[subgroup].hasOwnProperty(\"index\")) {\n subgroupOrder[subgroups[subgroup].index] = subgroup;\n }\n else {\n subgroupOrder.push(subgroup);\n }\n }\n\n for(let j = 0; j < subgroupOrder.length; j++) {\n subgroup = subgroupOrder[j];\n if (subgroups.hasOwnProperty(subgroup)) {\n\n doSubStack = doSubStack || subgroups[subgroup].stack;\n subgroups[subgroup].top = 0; \n\n for (const otherSubgroup in subgroups) {\n if (subgroups[otherSubgroup].visible && subgroups[subgroup].index > subgroups[otherSubgroup].index) {\n subgroups[subgroup].top += subgroups[otherSubgroup].height;\n }\n }\n\n const items = subgroupItems[subgroup];\n for(let i = 0; i < items.length; i++) {\n if (items[i].data.subgroup !== undefined) {\n items[i].top = subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical;\n\n if (subgroups[subgroup].stack) {\n items[i].baseTop = items[i].top; \n }\n } \n }\n\n if (doSubStack && subgroups[subgroup].stack) {\n substack(subgroupItems[subgroup], margin, subgroups[subgroup]); \n }\n }\n } \n}\n\n/**\n * Test if the two provided items collide\n * The items must have parameters left, width, top, and height.\n * @param {Item} a The first item\n * @param {Item} b The second item\n * @param {{horizontal: number, vertical: number}} margin\n * An object containing a horizontal and vertical\n * minimum required margin.\n * @param {boolean} rtl\n * @return {boolean} true if a and b collide, else false\n */\nexport function collision(a, b, margin, rtl) {\n if (rtl) {\n return ((a.right - margin.horizontal + EPSILON) < (b.right + b.width) &&\n (a.right + a.width + margin.horizontal - EPSILON) > b.right &&\n (a.top - margin.vertical + EPSILON) < (b.top + b.height) &&\n (a.top + a.height + margin.vertical - EPSILON) > b.top);\n } else {\n return ((a.left - margin.horizontal + EPSILON) < (b.left + b.width) &&\n (a.left + a.width + margin.horizontal - EPSILON) > b.left &&\n (a.top - margin.vertical + EPSILON) < (b.top + b.height) &&\n (a.top + a.height + margin.vertical - EPSILON) > b.top);\n }\n}\n\n/**\n * Test if the two provided objects collide\n * The objects must have parameters start, end, top, and height.\n * @param {Object} a The first Object\n * @param {Object} b The second Object\n * @return {boolean} true if a and b collide, else false\n */\nexport function collisionByTimes(a, b) {\n return (a.start <= b.start && a.end >= b.start && a.top < (b.top + b.height) && (a.top + a.height) > b.top ) ||\n (b.start <= a.start && b.end >= a.start && b.top < (a.top + a.height) && (b.top + b.height) > a.top );\n}","import util from '../../util';\nimport * as stack from '../Stack';\n\nconst UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items\nconst BACKGROUND = '__background__'; // reserved group id for background items without group\n\nexport const ReservedGroupIds = {\n UNGROUPED,\n BACKGROUND\n}\n\n\n/**\n * @constructor Group\n */\nclass Group {\n /**\n * @param {number | string} groupId\n * @param {Object} data\n * @param {ItemSet} itemSet\n * @constructor Group\n */\n constructor(groupId, data, itemSet) {\n this.groupId = groupId;\n this.subgroups = {};\n this.subgroupStack = {};\n this.subgroupStackAll = false;\n this.subgroupVisibility = {};\n this.doInnerStack = false;\n this.shouldBailStackItems = false;\n this.subgroupIndex = 0;\n this.subgroupOrderer = data && data.subgroupOrder;\n this.itemSet = itemSet;\n this.isVisible = null;\n this.stackDirty = true; // if true, items will be restacked on next redraw\n\n if (data && data.nestedGroups) {\n this.nestedGroups = data.nestedGroups;\n if (data.showNested == false) {\n this.showNested = false;\n } else {\n this.showNested = true;\n }\n }\n\n if (data && data.subgroupStack) {\n if (typeof data.subgroupStack === \"boolean\") {\n this.doInnerStack = data.subgroupStack;\n this.subgroupStackAll = data.subgroupStack;\n }\n else {\n // We might be doing stacking on specific sub groups, but only\n // if at least one is set to do stacking\n for(const key in data.subgroupStack) {\n this.subgroupStack[key] = data.subgroupStack[key];\n this.doInnerStack = this.doInnerStack || data.subgroupStack[key];\n }\n }\n }\n\n if (data && data.heightMode) {\n this.heightMode = data.heightMode;\n } else {\n this.heightMode = itemSet.options.groupHeightMode;\n }\n\n this.nestedInGroup = null;\n\n this.dom = {};\n this.props = {\n label: {\n width: 0,\n height: 0\n }\n };\n this.className = null;\n\n this.items = {}; // items filtered by groupId of this group\n this.visibleItems = []; // items currently visible in window\n this.itemsInRange = []; // items currently in range\n this.orderedItems = {\n byStart: [],\n byEnd: []\n };\n this.checkRangedItems = false; // needed to refresh the ranged items if the window is programatically changed with NO overlap.\n const me = this;\n this.itemSet.body.emitter.on(\"checkRangedItems\", () => {\n me.checkRangedItems = true;\n })\n\n this._create();\n\n this.setData(data);\n }\n\n /**\n * Create DOM elements for the group\n * @private\n */\n _create() {\n const label = document.createElement('div');\n if (this.itemSet.options.groupEditable.order) {\n label.className = 'vis-label draggable';\n } else {\n label.className = 'vis-label';\n }\n this.dom.label = label;\n\n const inner = document.createElement('div');\n inner.className = 'vis-inner';\n label.appendChild(inner);\n this.dom.inner = inner;\n\n const foreground = document.createElement('div');\n foreground.className = 'vis-group';\n foreground['vis-group'] = this;\n this.dom.foreground = foreground;\n\n this.dom.background = document.createElement('div');\n this.dom.background.className = 'vis-group';\n\n this.dom.axis = document.createElement('div');\n this.dom.axis.className = 'vis-group';\n\n // create a hidden marker to detect when the Timelines container is attached\n // to the DOM, or the style of a parent of the Timeline is changed from\n // display:none is changed to visible.\n this.dom.marker = document.createElement('div');\n this.dom.marker.style.visibility = 'hidden';\n this.dom.marker.style.position = 'absolute';\n this.dom.marker.innerHTML = '';\n this.dom.background.appendChild(this.dom.marker);\n }\n\n /**\n * Set the group data for this group\n * @param {Object} data Group data, can contain properties content and className\n */\n setData(data) {\n if (this.itemSet.groupTouchParams.isDragging) return;\n\n // update contents\n let content;\n let templateFunction;\n\n if (data && data.subgroupVisibility) {\n for (const key in data.subgroupVisibility) {\n this.subgroupVisibility[key] = data.subgroupVisibility[key];\n }\n }\n\n if (this.itemSet.options && this.itemSet.options.groupTemplate) {\n templateFunction = this.itemSet.options.groupTemplate.bind(this);\n content = templateFunction(data, this.dom.inner);\n } else {\n content = data && data.content;\n }\n\n if (content instanceof Element) {\n while (this.dom.inner.firstChild) {\n this.dom.inner.removeChild(this.dom.inner.firstChild);\n }\n this.dom.inner.appendChild(content);\n } else if (content instanceof Object && content.isReactComponent) {\n // Do nothing. Component was rendered into the node be ReactDOM.render.\n // That branch is necessary for evasion of a second call templateFunction.\n // Supports only React < 16(due to the asynchronous nature of React 16).\n } else if (content instanceof Object) {\n templateFunction(data, this.dom.inner);\n } else if (content !== undefined && content !== null) {\n this.dom.inner.innerHTML = content;\n } else {\n this.dom.inner.innerHTML = this.groupId || ''; // groupId can be null\n }\n\n // update title\n this.dom.label.title = data && data.title || '';\n if (!this.dom.inner.firstChild) {\n util.addClassName(this.dom.inner, 'vis-hidden');\n }\n else {\n util.removeClassName(this.dom.inner, 'vis-hidden');\n }\n\n if (data && data.nestedGroups) {\n if (!this.nestedGroups || this.nestedGroups != data.nestedGroups) {\n this.nestedGroups = data.nestedGroups;\n }\n\n if (data.showNested !== undefined || this.showNested === undefined) {\n if (data.showNested == false) {\n this.showNested = false;\n } else {\n this.showNested = true;\n }\n }\n\n util.addClassName(this.dom.label, 'vis-nesting-group');\n if (this.showNested) {\n util.removeClassName(this.dom.label, 'collapsed');\n util.addClassName(this.dom.label, 'expanded');\n } else {\n util.removeClassName(this.dom.label, 'expanded');\n util.addClassName(this.dom.label, 'collapsed');\n }\n } else if (this.nestedGroups) {\n this.nestedGroups = null;\n util.removeClassName(this.dom.label, 'collapsed');\n util.removeClassName(this.dom.label, 'expanded');\n util.removeClassName(this.dom.label, 'vis-nesting-group');\n }\n\n if (data && (data.treeLevel|| data.nestedInGroup)) {\n util.addClassName(this.dom.label, 'vis-nested-group');\n if (data.treeLevel) {\n util.addClassName(this.dom.label, 'vis-group-level-' + data.treeLevel);\n } else {\n // Nesting level is unknown, but we're sure it's at least 1\n util.addClassName(this.dom.label, 'vis-group-level-unknown-but-gte1');\n }\n } else {\n util.addClassName(this.dom.label, 'vis-group-level-0');\n }\n \n // update className\n const className = data && data.className || null;\n if (className != this.className) {\n if (this.className) {\n util.removeClassName(this.dom.label, this.className);\n util.removeClassName(this.dom.foreground, this.className);\n util.removeClassName(this.dom.background, this.className);\n util.removeClassName(this.dom.axis, this.className);\n }\n util.addClassName(this.dom.label, className);\n util.addClassName(this.dom.foreground, className);\n util.addClassName(this.dom.background, className);\n util.addClassName(this.dom.axis, className);\n this.className = className;\n }\n\n // update style\n if (this.style) {\n util.removeCssText(this.dom.label, this.style);\n this.style = null;\n }\n if (data && data.style) {\n util.addCssText(this.dom.label, data.style);\n this.style = data.style;\n }\n }\n\n /**\n * Get the width of the group label\n * @return {number} width\n */\n getLabelWidth() {\n return this.props.label.width;\n }\n\n /**\n * check if group has had an initial height hange\n * @returns {boolean} \n */\n _didMarkerHeightChange() {\n const markerHeight = this.dom.marker.clientHeight;\n if (markerHeight != this.lastMarkerHeight) {\n this.lastMarkerHeight = markerHeight;\n const redrawQueue = {};\n let redrawQueueLength = 0;\n\n util.forEach(this.items, (item, key) => {\n item.dirty = true;\n if (item.displayed) {\n const returnQueue = true;\n redrawQueue[key] = item.redraw(returnQueue);\n redrawQueueLength = redrawQueue[key].length;\n }\n })\n\n const needRedraw = redrawQueueLength > 0;\n if (needRedraw) {\n // redraw all regular items\n for (let i = 0; i < redrawQueueLength; i++) {\n util.forEach(redrawQueue, fns => {\n fns[i]();\n });\n }\n }\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * calculate group dimentions and position\n * @param {number} pixels\n */\n _calculateGroupSizeAndPosition() {\n const { offsetTop, offsetLeft, offsetWidth } = this.dom.foreground;\n this.top = offsetTop;\n this.right = offsetLeft;\n this.width = offsetWidth;\n }\n\n /**\n * checks if should bail redraw of items\n * @returns {boolean} should bail \n */\n _shouldBailItemsRedraw() {\n const me = this;\n const timeoutOptions = this.itemSet.options.onTimeout;\n const bailOptions = {\n relativeBailingTime: this.itemSet.itemsSettingTime,\n bailTimeMs: timeoutOptions && timeoutOptions.timeoutMs,\n userBailFunction: timeoutOptions && timeoutOptions.callback,\n shouldBailStackItems: this.shouldBailStackItems\n };\n let bail = null;\n if (!this.itemSet.initialDrawDone) {\n if (bailOptions.shouldBailStackItems) { return true; }\n if (Math.abs(Date.now() - new Date(bailOptions.relativeBailingTime)) > bailOptions.bailTimeMs) {\n if (bailOptions.userBailFunction && this.itemSet.userContinueNotBail == null) {\n bailOptions.userBailFunction(didUserContinue => {\n me.itemSet.userContinueNotBail = didUserContinue;\n bail = !didUserContinue;\n })\n } else if (me.itemSet.userContinueNotBail == false) {\n bail = true;\n } else {\n bail = false;\n }\n }\n }\n\n return bail;\n }\n\n /**\n * redraws items\n * @param {boolean} forceRestack\n * @param {boolean} lastIsVisible\n * @param {number} margin\n * @param {object} range\n * @private\n */\n _redrawItems(forceRestack, lastIsVisible, margin, range) {\n const restack = forceRestack || this.stackDirty || this.isVisible && !lastIsVisible;\n\n // if restacking, reposition visible items vertically\n if (restack) {\n const orderedItems = {\n byEnd: this.orderedItems.byEnd.filter(item => !item.isCluster),\n byStart: this.orderedItems.byStart.filter(item => !item.isCluster)\n }\n\n const orderedClusters = {\n byEnd: [...new Set(this.orderedItems.byEnd.map(item => item.cluster).filter(item => !!item))],\n byStart: [...new Set(this.orderedItems.byStart.map(item => item.cluster).filter(item => !!item))],\n }\n\n /**\n * Get all visible items in range\n * @return {array} items\n */\n const getVisibleItems = () => {\n const visibleItems = this._updateItemsInRange(orderedItems, this.visibleItems.filter(item => !item.isCluster), range);\n const visibleClusters = this._updateClustersInRange(orderedClusters, this.visibleItems.filter(item => item.isCluster), range);\n return [...visibleItems, ...visibleClusters];\n }\n\n /**\n * Get visible items grouped by subgroup\n * @param {function} orderFn An optional function to order items inside the subgroups\n * @return {Object}\n */\n const getVisibleItemsGroupedBySubgroup = orderFn => {\n let visibleSubgroupsItems = {};\n for (const subgroup in this.subgroups) {\n const items = this.visibleItems.filter(item => item.data.subgroup === subgroup);\n visibleSubgroupsItems[subgroup] = orderFn ? items.sort((a, b) => orderFn(a.data, b.data)) : items;\n }\n return visibleSubgroupsItems;\n };\n\n if (typeof this.itemSet.options.order === 'function') {\n // a custom order function\n //show all items\n const me = this;\n if (this.doInnerStack && this.itemSet.options.stackSubgroups) {\n // Order the items within each subgroup\n const visibleSubgroupsItems = getVisibleItemsGroupedBySubgroup(this.itemSet.options.order);\n stack.stackSubgroupsWithInnerStack(visibleSubgroupsItems, margin, this.subgroups);\n this.visibleItems = getVisibleItems();\n this._updateSubGroupHeights(margin);\n }\n else {\n this.visibleItems = getVisibleItems();\n this._updateSubGroupHeights(margin);\n // order all items and force a restacking\n // order all items outside clusters and force a restacking\n const customOrderedItems = this.visibleItems\n .slice()\n .filter(item => item.isCluster || (!item.isCluster && !item.cluster))\n .sort((a, b) => {\n return me.itemSet.options.order(a.data, b.data);\n });\n this.shouldBailStackItems = stack.stack(customOrderedItems, margin, true, this._shouldBailItemsRedraw.bind(this));\n }\n } else {\n // no custom order function, lazy stacking\n this.visibleItems = getVisibleItems();\n this._updateSubGroupHeights(margin);\n\n if (this.itemSet.options.stack) {\n if (this.doInnerStack && this.itemSet.options.stackSubgroups) {\n const visibleSubgroupsItems = getVisibleItemsGroupedBySubgroup();\n stack.stackSubgroupsWithInnerStack(visibleSubgroupsItems, margin, this.subgroups);\n }\n else {\n // TODO: ugly way to access options...\n this.shouldBailStackItems = stack.stack(this.visibleItems, margin, true, this._shouldBailItemsRedraw.bind(this));\n }\n } else {\n // no stacking\n stack.nostack(this.visibleItems, margin, this.subgroups, this.itemSet.options.stackSubgroups);\n }\n }\n\n for (let i = 0; i < this.visibleItems.length; i++) {\n this.visibleItems[i].repositionX();\n if (this.subgroupVisibility[this.visibleItems[i].data.subgroup] !== undefined) {\n if (!this.subgroupVisibility[this.visibleItems[i].data.subgroup]) {\n this.visibleItems[i].hide();\n }\n }\n }\n\n if (this.itemSet.options.cluster) {\n util.forEach(this.items, item => {\n if (item.cluster && item.displayed) {\n item.hide();\n }\n });\n }\n\n if (this.shouldBailStackItems) {\n this.itemSet.body.emitter.emit('destroyTimeline')\n }\n this.stackDirty = false;\n }\n }\n\n /**\n * check if group resized\n * @param {boolean} resized\n * @param {number} height\n * @return {boolean} did resize\n */\n _didResize(resized, height) {\n resized = util.updateProperty(this, 'height', height) || resized;\n // recalculate size of label\n const labelWidth = this.dom.inner.clientWidth;\n const labelHeight = this.dom.inner.clientHeight;\n resized = util.updateProperty(this.props.label, 'width', labelWidth) || resized;\n resized = util.updateProperty(this.props.label, 'height', labelHeight) || resized;\n return resized;\n }\n\n /**\n * apply group height\n * @param {number} height\n */\n _applyGroupHeight(height) {\n this.dom.background.style.height = `${height}px`;\n this.dom.foreground.style.height = `${height}px`;\n this.dom.label.style.height = `${height}px`;\n }\n\n /**\n * update vertical position of items after they are re-stacked and the height of the group is calculated\n * @param {number} margin\n */\n _updateItemsVerticalPosition(margin) {\n for (let i = 0, ii = this.visibleItems.length; i < ii; i++) {\n const item = this.visibleItems[i];\n item.repositionY(margin);\n if (!this.isVisible && this.groupId != ReservedGroupIds.BACKGROUND) {\n if (item.displayed) item.hide();\n }\n }\n }\n\n /**\n * Repaint this group\n * @param {{start: number, end: number}} range\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * @param {boolean} [forceRestack=false] Force restacking of all items\n * @param {boolean} [returnQueue=false] return the queue or if the group resized\n * @return {boolean} Returns true if the group is resized or the redraw queue if returnQueue=true\n */\n redraw(range, margin, forceRestack, returnQueue) {\n let resized = false;\n const lastIsVisible = this.isVisible;\n let height;\n\n const queue = [\n () => {\n forceRestack = this._didMarkerHeightChange.call(this) || forceRestack;\n },\n \n // recalculate the height of the subgroups\n this._updateSubGroupHeights.bind(this, margin),\n\n // calculate actual size and position\n this._calculateGroupSizeAndPosition.bind(this),\n\n () => {\n this.isVisible = this._isGroupVisible.bind(this)(range, margin);\n },\n \n () => {\n this._redrawItems.bind(this)(forceRestack, lastIsVisible, margin, range)\n },\n\n // update subgroups\n this._updateSubgroupsSizes.bind(this),\n\n () => {\n height = this._calculateHeight.bind(this)(margin);\n },\n\n // calculate actual size and position again\n this._calculateGroupSizeAndPosition.bind(this),\n\n () => {\n resized = this._didResize.bind(this)(resized, height)\n },\n\n () => {\n this._applyGroupHeight.bind(this)(height)\n },\n\n () => {\n this._updateItemsVerticalPosition.bind(this)(margin)\n },\n\n (() => {\n if (!this.isVisible && this.height) {\n resized = false;\n }\n return resized\n }).bind(this)\n ];\n\n if (returnQueue) {\n return queue;\n } else {\n let result;\n queue.forEach(fn => {\n result = fn();\n });\n return result;\n }\n }\n\n /**\n * recalculate the height of the subgroups\n *\n * @param {{item: timeline.Item}} margin\n * @private\n */\n _updateSubGroupHeights(margin) {\n if (Object.keys(this.subgroups).length > 0) {\n const me = this;\n\n this._resetSubgroups();\n\n util.forEach(this.visibleItems, item => {\n if (item.data.subgroup !== undefined) {\n me.subgroups[item.data.subgroup].height = Math.max(me.subgroups[item.data.subgroup].height, item.height + margin.item.vertical);\n me.subgroups[item.data.subgroup].visible = typeof this.subgroupVisibility[item.data.subgroup] === 'undefined' ? true : Boolean(this.subgroupVisibility[item.data.subgroup]);\n }\n });\n }\n }\n\n /**\n * check if group is visible\n *\n * @param {timeline.Range} range\n * @param {{axis: timeline.DataAxis}} margin\n * @returns {boolean} is visible\n * @private\n */\n _isGroupVisible(range, margin) {\n return (this.top <= range.body.domProps.centerContainer.height - range.body.domProps.scrollTop + margin.axis)\n && (this.top + this.height + margin.axis >= - range.body.domProps.scrollTop);\n }\n\n /**\n * recalculate the height of the group\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * @returns {number} Returns the height\n * @private\n */\n _calculateHeight(margin) {\n // recalculate the height of the group\n let height;\n\n let items;\n\n if (this.heightMode === 'fixed') {\n items = util.toArray(this.items);\n } else {\n // default or 'auto'\n items = this.visibleItems;\n }\n\n if (items.length > 0) {\n let min = items[0].top;\n let max = items[0].top + items[0].height;\n util.forEach(items, item => {\n min = Math.min(min, item.top);\n max = Math.max(max, (item.top + item.height));\n });\n if (min > margin.axis) {\n // there is an empty gap between the lowest item and the axis\n const offset = min - margin.axis;\n max -= offset;\n util.forEach(items, item => {\n item.top -= offset;\n });\n }\n height = Math.ceil(max + margin.item.vertical / 2);\n if (this.heightMode !== \"fitItems\") {\n height = Math.max(height, this.props.label.height);\n }\n }\n else {\n height = 0 || this.props.label.height;\n }\n return height;\n }\n\n /**\n * Show this group: attach to the DOM\n */\n show() {\n if (!this.dom.label.parentNode) {\n this.itemSet.dom.labelSet.appendChild(this.dom.label);\n }\n\n if (!this.dom.foreground.parentNode) {\n this.itemSet.dom.foreground.appendChild(this.dom.foreground);\n }\n\n if (!this.dom.background.parentNode) {\n this.itemSet.dom.background.appendChild(this.dom.background);\n }\n\n if (!this.dom.axis.parentNode) {\n this.itemSet.dom.axis.appendChild(this.dom.axis);\n }\n }\n\n /**\n * Hide this group: remove from the DOM\n */\n hide() {\n const label = this.dom.label;\n if (label.parentNode) {\n label.parentNode.removeChild(label);\n }\n\n const foreground = this.dom.foreground;\n if (foreground.parentNode) {\n foreground.parentNode.removeChild(foreground);\n }\n\n const background = this.dom.background;\n if (background.parentNode) {\n background.parentNode.removeChild(background);\n }\n\n const axis = this.dom.axis;\n if (axis.parentNode) {\n axis.parentNode.removeChild(axis);\n }\n }\n\n /**\n * Add an item to the group\n * @param {Item} item\n */\n add(item) {\n this.items[item.id] = item;\n item.setParent(this);\n this.stackDirty = true;\n // add to\n if (item.data.subgroup !== undefined) {\n this._addToSubgroup(item);\n this.orderSubgroups();\n }\n\n if (!this.visibleItems.includes(item)) {\n const range = this.itemSet.body.range; // TODO: not nice accessing the range like this\n this._checkIfVisible(item, this.visibleItems, range);\n }\n }\n\n /**\n * add item to subgroup\n * @param {object} item\n * @param {string} subgroupId\n */\n _addToSubgroup(item, subgroupId=item.data.subgroup) {\n if (subgroupId != undefined && this.subgroups[subgroupId] === undefined) {\n this.subgroups[subgroupId] = {\n height: 0,\n top: 0,\n start: item.data.start,\n end: item.data.end || item.data.start,\n visible: false,\n index: this.subgroupIndex,\n items: [],\n stack: this.subgroupStackAll || this.subgroupStack[subgroupId] || false\n };\n this.subgroupIndex++;\n }\n\n\n if (new Date(item.data.start) < new Date(this.subgroups[subgroupId].start)) {\n this.subgroups[subgroupId].start = item.data.start;\n }\n\n const itemEnd = item.data.end || item.data.start;\n if (new Date(itemEnd) > new Date(this.subgroups[subgroupId].end)) {\n this.subgroups[subgroupId].end = itemEnd;\n }\n\n this.subgroups[subgroupId].items.push(item);\n }\n\n /**\n * update subgroup sizes\n */\n _updateSubgroupsSizes() {\n const me = this;\n if (me.subgroups) {\n for (const subgroup in me.subgroups) {\n const initialEnd = me.subgroups[subgroup].items[0].data.end || me.subgroups[subgroup].items[0].data.start;\n let newStart = me.subgroups[subgroup].items[0].data.start;\n let newEnd = initialEnd - 1;\n\n me.subgroups[subgroup].items.forEach(item => {\n if (new Date(item.data.start) < new Date(newStart)) {\n newStart = item.data.start;\n }\n\n const itemEnd = item.data.end || item.data.start;\n if (new Date(itemEnd) > new Date(newEnd)) {\n newEnd = itemEnd;\n }\n })\n\n me.subgroups[subgroup].start = newStart;\n me.subgroups[subgroup].end = new Date(newEnd - 1) // -1 to compensate for colliding end to start subgroups;\n\n }\n }\n }\n\n /**\n * order subgroups\n */\n orderSubgroups() {\n if (this.subgroupOrderer !== undefined) {\n const sortArray = [];\n if (typeof this.subgroupOrderer == 'string') {\n for (const subgroup in this.subgroups) {\n sortArray.push({subgroup, sortField: this.subgroups[subgroup].items[0].data[this.subgroupOrderer]})\n }\n sortArray.sort((a, b) => a.sortField - b.sortField)\n }\n else if (typeof this.subgroupOrderer == 'function') {\n for (const subgroup in this.subgroups) {\n sortArray.push(this.subgroups[subgroup].items[0].data);\n }\n sortArray.sort(this.subgroupOrderer);\n }\n\n if (sortArray.length > 0) {\n for (let i = 0; i < sortArray.length; i++) {\n this.subgroups[sortArray[i].subgroup].index = i;\n }\n }\n }\n }\n\n /**\n * add item to subgroup\n */\n _resetSubgroups() {\n for (const subgroup in this.subgroups) {\n if (this.subgroups.hasOwnProperty(subgroup)) {\n this.subgroups[subgroup].visible = false;\n this.subgroups[subgroup].height = 0;\n }\n }\n }\n\n /**\n * Remove an item from the group\n * @param {Item} item\n */\n remove(item) {\n delete this.items[item.id];\n item.setParent(null);\n this.stackDirty = true;\n\n // remove from visible items\n const index = this.visibleItems.indexOf(item);\n if (index != -1) this.visibleItems.splice(index, 1);\n\n if(item.data.subgroup !== undefined){\n this._removeFromSubgroup(item);\n this.orderSubgroups();\n }\n }\n\n /**\n * remove item from subgroup\n * @param {object} item\n * @param {string} subgroupId\n */\n _removeFromSubgroup(item, subgroupId=item.data.subgroup) {\n if (subgroupId != undefined) {\n const subgroup = this.subgroups[subgroupId];\n if (subgroup){\n const itemIndex = subgroup.items.indexOf(item);\n // Check the item is actually in this subgroup. How should items not in the group be handled?\n if (itemIndex >= 0) {\n subgroup.items.splice(itemIndex,1);\n if (!subgroup.items.length){\n delete this.subgroups[subgroupId];\n } else {\n this._updateSubgroupsSizes();\n }\n }\n }\n }\n }\n\n /**\n * Remove an item from the corresponding DataSet\n * @param {Item} item\n */\n removeFromDataSet(item) {\n this.itemSet.removeItem(item.id);\n }\n\n /**\n * Reorder the items\n */\n order() {\n const array = util.toArray(this.items);\n const startArray = [];\n const endArray = [];\n\n for (let i = 0; i < array.length; i++) {\n if (array[i].data.end !== undefined) {\n endArray.push(array[i]);\n }\n startArray.push(array[i]);\n }\n this.orderedItems = {\n byStart: startArray,\n byEnd: endArray\n };\n\n stack.orderByStart(this.orderedItems.byStart);\n stack.orderByEnd(this.orderedItems.byEnd);\n }\n\n /**\n * Update the visible items\n * @param {{byStart: Item[], byEnd: Item[]}} orderedItems All items ordered by start date and by end date\n * @param {Item[]} oldVisibleItems The previously visible items.\n * @param {{start: number, end: number}} range Visible range\n * @return {Item[]} visibleItems The new visible items.\n * @private\n */\n _updateItemsInRange(orderedItems, oldVisibleItems, range) {\n const visibleItems = [];\n const visibleItemsLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems\n\n if (!this.isVisible && this.groupId != ReservedGroupIds.BACKGROUND) {\n for (let i = 0; i < oldVisibleItems.length; i++) {\n var item = oldVisibleItems[i];\n if (item.displayed) item.hide();\n }\n return visibleItems;\n } \n\n const interval = (range.end - range.start) / 4;\n const lowerBound = range.start - interval;\n const upperBound = range.end + interval;\n\n // this function is used to do the binary search for items having start date only.\n const startSearchFunction = value => {\n if (value < lowerBound) {return -1;}\n else if (value <= upperBound) {return 0;}\n else {return 1;}\n };\n\n // this function is used to do the binary search for items having start and end dates (range).\n const endSearchFunction = value => {\n if (value < lowerBound) {return -1;}\n else {return 0;}\n }\n\n // first check if the items that were in view previously are still in view.\n // IMPORTANT: this handles the case for the items with startdate before the window and enddate after the window!\n // also cleans up invisible items.\n if (oldVisibleItems.length > 0) {\n for (let i = 0; i < oldVisibleItems.length; i++) {\n this._checkIfVisibleWithReference(oldVisibleItems[i], visibleItems, visibleItemsLookup, range);\n }\n }\n\n // we do a binary search for the items that have only start values.\n const initialPosByStart = util.binarySearchCustom(orderedItems.byStart, startSearchFunction, 'data','start');\n\n // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the start values.\n this._traceVisible(initialPosByStart, orderedItems.byStart, visibleItems, visibleItemsLookup, item => item.data.start < lowerBound || item.data.start > upperBound);\n\n // if the window has changed programmatically without overlapping the old window, the ranged items with start < lowerBound and end > upperbound are not shown.\n // We therefore have to brute force check all items in the byEnd list\n if (this.checkRangedItems == true) {\n this.checkRangedItems = false;\n for (let i = 0; i < orderedItems.byEnd.length; i++) {\n this._checkIfVisibleWithReference(orderedItems.byEnd[i], visibleItems, visibleItemsLookup, range);\n }\n }\n else {\n // we do a binary search for the items that have defined end times.\n const initialPosByEnd = util.binarySearchCustom(orderedItems.byEnd, endSearchFunction, 'data','end');\n\n // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the end values.\n this._traceVisible(initialPosByEnd, orderedItems.byEnd, visibleItems, visibleItemsLookup, item => item.data.end < lowerBound || item.data.start > upperBound);\n }\n\n const redrawQueue = {};\n let redrawQueueLength = 0;\n\n for (let i = 0; i < visibleItems.length; i++) {\n const item = visibleItems[i];\n if (!item.displayed) {\n const returnQueue = true;\n redrawQueue[i] = item.redraw(returnQueue);\n redrawQueueLength = redrawQueue[i].length;\n }\n }\n\n const needRedraw = redrawQueueLength > 0;\n if (needRedraw) {\n // redraw all regular items\n for (let j = 0; j < redrawQueueLength; j++) {\n util.forEach(redrawQueue, fns => {\n fns[j]();\n });\n }\n }\n\n for (let i = 0; i < visibleItems.length; i++) {\n visibleItems[i].repositionX();\n }\n\n return visibleItems;\n }\n\n /**\n * trace visible items in group\n * @param {number} initialPos\n * @param {array} items\n * @param {aray} visibleItems\n * @param {object} visibleItemsLookup\n * @param {function} breakCondition\n */\n _traceVisible(initialPos, items, visibleItems, visibleItemsLookup, breakCondition) {\n if (initialPos != -1) {\n for (let i = initialPos; i >= 0; i--) {\n let item = items[i];\n if (breakCondition(item)) {\n break;\n }\n else {\n if (!(item.isCluster && !item.hasItems()) && !item.cluster) {\n if (visibleItemsLookup[item.id] === undefined) {\n visibleItemsLookup[item.id] = true;\n visibleItems.push(item);\n }\n }\n }\n }\n\n for (let i = initialPos + 1; i < items.length; i++) {\n let item = items[i];\n if (breakCondition(item)) {\n break;\n }\n else {\n if (!(item.isCluster && !item.hasItems()) && !item.cluster) {\n if (visibleItemsLookup[item.id] === undefined) {\n visibleItemsLookup[item.id] = true;\n visibleItems.push(item);\n }\n }\n }\n }\n }\n }\n\n /**\n * this function is very similar to the _checkIfInvisible() but it does not\n * return booleans, hides the item if it should not be seen and always adds to\n * the visibleItems.\n * this one is for brute forcing and hiding.\n *\n * @param {Item} item\n * @param {Array} visibleItems\n * @param {{start:number, end:number}} range\n * @private\n */\n _checkIfVisible(item, visibleItems, range) {\n if (item.isVisible(range)) {\n if (!item.displayed) item.show();\n // reposition item horizontally\n item.repositionX();\n visibleItems.push(item);\n }\n else {\n if (item.displayed) item.hide();\n }\n }\n\n /**\n * this function is very similar to the _checkIfInvisible() but it does not\n * return booleans, hides the item if it should not be seen and always adds to\n * the visibleItems.\n * this one is for brute forcing and hiding.\n *\n * @param {Item} item\n * @param {Array.} visibleItems\n * @param {Object} visibleItemsLookup\n * @param {{start:number, end:number}} range\n * @private\n */\n _checkIfVisibleWithReference(item, visibleItems, visibleItemsLookup, range) {\n if (item.isVisible(range)) {\n if (visibleItemsLookup[item.id] === undefined) {\n visibleItemsLookup[item.id] = true;\n visibleItems.push(item);\n }\n }\n else {\n if (item.displayed) item.hide();\n }\n }\n\n /**\n * Update the visible items\n * @param {array} orderedClusters \n * @param {array} oldVisibleClusters \n * @param {{start: number, end: number}} range \n * @return {Item[]} visibleItems \n * @private\n */\n _updateClustersInRange(orderedClusters, oldVisibleClusters, range) {\n // Clusters can overlap each other so we cannot use binary search here\n const visibleClusters = [];\n const visibleClustersLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems\n \n if (oldVisibleClusters.length > 0) {\n for (let i = 0; i < oldVisibleClusters.length; i++) {\n this._checkIfVisibleWithReference(oldVisibleClusters[i], visibleClusters, visibleClustersLookup, range);\n }\n }\n \n for (let i = 0; i < orderedClusters.byStart.length; i++) {\n this._checkIfVisibleWithReference(orderedClusters.byStart[i], visibleClusters, visibleClustersLookup, range);\n }\n \n for (let i = 0; i < orderedClusters.byEnd.length; i++) {\n this._checkIfVisibleWithReference(orderedClusters.byEnd[i], visibleClusters, visibleClustersLookup, range);\n }\n \n const redrawQueue = {};\n let redrawQueueLength = 0;\n \n for (let i = 0; i < visibleClusters.length; i++) {\n const item = visibleClusters[i];\n if (!item.displayed) {\n const returnQueue = true;\n redrawQueue[i] = item.redraw(returnQueue);\n redrawQueueLength = redrawQueue[i].length;\n }\n }\n \n const needRedraw = redrawQueueLength > 0;\n if (needRedraw) {\n // redraw all regular items\n for (var j = 0; j < redrawQueueLength; j++) {\n util.forEach(redrawQueue, function (fns) {\n fns[j]();\n });\n }\n }\n \n for (let i = 0; i < visibleClusters.length; i++) {\n visibleClusters[i].repositionX();\n }\n \n return visibleClusters;\n }\n\n /**\n * change item subgroup\n * @param {object} item\n * @param {string} oldSubgroup\n * @param {string} newSubgroup\n */\n changeSubgroup(item, oldSubgroup, newSubgroup) {\n this._removeFromSubgroup(item, oldSubgroup);\n this._addToSubgroup(item, newSubgroup);\n this.orderSubgroups();\n }\n}\n\nexport default Group;\n","import Group from './Group'\n\n/**\n * @constructor BackgroundGroup\n * @extends Group\n */\nclass BackgroundGroup extends Group {\n /**\n * @param {number | string} groupId\n * @param {Object} data\n * @param {ItemSet} itemSet\n */\n constructor(groupId, data, itemSet) {\n super(groupId, data, itemSet)\n // Group.call(this, groupId, data, itemSet);\n\n this.width = 0;\n this.height = 0;\n this.top = 0;\n this.left = 0;\n }\n\n /**\n * Repaint this group\n * @param {{start: number, end: number}} range\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * @param {boolean} [forceRestack=false] Force restacking of all items\n * @return {boolean} Returns true if the group is resized\n */\n redraw(range, margin, forceRestack) { // eslint-disable-line no-unused-vars\n const resized = false;\n\n this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range);\n\n // calculate actual size\n this.width = this.dom.background.offsetWidth;\n\n // apply new height (just always zero for BackgroundGroup\n this.dom.background.style.height = '0';\n\n // update vertical position of items after they are re-stacked and the height of the group is calculated\n for (let i = 0, ii = this.visibleItems.length; i < ii; i++) {\n const item = this.visibleItems[i];\n item.repositionY(margin);\n }\n\n return resized;\n }\n\n /**\n * Show this group: attach to the DOM\n */\n show() {\n if (!this.dom.background.parentNode) {\n this.itemSet.dom.background.appendChild(this.dom.background);\n }\n }\n}\n\nexport default BackgroundGroup;","import Hammer from '../../../module/hammer';\nimport util from '../../../util';\nimport moment from '../../../module/moment';\nimport locales from '../../locales';\n\nimport '../css/item.css';\n\n/**\n * Item\n */\nclass Item {\n /**\n * @constructor Item\n * @param {Object} data Object containing (optional) parameters type,\n * start, end, content, group, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} options Configuration options\n * // TODO: describe available options\n */\n constructor(data, conversion, options) {\n this.id = null;\n this.parent = null;\n this.data = data;\n this.dom = null;\n this.conversion = conversion || {};\n this.defaultOptions = {\n locales,\n locale: 'en'\n };\n this.options = util.extend({}, this.defaultOptions, options);\n this.options.locales = util.extend({}, locales, this.options.locales);\n const defaultLocales = this.defaultOptions.locales[this.defaultOptions.locale];\n Object.keys(this.options.locales).forEach(locale => {\n this.options.locales[locale] = util.extend(\n {},\n defaultLocales,\n this.options.locales[locale]\n );\n });\n this.selected = false;\n this.displayed = false;\n this.groupShowing = true;\n this.selectable = (options && options.selectable) || false;\n this.dirty = true;\n\n this.top = null;\n this.right = null;\n this.left = null;\n this.width = null;\n this.height = null;\n\n this.setSelectability(data);\n\n this.editable = null;\n this._updateEditStatus();\n }\n\n /**\n * Select current item\n */\n select() {\n if (this.selectable) {\n this.selected = true;\n this.dirty = true;\n if (this.displayed) this.redraw();\n }\n }\n\n /**\n * Unselect current item\n */\n unselect() {\n this.selected = false;\n this.dirty = true;\n if (this.displayed) this.redraw();\n }\n\n /**\n * Set data for the item. Existing data will be updated. The id should not\n * be changed. When the item is displayed, it will be redrawn immediately.\n * @param {Object} data\n */\n setData(data) {\n const groupChanged = data.group != undefined && this.data.group != data.group;\n if (groupChanged && this.parent != null) {\n this.parent.itemSet._moveToGroup(this, data.group);\n }\n\n this.setSelectability(data);\n\n if (this.parent) {\n this.parent.stackDirty = true;\n }\n \n const subGroupChanged = data.subgroup != undefined && this.data.subgroup != data.subgroup;\n if (subGroupChanged && this.parent != null) {\n this.parent.changeSubgroup(this, this.data.subgroup, data.subgroup);\n }\n\n this.data = data;\n this._updateEditStatus();\n this.dirty = true;\n if (this.displayed) this.redraw();\n }\n\n /**\n * Set whether the item can be selected.\n * Can only be set/unset if the timeline's `selectable` configuration option is `true`.\n * @param {Object} data `data` from `constructor` and `setData`\n */\n setSelectability(data) {\n if (data) {\n this.selectable = typeof data.selectable === 'undefined' ? true : Boolean(data.selectable);\n }\n }\n\n /**\n * Set a parent for the item\n * @param {Group} parent\n */\n setParent(parent) {\n if (this.displayed) {\n this.hide();\n this.parent = parent;\n if (this.parent) {\n this.show();\n }\n }\n else {\n this.parent = parent;\n }\n }\n\n /**\n * Check whether this item is visible inside given range\n * @param {timeline.Range} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\n isVisible(range) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n * Show the Item in the DOM (when not already visible)\n * @return {Boolean} changed\n */\n show() {\n return false;\n }\n\n /**\n * Hide the Item from the DOM (when visible)\n * @return {Boolean} changed\n */\n hide() {\n return false;\n }\n\n /**\n * Repaint the item\n */\n redraw() {\n // should be implemented by the item\n }\n\n /**\n * Reposition the Item horizontally\n */\n repositionX() {\n // should be implemented by the item\n }\n\n /**\n * Reposition the Item vertically\n */\n repositionY() {\n // should be implemented by the item\n }\n\n /**\n * Repaint a drag area on the center of the item when the item is selected\n * @protected\n */\n _repaintDragCenter() {\n if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) {\n const me = this;\n // create and show drag area\n const dragCenter = document.createElement('div');\n dragCenter.className = 'vis-drag-center';\n dragCenter.dragCenterItem = this;\n this.hammerDragCenter = new Hammer(dragCenter);\n\n this.hammerDragCenter.on('tap', event => {\n me.parent.itemSet.body.emitter.emit('click', {\n event,\n item: me.id\n });\n });\n this.hammerDragCenter.on('doubletap', event => {\n event.stopPropagation();\n me.parent.itemSet._onUpdateItem(me);\n me.parent.itemSet.body.emitter.emit('doubleClick', {\n event,\n item: me.id\n });\n });\n this.hammerDragCenter.on('panstart', me.parent.itemSet._onDragStart.bind(me.parent.itemSet));\n this.hammerDragCenter.on('panmove', me.parent.itemSet._onDrag.bind(me.parent.itemSet));\n this.hammerDragCenter.on('panend', me.parent.itemSet._onDragEnd.bind(me.parent.itemSet));\n\n if (this.dom.box) {\n if (this.dom.dragLeft) {\n this.dom.box.insertBefore(dragCenter, this.dom.dragLeft);\n }\n else {\n this.dom.box.appendChild(dragCenter);\n }\n }\n else if (this.dom.point) {\n this.dom.point.appendChild(dragCenter);\n }\n \n this.dom.dragCenter = dragCenter;\n }\n else if (!this.selected && this.dom.dragCenter) {\n // delete drag area\n if (this.dom.dragCenter.parentNode) {\n this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter);\n }\n this.dom.dragCenter = null;\n \n if (this.hammerDragCenter) {\n this.hammerDragCenter.destroy();\n this.hammerDragCenter = null;\n }\n }\n }\n\n /**\n * Repaint a delete button on the top right of the item when the item is selected\n * @param {HTMLElement} anchor\n * @protected\n */\n _repaintDeleteButton(anchor) {\n const editable = ((this.options.editable.overrideItems || this.editable == null) && this.options.editable.remove) ||\n (!this.options.editable.overrideItems && this.editable != null && this.editable.remove);\n\n if (this.selected && editable && !this.dom.deleteButton) {\n // create and show button\n const me = this;\n\n const deleteButton = document.createElement('div');\n\n if (this.options.rtl) {\n deleteButton.className = 'vis-delete-rtl';\n } else {\n deleteButton.className = 'vis-delete';\n }\n let optionsLocale = this.options.locales[this.options.locale];\n if (!optionsLocale) {\n if (!this.warned) {\n console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`);\n this.warned = true;\n }\n optionsLocale = this.options.locales['en']; // fall back on english when not available\n }\n deleteButton.title = optionsLocale.deleteSelected;\n\n // TODO: be able to destroy the delete button\n this.hammerDeleteButton = new Hammer(deleteButton).on('tap', event => {\n event.stopPropagation();\n me.parent.removeFromDataSet(me);\n });\n\n anchor.appendChild(deleteButton);\n this.dom.deleteButton = deleteButton;\n }\n else if (!this.selected && this.dom.deleteButton) {\n // remove button\n if (this.dom.deleteButton.parentNode) {\n this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton);\n }\n this.dom.deleteButton = null;\n\n if (this.hammerDeleteButton) {\n this.hammerDeleteButton.destroy();\n this.hammerDeleteButton = null;\n }\n }\n }\n\n /**\n * Repaint a onChange tooltip on the top right of the item when the item is selected\n * @param {HTMLElement} anchor\n * @protected\n */\n _repaintOnItemUpdateTimeTooltip(anchor) {\n if (!this.options.tooltipOnItemUpdateTime) return;\n\n const editable = (this.options.editable.updateTime || \n this.data.editable === true) &&\n this.data.editable !== false;\n\n if (this.selected && editable && !this.dom.onItemUpdateTimeTooltip) {\n const onItemUpdateTimeTooltip = document.createElement('div');\n\n onItemUpdateTimeTooltip.className = 'vis-onUpdateTime-tooltip';\n anchor.appendChild(onItemUpdateTimeTooltip);\n this.dom.onItemUpdateTimeTooltip = onItemUpdateTimeTooltip;\n\n } else if (!this.selected && this.dom.onItemUpdateTimeTooltip) {\n // remove button\n if (this.dom.onItemUpdateTimeTooltip.parentNode) {\n this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip);\n }\n this.dom.onItemUpdateTimeTooltip = null;\n }\n\n // position onChange tooltip\n if (this.dom.onItemUpdateTimeTooltip) {\n\n // only show when editing\n this.dom.onItemUpdateTimeTooltip.style.visibility = this.parent.itemSet.touchParams.itemIsDragging ? 'visible' : 'hidden';\n \n // position relative to item's content\n this.dom.onItemUpdateTimeTooltip.style.transform = 'translateX(-50%)';\n this.dom.onItemUpdateTimeTooltip.style.left = '50%';\n\n // position above or below the item depending on the item's position in the window\n const tooltipOffset = 50; // TODO: should be tooltip height (depends on template)\n const scrollTop = this.parent.itemSet.body.domProps.scrollTop;\n\n // TODO: this.top for orientation:true is actually the items distance from the bottom... \n // (should be this.bottom)\n let itemDistanceFromTop; \n if (this.options.orientation.item == 'top') {\n itemDistanceFromTop = this.top;\n } else {\n itemDistanceFromTop = (this.parent.height - this.top - this.height)\n }\n const isCloseToTop = itemDistanceFromTop + this.parent.top - tooltipOffset < -scrollTop;\n\n if (isCloseToTop) {\n this.dom.onItemUpdateTimeTooltip.style.bottom = \"\";\n this.dom.onItemUpdateTimeTooltip.style.top = `${this.height + 2}px`;\n } else {\n this.dom.onItemUpdateTimeTooltip.style.top = \"\";\n this.dom.onItemUpdateTimeTooltip.style.bottom = `${this.height + 2}px`;\n }\n \n // handle tooltip content\n let content;\n let templateFunction;\n\n if (this.options.tooltipOnItemUpdateTime && this.options.tooltipOnItemUpdateTime.template) {\n templateFunction = this.options.tooltipOnItemUpdateTime.template.bind(this);\n content = templateFunction(this.data);\n } else {\n content = `start: ${moment(this.data.start).format('MM/DD/YYYY hh:mm')}`;\n if (this.data.end) { \n content += `
end: ${moment(this.data.end).format('MM/DD/YYYY hh:mm')}`;\n }\n }\n this.dom.onItemUpdateTimeTooltip.innerHTML = content;\n }\n }\n\n /**\n * get item data\n * @return {object}\n * @private\n */\n _getItemData() {\n return this.parent.itemSet.itemsData.get(this.id);\n }\n\n /**\n * Set HTML contents for the item\n * @param {Element} element HTML element to fill with the contents\n * @private\n */\n _updateContents(element) {\n let content;\n let changed;\n let templateFunction;\n let itemVisibleFrameContent;\n let visibleFrameTemplateFunction; \n const itemData = this._getItemData(); // get a clone of the data from the dataset\n\n const frameElement = this.dom.box || this.dom.point;\n const itemVisibleFrameContentElement = frameElement.getElementsByClassName('vis-item-visible-frame')[0];\n\n if (this.options.visibleFrameTemplate) {\n visibleFrameTemplateFunction = this.options.visibleFrameTemplate.bind(this);\n itemVisibleFrameContent = visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement);\n } else {\n itemVisibleFrameContent = '';\n }\n \n if (itemVisibleFrameContentElement) {\n if ((itemVisibleFrameContent instanceof Object) && !(itemVisibleFrameContent instanceof Element)) {\n visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement)\n } else {\n changed = this._contentToString(this.itemVisibleFrameContent) !== this._contentToString(itemVisibleFrameContent);\n if (changed) {\n // only replace the content when changed\n if (itemVisibleFrameContent instanceof Element) {\n itemVisibleFrameContentElement.innerHTML = '';\n itemVisibleFrameContentElement.appendChild(itemVisibleFrameContent);\n }\n else if (itemVisibleFrameContent != undefined) {\n itemVisibleFrameContentElement.innerHTML = itemVisibleFrameContent;\n }\n else {\n if (!(this.data.type == 'background' && this.data.content === undefined)) {\n throw new Error(`Property \"content\" missing in item ${this.id}`);\n }\n }\n\n this.itemVisibleFrameContent = itemVisibleFrameContent;\n }\n }\n }\n\n if (this.options.template) {\n templateFunction = this.options.template.bind(this);\n content = templateFunction(itemData, element, this.data);\n } else {\n content = this.data.content;\n }\n\n if ((content instanceof Object) && !(content instanceof Element)) {\n templateFunction(itemData, element)\n } else {\n changed = this._contentToString(this.content) !== this._contentToString(content);\n if (changed) {\n // only replace the content when changed\n if (content instanceof Element) {\n element.innerHTML = '';\n element.appendChild(content);\n }\n else if (content != undefined) {\n element.innerHTML = content;\n }\n else {\n if (!(this.data.type == 'background' && this.data.content === undefined)) {\n throw new Error(`Property \"content\" missing in item ${this.id}`);\n }\n }\n this.content = content;\n }\n }\n }\n\n /**\n * Process dataAttributes timeline option and set as data- attributes on dom.content\n * @param {Element} element HTML element to which the attributes will be attached\n * @private\n */\n _updateDataAttributes(element) {\n if (this.options.dataAttributes && this.options.dataAttributes.length > 0) {\n let attributes = [];\n\n if (Array.isArray(this.options.dataAttributes)) {\n attributes = this.options.dataAttributes;\n }\n else if (this.options.dataAttributes == 'all') {\n attributes = Object.keys(this.data);\n }\n else {\n return;\n }\n\n for (const name of attributes) {\n const value = this.data[name];\n\n if (value != null) {\n element.setAttribute(`data-${name}`, value);\n }\n else {\n element.removeAttribute(`data-${name}`);\n }\n }\n }\n }\n\n /**\n * Update custom styles of the element\n * @param {Element} element\n * @private\n */\n _updateStyle(element) {\n // remove old styles\n if (this.style) {\n util.removeCssText(element, this.style);\n this.style = null;\n }\n\n // append new styles\n if (this.data.style) {\n util.addCssText(element, this.data.style);\n this.style = this.data.style;\n }\n }\n\n /**\n * Stringify the items contents\n * @param {string | Element | undefined} content\n * @returns {string | undefined}\n * @private\n */\n _contentToString(content) {\n if (typeof content === 'string') return content;\n if (content && 'outerHTML' in content) return content.outerHTML;\n return content;\n }\n\n /**\n * Update the editability of this item.\n */\n _updateEditStatus() {\n if (this.options) {\n if(typeof this.options.editable === 'boolean') {\n this.editable = {\n updateTime: this.options.editable,\n updateGroup: this.options.editable,\n remove: this.options.editable\n };\n } else if(typeof this.options.editable === 'object') {\n this.editable = {};\n util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, this.options.editable);\n }\n }\n // Item data overrides, except if options.editable.overrideItems is set.\n if (!this.options || !(this.options.editable) || (this.options.editable.overrideItems !== true)) {\n if (this.data) {\n if (typeof this.data.editable === 'boolean') {\n this.editable = {\n updateTime: this.data.editable,\n updateGroup: this.data.editable,\n remove: this.data.editable\n }\n } else if (typeof this.data.editable === 'object') {\n // TODO: in timeline.js 5.0, we should change this to not reset options from the timeline configuration.\n // Basically just remove the next line...\n this.editable = {};\n util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, this.data.editable);\n }\n }\n }\n }\n\n /**\n * Return the width of the item left from its start date\n * @return {number}\n */\n getWidthLeft() {\n return 0;\n }\n\n /**\n * Return the width of the item right from the max of its start and end date\n * @return {number}\n */\n getWidthRight() {\n return 0;\n }\n\n /**\n * Return the title of the item\n * @return {string | undefined}\n */\n getTitle() {\n if (this.options.tooltip && this.options.tooltip.template) {\n const templateFunction = this.options.tooltip.template.bind(this);\n return templateFunction(this._getItemData(), this.data);\n }\n\n return this.data.title;\n }\n}\n\nItem.prototype.stack = true;\n\nexport default Item;\n","import Item from './Item';\n\n/**\n * @constructor BoxItem\n * @extends Item\n */\nclass BoxItem extends Item {\n /**\n * @param {Object} data Object containing parameters start\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe available options\n */\n constructor(data, conversion, options) {\n super(data, conversion, options)\n this.props = {\n dot: {\n width: 0,\n height: 0\n },\n line: {\n width: 0,\n height: 0\n }\n };\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error(`Property \"start\" missing in item ${data}`);\n }\n }\n }\n\n /**\n * Check whether this item is visible inside given range\n * @param {{start: number, end: number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\n isVisible(range) {\n if (this.cluster) {\n return false;\n }\n // determine visibility\n let isVisible;\n const align = this.data.align || this.options.align;\n const widthInMs = this.width * range.getMillisecondsPerPixel();\n\n if (align == 'right') {\n isVisible = (this.data.start.getTime() > range.start) && (this.data.start.getTime() - widthInMs < range.end);\n }\n else if (align == 'left') {\n isVisible = (this.data.start.getTime() + widthInMs > range.start) && (this.data.start.getTime() < range.end);\n }\n else {\n // default or 'center'\n isVisible = (this.data.start.getTime() + widthInMs / 2 > range.start ) && (this.data.start.getTime() - widthInMs/2 < range.end);\n }\n return isVisible;\n }\n\n /**\n * create DOM element\n * @private\n */\n _createDomElement() {\n if (!this.dom) {\n // create DOM\n this.dom = {};\n\n // create main box\n this.dom.box = document.createElement('DIV');\n\n // contents box (inside the background box). used for making margins\n this.dom.content = document.createElement('DIV');\n this.dom.content.className = 'vis-item-content';\n this.dom.box.appendChild(this.dom.content);\n\n // line to axis\n this.dom.line = document.createElement('DIV');\n this.dom.line.className = 'vis-line';\n\n // dot on axis\n this.dom.dot = document.createElement('DIV');\n this.dom.dot.className = 'vis-dot';\n\n // attach this item as attribute\n this.dom.box['vis-item'] = this;\n\n this.dirty = true;\n }\n }\n\n /**\n * append DOM element\n * @private\n */\n _appendDomElement() {\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!this.dom.box.parentNode) {\n const foreground = this.parent.dom.foreground;\n if (!foreground) throw new Error('Cannot redraw item: parent has no foreground container element');\n foreground.appendChild(this.dom.box);\n }\n if (!this.dom.line.parentNode) {\n var background = this.parent.dom.background;\n if (!background) throw new Error('Cannot redraw item: parent has no background container element');\n background.appendChild(this.dom.line);\n }\n if (!this.dom.dot.parentNode) {\n const axis = this.parent.dom.axis;\n if (!background) throw new Error('Cannot redraw item: parent has no axis container element');\n axis.appendChild(this.dom.dot);\n }\n this.displayed = true;\n }\n\n /**\n * update dirty DOM element\n * @private\n */\n _updateDirtyDomComponents() {\n // An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateDataAttributes(this.dom.box);\n this._updateStyle(this.dom.box);\n\n const editable = (this.editable.updateTime || this.editable.updateGroup);\n\n // update class\n const className = (this.data.className ? ' ' + this.data.className : '') +\n (this.selected ? ' vis-selected' : '') +\n (editable ? ' vis-editable' : ' vis-readonly');\n this.dom.box.className = `vis-item vis-box${className}`;\n this.dom.line.className = `vis-item vis-line${className}`;\n this.dom.dot.className = `vis-item vis-dot${className}`;\n }\n }\n\n /**\n * get DOM components sizes\n * @return {object}\n * @private\n */\n _getDomComponentsSizes() {\n return {\n previous: {\n right: this.dom.box.style.right,\n left: this.dom.box.style.left\n },\n dot: {\n height: this.dom.dot.offsetHeight,\n width: this.dom.dot.offsetWidth\n },\n line: {\n width: this.dom.line.offsetWidth\n },\n box: {\n width: this.dom.box.offsetWidth,\n height: this.dom.box.offsetHeight\n }\n }\n }\n\n /**\n * update DOM components sizes\n * @param {object} sizes\n * @private\n */\n _updateDomComponentsSizes(sizes) {\n if (this.options.rtl) {\n this.dom.box.style.right = \"0px\";\n } else {\n this.dom.box.style.left = \"0px\";\n }\n\n // recalculate size\n this.props.dot.height = sizes.dot.height;\n this.props.dot.width = sizes.dot.width;\n this.props.line.width = sizes.line.width;\n this.width = sizes.box.width;\n this.height = sizes.box.height;\n\n // restore previous position\n if (this.options.rtl) {\n this.dom.box.style.right = sizes.previous.right;\n } else {\n this.dom.box.style.left = sizes.previous.left;\n }\n\n this.dirty = false;\n }\n\n /**\n * repaint DOM additionals\n * @private\n */\n _repaintDomAdditionals() {\n this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n this._repaintDragCenter();\n this._repaintDeleteButton(this.dom.box);\n }\n\n /**\n * Repaint the item\n * @param {boolean} [returnQueue=false] return the queue\n * @return {boolean} the redraw queue if returnQueue=true\n */\n redraw(returnQueue) {\n let sizes;\n const queue = [\n // create item DOM\n this._createDomElement.bind(this),\n\n // append DOM to parent DOM\n this._appendDomElement.bind(this),\n\n // update dirty DOM\n this._updateDirtyDomComponents.bind(this),\n\n () => {\n if (this.dirty) {\n sizes = this._getDomComponentsSizes();\n }\n },\n\n () => {\n if (this.dirty) {\n this._updateDomComponentsSizes.bind(this)(sizes);\n }\n },\n\n // repaint DOM additionals\n this._repaintDomAdditionals.bind(this)\n ];\n\n if (returnQueue) {\n return queue;\n } else {\n let result;\n queue.forEach(fn => {\n result = fn();\n });\n return result;\n }\n }\n\n /**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n * @param {boolean} [returnQueue=false] whether to return a queue of functions to execute instead of just executing them\n * @return {boolean} the redraw queue if returnQueue=true\n */\n show(returnQueue) {\n if (!this.displayed) {\n return this.redraw(returnQueue);\n }\n }\n\n /**\n * Hide the item from the DOM (when visible)\n */\n hide() {\n if (this.displayed) {\n const dom = this.dom;\n\n if (dom.box.parentNode) dom.box.remove();\n if (dom.line.parentNode) dom.line.remove();\n if (dom.dot.parentNode) dom.dot.remove();\n\n this.displayed = false;\n }\n }\n\n /**\n * Reposition the item XY\n */\n repositionXY() {\n const rtl = this.options.rtl;\n\n const repositionXY = (element, x, y, rtl = false) => {\n if (x === undefined && y === undefined) return;\n // If rtl invert the number.\n const directionX = rtl ? (x * -1) : x;\n\n //no y. translate x\n if (y === undefined) {\n element.style.transform = `translateX(${directionX}px)`;\n return;\n }\n\n //no x. translate y\n if (x === undefined) {\n element.style.transform = `translateY(${y}px)`;\n return;\n }\n\n element.style.transform = `translate(${directionX}px, ${y}px)`;\n }\n repositionXY(this.dom.box, this.boxX, this.boxY, rtl);\n repositionXY(this.dom.dot, this.dotX, this.dotY, rtl);\n repositionXY(this.dom.line, this.lineX, this.lineY, rtl);\n }\n\n /**\n * Reposition the item horizontally\n * @Override\n */\n repositionX() {\n const start = this.conversion.toScreen(this.data.start);\n const align = this.data.align === undefined ? this.options.align : this.data.align\n const lineWidth = this.props.line.width;\n const dotWidth = this.props.dot.width;\n \n if (align == 'right') {\n // calculate right position of the box\n this.boxX = start - this.width;\n this.lineX = start - lineWidth;\n this.dotX = start - lineWidth / 2 - dotWidth / 2;\n }\n else if (align == 'left') {\n // calculate left position of the box\n this.boxX = start;\n this.lineX = start;\n this.dotX = start + lineWidth / 2 - dotWidth / 2;\n }\n else {\n // default or 'center'\n this.boxX = start - this.width / 2;\n this.lineX = this.options.rtl ? start - lineWidth : start - lineWidth / 2;\n this.dotX = start - dotWidth / 2;\n }\n\n if (this.options.rtl)\n this.right = this.boxX;\n else\n this.left = this.boxX;\n\n this.repositionXY();\n }\n\n /**\n * Reposition the item vertically\n * @Override\n */\n repositionY() {\n const orientation = this.options.orientation.item;\n const lineStyle = this.dom.line.style;\n\n if (orientation == 'top') {\n const lineHeight = this.parent.top + this.top + 1;\n\n this.boxY = this.top || 0;\n lineStyle.height = `${lineHeight}px`;\n lineStyle.bottom = '';\n lineStyle.top = '0';\n }\n else { // orientation 'bottom'\n const itemSetHeight = this.parent.itemSet.props.height; // TODO: this is nasty\n const lineHeight = itemSetHeight - this.parent.top - this.parent.height + this.top;\n\n this.boxY = this.parent.height - this.top - (this.height || 0);\n lineStyle.height = `${lineHeight}px`;\n lineStyle.top = '';\n lineStyle.bottom = '0';\n }\n\n this.dotY = -this.props.dot.height / 2;\n\n this.repositionXY();\n }\n\n /**\n * Return the width of the item left from its start date\n * @return {number}\n */\n getWidthLeft() {\n return this.width / 2;\n }\n\n /**\n * Return the width of the item right from its start date\n * @return {number}\n */\n getWidthRight() {\n return this.width / 2;\n }\n}\n\nexport default BoxItem;\n","import Item from './Item';\n\n/**\n * @constructor PointItem\n * @extends Item\n */\nclass PointItem extends Item {\n /**\n * @param {Object} data Object containing parameters start\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe available options\n */\n constructor(data, conversion, options) {\n super(data, conversion, options)\n this.props = {\n dot: {\n top: 0,\n width: 0,\n height: 0\n },\n content: {\n height: 0,\n marginLeft: 0,\n marginRight: 0\n }\n };\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error(`Property \"start\" missing in item ${data}`);\n }\n }\n }\n\n /**\n * Check whether this item is visible inside given range\n * @param {{start: number, end: number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\n isVisible(range) {\n if (this.cluster) {\n return false;\n }\n // determine visibility\n const widthInMs = this.width * range.getMillisecondsPerPixel();\n \n return (this.data.start.getTime() + widthInMs > range.start ) && (this.data.start < range.end);\n }\n\n /**\n * create DOM element\n * @private\n */\n _createDomElement() {\n if (!this.dom) {\n // create DOM\n this.dom = {};\n\n // background box\n this.dom.point = document.createElement('div');\n // className is updated in redraw()\n\n // contents box, right from the dot\n this.dom.content = document.createElement('div');\n this.dom.content.className = 'vis-item-content';\n this.dom.point.appendChild(this.dom.content);\n\n // dot at start\n this.dom.dot = document.createElement('div');\n this.dom.point.appendChild(this.dom.dot);\n\n // attach this item as attribute\n this.dom.point['vis-item'] = this;\n\n this.dirty = true;\n }\n }\n\n /**\n * append DOM element\n * @private\n */\n _appendDomElement() {\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!this.dom.point.parentNode) {\n const foreground = this.parent.dom.foreground;\n if (!foreground) {\n throw new Error('Cannot redraw item: parent has no foreground container element');\n }\n foreground.appendChild(this.dom.point);\n }\n this.displayed = true;\n }\n\n /**\n * update dirty DOM components\n * @private\n */\n _updateDirtyDomComponents() {\n // An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateDataAttributes(this.dom.point);\n this._updateStyle(this.dom.point);\n\n const editable = (this.editable.updateTime || this.editable.updateGroup);\n // update class\n const className = (this.data.className ? ' ' + this.data.className : '') +\n (this.selected ? ' vis-selected' : '') +\n (editable ? ' vis-editable' : ' vis-readonly');\n this.dom.point.className = `vis-item vis-point${className}`;\n this.dom.dot.className = `vis-item vis-dot${className}`;\n }\n }\n\n /**\n * get DOM component sizes\n * @return {object}\n * @private\n */\n _getDomComponentsSizes() {\n return {\n dot: {\n width: this.dom.dot.offsetWidth,\n height: this.dom.dot.offsetHeight\n },\n content: {\n width: this.dom.content.offsetWidth,\n height: this.dom.content.offsetHeight\n },\n point: {\n width: this.dom.point.offsetWidth,\n height: this.dom.point.offsetHeight\n }\n }\n }\n\n /**\n * update DOM components sizes\n * @param {array} sizes\n * @private\n */\n _updateDomComponentsSizes(sizes) {\n // recalculate size of dot and contents\n this.props.dot.width = sizes.dot.width;\n this.props.dot.height = sizes.dot.height;\n this.props.content.height = sizes.content.height;\n\n // resize contents\n if (this.options.rtl) {\n this.dom.content.style.marginRight = `${2 * this.props.dot.width}px`;\n } else {\n this.dom.content.style.marginLeft = `${2 * this.props.dot.width}px`;\n }\n //this.dom.content.style.marginRight = ... + 'px'; // TODO: margin right\n\n // recalculate size\n this.width = sizes.point.width;\n this.height = sizes.point.height;\n\n // reposition the dot\n this.dom.dot.style.top = `${(this.height - this.props.dot.height) / 2}px`;\n \n const dotWidth = this.props.dot.width;\n const translateX = this.options.rtl ? (dotWidth / 2) * -1 : dotWidth / 2;\n this.dom.dot.style.transform = `translateX(${translateX}px`;\n this.dirty = false;\n }\n\n /**\n * Repain DOM additionals\n * @private\n */\n _repaintDomAdditionals() {\n this._repaintOnItemUpdateTimeTooltip(this.dom.point);\n this._repaintDragCenter();\n this._repaintDeleteButton(this.dom.point);\n }\n\n /**\n * Repaint the item\n * @param {boolean} [returnQueue=false] return the queue\n * @return {boolean} the redraw queue if returnQueue=true\n */\n redraw(returnQueue) {\n let sizes;\n const queue = [\n // create item DOM\n this._createDomElement.bind(this),\n\n // append DOM to parent DOM\n this._appendDomElement.bind(this),\n\n // update dirty DOM\n this._updateDirtyDomComponents.bind(this),\n\n () => {\n if (this.dirty) {\n sizes = this._getDomComponentsSizes();\n }\n },\n\n () => {\n if (this.dirty) {\n this._updateDomComponentsSizes.bind(this)(sizes);\n }\n },\n\n // repaint DOM additionals\n this._repaintDomAdditionals.bind(this)\n ];\n\n if (returnQueue) {\n return queue;\n } else {\n let result;\n queue.forEach(fn => {\n result = fn();\n });\n return result;\n }\n }\n\n \n /**\n * Reposition XY\n */\n repositionXY() {\n const rtl = this.options.rtl;\n \n const repositionXY = (element, x, y, rtl = false) => {\n if (x === undefined && y === undefined) return;\n // If rtl invert the number.\n const directionX = rtl ? (x * -1) : x;\n\n //no y. translate x\n if (y === undefined) {\n element.style.transform = `translateX(${directionX}px)`;\n return;\n }\n\n //no x. translate y\n if (x === undefined) {\n element.style.transform = `translateY(${y}px)`;\n return;\n }\n\n element.style.transform = `translate(${directionX}px, ${y}px)`;\n }\n repositionXY(this.dom.point, this.pointX, this.pointY, rtl);\n }\n\n /**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n * @param {boolean} [returnQueue=false] whether to return a queue of functions to execute instead of just executing them\n * @return {boolean} the redraw queue if returnQueue=true\n */\n show(returnQueue) {\n if (!this.displayed) {\n return this.redraw(returnQueue);\n }\n }\n\n /**\n * Hide the item from the DOM (when visible)\n */\n hide() {\n if (this.displayed) {\n if (this.dom.point.parentNode) {\n this.dom.point.parentNode.removeChild(this.dom.point);\n }\n\n this.displayed = false;\n }\n }\n\n /**\n * Reposition the item horizontally\n * @Override\n */\n repositionX() {\n const start = this.conversion.toScreen(this.data.start);\n\n this.pointX = start;\n if (this.options.rtl) {\n this.right = start - this.props.dot.width;\n } else {\n this.left = start - this.props.dot.width;\n }\n\n this.repositionXY();\n }\n\n /**\n * Reposition the item vertically\n * @Override\n */\n repositionY() {\n const orientation = this.options.orientation.item;\n if (orientation == 'top') {\n this.pointY = this.top;\n }\n else {\n this.pointY = this.parent.height - this.top - this.height\n }\n\n this.repositionXY();\n }\n\n /**\n * Return the width of the item left from its start date\n * @return {number}\n */\n getWidthLeft() {\n return this.props.dot.width;\n }\n\n /**\n * Return the width of the item right from its start date\n * @return {number}\n */\n getWidthRight() {\n return this.props.dot.width;\n }\n}\n\nexport default PointItem;\n","import Item from './Item';\n\n/**\n * @constructor RangeItem\n * @extends Item\n */\nclass RangeItem extends Item {\n /**\n * @param {Object} data Object containing parameters start, end\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe options\n */\n constructor(data, conversion, options) {\n super(data, conversion, options)\n this.props = {\n content: {\n width: 0\n }\n };\n this.overflow = false; // if contents can overflow (css styling), this flag is set to true\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error(`Property \"start\" missing in item ${data.id}`);\n }\n if (data.end == undefined) {\n throw new Error(`Property \"end\" missing in item ${data.id}`);\n }\n }\n }\n\n /**\n * Check whether this item is visible inside given range\n *\n * @param {timeline.Range} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\n isVisible(range) {\n if (this.cluster) {\n return false;\n }\n // determine visibility\n return (this.data.start < range.end) && (this.data.end > range.start);\n }\n\n /**\n * create DOM elements\n * @private\n */\n _createDomElement() {\n if (!this.dom) {\n // create DOM\n this.dom = {};\n\n // background box\n this.dom.box = document.createElement('div');\n // className is updated in redraw()\n\n // frame box (to prevent the item contents from overflowing)\n this.dom.frame = document.createElement('div');\n this.dom.frame.className = 'vis-item-overflow';\n this.dom.box.appendChild(this.dom.frame);\n \n // visible frame box (showing the frame that is always visible)\n this.dom.visibleFrame = document.createElement('div');\n this.dom.visibleFrame.className = 'vis-item-visible-frame';\n this.dom.box.appendChild(this.dom.visibleFrame);\n\n // contents box\n this.dom.content = document.createElement('div');\n this.dom.content.className = 'vis-item-content';\n this.dom.frame.appendChild(this.dom.content);\n\n // attach this item as attribute\n this.dom.box['vis-item'] = this;\n\n this.dirty = true;\n }\n\n }\n\n /**\n * append element to DOM\n * @private\n */\n _appendDomElement() {\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!this.dom.box.parentNode) {\n const foreground = this.parent.dom.foreground;\n if (!foreground) {\n throw new Error('Cannot redraw item: parent has no foreground container element');\n }\n foreground.appendChild(this.dom.box);\n }\n this.displayed = true;\n }\n\n /**\n * update dirty DOM components\n * @private\n */\n _updateDirtyDomComponents() {\n // update dirty DOM. An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateDataAttributes(this.dom.box);\n this._updateStyle(this.dom.box);\n\n const editable = (this.editable.updateTime || this.editable.updateGroup);\n\n // update class\n const className = (this.data.className ? (' ' + this.data.className) : '') +\n (this.selected ? ' vis-selected' : '') + \n (editable ? ' vis-editable' : ' vis-readonly');\n this.dom.box.className = this.baseClassName + className;\n\n // turn off max-width to be able to calculate the real width\n // this causes an extra browser repaint/reflow, but so be it\n this.dom.content.style.maxWidth = 'none';\n }\n }\n\n /**\n * get DOM component sizes\n * @return {object}\n * @private\n */\n _getDomComponentsSizes() {\n // determine from css whether this box has overflow\n this.overflow = window.getComputedStyle(this.dom.frame).overflow !== 'hidden';\n this.whiteSpace = window.getComputedStyle(this.dom.content).whiteSpace !== 'nowrap';\n return {\n content: {\n width: this.dom.content.offsetWidth,\n },\n box: {\n height: this.dom.box.offsetHeight\n }\n }\n }\n\n /**\n * update DOM component sizes\n * @param {array} sizes\n * @private\n */\n _updateDomComponentsSizes(sizes) {\n this.props.content.width = sizes.content.width;\n this.height = sizes.box.height;\n this.dom.content.style.maxWidth = '';\n this.dirty = false;\n }\n\n /**\n * repaint DOM additional components\n * @private\n */\n _repaintDomAdditionals() {\n this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n this._repaintDeleteButton(this.dom.box);\n this._repaintDragCenter();\n this._repaintDragLeft();\n this._repaintDragRight();\n }\n\n /**\n * Repaint the item\n * @param {boolean} [returnQueue=false] return the queue\n * @return {boolean} the redraw queue if returnQueue=true\n */\n redraw(returnQueue) {\n let sizes;\n const queue = [\n // create item DOM\n this._createDomElement.bind(this),\n\n // append DOM to parent DOM\n this._appendDomElement.bind(this),\n\n // update dirty DOM \n this._updateDirtyDomComponents.bind(this),\n\n () => {\n if (this.dirty) {\n sizes = this._getDomComponentsSizes.bind(this)();\n }\n },\n\n () => {\n if (this.dirty) {\n this._updateDomComponentsSizes.bind(this)(sizes);\n }\n },\n\n // repaint DOM additionals\n this._repaintDomAdditionals.bind(this)\n ];\n\n if (returnQueue) {\n return queue;\n } else {\n let result;\n queue.forEach(fn => {\n result = fn();\n });\n return result;\n }\n }\n\n /**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n * @param {boolean} [returnQueue=false] whether to return a queue of functions to execute instead of just executing them\n * @return {boolean} the redraw queue if returnQueue=true\n */\n show(returnQueue) {\n if (!this.displayed) {\n return this.redraw(returnQueue);\n }\n }\n\n /**\n * Hide the item from the DOM (when visible)\n */\n hide() {\n if (this.displayed) {\n const box = this.dom.box;\n\n if (box.parentNode) {\n box.parentNode.removeChild(box);\n }\n\n this.displayed = false;\n }\n }\n\n /**\n * Reposition the item horizontally\n * @param {boolean} [limitSize=true] If true (default), the width of the range\n * item will be limited, as the browser cannot\n * display very wide divs. This means though\n * that the applied left and width may\n * not correspond to the ranges start and end\n * @Override\n */\n repositionX(limitSize) {\n const parentWidth = this.parent.width;\n let start = this.conversion.toScreen(this.data.start);\n let end = this.conversion.toScreen(this.data.end);\n const align = this.data.align === undefined ? this.options.align : this.data.align;\n let contentStartPosition;\n let contentWidth;\n\n // limit the width of the range, as browsers cannot draw very wide divs\n // unless limitSize: false is explicitly set in item data\n if (this.data.limitSize !== false && (limitSize === undefined || limitSize === true)) {\n if (start < -parentWidth) {\n start = -parentWidth;\n }\n if (end > 2 * parentWidth) {\n end = 2 * parentWidth;\n }\n }\n\n //round to 3 decimals to compensate floating-point values rounding\n const boxWidth = Math.max(Math.round((end - start) * 1000) / 1000, 1);\n\n if (this.overflow) {\n if (this.options.rtl) {\n this.right = start;\n } else {\n this.left = start;\n }\n this.width = boxWidth + this.props.content.width;\n contentWidth = this.props.content.width;\n\n // Note: The calculation of width is an optimistic calculation, giving\n // a width which will not change when moving the Timeline\n // So no re-stacking needed, which is nicer for the eye;\n }\n else {\n if (this.options.rtl) {\n this.right = start;\n } else {\n this.left = start;\n }\n this.width = boxWidth;\n contentWidth = Math.min(end - start, this.props.content.width);\n }\n\n if (this.options.rtl) {\n this.dom.box.style.transform = `translateX(${this.right * -1}px)`;\n } else {\n this.dom.box.style.transform = `translateX(${this.left}px)`;\n }\n this.dom.box.style.width = `${boxWidth}px`;\n if (this.whiteSpace) {\n this.height = this.dom.box.offsetHeight;\n }\n\n switch (align) {\n case 'left':\n this.dom.content.style.transform = 'translateX(0)';\n break;\n\n case 'right':\n if (this.options.rtl) {\n const translateX = Math.max((boxWidth - contentWidth), 0) * -1;\n this.dom.content.style.transform = `translateX(${translateX}px)`;\n } else {\n this.dom.content.style.transform = `translateX(${Math.max((boxWidth - contentWidth), 0)}px)`;\n }\n break;\n\n case 'center':\n if (this.options.rtl) {\n const translateX = Math.max((boxWidth - contentWidth) / 2, 0) * -1;\n this.dom.content.style.transform = `translateX(${translateX}px)`;\n } else {\n this.dom.content.style.transform = `translateX(${Math.max((boxWidth - contentWidth) / 2, 0)}px)`;\n }\n \n break;\n\n default: // 'auto'\n // when range exceeds left of the window, position the contents at the left of the visible area\n if (this.overflow) {\n if (end > 0) {\n contentStartPosition = Math.max(-start, 0);\n }\n else {\n contentStartPosition = -contentWidth; // ensure it's not visible anymore\n }\n }\n else {\n if (start < 0) {\n contentStartPosition = -start;\n }\n else {\n contentStartPosition = 0;\n }\n }\n if (this.options.rtl) {\n const translateX = contentStartPosition * -1;\n this.dom.content.style.transform = `translateX(${translateX}px)`;\n } else {\n this.dom.content.style.transform = `translateX(${contentStartPosition}px)`;\n // this.dom.content.style.width = `calc(100% - ${contentStartPosition}px)`;\n }\n }\n }\n\n /**\n * Reposition the item vertically\n * @Override\n */\n repositionY() {\n const orientation = this.options.orientation.item;\n const box = this.dom.box;\n\n if (orientation == 'top') {\n box.style.top = `${this.top}px`;\n }\n else {\n box.style.top = `${this.parent.height - this.top - this.height}px`;\n }\n }\n\n /**\n * Repaint a drag area on the left side of the range when the range is selected\n * @protected\n */\n _repaintDragLeft() {\n if ((this.selected || this.options.itemsAlwaysDraggable.range) && this.options.editable.updateTime && !this.dom.dragLeft) {\n // create and show drag area\n const dragLeft = document.createElement('div');\n dragLeft.className = 'vis-drag-left';\n dragLeft.dragLeftItem = this;\n\n this.dom.box.appendChild(dragLeft);\n this.dom.dragLeft = dragLeft;\n }\n else if (!this.selected && !this.options.itemsAlwaysDraggable.range && this.dom.dragLeft) {\n // delete drag area\n if (this.dom.dragLeft.parentNode) {\n this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft);\n }\n this.dom.dragLeft = null;\n }\n }\n\n /**\n * Repaint a drag area on the right side of the range when the range is selected\n * @protected\n */\n _repaintDragRight() {\n if ((this.selected || this.options.itemsAlwaysDraggable.range) && this.options.editable.updateTime && !this.dom.dragRight) {\n // create and show drag area\n const dragRight = document.createElement('div');\n dragRight.className = 'vis-drag-right';\n dragRight.dragRightItem = this;\n\n this.dom.box.appendChild(dragRight);\n this.dom.dragRight = dragRight;\n }\n else if (!this.selected && !this.options.itemsAlwaysDraggable.range && this.dom.dragRight) {\n // delete drag area\n if (this.dom.dragRight.parentNode) {\n this.dom.dragRight.parentNode.removeChild(this.dom.dragRight);\n }\n this.dom.dragRight = null;\n }\n }\n}\n\nRangeItem.prototype.baseClassName = 'vis-item vis-range';\n\nexport default RangeItem;\n","import Item from './Item';\nimport BackgroundGroup from '../BackgroundGroup';\nimport RangeItem from './RangeItem';\n\n/**\n * @constructor BackgroundItem\n * @extends Item\n */\nclass BackgroundItem extends Item {\n /**\n * @constructor BackgroundItem\n * @param {Object} data Object containing parameters start, end\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe options\n * // TODO: implement support for the BackgroundItem just having a start, then being displayed as a sort of an annotation\n */\n constructor(data, conversion, options) {\n super(data, conversion, options)\n this.props = {\n content: {\n width: 0\n }\n };\n this.overflow = false; // if contents can overflow (css styling), this flag is set to true\n\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error(`Property \"start\" missing in item ${data.id}`);\n }\n if (data.end == undefined) {\n throw new Error(`Property \"end\" missing in item ${data.id}`);\n }\n }\n }\n\n /**\n * Check whether this item is visible inside given range\n * @param {timeline.Range} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\n isVisible(range) {\n // determine visibility\n return (this.data.start < range.end) && (this.data.end > range.start); \n }\n\n /**\n * create DOM element\n * @private\n */\n _createDomElement() {\n if (!this.dom) {\n // create DOM\n this.dom = {};\n\n // background box\n this.dom.box = document.createElement('div');\n // className is updated in redraw()\n\n // frame box (to prevent the item contents from overflowing\n this.dom.frame = document.createElement('div');\n this.dom.frame.className = 'vis-item-overflow';\n this.dom.box.appendChild(this.dom.frame);\n\n // contents box\n this.dom.content = document.createElement('div');\n this.dom.content.className = 'vis-item-content';\n this.dom.frame.appendChild(this.dom.content);\n\n // Note: we do NOT attach this item as attribute to the DOM,\n // such that background items cannot be selected\n //this.dom.box['vis-item'] = this;\n\n this.dirty = true;\n }\n }\n\n /**\n * append DOM element\n * @private\n */\n _appendDomElement() {\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!this.dom.box.parentNode) {\n const background = this.parent.dom.background;\n if (!background) {\n throw new Error('Cannot redraw item: parent has no background container element');\n }\n background.appendChild(this.dom.box);\n }\n this.displayed = true;\n }\n\n /**\n * update DOM Dirty components\n * @private\n */\n _updateDirtyDomComponents() {\n // update dirty DOM. An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateDataAttributes(this.dom.content);\n this._updateStyle(this.dom.box);\n\n // update class\n const className = (this.data.className ? (' ' + this.data.className) : '') +\n (this.selected ? ' vis-selected' : '');\n this.dom.box.className = this.baseClassName + className;\n }\n }\n\n /**\n * get DOM components sizes\n * @return {object}\n * @private\n */\n _getDomComponentsSizes() {\n // determine from css whether this box has overflow\n this.overflow = window.getComputedStyle(this.dom.content).overflow !== 'hidden';\n return {\n content: {\n width: this.dom.content.offsetWidth\n }\n }\n }\n\n /**\n * update DOM components sizes\n * @param {object} sizes\n * @private\n */\n _updateDomComponentsSizes(sizes) {\n // recalculate size\n this.props.content.width = sizes.content.width;\n this.height = 0; // set height zero, so this item will be ignored when stacking items\n\n this.dirty = false;\n }\n\n /**\n * repaint DOM additionals\n * @private\n */\n _repaintDomAdditionals() {\n }\n\n /**\n * Repaint the item\n * @param {boolean} [returnQueue=false] return the queue\n * @return {boolean} the redraw result or the redraw queue if returnQueue=true\n */\n redraw(returnQueue) {\n let sizes;\n const queue = [\n // create item DOM\n this._createDomElement.bind(this),\n\n // append DOM to parent DOM\n this._appendDomElement.bind(this),\n\n this._updateDirtyDomComponents.bind(this),\n\n () => {\n if (this.dirty) {\n sizes = this._getDomComponentsSizes.bind(this)();\n }\n },\n\n () => {\n if (this.dirty) {\n this._updateDomComponentsSizes.bind(this)(sizes);\n }\n },\n\n // repaint DOM additionals\n this._repaintDomAdditionals.bind(this)\n ];\n\n if (returnQueue) {\n return queue;\n } else {\n let result;\n queue.forEach(fn => {\n result = fn();\n });\n return result;\n }\n }\n\n /**\n * Reposition the item vertically\n * @Override\n */\n repositionY(margin) { // eslint-disable-line no-unused-vars\n let height;\n const orientation = this.options.orientation.item;\n\n // special positioning for subgroups\n if (this.data.subgroup !== undefined) {\n // TODO: instead of calculating the top position of the subgroups here for every BackgroundItem, calculate the top of the subgroup once in Itemset\n const itemSubgroup = this.data.subgroup;\n\n this.dom.box.style.height = `${this.parent.subgroups[itemSubgroup].height}px`;\n\n if (orientation == 'top') { \n this.dom.box.style.top = `${this.parent.top + this.parent.subgroups[itemSubgroup].top}px`;\n } else {\n this.dom.box.style.top = `${this.parent.top + this.parent.height - this.parent.subgroups[itemSubgroup].top - this.parent.subgroups[itemSubgroup].height}px`;\n }\n this.dom.box.style.bottom = '';\n }\n // and in the case of no subgroups:\n else {\n // we want backgrounds with groups to only show in groups.\n if (this.parent instanceof BackgroundGroup) {\n // if the item is not in a group:\n height = Math.max(this.parent.height,\n this.parent.itemSet.body.domProps.center.height,\n this.parent.itemSet.body.domProps.centerContainer.height);\n this.dom.box.style.bottom = orientation == 'bottom' ? '0' : '';\n this.dom.box.style.top = orientation == 'top' ? '0' : '';\n }\n else {\n height = this.parent.height;\n // same alignment for items when orientation is top or bottom\n this.dom.box.style.top = `${this.parent.top}px`;\n this.dom.box.style.bottom = '';\n }\n }\n this.dom.box.style.height = `${height}px`;\n }\n}\n\nBackgroundItem.prototype.baseClassName = 'vis-item vis-background';\n\nBackgroundItem.prototype.stack = false;\n\n/**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n */\nBackgroundItem.prototype.show = RangeItem.prototype.show;\n\n/**\n * Hide the item from the DOM (when visible)\n * @return {Boolean} changed\n */\nBackgroundItem.prototype.hide = RangeItem.prototype.hide;\n\n/**\n * Reposition the item horizontally\n * @Override\n */\nBackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;\n\nexport default BackgroundItem;\n","import './tooltip.css';\n\n/**\n * Popup is a class to create a popup window with some text\n */\nclass Popup {\n /**\n * @param {Element} container The container object.\n * @param {string} overflowMethod How the popup should act to overflowing ('flip', 'cap' or 'none')\n */\n constructor(container, overflowMethod) {\n this.container = container;\n this.overflowMethod = overflowMethod || 'cap';\n\n this.x = 0;\n this.y = 0;\n this.padding = 5;\n this.hidden = false;\n\n // create the frame\n this.frame = document.createElement('div');\n this.frame.className = 'vis-tooltip';\n this.container.appendChild(this.frame);\n }\n\n /**\n * @param {number} x Horizontal position of the popup window\n * @param {number} y Vertical position of the popup window\n */\n setPosition(x, y) {\n this.x = parseInt(x);\n this.y = parseInt(y);\n }\n\n /**\n * Set the content for the popup window. This can be HTML code or text.\n * @param {string | Element} content\n */\n setText(content) {\n if (content instanceof Element) {\n this.frame.innerHTML = '';\n this.frame.appendChild(content);\n }\n else {\n this.frame.innerHTML = content; // string containing text or HTML\n }\n }\n\n /**\n * Show the popup window\n * @param {boolean} [doShow] Show or hide the window\n */\n show(doShow) {\n if (doShow === undefined) {\n doShow = true;\n }\n\n if (doShow === true) {\n var height = this.frame.clientHeight;\n var width = this.frame.clientWidth;\n var maxHeight = this.frame.parentNode.clientHeight;\n var maxWidth = this.frame.parentNode.clientWidth;\n\n var left = 0, top = 0;\n\n if (this.overflowMethod == 'flip' || this.overflowMethod == 'none') {\n let isLeft = false, isTop = true; // Where around the position it's located\n\n if (this.overflowMethod == 'flip') {\n if (this.y - height < this.padding) {\n isTop = false;\n }\n\n if (this.x + width > maxWidth - this.padding) {\n isLeft = true;\n }\n }\n\n if (isLeft) {\n left = this.x - width;\n } else {\n left = this.x;\n }\n\n if (isTop) {\n top = this.y - height;\n } else {\n top = this.y;\n }\n } else { // this.overflowMethod == 'cap'\n top = (this.y - height);\n if (top + height + this.padding > maxHeight) {\n top = maxHeight - height - this.padding;\n }\n if (top < this.padding) {\n top = this.padding;\n }\n\n left = this.x;\n if (left + width + this.padding > maxWidth) {\n left = maxWidth - width - this.padding;\n }\n if (left < this.padding) {\n left = this.padding;\n }\n }\n\n this.frame.style.left = left + \"px\";\n this.frame.style.top = top + \"px\";\n this.frame.style.visibility = \"visible\";\n this.hidden = false;\n }\n else {\n this.hide();\n }\n }\n\n /**\n * Hide the popup window\n */\n hide() {\n this.hidden = true;\n this.frame.style.left = \"0\";\n this.frame.style.top = \"0\";\n this.frame.style.visibility = \"hidden\";\n }\n\n /**\n * Remove the popup window\n */\n destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }\n}\n\nexport default Popup;\n","'use strict';\nvar $ = require('../internals/export');\nvar $every = require('../internals/array-iteration').every;\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\n// `Array.prototype.every` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.every\n$({ target: 'Array', proto: true, forced: sloppyArrayMethod('every') }, {\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.every');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').every;\n","var every = require('../array/virtual/every');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.every;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.every) ? every : own;\n};\n","module.exports = require('../../es/instance/every');\n","module.exports = require(\"core-js-pure/stable/instance/every\");","var DESCRIPTORS = require('../internals/descriptors');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {\n result.push(TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.github.io/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.github.io/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","var $ = require('../internals/export');\nvar $values = require('../internals/object-to-array').values;\n\n// `Object.values` method\n// https://tc39.github.io/ecma262/#sec-object.values\n$({ target: 'Object', stat: true }, {\n values: function values(O) {\n return $values(O);\n }\n});\n","require('../../modules/es.object.values');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Object.values;\n","module.exports = require('../../es/object/values');\n","module.exports = require(\"core-js-pure/stable/object/values\");","var aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = toLength(O.length);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $reduce = require('../internals/array-reduce').left;\nvar sloppyArrayMethod = require('../internals/sloppy-array-method');\n\n// `Array.prototype.reduce` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.reduce');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').reduce;\n","var reduce = require('../array/virtual/reduce');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.reduce;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.reduce) ? reduce : own;\n};\n","module.exports = require('../../es/instance/reduce');\n","module.exports = require(\"core-js-pure/stable/instance/reduce\");","import Item from './Item';\nimport util from '../../../util';\n\n/**\n * ClusterItem\n */\nclass ClusterItem extends Item {\n /**\n * @constructor Item\n * @param {Object} data Object containing (optional) parameters type,\n * start, end, content, group, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} options Configuration options\n * // TODO: describe available options\n */\n constructor(data, conversion, options) {\n const modifiedOptions = Object.assign({}, {fitOnDoubleClick: true}, options, {editable: false});\n super(data, conversion, modifiedOptions);\n\n this.props = {\n content: {\n width: 0,\n height: 0\n },\n };\n \n if (!data || data.uiItems == undefined) {\n throw new Error('Property \"uiItems\" missing in item ' + data.id);\n }\n \n this.id = util.randomUUID();\n this.group = data.group;\n this._setupRange();\n \n this.emitter = this.data.eventEmitter;\n this.range = this.data.range;\n this.attached = false;\n this.isCluster = true;\n this.data.isCluster = true;\n }\n\n /**\n * check if there are items\n * @return {boolean}\n */\n hasItems() {\n return this.data.uiItems && this.data.uiItems.length && this.attached;\n }\n \n /**\n * set UI items\n * @param {array} items\n */\n setUiItems(items) {\n this.detach();\n \n this.data.uiItems = items;\n \n this._setupRange();\n \n this.attach();\n }\n \n /**\n * check is visible\n * @param {object} range\n * @return {boolean}\n */\n isVisible(range) {\n const rangeWidth = this.data.end ? this.data.end - this.data.start : 0;\n const widthInMs = this.width * range.getMillisecondsPerPixel();\n const end = Math.max(rangeWidth, this.data.start.getTime() + widthInMs);\n return (this.data.start < range.end) && (end > range.start) && this.hasItems();\n }\n \n /**\n * get cluster data\n * @return {object}\n */\n getData() {\n return {\n isCluster: true,\n id: this.id,\n items: this.data.items || [],\n data: this.data\n }\n }\n \n /**\n * redraw cluster item\n * @param {boolean} returnQueue\n * @return {boolean}\n */\n redraw (returnQueue) {\n var sizes\n var queue = [\n // create item DOM\n this._createDomElement.bind(this),\n \n // append DOM to parent DOM\n this._appendDomElement.bind(this),\n \n // update dirty DOM\n this._updateDirtyDomComponents.bind(this),\n \n (function () {\n if (this.dirty) {\n sizes = this._getDomComponentsSizes();\n }\n }).bind(this),\n \n (function () {\n if (this.dirty) {\n this._updateDomComponentsSizes.bind(this)(sizes);\n }\n }).bind(this),\n \n // repaint DOM additionals\n this._repaintDomAdditionals.bind(this)\n ];\n \n if (returnQueue) {\n return queue;\n } else {\n var result;\n queue.forEach(function (fn) {\n result = fn();\n });\n return result;\n }\n }\n \n /**\n * show cluster item\n */\n show() {\n if (!this.displayed) {\n this.redraw();\n }\n }\n \n /**\n * Hide the item from the DOM (when visible)\n */\n hide() {\n if (this.displayed) {\n var dom = this.dom;\n if (dom.box.parentNode) {\n dom.box.parentNode.removeChild(dom.box);\n }\n\n if (this.options.showStipes) {\n if (dom.line.parentNode) {\n dom.line.parentNode.removeChild(dom.line);\n }\n if (dom.dot.parentNode) {\n dom.dot.parentNode.removeChild(dom.dot);\n }\n }\n this.displayed = false;\n }\n }\n \n /**\n * reposition item x axis\n */\n repositionX() {\n let start = this.conversion.toScreen(this.data.start);\n let end = this.data.end ? this.conversion.toScreen(this.data.end) : 0;\n if (end) {\n this.repositionXWithRanges(start, end);\n } else {\n let align = this.data.align === undefined ? this.options.align : this.data.align;\n this.repositionXWithoutRanges(start, align);\n }\n \n if (this.options.showStipes) {\n this.dom.line.style.display = this._isStipeVisible() ? 'block' : 'none';\n this.dom.dot.style.display = this._isStipeVisible() ? 'block' : 'none';\n\n if (this._isStipeVisible()) {\n this.repositionStype(start, end);\n }\n }\n }\n\n /**\n * reposition item stype\n * @param {date} start\n * @param {date} end\n */\n repositionStype(start, end) {\n this.dom.line.style.display = 'block';\n this.dom.dot.style.display = 'block';\n const lineOffsetWidth = this.dom.line.offsetWidth;\n const dotOffsetWidth = this.dom.dot.offsetWidth;\n\n if (end) {\n const lineOffset = lineOffsetWidth + start + (end - start) / 2;\n const dotOffset = lineOffset - dotOffsetWidth / 2;\n const lineOffsetDirection = this.options.rtl ? lineOffset * -1 : lineOffset;\n const dotOffsetDirection = this.options.rtl ? dotOffset * -1 : dotOffset;\n\n this.dom.line.style.transform = `translateX(${lineOffsetDirection})px`;\n this.dom.dot.style.transform = `translateX(${dotOffsetDirection}px)`;\n } else {\n const lineOffsetDirection = this.options.rtl ? start * -1 : start;\n const dotOffsetDirection = this.options.rtl ? (start - dotOffsetWidth / 2) * -1 : start - dotOffsetWidth / 2;\n\n this.dom.line.style.transform = `${lineOffsetDirection}px`;\n this.dom.dot.style.transform = `${dotOffsetDirection}px`;\n }\n }\n \n /**\n * reposition x without ranges\n * @param {date} start\n * @param {string} align\n */\n repositionXWithoutRanges(start, align) {\n // calculate left position of the box\n if (align == 'right') {\n if (this.options.rtl) {\n this.right = start - this.width;\n \n // reposition box, line, and dot\n this.dom.box.style.right = this.right + 'px';\n } else {\n this.left = start - this.width;\n \n // reposition box, line, and dot\n this.dom.box.style.left = this.left + 'px';\n }\n } else if (align == 'left') {\n if (this.options.rtl) {\n this.right = start;\n \n // reposition box, line, and dot\n this.dom.box.style.right = this.right + 'px';\n } else {\n this.left = start;\n \n // reposition box, line, and dot\n this.dom.box.style.left = this.left + 'px';\n }\n } else {\n // default or 'center'\n if (this.options.rtl) {\n this.right = start - this.width / 2;\n \n // reposition box, line, and dot\n this.dom.box.style.right = this.right + 'px';\n } else {\n this.left = start - this.width / 2;\n \n // reposition box, line, and dot\n this.dom.box.style.left = this.left + 'px';\n }\n }\n }\n \n /**\n * reposition x with ranges\n * @param {date} start\n * @param {date} end\n */\n repositionXWithRanges(start, end) {\n let boxWidth = Math.round(Math.max(end - start + 0.5, 1));\n \n if (this.options.rtl) {\n this.right = start;\n } else {\n this.left = start;\n }\n \n this.width = Math.max(boxWidth, this.minWidth || 0);\n \n if (this.options.rtl) {\n this.dom.box.style.right = this.right + 'px';\n } else {\n this.dom.box.style.left = this.left + 'px';\n }\n \n this.dom.box.style.width = boxWidth + 'px';\n }\n \n /**\n * reposition item y axis\n */\n repositionY() {\n var orientation = this.options.orientation.item;\n var box = this.dom.box;\n if (orientation == 'top') {\n box.style.top = (this.top || 0) + 'px';\n } else { \n // orientation 'bottom'\n box.style.top = (this.parent.height - this.top - this.height || 0) + 'px';\n }\n \n if (this.options.showStipes) {\n if (orientation == 'top') {\n this.dom.line.style.top = '0';\n this.dom.line.style.height = (this.parent.top + this.top + 1) + 'px';\n this.dom.line.style.bottom = '';\n }\n else { \n // orientation 'bottom'\n var itemSetHeight = this.parent.itemSet.props.height;\n var lineHeight = itemSetHeight - this.parent.top - this.parent.height + this.top;\n this.dom.line.style.top = (itemSetHeight - lineHeight) + 'px';\n this.dom.line.style.bottom = '0';\n }\n \n this.dom.dot.style.top = (-this.dom.dot.offsetHeight / 2) + 'px';\n }\n }\n\n /**\n * get width left\n * @return {number}\n */\n getWidthLeft() {\n return this.width / 2;\n }\n \n /**\n * get width right\n * @return {number}\n */\n getWidthRight() {\n return this.width / 2;\n }\n \n /**\n * move cluster item\n */\n move() {\n this.repositionX();\n this.repositionY();\n }\n \n /**\n * attach\n */\n attach() {\n for (let item of this.data.uiItems) {\n item.cluster = this;\n }\n \n this.data.items = this.data.uiItems.map(item => item.data);\n\n this.attached = true;\n this.dirty = true;\n }\n \n /**\n * detach\n * @param {boolean} detachFromParent\n * @return {void}\n */\n detach(detachFromParent = false) {\n if (!this.hasItems()) {\n return;\n }\n \n for (let item of this.data.uiItems) {\n delete item.cluster;\n }\n \n this.attached = false;\n \n if (detachFromParent && this.group) {\n this.group.remove(this);\n this.group = null;\n }\n \n this.data.items = [];\n this.dirty = true;\n }\n \n /**\n * handle on double click\n */\n _onDoubleClick() {\n this._fit();\n }\n \n /**\n * set range\n */\n _setupRange() {\n const stats = this.data.uiItems.map(item => ({\n start: item.data.start.valueOf(),\n end: item.data.end ? item.data.end.valueOf() : item.data.start.valueOf(),\n }));\n \n this.data.min = Math.min(...stats.map(s => Math.min(s.start, s.end || s.start)));\n this.data.max = Math.max(...stats.map(s => Math.max(s.start, s.end || s.start)));\n const centers = this.data.uiItems.map(item => item.center);\n const avg = centers.reduce((sum, value) => sum + value, 0) / this.data.uiItems.length;\n \n if (this.data.uiItems.some(item => item.data.end)) {\n // contains ranges\n this.data.start = new Date(this.data.min);\n this.data.end = new Date(this.data.max);\n } else {\n this.data.start = new Date(avg);\n this.data.end = null;\n }\n }\n \n /**\n * get UI items\n * @return {array}\n */\n _getUiItems() {\n if (this.data.uiItems && this.data.uiItems.length) {\n return this.data.uiItems.filter(item => item.cluster === this);\n }\n \n return [];\n }\n \n /**\n * create DOM element\n */\n _createDomElement() {\n if (!this.dom) {\n // create DOM\n this.dom = {};\n \n // create main box\n this.dom.box = document.createElement('DIV');\n \n // contents box (inside the background box). used for making margins\n this.dom.content = document.createElement('DIV');\n this.dom.content.className = 'vis-item-content';\n \n this.dom.box.appendChild(this.dom.content);\n \n if (this.options.showStipes) {\n // line to axis\n this.dom.line = document.createElement('DIV');\n this.dom.line.className = 'vis-cluster-line';\n this.dom.line.style.display = 'none';\n \n // dot on axis\n this.dom.dot = document.createElement('DIV');\n this.dom.dot.className = 'vis-cluster-dot';\n this.dom.dot.style.display = 'none';\n }\n \n if (this.options.fitOnDoubleClick) {\n this.dom.box.ondblclick = ClusterItem.prototype._onDoubleClick.bind(this);\n }\n \n // attach this item as attribute\n this.dom.box['vis-item'] = this;\n \n this.dirty = true;\n }\n }\n \n /**\n * append element to DOM\n */\n _appendDomElement() {\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n \n if (!this.dom.box.parentNode) {\n const foreground = this.parent.dom.foreground;\n if (!foreground) {\n throw new Error('Cannot redraw item: parent has no foreground container element');\n }\n \n foreground.appendChild(this.dom.box);\n }\n \n const background = this.parent.dom.background;\n \n if (this.options.showStipes) {\n if (!this.dom.line.parentNode) {\n if (!background) throw new Error('Cannot redraw item: parent has no background container element');\n background.appendChild(this.dom.line);\n }\n \n if (!this.dom.dot.parentNode) {\n var axis = this.parent.dom.axis;\n if (!background) throw new Error('Cannot redraw item: parent has no axis container element');\n axis.appendChild(this.dom.dot);\n }\n }\n \n this.displayed = true;\n }\n \n /**\n * update dirty DOM components\n */\n _updateDirtyDomComponents() {\n // An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateDataAttributes(this.dom.box);\n this._updateStyle(this.dom.box);\n \n // update class\n const className = this.baseClassName + ' ' + (this.data.className ? ' ' + this.data.className : '') +\n (this.selected ? ' vis-selected' : '') + ' vis-readonly';\n this.dom.box.className = 'vis-item ' + className;\n \n if (this.options.showStipes) {\n this.dom.line.className = 'vis-item vis-cluster-line ' + (this.selected ? ' vis-selected' : '');\n this.dom.dot.className = 'vis-item vis-cluster-dot ' + (this.selected ? ' vis-selected' : '');\n }\n \n if (this.data.end) {\n // turn off max-width to be able to calculate the real width\n // this causes an extra browser repaint/reflow, but so be it\n this.dom.content.style.maxWidth = 'none';\n }\n }\n }\n \n /**\n * get DOM components sizes\n * @return {object}\n */\n _getDomComponentsSizes() {\n return {\n previous: {\n right: this.dom.box.style.right,\n left: this.dom.box.style.left\n },\n box: {\n width: this.dom.box.offsetWidth,\n height: this.dom.box.offsetHeight\n },\n }\n }\n \n /**\n * update DOM components sizes\n * @param {object} sizes\n */\n _updateDomComponentsSizes(sizes) {\n if (this.options.rtl) {\n this.dom.box.style.right = \"0px\";\n } else {\n this.dom.box.style.left = \"0px\";\n }\n \n // recalculate size\n if (!this.data.end) {\n this.width = sizes.box.width;\n } else {\n this.minWidth = sizes.box.width;\n }\n \n this.height = sizes.box.height;\n \n // restore previous position\n if (this.options.rtl) {\n this.dom.box.style.right = sizes.previous.right;\n } else {\n this.dom.box.style.left = sizes.previous.left;\n }\n \n this.dirty = false;\n }\n \n /**\n * repaint DOM additional components\n */\n _repaintDomAdditionals() {\n this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n }\n \n /**\n * check is stripe visible\n * @return {number}\n * @private\n */\n _isStipeVisible() {\n return this.minWidth >= this.width || !this.data.end;\n }\n \n /**\n * get fit range\n * @return {object}\n * @private\n */\n _getFitRange() {\n const offset = 0.05*(this.data.max - this.data.min) / 2;\n return {\n fitStart: this.data.min - offset,\n fitEnd: this.data.max + offset\n };\n }\n \n /**\n * fit\n * @private\n */\n _fit() {\n if (this.emitter) {\n const {fitStart, fitEnd} = this._getFitRange();\n \n const fitArgs = {\n start: new Date(fitStart),\n end: new Date(fitEnd),\n animation: true\n };\n \n this.emitter.emit('fit', fitArgs);\n }\n }\n\n /**\n * get item data\n * @return {object}\n * @private\n */\n _getItemData() {\n return this.data;\n }\n}\n\nClusterItem.prototype.baseClassName = 'vis-item vis-range vis-cluster';\nexport default ClusterItem;\n","import ClusterItem from './item/ClusterItem';\n\nconst UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items\nconst BACKGROUND = '__background__'; // reserved group id for background items without group\n\nexport const ReservedGroupIds = {\n UNGROUPED,\n BACKGROUND\n}\n\n/**\n * An Cluster generator generates cluster items\n */\nexport default class ClusterGenerator {\n /**\n * @param {ItemSet} itemSet itemsSet instance\n * @constructor ClusterGenerator\n */\n constructor(itemSet) {\n this.itemSet = itemSet;\n this.groups = {};\n this.cache = {};\n this.cache[-1] = [];\n }\n\n /**\n * @param {Object} itemData Object containing parameters start content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * @return {Object} newItem\n */\n createClusterItem(itemData, conversion, options) {\n const newItem = new ClusterItem(itemData, conversion, options);\n return newItem;\n }\n\n /**\n * Set the items to be clustered.\n * This will clear cached clusters.\n * @param {Item[]} items\n * @param {Object} [options] Available options:\n * {boolean} applyOnChangedLevel\n * If true (default), the changed data is applied\n * as soon the cluster level changes. If false,\n * The changed data is applied immediately\n */\n setItems(items, options) {\n this.items = items || [];\n this.dataChanged = true;\n this.applyOnChangedLevel = false;\n\n if (options && options.applyOnChangedLevel) {\n this.applyOnChangedLevel = options.applyOnChangedLevel;\n }\n }\n\n /**\n * Update the current data set: clear cache, and recalculate the clustering for\n * the current level\n */\n updateData() {\n this.dataChanged = true;\n this.applyOnChangedLevel = false;\n }\n\n /**\n * Cluster the items which are too close together\n * @param {array} oldClusters \n * @param {number} scale The scale of the current window : (windowWidth / (endDate - startDate)) \n * @param {{maxItems: number, clusterCriteria: function, titleTemplate: string}} options \n * @return {array} clusters\n */\n getClusters(oldClusters, scale, options) {\n let { maxItems, clusterCriteria } = typeof options === \"boolean\" ? {} : options;\n \n if (!clusterCriteria) {\n clusterCriteria = () => true;\n }\n\n maxItems = maxItems || 1;\n\n let level = -1;\n let granularity = 2;\n let timeWindow = 0;\n\n if (scale > 0) {\n if (scale >= 1) {\n return [];\n }\n\n level = Math.abs(Math.round(Math.log(100 / scale) / Math.log(granularity)));\n timeWindow = Math.abs(Math.pow(granularity, level));\n }\n\n // clear the cache when and re-generate groups the data when needed.\n if (this.dataChanged) {\n const levelChanged = (level != this.cacheLevel);\n const applyDataNow = this.applyOnChangedLevel ? levelChanged : true;\n if (applyDataNow) {\n this._dropLevelsCache();\n this._filterData();\n }\n }\n\n this.cacheLevel = level;\n let clusters = this.cache[level];\n if (!clusters) {\n clusters = [];\n for (let groupName in this.groups) {\n if (this.groups.hasOwnProperty(groupName)) {\n const items = this.groups[groupName];\n const iMax = items.length;\n let i = 0;\n while (i < iMax) {\n // find all items around current item, within the timeWindow\n let item = items[i];\n let neighbors = 1; // start at 1, to include itself)\n\n // loop through items left from the current item\n let j = i - 1;\n while (j >= 0 && (item.center - items[j].center) < timeWindow / 2) {\n if (!items[j].cluster && clusterCriteria(item.data, items[j].data)) {\n neighbors++;\n }\n j--;\n }\n\n // loop through items right from the current item\n let k = i + 1;\n while (k < items.length && (items[k].center - item.center) < timeWindow / 2) {\n if (clusterCriteria(item.data, items[k].data)) {\n neighbors++;\n }\n k++;\n }\n\n // loop through the created clusters\n let l = clusters.length - 1;\n while (l >= 0 && (item.center - clusters[l].center) < timeWindow) {\n if (item.group == clusters[l].group && clusterCriteria(item.data, clusters[l].data)) {\n neighbors++;\n }\n l--;\n }\n\n // aggregate until the number of items is within maxItems\n if (neighbors > maxItems) {\n // too busy in this window.\n const num = neighbors - maxItems + 1;\n const clusterItems = [];\n\n // append the items to the cluster,\n // and calculate the average start for the cluster\n let m = i;\n while (clusterItems.length < num && m < items.length) {\n if (clusterCriteria(items[m].data, items[m].data)) {\n clusterItems.push(items[m]);\n }\n m++;\n }\n\n const groupId = this.itemSet.getGroupId(item.data);\n const group = this.itemSet.groups[groupId] || this.itemSet.groups[ReservedGroupIds.UNGROUPED];\n let cluster = this._getClusterForItems(clusterItems, group, oldClusters, options);\n clusters.push(cluster);\n\n i += num;\n } else {\n delete item.cluster;\n i += 1;\n }\n }\n }\n }\n\n this.cache[level] = clusters;\n }\n\n return clusters;\n }\n\n /**\n * Filter the items per group.\n * @private\n */\n _filterData() {\n // filter per group\n const groups = {};\n this.groups = groups;\n\n // split the items per group\n for (const item of Object.values(this.items)) {\n // put the item in the correct group\n const groupName = item.parent ? item.parent.groupId : '';\n let group = groups[groupName];\n if (!group) {\n group = [];\n groups[groupName] = group;\n }\n group.push(item);\n\n // calculate the center of the item\n if (item.data.start) {\n if (item.data.end) {\n // range\n item.center = (item.data.start.valueOf() + item.data.end.valueOf()) / 2;\n } else {\n // box, dot\n item.center = item.data.start.valueOf();\n }\n }\n }\n\n // sort the items per group\n for (let currentGroupName in groups) {\n if (groups.hasOwnProperty(currentGroupName)) {\n groups[currentGroupName].sort((a, b) => a.center - b.center);\n }\n }\n\n this.dataChanged = false;\n }\n\n /**\n * Create new cluster or return existing\n * @private\n * @param {array} clusterItems \n * @param {object} group \n * @param {array} oldClusters \n * @param {object} options \n * @returns {object} cluster\n */\n _getClusterForItems(clusterItems, group, oldClusters, options) {\n const oldClustersLookup = (oldClusters || []).map(cluster => ({\n cluster,\n itemsIds: new Set(cluster.data.uiItems.map(item => item.id))\n }));\n let cluster;\n if (oldClustersLookup.length) {\n for (let oldClusterData of oldClustersLookup) {\n if (oldClusterData.itemsIds.size === clusterItems.length \n && clusterItems.every(clusterItem => oldClusterData.itemsIds.has(clusterItem.id))) {\n cluster = oldClusterData.cluster;\n break;\n }\n }\n }\n\n if (cluster) {\n cluster.setUiItems(clusterItems);\n if (cluster.group !== group) {\n if (cluster.group) {\n cluster.group.remove(cluster); \n }\n\n if (group) {\n group.add(cluster); \n cluster.group = group;\n }\n }\n return cluster;\n }\n\n let titleTemplate = options.titleTemplate || '';\n const conversion = {\n toScreen: this.itemSet.body.util.toScreen,\n toTime: this.itemSet.body.util.toTime\n };\n\n const clusterContent = '
' + clusterItems.length + '
';\n const title = titleTemplate.replace(/{count}/, clusterItems.length);\n const clusterOptions = Object.assign({}, options, this.itemSet.options);\n const data = {\n 'content': clusterContent,\n 'title': title,\n 'group': group,\n 'uiItems': clusterItems,\n 'eventEmitter': this.itemSet.body.emitter,\n 'range': this.itemSet.body.range\n };\n cluster = this.createClusterItem(data,\n conversion,\n clusterOptions);\n\n if (group) {\n group.add(cluster);\n cluster.group = group;\n }\n\n cluster.attach();\n\n return cluster;\n }\n\n /**\n * Drop cache\n * @private\n */\n _dropLevelsCache() {\n this.cache = {};\n this.cacheLevel = -1;\n this.cache[this.cacheLevel] = [];\n }\n}\n","import Hammer from '../../module/hammer';\nimport util from '../../util';\nimport { DataSet } from 'vis-data';\nimport { DataView } from 'vis-data';\nimport TimeStep from '../TimeStep';\nimport Component from './Component';\nimport Group from './Group';\nimport BackgroundGroup from './BackgroundGroup';\nimport BoxItem from './item/BoxItem';\nimport PointItem from './item/PointItem';\nimport RangeItem from './item/RangeItem';\nimport BackgroundItem from './item/BackgroundItem';\nimport Popup from '../../shared/Popup';\nimport ClusterGenerator from './ClusterGenerator';\n\nimport './css/itemset.css';\nimport './css/labelset.css';\n\nconst UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items\nconst BACKGROUND = '__background__'; // reserved group id for background items without group\n\nexport const ReservedGroupIds = {\n UNGROUPED,\n BACKGROUND\n}\n\n/**\n * An ItemSet holds a set of items and ranges which can be displayed in a\n * range. The width is determined by the parent of the ItemSet, and the height\n * is determined by the size of the items.\n */\nclass ItemSet extends Component {\n /**\n * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body\n * @param {Object} [options] See ItemSet.setOptions for the available options.\n * @constructor ItemSet\n * @extends Component\n */\n constructor(body, options) {\n super()\n this.body = body;\n this.defaultOptions = {\n type: null, // 'box', 'point', 'range', 'background'\n orientation: {\n item: 'bottom' // item orientation: 'top' or 'bottom'\n },\n align: 'auto', // alignment of box items\n stack: true,\n stackSubgroups: true,\n groupOrderSwap(fromGroup, toGroup, groups) { // eslint-disable-line no-unused-vars\n const targetOrder = toGroup.order;\n toGroup.order = fromGroup.order;\n fromGroup.order = targetOrder;\n },\n groupOrder: 'order',\n\n selectable: true,\n multiselect: false,\n itemsAlwaysDraggable: {\n item: false,\n range: false,\n },\n\n editable: {\n updateTime: false,\n updateGroup: false,\n add: false,\n remove: false,\n overrideItems: false\n },\n\n groupEditable: {\n order: false,\n add: false,\n remove: false\n },\n\n snap: TimeStep.snap,\n\n // Only called when `objectData.target === 'item'.\n onDropObjectOnItem(objectData, item, callback) {\n callback(item)\n },\n onAdd(item, callback) {\n callback(item);\n },\n onUpdate(item, callback) {\n callback(item);\n },\n onMove(item, callback) {\n callback(item);\n },\n onRemove(item, callback) {\n callback(item);\n },\n onMoving(item, callback) {\n callback(item);\n },\n onAddGroup(item, callback) {\n callback(item);\n },\n onMoveGroup(item, callback) {\n callback(item);\n },\n onRemoveGroup(item, callback) {\n callback(item);\n },\n\n margin: {\n item: {\n horizontal: 10,\n vertical: 10\n },\n axis: 20\n },\n\n showTooltips: true,\n\n tooltip: {\n followMouse: false,\n overflowMethod: 'flip',\n delay: 500\n },\n\n tooltipOnItemUpdateTime: false\n };\n\n // options is shared by this ItemSet and all its items\n this.options = util.extend({}, this.defaultOptions);\n this.options.rtl = options.rtl;\n this.options.onTimeout = options.onTimeout;\n \n // options for getting items from the DataSet with the correct type\n this.itemOptions = {\n type: {start: 'Date', end: 'Date'}\n };\n \n this.conversion = {\n toScreen: body.util.toScreen,\n toTime: body.util.toTime\n };\n this.dom = {};\n this.props = {};\n this.hammer = null;\n \n const me = this;\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n this.itemsSettingTime = null;\n this.initialItemSetDrawn = false;\n this.userContinueNotBail = null; \n\n this.sequentialSelection = false;\n \n // listeners for the DataSet of the items\n this.itemListeners = {\n 'add'(event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onAdd(params.items);\n if (me.options.cluster) {\n me.clusterGenerator.setItems(me.items, { applyOnChangedLevel: false });\n }\n me.redraw();\n },\n 'update'(event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onUpdate(params.items);\n if (me.options.cluster) {\n me.clusterGenerator.setItems(me.items, { applyOnChangedLevel: false });\n }\n me.redraw();\n },\n 'remove'(event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onRemove(params.items);\n if (me.options.cluster) {\n me.clusterGenerator.setItems(me.items, { applyOnChangedLevel: false });\n }\n me.redraw();\n }\n };\n\n // listeners for the DataSet of the groups\n this.groupListeners = {\n 'add'(event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onAddGroups(params.items);\n \n if (me.groupsData && me.groupsData.length > 0) {\n const groupsData = me.groupsData.getDataSet();\n groupsData.get().forEach(groupData => {\n if (groupData.nestedGroups) {\n if (groupData.showNested != false) {\n groupData.showNested = true;\n }\n let updatedGroups = [];\n groupData.nestedGroups.forEach(nestedGroupId => {\n const updatedNestedGroup = groupsData.get(nestedGroupId);\n if (!updatedNestedGroup) { return; }\n updatedNestedGroup.nestedInGroup = groupData.id;\n if (groupData.showNested == false) {\n updatedNestedGroup.visible = false;\n }\n updatedGroups = updatedGroups.concat(updatedNestedGroup);\n });\n groupsData.update(updatedGroups, senderId);\n }\n });\n }\n },\n 'update'(event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onUpdateGroups(params.items);\n },\n 'remove'(event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onRemoveGroups(params.items);\n }\n };\n\n this.items = {}; // object with an Item for every data item\n this.groups = {}; // Group object for every group\n this.groupIds = [];\n\n this.selection = []; // list with the ids of all selected nodes\n\n this.popup = null;\n this.popupTimer = null;\n\n this.touchParams = {}; // stores properties while dragging\n this.groupTouchParams = {\n group: null,\n isDragging: false\n };\n \n // create the HTML DOM\n this._create();\n\n this.setOptions(options);\n this.clusters = [];\n }\n\n /**\n * Create the HTML DOM for the ItemSet\n */\n _create() {\n const frame = document.createElement('div');\n frame.className = 'vis-itemset';\n frame['vis-itemset'] = this;\n this.dom.frame = frame;\n\n // create background panel\n const background = document.createElement('div');\n background.className = 'vis-background';\n frame.appendChild(background);\n this.dom.background = background;\n\n // create foreground panel\n const foreground = document.createElement('div');\n foreground.className = 'vis-foreground';\n frame.appendChild(foreground);\n this.dom.foreground = foreground;\n\n // create axis panel\n const axis = document.createElement('div');\n axis.className = 'vis-axis';\n this.dom.axis = axis;\n\n // create labelset\n const labelSet = document.createElement('div');\n labelSet.className = 'vis-labelset';\n this.dom.labelSet = labelSet;\n\n // create ungrouped Group\n this._updateUngrouped();\n\n // create background Group\n const backgroundGroup = new BackgroundGroup(BACKGROUND, null, this);\n backgroundGroup.show();\n this.groups[BACKGROUND] = backgroundGroup;\n\n // attach event listeners\n // Note: we bind to the centerContainer for the case where the height\n // of the center container is larger than of the ItemSet, so we\n // can click in the empty area to create a new item or deselect an item.\n this.hammer = new Hammer(this.body.dom.centerContainer);\n\n // drag items when selected\n this.hammer.on('hammer.input', event => {\n if (event.isFirst) {\n this._onTouch(event);\n }\n });\n this.hammer.on('panstart', this._onDragStart.bind(this));\n this.hammer.on('panmove', this._onDrag.bind(this));\n this.hammer.on('panend', this._onDragEnd.bind(this));\n this.hammer.get('pan').set({threshold:5, direction: Hammer.ALL});\n\n // single select (or unselect) when tapping an item\n this.hammer.on('tap', this._onSelectItem.bind(this));\n\n // multi select when holding mouse/touch, or on ctrl+click\n this.hammer.on('press', this._onMultiSelectItem.bind(this));\n\n // add item on doubletap\n this.hammer.on('doubletap', this._onAddItem.bind(this));\n\n if (this.options.rtl) {\n this.groupHammer = new Hammer(this.body.dom.rightContainer);\n } else {\n this.groupHammer = new Hammer(this.body.dom.leftContainer);\n }\n \n this.groupHammer.on('tap', this._onGroupClick.bind(this));\n this.groupHammer.on('panstart', this._onGroupDragStart.bind(this));\n this.groupHammer.on('panmove', this._onGroupDrag.bind(this));\n this.groupHammer.on('panend', this._onGroupDragEnd.bind(this));\n this.groupHammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_VERTICAL});\n \n this.body.dom.centerContainer.addEventListener('mouseover', this._onMouseOver.bind(this));\n this.body.dom.centerContainer.addEventListener('mouseout', this._onMouseOut.bind(this));\n this.body.dom.centerContainer.addEventListener('mousemove', this._onMouseMove.bind(this));\n // right-click on timeline \n this.body.dom.centerContainer.addEventListener('contextmenu', this._onDragEnd.bind(this));\n\n this.body.dom.centerContainer.addEventListener('mousewheel', this._onMouseWheel.bind(this));\n\n // attach to the DOM\n this.show();\n }\n\n /**\n * Set options for the ItemSet. Existing options will be extended/overwritten.\n * @param {Object} [options] The following options are available:\n * {string} type\n * Default type for the items. Choose from 'box'\n * (default), 'point', 'range', or 'background'.\n * The default style can be overwritten by\n * individual items.\n * {string} align\n * Alignment for the items, only applicable for\n * BoxItem. Choose 'center' (default), 'left', or\n * 'right'.\n * {string} orientation.item\n * Orientation of the item set. Choose 'top' or\n * 'bottom' (default).\n * {Function} groupOrder\n * A sorting function for ordering groups\n * {boolean} stack\n * If true (default), items will be stacked on\n * top of each other.\n * {number} margin.axis\n * Margin between the axis and the items in pixels.\n * Default is 20.\n * {number} margin.item.horizontal\n * Horizontal margin between items in pixels.\n * Default is 10.\n * {number} margin.item.vertical\n * Vertical Margin between items in pixels.\n * Default is 10.\n * {number} margin.item\n * Margin between items in pixels in both horizontal\n * and vertical direction. Default is 10.\n * {number} margin\n * Set margin for both axis and items in pixels.\n * {boolean} selectable\n * If true (default), items can be selected.\n * {boolean} multiselect\n * If true, multiple items can be selected.\n * False by default.\n * {boolean} editable\n * Set all editable options to true or false\n * {boolean} editable.updateTime\n * Allow dragging an item to an other moment in time\n * {boolean} editable.updateGroup\n * Allow dragging an item to an other group\n * {boolean} editable.add\n * Allow creating new items on double tap\n * {boolean} editable.remove\n * Allow removing items by clicking the delete button\n * top right of a selected item.\n * {Function(item: Item, callback: Function)} onAdd\n * Callback function triggered when an item is about to be added:\n * when the user double taps an empty space in the Timeline.\n * {Function(item: Item, callback: Function)} onUpdate\n * Callback function fired when an item is about to be updated.\n * This function typically has to show a dialog where the user\n * change the item. If not implemented, nothing happens.\n * {Function(item: Item, callback: Function)} onMove\n * Fired when an item has been moved. If not implemented,\n * the move action will be accepted.\n * {Function(item: Item, callback: Function)} onRemove\n * Fired when an item is about to be deleted.\n * If not implemented, the item will be always removed.\n */\n setOptions(options) {\n if (options) {\n // copy all options that we know\n const fields = [\n 'type', 'rtl', 'align', 'order', 'stack', 'stackSubgroups', 'selectable', 'multiselect', 'sequentialSelection',\n 'multiselectPerGroup', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'visibleFrameTemplate',\n 'hide', 'snap', 'groupOrderSwap', 'showTooltips', 'tooltip', 'tooltipOnItemUpdateTime', 'groupHeightMode', 'onTimeout'\n ];\n util.selectiveExtend(fields, this.options, options);\n\n if ('itemsAlwaysDraggable' in options) {\n if (typeof options.itemsAlwaysDraggable === 'boolean') {\n this.options.itemsAlwaysDraggable.item = options.itemsAlwaysDraggable;\n this.options.itemsAlwaysDraggable.range = false;\n }\n else if (typeof options.itemsAlwaysDraggable === 'object') {\n util.selectiveExtend(['item', 'range'], this.options.itemsAlwaysDraggable, options.itemsAlwaysDraggable);\n // only allow range always draggable when item is always draggable as well\n if (! this.options.itemsAlwaysDraggable.item) {\n this.options.itemsAlwaysDraggable.range = false;\n }\n }\n }\n\n if ('sequentialSelection' in options) {\n if (typeof options.sequentialSelection === 'boolean') {\n this.options.sequentialSelection = options.sequentialSelection;\n }\n }\n\n if ('orientation' in options) {\n if (typeof options.orientation === 'string') {\n this.options.orientation.item = options.orientation === 'top' ? 'top' : 'bottom';\n }\n else if (typeof options.orientation === 'object' && 'item' in options.orientation) {\n this.options.orientation.item = options.orientation.item;\n }\n }\n\n if ('margin' in options) {\n if (typeof options.margin === 'number') {\n this.options.margin.axis = options.margin;\n this.options.margin.item.horizontal = options.margin;\n this.options.margin.item.vertical = options.margin;\n }\n else if (typeof options.margin === 'object') {\n util.selectiveExtend(['axis'], this.options.margin, options.margin);\n if ('item' in options.margin) {\n if (typeof options.margin.item === 'number') {\n this.options.margin.item.horizontal = options.margin.item;\n this.options.margin.item.vertical = options.margin.item;\n }\n else if (typeof options.margin.item === 'object') {\n util.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item);\n }\n }\n }\n }\n\n ['locale', 'locales'].forEach(key => {\n if (key in options) {\n this.options[key] = options[key];\n }\n });\n\n if ('editable' in options) {\n if (typeof options.editable === 'boolean') {\n this.options.editable.updateTime = options.editable;\n this.options.editable.updateGroup = options.editable;\n this.options.editable.add = options.editable;\n this.options.editable.remove = options.editable;\n this.options.editable.overrideItems = false;\n }\n else if (typeof options.editable === 'object') {\n util.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove', 'overrideItems'], this.options.editable, options.editable);\n }\n }\n\n if ('groupEditable' in options) {\n if (typeof options.groupEditable === 'boolean') {\n this.options.groupEditable.order = options.groupEditable;\n this.options.groupEditable.add = options.groupEditable;\n this.options.groupEditable.remove = options.groupEditable;\n }\n else if (typeof options.groupEditable === 'object') {\n util.selectiveExtend(['order', 'add', 'remove'], this.options.groupEditable, options.groupEditable);\n }\n }\n\n // callback functions\n const addCallback = name => {\n const fn = options[name];\n if (fn) {\n if (!(typeof fn === 'function')) {\n throw new Error(`option ${name} must be a function ${name}(item, callback)`);\n }\n this.options[name] = fn;\n }\n };\n ['onDropObjectOnItem', 'onAdd', 'onUpdate', 'onRemove', 'onMove', 'onMoving', 'onAddGroup', 'onMoveGroup', 'onRemoveGroup'].forEach(addCallback);\n\n if (options.cluster) {\n Object.assign(this.options, {\n cluster: options.cluster\n });\n if (!this.clusterGenerator) {\n this.clusterGenerator = new ClusterGenerator(this);\n } \n this.clusterGenerator.setItems(this.items, { applyOnChangedLevel: false });\n this.markDirty({ refreshItems: true, restackGroups: true });\n\n this.redraw();\n } else if (this.clusterGenerator) {\n this._detachAllClusters();\n this.clusters = [];\n this.clusterGenerator = null;\n this.options.cluster = undefined;\n this.markDirty({ refreshItems: true, restackGroups: true });\n\n this.redraw();\n } else {\n // force the itemSet to refresh: options like orientation and margins may be changed\n this.markDirty();\n }\n }\n }\n\n /**\n * Mark the ItemSet dirty so it will refresh everything with next redraw.\n * Optionally, all items can be marked as dirty and be refreshed.\n * @param {{refreshItems: boolean}} [options]\n */\n markDirty(options) {\n this.groupIds = [];\n\n if (options) {\n if (options.refreshItems) {\n util.forEach(this.items, item => {\n item.dirty = true;\n if (item.displayed) item.redraw();\n });\n }\n \n if (options.restackGroups) {\n util.forEach(this.groups, (group, key) => {\n if (key === BACKGROUND) return;\n group.stackDirty = true;\n });\n }\n }\n }\n\n /**\n * Destroy the ItemSet\n */\n destroy() {\n this.clearPopupTimer();\n this.hide();\n this.setItems(null);\n this.setGroups(null);\n\n this.hammer && this.hammer.destroy();\n this.groupHammer && this.groupHammer.destroy();\n this.hammer = null;\n\n this.body = null;\n this.conversion = null;\n }\n\n /**\n * Hide the component from the DOM\n */\n hide() {\n // remove the frame containing the items\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n\n // remove the axis with dots\n if (this.dom.axis.parentNode) {\n this.dom.axis.parentNode.removeChild(this.dom.axis);\n }\n\n // remove the labelset containing all group labels\n if (this.dom.labelSet.parentNode) {\n this.dom.labelSet.parentNode.removeChild(this.dom.labelSet);\n }\n }\n\n /**\n * Show the component in the DOM (when not already visible).\n */\n show() {\n // show frame containing the items\n if (!this.dom.frame.parentNode) {\n this.body.dom.center.appendChild(this.dom.frame);\n }\n\n // show axis with dots\n if (!this.dom.axis.parentNode) {\n this.body.dom.backgroundVertical.appendChild(this.dom.axis);\n }\n\n // show labelset containing labels\n if (!this.dom.labelSet.parentNode) {\n if (this.options.rtl) {\n this.body.dom.right.appendChild(this.dom.labelSet);\n } else {\n this.body.dom.left.appendChild(this.dom.labelSet);\n }\n }\n }\n\n /**\n * Activates the popup timer to show the given popup after a fixed time.\n * @param {Popup} popup\n */\n setPopupTimer(popup) {\n this.clearPopupTimer();\n if (popup) {\n const delay = this.options.tooltip.delay || typeof this.options.tooltip.delay === 'number' ?\n this.options.tooltip.delay :\n 500;\n this.popupTimer = setTimeout(\n function () {\n popup.show()\n }, delay);\n }\n }\n\n /**\n * Clears the popup timer for the tooltip.\n */\n clearPopupTimer() {\n if (this.popupTimer != null) {\n clearTimeout(this.popupTimer);\n this.popupTimer = null;\n }\n }\n \n /**\n * Set selected items by their id. Replaces the current selection\n * Unknown id's are silently ignored.\n * @param {string[] | string} [ids] An array with zero or more id's of the items to be\n * selected, or a single item id. If ids is undefined\n * or an empty array, all items will be unselected.\n */\n setSelection(ids) {\n if (ids == undefined) { \n ids = [];\n }\n \n if (!Array.isArray(ids)) {\n ids = [ids];\n }\n \n\n const idsToDeselect = this.selection.filter(id => ids.indexOf(id) === -1);\n\n // unselect currently selected items\n for (let selectedId of idsToDeselect) {\n const item = this.getItemById(selectedId);\n if (item) {\n item.unselect();\n }\n }\n \n // select items\n this.selection = [ ...ids ];\n for (let id of ids) {\n const item = this.getItemById(id);\n if (item) {\n item.select();\n }\n }\n }\n\n /**\n * Get the selected items by their id\n * @return {Array} ids The ids of the selected items\n */\n getSelection() {\n return this.selection.concat([]);\n }\n\n /**\n * Get the id's of the currently visible items.\n * @returns {Array} The ids of the visible items\n */\n getVisibleItems() {\n const range = this.body.range.getRange();\n let right;\n let left;\n\n if (this.options.rtl) { \n right = this.body.util.toScreen(range.start);\n left = this.body.util.toScreen(range.end);\n } else {\n left = this.body.util.toScreen(range.start);\n right = this.body.util.toScreen(range.end);\n }\n\n const ids = [];\n for (const groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n const group = this.groups[groupId];\n const rawVisibleItems = group.isVisible ? group.visibleItems : [];\n\n // filter the \"raw\" set with visibleItems into a set which is really\n // visible by pixels\n for (const item of rawVisibleItems) {\n // TODO: also check whether visible vertically\n if (this.options.rtl) { \n if ((item.right < left) && (item.right + item.width > right)) {\n ids.push(item.id);\n }\n } else {\n if ((item.left < right) && (item.left + item.width > left)) {\n ids.push(item.id);\n }\n }\n }\n }\n }\n\n return ids;\n }\n\n /**\n * Get the id's of the currently visible groups.\n * @returns {Array} The ids of the visible groups\n */\n getVisibleGroups() {\n const ids = [];\n\n for (const groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n const group = this.groups[groupId];\n if (group.isVisible) {\n ids.push(groupId)\n }\n }\n }\n\n return ids;\n }\n \n /**\n * get item by id\n * @param {string} id\n * @return {object} item\n */\n getItemById(id) {\n return this.items[id] || this.clusters.find(cluster => cluster.id === id);\n } \n\n /**\n * Deselect a selected item\n * @param {string | number} id\n * @private\n */\n _deselect(id) {\n const selection = this.selection;\n for (let i = 0, ii = selection.length; i < ii; i++) {\n if (selection[i] == id) { // non-strict comparison!\n selection.splice(i, 1);\n break;\n }\n }\n }\n\n /**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\n redraw() {\n const margin = this.options.margin;\n const range = this.body.range;\n const asSize = util.option.asSize;\n const options = this.options;\n const orientation = options.orientation.item;\n let resized = false;\n const frame = this.dom.frame;\n\n // recalculate absolute position (before redrawing groups)\n this.props.top = this.body.domProps.top.height + this.body.domProps.border.top;\n\n if (this.options.rtl) {\n this.props.right = this.body.domProps.right.width + this.body.domProps.border.right;\n } else {\n this.props.left = this.body.domProps.left.width + this.body.domProps.border.left;\n }\n\n // update class name\n frame.className = 'vis-itemset';\n\n if (this.options.cluster) {\n this._clusterItems();\n }\n\n // reorder the groups (if needed)\n resized = this._orderGroups() || resized;\n\n // check whether zoomed (in that case we need to re-stack everything)\n // TODO: would be nicer to get this as a trigger from Range\n const visibleInterval = range.end - range.start;\n const zoomed = (visibleInterval != this.lastVisibleInterval) || (this.props.width != this.props.lastWidth);\n const scrolled = range.start != this.lastRangeStart;\n const changedStackOption = options.stack != this.lastStack;\n const changedStackSubgroupsOption = options.stackSubgroups != this.lastStackSubgroups;\n const forceRestack = (zoomed || scrolled || changedStackOption || changedStackSubgroupsOption);\n this.lastVisibleInterval = visibleInterval;\n this.lastRangeStart = range.start;\n this.lastStack = options.stack;\n this.lastStackSubgroups = options.stackSubgroups;\n\n this.props.lastWidth = this.props.width;\n const firstGroup = this._firstGroup();\n const firstMargin = {\n item: margin.item,\n axis: margin.axis\n };\n const nonFirstMargin = {\n item: margin.item,\n axis: margin.item.vertical / 2\n };\n let height = 0;\n const minHeight = margin.axis + margin.item.vertical;\n\n // redraw the background group\n this.groups[BACKGROUND].redraw(range, nonFirstMargin, forceRestack);\n\n const redrawQueue = {};\n let redrawQueueLength = 0;\n\n // collect redraw functions\n util.forEach(this.groups, (group, key) => {\n if (key === BACKGROUND) return;\n const groupMargin = group == firstGroup ? firstMargin : nonFirstMargin;\n const returnQueue = true;\n redrawQueue[key] = group.redraw(range, groupMargin, forceRestack, returnQueue);\n redrawQueueLength = redrawQueue[key].length;\n });\n\n const needRedraw = redrawQueueLength > 0;\n if (needRedraw) {\n const redrawResults = {};\n\n for (let i = 0; i < redrawQueueLength; i++) {\n util.forEach(redrawQueue, (fns, key) => {\n redrawResults[key] = fns[i]();\n });\n }\n\n // redraw all regular groups\n util.forEach(this.groups, (group, key) => {\n if (key === BACKGROUND) return;\n const groupResized = redrawResults[key];\n resized = groupResized || resized;\n height += group.height;\n });\n height = Math.max(height, minHeight);\n }\n\n height = Math.max(height, minHeight);\n\n // update frame height\n frame.style.height = asSize(height);\n\n // calculate actual size\n this.props.width = frame.offsetWidth;\n this.props.height = height;\n\n // reposition axis\n this.dom.axis.style.top = asSize((orientation == 'top') ?\n (this.body.domProps.top.height + this.body.domProps.border.top) :\n (this.body.domProps.top.height + this.body.domProps.centerContainer.height));\n if (this.options.rtl) {\n this.dom.axis.style.right = '0';\n } else {\n this.dom.axis.style.left = '0';\n }\n\n this.initialItemSetDrawn = true;\n // check if this component is resized\n resized = this._isResized() || resized;\n\n return resized;\n }\n\n /**\n * Get the first group, aligned with the axis\n * @return {Group | null} firstGroup\n * @private\n */\n _firstGroup() {\n const firstGroupIndex = (this.options.orientation.item == 'top') ? 0 : (this.groupIds.length - 1);\n const firstGroupId = this.groupIds[firstGroupIndex];\n const firstGroup = this.groups[firstGroupId] || this.groups[UNGROUPED];\n\n return firstGroup || null;\n }\n\n /**\n * Create or delete the group holding all ungrouped items. This group is used when\n * there are no groups specified.\n * @protected\n */\n _updateUngrouped() {\n let ungrouped = this.groups[UNGROUPED];\n let item;\n let itemId;\n\n if (this.groupsData) {\n // remove the group holding all ungrouped items\n if (ungrouped) {\n ungrouped.hide();\n delete this.groups[UNGROUPED];\n\n for (itemId in this.items) {\n if (this.items.hasOwnProperty(itemId)) {\n item = this.items[itemId];\n item.parent && item.parent.remove(item);\n const groupId = this.getGroupId(item.data);\n const group = this.groups[groupId];\n group && group.add(item) || item.hide();\n }\n }\n }\n }\n else {\n // create a group holding all (unfiltered) items\n if (!ungrouped) {\n const id = null;\n const data = null;\n ungrouped = new Group(id, data, this);\n this.groups[UNGROUPED] = ungrouped;\n\n for (itemId in this.items) {\n if (this.items.hasOwnProperty(itemId)) {\n item = this.items[itemId];\n ungrouped.add(item);\n }\n }\n\n ungrouped.show();\n }\n }\n }\n\n /**\n * Get the element for the labelset\n * @return {HTMLElement} labelSet\n */\n getLabelSet() {\n return this.dom.labelSet;\n }\n\n /**\n * Set items\n * @param {vis.DataSet | null} items\n */\n setItems(items) {\n this.itemsSettingTime = new Date();\n const me = this;\n let ids;\n const oldItemsData = this.itemsData;\n\n // replace the dataset\n if (!items) {\n this.itemsData = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n this.itemsData = items;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (oldItemsData) {\n // unsubscribe from old dataset\n util.forEach(this.itemListeners, (callback, event) => {\n oldItemsData.off(event, callback);\n });\n\n // remove all drawn items\n ids = oldItemsData.getIds();\n this._onRemove(ids);\n }\n\n if (this.itemsData) {\n // subscribe to new dataset\n const id = this.id;\n util.forEach(this.itemListeners, (callback, event) => {\n me.itemsData.on(event, callback, id);\n });\n\n // add all new items\n ids = this.itemsData.getIds();\n this._onAdd(ids);\n\n // update the group holding all ungrouped items\n this._updateUngrouped();\n }\n\n this.body.emitter.emit('_change', {queue: true});\n }\n\n /**\n * Get the current items\n * @returns {vis.DataSet | null}\n */\n getItems() {\n return this.itemsData;\n }\n\n /**\n * Set groups\n * @param {vis.DataSet} groups\n */\n setGroups(groups) {\n const me = this;\n let ids;\n\n // unsubscribe from current dataset\n if (this.groupsData) {\n util.forEach(this.groupListeners, (callback, event) => {\n me.groupsData.off(event, callback);\n });\n\n // remove all drawn groups\n ids = this.groupsData.getIds();\n this.groupsData = null;\n this._onRemoveGroups(ids); // note: this will cause a redraw\n }\n\n // replace the dataset\n if (!groups) {\n this.groupsData = null;\n }\n else if (groups instanceof DataSet || groups instanceof DataView) {\n this.groupsData = groups;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (this.groupsData) {\n // go over all groups nesting\n let groupsData = this.groupsData;\n if (this.groupsData instanceof DataView) {\n groupsData = this.groupsData.getDataSet()\n }\n\n groupsData.get().forEach(group => {\n if (group.nestedGroups) {\n group.nestedGroups.forEach(nestedGroupId => {\n const updatedNestedGroup = groupsData.get(nestedGroupId);\n updatedNestedGroup.nestedInGroup = group.id;\n if (group.showNested == false) {\n updatedNestedGroup.visible = false;\n }\n groupsData.update(updatedNestedGroup);\n })\n }\n });\n\n // subscribe to new dataset\n const id = this.id;\n util.forEach(this.groupListeners, (callback, event) => {\n me.groupsData.on(event, callback, id);\n });\n\n // draw all ms\n ids = this.groupsData.getIds();\n this._onAddGroups(ids);\n }\n\n // update the group holding all ungrouped items\n this._updateUngrouped();\n\n // update the order of all items in each group\n this._order();\n\n if (this.options.cluster) {\n this.clusterGenerator.updateData();\n this._clusterItems();\n this.markDirty({ refreshItems: true, restackGroups: true });\n }\n\n this.body.emitter.emit('_change', {queue: true});\n }\n\n /**\n * Get the current groups\n * @returns {vis.DataSet | null} groups\n */\n getGroups() {\n return this.groupsData;\n }\n\n /**\n * Remove an item by its id\n * @param {string | number} id\n */\n removeItem(id) {\n const item = this.itemsData.get(id);\n const dataset = this.itemsData.getDataSet();\n\n if (item) {\n // confirm deletion\n this.options.onRemove(item, item => {\n if (item) {\n // remove by id here, it is possible that an item has no id defined\n // itself, so better not delete by the item itself\n dataset.remove(id);\n }\n });\n }\n }\n\n /**\n * Get the time of an item based on it's data and options.type\n * @param {Object} itemData\n * @returns {string} Returns the type\n * @private\n */\n _getType(itemData) {\n return itemData.type || this.options.type || (itemData.end ? 'range' : 'box');\n }\n\n /**\n * Get the group id for an item\n * @param {Object} itemData\n * @returns {string} Returns the groupId\n * @private\n */\n getGroupId(itemData) {\n const type = this._getType(itemData);\n if (type == 'background' && itemData.group == undefined) {\n return BACKGROUND;\n }\n else {\n return this.groupsData ? itemData.group : UNGROUPED;\n }\n }\n\n /**\n * Handle updated items\n * @param {number[]} ids\n * @protected\n */\n _onUpdate(ids) {\n const me = this;\n\n ids.forEach(id => {\n const itemData = me.itemsData.get(id, me.itemOptions);\n let item = me.items[id];\n const type = itemData ? me._getType(itemData) : null;\n\n const constructor = ItemSet.types[type];\n let selected;\n\n if (item) {\n // update item \t\n if (!constructor || !(item instanceof constructor)) {\n // item type has changed, delete the item and recreate it\n selected = item.selected; // preserve selection of this item\n me._removeItem(item);\n item = null;\n }\n else {\n me._updateItem(item, itemData);\n }\n }\n\n if (!item && itemData) {\n // create item\n if (constructor) {\n item = new constructor(itemData, me.conversion, me.options);\n item.id = id; // TODO: not so nice setting id afterwards\n\n me._addItem(item);\n if (selected) {\n this.selection.push(id);\n item.select();\n }\n }\n else {\n throw new TypeError(`Unknown item type \"${type}\"`);\n }\n }\n });\n\n this._order();\n \n if (this.options.cluster) {\n this.clusterGenerator.setItems(this.items, { applyOnChangedLevel: false });\n this._clusterItems();\n }\n\n this.body.emitter.emit('_change', {queue: true});\n }\n\n /**\n * Handle removed items\n * @param {number[]} ids\n * @protected\n */\n _onRemove(ids) {\n let count = 0;\n const me = this;\n ids.forEach(id => {\n const item = me.items[id];\n if (item) {\n count++;\n me._removeItem(item);\n }\n });\n\n if (count) {\n // update order\n this._order();\n this.body.emitter.emit('_change', {queue: true});\n }\n }\n\n /**\n * Update the order of item in all groups\n * @private\n */\n _order() {\n // reorder the items in all groups\n // TODO: optimization: only reorder groups affected by the changed items\n util.forEach(this.groups, group => {\n group.order();\n });\n }\n\n /**\n * Handle updated groups\n * @param {number[]} ids\n * @private\n */\n _onUpdateGroups(ids) {\n this._onAddGroups(ids);\n }\n\n /**\n * Handle changed groups (added or updated)\n * @param {number[]} ids\n * @private\n */\n _onAddGroups(ids) {\n const me = this;\n\n ids.forEach(id => {\n const groupData = me.groupsData.get(id);\n let group = me.groups[id];\n\n if (!group) {\n // check for reserved ids\n if (id == UNGROUPED || id == BACKGROUND) {\n throw new Error(`Illegal group id. ${id} is a reserved id.`);\n }\n\n const groupOptions = Object.create(me.options);\n util.extend(groupOptions, {\n height: null\n });\n\n group = new Group(id, groupData, me);\n me.groups[id] = group;\n\n // add items with this groupId to the new group\n for (const itemId in me.items) {\n if (me.items.hasOwnProperty(itemId)) {\n const item = me.items[itemId];\n if (item.data.group == id) {\n group.add(item);\n }\n }\n }\n\n group.order();\n group.show();\n }\n else {\n // update group\n group.setData(groupData);\n }\n });\n\n this.body.emitter.emit('_change', {queue: true});\n }\n\n /**\n * Handle removed groups\n * @param {number[]} ids\n * @private\n */\n _onRemoveGroups(ids) {\n const groups = this.groups;\n ids.forEach(id => {\n const group = groups[id];\n\n if (group) {\n group.hide();\n delete groups[id];\n }\n });\n\n if (this.options.cluster) {\n this.clusterGenerator.updateData();\n this._clusterItems();\n } \n\n this.markDirty({ restackGroups: !!this.options.cluster });\n this.body.emitter.emit('_change', {queue: true});\n }\n\n /**\n * Reorder the groups if needed\n * @return {boolean} changed\n * @private\n */\n _orderGroups() {\n if (this.groupsData) {\n // reorder the groups\n let groupIds = this.groupsData.getIds({\n order: this.options.groupOrder\n });\n\n groupIds = this._orderNestedGroups(groupIds);\n\n const changed = !util.equalArray(groupIds, this.groupIds);\n if (changed) {\n // hide all groups, removes them from the DOM\n const groups = this.groups;\n groupIds.forEach(groupId => {\n groups[groupId].hide();\n });\n\n // show the groups again, attach them to the DOM in correct order\n groupIds.forEach(groupId => {\n groups[groupId].show();\n });\n\n this.groupIds = groupIds;\n }\n\n return changed;\n }\n else {\n return false;\n }\n }\n\n /**\n * Reorder the nested groups\n *\n * @param {Array.} groupIds\n * @returns {Array.}\n * @private\n */\n _orderNestedGroups(groupIds) {\n /**\n * Recursively order nested groups\n *\n * @param {ItemSet} t\n * @param {Array.} groupIds\n * @returns {Array.}\n * @private\n */\n function getOrderedNestedGroups(t, groupIds) {\n let result = [];\n groupIds.forEach(groupId => {\n result.push(groupId);\n const groupData = t.groupsData.get(groupId);\n if (groupData.nestedGroups) {\n const nestedGroupIds = t.groupsData.get({\n filter(nestedGroup) {\n return nestedGroup.nestedInGroup == groupId;\n },\n order: t.options.groupOrder\n }).map(nestedGroup => nestedGroup.id);\n result = result.concat(getOrderedNestedGroups(t, nestedGroupIds));\n }\n });\n\n return result;\n }\n\n const topGroupIds = groupIds.filter(groupId => !this.groupsData.get(groupId).nestedInGroup);\n\n return getOrderedNestedGroups(this, topGroupIds);\n }\n\n /**\n * Add a new item\n * @param {Item} item\n * @private\n */\n _addItem(item) {\n this.items[item.id] = item;\n\n // add to group\n const groupId = this.getGroupId(item.data);\n const group = this.groups[groupId];\n\n if (!group) {\n item.groupShowing = false;\n } else if (group && group.data && group.data.showNested) {\n item.groupShowing = true;\n }\n\n if (group) group.add(item);\n }\n\n /**\n * Update an existing item\n * @param {Item} item\n * @param {Object} itemData\n * @private\n */\n _updateItem(item, itemData) {\n // update the items data (will redraw the item when displayed)\n item.setData(itemData);\n\n const groupId = this.getGroupId(item.data);\n const group = this.groups[groupId];\n if (!group) {\n item.groupShowing = false;\n } else if (group && group.data && group.data.showNested) {\n item.groupShowing = true;\n }\n }\n\n /**\n * Delete an item from the ItemSet: remove it from the DOM, from the map\n * with items, and from the map with visible items, and from the selection\n * @param {Item} item\n * @private\n */\n _removeItem(item) {\n // remove from DOM\n item.hide();\n\n // remove from items\n delete this.items[item.id];\n\n // remove from selection\n const index = this.selection.indexOf(item.id);\n if (index != -1) this.selection.splice(index, 1);\n\n // remove from group\n item.parent && item.parent.remove(item);\n\n // remove Tooltip from DOM\n if (this.popup != null) {\n this.popup.hide();\n }\n }\n\n /**\n * Create an array containing all items being a range (having an end date)\n * @param {Array.} array\n * @returns {Array}\n * @private\n */\n _constructByEndArray(array) {\n const endArray = [];\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] instanceof RangeItem) {\n endArray.push(array[i]);\n }\n }\n return endArray;\n }\n\n /**\n * Register the clicked item on touch, before dragStart is initiated.\n *\n * dragStart is initiated from a mousemove event, AFTER the mouse/touch is\n * already moving. Therefore, the mouse/touch can sometimes be above an other\n * DOM element than the item itself.\n *\n * @param {Event} event\n * @private\n */\n _onTouch(event) {\n // store the touched item, used in _onDragStart\n this.touchParams.item = this.itemFromTarget(event);\n this.touchParams.dragLeftItem = event.target.dragLeftItem || false;\n this.touchParams.dragRightItem = event.target.dragRightItem || false;\n this.touchParams.itemProps = null;\n }\n\n /**\n * Given an group id, returns the index it has.\n *\n * @param {number} groupId\n * @returns {number} index / groupId\n * @private\n */\n _getGroupIndex(groupId) {\n for (let i = 0; i < this.groupIds.length; i++) {\n if (groupId == this.groupIds[i])\n return i;\n }\n }\n\n /**\n * Start dragging the selected events\n * @param {Event} event\n * @private\n */\n _onDragStart(event) {\n if (this.touchParams.itemIsDragging) { return; }\n const item = this.touchParams.item || null;\n const me = this;\n let props;\n\n if (item && (item.selected || this.options.itemsAlwaysDraggable.item)) {\n\n if (this.options.editable.overrideItems &&\n !this.options.editable.updateTime &&\n !this.options.editable.updateGroup) {\n return;\n }\n\n // override options.editable\n if ((item.editable != null && !item.editable.updateTime && !item.editable.updateGroup)\n && !this.options.editable.overrideItems) {\n return;\n }\n\n const dragLeftItem = this.touchParams.dragLeftItem;\n const dragRightItem = this.touchParams.dragRightItem;\n this.touchParams.itemIsDragging = true;\n this.touchParams.selectedItem = item;\n\n if (dragLeftItem) {\n props = {\n item: dragLeftItem,\n initialX: event.center.x,\n dragLeft: true,\n data: this._cloneItemData(item.data)\n };\n\n this.touchParams.itemProps = [props];\n } else if (dragRightItem) {\n props = {\n item: dragRightItem,\n initialX: event.center.x,\n dragRight: true,\n data: this._cloneItemData(item.data)\n };\n\n this.touchParams.itemProps = [props];\n } else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {\n // create a new range item when dragging with ctrl key down\n this._onDragStartAddItem(event);\n } else {\n if(this.groupIds.length < 1) {\n // Mitigates a race condition if _onDragStart() is\n // called after markDirty() without redraw() being called between.\n this.redraw();\n }\n \n const baseGroupIndex = this._getGroupIndex(item.data.group);\n\n const itemsToDrag = (this.options.itemsAlwaysDraggable.item && !item.selected) ? [item.id] : this.getSelection();\n\n this.touchParams.itemProps = itemsToDrag.map(id => {\n const item = me.items[id];\n const groupIndex = me._getGroupIndex(item.data.group);\n return {\n item,\n initialX: event.center.x,\n groupOffset: baseGroupIndex-groupIndex,\n data: this._cloneItemData(item.data)\n };\n });\n }\n\n event.stopPropagation();\n } else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {\n // create a new range item when dragging with ctrl key down\n this._onDragStartAddItem(event);\n }\n }\n\n /**\n * Start creating a new range item by dragging.\n * @param {Event} event\n * @private\n */\n _onDragStartAddItem(event) {\n const snap = this.options.snap || null;\n const frameRect = this.dom.frame.getBoundingClientRect()\n\n // plus (if rtl) 10 to compensate for the drag starting as soon as you've moved 10px\n const x = this.options.rtl ? frameRect.right - event.center.x + 10 : event.center.x - frameRect.left - 10;\n\n const time = this.body.util.toTime(x);\n const scale = this.body.util.getScale();\n const step = this.body.util.getStep();\n const start = snap ? snap(time, scale, step) : time;\n const end = start;\n\n const itemData = {\n type: 'range',\n start,\n end,\n content: 'new item'\n };\n\n const id = util.randomUUID();\n itemData[this.itemsData._idProp] = id;\n\n const group = this.groupFromTarget(event);\n if (group) {\n itemData.group = group.groupId;\n }\n const newItem = new RangeItem(itemData, this.conversion, this.options);\n newItem.id = id; // TODO: not so nice setting id afterwards\n newItem.data = this._cloneItemData(itemData);\n this._addItem(newItem);\n this.touchParams.selectedItem = newItem;\n \n const props = {\n item: newItem,\n initialX: event.center.x,\n data: newItem.data\n };\n\n if (this.options.rtl) {\n props.dragLeft = true;\n } else {\n props.dragRight = true;\n }\n this.touchParams.itemProps = [props];\n\n event.stopPropagation();\n }\n\n /**\n * Drag selected items\n * @param {Event} event\n * @private\n */\n _onDrag(event) {\n if (this.popup != null && this.options.showTooltips && !this.popup.hidden) {\n // this.popup.hide();\n const container = this.body.dom.centerContainer;\n const containerRect = container.getBoundingClientRect()\n this.popup.setPosition(\n event.center.x - containerRect.left + container.offsetLeft,\n event.center.y - containerRect.top + container.offsetTop\n );\n this.popup.show(); // redraw\n }\n \n if (this.touchParams.itemProps) {\n event.stopPropagation();\n\n const me = this;\n const snap = this.options.snap || null;\n const domRootOffsetLeft = this.body.dom.root.offsetLeft;\n const xOffset = this.options.rtl ? domRootOffsetLeft + this.body.domProps.right.width : domRootOffsetLeft + this.body.domProps.left.width;\n const scale = this.body.util.getScale();\n const step = this.body.util.getStep();\n\n //only calculate the new group for the item that's actually dragged\n const selectedItem = this.touchParams.selectedItem;\n const updateGroupAllowed = ((this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateGroup) ||\n (!this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateGroup);\n let newGroupBase = null;\n if (updateGroupAllowed && selectedItem) {\n if (selectedItem.data.group != undefined) {\n // drag from one group to another\n const group = me.groupFromTarget(event);\n if (group) {\n //we know the offset for all items, so the new group for all items\n //will be relative to this one.\n newGroupBase = this._getGroupIndex(group.groupId);\n }\n }\n }\n\n // move\n this.touchParams.itemProps.forEach(props => {\n const current = me.body.util.toTime(event.center.x - xOffset);\n const initial = me.body.util.toTime(props.initialX - xOffset);\n let offset;\n let initialStart;\n let initialEnd;\n let start;\n let end;\n\n if (this.options.rtl) {\n offset = -(current - initial); // ms\n } else {\n offset = (current - initial); // ms\n }\n\n let itemData = this._cloneItemData(props.item.data); // clone the data\n if (props.item.editable != null\n && !props.item.editable.updateTime\n && !props.item.editable.updateGroup\n && !me.options.editable.overrideItems) {\n return;\n }\n\n const updateTimeAllowed = ((this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateTime) ||\n (!this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateTime);\n if (updateTimeAllowed) {\n if (props.dragLeft) {\n // drag left side of a range item\n if (this.options.rtl) {\n if (itemData.end != undefined) {\n initialEnd = util.convert(props.data.end, 'Date');\n end = new Date(initialEnd.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.end = snap ? snap(end, scale, step) : end;\n }\n } else {\n if (itemData.start != undefined) {\n initialStart = util.convert(props.data.start, 'Date');\n start = new Date(initialStart.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n }\n }\n }\n else if (props.dragRight) {\n // drag right side of a range item\n if (this.options.rtl) {\n if (itemData.start != undefined) {\n initialStart = util.convert(props.data.start, 'Date');\n start = new Date(initialStart.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n }\n } else {\n if (itemData.end != undefined) {\n initialEnd = util.convert(props.data.end, 'Date');\n end = new Date(initialEnd.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.end = snap ? snap(end, scale, step) : end;\n }\n }\n }\n else {\n // drag both start and end\n if (itemData.start != undefined) {\n\n initialStart = util.convert(props.data.start, 'Date').valueOf();\n start = new Date(initialStart + offset);\n\n if (itemData.end != undefined) {\n initialEnd = util.convert(props.data.end, 'Date');\n const duration = initialEnd.valueOf() - initialStart.valueOf();\n\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n itemData.end = new Date(itemData.start.valueOf() + duration);\n }\n else {\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n }\n }\n }\n }\n\n if (updateGroupAllowed && (!props.dragLeft && !props.dragRight) && newGroupBase!=null) {\n if (itemData.group != undefined) {\n let newOffset = newGroupBase - props.groupOffset;\n\n //make sure we stay in bounds\n newOffset = Math.max(0, newOffset);\n newOffset = Math.min(me.groupIds.length-1, newOffset);\n itemData.group = me.groupIds[newOffset];\n }\n }\n\n // confirm moving the item\n itemData = this._cloneItemData(itemData); // convert start and end to the correct type\n me.options.onMoving(itemData, itemData => {\n if (itemData) {\n props.item.setData(this._cloneItemData(itemData, 'Date'));\n }\n });\n });\n \n this.body.emitter.emit('_change');\n }\n }\n\n /**\n * Move an item to another group\n * @param {Item} item\n * @param {string | number} groupId\n * @private\n */\n _moveToGroup(item, groupId) {\n const group = this.groups[groupId];\n if (group && group.groupId != item.data.group) {\n const oldGroup = item.parent;\n oldGroup.remove(item);\n oldGroup.order();\n \n item.data.group = group.groupId;\n \n group.add(item);\n group.order();\n }\n }\n\n /**\n * End of dragging selected items\n * @param {Event} event\n * @private\n */\n _onDragEnd(event) {\n this.touchParams.itemIsDragging = false;\n if (this.touchParams.itemProps) {\n event.stopPropagation();\n\n const me = this;\n const dataset = this.itemsData.getDataSet();\n const itemProps = this.touchParams.itemProps;\n this.touchParams.itemProps = null;\n\n itemProps.forEach(props => {\n const id = props.item.id;\n const exists = me.itemsData.get(id, me.itemOptions) != null;\n\n if (!exists) {\n // add a new item\n me.options.onAdd(props.item.data, itemData => {\n me._removeItem(props.item); // remove temporary item\n if (itemData) {\n me.itemsData.getDataSet().add(itemData);\n }\n\n // force re-stacking of all items next redraw\n me.body.emitter.emit('_change');\n });\n }\n else {\n // update existing item\n const itemData = this._cloneItemData(props.item.data); // convert start and end to the correct type\n me.options.onMove(itemData, itemData => {\n if (itemData) {\n // apply changes\n itemData[dataset._idProp] = id; // ensure the item contains its id (can be undefined)\n dataset.update(itemData);\n }\n else {\n // restore original values\n props.item.setData(props.data);\n\n me.body.emitter.emit('_change');\n }\n });\n }\n });\n }\n }\n\n /**\n * On group click\n * @param {Event} event\n * @private\n */\n _onGroupClick(event) {\n const group = this.groupFromTarget(event);\n setTimeout(() => {\n this.toggleGroupShowNested(group);\n }, 1)\n }\n \n /**\n * Toggle show nested\n * @param {object} group\n * @param {boolean} force\n */\n toggleGroupShowNested(group, force = undefined) {\n\n if (!group || !group.nestedGroups) return;\n\n const groupsData = this.groupsData.getDataSet();\n\n if (force != undefined) {\n group.showNested = !!force;\n } else {\n group.showNested = !group.showNested;\n }\n\n let nestingGroup = groupsData.get(group.groupId);\n nestingGroup.showNested = group.showNested;\n\n let fullNestedGroups = group.nestedGroups;\n let nextLevel = fullNestedGroups;\n while (nextLevel.length > 0) {\n let current = nextLevel;\n nextLevel = [];\n for (let i = 0; i < current.length; i++) {\n let node = groupsData.get(current[i]);\n if (node.nestedGroups) {\n nextLevel = nextLevel.concat(node.nestedGroups);\n }\n }\n if (nextLevel.length > 0) {\n fullNestedGroups = fullNestedGroups.concat(nextLevel);\n }\n }\n let nestedGroups = groupsData.get(fullNestedGroups).map(function (nestedGroup) {\n if (nestedGroup.visible == undefined) {\n nestedGroup.visible = true;\n }\n nestedGroup.visible = !!nestingGroup.showNested;\n return nestedGroup;\n });\n\n groupsData.update(nestedGroups.concat(nestingGroup));\n\n if (nestingGroup.showNested) {\n util.removeClassName(group.dom.label, 'collapsed');\n util.addClassName(group.dom.label, 'expanded');\n } else {\n util.removeClassName(group.dom.label, 'expanded');\n util.addClassName(group.dom.label, 'collapsed');\n }\n }\n \n /**\n * Toggle group drag classname\n * @param {object} group\n */\n toggleGroupDragClassName(group) {\n group.dom.label.classList.toggle('vis-group-is-dragging');\n group.dom.foreground.classList.toggle('vis-group-is-dragging');\n }\n \n /**\n * on drag start\n * @param {Event} event\n * @return {void} \n * @private\n */\n _onGroupDragStart(event) {\n if (this.groupTouchParams.isDragging) return;\n\n if (this.options.groupEditable.order) {\n this.groupTouchParams.group = this.groupFromTarget(event);\n \n if (this.groupTouchParams.group) {\n event.stopPropagation(); \n \n this.groupTouchParams.isDragging = true;\n this.toggleGroupDragClassName(this.groupTouchParams.group);\n \n this.groupTouchParams.originalOrder = this.groupsData.getIds({\n order: this.options.groupOrder\n });\n }\n }\n }\n\n /**\n * on drag\n * @param {Event} event\n * @return {void}\n * @private\n */\n _onGroupDrag(event) {\n if (this.options.groupEditable.order && this.groupTouchParams.group) {\n event.stopPropagation();\n \n let groupsData = this.groupsData;\n if (this.groupsData instanceof DataView) {\n groupsData = this.groupsData.getDataSet()\n }\n // drag from one group to another\n const group = this.groupFromTarget(event);\n \n // try to avoid toggling when groups differ in height\n if (group && group.height != this.groupTouchParams.group.height) {\n const movingUp = (group.top < this.groupTouchParams.group.top);\n const clientY = event.center ? event.center.y : event.clientY;\n const targetGroup = group.dom.foreground.getBoundingClientRect()\n const draggedGroupHeight = this.groupTouchParams.group.height;\n if (movingUp) {\n // skip swapping the groups when the dragged group is not below clientY afterwards\n if (targetGroup.top + draggedGroupHeight < clientY) {\n return;\n }\n } else {\n const targetGroupHeight = group.height;\n // skip swapping the groups when the dragged group is not below clientY afterwards\n if (targetGroup.top + targetGroupHeight - draggedGroupHeight > clientY) {\n return;\n }\n }\n }\n \n if (group && group != this.groupTouchParams.group) {\n const targetGroup = groupsData.get(group.groupId);\n const draggedGroup = groupsData.get(this.groupTouchParams.group.groupId);\n \n // switch groups\n if (draggedGroup && targetGroup) {\n this.options.groupOrderSwap(draggedGroup, targetGroup, groupsData);\n groupsData.update(draggedGroup);\n groupsData.update(targetGroup);\n }\n \n // fetch current order of groups\n const newOrder = groupsData.getIds({\n order: this.options.groupOrder\n });\n\n \n // in case of changes since _onGroupDragStart\n if (!util.equalArray(newOrder, this.groupTouchParams.originalOrder)) {\n const origOrder = this.groupTouchParams.originalOrder;\n const draggedId = this.groupTouchParams.group.groupId;\n const numGroups = Math.min(origOrder.length, newOrder.length);\n let curPos = 0;\n let newOffset = 0;\n let orgOffset = 0;\n while (curPos < numGroups) {\n // as long as the groups are where they should be step down along the groups order\n while ((curPos+newOffset) < numGroups \n && (curPos+orgOffset) < numGroups \n && newOrder[curPos+newOffset] == origOrder[curPos+orgOffset]) {\n curPos++;\n }\n \n // all ok\n if (curPos+newOffset >= numGroups) {\n break;\n }\n \n // not all ok\n // if dragged group was move upwards everything below should have an offset\n if (newOrder[curPos+newOffset] == draggedId) {\n newOffset = 1;\n\n }\n // if dragged group was move downwards everything above should have an offset\n else if (origOrder[curPos+orgOffset] == draggedId) {\n orgOffset = 1;\n\n } \n // found a group (apart from dragged group) that has the wrong position -> switch with the \n // group at the position where other one should be, fix index arrays and continue\n else {\n const slippedPosition = newOrder.indexOf(origOrder[curPos+orgOffset]);\n const switchGroup = groupsData.get(newOrder[curPos+newOffset]);\n const shouldBeGroup = groupsData.get(origOrder[curPos+orgOffset]);\n this.options.groupOrderSwap(switchGroup, shouldBeGroup, groupsData);\n groupsData.update(switchGroup);\n groupsData.update(shouldBeGroup);\n \n const switchGroupId = newOrder[curPos+newOffset];\n newOrder[curPos+newOffset] = origOrder[curPos+orgOffset];\n newOrder[slippedPosition] = switchGroupId;\n \n curPos++;\n }\n }\n }\n \n }\n }\n }\n\n /**\n * on drag end\n * @param {Event} event\n * @return {void}\n * @private\n */\n _onGroupDragEnd(event) {\n this.groupTouchParams.isDragging = false;\n\n if (this.options.groupEditable.order && this.groupTouchParams.group) {\n event.stopPropagation();\n \n // update existing group\n const me = this;\n const id = me.groupTouchParams.group.groupId;\n const dataset = me.groupsData.getDataSet();\n const groupData = util.extend({}, dataset.get(id)); // clone the data\n me.options.onMoveGroup(groupData, groupData => {\n if (groupData) {\n // apply changes\n groupData[dataset._idProp] = id; // ensure the group contains its id (can be undefined)\n dataset.update(groupData);\n }\n else {\n\n // fetch current order of groups\n const newOrder = dataset.getIds({\n order: me.options.groupOrder\n });\n\n // restore original order\n if (!util.equalArray(newOrder, me.groupTouchParams.originalOrder)) {\n const origOrder = me.groupTouchParams.originalOrder;\n const numGroups = Math.min(origOrder.length, newOrder.length);\n let curPos = 0;\n while (curPos < numGroups) {\n // as long as the groups are where they should be step down along the groups order\n while (curPos < numGroups && newOrder[curPos] == origOrder[curPos]) {\n curPos++;\n }\n\n // all ok\n if (curPos >= numGroups) {\n break;\n }\n\n // found a group that has the wrong position -> switch with the\n // group at the position where other one should be, fix index arrays and continue\n const slippedPosition = newOrder.indexOf(origOrder[curPos]);\n const switchGroup = dataset.get(newOrder[curPos]);\n const shouldBeGroup = dataset.get(origOrder[curPos]);\n me.options.groupOrderSwap(switchGroup, shouldBeGroup, dataset);\n dataset.update(switchGroup);\n dataset.update(shouldBeGroup);\n\n const switchGroupId = newOrder[curPos];\n newOrder[curPos] = origOrder[curPos];\n newOrder[slippedPosition] = switchGroupId;\n\n curPos++;\n }\n }\n }\n });\n\n me.body.emitter.emit('groupDragged', { groupId: id });\n this.toggleGroupDragClassName(this.groupTouchParams.group);\n this.groupTouchParams.group = null;\n }\n }\n\n /**\n * Handle selecting/deselecting an item when tapping it\n * @param {Event} event\n * @private\n */\n _onSelectItem(event) {\n if (!this.options.selectable) return;\n\n const ctrlKey = event.srcEvent && (event.srcEvent.ctrlKey || event.srcEvent.metaKey);\n const shiftKey = event.srcEvent && event.srcEvent.shiftKey;\n if (ctrlKey || shiftKey) {\n this._onMultiSelectItem(event);\n return;\n }\n\n const oldSelection = this.getSelection();\n\n const item = this.itemFromTarget(event);\n const selection = item && item.selectable ? [item.id] : [];\n this.setSelection(selection);\n\n const newSelection = this.getSelection();\n\n // emit a select event,\n // except when old selection is empty and new selection is still empty\n if (newSelection.length > 0 || oldSelection.length > 0) {\n this.body.emitter.emit('select', {\n items: newSelection,\n event\n });\n }\n }\n\n /**\n * Handle hovering an item\n * @param {Event} event\n * @private\n */\n _onMouseOver(event) {\n const item = this.itemFromTarget(event);\n if (!item) return;\n\n // Item we just left\n const related = this.itemFromRelatedTarget(event);\n if (item === related) {\n // We haven't changed item, just element in the item\n return;\n }\n\n const title = item.getTitle();\n if (this.options.showTooltips && title) {\n if (this.popup == null) {\n this.popup = new Popup(this.body.dom.root,\n this.options.tooltip.overflowMethod || 'flip');\n }\n\n this.popup.setText(title);\n const container = this.body.dom.centerContainer;\n const containerRect = container.getBoundingClientRect()\n this.popup.setPosition(\n event.clientX - containerRect.left + container.offsetLeft,\n event.clientY - containerRect.top + container.offsetTop\n );\n this.setPopupTimer(this.popup);\n } else {\n // Hovering over item without a title, hide popup\n // Needed instead of _just_ in _onMouseOut due to #2572\n this.clearPopupTimer();\n if (this.popup != null) {\n this.popup.hide();\n }\n }\n\n this.body.emitter.emit('itemover', {\n item: item.id,\n event\n });\n }\n\n /**\n * on mouse start\n * @param {Event} event\n * @return {void} \n * @private\n */\n _onMouseOut(event) {\n const item = this.itemFromTarget(event);\n if (!item) return;\n\n // Item we are going to\n const related = this.itemFromRelatedTarget(event);\n if (item === related) {\n // We aren't changing item, just element in the item\n return;\n }\n\n this.clearPopupTimer();\n if (this.popup != null) {\n this.popup.hide();\n }\n\n this.body.emitter.emit('itemout', {\n item: item.id,\n event\n });\n }\n\n /**\n * on mouse move\n * @param {Event} event\n * @return {void} \n * @private\n */\n _onMouseMove(event) {\n const item = this.itemFromTarget(event);\n if (!item) return;\n\n if (this.popupTimer != null) {\n // restart timer\n this.setPopupTimer(this.popup);\n }\n \n if (this.options.showTooltips && this.options.tooltip.followMouse && this.popup && !this.popup.hidden) {\n const container = this.body.dom.centerContainer;\n const containerRect = container.getBoundingClientRect()\n this.popup.setPosition(\n event.clientX - containerRect.left + container.offsetLeft,\n event.clientY - containerRect.top + container.offsetTop\n );\n this.popup.show(); // Redraw\n }\n }\n\n /**\n * Handle mousewheel\n * @param {Event} event The event\n * @private\n */\n _onMouseWheel(event) {\n if (this.touchParams.itemIsDragging) {\n this._onDragEnd(event);\n }\n }\n\n /**\n * Handle updates of an item on double tap\n * @param {timeline.Item} item The item\n * @private\n */\n _onUpdateItem(item) {\n if (!this.options.selectable) return;\n if (!this.options.editable.updateTime) return;\n if (!this.options.editable.updateGroup) return;\n\n\n const me = this;\n \n if (item) {\n // execute async handler to update the item (or cancel it)\n const itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset\n this.options.onUpdate(itemData, itemData => {\n if (itemData) {\n me.itemsData.getDataSet().update(itemData);\n }\n });\n }\n }\n\n /**\n * Handle drop event of data on item\n * Only called when `objectData.target === 'item'.\n * @param {Event} event The event \n * @private\n */\n _onDropObjectOnItem(event) {\n const item = this.itemFromTarget(event);\n const objectData = JSON.parse(event.dataTransfer.getData(\"text\"));\n this.options.onDropObjectOnItem(objectData, item)\n }\n\n /**\n * Handle creation of an item on double tap or drop of a drag event\n * @param {Event} event The event\n * @private\n */\n _onAddItem(event) {\n if (!this.options.selectable) return;\n if (!this.options.editable.add) return;\n\n const me = this;\n const snap = this.options.snap || null;\n\n // add item\n const frameRect = this.dom.frame.getBoundingClientRect()\n const x = this.options.rtl ? frameRect.right - event.center.x : event.center.x - frameRect.left;\n const start = this.body.util.toTime(x);\n const scale = this.body.util.getScale();\n const step = this.body.util.getStep();\n let end;\n\n let newItemData;\n if (event.type == 'drop') {\n newItemData = JSON.parse(event.dataTransfer.getData(\"text\"));\n newItemData.content = newItemData.content ? newItemData.content : 'new item';\n newItemData.start = newItemData.start ? newItemData.start : (snap ? snap(start, scale, step) : start);\n newItemData.type = newItemData.type || 'box';\n newItemData[this.itemsData._idProp] = newItemData.id || util.randomUUID();\n\n if (newItemData.type == 'range' && !newItemData.end) {\n end = this.body.util.toTime(x + this.props.width / 5);\n newItemData.end = snap ? snap(end, scale, step) : end;\n }\n } else {\n newItemData = {\n start: snap ? snap(start, scale, step) : start,\n content: 'new item'\n };\n newItemData[this.itemsData._idProp] = util.randomUUID();\n\n // when default type is a range, add a default end date to the new item\n if (this.options.type === 'range') {\n end = this.body.util.toTime(x + this.props.width / 5);\n newItemData.end = snap ? snap(end, scale, step) : end;\n }\n }\n\n const group = this.groupFromTarget(event);\n if (group) {\n newItemData.group = group.groupId;\n }\n\n // execute async handler to customize (or cancel) adding an item\n newItemData = this._cloneItemData(newItemData); // convert start and end to the correct type\n this.options.onAdd(newItemData, item => {\n if (item) {\n me.itemsData.getDataSet().add(item);\n if (event.type == 'drop') {\n me.setSelection([item.id]);\n }\n // TODO: need to trigger a redraw?\n }\n });\n }\n\n /**\n * Handle selecting/deselecting multiple items when holding an item\n * @param {Event} event\n * @private\n */\n _onMultiSelectItem(event) {\n if (!this.options.selectable) return;\n\n const item = this.itemFromTarget(event);\n\n if (item) {\n // multi select items (if allowed)\n\n let selection = this.options.multiselect\n ? this.getSelection() // take current selection\n : []; // deselect current selection\n\n const shiftKey = event.srcEvent && event.srcEvent.shiftKey || false;\n\n if ((shiftKey || this.options.sequentialSelection) && this.options.multiselect) {\n // select all items between the old selection and the tapped item\n const itemGroup = this.itemsData.get(item.id).group;\n\n // when filtering get the group of the last selected item\n let lastSelectedGroup = undefined;\n if (this.options.multiselectPerGroup) {\n if (selection.length > 0) {\n lastSelectedGroup = this.itemsData.get(selection[0]).group;\n }\n }\n\n // determine the selection range\n if (!this.options.multiselectPerGroup || lastSelectedGroup == undefined || lastSelectedGroup == itemGroup) {\n selection.push(item.id);\n }\n const range = ItemSet._getItemRange(this.itemsData.get(selection, this.itemOptions));\n \n if (!this.options.multiselectPerGroup || lastSelectedGroup == itemGroup) {\n // select all items within the selection range\n selection = [];\n for (const id in this.items) {\n if (this.items.hasOwnProperty(id)) {\n const _item = this.items[id];\n const start = _item.data.start;\n const end = (_item.data.end !== undefined) ? _item.data.end : start;\n\n if (start >= range.min &&\n end <= range.max &&\n (!this.options.multiselectPerGroup || lastSelectedGroup == this.itemsData.get(_item.id).group) &&\n !(_item instanceof BackgroundItem)) {\n selection.push(_item.id); // do not use id but item.id, id itself is stringified\n }\n }\n }\n }\n }\n else {\n // add/remove this item from the current selection\n const index = selection.indexOf(item.id);\n if (index == -1) {\n // item is not yet selected -> select it\n selection.push(item.id);\n }\n else {\n // item is already selected -> deselect it\n selection.splice(index, 1);\n }\n }\n\n const filteredSelection = selection.filter(item => this.getItemById(item).selectable);\n\n this.setSelection(filteredSelection);\n\n this.body.emitter.emit('select', {\n items: this.getSelection(),\n event\n });\n }\n }\n\n /**\n * Calculate the time range of a list of items\n * @param {Array.} itemsData\n * @return {{min: Date, max: Date}} Returns the range of the provided items\n * @private\n */\n static _getItemRange(itemsData) {\n let max = null;\n let min = null;\n\n itemsData.forEach(data => {\n if (min == null || data.start < min) {\n min = data.start;\n }\n\n if (data.end != undefined) {\n if (max == null || data.end > max) {\n max = data.end;\n }\n }\n else {\n if (max == null || data.start > max) {\n max = data.start;\n }\n }\n });\n\n return {\n min,\n max\n }\n }\n\n /**\n * Find an item from an element:\n * searches for the attribute 'vis-item' in the element's tree\n * @param {HTMLElement} element\n * @return {Item | null} item\n */\n itemFromElement(element) {\n let cur = element;\n while (cur) {\n if (cur.hasOwnProperty('vis-item')) {\n return cur['vis-item'];\n }\n cur = cur.parentNode;\n }\n\n return null;\n }\n\n /**\n * Find an item from an event target:\n * searches for the attribute 'vis-item' in the event target's element tree\n * @param {Event} event\n * @return {Item | null} item\n */\n itemFromTarget(event) {\n return this.itemFromElement(event.target);\n }\n\n /**\n * Find an item from an event's related target:\n * searches for the attribute 'vis-item' in the related target's element tree\n * @param {Event} event\n * @return {Item | null} item\n */\n itemFromRelatedTarget(event) {\n return this.itemFromElement(event.relatedTarget);\n }\n\n /**\n * Find the Group from an event target:\n * searches for the attribute 'vis-group' in the event target's element tree\n * @param {Event} event\n * @return {Group | null} group\n */\n groupFromTarget(event) {\n const clientY = event.center ? event.center.y : event.clientY;\n let groupIds = this.groupIds;\n \n if (groupIds.length <= 0 && this.groupsData) {\n groupIds = this.groupsData.getIds({\n order: this.options.groupOrder\n });\n }\n \n for (let i = 0; i < groupIds.length; i++) {\n const groupId = groupIds[i];\n const group = this.groups[groupId];\n const foreground = group.dom.foreground;\n const foregroundRect = foreground.getBoundingClientRect()\n if (clientY >= foregroundRect.top && clientY < foregroundRect.top + foreground.offsetHeight) {\n return group;\n }\n\n if (this.options.orientation.item === 'top') {\n if (i === this.groupIds.length - 1 && clientY > foregroundRect.top) {\n return group;\n }\n }\n else {\n if (i === 0 && clientY < foregroundRect.top + foreground.offset) {\n return group;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Find the ItemSet from an event target:\n * searches for the attribute 'vis-itemset' in the event target's element tree\n * @param {Event} event\n * @return {ItemSet | null} item\n */\n static itemSetFromTarget(event) {\n let target = event.target;\n while (target) {\n if (target.hasOwnProperty('vis-itemset')) {\n return target['vis-itemset'];\n }\n target = target.parentNode;\n }\n\n return null;\n }\n\n /**\n * Clone the data of an item, and \"normalize\" it: convert the start and end date\n * to the type (Date, Moment, ...) configured in the DataSet. If not configured,\n * start and end are converted to Date.\n * @param {Object} itemData, typically `item.data`\n * @param {string} [type] Optional Date type. If not provided, the type from the DataSet is taken\n * @return {Object} The cloned object\n * @private\n */\n _cloneItemData(itemData, type) {\n const clone = util.extend({}, itemData);\n\n if (!type) {\n // convert start and end date to the type (Date, Moment, ...) configured in the DataSet\n type = this.itemsData.getDataSet()._options.type;\n }\n\n if (clone.start != undefined) {\n clone.start = util.convert(clone.start, type && type.start || 'Date');\n }\n if (clone.end != undefined) {\n clone.end = util.convert(clone.end , type && type.end || 'Date');\n }\n\n return clone;\n }\n\n /**\n * cluster items\n * @return {void} \n * @private\n */\n _clusterItems() {\n if (!this.options.cluster) {\n return;\n }\n\n const { scale } = this.body.range.conversion(this.body.domProps.center.width);\n const clusters = this.clusterGenerator.getClusters(this.clusters, scale, this.options.cluster);\n\n if (this.clusters != clusters) {\n this._detachAllClusters();\n\n if (clusters) {\n for (let cluster of clusters) {\n cluster.attach();\n }\n this.clusters = clusters;\n }\n\n this._updateClusters(clusters);\n }\n }\n\n /**\n * detach all cluster items\n * @private\n */\n _detachAllClusters() {\n if (this.options.cluster) {\n if (this.clusters && this.clusters.length) {\n for (let cluster of this.clusters) {\n cluster.detach();\n }\n }\n }\n }\n\n /**\n * update clusters\n * @param {array} clusters\n * @private\n */\n _updateClusters(clusters) {\n if (this.clusters && this.clusters.length) {\n const newClustersIds = new Set(clusters.map(cluster => cluster.id));\n const clustersToUnselect = this.clusters.filter(cluster => !newClustersIds.has(cluster.id));\n let selectionChanged = false;\n for (let cluster of clustersToUnselect) {\n const selectedIdx = this.selection.indexOf(cluster.id);\n if (selectedIdx !== -1) {\n cluster.unselect();\n this.selection.splice(selectedIdx, 1);\n selectionChanged = true;\n }\n }\n\n if (selectionChanged) {\n const newSelection = this.getSelection();\n this.body.emitter.emit('select', {\n items: newSelection,\n event: event\n });\n }\n }\n\n this.clusters = clusters || [];\n }\n}\n\n// available item types will be registered here\nItemSet.types = {\n background: BackgroundItem,\n box: BoxItem,\n range: RangeItem,\n point: PointItem\n};\n\n/**\n * Handle added items\n * @param {number[]} ids\n * @protected\n */\nItemSet.prototype._onAdd = ItemSet.prototype._onUpdate;\n\nexport default ItemSet;\n","import util from '../util';\n\nlet errorFound = false;\nlet allOptions;\nlet printStyle = 'background: #FFeeee; color: #dd0000';\n/**\n * Used to validate options.\n */\nclass Validator {\n /**\n * @ignore\n */\n constructor() {\n }\n\n /**\n * Main function to be called\n * @param {Object} options\n * @param {Object} referenceOptions\n * @param {Object} subObject\n * @returns {boolean}\n * @static\n */\n static validate(options, referenceOptions, subObject) {\n errorFound = false;\n allOptions = referenceOptions;\n let usedOptions = referenceOptions;\n if (subObject !== undefined) {\n usedOptions = referenceOptions[subObject];\n }\n Validator.parse(options, usedOptions, []);\n return errorFound;\n }\n\n\n /**\n * Will traverse an object recursively and check every value\n * @param {Object} options\n * @param {Object} referenceOptions\n * @param {array} path | where to look for the actual option\n * @static\n */\n static parse(options, referenceOptions, path) {\n for (let option in options) {\n if (options.hasOwnProperty(option)) {\n Validator.check(option, options, referenceOptions, path);\n }\n }\n }\n\n\n /**\n * Check every value. If the value is an object, call the parse function on that object.\n * @param {string} option\n * @param {Object} options\n * @param {Object} referenceOptions\n * @param {array} path | where to look for the actual option\n * @static\n */\n static check(option, options, referenceOptions, path) {\n if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) {\n Validator.getSuggestion(option, referenceOptions, path);\n return;\n }\n\n let referenceOption = option;\n let is_object = true;\n\n if (referenceOptions[option] === undefined && referenceOptions.__any__ !== undefined) {\n // NOTE: This only triggers if the __any__ is in the top level of the options object.\n // THAT'S A REALLY BAD PLACE TO ALLOW IT!!!!\n // TODO: Examine if needed, remove if possible\n\n // __any__ is a wildcard. Any value is accepted and will be further analysed by reference.\n referenceOption = '__any__';\n\n // if the any-subgroup is not a predefined object in the configurator,\n // we do not look deeper into the object.\n is_object = (Validator.getType(options[option]) === 'object');\n }\n else {\n // Since all options in the reference are objects, we can check whether \n // they are supposed to be the object to look for the __type__ field.\n // if this is an object, we check if the correct type has been supplied to account for shorthand options.\n }\n\n let refOptionObj = referenceOptions[referenceOption];\n if (is_object && refOptionObj.__type__ !== undefined) {\n refOptionObj = refOptionObj.__type__;\n }\n\n Validator.checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path);\n }\n\n /**\n *\n * @param {string} option | the option property\n * @param {Object} options | The supplied options object\n * @param {Object} referenceOptions | The reference options containing all options and their allowed formats\n * @param {string} referenceOption | Usually this is the same as option, except when handling an __any__ tag.\n * @param {string} refOptionObj | This is the type object from the reference options\n * @param {Array} path | where in the object is the option\n * @static\n */\n static checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) {\n let log = function(message) {\n console.log('%c' + message + Validator.printLocation(path, option), printStyle);\n };\n\n let optionType = Validator.getType(options[option]);\n let refOptionType = refOptionObj[optionType];\n\n if (refOptionType !== undefined) {\n // if the type is correct, we check if it is supposed to be one of a few select values\n if (Validator.getType(refOptionType) === 'array' && refOptionType.indexOf(options[option]) === -1) {\n log('Invalid option detected in \"' + option + '\".' +\n ' Allowed values are:' + Validator.print(refOptionType) +\n ' not \"' + options[option] + '\". ');\n errorFound = true;\n }\n else if (optionType === 'object' && referenceOption !== \"__any__\") {\n path = util.copyAndExtendArray(path, option);\n Validator.parse(options[option], referenceOptions[referenceOption], path);\n }\n }\n else if (refOptionObj['any'] === undefined) {\n // type of the field is incorrect and the field cannot be any\n log('Invalid type received for \"' + option +\n '\". Expected: ' + Validator.print(Object.keys(refOptionObj)) +\n '. Received [' + optionType + '] \"' + options[option] + '\"');\n errorFound = true;\n }\n }\n\n /**\n *\n * @param {Object|boolean|number|string|Array.|Date|Node|Moment|undefined|null} object\n * @returns {string}\n * @static\n */\n static getType(object) {\n var type = typeof object;\n\n if (type === 'object') {\n if (object === null) {\n return 'null';\n }\n if (object instanceof Boolean) {\n return 'boolean';\n }\n if (object instanceof Number) {\n return 'number';\n }\n if (object instanceof String) {\n return 'string';\n }\n if (Array.isArray(object)) {\n return 'array';\n }\n if (object instanceof Date) {\n return 'date';\n }\n if (object.nodeType !== undefined) {\n return 'dom';\n }\n if (object._isAMomentObject === true) {\n return 'moment';\n }\n return 'object';\n }\n else if (type === 'number') {\n return 'number';\n }\n else if (type === 'boolean') {\n return 'boolean';\n }\n else if (type === 'string') {\n return 'string';\n }\n else if (type === undefined) {\n return 'undefined';\n }\n return type;\n }\n\n /**\n * @param {string} option\n * @param {Object} options\n * @param {Array.} path\n * @static\n */\n static getSuggestion(option, options, path) {\n let localSearch = Validator.findInOptions(option,options,path,false);\n let globalSearch = Validator.findInOptions(option,allOptions,[],true);\n\n let localSearchThreshold = 8;\n let globalSearchThreshold = 4;\n\n let msg;\n if (localSearch.indexMatch !== undefined) {\n msg = ' in ' + Validator.printLocation(localSearch.path, option,'') +\n 'Perhaps it was incomplete? Did you mean: \"' + localSearch.indexMatch + '\"?\\n\\n';\n }\n else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {\n msg = ' in ' + Validator.printLocation(localSearch.path, option,'') +\n 'Perhaps it was misplaced? Matching option found at: ' +\n Validator.printLocation(globalSearch.path, globalSearch.closestMatch,'');\n }\n else if (localSearch.distance <= localSearchThreshold) {\n msg = '. Did you mean \"' + localSearch.closestMatch + '\"?' +\n Validator.printLocation(localSearch.path, option);\n }\n else {\n msg = '. Did you mean one of these: ' + Validator.print(Object.keys(options)) +\n Validator.printLocation(path, option);\n }\n\n console.log('%cUnknown option detected: \"' + option + '\"' + msg, printStyle);\n errorFound = true;\n }\n\n /**\n * traverse the options in search for a match.\n * @param {string} option\n * @param {Object} options\n * @param {Array} path | where to look for the actual option\n * @param {boolean} [recursive=false]\n * @returns {{closestMatch: string, path: Array, distance: number}}\n * @static\n */\n static findInOptions(option, options, path, recursive = false) {\n let min = 1e9;\n let closestMatch = '';\n let closestMatchPath = [];\n let lowerCaseOption = option.toLowerCase();\n let indexMatch = undefined;\n for (let op in options) { // eslint-disable-line guard-for-in\n let distance;\n if (options[op].__type__ !== undefined && recursive === true) {\n let result = Validator.findInOptions(option, options[op], util.copyAndExtendArray(path,op));\n if (min > result.distance) {\n closestMatch = result.closestMatch;\n closestMatchPath = result.path;\n min = result.distance;\n indexMatch = result.indexMatch;\n }\n }\n else {\n if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {\n indexMatch = op;\n }\n distance = Validator.levenshteinDistance(option, op);\n if (min > distance) {\n closestMatch = op;\n closestMatchPath = util.copyArray(path);\n min = distance;\n }\n }\n }\n return {closestMatch:closestMatch, path:closestMatchPath, distance:min, indexMatch: indexMatch};\n }\n\n /**\n * @param {Array.} path\n * @param {Object} option\n * @param {string} prefix\n * @returns {String}\n * @static\n */\n static printLocation(path, option, prefix = 'Problem value found at: \\n') {\n let str = '\\n\\n' + prefix + 'options = {\\n';\n for (let i = 0; i < path.length; i++) {\n for (let j = 0; j < i + 1; j++) {\n str += ' ';\n }\n str += path[i] + ': {\\n'\n }\n for (let j = 0; j < path.length + 1; j++) {\n str += ' ';\n }\n str += option + '\\n';\n for (let i = 0; i < path.length + 1; i++) {\n for (let j = 0; j < path.length - i; j++) {\n str += ' ';\n }\n str += '}\\n'\n }\n return str + '\\n\\n';\n }\n\n /**\n * @param {Object} options\n * @returns {String}\n * @static\n */\n static print(options) {\n return JSON.stringify(options).replace(/(\\\")|(\\[)|(\\])|(,\"__type__\")/g, \"\").replace(/(\\,)/g, ', ')\n }\n\n\n /**\n * Compute the edit distance between the two given strings\n * http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript\n *\n * Copyright (c) 2011 Andrei Mackenzie\n *\n * 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:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * 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.\n *\n * @param {string} a\n * @param {string} b\n * @returns {Array.>}}\n * @static\n */\n static levenshteinDistance(a, b) {\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n\n var matrix = [];\n\n // increment along the first column of each row\n var i;\n for (i = 0; i <= b.length; i++) {\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n var j;\n for (j = 0; j <= a.length; j++) {\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for (i = 1; i <= b.length; i++) {\n for (j = 1; j <= a.length; j++) {\n if (b.charAt(i - 1) == a.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n } else {\n matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution\n Math.min(matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j] + 1)); // deletion\n }\n }\n }\n\n return matrix[b.length][a.length];\n }\n}\n\n\nexport {\n Validator,\n printStyle\n};\n","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = 'string';\nlet bool = 'boolean';\nlet number = 'number';\nlet array = 'array';\nlet date = 'date';\nlet object = 'object'; // should only be in a __type__ property\nlet dom = 'dom';\nlet moment = 'moment';\nlet any = 'any';\n\nlet allOptions = {\n configure: {\n enabled: { 'boolean': bool},\n filter: { 'boolean': bool,'function': 'function'},\n container: {dom},\n __type__: {object, 'boolean': bool,'function': 'function'}\n },\n\n //globals :\n align: {string},\n alignCurrentTime: {string, 'undefined': 'undefined'},\n rtl: { 'boolean': bool, 'undefined': 'undefined'},\n rollingMode: {\n follow: { 'boolean': bool },\n offset: {number,'undefined': 'undefined'},\n __type__: {object}\n },\n onTimeout: {\n timeoutMs: {number},\n callback: {'function': 'function'},\n __type__: {object}\n },\n verticalScroll: { 'boolean': bool, 'undefined': 'undefined'},\n horizontalScroll: { 'boolean': bool, 'undefined': 'undefined'},\n autoResize: { 'boolean': bool},\n throttleRedraw: {number}, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511\n clickToUse: { 'boolean': bool},\n dataAttributes: {string, array},\n editable: {\n add: { 'boolean': bool, 'undefined': 'undefined'},\n remove: { 'boolean': bool, 'undefined': 'undefined'},\n updateGroup: { 'boolean': bool, 'undefined': 'undefined'},\n updateTime: { 'boolean': bool, 'undefined': 'undefined'},\n overrideItems: { 'boolean': bool, 'undefined': 'undefined'},\n __type__: { 'boolean': bool, object}\n },\n end: {number, date, string, moment},\n format: {\n minorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n week: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object, 'function': 'function'}\n },\n majorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n week: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object, 'function': 'function'}\n },\n __type__: {object}\n },\n moment: {'function': 'function'},\n groupHeightMode: {string},\n groupOrder: {string, 'function': 'function'},\n groupEditable: {\n add: { 'boolean': bool, 'undefined': 'undefined'},\n remove: { 'boolean': bool, 'undefined': 'undefined'},\n order: { 'boolean': bool, 'undefined': 'undefined'},\n __type__: { 'boolean': bool, object}\n },\n groupOrderSwap: {'function': 'function'},\n height: {string, number},\n hiddenDates: {\n start: {date, number, string, moment},\n end: {date, number, string, moment},\n repeat: {string},\n __type__: {object, array}\n },\n itemsAlwaysDraggable: {\n item: { 'boolean': bool, 'undefined': 'undefined'},\n range: { 'boolean': bool, 'undefined': 'undefined'},\n __type__: { 'boolean': bool, object}\n },\n limitSize: {'boolean': bool},\n locale:{string},\n locales:{\n __any__: {any},\n __type__: {object}\n },\n margin: {\n axis: {number},\n item: {\n horizontal: {number,'undefined': 'undefined'},\n vertical: {number,'undefined': 'undefined'},\n __type__: {object,number}\n },\n __type__: {object,number}\n },\n max: {date, number, string, moment},\n maxHeight: {number, string},\n maxMinorChars: {number},\n min: {date, number, string, moment},\n minHeight: {number, string},\n moveable: { 'boolean': bool},\n multiselect: { 'boolean': bool},\n multiselectPerGroup: { 'boolean': bool},\n onAdd: {'function': 'function'},\n onDropObjectOnItem: {'function': 'function'},\n onUpdate: {'function': 'function'},\n onMove: {'function': 'function'},\n onMoving: {'function': 'function'},\n onRemove: {'function': 'function'},\n onAddGroup: {'function': 'function'},\n onMoveGroup: {'function': 'function'},\n onRemoveGroup: {'function': 'function'},\n onInitialDrawComplete: {'function': 'function'},\n order: {'function': 'function'},\n orientation: {\n axis: {string,'undefined': 'undefined'},\n item: {string,'undefined': 'undefined'},\n __type__: {string, object}\n },\n selectable: { 'boolean': bool},\n sequentialSelection: { 'boolean': bool },\n showCurrentTime: { 'boolean': bool},\n showMajorLabels: { 'boolean': bool},\n showMinorLabels: { 'boolean': bool},\n stack: { 'boolean': bool},\n stackSubgroups: { 'boolean': bool},\n cluster: { \n maxItems: {'number': number, 'undefined': 'undefined'},\n titleTemplate: {'string': string, 'undefined': 'undefined'},\n clusterCriteria: { 'function': 'function', 'undefined': 'undefined'},\n showStipes: {'boolean': bool, 'undefined': 'undefined'},\n fitOnDoubleClick: {'boolean': bool, 'undefined': 'undefined'},\n __type__: {'boolean': bool, object}\n },\n snap: {'function': 'function', 'null': 'null'},\n start: {date, number, string, moment},\n template: {'function': 'function'},\n loadingScreenTemplate: {'function': 'function'},\n groupTemplate: {'function': 'function'},\n visibleFrameTemplate: {string, 'function': 'function'},\n showTooltips: { 'boolean': bool},\n tooltip: {\n followMouse: { 'boolean': bool },\n overflowMethod: { 'string': ['cap', 'flip', 'none'] },\n delay: {number},\n template: {'function': 'function'},\n __type__: {object}\n },\n tooltipOnItemUpdateTime: {\n template: {'function': 'function'},\n __type__: { 'boolean': bool, object}\n },\n timeAxis: {\n scale: {string,'undefined': 'undefined'},\n step: {number,'undefined': 'undefined'},\n __type__: {object}\n },\n type: {string},\n width: {string, number},\n preferZoom: { 'boolean': bool},\n zoomable: { 'boolean': bool},\n zoomKey: {string: ['ctrlKey', 'altKey', 'shiftKey', 'metaKey', '']},\n zoomFriction: {number},\n zoomMax: {number},\n zoomMin: {number},\n\n __type__: {object}\n};\n\nlet configureOptions = {\n global: {\n align: ['center', 'left', 'right'],\n alignCurrentTime: ['none', 'year', 'month', 'quarter', 'week', 'isoWeek', 'day', 'date', 'hour', 'minute', 'second'],\n direction: false,\n autoResize: true,\n clickToUse: false,\n // dataAttributes: ['all'], // FIXME: can be 'all' or string[]\n editable: {\n add: false,\n remove: false,\n updateGroup: false,\n updateTime: false\n },\n end: '',\n format: {\n minorLabels: {\n millisecond:'SSS',\n second: 's',\n minute: 'HH:mm',\n hour: 'HH:mm',\n weekday: 'ddd D',\n day: 'D',\n week: 'w',\n month: 'MMM',\n year: 'YYYY'\n },\n majorLabels: {\n millisecond:'HH:mm:ss',\n second: 'D MMMM HH:mm',\n minute: 'ddd D MMMM',\n hour: 'ddd D MMMM',\n weekday: 'MMMM YYYY',\n day: 'MMMM YYYY',\n week: 'MMMM YYYY',\n month: 'YYYY',\n year: ''\n }\n },\n groupHeightMode: ['auto', 'fixed', 'fitItems'],\n //groupOrder: {string, 'function': 'function'},\n groupsDraggable: false,\n height: '',\n //hiddenDates: {object, array},\n locale: '',\n margin: {\n axis: [20, 0, 100, 1],\n item: {\n horizontal: [10, 0, 100, 1],\n vertical: [10, 0, 100, 1]\n }\n },\n max: '',\n maxHeight: '',\n maxMinorChars: [7, 0, 20, 1],\n min: '',\n minHeight: '',\n moveable: false,\n multiselect: false,\n multiselectPerGroup: false,\n //onAdd: {'function': 'function'},\n //onUpdate: {'function': 'function'},\n //onMove: {'function': 'function'},\n //onMoving: {'function': 'function'},\n //onRename: {'function': 'function'},\n //order: {'function': 'function'},\n orientation: {\n axis: ['both', 'bottom', 'top'],\n item: ['bottom', 'top']\n },\n preferZoom: false,\n selectable: true,\n showCurrentTime: false,\n showMajorLabels: true,\n showMinorLabels: true,\n stack: true,\n stackSubgroups: true,\n cluster: false,\n //snap: {'function': 'function', nada},\n start: '',\n //template: {'function': 'function'},\n //timeAxis: {\n // scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'],\n // step: [1, 1, 10, 1]\n //},\n showTooltips: true,\n tooltip: {\n followMouse: false,\n overflowMethod: 'flip',\n delay: [500, 0, 99999, 100],\n },\n tooltipOnItemUpdateTime: false,\n type: ['box', 'point', 'range', 'background'],\n width: '100%',\n zoomable: true,\n zoomKey: ['ctrlKey', 'altKey', 'shiftKey', 'metaKey', ''],\n zoomMax: [315360000000000, 10, 315360000000000, 1],\n zoomMin: [10, 10, 315360000000000, 1]\n }\n};\n\nexport {allOptions, configureOptions};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","var $ = require('../internals/export');\nvar fill = require('../internals/array-fill');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.fill` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\n$({ target: 'Array', proto: true }, {\n fill: fill\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('fill');\n","require('../../../modules/es.array.fill');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').fill;\n","var fill = require('../array/virtual/fill');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.fill;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.fill) ? fill : own;\n};\n","module.exports = require('../../es/instance/fill');\n","module.exports = require(\"core-js-pure/stable/instance/fill\");","import Hammer from '../module/hammer';\nimport * as hammerUtil from '../hammerUtil';\nimport util from '../util';\n\n\nvar 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'};\n\n/**\n * @param {number} [pixelRatio=1]\n */\nclass ColorPicker {\n /**\n * @param {number} [pixelRatio=1]\n */\n constructor(pixelRatio = 1) {\n this.pixelRatio = pixelRatio;\n this.generated = false;\n this.centerCoordinates = {x:289/2, y:289/2};\n this.r = 289 * 0.49;\n this.color = {r:255,g:255,b:255,a:1.0};\n this.hueCircle = undefined;\n this.initialColor = {r:255,g:255,b:255,a:1.0};\n this.previousColor= undefined;\n this.applied = false;\n\n // bound by\n this.updateCallback = () => {};\n this.closeCallback = () => {};\n\n // create all DOM elements\n this._create();\n }\n\n\n /**\n * this inserts the colorPicker into a div from the DOM\n * @param {Element} container\n */\n insertTo(container) {\n if (this.hammer !== undefined) {\n this.hammer.destroy();\n this.hammer = undefined;\n }\n this.container = container;\n this.container.appendChild(this.frame);\n this._bindHammer();\n\n this._setSize();\n }\n\n /**\n * the callback is executed on apply and save. Bind it to the application\n * @param {function} callback\n */\n setUpdateCallback(callback) {\n if (typeof callback === 'function') {\n this.updateCallback = callback;\n }\n else {\n throw new Error(\"Function attempted to set as colorPicker update callback is not a function.\");\n }\n }\n\n /**\n * the callback is executed on apply and save. Bind it to the application\n * @param {function} callback\n */\n setCloseCallback(callback) {\n if (typeof callback === 'function') {\n this.closeCallback = callback;\n }\n else {\n throw new Error(\"Function attempted to set as colorPicker closing callback is not a function.\");\n }\n }\n\n /**\n *\n * @param {string} color\n * @returns {String}\n * @private\n */\n _isColorString(color) {\n if (typeof color === 'string') {\n return htmlColors[color];\n }\n }\n\n\n /**\n * Set the color of the colorPicker\n * Supported formats:\n * 'red' --> HTML color string\n * '#ffffff' --> hex string\n * 'rgb(255,255,255)' --> rgb string\n * 'rgba(255,255,255,1.0)' --> rgba string\n * {r:255,g:255,b:255} --> rgb object\n * {r:255,g:255,b:255,a:1.0} --> rgba object\n * @param {string|Object} color\n * @param {boolean} [setInitial=true]\n */\n setColor(color, setInitial = true) {\n if (color === 'none') {\n return;\n }\n\n let rgba;\n\n // if a html color shorthand is used, convert to hex\n var htmlColor = this._isColorString(color);\n if (htmlColor !== undefined) {\n color = htmlColor;\n }\n\n // check format\n if (util.isString(color) === true) {\n if (util.isValidRGB(color) === true) {\n let rgbaArray = color.substr(4).substr(0, color.length - 5).split(',');\n rgba = {r:rgbaArray[0], g:rgbaArray[1], b:rgbaArray[2], a:1.0};\n }\n else if (util.isValidRGBA(color) === true) {\n let rgbaArray = color.substr(5).substr(0, color.length - 6).split(',');\n rgba = {r:rgbaArray[0], g:rgbaArray[1], b:rgbaArray[2], a:rgbaArray[3]};\n }\n else if (util.isValidHex(color) === true) {\n let rgbObj = util.hexToRGB(color);\n rgba = {r:rgbObj.r, g:rgbObj.g, b:rgbObj.b, a:1.0};\n }\n }\n else {\n if (color instanceof Object) {\n if (color.r !== undefined && color.g !== undefined && color.b !== undefined) {\n let alpha = color.a !== undefined ? color.a : '1.0';\n rgba = {r:color.r, g:color.g, b:color.b, a:alpha};\n }\n }\n }\n\n // set color\n if (rgba === undefined) {\n throw new Error(\"Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: \" + JSON.stringify(color));\n }\n else {\n this._setColor(rgba, setInitial);\n }\n }\n\n\n /**\n * this shows the color picker.\n * The hue circle is constructed once and stored.\n */\n show() {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n\n this.applied = false;\n this.frame.style.display = 'block';\n this._generateHueCircle();\n }\n\n // ------------------------------------------ PRIVATE ----------------------------- //\n\n /**\n * Hide the picker. Is called by the cancel button.\n * Optional boolean to store the previous color for easy access later on.\n * @param {boolean} [storePrevious=true]\n * @private\n */\n _hide(storePrevious = true) {\n // store the previous color for next time;\n if (storePrevious === true) {\n this.previousColor = util.extend({}, this.color);\n }\n\n if (this.applied === true) {\n this.updateCallback(this.initialColor);\n }\n\n this.frame.style.display = 'none';\n\n // call the closing callback, restoring the onclick method.\n // this is in a setTimeout because it will trigger the show again before the click is done.\n setTimeout(() => {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n },0);\n }\n\n\n /**\n * bound to the save button. Saves and hides.\n * @private\n */\n _save() {\n this.updateCallback(this.color);\n this.applied = false;\n this._hide();\n }\n\n\n /**\n * Bound to apply button. Saves but does not close. Is undone by the cancel button.\n * @private\n */\n _apply() {\n this.applied = true;\n this.updateCallback(this.color);\n this._updatePicker(this.color);\n }\n\n\n /**\n * load the color from the previous session.\n * @private\n */\n _loadLast() {\n if (this.previousColor !== undefined) {\n this.setColor(this.previousColor, false);\n }\n else {\n alert(\"There is no last color to load...\");\n }\n }\n\n\n /**\n * set the color, place the picker\n * @param {Object} rgba\n * @param {boolean} [setInitial=true]\n * @private\n */\n _setColor(rgba, setInitial = true) {\n // store the initial color\n if (setInitial === true) {\n this.initialColor = util.extend({}, rgba);\n }\n\n this.color = rgba;\n let hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);\n\n let angleConvert = 2 * Math.PI;\n let radius = this.r * hsv.s;\n let x = this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);\n let y = this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);\n\n this.colorPickerSelector.style.left = x - 0.5 * this.colorPickerSelector.clientWidth + 'px';\n this.colorPickerSelector.style.top = y - 0.5 * this.colorPickerSelector.clientHeight + 'px';\n\n this._updatePicker(rgba);\n }\n\n\n /**\n * bound to opacity control\n * @param {number} value\n * @private\n */\n _setOpacity(value) {\n this.color.a = value / 100;\n this._updatePicker(this.color);\n }\n\n\n /**\n * bound to brightness control\n * @param {number} value\n * @private\n */\n _setBrightness(value) {\n let hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);\n hsv.v = value / 100;\n let rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);\n rgba['a'] = this.color.a;\n this.color = rgba;\n this._updatePicker();\n }\n\n\n /**\n * update the color picker. A black circle overlays the hue circle to mimic the brightness decreasing.\n * @param {Object} rgba\n * @private\n */\n _updatePicker(rgba = this.color) {\n let hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);\n let ctx = this.colorPickerCanvas.getContext('2d');\n if (this.pixelRation === undefined) {\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n let w = this.colorPickerCanvas.clientWidth;\n let h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n ctx.putImageData(this.hueCircle, 0,0);\n ctx.fillStyle = 'rgba(0,0,0,' + (1- hsv.v) + ')';\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.fill();\n\n this.brightnessRange.value = 100 * hsv.v;\n this.opacityRange.value = 100 * rgba.a;\n\n this.initialColorDiv.style.backgroundColor = 'rgba(' + this.initialColor.r + ',' + this.initialColor.g + ',' + this.initialColor.b + ',' + this.initialColor.a + ')';\n this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')';\n }\n\n\n /**\n * used by create to set the size of the canvas.\n * @private\n */\n _setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }\n\n\n /**\n * create all dom elements\n * TODO: cleanup, lots of similar dom elements\n * @private\n */\n _create() {\n this.frame = document.createElement('div');\n this.frame.className = 'vis-color-picker';\n\n this.colorPickerDiv = document.createElement('div');\n this.colorPickerSelector = document.createElement('div');\n this.colorPickerSelector.className = 'vis-selector';\n this.colorPickerDiv.appendChild(this.colorPickerSelector);\n\n this.colorPickerCanvas = document.createElement('canvas');\n this.colorPickerDiv.appendChild(this.colorPickerCanvas);\n\n if (!this.colorPickerCanvas.getContext) {\n let noCanvas = document.createElement( 'DIV' );\n noCanvas.style.color = 'red';\n noCanvas.style.fontWeight = 'bold' ;\n noCanvas.style.padding = '10px';\n noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';\n this.colorPickerCanvas.appendChild(noCanvas);\n }\n else {\n let ctx = this.colorPickerCanvas.getContext(\"2d\");\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n this.colorPickerCanvas.getContext(\"2d\").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n\n this.colorPickerDiv.className = 'vis-color';\n\n this.opacityDiv = document.createElement('div');\n this.opacityDiv.className = 'vis-opacity';\n\n this.brightnessDiv = document.createElement('div');\n this.brightnessDiv.className = 'vis-brightness';\n\n this.arrowDiv = document.createElement('div');\n this.arrowDiv.className = 'vis-arrow';\n\n this.opacityRange = document.createElement('input');\n try {\n this.opacityRange.type = 'range'; // Not supported on IE9\n this.opacityRange.min = '0';\n this.opacityRange.max = '100';\n }\n // TODO: Add some error handling and remove this lint exception\n catch (err) {} // eslint-disable-line no-empty\n this.opacityRange.value = '100';\n this.opacityRange.className = 'vis-range';\n\n this.brightnessRange = document.createElement('input');\n try {\n this.brightnessRange.type = 'range'; // Not supported on IE9\n this.brightnessRange.min = '0';\n this.brightnessRange.max = '100';\n }\n // TODO: Add some error handling and remove this lint exception\n catch (err) {} // eslint-disable-line no-empty\n this.brightnessRange.value = '100';\n this.brightnessRange.className = 'vis-range';\n\n this.opacityDiv.appendChild(this.opacityRange);\n this.brightnessDiv.appendChild(this.brightnessRange);\n\n var me = this;\n this.opacityRange.onchange = function () {me._setOpacity(this.value);};\n this.opacityRange.oninput = function () {me._setOpacity(this.value);};\n this.brightnessRange.onchange = function () {me._setBrightness(this.value);};\n this.brightnessRange.oninput = function () {me._setBrightness(this.value);};\n\n this.brightnessLabel = document.createElement(\"div\");\n this.brightnessLabel.className = \"vis-label vis-brightness\";\n this.brightnessLabel.innerHTML = 'brightness:';\n\n this.opacityLabel = document.createElement(\"div\");\n this.opacityLabel.className = \"vis-label vis-opacity\";\n this.opacityLabel.innerHTML = 'opacity:';\n\n this.newColorDiv = document.createElement(\"div\");\n this.newColorDiv.className = \"vis-new-color\";\n this.newColorDiv.innerHTML = 'new';\n\n this.initialColorDiv = document.createElement(\"div\");\n this.initialColorDiv.className = \"vis-initial-color\";\n this.initialColorDiv.innerHTML = 'initial';\n\n this.cancelButton = document.createElement(\"div\");\n this.cancelButton.className = \"vis-button vis-cancel\";\n this.cancelButton.innerHTML = 'cancel';\n this.cancelButton.onclick = this._hide.bind(this, false);\n\n this.applyButton = document.createElement(\"div\");\n this.applyButton.className = \"vis-button vis-apply\";\n this.applyButton.innerHTML = 'apply';\n this.applyButton.onclick = this._apply.bind(this);\n\n this.saveButton = document.createElement(\"div\");\n this.saveButton.className = \"vis-button vis-save\";\n this.saveButton.innerHTML = 'save';\n this.saveButton.onclick = this._save.bind(this);\n\n this.loadButton = document.createElement(\"div\");\n this.loadButton.className = \"vis-button vis-load\";\n this.loadButton.innerHTML = 'load last';\n this.loadButton.onclick = this._loadLast.bind(this);\n\n this.frame.appendChild(this.colorPickerDiv);\n this.frame.appendChild(this.arrowDiv);\n this.frame.appendChild(this.brightnessLabel);\n this.frame.appendChild(this.brightnessDiv);\n this.frame.appendChild(this.opacityLabel);\n this.frame.appendChild(this.opacityDiv);\n this.frame.appendChild(this.newColorDiv);\n this.frame.appendChild(this.initialColorDiv);\n\n this.frame.appendChild(this.cancelButton);\n this.frame.appendChild(this.applyButton);\n this.frame.appendChild(this.saveButton);\n this.frame.appendChild(this.loadButton);\n }\n\n\n /**\n * bind hammer to the color picker\n * @private\n */\n _bindHammer() {\n this.drag = {};\n this.pinch = {};\n this.hammer = new Hammer(this.colorPickerCanvas);\n this.hammer.get('pinch').set({enable: true});\n\n hammerUtil.onTouch(this.hammer, (event) => {this._moveSelector(event)});\n this.hammer.on('tap', (event) => {this._moveSelector(event)});\n this.hammer.on('panstart', (event) => {this._moveSelector(event)});\n this.hammer.on('panmove', (event) => {this._moveSelector(event)});\n this.hammer.on('panend', (event) => {this._moveSelector(event)});\n }\n\n\n /**\n * generate the hue circle. This is relatively heavy (200ms) and is done only once on the first time it is shown.\n * @private\n */\n _generateHueCircle() {\n if (this.generated === false) {\n let ctx = this.colorPickerCanvas.getContext('2d');\n if (this.pixelRation === undefined) {\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n let w = this.colorPickerCanvas.clientWidth;\n let h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n\n // draw hue circle\n let x, y, hue, sat;\n this.centerCoordinates = {x: w * 0.5, y: h * 0.5};\n this.r = 0.49 * w;\n let angleConvert = (2 * Math.PI) / 360;\n let hfac = 1 / 360;\n let sfac = 1 / this.r;\n let rgb;\n for (hue = 0; hue < 360; hue++) {\n for (sat = 0; sat < this.r; sat++) {\n x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);\n y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);\n rgb = util.HSVToRGB(hue * hfac, sat * sfac, 1);\n ctx.fillStyle = 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';\n ctx.fillRect(x - 0.5, y - 0.5, 2, 2);\n }\n }\n ctx.strokeStyle = 'rgba(0,0,0,1)';\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.stroke();\n\n this.hueCircle = ctx.getImageData(0,0,w,h);\n }\n this.generated = true;\n }\n\n\n /**\n * move the selector. This is called by hammer functions.\n *\n * @param {Event} event The event\n * @private\n */\n _moveSelector(event) {\n let rect = this.colorPickerDiv.getBoundingClientRect();\n let left = event.center.x - rect.left;\n let top = event.center.y - rect.top;\n\n let centerY = 0.5 * this.colorPickerDiv.clientHeight;\n let centerX = 0.5 * this.colorPickerDiv.clientWidth;\n\n let x = left - centerX;\n let y = top - centerY;\n\n let angle = Math.atan2(x,y);\n let radius = 0.98 * Math.min(Math.sqrt(x * x + y * y), centerX);\n\n let newTop = Math.cos(angle) * radius + centerY;\n let newLeft = Math.sin(angle) * radius + centerX;\n\n this.colorPickerSelector.style.top = newTop - 0.5 * this.colorPickerSelector.clientHeight + 'px';\n this.colorPickerSelector.style.left = newLeft - 0.5 * this.colorPickerSelector.clientWidth + 'px';\n\n // set color\n let h = angle / (2 * Math.PI);\n h = h < 0 ? h + 1 : h;\n let s = radius / this.r;\n let hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);\n hsv.h = h;\n hsv.s = s;\n let rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);\n rgba['a'] = this.color.a;\n this.color = rgba;\n\n // update previews\n this.initialColorDiv.style.backgroundColor = 'rgba(' + this.initialColor.r + ',' + this.initialColor.g + ',' + this.initialColor.b + ',' + this.initialColor.a + ')';\n this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')';\n }\n}\n\nexport default ColorPicker;\n","import util from '../util';\nimport ColorPicker from './ColorPicker';\n\nimport './configuration.css';\n\n/**\n * 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.\n * Boolean options are recognised as Boolean\n * Number options should be written as array: [default value, min value, max value, stepsize]\n * Colors should be written as array: ['color', '#ffffff']\n * Strings with should be written as array: [option1, option2, option3, ..]\n *\n * The options are matched with their counterparts in each of the modules and the values used in the configuration are\n */\nclass Configurator {\n /**\n * @param {Object} parentModule | the location where parentModule.setOptions() can be called\n * @param {Object} defaultContainer | the default container of the module\n * @param {Object} configureOptions | the fully configured and predefined options set found in allOptions.js\n * @param {number} pixelRatio | canvas pixel ratio\n */\n constructor(parentModule, defaultContainer, configureOptions, pixelRatio = 1) {\n this.parent = parentModule;\n this.changedOptions = [];\n this.container = defaultContainer;\n this.allowCreation = false;\n\n this.options = {};\n this.initialized = false;\n this.popupCounter = 0;\n this.defaultOptions = {\n enabled: false,\n filter: true,\n container: undefined,\n showButton: true\n };\n util.extend(this.options, this.defaultOptions);\n\n this.configureOptions = configureOptions;\n this.moduleOptions = {};\n this.domElements = [];\n this.popupDiv = {};\n this.popupLimit = 5;\n this.popupHistory = {};\n this.colorPicker = new ColorPicker(pixelRatio);\n this.wrapper = undefined;\n }\n\n\n /**\n * refresh all options.\n * Because all modules parse their options by themselves, we just use their options. We copy them here.\n *\n * @param {Object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n // reset the popup history because the indices may have been changed.\n this.popupHistory = {};\n this._removePopup();\n\n let enabled = true;\n if (typeof options === 'string') {\n this.options.filter = options;\n }\n else if (options instanceof Array) {\n this.options.filter = options.join();\n }\n else if (typeof options === 'object') {\n if (options == null) {\n throw new TypeError('options cannot be null');\n }\n if (options.container !== undefined) {\n this.options.container = options.container;\n }\n if (options.filter !== undefined) {\n this.options.filter = options.filter;\n }\n if (options.showButton !== undefined) {\n this.options.showButton = options.showButton;\n }\n if (options.enabled !== undefined) {\n enabled = options.enabled;\n }\n }\n else if (typeof options === 'boolean') {\n this.options.filter = true;\n enabled = options;\n }\n else if (typeof options === 'function') {\n this.options.filter = options;\n enabled = true;\n }\n if (this.options.filter === false) {\n enabled = false;\n }\n\n this.options.enabled = enabled;\n }\n this._clean();\n }\n\n /**\n *\n * @param {Object} moduleOptions\n */\n setModuleOptions(moduleOptions) {\n this.moduleOptions = moduleOptions;\n if (this.options.enabled === true) {\n this._clean();\n if (this.options.container !== undefined) {\n this.container = this.options.container;\n }\n this._create();\n }\n }\n\n /**\n * Create all DOM elements\n * @private\n */\n _create() {\n this._clean();\n this.changedOptions = [];\n\n let filter = this.options.filter;\n let counter = 0;\n let show = false;\n for (let option in this.configureOptions) {\n if (this.configureOptions.hasOwnProperty(option)) {\n this.allowCreation = false;\n show = false;\n if (typeof filter === 'function') {\n show = filter(option,[]);\n show = show || this._handleObject(this.configureOptions[option], [option], true);\n }\n else if (filter === true || filter.indexOf(option) !== -1) {\n show = true;\n }\n\n if (show !== false) {\n this.allowCreation = true;\n\n // linebreak between categories\n if (counter > 0) {\n this._makeItem([]);\n }\n // a header for the category\n this._makeHeader(option);\n\n // get the sub options\n this._handleObject(this.configureOptions[option], [option]);\n }\n counter++;\n }\n }\n this._makeButton();\n this._push();\n //~ this.colorPicker.insertTo(this.container);\n }\n\n\n /**\n * draw all DOM elements on the screen\n * @private\n */\n _push() {\n this.wrapper = document.createElement('div');\n this.wrapper.className = 'vis-configuration-wrapper';\n this.container.appendChild(this.wrapper);\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.appendChild(this.domElements[i]);\n }\n\n this._showPopupIfNeeded()\n }\n\n\n /**\n * delete all DOM elements\n * @private\n */\n _clean() {\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }\n\n\n /**\n * get the value from the actualOptions if it exists\n * @param {array} path | where to look for the actual option\n * @returns {*}\n * @private\n */\n _getValue(path) {\n let base = this.moduleOptions;\n for (let i = 0; i < path.length; i++) {\n if (base[path[i]] !== undefined) {\n base = base[path[i]];\n }\n else {\n base = undefined;\n break;\n }\n }\n return base;\n }\n\n\n /**\n * all option elements are wrapped in an item\n * @param {Array} path | where to look for the actual option\n * @param {Array.} domElements\n * @returns {number}\n * @private\n */\n _makeItem(path, ...domElements) {\n if (this.allowCreation === true) {\n let item = document.createElement('div');\n item.className = 'vis-configuration vis-config-item vis-config-s' + path.length;\n domElements.forEach((element) => {\n item.appendChild(element);\n });\n this.domElements.push(item);\n return this.domElements.length;\n }\n return 0;\n }\n\n\n /**\n * header for major subjects\n * @param {string} name\n * @private\n */\n _makeHeader(name) {\n let div = document.createElement('div');\n div.className = 'vis-configuration vis-config-header';\n div.innerHTML = name;\n this._makeItem([],div);\n }\n\n\n /**\n * make a label, if it is an object label, it gets different styling.\n * @param {string} name\n * @param {array} path | where to look for the actual option\n * @param {string} objectLabel\n * @returns {HTMLElement}\n * @private\n */\n _makeLabel(name, path, objectLabel = false) {\n let div = document.createElement('div');\n div.className = 'vis-configuration vis-config-label vis-config-s' + path.length;\n if (objectLabel === true) {\n div.innerHTML = '' + name + ':';\n }\n else {\n div.innerHTML = name + ':';\n }\n return div;\n }\n\n\n /**\n * make a dropdown list for multiple possible string optoins\n * @param {Array.} arr\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _makeDropdown(arr, value, path) {\n let select = document.createElement('select');\n select.className = 'vis-configuration vis-config-select';\n let selectedValue = 0;\n if (value !== undefined) {\n if (arr.indexOf(value) !== -1) {\n selectedValue = arr.indexOf(value);\n }\n }\n\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement('option');\n option.value = arr[i];\n if (i === selectedValue) {\n option.selected = 'selected';\n }\n option.innerHTML = arr[i];\n select.appendChild(option);\n }\n\n let me = this;\n select.onchange = function () {me._update(this.value, path);};\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path, label, select);\n }\n\n\n /**\n * make a range object for numeric options\n * @param {Array.} arr\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _makeRange(arr, value, path) {\n let defaultValue = arr[0];\n let min = arr[1];\n let max = arr[2];\n let step = arr[3];\n let range = document.createElement('input');\n range.className = 'vis-configuration vis-config-range';\n try {\n range.type = 'range'; // not supported on IE9\n range.min = min;\n range.max = max;\n }\n // TODO: Add some error handling and remove this lint exception\n catch (err) {} // eslint-disable-line no-empty\n range.step = step;\n\n // set up the popup settings in case they are needed.\n let popupString = '';\n let popupValue = 0;\n\n if (value !== undefined) {\n let factor = 1.20;\n if (value < 0 && value * factor < min) {\n range.min = Math.ceil(value * factor);\n popupValue = range.min;\n popupString = 'range increased';\n }\n else if (value / factor < min) {\n range.min = Math.ceil(value / factor);\n popupValue = range.min;\n popupString = 'range increased';\n }\n if (value * factor > max && max !== 1) {\n range.max = Math.ceil(value * factor);\n popupValue = range.max;\n popupString = 'range increased';\n }\n range.value = value;\n }\n else {\n range.value = defaultValue;\n }\n\n let input = document.createElement('input');\n input.className = 'vis-configuration vis-config-rangeinput';\n input.value = Number(range.value);\n\n var me = this;\n range.onchange = function () {input.value = this.value; me._update(Number(this.value), path);};\n range.oninput = function () {input.value = this.value; };\n\n let label = this._makeLabel(path[path.length-1], path);\n let itemIndex = this._makeItem(path, label, range, input);\n\n // if a popup is needed AND it has not been shown for this value, show it.\n if (popupString !== '' && this.popupHistory[itemIndex] !== popupValue) {\n this.popupHistory[itemIndex] = popupValue;\n this._setupPopup(popupString, itemIndex);\n }\n }\n\n /**\n * make a button object\n * @private\n */\n _makeButton() {\n if (this.options.showButton === true) {\n let generateButton = document.createElement('div');\n generateButton.className = 'vis-configuration vis-config-button';\n generateButton.innerHTML = 'generate options';\n generateButton.onclick = () => {this._printOptions();};\n generateButton.onmouseover = () => {generateButton.className = 'vis-configuration vis-config-button hover';};\n generateButton.onmouseout = () => {generateButton.className = 'vis-configuration vis-config-button';};\n\n this.optionsContainer = document.createElement('div');\n this.optionsContainer.className = 'vis-configuration vis-config-option-container';\n\n this.domElements.push(this.optionsContainer);\n this.domElements.push(generateButton);\n }\n }\n\n\n /**\n * prepare the popup\n * @param {string} string\n * @param {number} index\n * @private\n */\n _setupPopup(string, index) {\n if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) {\n let div = document.createElement(\"div\");\n div.id = \"vis-configuration-popup\";\n div.className = \"vis-configuration-popup\";\n div.innerHTML = string;\n div.onclick = () => {this._removePopup()};\n this.popupCounter += 1;\n this.popupDiv = {html:div, index:index};\n }\n }\n\n\n /**\n * remove the popup from the dom\n * @private\n */\n _removePopup() {\n if (this.popupDiv.html !== undefined) {\n this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);\n clearTimeout(this.popupDiv.hideTimeout);\n clearTimeout(this.popupDiv.deleteTimeout);\n this.popupDiv = {};\n }\n }\n\n\n /**\n * Show the popup if it is needed.\n * @private\n */\n _showPopupIfNeeded() {\n if (this.popupDiv.html !== undefined) {\n let correspondingElement = this.domElements[this.popupDiv.index];\n let rect = correspondingElement.getBoundingClientRect();\n this.popupDiv.html.style.left = rect.left + \"px\";\n this.popupDiv.html.style.top = rect.top - 30 + \"px\"; // 30 is the height;\n document.body.appendChild(this.popupDiv.html)\n this.popupDiv.hideTimeout = setTimeout(() => {\n this.popupDiv.html.style.opacity = 0;\n },1500);\n this.popupDiv.deleteTimeout = setTimeout(() => {\n this._removePopup();\n },1800)\n }\n }\n\n /**\n * make a checkbox for boolean options.\n * @param {number} defaultValue\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _makeCheckbox(defaultValue, value, path) {\n var checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.className = 'vis-configuration vis-config-checkbox';\n checkbox.checked = defaultValue;\n if (value !== undefined) {\n checkbox.checked = value;\n if (value !== defaultValue) {\n if (typeof defaultValue === 'object') {\n if (value !== defaultValue.enabled) {\n this.changedOptions.push({path:path, value:value});\n }\n }\n else {\n this.changedOptions.push({path:path, value:value});\n }\n }\n }\n\n let me = this;\n checkbox.onchange = function() {me._update(this.checked, path)};\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path, label, checkbox);\n }\n\n /**\n * make a text input field for string options.\n * @param {number} defaultValue\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _makeTextInput(defaultValue, value, path) {\n var checkbox = document.createElement('input');\n checkbox.type = 'text';\n checkbox.className = 'vis-configuration vis-config-text';\n checkbox.value = value;\n if (value !== defaultValue) {\n this.changedOptions.push({path:path, value:value});\n }\n\n let me = this;\n checkbox.onchange = function() {me._update(this.value, path)};\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path, label, checkbox);\n }\n\n\n /**\n * make a color field with a color picker for color fields\n * @param {Array.} arr\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _makeColorField(arr, value, path) {\n let defaultColor = arr[1];\n let div = document.createElement('div');\n value = value === undefined ? defaultColor : value;\n\n if (value !== 'none') {\n div.className = 'vis-configuration vis-config-colorBlock';\n div.style.backgroundColor = value;\n }\n else {\n div.className = 'vis-configuration vis-config-colorBlock none';\n }\n\n value = value === undefined ? defaultColor : value;\n div.onclick = () => {\n this._showColorPicker(value,div,path);\n };\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path,label, div);\n }\n\n\n /**\n * used by the color buttons to call the color picker.\n * @param {number} value\n * @param {HTMLElement} div\n * @param {array} path | where to look for the actual option\n * @private\n */\n _showColorPicker(value, div, path) {\n // clear the callback from this div\n div.onclick = function() {};\n\n this.colorPicker.insertTo(div);\n this.colorPicker.show();\n\n this.colorPicker.setColor(value);\n this.colorPicker.setUpdateCallback((color) => {\n let colorString = 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';\n div.style.backgroundColor = colorString;\n this._update(colorString,path);\n });\n\n // on close of the colorpicker, restore the callback.\n this.colorPicker.setCloseCallback(() => {\n div.onclick = () => {\n this._showColorPicker(value,div,path);\n };\n });\n }\n\n\n /**\n * parse an object and draw the correct items\n * @param {Object} obj\n * @param {array} [path=[]] | where to look for the actual option\n * @param {boolean} [checkOnly=false]\n * @returns {boolean}\n * @private\n */\n _handleObject(obj, path = [], checkOnly = false) {\n let show = false;\n let filter = this.options.filter;\n let visibleInSet = false;\n for (let subObj in obj) {\n if (obj.hasOwnProperty(subObj)) {\n show = true;\n let item = obj[subObj];\n let newPath = util.copyAndExtendArray(path, subObj);\n if (typeof filter === 'function') {\n show = filter(subObj,path);\n\n // if needed we must go deeper into the object.\n if (show === false) {\n if (!(item instanceof Array) && typeof item !== 'string' && typeof item !== 'boolean' && item instanceof Object) {\n this.allowCreation = false;\n show = this._handleObject(item, newPath, true);\n this.allowCreation = checkOnly === false;\n }\n }\n }\n\n if (show !== false) {\n visibleInSet = true;\n let value = this._getValue(newPath);\n\n if (item instanceof Array) {\n this._handleArray(item, value, newPath);\n }\n else if (typeof item === 'string') {\n this._makeTextInput(item, value, newPath);\n }\n else if (typeof item === 'boolean') {\n this._makeCheckbox(item, value, newPath);\n }\n else if (item instanceof Object) {\n // collapse the physics options that are not enabled\n let draw = true;\n if (path.indexOf('physics') !== -1) {\n if (this.moduleOptions.physics.solver !== subObj) {\n draw = false;\n }\n }\n\n if (draw === true) {\n // initially collapse options with an disabled enabled option.\n if (item.enabled !== undefined) {\n let enabledPath = util.copyAndExtendArray(newPath, 'enabled');\n let enabledValue = this._getValue(enabledPath);\n if (enabledValue === true) {\n let label = this._makeLabel(subObj, newPath, true);\n this._makeItem(newPath, label);\n visibleInSet = this._handleObject(item, newPath) || visibleInSet;\n }\n else {\n this._makeCheckbox(item, enabledValue, newPath);\n }\n }\n else {\n let label = this._makeLabel(subObj, newPath, true);\n this._makeItem(newPath, label);\n visibleInSet = this._handleObject(item, newPath) || visibleInSet;\n }\n }\n }\n else {\n console.error('dont know how to handle', item, subObj, newPath);\n }\n }\n }\n }\n return visibleInSet;\n }\n\n\n /**\n * handle the array type of option\n * @param {Array.} arr\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _handleArray(arr, value, path) {\n if (typeof arr[0] === 'string' && arr[0] === 'color') {\n this._makeColorField(arr, value, path);\n if (arr[1] !== value) {this.changedOptions.push({path:path, value:value});}\n }\n else if (typeof arr[0] === 'string') {\n this._makeDropdown(arr, value, path);\n if (arr[0] !== value) {this.changedOptions.push({path:path, value:value});}\n }\n else if (typeof arr[0] === 'number') {\n this._makeRange(arr, value, path);\n if (arr[0] !== value) {this.changedOptions.push({path:path, value:Number(value)});}\n }\n }\n\n\n\n /**\n * called to update the network with the new settings.\n * @param {number} value\n * @param {array} path | where to look for the actual option\n * @private\n */\n _update(value, path) {\n let options = this._constructOptions(value,path);\n\n if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) {\n this.parent.body.emitter.emit(\"configChange\", options);\n }\n this.initialized = true;\n this.parent.setOptions(options);\n }\n\n\n /**\n *\n * @param {string|Boolean} value\n * @param {Array.} path\n * @param {{}} optionsObj\n * @returns {{}}\n * @private\n */\n _constructOptions(value, path, optionsObj = {}) {\n let pointer = optionsObj;\n\n // when dropdown boxes can be string or boolean, we typecast it into correct types\n value = value === 'true' ? true : value;\n value = value === 'false' ? false : value;\n\n for (let i = 0; i < path.length; i++) {\n if (path[i] !== 'global') {\n if (pointer[path[i]] === undefined) {\n pointer[path[i]] = {};\n }\n if (i !== path.length - 1) {\n pointer = pointer[path[i]];\n }\n else {\n pointer[path[i]] = value;\n }\n }\n }\n return optionsObj;\n }\n\n /**\n * @private\n */\n _printOptions() {\n let options = this.getOptions();\n this.optionsContainer.innerHTML = '
var options = ' + JSON.stringify(options, null, 2) + '
';\n }\n\n /**\n *\n * @returns {{}} options\n */\n getOptions() {\n let options = {};\n for (var i = 0; i < this.changedOptions.length; i++) {\n this._constructOptions(this.changedOptions[i].value, this.changedOptions[i].path, options)\n }\n return options;\n }\n}\n\n\nexport default Configurator;\n","import moment from '../module/moment';\nimport util from '../util';\nimport { DataSet } from 'vis-data';\nimport { DataView } from 'vis-data';\nimport Range from './Range';\nimport Core from './Core';\nimport TimeAxis from './component/TimeAxis';\nimport CurrentTime from './component/CurrentTime';\nimport CustomTime from './component/CustomTime';\nimport ItemSet from './component/ItemSet';\n\nimport { Validator } from '../shared/Validator';\nimport { printStyle } from '../shared/Validator';\nimport { allOptions } from './optionsTimeline';\nimport { configureOptions } from './optionsTimeline';\n\nimport Configurator from '../shared/Configurator';\n\n/**\n * Create a timeline visualization\n * @extends Core\n */\nexport default class Timeline extends Core {\n /**\n * @param {HTMLElement} container\n * @param {vis.DataSet | vis.DataView | Array} [items]\n * @param {vis.DataSet | vis.DataView | Array} [groups]\n * @param {Object} [options] See Timeline.setOptions for the available options.\n * @constructor Timeline\n */\n constructor(container, items, groups, options) {\n super()\n this.initTime = new Date();\n this.itemsDone = false;\n\n if (!(this instanceof Timeline)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // if the third element is options, the forth is groups (optionally);\n if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {\n const forthArgument = options;\n options = groups;\n groups = forthArgument;\n }\n\n // TODO: REMOVE THIS in the next MAJOR release\n // see https://github.com/almende/vis/issues/2511\n if (options && options.throttleRedraw) {\n console.warn(\"Timeline option \\\"throttleRedraw\\\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.\");\n }\n\n const me = this;\n this.defaultOptions = {\n autoResize: true,\n orientation: {\n axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'\n item: 'bottom' // not relevant\n },\n moment,\n };\n this.options = util.deepExtend({}, this.defaultOptions);\n\n // Create the DOM, props, and emitter\n this._create(container);\n if (!options || (options && typeof options.rtl == \"undefined\")) {\n this.dom.root.style.visibility = 'hidden';\n let directionFromDom;\n let domNode = this.dom.root;\n while (!directionFromDom && domNode) {\n directionFromDom = window.getComputedStyle(domNode, null).direction;\n domNode = domNode.parentElement;\n }\n this.options.rtl = (directionFromDom && (directionFromDom.toLowerCase() == \"rtl\"));\n } else {\n this.options.rtl = options.rtl;\n }\n\n if (options) {\n if (options.rollingMode) { this.options.rollingMode = options.rollingMode; }\n if (options.onInitialDrawComplete) { this.options.onInitialDrawComplete = options.onInitialDrawComplete; }\n if (options.onTimeout) { this.options.onTimeout = options.onTimeout; }\n if (options.loadingScreenTemplate) { this.options.loadingScreenTemplate = options.loadingScreenTemplate; }\n }\n\n // Prepare loading screen\n const loadingScreenFragment = document.createElement('div');\n if (this.options.loadingScreenTemplate) {\n const templateFunction = this.options.loadingScreenTemplate.bind(this);\n const loadingScreen = templateFunction(this.dom.loadingScreen);\n if ((loadingScreen instanceof Object) && !(loadingScreen instanceof Element)) {\n templateFunction(loadingScreenFragment)\n } else {\n if (loadingScreen instanceof Element) {\n loadingScreenFragment.innerHTML = '';\n loadingScreenFragment.appendChild(loadingScreen);\n }\n else if (loadingScreen != undefined) {\n loadingScreenFragment.innerHTML = loadingScreen;\n }\n }\n }\n this.dom.loadingScreen.appendChild(loadingScreenFragment);\n\n // all components listed here will be repainted automatically\n this.components = [];\n\n this.body = {\n dom: this.dom,\n domProps: this.props,\n emitter: {\n on: this.on.bind(this),\n off: this.off.bind(this),\n emit: this.emit.bind(this)\n },\n hiddenDates: [],\n util: {\n getScale() {\n return me.timeAxis.step.scale;\n },\n getStep() {\n return me.timeAxis.step.step;\n },\n\n toScreen: me._toScreen.bind(me),\n toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width\n toTime: me._toTime.bind(me),\n toGlobalTime : me._toGlobalTime.bind(me)\n }\n };\n\n // range\n this.range = new Range(this.body, this.options);\n this.components.push(this.range);\n this.body.range = this.range;\n\n // time axis\n this.timeAxis = new TimeAxis(this.body, this.options);\n this.timeAxis2 = null; // used in case of orientation option 'both'\n this.components.push(this.timeAxis);\n\n // current time bar\n this.currentTime = new CurrentTime(this.body, this.options);\n this.components.push(this.currentTime);\n\n // item set\n this.itemSet = new ItemSet(this.body, this.options);\n this.components.push(this.itemSet);\n\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n this.dom.root.onclick = event => {\n me.emit('click', me.getEventProperties(event))\n };\n this.dom.root.ondblclick = event => {\n me.emit('doubleClick', me.getEventProperties(event))\n };\n this.dom.root.oncontextmenu = event => {\n me.emit('contextmenu', me.getEventProperties(event))\n };\n this.dom.root.onmouseover = event => {\n me.emit('mouseOver', me.getEventProperties(event))\n };\n if(window.PointerEvent) {\n this.dom.root.onpointerdown = event => {\n me.emit('mouseDown', me.getEventProperties(event))\n };\n this.dom.root.onpointermove = event => {\n me.emit('mouseMove', me.getEventProperties(event))\n };\n this.dom.root.onpointerup = event => {\n me.emit('mouseUp', me.getEventProperties(event))\n };\n } else {\n this.dom.root.onmousemove = event => {\n me.emit('mouseMove', me.getEventProperties(event))\n };\n this.dom.root.onmousedown = event => {\n me.emit('mouseDown', me.getEventProperties(event))\n };\n this.dom.root.onmouseup = event => {\n me.emit('mouseUp', me.getEventProperties(event))\n };\n }\n\n //Single time autoscale/fit\n this.initialFitDone = false;\n this.on('changed', () => {\n if (me.itemsData == null) return;\n if (!me.initialFitDone && !me.options.rollingMode) {\n me.initialFitDone = true;\n if (me.options.start != undefined || me.options.end != undefined) {\n if (me.options.start == undefined || me.options.end == undefined) {\n var range = me.getItemRange();\n }\n\n const start = me.options.start != undefined ? me.options.start : range.min;\n const end = me.options.end != undefined ? me.options.end : range.max;\n me.setWindow(start, end, {animation: false});\n } else {\n me.fit({animation: false});\n }\n }\n\n if (!me.initialDrawDone && (me.initialRangeChangeDone || (!me.options.start && !me.options.end) \n || me.options.rollingMode)) {\n me.initialDrawDone = true;\n me.itemSet.initialDrawDone = true;\n me.dom.root.style.visibility = 'visible';\n me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen);\n if (me.options.onInitialDrawComplete) {\n setTimeout(() => {\n return me.options.onInitialDrawComplete();\n }, 0)\n }\n }\n });\n\n this.on('destroyTimeline', () => {\n me.destroy()\n });\n\n // apply options\n if (options) {\n this.setOptions(options);\n }\n\n this.body.emitter.on('fit', (args) => {\n this._onFit(args);\n this.redraw();\n });\n\n // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!\n if (groups) {\n this.setGroups(groups);\n }\n\n // create itemset\n if (items) {\n this.setItems(items);\n }\n\n // draw for the first time\n this._redraw();\n }\n\n /**\n * Load a configurator\n * @return {Object}\n * @private\n */\n _createConfigurator() {\n return new Configurator(this, this.dom.container, configureOptions);\n }\n\n /**\n * Force a redraw. The size of all items will be recalculated.\n * Can be useful to manually redraw when option autoResize=false and the window\n * has been resized, or when the items CSS has been changed.\n *\n * Note: this function will be overridden on construction with a trottled version\n */\n redraw() {\n this.itemSet && this.itemSet.markDirty({refreshItems: true});\n this._redraw();\n }\n\n /**\n * Remove an item from the group\n * @param {object} options\n */\n setOptions(options) {\n // validate options\n let errorFound = Validator.validate(options, allOptions);\n\n if (errorFound === true) {\n console.log('%cErrors have been found in the supplied options object.', printStyle);\n }\n\n Core.prototype.setOptions.call(this, options);\n\n if ('type' in options) {\n if (options.type !== this.options.type) {\n this.options.type = options.type;\n\n // force recreation of all items\n const itemsData = this.itemsData;\n if (itemsData) {\n const selection = this.getSelection();\n this.setItems(null); // remove all\n this.setItems(itemsData); // add all\n this.setSelection(selection); // restore selection\n }\n }\n }\n }\n\n /**\n * Set items\n * @param {vis.DataSet | Array | null} items\n */\n setItems(items) {\n this.itemsDone = false;\n \n // convert to type DataSet when needed\n let newDataSet;\n if (!items) {\n newDataSet = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n newDataSet = items;\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(items, {\n type: {\n start: 'Date',\n end: 'Date'\n }\n });\n }\n\n // set items\n this.itemsData = newDataSet;\n this.itemSet && this.itemSet.setItems(newDataSet);\n }\n\n /**\n * Set groups\n * @param {vis.DataSet | Array} groups\n */\n setGroups(groups) {\n // convert to type DataSet when needed\n let newDataSet;\n if (!groups) {\n newDataSet = null;\n }\n else {\n const filter = group => group.visible !== false;\n if (groups instanceof DataSet || groups instanceof DataView) {\n newDataSet = new DataView(groups,{filter});\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(groups.filter(filter));\n }\n }\n\n this.groupsData = newDataSet;\n this.itemSet.setGroups(newDataSet);\n }\n\n /**\n * Set both items and groups in one go\n * @param {{items: (Array | vis.DataSet), groups: (Array | vis.DataSet)}} data\n */\n setData(data) {\n if (data && data.groups) {\n this.setGroups(data.groups);\n }\n\n if (data && data.items) {\n this.setItems(data.items);\n }\n }\n\n /**\n * Set selected items by their id. Replaces the current selection\n * Unknown id's are silently ignored.\n * @param {string[] | string} [ids] An array with zero or more id's of the items to be\n * selected. If ids is an empty array, all items will be\n * unselected.\n * @param {Object} [options] Available options:\n * `focus: boolean`\n * If true, focus will be set to the selected item(s)\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * Only applicable when option focus is true.\n */\n setSelection(ids, options) {\n this.itemSet && this.itemSet.setSelection(ids);\n\n if (options && options.focus) {\n this.focus(ids, options);\n }\n }\n\n /**\n * Get the selected items by their id\n * @return {Array} ids The ids of the selected items\n */\n getSelection() {\n return this.itemSet && this.itemSet.getSelection() || [];\n }\n\n /**\n * Adjust the visible window such that the selected item (or multiple items)\n * are centered on screen.\n * @param {string | String[]} id An item id or array with item ids\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * `zoom: boolean`\n * If true (default), the timeline will\n * zoom on the element after focus it.\n */\n focus(id, options) {\n if (!this.itemsData || id == undefined) return;\n\n const ids = Array.isArray(id) ? id : [id];\n\n // get the specified item(s)\n const itemsData = this.itemsData.getDataSet().get(ids, {\n type: {\n start: 'Date',\n end: 'Date'\n }\n });\n\n // calculate minimum start and maximum end of specified items\n let start = null;\n let end = null;\n itemsData.forEach(itemData => {\n const s = itemData.start.valueOf();\n const e = 'end' in itemData ? itemData.end.valueOf() : itemData.start.valueOf();\n\n if (start === null || s < start) {\n start = s;\n }\n\n if (end === null || e > end) {\n end = e;\n }\n });\n\n\n if (start !== null && end !== null) {\n const me = this;\n // Use the first item for the vertical focus\n const item = this.itemSet.items[ids[0]];\n let startPos = this._getScrollTop() * -1;\n let initialVerticalScroll = null;\n\n // Setup a handler for each frame of the vertical scroll\n const verticalAnimationFrame = (ease, willDraw, done) => {\n const verticalScroll = getItemVerticalScroll(me, item);\n\n if (verticalScroll === false) {\n return; // We don't need to scroll, so do nothing\n }\n\n if(!initialVerticalScroll) {\n initialVerticalScroll = verticalScroll;\n }\n\n if(initialVerticalScroll.itemTop == verticalScroll.itemTop && !initialVerticalScroll.shouldScroll) {\n return; // We don't need to scroll, so do nothing\n }\n else if(initialVerticalScroll.itemTop != verticalScroll.itemTop && verticalScroll.shouldScroll) {\n // The redraw shifted elements, so reset the animation to correct\n initialVerticalScroll = verticalScroll;\n startPos = me._getScrollTop() * -1;\n } \n\n const from = startPos;\n const to = initialVerticalScroll.scrollOffset;\n const scrollTop = done ? to : (from + (to - from) * ease);\n\n me._setScrollTop(-scrollTop);\n\n if(!willDraw) {\n me._redraw();\n }\n };\n\n // Enforces the final vertical scroll position\n const setFinalVerticalPosition = () => {\n const finalVerticalScroll = getItemVerticalScroll(me, item);\n\n if (finalVerticalScroll.shouldScroll && finalVerticalScroll.itemTop != initialVerticalScroll.itemTop) {\n me._setScrollTop(-finalVerticalScroll.scrollOffset);\n me._redraw();\n }\n };\n\n // Perform one last check at the end to make sure the final vertical\n // position is correct\n const finalVerticalCallback = () => {\n // Double check we ended at the proper scroll position\n setFinalVerticalPosition();\n\n // Let the redraw settle and finalize the position. \n setTimeout(setFinalVerticalPosition, 100);\n };\n\n // calculate the new middle and interval for the window\n const zoom = options && options.zoom !== undefined ? options.zoom : true;\n const middle = (start + end) / 2;\n const interval = zoom ? (end - start) * 1.1 : Math.max(this.range.end - this.range.start, (end - start) * 1.1);\n\n const animation = options && options.animation !== undefined ? options.animation : true;\n\n if (!animation) {\n // We aren't animating so set a default so that the final callback forces the vertical location\n initialVerticalScroll = { shouldScroll: false, scrollOffset: -1, itemTop: -1 };\n }\n\n this.range.setRange(middle - interval / 2, middle + interval / 2, { animation }, finalVerticalCallback, verticalAnimationFrame); \n }\n }\n\n /**\n * Set Timeline window such that it fits all items\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {function} [callback]\n */\n fit(options, callback) {\n const animation = (options && options.animation !== undefined) ? options.animation : true;\n let range;\n\n const dataset = this.itemsData && this.itemsData.getDataSet();\n if (dataset.length === 1 && dataset.get()[0].end === undefined) {\n // a single item -> don't fit, just show a range around the item from -4 to +3 days\n range = this.getDataRange();\n this.moveTo(range.min.valueOf(), {animation}, callback);\n }\n else {\n // exactly fit the items (plus a small margin)\n range = this.getItemRange();\n this.range.setRange(range.min, range.max, { animation }, callback);\n }\n }\n\n /**\n * Determine the range of the items, taking into account their actual width\n * and a margin of 10 pixels on both sides.\n *\n * @returns {{min: Date, max: Date}}\n */\n getItemRange() {\n // get a rough approximation for the range based on the items start and end dates\n const range = this.getDataRange();\n let min = range.min !== null ? range.min.valueOf() : null;\n let max = range.max !== null ? range.max.valueOf() : null;\n let minItem = null;\n let maxItem = null;\n\n if (min != null && max != null) {\n let interval = (max - min); // ms\n if (interval <= 0) {\n interval = 10;\n }\n const factor = interval / this.props.center.width;\n\n const redrawQueue = {};\n let redrawQueueLength = 0;\n\n // collect redraw functions\n util.forEach(this.itemSet.items, (item, key) => {\n if (item.groupShowing) {\n const returnQueue = true;\n redrawQueue[key] = item.redraw(returnQueue);\n redrawQueueLength = redrawQueue[key].length;\n }\n })\n\n const needRedraw = redrawQueueLength > 0;\n if (needRedraw) {\n // redraw all regular items\n for (let i = 0; i < redrawQueueLength; i++) {\n util.forEach(redrawQueue, fns => {\n fns[i]();\n });\n }\n }\n\n // calculate the date of the left side and right side of the items given\n util.forEach(this.itemSet.items, item => {\n const start = getStart(item);\n const end = getEnd(item);\n let startSide;\n let endSide;\n\n if (this.options.rtl) {\n startSide = start - (item.getWidthRight() + 10) * factor;\n endSide = end + (item.getWidthLeft() + 10) * factor;\n } else {\n startSide = start - (item.getWidthLeft() + 10) * factor;\n endSide = end + (item.getWidthRight() + 10) * factor;\n }\n\n if (startSide < min) {\n min = startSide;\n minItem = item;\n }\n if (endSide > max) {\n max = endSide;\n maxItem = item;\n }\n });\n\n if (minItem && maxItem) {\n const lhs = minItem.getWidthLeft() + 10;\n const rhs = maxItem.getWidthRight() + 10;\n const delta = this.props.center.width - lhs - rhs; // px\n\n if (delta > 0) {\n if (this.options.rtl) {\n min = getStart(minItem) - rhs * interval / delta; // ms\n max = getEnd(maxItem) + lhs * interval / delta; // ms\n } else {\n min = getStart(minItem) - lhs * interval / delta; // ms\n max = getEnd(maxItem) + rhs * interval / delta; // ms\n }\n }\n }\n }\n\n return {\n min: min != null ? new Date(min) : null,\n max: max != null ? new Date(max) : null\n }\n }\n\n /**\n * Calculate the data range of the items start and end dates\n * @returns {{min: Date, max: Date}}\n */\n getDataRange() {\n let min = null;\n let max = null;\n\n const dataset = this.itemsData && this.itemsData.getDataSet();\n if (dataset) {\n dataset.forEach(item => {\n const start = util.convert(item.start, 'Date').valueOf();\n const end = util.convert(item.end != undefined ? item.end : item.start, 'Date').valueOf();\n if (min === null || start < min) {\n min = start;\n }\n if (max === null || end > max) {\n max = end;\n }\n });\n }\n\n return {\n min: min != null ? new Date(min) : null,\n max: max != null ? new Date(max) : null\n }\n }\n\n /**\n * Generate Timeline related information from an event\n * @param {Event} event\n * @return {Object} An object with related information, like on which area\n * The event happened, whether clicked on an item, etc.\n */\n getEventProperties(event) {\n const clientX = event.center ? event.center.x : event.clientX;\n const clientY = event.center ? event.center.y : event.clientY;\n const centerContainerRect = this.dom.centerContainer.getBoundingClientRect();\n const x = this.options.rtl ? centerContainerRect.right - clientX : clientX - centerContainerRect.left;\n const y = clientY - centerContainerRect.top;\n \n const item = this.itemSet.itemFromTarget(event);\n const group = this.itemSet.groupFromTarget(event);\n const customTime = CustomTime.customTimeFromTarget(event);\n\n const snap = this.itemSet.options.snap || null;\n const scale = this.body.util.getScale();\n const step = this.body.util.getStep();\n const time = this._toTime(x);\n const snappedTime = snap ? snap(time, scale, step) : time;\n\n const element = util.getTarget(event);\n let what = null;\n if (item != null) {what = 'item';}\n else if (customTime != null) {what = 'custom-time';}\n else if (util.hasParent(element, this.timeAxis.dom.foreground)) {what = 'axis';}\n else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {what = 'axis';}\n else if (util.hasParent(element, this.itemSet.dom.labelSet)) {what = 'group-label';}\n else if (util.hasParent(element, this.currentTime.bar)) {what = 'current-time';}\n else if (util.hasParent(element, this.dom.center)) {what = 'background';}\n\n return {\n event,\n item: item ? item.id : null,\n isCluster: item ? !!item.isCluster: false,\n items: item ? item.items || []: null,\n group: group ? group.groupId : null,\n customTime: customTime ? customTime.options.id : null,\n what,\n pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,\n pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,\n x,\n y,\n time,\n snappedTime\n }\n }\n\n /**\n * Toggle Timeline rolling mode\n */\n toggleRollingMode() {\n if (this.range.rolling) {\n this.range.stopRolling();\n } else {\n if (this.options.rollingMode == undefined) {\n this.setOptions(this.options)\n }\n this.range.startRolling();\n }\n }\n\n /**\n * redraw\n * @private\n */\n _redraw() {\n Core.prototype._redraw.call(this);\n }\n\n /**\n * on fit callback\n * @param {object} args\n * @private\n */\n _onFit(args) {\n const { start, end, animation } = args;\n if (!end) {\n this.moveTo(start.valueOf(), {\n animation\n });\n } else {\n this.range.setRange(start, end, {\n animation: animation\n });\n }\n }\n}\n\n/**\n *\n * @param {timeline.Item} item\n * @returns {number}\n */\nfunction getStart(item) {\n return util.convert(item.data.start, 'Date').valueOf()\n}\n\n/**\n *\n * @param {timeline.Item} item\n * @returns {number}\n */\nfunction getEnd(item) {\n const end = item.data.end != undefined ? item.data.end : item.data.start;\n return util.convert(end, 'Date').valueOf();\n}\n\n/**\n * @param {vis.Timeline} timeline\n * @param {timeline.Item} item\n * @return {{shouldScroll: bool, scrollOffset: number, itemTop: number}}\n */\nfunction getItemVerticalScroll(timeline, item) {\n if (!item.parent) {\n // The item no longer exists, so ignore this focus.\n return false;\n }\n\n const itemsetHeight = timeline.options.rtl ? timeline.props.rightContainer.height : timeline.props.leftContainer.height;\n const contentHeight = timeline.props.center.height;\n \n const group = item.parent;\n let offset = group.top;\n let shouldScroll = true;\n const orientation = timeline.timeAxis.options.orientation.axis;\n \n const itemTop = () => {\n if (orientation == \"bottom\") {\n return group.height - item.top - item.height;\n }\n else {\n return item.top;\n }\n };\n\n const currentScrollHeight = timeline._getScrollTop() * -1;\n const targetOffset = offset + itemTop();\n const height = item.height;\n\n if (targetOffset < currentScrollHeight) {\n if (offset + itemsetHeight <= offset + itemTop() + height) {\n offset += itemTop() - timeline.itemSet.options.margin.item.vertical;\n }\n }\n else if (targetOffset + height > currentScrollHeight + itemsetHeight) {\n offset += itemTop() + height - itemsetHeight + timeline.itemSet.options.margin.item.vertical;\n }\n else {\n shouldScroll = false;\n }\n\n offset = Math.min(offset, contentHeight - itemsetHeight);\n\n return { shouldScroll, scrollOffset: offset, itemTop: targetOffset };\n}\n","/** DataScale */\nclass DataScale {\n /**\n *\n * @param {number} start\n * @param {number} end\n * @param {boolean} autoScaleStart\n * @param {boolean} autoScaleEnd\n * @param {number} containerHeight\n * @param {number} majorCharHeight\n * @param {boolean} zeroAlign\n * @param {function} formattingFunction\n * @constructor DataScale\n */\n constructor(\n start,\n end,\n autoScaleStart,\n autoScaleEnd,\n containerHeight,\n majorCharHeight,\n zeroAlign = false,\n formattingFunction=false) {\n this.majorSteps = [1, 2, 5, 10];\n this.minorSteps = [0.25, 0.5, 1, 2];\n this.customLines = null;\n\n this.containerHeight = containerHeight;\n this.majorCharHeight = majorCharHeight;\n this._start = start;\n this._end = end;\n\n this.scale = 1;\n this.minorStepIdx = -1;\n this.magnitudefactor = 1;\n this.determineScale();\n\n this.zeroAlign = zeroAlign;\n this.autoScaleStart = autoScaleStart;\n this.autoScaleEnd = autoScaleEnd;\n\n this.formattingFunction = formattingFunction;\n\n if (autoScaleStart || autoScaleEnd) {\n const me = this;\n const roundToMinor = value => {\n const rounded = value - (value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]));\n if (value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]) > 0.5 * (me.magnitudefactor * me.minorSteps[me.minorStepIdx])) {\n return rounded + (me.magnitudefactor * me.minorSteps[me.minorStepIdx]);\n }\n else {\n return rounded;\n }\n };\n if (autoScaleStart) {\n this._start -= this.magnitudefactor * 2 * this.minorSteps[this.minorStepIdx];\n this._start = roundToMinor(this._start);\n }\n\n if (autoScaleEnd) {\n this._end += this.magnitudefactor * this.minorSteps[this.minorStepIdx];\n this._end = roundToMinor(this._end);\n }\n this.determineScale();\n }\n }\n\n /**\n * set chart height\n * @param {number} majorCharHeight \n */\n setCharHeight(majorCharHeight) {\n this.majorCharHeight = majorCharHeight;\n }\n\n /**\n * set height\n * @param {number} containerHeight \n */\n setHeight(containerHeight) {\n this.containerHeight = containerHeight;\n }\n\n /**\n * determine scale\n */\n determineScale() {\n const range = this._end - this._start;\n this.scale = this.containerHeight / range;\n const minimumStepValue = this.majorCharHeight / this.scale;\n const orderOfMagnitude = (range > 0)\n ? Math.round(Math.log(range) / Math.LN10)\n : 0;\n\n this.minorStepIdx = -1;\n this.magnitudefactor = Math.pow(10, orderOfMagnitude);\n\n let start = 0;\n if (orderOfMagnitude < 0) {\n start = orderOfMagnitude;\n }\n\n let solutionFound = false;\n for (let l = start; Math.abs(l) <= Math.abs(orderOfMagnitude); l++) {\n this.magnitudefactor = Math.pow(10, l);\n for (let j = 0; j < this.minorSteps.length; j++) {\n const stepSize = this.magnitudefactor * this.minorSteps[j];\n if (stepSize >= minimumStepValue) {\n solutionFound = true;\n this.minorStepIdx = j;\n break;\n }\n }\n if (solutionFound === true) {\n break;\n }\n }\n }\n\n /**\n * returns if value is major\n * @param {number} value\n * @returns {boolean} \n */\n is_major(value) {\n return (value % (this.magnitudefactor * this.majorSteps[this.minorStepIdx]) === 0);\n }\n\n /**\n * returns step size\n * @returns {number} \n */\n getStep() {\n return this.magnitudefactor * this.minorSteps[this.minorStepIdx];\n }\n\n /**\n * returns first major\n * @returns {number} \n */\n getFirstMajor() {\n const majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];\n return this.convertValue(this._start + ((majorStep - (this._start % majorStep)) % majorStep));\n }\n\n /**\n * returns first major\n * @param {date} current\n * @returns {date} formatted date\n */\n formatValue(current) {\n let returnValue = current.toPrecision(5);\n if (typeof this.formattingFunction === 'function') {\n returnValue = this.formattingFunction(current);\n }\n\n if (typeof returnValue === 'number') {\n return `${returnValue}`;\n }\n else if (typeof returnValue === 'string') {\n return returnValue;\n }\n else {\n return current.toPrecision(5);\n }\n\n }\n\n /**\n * returns lines\n * @returns {object} lines\n */\n getLines() {\n const lines = [];\n const step = this.getStep();\n const bottomOffset = (step - (this._start % step)) % step;\n for (let i = (this._start + bottomOffset); this._end-i > 0.00001; i += step) {\n if (i != this._start) { //Skip the bottom line\n lines.push({major: this.is_major(i), y: this.convertValue(i), val: this.formatValue(i)});\n }\n }\n return lines;\n }\n\n /**\n * follow scale\n * @param {object} other\n */\n followScale(other) {\n const oldStepIdx = this.minorStepIdx;\n const oldStart = this._start;\n const oldEnd = this._end;\n\n const me = this;\n const increaseMagnitude = () => {\n me.magnitudefactor *= 2;\n };\n const decreaseMagnitude = () => {\n me.magnitudefactor /= 2;\n };\n\n if ((other.minorStepIdx <= 1 && this.minorStepIdx <= 1) || (other.minorStepIdx > 1 && this.minorStepIdx > 1)) {\n //easy, no need to change stepIdx nor multiplication factor\n } else if (other.minorStepIdx < this.minorStepIdx) {\n //I'm 5, they are 4 per major.\n this.minorStepIdx = 1;\n if (oldStepIdx == 2) {\n increaseMagnitude();\n } else {\n increaseMagnitude();\n increaseMagnitude();\n }\n } else {\n //I'm 4, they are 5 per major\n this.minorStepIdx = 2;\n if (oldStepIdx == 1) {\n decreaseMagnitude();\n } else {\n decreaseMagnitude();\n decreaseMagnitude();\n }\n }\n\n //Get masters stats:\n const otherZero = other.convertValue(0);\n const otherStep = other.getStep() * other.scale;\n\n let done = false;\n let count = 0;\n //Loop until magnitude is correct for given constrains.\n while (!done && count++ <5) {\n\n //Get my stats:\n this.scale = otherStep / (this.minorSteps[this.minorStepIdx] * this.magnitudefactor);\n const newRange = this.containerHeight / this.scale;\n\n //For the case the magnitudefactor has changed:\n this._start = oldStart;\n this._end = this._start + newRange;\n\n const myOriginalZero = this._end * this.scale;\n const majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];\n const majorOffset = this.getFirstMajor() - other.getFirstMajor();\n\n if (this.zeroAlign) {\n const zeroOffset = otherZero - myOriginalZero;\n this._end += (zeroOffset / this.scale);\n this._start = this._end - newRange;\n } else {\n if (!this.autoScaleStart) {\n this._start += majorStep - (majorOffset / this.scale);\n this._end = this._start + newRange;\n } else {\n this._start -= majorOffset / this.scale;\n this._end = this._start + newRange;\n }\n }\n if (!this.autoScaleEnd && this._end > oldEnd+0.00001) {\n //Need to decrease magnitude to prevent scale overshoot! (end)\n decreaseMagnitude();\n done = false;\n continue;\n }\n if (!this.autoScaleStart && this._start < oldStart-0.00001) {\n if (this.zeroAlign && oldStart >= 0) {\n console.warn(\"Can't adhere to given 'min' range, due to zeroalign\");\n } else {\n //Need to decrease magnitude to prevent scale overshoot! (start)\n decreaseMagnitude();\n done = false;\n continue;\n }\n }\n if (this.autoScaleStart && this.autoScaleEnd && newRange < (oldEnd-oldStart)){\n increaseMagnitude();\n done = false;\n continue;\n }\n done = true;\n }\n }\n\n /**\n * convert value\n * @param {number} value\n * @returns {number} \n */\n convertValue(value) {\n return this.containerHeight - ((value - this._start) * this.scale);\n }\n\n /**\n * returns screen to value\n * @param {number} pixels\n * @returns {number} \n */\n screenToValue(pixels) {\n return ((this.containerHeight - pixels) / this.scale) + this._start;\n }\n}\n\nexport default DataScale;","import util from '../../util';\nimport * as DOMutil from '../../DOMutil';\nimport Component from './Component';\nimport DataScale from './DataScale';\n\nimport './css/dataaxis.css';\n\n/** A horizontal time axis */\nclass DataAxis extends Component {\n /**\n * @param {Object} body\n * @param {Object} [options] See DataAxis.setOptions for the available\n * options.\n * @param {SVGElement} svg\n * @param {timeline.LineGraph.options} linegraphOptions\n * @constructor DataAxis\n * @extends Component\n */\n constructor(body, options, svg, linegraphOptions) {\n super()\n this.id = util.randomUUID();\n this.body = body;\n\n this.defaultOptions = {\n orientation: 'left', // supported: 'left', 'right'\n showMinorLabels: true,\n showMajorLabels: true,\n icons: false,\n majorLinesOffset: 7,\n minorLinesOffset: 4,\n labelOffsetX: 10,\n labelOffsetY: 2,\n iconWidth: 20,\n width: '40px',\n visible: true,\n alignZeros: true,\n left: {\n range: {min: undefined, max: undefined},\n format(value) {\n return `${parseFloat(value.toPrecision(3))}`;\n },\n title: {text: undefined, style: undefined}\n },\n right: {\n range: {min: undefined, max: undefined},\n format(value) {\n return `${parseFloat(value.toPrecision(3))}`;\n },\n title: {text: undefined, style: undefined}\n }\n };\n\n this.linegraphOptions = linegraphOptions;\n this.linegraphSVG = svg;\n this.props = {};\n this.DOMelements = { // dynamic elements\n lines: {},\n labels: {},\n title: {}\n };\n\n this.dom = {};\n this.scale = undefined;\n this.range = {start: 0, end: 0};\n\n this.options = util.extend({}, this.defaultOptions);\n this.conversionFactor = 1;\n\n this.setOptions(options);\n this.width = Number((`${this.options.width}`).replace(\"px\", \"\"));\n this.minWidth = this.width;\n this.height = this.linegraphSVG.getBoundingClientRect().height;\n this.hidden = false;\n\n this.stepPixels = 25;\n this.zeroCrossing = -1;\n this.amountOfSteps = -1;\n\n this.lineOffset = 0;\n this.master = true;\n this.masterAxis = null;\n this.svgElements = {};\n this.iconsRemoved = false;\n\n this.groups = {};\n this.amountOfGroups = 0;\n\n // create the HTML DOM\n this._create();\n if (this.scale == undefined) {\n this._redrawLabels();\n }\n this.framework = {svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups};\n\n const me = this;\n this.body.emitter.on(\"verticalDrag\", () => {\n me.dom.lineContainer.style.top = `${me.body.domProps.scrollTop}px`;\n });\n }\n\n /**\n * Adds group to data axis\n * @param {string} label \n * @param {object} graphOptions\n */\n addGroup(label, graphOptions) {\n if (!this.groups.hasOwnProperty(label)) {\n this.groups[label] = graphOptions;\n }\n this.amountOfGroups += 1;\n }\n\n /**\n * updates group of data axis\n * @param {string} label \n * @param {object} graphOptions\n */\n updateGroup(label, graphOptions) {\n if (!this.groups.hasOwnProperty(label)) {\n this.amountOfGroups += 1;\n }\n this.groups[label] = graphOptions;\n }\n\n /**\n * removes group of data axis\n * @param {string} label \n */\n removeGroup(label) {\n if (this.groups.hasOwnProperty(label)) {\n delete this.groups[label];\n this.amountOfGroups -= 1;\n }\n }\n\n /**\n * sets options\n * @param {object} options\n */\n setOptions(options) {\n if (options) {\n let redraw = false;\n if (this.options.orientation != options.orientation && options.orientation !== undefined) {\n redraw = true;\n }\n const fields = [\n 'orientation',\n 'showMinorLabels',\n 'showMajorLabels',\n 'icons',\n 'majorLinesOffset',\n 'minorLinesOffset',\n 'labelOffsetX',\n 'labelOffsetY',\n 'iconWidth',\n 'width',\n 'visible',\n 'left',\n 'right',\n 'alignZeros'\n ];\n util.selectiveDeepExtend(fields, this.options, options);\n\n this.minWidth = Number((`${this.options.width}`).replace(\"px\", \"\"));\n if (redraw === true && this.dom.frame) {\n this.hide();\n this.show();\n }\n }\n }\n\n /**\n * Create the HTML DOM for the DataAxis\n */\n _create() {\n this.dom.frame = document.createElement('div');\n this.dom.frame.style.width = this.options.width;\n this.dom.frame.style.height = this.height;\n\n this.dom.lineContainer = document.createElement('div');\n this.dom.lineContainer.style.width = '100%';\n this.dom.lineContainer.style.height = this.height;\n this.dom.lineContainer.style.position = 'relative';\n this.dom.lineContainer.style.visibility = 'visible';\n this.dom.lineContainer.style.display = 'block';\n\n // create svg element for graph drawing.\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\n this.svg.style.position = \"absolute\";\n this.svg.style.top = '0px';\n this.svg.style.height = '100%';\n this.svg.style.width = '100%';\n this.svg.style.display = \"block\";\n this.dom.frame.appendChild(this.svg);\n }\n\n /**\n * redraws groups icons\n */\n _redrawGroupIcons() {\n DOMutil.prepareElements(this.svgElements);\n\n let x;\n const iconWidth = this.options.iconWidth;\n const iconHeight = 15;\n const iconOffset = 4;\n let y = iconOffset + 0.5 * iconHeight;\n\n if (this.options.orientation === 'left') {\n x = iconOffset;\n }\n else {\n x = this.width - iconWidth - iconOffset;\n }\n\n const groupArray = Object.keys(this.groups);\n groupArray.sort((a, b) => a < b ? -1 : 1)\n\n for (const groupId of groupArray) {\n if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {\n this.groups[groupId].getLegend(iconWidth, iconHeight, this.framework, x, y);\n y += iconHeight + iconOffset;\n }\n }\n\n DOMutil.cleanupElements(this.svgElements);\n this.iconsRemoved = false;\n }\n\n /**\n * Cleans up icons\n */\n _cleanupIcons() {\n if (this.iconsRemoved === false) {\n DOMutil.prepareElements(this.svgElements);\n DOMutil.cleanupElements(this.svgElements);\n this.iconsRemoved = true;\n }\n }\n\n /**\n * Create the HTML DOM for the DataAxis\n */\n show() {\n this.hidden = false;\n if (!this.dom.frame.parentNode) {\n if (this.options.orientation === 'left') {\n this.body.dom.left.appendChild(this.dom.frame);\n }\n else {\n this.body.dom.right.appendChild(this.dom.frame);\n }\n }\n\n if (!this.dom.lineContainer.parentNode) {\n this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer);\n }\n this.dom.lineContainer.style.display = 'block';\n }\n\n /**\n * Create the HTML DOM for the DataAxis\n */\n hide() {\n this.hidden = true;\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n\n this.dom.lineContainer.style.display = 'none';\n }\n\n /**\n * Set a range (start and end)\n * @param {number} start\n * @param {number} end\n */\n setRange(start, end) {\n this.range.start = start;\n this.range.end = end;\n }\n\n /**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\n redraw() {\n let resized = false;\n let activeGroups = 0;\n\n // Make sure the line container adheres to the vertical scrolling.\n this.dom.lineContainer.style.top = `${this.body.domProps.scrollTop}px`;\n\n for (const groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {\n activeGroups++;\n }\n }\n }\n if (this.amountOfGroups === 0 || activeGroups === 0) {\n this.hide();\n }\n else {\n this.show();\n this.height = Number(this.linegraphSVG.style.height.replace(\"px\", \"\"));\n\n // svg offsetheight did not work in firefox and explorer...\n this.dom.lineContainer.style.height = `${this.height}px`;\n this.width = this.options.visible === true ? Number((`${this.options.width}`).replace(\"px\", \"\")) : 0;\n\n const props = this.props;\n const frame = this.dom.frame;\n\n // update classname\n frame.className = 'vis-data-axis';\n\n // calculate character width and height\n this._calculateCharSize();\n\n const orientation = this.options.orientation;\n const showMinorLabels = this.options.showMinorLabels;\n const showMajorLabels = this.options.showMajorLabels;\n\n const backgroundHorizontalOffsetWidth = this.body.dom.backgroundHorizontal.offsetWidth;\n\n // determine the width and height of the elements for the axis\n props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;\n props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;\n\n props.minorLineWidth = backgroundHorizontalOffsetWidth - this.lineOffset - this.width + 2 * this.options.minorLinesOffset;\n props.minorLineHeight = 1;\n props.majorLineWidth = backgroundHorizontalOffsetWidth - this.lineOffset - this.width + 2 * this.options.majorLinesOffset;\n props.majorLineHeight = 1;\n\n // take frame offline while updating (is almost twice as fast)\n if (orientation === 'left') {\n frame.style.top = '0';\n frame.style.left = '0';\n frame.style.bottom = '';\n frame.style.width = `${this.width}px`;\n frame.style.height = `${this.height}px`;\n this.props.width = this.body.domProps.left.width;\n this.props.height = this.body.domProps.left.height;\n }\n else { // right\n frame.style.top = '';\n frame.style.bottom = '0';\n frame.style.left = '0';\n frame.style.width = `${this.width}px`;\n frame.style.height = `${this.height}px`;\n this.props.width = this.body.domProps.right.width;\n this.props.height = this.body.domProps.right.height;\n }\n\n resized = this._redrawLabels();\n resized = this._isResized() || resized;\n\n if (this.options.icons === true) {\n this._redrawGroupIcons();\n }\n else {\n this._cleanupIcons();\n }\n\n this._redrawTitle(orientation);\n }\n return resized;\n }\n\n /**\n * Repaint major and minor text labels and vertical grid lines\n *\n * @returns {boolean}\n * @private\n */\n _redrawLabels() {\n let resized = false;\n DOMutil.prepareElements(this.DOMelements.lines);\n DOMutil.prepareElements(this.DOMelements.labels);\n const orientation = this.options['orientation'];\n const customRange = this.options[orientation].range != undefined ? this.options[orientation].range : {};\n\n //Override range with manual options:\n let autoScaleEnd = true;\n if (customRange.max != undefined) {\n this.range.end = customRange.max;\n autoScaleEnd = false;\n }\n let autoScaleStart = true;\n if (customRange.min != undefined) {\n this.range.start = customRange.min;\n autoScaleStart = false;\n }\n\n this.scale = new DataScale(\n this.range.start,\n this.range.end,\n autoScaleStart,\n autoScaleEnd,\n this.dom.frame.offsetHeight,\n this.props.majorCharHeight,\n this.options.alignZeros,\n this.options[orientation].format\n );\n\n if (this.master === false && this.masterAxis != undefined) {\n this.scale.followScale(this.masterAxis.scale);\n this.dom.lineContainer.style.display = 'none';\n } else {\n this.dom.lineContainer.style.display = 'block';\n }\n\n //Is updated in side-effect of _redrawLabel():\n this.maxLabelSize = 0;\n\n const lines = this.scale.getLines();\n lines.forEach(\n line=> {\n const y = line.y;\n const isMajor = line.major;\n if (this.options['showMinorLabels'] && isMajor === false) {\n this._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-minor', this.props.minorCharHeight);\n }\n if (isMajor) {\n if (y >= 0) {\n this._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-major', this.props.majorCharHeight);\n }\n }\n if (this.master === true) {\n if (isMajor) {\n this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-major', this.options.majorLinesOffset, this.props.majorLineWidth);\n }\n else {\n this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-minor', this.options.minorLinesOffset, this.props.minorLineWidth);\n }\n }\n });\n\n // Note that title is rotated, so we're using the height, not width!\n let titleWidth = 0;\n if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {\n titleWidth = this.props.titleCharHeight;\n }\n const offset = this.options.icons === true ? Math.max(this.options.iconWidth, titleWidth) + this.options.labelOffsetX + 15 : titleWidth + this.options.labelOffsetX + 15;\n\n // this will resize the yAxis to accommodate the labels.\n if (this.maxLabelSize > (this.width - offset) && this.options.visible === true) {\n this.width = this.maxLabelSize + offset;\n this.options.width = `${this.width}px`;\n DOMutil.cleanupElements(this.DOMelements.lines);\n DOMutil.cleanupElements(this.DOMelements.labels);\n this.redraw();\n resized = true;\n }\n // this will resize the yAxis if it is too big for the labels.\n else if (this.maxLabelSize < (this.width - offset) && this.options.visible === true && this.width > this.minWidth) {\n this.width = Math.max(this.minWidth, this.maxLabelSize + offset);\n this.options.width = `${this.width}px`;\n DOMutil.cleanupElements(this.DOMelements.lines);\n DOMutil.cleanupElements(this.DOMelements.labels);\n this.redraw();\n resized = true;\n }\n else {\n DOMutil.cleanupElements(this.DOMelements.lines);\n DOMutil.cleanupElements(this.DOMelements.labels);\n resized = false;\n }\n\n return resized;\n }\n\n /**\n * converts value\n * @param {number} value\n * @returns {number} converted number\n */\n convertValue(value) {\n return this.scale.convertValue(value);\n }\n\n /**\n * converts value\n * @param {number} x\n * @returns {number} screen value\n */\n screenToValue(x) {\n return this.scale.screenToValue(x);\n }\n\n /**\n * Create a label for the axis at position x\n *\n * @param {number} y\n * @param {string} text\n * @param {'top'|'right'|'bottom'|'left'} orientation\n * @param {string} className\n * @param {number} characterHeight\n * @private\n */\n _redrawLabel(y, text, orientation, className, characterHeight) {\n // reuse redundant label\n const label = DOMutil.getDOMElement('div', this.DOMelements.labels, this.dom.frame); //this.dom.redundant.labels.shift();\n label.className = className;\n label.innerHTML = text;\n if (orientation === 'left') {\n label.style.left = `-${this.options.labelOffsetX}px`;\n label.style.textAlign = \"right\";\n }\n else {\n label.style.right = `-${this.options.labelOffsetX}px`;\n label.style.textAlign = \"left\";\n }\n\n label.style.top = `${y - 0.5 * characterHeight + this.options.labelOffsetY}px`;\n\n text += '';\n\n const largestWidth = Math.max(this.props.majorCharWidth, this.props.minorCharWidth);\n if (this.maxLabelSize < text.length * largestWidth) {\n this.maxLabelSize = text.length * largestWidth;\n }\n }\n\n /**\n * Create a minor line for the axis at position y\n * @param {number} y\n * @param {'top'|'right'|'bottom'|'left'} orientation\n * @param {string} className\n * @param {number} offset\n * @param {number} width\n */\n _redrawLine(y, orientation, className, offset, width) {\n if (this.master === true) {\n const line = DOMutil.getDOMElement('div', this.DOMelements.lines, this.dom.lineContainer); //this.dom.redundant.lines.shift();\n line.className = className;\n line.innerHTML = '';\n\n if (orientation === 'left') {\n line.style.left = `${this.width - offset}px`;\n }\n else {\n line.style.right = `${this.width - offset}px`;\n }\n\n line.style.width = `${width}px`;\n line.style.top = `${y}px`;\n }\n }\n\n /**\n * Create a title for the axis\n * @private\n * @param {'top'|'right'|'bottom'|'left'} orientation\n */\n _redrawTitle(orientation) {\n DOMutil.prepareElements(this.DOMelements.title);\n\n // Check if the title is defined for this axes\n if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {\n const title = DOMutil.getDOMElement('div', this.DOMelements.title, this.dom.frame);\n title.className = `vis-y-axis vis-title vis-${orientation}`;\n title.innerHTML = this.options[orientation].title.text;\n\n // Add style - if provided\n if (this.options[orientation].title.style !== undefined) {\n util.addCssText(title, this.options[orientation].title.style);\n }\n\n if (orientation === 'left') {\n title.style.left = `${this.props.titleCharHeight}px`;\n }\n else {\n title.style.right = `${this.props.titleCharHeight}px`;\n }\n\n title.style.width = `${this.height}px`;\n }\n\n // we need to clean up in case we did not use all elements.\n DOMutil.cleanupElements(this.DOMelements.title);\n }\n\n /**\n * Determine the size of text on the axis (both major and minor axis).\n * The size is calculated only once and then cached in this.props.\n * @private\n */\n _calculateCharSize() {\n // determine the char width and height on the minor axis\n if (!('minorCharHeight' in this.props)) {\n const textMinor = document.createTextNode('0');\n const measureCharMinor = document.createElement('div');\n measureCharMinor.className = 'vis-y-axis vis-minor vis-measure';\n measureCharMinor.appendChild(textMinor);\n this.dom.frame.appendChild(measureCharMinor);\n\n this.props.minorCharHeight = measureCharMinor.clientHeight;\n this.props.minorCharWidth = measureCharMinor.clientWidth;\n\n this.dom.frame.removeChild(measureCharMinor);\n }\n\n if (!('majorCharHeight' in this.props)) {\n const textMajor = document.createTextNode('0');\n const measureCharMajor = document.createElement('div');\n measureCharMajor.className = 'vis-y-axis vis-major vis-measure';\n measureCharMajor.appendChild(textMajor);\n this.dom.frame.appendChild(measureCharMajor);\n\n this.props.majorCharHeight = measureCharMajor.clientHeight;\n this.props.majorCharWidth = measureCharMajor.clientWidth;\n\n this.dom.frame.removeChild(measureCharMajor);\n }\n\n if (!('titleCharHeight' in this.props)) {\n const textTitle = document.createTextNode('0');\n const measureCharTitle = document.createElement('div');\n measureCharTitle.className = 'vis-y-axis vis-title vis-measure';\n measureCharTitle.appendChild(textTitle);\n this.dom.frame.appendChild(measureCharTitle);\n\n this.props.titleCharHeight = measureCharTitle.clientHeight;\n this.props.titleCharWidth = measureCharTitle.clientWidth;\n\n this.dom.frame.removeChild(measureCharTitle);\n }\n }\n}\n\nexport default DataAxis;\n","import * as DOMutil from '../../../DOMutil';\n\n/**\n *\n * @param {number | string} groupId\n * @param {Object} options // TODO: Describe options\n *\n * @constructor Points\n */\nfunction Points(groupId, options) { // eslint-disable-line no-unused-vars\n}\n\n/**\n * draw the data points\n *\n * @param {Array} dataset\n * @param {GraphGroup} group\n * @param {Object} framework | SVG DOM element\n * @param {number} [offset]\n */\nPoints.draw = function (dataset, group, framework, offset) {\n offset = offset || 0;\n var callback = getCallback(framework, group);\n\n for (var i = 0; i < dataset.length; i++) {\n if (!callback) {\n // draw the point the simple way.\n DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group), framework.svgElements, framework.svg, dataset[i].label);\n }\n else {\n var callbackResult = callback(dataset[i], group); // result might be true, false or an object\n if (callbackResult === true || typeof callbackResult === 'object') {\n DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group, callbackResult), framework.svgElements, framework.svg, dataset[i].label);\n }\n }\n }\n};\n\nPoints.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n var fillHeight = iconHeight * 0.5;\n\n var outline = DOMutil.getSVGElement(\"rect\", framework.svgElements, framework.svg);\n outline.setAttributeNS(null, \"x\", x);\n outline.setAttributeNS(null, \"y\", y - fillHeight);\n outline.setAttributeNS(null, \"width\", iconWidth);\n outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n //Don't call callback on icon\n DOMutil.drawPoint(x + 0.5 * iconWidth, y, getGroupTemplate(group), framework.svgElements, framework.svg);\n};\n\n/**\n *\n * @param {vis.Group} group\n * @param {any} callbackResult\n * @returns {{style: *, styles: (*|string), size: *, className: *}}\n */\nfunction getGroupTemplate(group, callbackResult) {\n callbackResult = (typeof callbackResult === 'undefined') ? {} : callbackResult;\n return {\n style: callbackResult.style || group.options.drawPoints.style,\n styles: callbackResult.styles || group.options.drawPoints.styles,\n size: callbackResult.size || group.options.drawPoints.size,\n className: callbackResult.className || group.className\n };\n}\n\n/**\n *\n * @param {Object} framework | SVG DOM element\n * @param {vis.Group} group\n * @returns {function}\n */\nfunction getCallback(framework, group) {\n var callback = undefined;\n // check for the graph2d onRender\n if (framework.options && framework.options.drawPoints && framework.options.drawPoints.onRender && typeof framework.options.drawPoints.onRender == 'function') {\n callback = framework.options.drawPoints.onRender;\n }\n\n // override it with the group onRender if defined\n if (group.group.options && group.group.options.drawPoints && group.group.options.drawPoints.onRender && typeof group.group.options.drawPoints.onRender == 'function') {\n callback = group.group.options.drawPoints.onRender;\n }\n return callback;\n}\n\nexport default Points;\n","import * as DOMutil from '../../../DOMutil';\nimport Points from './points';\n\n/**\n *\n * @param {vis.GraphGroup.id} groupId\n * @param {Object} options // TODO: Describe options\n * @constructor Bargraph\n */\nfunction Bargraph(groupId, options) { // eslint-disable-line no-unused-vars\n}\n\nBargraph.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n var fillHeight = iconHeight * 0.5;\n var outline = DOMutil.getSVGElement(\"rect\", framework.svgElements, framework.svg);\n outline.setAttributeNS(null, \"x\", x);\n outline.setAttributeNS(null, \"y\", y - fillHeight);\n outline.setAttributeNS(null, \"width\", iconWidth);\n outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n var barWidth = Math.round(0.3 * iconWidth);\n var originalWidth = group.options.barChart.width;\n var scale = originalWidth / barWidth;\n var bar1Height = Math.round(0.4 * iconHeight);\n var bar2Height = Math.round(0.75 * iconHeight);\n\n var offset = Math.round((iconWidth - (2 * barWidth)) / 3);\n\n DOMutil.drawBar(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, barWidth, bar1Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);\n DOMutil.drawBar(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, barWidth, bar2Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);\n\n if (group.options.drawPoints.enabled == true) {\n var groupTemplate = {\n style: group.options.drawPoints.style,\n styles: group.options.drawPoints.styles,\n size: (group.options.drawPoints.size / scale),\n className: group.className\n };\n DOMutil.drawPoint(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, groupTemplate, framework.svgElements, framework.svg);\n DOMutil.drawPoint(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, groupTemplate, framework.svgElements, framework.svg);\n }\n};\n\n/**\n * draw a bar graph\n *\n * @param {Array.} groupIds\n * @param {Object} processedGroupData\n * @param {{svg: Object, svgElements: Array., options: Object, groups: Array.}} framework\n */\nBargraph.draw = function (groupIds, processedGroupData, framework) {\n var combinedData = [];\n var intersections = {};\n var coreDistance;\n var key, drawData;\n var group;\n var i, j;\n var barPoints = 0;\n\n // combine all barchart data\n for (i = 0; i < groupIds.length; i++) {\n group = framework.groups[groupIds[i]];\n if (group.options.style === 'bar') {\n if (group.visible === true && (framework.options.groups.visibility[groupIds[i]] === undefined || framework.options.groups.visibility[groupIds[i]] === true)) {\n for (j = 0; j < processedGroupData[groupIds[i]].length; j++) {\n combinedData.push({\n screen_x: processedGroupData[groupIds[i]][j].screen_x,\n screen_end: processedGroupData[groupIds[i]][j].screen_end,\n screen_y: processedGroupData[groupIds[i]][j].screen_y,\n x: processedGroupData[groupIds[i]][j].x,\n end: processedGroupData[groupIds[i]][j].end,\n y: processedGroupData[groupIds[i]][j].y,\n groupId: groupIds[i],\n label: processedGroupData[groupIds[i]][j].label\n });\n barPoints += 1;\n }\n }\n }\n }\n\n if (barPoints === 0) {\n return;\n }\n\n // sort by time and by group\n combinedData.sort(function (a, b) {\n if (a.screen_x === b.screen_x) {\n return a.groupId < b.groupId ? -1 : 1;\n }\n else {\n return a.screen_x - b.screen_x;\n }\n });\n\n // get intersections\n Bargraph._getDataIntersections(intersections, combinedData);\n\n // plot barchart\n for (i = 0; i < combinedData.length; i++) {\n group = framework.groups[combinedData[i].groupId];\n var minWidth = group.options.barChart.minWidth != undefined ? group.options.barChart.minWidth : 0.1 * group.options.barChart.width;\n\n key = combinedData[i].screen_x;\n var heightOffset = 0;\n if (intersections[key] === undefined) {\n if (i + 1 < combinedData.length) {\n coreDistance = Math.abs(combinedData[i + 1].screen_x - key);\n }\n drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);\n }\n else {\n var nextKey = i + (intersections[key].amount - intersections[key].resolved);\n if (nextKey < combinedData.length) {\n coreDistance = Math.abs(combinedData[nextKey].screen_x - key);\n }\n drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);\n intersections[key].resolved += 1;\n\n if (group.options.stack === true && group.options.excludeFromStacking !== true) {\n if (combinedData[i].screen_y < group.zeroPosition) {\n heightOffset = intersections[key].accumulatedNegative;\n intersections[key].accumulatedNegative += group.zeroPosition - combinedData[i].screen_y;\n }\n else {\n heightOffset = intersections[key].accumulatedPositive;\n intersections[key].accumulatedPositive += group.zeroPosition - combinedData[i].screen_y;\n }\n }\n else if (group.options.barChart.sideBySide === true) {\n drawData.width = drawData.width / intersections[key].amount;\n drawData.offset += (intersections[key].resolved) * drawData.width - (0.5 * drawData.width * (intersections[key].amount + 1));\n }\n }\n \n let dataWidth = drawData.width;\n let start = combinedData[i].screen_x;\n\n // are we drawing explicit boxes? (we supplied an end value)\n if (combinedData[i].screen_end != undefined){\n dataWidth = combinedData[i].screen_end - combinedData[i].screen_x;\n start += (dataWidth * 0.5);\n }\n else {\n start += drawData.offset\n }\n\n DOMutil.drawBar(start, combinedData[i].screen_y - heightOffset, dataWidth, group.zeroPosition - combinedData[i].screen_y, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);\n\n // draw points\n if (group.options.drawPoints.enabled === true) {\n let pointData = {\n screen_x: combinedData[i].screen_x,\n screen_y: combinedData[i].screen_y - heightOffset,\n x: combinedData[i].x,\n y: combinedData[i].y,\n groupId: combinedData[i].groupId,\n label: combinedData[i].label\n };\n Points.draw([pointData], group, framework, drawData.offset);\n //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);\n }\n }\n};\n\n\n/**\n * Fill the intersections object with counters of how many datapoints share the same x coordinates\n * @param {Object} intersections\n * @param {Array.} combinedData\n * @private\n */\nBargraph._getDataIntersections = function (intersections, combinedData) {\n // get intersections\n var coreDistance;\n for (var i = 0; i < combinedData.length; i++) {\n if (i + 1 < combinedData.length) {\n coreDistance = Math.abs(combinedData[i + 1].screen_x - combinedData[i].screen_x);\n }\n if (i > 0) {\n coreDistance = Math.min(coreDistance, Math.abs(combinedData[i - 1].screen_x - combinedData[i].screen_x));\n }\n if (coreDistance === 0) {\n if (intersections[combinedData[i].screen_x] === undefined) {\n intersections[combinedData[i].screen_x] = {\n amount: 0,\n resolved: 0,\n accumulatedPositive: 0,\n accumulatedNegative: 0\n };\n }\n intersections[combinedData[i].screen_x].amount += 1;\n }\n }\n};\n\n\n/**\n * Get the width and offset for bargraphs based on the coredistance between datapoints\n *\n * @param {number} coreDistance\n * @param {vis.Group} group\n * @param {number} minWidth\n * @returns {{width: number, offset: number}}\n * @private\n */\nBargraph._getSafeDrawData = function (coreDistance, group, minWidth) {\n var width, offset;\n if (coreDistance < group.options.barChart.width && coreDistance > 0) {\n width = coreDistance < minWidth ? minWidth : coreDistance\n\n offset = 0; // recalculate offset with the new width;\n if (group.options.barChart.align === 'left') {\n offset -= 0.5 * coreDistance;\n }\n else if (group.options.barChart.align === 'right') {\n offset += 0.5 * coreDistance;\n }\n }\n else {\n // default settings\n width = group.options.barChart.width;\n offset = 0;\n if (group.options.barChart.align === 'left') {\n offset -= 0.5 * group.options.barChart.width;\n }\n else if (group.options.barChart.align === 'right') {\n offset += 0.5 * group.options.barChart.width;\n }\n }\n\n return {width: width, offset: offset};\n};\n\nBargraph.getStackedYRange = function (combinedData, groupRanges, groupIds, groupLabel, orientation) {\n if (combinedData.length > 0) {\n // sort by time and by group\n combinedData.sort(function (a, b) {\n if (a.screen_x === b.screen_x) {\n return a.groupId < b.groupId ? -1 : 1;\n }\n else {\n return a.screen_x - b.screen_x;\n }\n });\n var intersections = {};\n\n Bargraph._getDataIntersections(intersections, combinedData);\n groupRanges[groupLabel] = Bargraph._getStackedYRange(intersections, combinedData);\n groupRanges[groupLabel].yAxisOrientation = orientation;\n groupIds.push(groupLabel);\n }\n};\n\nBargraph._getStackedYRange = function (intersections, combinedData) {\n var key;\n var yMin = combinedData[0].screen_y;\n var yMax = combinedData[0].screen_y;\n for (var i = 0; i < combinedData.length; i++) {\n key = combinedData[i].screen_x;\n if (intersections[key] === undefined) {\n yMin = yMin > combinedData[i].screen_y ? combinedData[i].screen_y : yMin;\n yMax = yMax < combinedData[i].screen_y ? combinedData[i].screen_y : yMax;\n }\n else {\n if (combinedData[i].screen_y < 0) {\n intersections[key].accumulatedNegative += combinedData[i].screen_y;\n }\n else {\n intersections[key].accumulatedPositive += combinedData[i].screen_y;\n }\n }\n }\n for (var xpos in intersections) {\n if (intersections.hasOwnProperty(xpos)) {\n yMin = yMin > intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMin;\n yMin = yMin > intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMin;\n yMax = yMax < intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMax;\n yMax = yMax < intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMax;\n }\n }\n\n return {min: yMin, max: yMax};\n};\n\nexport default Bargraph;","import * as DOMutil from '../../../DOMutil';\n\n/**\n *\n * @param {vis.GraphGroup.id} groupId\n * @param {Object} options // TODO: Describe options\n * @constructor Line\n */\nfunction Line(groupId, options) { // eslint-disable-line no-unused-vars\n}\n\nLine.calcPath = function (dataset, group) {\n if (dataset != null) {\n if (dataset.length > 0) {\n var d = [];\n\n // construct path from dataset\n if (group.options.interpolation.enabled == true) {\n d = Line._catmullRom(dataset, group);\n }\n else {\n d = Line._linear(dataset);\n }\n return d;\n }\n }\n};\n\nLine.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n var fillHeight = iconHeight * 0.5;\n var path, fillPath;\n\n var outline = DOMutil.getSVGElement(\"rect\", framework.svgElements, framework.svg);\n outline.setAttributeNS(null, \"x\", x);\n outline.setAttributeNS(null, \"y\", y - fillHeight);\n outline.setAttributeNS(null, \"width\", iconWidth);\n outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n path = DOMutil.getSVGElement(\"path\", framework.svgElements, framework.svg);\n path.setAttributeNS(null, \"class\", group.className);\n if (group.style !== undefined) {\n path.setAttributeNS(null, \"style\", group.style);\n }\n\n path.setAttributeNS(null, \"d\", \"M\" + x + \",\" + y + \" L\" + (x + iconWidth) + \",\" + y + \"\");\n if (group.options.shaded.enabled == true) {\n fillPath = DOMutil.getSVGElement(\"path\", framework.svgElements, framework.svg);\n if (group.options.shaded.orientation == 'top') {\n fillPath.setAttributeNS(null, \"d\", \"M\" + x + \", \" + (y - fillHeight) +\n \"L\" + x + \",\" + y + \" L\" + (x + iconWidth) + \",\" + y + \" L\" + (x + iconWidth) + \",\" + (y - fillHeight));\n }\n else {\n fillPath.setAttributeNS(null, \"d\", \"M\" + x + \",\" + y + \" \" +\n \"L\" + x + \",\" + (y + fillHeight) + \" \" +\n \"L\" + (x + iconWidth) + \",\" + (y + fillHeight) +\n \"L\" + (x + iconWidth) + \",\" + y);\n }\n fillPath.setAttributeNS(null, \"class\", group.className + \" vis-icon-fill\");\n if (group.options.shaded.style !== undefined && group.options.shaded.style !== \"\") {\n fillPath.setAttributeNS(null, \"style\", group.options.shaded.style);\n }\n }\n\n if (group.options.drawPoints.enabled == true) {\n var groupTemplate = {\n style: group.options.drawPoints.style,\n styles: group.options.drawPoints.styles,\n size: group.options.drawPoints.size,\n className: group.className\n };\n DOMutil.drawPoint(x + 0.5 * iconWidth, y, groupTemplate, framework.svgElements, framework.svg);\n }\n};\n\nLine.drawShading = function (pathArray, group, subPathArray, framework) {\n // append shading to the path\n if (group.options.shaded.enabled == true) {\n var svgHeight = Number(framework.svg.style.height.replace('px',''));\n var fillPath = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);\n var type = \"L\";\n if (group.options.interpolation.enabled == true){\n type = \"C\";\n }\n var dFill;\n var zero = 0;\n if (group.options.shaded.orientation == 'top') {\n zero = 0;\n }\n else if (group.options.shaded.orientation == 'bottom') {\n zero = svgHeight;\n }\n else {\n zero = Math.min(Math.max(0, group.zeroPosition), svgHeight);\n }\n if (group.options.shaded.orientation == 'group' && (subPathArray != null && subPathArray != undefined)) {\n dFill = 'M' + pathArray[0][0]+ \",\"+pathArray[0][1] + \" \" +\n this.serializePath(pathArray,type,false) +\n ' L'+ subPathArray[subPathArray.length-1][0]+ \",\" + subPathArray[subPathArray.length-1][1] + \" \" +\n this.serializePath(subPathArray,type,true) +\n subPathArray[0][0]+ \",\"+subPathArray[0][1] + \" Z\";\n }\n else {\n dFill = 'M' + pathArray[0][0]+ \",\"+pathArray[0][1] + \" \" +\n this.serializePath(pathArray,type,false) +\n ' V' + zero + ' H'+ pathArray[0][0] + \" Z\";\n }\n\n fillPath.setAttributeNS(null, 'class', group.className + ' vis-fill');\n if (group.options.shaded.style !== undefined) {\n fillPath.setAttributeNS(null, 'style', group.options.shaded.style);\n }\n fillPath.setAttributeNS(null, 'd', dFill);\n }\n};\n\n/**\n * draw a line graph\n *\n * @param {Array.} pathArray\n * @param {vis.Group} group\n * @param {{svg: Object, svgElements: Array., options: Object, groups: Array.}} framework\n */\nLine.draw = function (pathArray, group, framework) {\n if (pathArray != null && pathArray != undefined) {\n var path = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);\n path.setAttributeNS(null, \"class\", group.className);\n if (group.style !== undefined) {\n path.setAttributeNS(null, \"style\", group.style);\n }\n\n var type = \"L\";\n if (group.options.interpolation.enabled == true){\n type = \"C\";\n }\n // copy properties to path for drawing.\n path.setAttributeNS(null, 'd', 'M' + pathArray[0][0]+ \",\"+pathArray[0][1] + \" \" + this.serializePath(pathArray,type,false));\n }\n};\n\nLine.serializePath = function(pathArray,type,inverse){\n if (pathArray.length < 2){\n //Too little data to create a path.\n return \"\";\n }\n var d = type;\n var i;\n if (inverse){\n for (i = pathArray.length-2; i > 0; i--){\n d += pathArray[i][0] + \",\" + pathArray[i][1] + \" \";\n }\n }\n else {\n for (i = 1; i < pathArray.length; i++){\n d += pathArray[i][0] + \",\" + pathArray[i][1] + \" \";\n }\n }\n return d;\n};\n\n/**\n * This uses an uniform parametrization of the interpolation algorithm:\n * 'On the Parameterization of Catmull-Rom Curves' by Cem Yuksel et al.\n * @param {Array.} data\n * @returns {string}\n * @private\n */\nLine._catmullRomUniform = function (data) {\n // catmull rom\n var p0, p1, p2, p3, bp1, bp2;\n var d = [];\n d.push( [ Math.round(data[0].screen_x) , Math.round(data[0].screen_y) ]);\n var normalization = 1 / 6;\n var length = data.length;\n for (var i = 0; i < length - 1; i++) {\n\n p0 = (i == 0) ? data[0] : data[i - 1];\n p1 = data[i];\n p2 = data[i + 1];\n p3 = (i + 2 < length) ? data[i + 2] : p2;\n\n\n // Catmull-Rom to Cubic Bezier conversion matrix\n // 0 1 0 0\n // -1/6 1 1/6 0\n // 0 1/6 1 -1/6\n // 0 0 1 0\n\n // bp0 = { x: p1.x, y: p1.y };\n bp1 = {\n screen_x: ((-p0.screen_x + 6 * p1.screen_x + p2.screen_x) * normalization),\n screen_y: ((-p0.screen_y + 6 * p1.screen_y + p2.screen_y) * normalization)\n };\n bp2 = {\n screen_x: (( p1.screen_x + 6 * p2.screen_x - p3.screen_x) * normalization),\n screen_y: (( p1.screen_y + 6 * p2.screen_y - p3.screen_y) * normalization)\n };\n // bp0 = { x: p2.x, y: p2.y };\n\n d.push( [ bp1.screen_x , bp1.screen_y ]);\n d.push( [ bp2.screen_x , bp2.screen_y ]);\n d.push( [ p2.screen_x , p2.screen_y ]);\n }\n\n return d;\n};\n\n/**\n * This uses either the chordal or centripetal parameterization of the catmull-rom algorithm.\n * By default, the centripetal parameterization is used because this gives the nicest results.\n * These parameterizations are relatively heavy because the distance between 4 points have to be calculated.\n *\n * One optimization can be used to reuse distances since this is a sliding window approach.\n * @param {Array.} data\n * @param {vis.GraphGroup} group\n * @returns {string}\n * @private\n */\nLine._catmullRom = function (data, group) {\n var alpha = group.options.interpolation.alpha;\n if (alpha == 0 || alpha === undefined) {\n return this._catmullRomUniform(data);\n }\n else {\n var p0, p1, p2, p3, bp1, bp2, d1, d2, d3, A, B, N, M;\n var d3powA, d2powA, d3pow2A, d2pow2A, d1pow2A, d1powA;\n var d = [];\n d.push( [ Math.round(data[0].screen_x) , Math.round(data[0].screen_y) ]);\n var length = data.length;\n for (var i = 0; i < length - 1; i++) {\n\n p0 = (i == 0) ? data[0] : data[i - 1];\n p1 = data[i];\n p2 = data[i + 1];\n p3 = (i + 2 < length) ? data[i + 2] : p2;\n\n d1 = Math.sqrt(Math.pow(p0.screen_x - p1.screen_x, 2) + Math.pow(p0.screen_y - p1.screen_y, 2));\n d2 = Math.sqrt(Math.pow(p1.screen_x - p2.screen_x, 2) + Math.pow(p1.screen_y - p2.screen_y, 2));\n d3 = Math.sqrt(Math.pow(p2.screen_x - p3.screen_x, 2) + Math.pow(p2.screen_y - p3.screen_y, 2));\n\n // Catmull-Rom to Cubic Bezier conversion matrix\n\n // A = 2d1^2a + 3d1^a * d2^a + d3^2a\n // B = 2d3^2a + 3d3^a * d2^a + d2^2a\n\n // [ 0 1 0 0 ]\n // [ -d2^2a /N A/N d1^2a /N 0 ]\n // [ 0 d3^2a /M B/M -d2^2a /M ]\n // [ 0 0 1 0 ]\n\n d3powA = Math.pow(d3, alpha);\n d3pow2A = Math.pow(d3, 2 * alpha);\n d2powA = Math.pow(d2, alpha);\n d2pow2A = Math.pow(d2, 2 * alpha);\n d1powA = Math.pow(d1, alpha);\n d1pow2A = Math.pow(d1, 2 * alpha);\n\n A = 2 * d1pow2A + 3 * d1powA * d2powA + d2pow2A;\n B = 2 * d3pow2A + 3 * d3powA * d2powA + d2pow2A;\n N = 3 * d1powA * (d1powA + d2powA);\n if (N > 0) {\n N = 1 / N;\n }\n M = 3 * d3powA * (d3powA + d2powA);\n if (M > 0) {\n M = 1 / M;\n }\n\n bp1 = {\n screen_x: ((-d2pow2A * p0.screen_x + A * p1.screen_x + d1pow2A * p2.screen_x) * N),\n screen_y: ((-d2pow2A * p0.screen_y + A * p1.screen_y + d1pow2A * p2.screen_y) * N)\n };\n\n bp2 = {\n screen_x: (( d3pow2A * p1.screen_x + B * p2.screen_x - d2pow2A * p3.screen_x) * M),\n screen_y: (( d3pow2A * p1.screen_y + B * p2.screen_y - d2pow2A * p3.screen_y) * M)\n };\n\n if (bp1.screen_x == 0 && bp1.screen_y == 0) {\n bp1 = p1;\n }\n if (bp2.screen_x == 0 && bp2.screen_y == 0) {\n bp2 = p2;\n }\n d.push( [ bp1.screen_x , bp1.screen_y ]);\n d.push( [ bp2.screen_x , bp2.screen_y ]);\n d.push( [ p2.screen_x , p2.screen_y ]);\n }\n\n return d;\n }\n};\n\n/**\n * this generates the SVG path for a linear drawing between datapoints.\n * @param {Array.} data\n * @returns {string}\n * @private\n */\nLine._linear = function (data) {\n // linear\n var d = [];\n for (var i = 0; i < data.length; i++) {\n d.push([ data[i].screen_x , data[i].screen_y ]);\n }\n return d;\n};\n\nexport default Line;\n","import util from '../../util';\nimport Bars from './graph2d_types/bar';\nimport Lines from './graph2d_types/line';\nimport Points from './graph2d_types/points';\n\n/**\n * /**\n * @param {object} group | the object of the group from the dataset\n * @param {string} groupId | ID of the group\n * @param {object} options | the default options\n * @param {array} groupsUsingDefaultStyles | this array has one entree.\n * It is passed as an array so it is passed by reference.\n * It enumerates through the default styles\n * @constructor GraphGroup\n */\nfunction GraphGroup(group, groupId, options, groupsUsingDefaultStyles) {\n this.id = groupId;\n var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'drawPoints', 'shaded', 'interpolation', 'zIndex','excludeFromStacking', 'excludeFromLegend'];\n this.options = util.selectiveBridgeObject(fields, options);\n this.usingDefaultStyle = group.className === undefined;\n this.groupsUsingDefaultStyles = groupsUsingDefaultStyles;\n this.zeroPosition = 0;\n this.update(group);\n if (this.usingDefaultStyle == true) {\n this.groupsUsingDefaultStyles[0] += 1;\n }\n this.itemsData = [];\n this.visible = group.visible === undefined ? true : group.visible;\n}\n\n/**\n * this loads a reference to all items in this group into this group.\n * @param {array} items\n */\nGraphGroup.prototype.setItems = function (items) {\n if (items != null) {\n this.itemsData = items;\n if (this.options.sort == true) {\n util.insertSort(this.itemsData,function (a, b) {\n return a.x > b.x ? 1 : -1;\n });\n }\n }\n else {\n this.itemsData = [];\n }\n};\n\nGraphGroup.prototype.getItems = function () {\n return this.itemsData;\n};\n\n/**\n * this is used for barcharts and shading, this way, we only have to calculate it once.\n * @param {number} pos\n */\nGraphGroup.prototype.setZeroPosition = function (pos) {\n this.zeroPosition = pos;\n};\n\n/**\n * set the options of the graph group over the default options.\n * @param {Object} options\n */\nGraphGroup.prototype.setOptions = function (options) {\n if (options !== undefined) {\n var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'zIndex','excludeFromStacking', 'excludeFromLegend'];\n util.selectiveDeepExtend(fields, this.options, options);\n\n // if the group's drawPoints is a function delegate the callback to the onRender property\n if (typeof options.drawPoints == 'function') {\n options.drawPoints = {\n onRender: options.drawPoints\n }\n }\n\n util.mergeOptions(this.options, options, 'interpolation');\n util.mergeOptions(this.options, options, 'drawPoints');\n util.mergeOptions(this.options, options, 'shaded');\n\n if (options.interpolation) {\n if (typeof options.interpolation == 'object') {\n if (options.interpolation.parametrization) {\n if (options.interpolation.parametrization == 'uniform') {\n this.options.interpolation.alpha = 0;\n }\n else if (options.interpolation.parametrization == 'chordal') {\n this.options.interpolation.alpha = 1.0;\n }\n else {\n this.options.interpolation.parametrization = 'centripetal';\n this.options.interpolation.alpha = 0.5;\n }\n }\n }\n }\n }\n};\n\n\n/**\n * this updates the current group class with the latest group dataset entree, used in _updateGroup in linegraph\n * @param {vis.Group} group\n */\nGraphGroup.prototype.update = function (group) {\n this.group = group;\n this.content = group.content || 'graph';\n this.className = group.className || this.className || 'vis-graph-group' + this.groupsUsingDefaultStyles[0] % 10;\n this.visible = group.visible === undefined ? true : group.visible;\n this.style = group.style;\n this.setOptions(group.options);\n};\n\n/**\n * return the legend entree for this group.\n *\n * @param {number} iconWidth\n * @param {number} iconHeight\n * @param {{svg: (*|Element), svgElements: Object, options: Object, groups: Array.}} framework\n * @param {number} x\n * @param {number} y\n * @returns {{icon: (*|Element), label: (*|string), orientation: *}}\n */\nGraphGroup.prototype.getLegend = function (iconWidth, iconHeight, framework, x, y) {\n if (framework == undefined || framework == null) {\n var svg = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\n framework = {svg: svg, svgElements:{}, options: this.options, groups: [this]}\n }\n if (x == undefined || x == null){\n x = 0;\n }\n if (y == undefined || y == null){\n y = 0.5 * iconHeight;\n }\n switch (this.options.style){\n case \"line\":\n Lines.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n break;\n case \"points\": //explicit no break\n case \"point\":\n Points.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n break;\n case \"bar\":\n Bars.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n break;\n }\n return {icon: framework.svg, label: this.content, orientation: this.options.yAxisOrientation};\n};\n\nGraphGroup.prototype.getYRange = function (groupData) {\n var yMin = groupData[0].y;\n var yMax = groupData[0].y;\n for (var j = 0; j < groupData.length; j++) {\n yMin = yMin > groupData[j].y ? groupData[j].y : yMin;\n yMax = yMax < groupData[j].y ? groupData[j].y : yMax;\n }\n return {min: yMin, max: yMax, yAxisOrientation: this.options.yAxisOrientation};\n};\n\nexport default GraphGroup;\n","import util from '../../util';\nimport * as DOMutil from '../../DOMutil';\nimport Component from './Component';\n\n/**\n * Legend for Graph2d\n *\n * @param {vis.Graph2d.body} body\n * @param {vis.Graph2d.options} options\n * @param {number} side\n * @param {vis.LineGraph.options} linegraphOptions\n * @constructor Legend\n * @extends Component\n */\nfunction Legend(body, options, side, linegraphOptions) {\n this.body = body;\n this.defaultOptions = {\n enabled: false,\n icons: true,\n iconSize: 20,\n iconSpacing: 6,\n left: {\n visible: true,\n position: 'top-left' // top/bottom - left,center,right\n },\n right: {\n visible: true,\n position: 'top-right' // top/bottom - left,center,right\n }\n };\n\n this.side = side;\n this.options = util.extend({}, this.defaultOptions);\n this.linegraphOptions = linegraphOptions;\n\n this.svgElements = {};\n this.dom = {};\n this.groups = {};\n this.amountOfGroups = 0;\n this._create();\n this.framework = {svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups};\n\n this.setOptions(options);\n}\n\nLegend.prototype = new Component();\n\nLegend.prototype.clear = function() {\n this.groups = {};\n this.amountOfGroups = 0;\n};\n\nLegend.prototype.addGroup = function(label, graphOptions) {\n\n // Include a group only if the group option 'excludeFromLegend: false' is not set.\n if (graphOptions.options.excludeFromLegend != true) {\n if (!this.groups.hasOwnProperty(label)) {\n this.groups[label] = graphOptions;\n }\n this.amountOfGroups += 1;\n }\n};\n\nLegend.prototype.updateGroup = function(label, graphOptions) {\n this.groups[label] = graphOptions;\n};\n\nLegend.prototype.removeGroup = function(label) {\n if (this.groups.hasOwnProperty(label)) {\n delete this.groups[label];\n this.amountOfGroups -= 1;\n }\n};\n\nLegend.prototype._create = function() {\n this.dom.frame = document.createElement('div');\n this.dom.frame.className = 'vis-legend';\n this.dom.frame.style.position = \"absolute\";\n this.dom.frame.style.top = \"10px\";\n this.dom.frame.style.display = \"block\";\n\n this.dom.textArea = document.createElement('div');\n this.dom.textArea.className = 'vis-legend-text';\n this.dom.textArea.style.position = \"relative\";\n this.dom.textArea.style.top = \"0px\";\n\n this.svg = document.createElementNS('http://www.w3.org/2000/svg',\"svg\");\n this.svg.style.position = 'absolute';\n this.svg.style.top = 0 +'px';\n this.svg.style.width = this.options.iconSize + 5 + 'px';\n this.svg.style.height = '100%';\n\n this.dom.frame.appendChild(this.svg);\n this.dom.frame.appendChild(this.dom.textArea);\n};\n\n/**\n * Hide the component from the DOM\n */\nLegend.prototype.hide = function() {\n // remove the frame containing the items\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n};\n\n/**\n * Show the component in the DOM (when not already visible).\n */\nLegend.prototype.show = function() {\n // show frame containing the items\n if (!this.dom.frame.parentNode) {\n this.body.dom.center.appendChild(this.dom.frame);\n }\n};\n\nLegend.prototype.setOptions = function(options) {\n var fields = ['enabled','orientation','icons','left','right'];\n util.selectiveDeepExtend(fields, this.options, options);\n};\n\nLegend.prototype.redraw = function() {\n var activeGroups = 0;\n var groupArray = Object.keys(this.groups);\n groupArray.sort(function (a,b) {\n return (a < b ? -1 : 1);\n })\n\n for (var i = 0; i < groupArray.length; i++) {\n var groupId = groupArray[i];\n if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {\n activeGroups++;\n }\n }\n\n if (this.options[this.side].visible == false || this.amountOfGroups == 0 || this.options.enabled == false || activeGroups == 0) {\n this.hide();\n }\n else {\n this.show();\n if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'bottom-left') {\n this.dom.frame.style.left = '4px';\n this.dom.frame.style.textAlign = \"left\";\n this.dom.textArea.style.textAlign = \"left\";\n this.dom.textArea.style.left = (this.options.iconSize + 15) + 'px';\n this.dom.textArea.style.right = '';\n this.svg.style.left = 0 +'px';\n this.svg.style.right = '';\n }\n else {\n this.dom.frame.style.right = '4px';\n this.dom.frame.style.textAlign = \"right\";\n this.dom.textArea.style.textAlign = \"right\";\n this.dom.textArea.style.right = (this.options.iconSize + 15) + 'px';\n this.dom.textArea.style.left = '';\n this.svg.style.right = 0 +'px';\n this.svg.style.left = '';\n }\n\n if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'top-right') {\n this.dom.frame.style.top = 4 - Number(this.body.dom.center.style.top.replace(\"px\",\"\")) + 'px';\n this.dom.frame.style.bottom = '';\n }\n else {\n var scrollableHeight = this.body.domProps.center.height - this.body.domProps.centerContainer.height;\n this.dom.frame.style.bottom = 4 + scrollableHeight + Number(this.body.dom.center.style.top.replace(\"px\",\"\")) + 'px';\n this.dom.frame.style.top = '';\n }\n\n if (this.options.icons == false) {\n this.dom.frame.style.width = this.dom.textArea.offsetWidth + 10 + 'px';\n this.dom.textArea.style.right = '';\n this.dom.textArea.style.left = '';\n this.svg.style.width = '0px';\n }\n else {\n this.dom.frame.style.width = this.options.iconSize + 15 + this.dom.textArea.offsetWidth + 10 + 'px'\n this.drawLegendIcons();\n }\n\n var content = '';\n for (i = 0; i < groupArray.length; i++) {\n groupId = groupArray[i];\n if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {\n content += this.groups[groupId].content + '
';\n }\n }\n this.dom.textArea.innerHTML = content;\n this.dom.textArea.style.lineHeight = ((0.75 * this.options.iconSize) + this.options.iconSpacing) + 'px';\n }\n};\n\nLegend.prototype.drawLegendIcons = function() {\n if (this.dom.frame.parentNode) {\n var groupArray = Object.keys(this.groups);\n groupArray.sort(function (a,b) {\n return (a < b ? -1 : 1);\n });\n\n // this resets the elements so the order is maintained\n DOMutil.resetElements(this.svgElements);\n\n var padding = window.getComputedStyle(this.dom.frame).paddingTop;\n var iconOffset = Number(padding.replace('px',''));\n var x = iconOffset;\n var iconWidth = this.options.iconSize;\n var iconHeight = 0.75 * this.options.iconSize;\n var y = iconOffset + 0.5 * iconHeight + 3;\n\n this.svg.style.width = iconWidth + 5 + iconOffset + 'px';\n\n for (var i = 0; i < groupArray.length; i++) {\n var groupId = groupArray[i];\n if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {\n this.groups[groupId].getLegend(iconWidth, iconHeight, this.framework, x, y);\n y += iconHeight + this.options.iconSpacing;\n }\n }\n }\n};\n\nexport default Legend;\n","import util from '../../util';\nimport * as DOMutil from '../../DOMutil';\nimport { DataSet } from 'vis-data';\nimport { DataView } from 'vis-data';\nimport Component from './Component';\nimport DataAxis from './DataAxis';\nimport GraphGroup from './GraphGroup';\nimport Legend from './Legend';\nimport Bars from './graph2d_types/bar';\nimport Lines from './graph2d_types/line';\nimport Points from './graph2d_types/points';\n\nvar UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items\n\n/**\n * This is the constructor of the LineGraph. It requires a Timeline body and options.\n *\n * @param {vis.Timeline.body} body\n * @param {Object} options\n * @constructor LineGraph\n * @extends Component\n */\nfunction LineGraph(body, options) {\n this.id = util.randomUUID();\n this.body = body;\n\n this.defaultOptions = {\n yAxisOrientation: 'left',\n defaultGroup: 'default',\n sort: true,\n sampling: true,\n stack: false,\n graphHeight: '400px',\n shaded: {\n enabled: false,\n orientation: 'bottom' // top, bottom, zero\n },\n style: 'line', // line, bar\n barChart: {\n width: 50,\n sideBySide: false,\n align: 'center' // left, center, right\n },\n interpolation: {\n enabled: true,\n parametrization: 'centripetal', // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n alpha: 0.5\n },\n drawPoints: {\n enabled: true,\n size: 6,\n style: 'square' // square, circle\n },\n dataAxis: {}, //Defaults are done on DataAxis level\n legend: {}, //Defaults are done on Legend level\n groups: {\n visibility: {}\n }\n };\n\n // options is shared by this lineGraph and all its items\n this.options = util.extend({}, this.defaultOptions);\n this.dom = {};\n this.props = {};\n this.hammer = null;\n this.groups = {};\n this.abortedGraphUpdate = false;\n this.updateSVGheight = false;\n this.updateSVGheightOnResize = false;\n this.forceGraphUpdate = true;\n\n var me = this;\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n // listeners for the DataSet of the items\n this.itemListeners = {\n 'add': function (event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onAdd(params.items);\n },\n 'update': function (event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onUpdate(params.items);\n },\n 'remove': function (event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onRemove(params.items);\n }\n };\n\n // listeners for the DataSet of the groups\n this.groupListeners = {\n 'add': function (event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onAddGroups(params.items);\n },\n 'update': function (event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onUpdateGroups(params.items);\n },\n 'remove': function (event, params, senderId) { // eslint-disable-line no-unused-vars\n me._onRemoveGroups(params.items);\n }\n };\n\n this.items = {}; // object with an Item for every data item\n this.selection = []; // list with the ids of all selected nodes\n this.lastStart = this.body.range.start;\n this.touchParams = {}; // stores properties while dragging\n\n this.svgElements = {};\n this.setOptions(options);\n this.groupsUsingDefaultStyles = [0];\n this.body.emitter.on('rangechanged', function () {\n me.lastStart = me.body.range.start;\n me.svg.style.left = util.option.asSize(-me.props.width);\n\n me.forceGraphUpdate = true;\n //Is this local redraw necessary? (Core also does a change event!)\n me.redraw.call(me);\n });\n\n // create the HTML DOM\n this._create();\n this.framework = {svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups};\n}\n\nLineGraph.prototype = new Component();\n\n/**\n * Create the HTML DOM for the ItemSet\n */\nLineGraph.prototype._create = function () {\n var frame = document.createElement('div');\n frame.className = 'vis-line-graph';\n this.dom.frame = frame;\n\n // create svg element for graph drawing.\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n this.svg.style.position = 'relative';\n this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';\n this.svg.style.display = 'block';\n frame.appendChild(this.svg);\n\n // data axis\n this.options.dataAxis.orientation = 'left';\n this.yAxisLeft = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);\n\n this.options.dataAxis.orientation = 'right';\n this.yAxisRight = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);\n delete this.options.dataAxis.orientation;\n\n // legends\n this.legendLeft = new Legend(this.body, this.options.legend, 'left', this.options.groups);\n this.legendRight = new Legend(this.body, this.options.legend, 'right', this.options.groups);\n\n this.show();\n};\n\n/**\n * set the options of the LineGraph. the mergeOptions is used for subObjects that have an enabled element.\n * @param {object} options\n */\nLineGraph.prototype.setOptions = function (options) {\n if (options) {\n var fields = ['sampling', 'defaultGroup', 'stack', 'height', 'graphHeight', 'yAxisOrientation', 'style', 'barChart', 'dataAxis', 'sort', 'groups'];\n if (options.graphHeight === undefined && options.height !== undefined) {\n this.updateSVGheight = true;\n this.updateSVGheightOnResize = true;\n }\n else if (this.body.domProps.centerContainer.height !== undefined && options.graphHeight !== undefined) {\n if (parseInt((options.graphHeight + '').replace(\"px\", '')) < this.body.domProps.centerContainer.height) {\n this.updateSVGheight = true;\n }\n }\n util.selectiveDeepExtend(fields, this.options, options);\n util.mergeOptions(this.options, options, 'interpolation');\n util.mergeOptions(this.options, options, 'drawPoints');\n util.mergeOptions(this.options, options, 'shaded');\n util.mergeOptions(this.options, options, 'legend');\n\n if (options.interpolation) {\n if (typeof options.interpolation == 'object') {\n if (options.interpolation.parametrization) {\n if (options.interpolation.parametrization == 'uniform') {\n this.options.interpolation.alpha = 0;\n }\n else if (options.interpolation.parametrization == 'chordal') {\n this.options.interpolation.alpha = 1.0;\n }\n else {\n this.options.interpolation.parametrization = 'centripetal';\n this.options.interpolation.alpha = 0.5;\n }\n }\n }\n }\n\n if (this.yAxisLeft) {\n if (options.dataAxis !== undefined) {\n this.yAxisLeft.setOptions(this.options.dataAxis);\n this.yAxisRight.setOptions(this.options.dataAxis);\n }\n }\n\n if (this.legendLeft) {\n if (options.legend !== undefined) {\n this.legendLeft.setOptions(this.options.legend);\n this.legendRight.setOptions(this.options.legend);\n }\n }\n\n if (this.groups.hasOwnProperty(UNGROUPED)) {\n this.groups[UNGROUPED].setOptions(options);\n }\n }\n\n // this is used to redraw the graph if the visibility of the groups is changed.\n if (this.dom.frame) { //not on initial run?\n this.forceGraphUpdate=true;\n this.body.emitter.emit(\"_change\",{queue: true});\n }\n};\n\n/**\n * Hide the component from the DOM\n */\nLineGraph.prototype.hide = function () {\n // remove the frame containing the items\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n};\n\n\n/**\n * Show the component in the DOM (when not already visible).\n */\nLineGraph.prototype.show = function () {\n // show frame containing the items\n if (!this.dom.frame.parentNode) {\n this.body.dom.center.appendChild(this.dom.frame);\n }\n};\n\n\n/**\n * Set items\n * @param {vis.DataSet | null} items\n */\nLineGraph.prototype.setItems = function (items) {\n var me = this,\n ids,\n oldItemsData = this.itemsData;\n\n // replace the dataset\n if (!items) {\n this.itemsData = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n this.itemsData = items;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (oldItemsData) {\n // unsubscribe from old dataset\n util.forEach(this.itemListeners, function (callback, event) {\n oldItemsData.off(event, callback);\n });\n\n // remove all drawn items\n ids = oldItemsData.getIds();\n this._onRemove(ids);\n }\n\n if (this.itemsData) {\n // subscribe to new dataset\n var id = this.id;\n util.forEach(this.itemListeners, function (callback, event) {\n me.itemsData.on(event, callback, id);\n });\n\n // add all new items\n ids = this.itemsData.getIds();\n this._onAdd(ids);\n }\n};\n\n\n/**\n * Set groups\n * @param {vis.DataSet} groups\n */\nLineGraph.prototype.setGroups = function (groups) {\n var me = this;\n var ids;\n\n // unsubscribe from current dataset\n if (this.groupsData) {\n util.forEach(this.groupListeners, function (callback, event) {\n me.groupsData.off(event, callback);\n });\n\n // remove all drawn groups\n ids = this.groupsData.getIds();\n this.groupsData = null;\n for (var i = 0; i < ids.length; i++) {\n this._removeGroup(ids[i]);\n }\n }\n\n // replace the dataset\n if (!groups) {\n this.groupsData = null;\n }\n else if (groups instanceof DataSet || groups instanceof DataView) {\n this.groupsData = groups;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (this.groupsData) {\n // subscribe to new dataset\n var id = this.id;\n util.forEach(this.groupListeners, function (callback, event) {\n me.groupsData.on(event, callback, id);\n });\n\n // draw all ms\n ids = this.groupsData.getIds();\n this._onAddGroups(ids);\n }\n};\n\nLineGraph.prototype._onUpdate = function (ids) {\n this._updateAllGroupData(ids);\n};\nLineGraph.prototype._onAdd = function (ids) {\n this._onUpdate(ids);\n};\nLineGraph.prototype._onRemove = function (ids) {\n this._onUpdate(ids);\n};\nLineGraph.prototype._onUpdateGroups = function (groupIds) {\n this._updateAllGroupData(null, groupIds);\n};\nLineGraph.prototype._onAddGroups = function (groupIds) {\n this._onUpdateGroups(groupIds);\n};\n\n/**\n * this cleans the group out off the legends and the dataaxis, updates the ungrouped and updates the graph\n * @param {Array} groupIds\n * @private\n */\nLineGraph.prototype._onRemoveGroups = function (groupIds) {\n for (var i = 0; i < groupIds.length; i++) {\n this._removeGroup(groupIds[i]);\n }\n this.forceGraphUpdate = true;\n this.body.emitter.emit(\"_change\",{queue: true});\n};\n\n/**\n * this cleans the group out off the legends and the dataaxis\n * @param {vis.GraphGroup.id} groupId\n * @private\n */\nLineGraph.prototype._removeGroup = function (groupId) {\n if (this.groups.hasOwnProperty(groupId)) {\n if (this.groups[groupId].options.yAxisOrientation == 'right') {\n this.yAxisRight.removeGroup(groupId);\n this.legendRight.removeGroup(groupId);\n this.legendRight.redraw();\n }\n else {\n this.yAxisLeft.removeGroup(groupId);\n this.legendLeft.removeGroup(groupId);\n this.legendLeft.redraw();\n }\n delete this.groups[groupId];\n }\n};\n\n/**\n * update a group object with the group dataset entree\n *\n * @param {vis.GraphGroup} group\n * @param {vis.GraphGroup.id} groupId\n * @private\n */\nLineGraph.prototype._updateGroup = function (group, groupId) {\n if (!this.groups.hasOwnProperty(groupId)) {\n this.groups[groupId] = new GraphGroup(group, groupId, this.options, this.groupsUsingDefaultStyles);\n if (this.groups[groupId].options.yAxisOrientation == 'right') {\n this.yAxisRight.addGroup(groupId, this.groups[groupId]);\n this.legendRight.addGroup(groupId, this.groups[groupId]);\n }\n else {\n this.yAxisLeft.addGroup(groupId, this.groups[groupId]);\n this.legendLeft.addGroup(groupId, this.groups[groupId]);\n }\n }\n else {\n this.groups[groupId].update(group);\n if (this.groups[groupId].options.yAxisOrientation == 'right') {\n this.yAxisRight.updateGroup(groupId, this.groups[groupId]);\n this.legendRight.updateGroup(groupId, this.groups[groupId]);\n //If yAxisOrientation changed, clean out the group from the other axis.\n this.yAxisLeft.removeGroup(groupId);\n this.legendLeft.removeGroup(groupId);\n }\n else {\n this.yAxisLeft.updateGroup(groupId, this.groups[groupId]);\n this.legendLeft.updateGroup(groupId, this.groups[groupId]);\n //If yAxisOrientation changed, clean out the group from the other axis.\n this.yAxisRight.removeGroup(groupId);\n this.legendRight.removeGroup(groupId);\n }\n }\n this.legendLeft.redraw();\n this.legendRight.redraw();\n};\n\n\n/**\n * this updates all groups, it is used when there is an update the the itemset.\n *\n * @param {Array} ids\n * @param {Array} groupIds\n * @private\n */\nLineGraph.prototype._updateAllGroupData = function (ids, groupIds) {\n if (this.itemsData != null) {\n var groupsContent = {};\n var items = this.itemsData.get();\n var fieldId = this.itemsData._idProp;\n var idMap = {};\n if (ids){\n ids.map(function (id) {\n idMap[id] = id;\n });\n }\n\n //pre-Determine array sizes, for more efficient memory claim\n var groupCounts = {};\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var groupId = item.group;\n if (groupId === null || groupId === undefined) {\n groupId = UNGROUPED;\n }\n groupCounts.hasOwnProperty(groupId) ? groupCounts[groupId]++ : groupCounts[groupId] = 1;\n }\n\n //Pre-load arrays from existing groups if items are not changed (not in ids)\n var existingItemsMap = {};\n if (!groupIds && ids) {\n for (groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n group = this.groups[groupId];\n var existing_items = group.getItems();\n\n groupsContent[groupId] = existing_items.filter(function (item) {\n existingItemsMap[item[fieldId]] = item[fieldId];\n return (item[fieldId] !== idMap[item[fieldId]]);\n });\n var newLength = groupCounts[groupId];\n groupCounts[groupId] -= groupsContent[groupId].length;\n if (groupsContent[groupId].length < newLength) {\n groupsContent[groupId][newLength - 1] = {};\n }\n }\n }\n }\n\n //Now insert data into the arrays.\n for (i = 0; i < items.length; i++) {\n item = items[i];\n groupId = item.group;\n if (groupId === null || groupId === undefined) {\n groupId = UNGROUPED;\n }\n if (!groupIds && ids && (item[fieldId] !== idMap[item[fieldId]]) && existingItemsMap.hasOwnProperty(item[fieldId])) {\n continue;\n }\n if (!groupsContent.hasOwnProperty(groupId)) {\n groupsContent[groupId] = new Array(groupCounts[groupId]);\n }\n //Copy data (because of unmodifiable DataView input.\n var extended = util.bridgeObject(item);\n extended.x = util.convert(item.x, 'Date');\n extended.end = util.convert(item.end, 'Date');\n extended.orginalY = item.y; //real Y\n extended.y = Number(item.y);\n extended[fieldId] = item[fieldId];\n\n var index= groupsContent[groupId].length - groupCounts[groupId]--;\n groupsContent[groupId][index] = extended;\n }\n\n //Make sure all groups are present, to allow removal of old groups\n for (groupId in this.groups){\n if (this.groups.hasOwnProperty(groupId)){\n if (!groupsContent.hasOwnProperty(groupId)) {\n groupsContent[groupId] = new Array(0);\n }\n }\n }\n\n //Update legendas, style and axis\n for (groupId in groupsContent) {\n if (groupsContent.hasOwnProperty(groupId)) {\n if (groupsContent[groupId].length == 0) {\n if (this.groups.hasOwnProperty(groupId)) {\n this._removeGroup(groupId);\n }\n } else {\n var group = undefined;\n if (this.groupsData != undefined) {\n group = this.groupsData.get(groupId);\n }\n if (group == undefined) {\n group = {id: groupId, content: this.options.defaultGroup + groupId};\n }\n this._updateGroup(group, groupId);\n this.groups[groupId].setItems(groupsContent[groupId]);\n }\n }\n }\n this.forceGraphUpdate = true;\n this.body.emitter.emit(\"_change\",{queue: true});\n }\n};\n\n/**\n * Redraw the component, mandatory function\n * @return {boolean} Returns true if the component is resized\n */\nLineGraph.prototype.redraw = function () {\n var resized = false;\n\n // calculate actual size and position\n this.props.width = this.dom.frame.offsetWidth;\n this.props.height = this.body.domProps.centerContainer.height\n - this.body.domProps.border.top\n - this.body.domProps.border.bottom;\n\n // check if this component is resized\n resized = this._isResized() || resized;\n\n // check whether zoomed (in that case we need to re-stack everything)\n var visibleInterval = this.body.range.end - this.body.range.start;\n var zoomed = (visibleInterval != this.lastVisibleInterval);\n this.lastVisibleInterval = visibleInterval;\n\n\n // the svg element is three times as big as the width, this allows for fully dragging left and right\n // without reloading the graph. the controls for this are bound to events in the constructor\n if (resized == true) {\n this.svg.style.width = util.option.asSize(3 * this.props.width);\n this.svg.style.left = util.option.asSize(-this.props.width);\n\n // if the height of the graph is set as proportional, change the height of the svg\n if ((this.options.height + '').indexOf(\"%\") != -1 || this.updateSVGheightOnResize == true) {\n this.updateSVGheight = true;\n }\n }\n\n // update the height of the graph on each redraw of the graph.\n if (this.updateSVGheight == true) {\n if (this.options.graphHeight != this.props.height + 'px') {\n this.options.graphHeight = this.props.height + 'px';\n this.svg.style.height = this.props.height + 'px';\n }\n this.updateSVGheight = false;\n }\n else {\n this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';\n }\n\n // zoomed is here to ensure that animations are shown correctly.\n if (resized == true || zoomed == true || this.abortedGraphUpdate == true || this.forceGraphUpdate == true) {\n resized = this._updateGraph() || resized;\n this.forceGraphUpdate = false;\n }\n else {\n // move the whole svg while dragging\n if (this.lastStart != 0) {\n var offset = this.body.range.start - this.lastStart;\n var range = this.body.range.end - this.body.range.start;\n if (this.props.width != 0) {\n var rangePerPixelInv = this.props.width / range;\n var xOffset = offset * rangePerPixelInv;\n this.svg.style.left = (-this.props.width - xOffset) + 'px';\n }\n }\n }\n this.legendLeft.redraw();\n this.legendRight.redraw();\n return resized;\n};\n\n\nLineGraph.prototype._getSortedGroupIds = function(){\n // getting group Ids\n var grouplist = [];\n for (var groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n var group = this.groups[groupId];\n if (group.visible == true && (this.options.groups.visibility[groupId] === undefined || this.options.groups.visibility[groupId] == true)) {\n grouplist.push({id:groupId,zIndex:group.options.zIndex});\n }\n }\n }\n util.insertSort(grouplist,function(a,b){\n var az = a.zIndex;\n var bz = b.zIndex;\n if (az === undefined) az=0;\n if (bz === undefined) bz=0;\n return az==bz? 0: (az 0) {\n var groupsData = {};\n\n // fill groups data, this only loads the data we require based on the timewindow\n this._getRelevantData(groupIds, groupsData, minDate, maxDate);\n\n // apply sampling, if disabled, it will pass through this function.\n this._applySampling(groupIds, groupsData);\n\n // we transform the X coordinates to detect collisions\n for (i = 0; i < groupIds.length; i++) {\n this._convertXcoordinates(groupsData[groupIds[i]]);\n }\n\n // now all needed data has been collected we start the processing.\n this._getYRanges(groupIds, groupsData, groupRanges);\n\n // update the Y axis first, we use this data to draw at the correct Y points\n changeCalled = this._updateYAxis(groupIds, groupRanges);\n\n // at changeCalled, abort this update cycle as the graph needs another update with new Width input from the Redraw container.\n // Cleanup SVG elements on abort.\n if (changeCalled == true) {\n DOMutil.cleanupElements(this.svgElements);\n this.abortedGraphUpdate = true;\n return true;\n }\n this.abortedGraphUpdate = false;\n\n // With the yAxis scaled correctly, use this to get the Y values of the points.\n var below = undefined;\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (this.options.stack === true && this.options.style === 'line') {\n if (group.options.excludeFromStacking == undefined || !group.options.excludeFromStacking) {\n if (below != undefined) {\n this._stack(groupsData[group.id], groupsData[below.id]);\n if (group.options.shaded.enabled == true && group.options.shaded.orientation !== \"group\"){\n if (group.options.shaded.orientation == \"top\" && below.options.shaded.orientation !== \"group\"){\n below.options.shaded.orientation=\"group\";\n below.options.shaded.groupId=group.id;\n } else {\n group.options.shaded.orientation=\"group\";\n group.options.shaded.groupId=below.id;\n }\n }\n }\n below = group;\n }\n }\n this._convertYcoordinates(groupsData[groupIds[i]], group);\n }\n\n //Precalculate paths and draw shading if appropriate. This will make sure the shading is always behind any lines.\n var paths = {};\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (group.options.style === 'line' && group.options.shaded.enabled == true) {\n var dataset = groupsData[groupIds[i]];\n if (dataset == null || dataset.length == 0) {\n continue;\n }\n if (!paths.hasOwnProperty(groupIds[i])) {\n paths[groupIds[i]] = Lines.calcPath(dataset, group);\n }\n if (group.options.shaded.orientation === \"group\") {\n var subGroupId = group.options.shaded.groupId;\n if (groupIds.indexOf(subGroupId) === -1) {\n console.log(group.id + \": Unknown shading group target given:\" + subGroupId);\n continue;\n }\n if (!paths.hasOwnProperty(subGroupId)) {\n paths[subGroupId] = Lines.calcPath(groupsData[subGroupId], this.groups[subGroupId]);\n }\n Lines.drawShading(paths[groupIds[i]], group, paths[subGroupId], this.framework);\n }\n else {\n Lines.drawShading(paths[groupIds[i]], group, undefined, this.framework);\n }\n }\n }\n\n // draw the groups, calculating paths if still necessary.\n Bars.draw(groupIds, groupsData, this.framework);\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (groupsData[groupIds[i]].length > 0) {\n switch (group.options.style) {\n case \"line\":\n if (!paths.hasOwnProperty(groupIds[i])) {\n paths[groupIds[i]] = Lines.calcPath(groupsData[groupIds[i]], group);\n }\n Lines.draw(paths[groupIds[i]], group, this.framework);\n // eslint-disable-line no-fallthrough\n case \"point\":\n // eslint-disable-line no-fallthrough\n case \"points\":\n if (group.options.style == \"point\" || group.options.style == \"points\" || group.options.drawPoints.enabled == true) {\n Points.draw(groupsData[groupIds[i]], group, this.framework);\n }\n break;\n case \"bar\":\n // bar needs to be drawn enmasse\n // eslint-disable-line no-fallthrough\n default:\n //do nothing...\n }\n }\n\n }\n }\n }\n\n // cleanup unused svg elements\n DOMutil.cleanupElements(this.svgElements);\n return false;\n};\n\nLineGraph.prototype._stack = function (data, subData) {\n var index, dx, dy, subPrevPoint, subNextPoint;\n index = 0;\n // for each data point we look for a matching on in the set below\n for (var j = 0; j < data.length; j++) {\n subPrevPoint = undefined;\n subNextPoint = undefined;\n // we look for time matches or a before-after point\n for (var k = index; k < subData.length; k++) {\n // if times match exactly\n if (subData[k].x === data[j].x) {\n subPrevPoint = subData[k];\n subNextPoint = subData[k];\n index = k;\n break;\n }\n else if (subData[k].x > data[j].x) { // overshoot\n subNextPoint = subData[k];\n if (k == 0) {\n subPrevPoint = subNextPoint;\n }\n else {\n subPrevPoint = subData[k - 1];\n }\n index = k;\n break;\n }\n }\n // in case the last data point has been used, we assume it stays like this.\n if (subNextPoint === undefined) {\n subPrevPoint = subData[subData.length - 1];\n subNextPoint = subData[subData.length - 1];\n }\n // linear interpolation\n dx = subNextPoint.x - subPrevPoint.x;\n dy = subNextPoint.y - subPrevPoint.y;\n if (dx == 0) {\n data[j].y = data[j].orginalY + subNextPoint.y;\n }\n else {\n data[j].y = data[j].orginalY + (dy / dx) * (data[j].x - subPrevPoint.x) + subPrevPoint.y; // ax + b where b is data[j].y\n }\n }\n}\n\n\n/**\n * first select and preprocess the data from the datasets.\n * the groups have their preselection of data, we now loop over this data to see\n * what data we need to draw. Sorted data is much faster.\n * more optimization is possible by doing the sampling before and using the binary search\n * to find the end date to determine the increment.\n *\n * @param {array} groupIds\n * @param {object} groupsData\n * @param {date} minDate\n * @param {date} maxDate\n * @private\n */\nLineGraph.prototype._getRelevantData = function (groupIds, groupsData, minDate, maxDate) {\n var group, i, j, item;\n if (groupIds.length > 0) {\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n var itemsData = group.getItems();\n // optimization for sorted data\n if (group.options.sort == true) {\n var dateComparator = function (a, b) {\n return a.getTime() == b.getTime() ? 0 : a < b ? -1 : 1\n };\n var first = Math.max(0, util.binarySearchValue(itemsData, minDate, 'x', 'before', dateComparator));\n var last = Math.min(itemsData.length, util.binarySearchValue(itemsData, maxDate, 'x', 'after', dateComparator) + 1);\n if (last <= 0) {\n last = itemsData.length;\n }\n var dataContainer = new Array(last-first);\n for (j = first; j < last; j++) {\n item = group.itemsData[j];\n dataContainer[j-first] = item;\n }\n groupsData[groupIds[i]] = dataContainer;\n }\n else {\n // If unsorted data, all data is relevant, just returning entire structure\n groupsData[groupIds[i]] = group.itemsData;\n }\n }\n }\n};\n\n\n/**\n *\n * @param {Array.} groupIds\n * @param {vis.DataSet} groupsData\n * @private\n */\nLineGraph.prototype._applySampling = function (groupIds, groupsData) {\n var group;\n if (groupIds.length > 0) {\n for (var i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (group.options.sampling == true) {\n var dataContainer = groupsData[groupIds[i]];\n if (dataContainer.length > 0) {\n var increment = 1;\n var amountOfPoints = dataContainer.length;\n\n // the global screen is used because changing the width of the yAxis may affect the increment, resulting in an endless loop\n // of width changing of the yAxis.\n //TODO: This assumes sorted data, but that's not guaranteed!\n var xDistance = this.body.util.toGlobalScreen(dataContainer[dataContainer.length - 1].x) - this.body.util.toGlobalScreen(dataContainer[0].x);\n var pointsPerPixel = amountOfPoints / xDistance;\n increment = Math.min(Math.ceil(0.2 * amountOfPoints), Math.max(1, Math.round(pointsPerPixel)));\n\n var sampledData = new Array(amountOfPoints);\n for (var j = 0; j < amountOfPoints; j += increment) {\n var idx = Math.round(j/increment);\n sampledData[idx]=dataContainer[j];\n }\n groupsData[groupIds[i]] = sampledData.splice(0,Math.round(amountOfPoints/increment));\n }\n }\n }\n }\n};\n\n\n/**\n *\n * @param {Array.} groupIds\n * @param {vis.DataSet} groupsData\n * @param {object} groupRanges | this is being filled here\n * @private\n */\nLineGraph.prototype._getYRanges = function (groupIds, groupsData, groupRanges) {\n var groupData, group, i;\n var combinedDataLeft = [];\n var combinedDataRight = [];\n var options;\n if (groupIds.length > 0) {\n for (i = 0; i < groupIds.length; i++) {\n groupData = groupsData[groupIds[i]];\n options = this.groups[groupIds[i]].options;\n if (groupData.length > 0) {\n group = this.groups[groupIds[i]];\n // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.\n if (options.stack === true && options.style === 'bar') {\n if (options.yAxisOrientation === 'left') {\n combinedDataLeft = combinedDataLeft.concat(groupData);\n }\n else {\n combinedDataRight = combinedDataRight.concat(groupData);\n }\n }\n else {\n groupRanges[groupIds[i]] = group.getYRange(groupData, groupIds[i]);\n }\n }\n }\n\n // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.\n Bars.getStackedYRange(combinedDataLeft, groupRanges, groupIds, '__barStackLeft', 'left');\n Bars.getStackedYRange(combinedDataRight, groupRanges, groupIds, '__barStackRight', 'right');\n }\n};\n\n\n/**\n * this sets the Y ranges for the Y axis. It also determines which of the axis should be shown or hidden.\n * @param {Array.} groupIds\n * @param {Object} groupRanges\n * @returns {boolean} resized\n * @private\n */\nLineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {\n var resized = false;\n var yAxisLeftUsed = false;\n var yAxisRightUsed = false;\n var minLeft = 1e9, minRight = 1e9, maxLeft = -1e9, maxRight = -1e9, minVal, maxVal;\n // if groups are present\n if (groupIds.length > 0) {\n // 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.\n for (var i = 0; i < groupIds.length; i++) {\n var group = this.groups[groupIds[i]];\n if (group && group.options.yAxisOrientation != 'right') {\n yAxisLeftUsed = true;\n minLeft = 1e9;\n maxLeft = -1e9;\n }\n else if (group && group.options.yAxisOrientation) {\n yAxisRightUsed = true;\n minRight = 1e9;\n maxRight = -1e9;\n }\n }\n\n // if there are items:\n for (i = 0; i < groupIds.length; i++) {\n if (groupRanges.hasOwnProperty(groupIds[i])) {\n if (groupRanges[groupIds[i]].ignore !== true) {\n minVal = groupRanges[groupIds[i]].min;\n maxVal = groupRanges[groupIds[i]].max;\n\n if (groupRanges[groupIds[i]].yAxisOrientation != 'right') {\n yAxisLeftUsed = true;\n minLeft = minLeft > minVal ? minVal : minLeft;\n maxLeft = maxLeft < maxVal ? maxVal : maxLeft;\n }\n else {\n yAxisRightUsed = true;\n minRight = minRight > minVal ? minVal : minRight;\n maxRight = maxRight < maxVal ? maxVal : maxRight;\n }\n }\n }\n }\n\n if (yAxisLeftUsed == true) {\n this.yAxisLeft.setRange(minLeft, maxLeft);\n }\n if (yAxisRightUsed == true) {\n this.yAxisRight.setRange(minRight, maxRight);\n }\n }\n resized = this._toggleAxisVisiblity(yAxisLeftUsed, this.yAxisLeft) || resized;\n resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;\n\n if (yAxisRightUsed == true && yAxisLeftUsed == true) {\n this.yAxisLeft.drawIcons = true;\n this.yAxisRight.drawIcons = true;\n }\n else {\n this.yAxisLeft.drawIcons = false;\n this.yAxisRight.drawIcons = false;\n }\n this.yAxisRight.master = !yAxisLeftUsed;\n this.yAxisRight.masterAxis = this.yAxisLeft;\n\n if (this.yAxisRight.master == false) {\n if (yAxisRightUsed == true) {\n this.yAxisLeft.lineOffset = this.yAxisRight.width;\n }\n else {\n this.yAxisLeft.lineOffset = 0;\n }\n\n resized = this.yAxisLeft.redraw() || resized;\n resized = this.yAxisRight.redraw() || resized;\n }\n else {\n resized = this.yAxisRight.redraw() || resized;\n }\n\n // clean the accumulated lists\n var tempGroups = ['__barStackLeft', '__barStackRight', '__lineStackLeft', '__lineStackRight'];\n for (i = 0; i < tempGroups.length; i++) {\n if (groupIds.indexOf(tempGroups[i]) != -1) {\n groupIds.splice(groupIds.indexOf(tempGroups[i]), 1);\n }\n }\n\n return resized;\n};\n\n\n/**\n * This shows or hides the Y axis if needed. If there is a change, the changed event is emitted by the updateYAxis function\n *\n * @param {boolean} axisUsed\n * @param {vis.DataAxis} axis\n * @returns {boolean}\n * @private\n */\nLineGraph.prototype._toggleAxisVisiblity = function (axisUsed, axis) {\n var changed = false;\n if (axisUsed == false) {\n if (axis.dom.frame.parentNode && axis.hidden == false) {\n axis.hide();\n changed = true;\n }\n }\n else {\n if (!axis.dom.frame.parentNode && axis.hidden == true) {\n axis.show();\n changed = true;\n }\n }\n return changed;\n};\n\n\n/**\n * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the\n * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for\n * the yAxis.\n *\n * @param {Array.} datapoints\n * @private\n */\nLineGraph.prototype._convertXcoordinates = function (datapoints) {\n var toScreen = this.body.util.toScreen;\n for (var i = 0; i < datapoints.length; i++) {\n datapoints[i].screen_x = toScreen(datapoints[i].x) + this.props.width;\n datapoints[i].screen_y = datapoints[i].y; //starting point for range calculations\n if (datapoints[i].end != undefined) {\n datapoints[i].screen_end = toScreen(datapoints[i].end) + this.props.width;\n }\n else {\n datapoints[i].screen_end = undefined;\n }\n }\n};\n\n\n/**\n * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the\n * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for\n * the yAxis.\n *\n * @param {Array.} datapoints\n * @param {vis.GraphGroup} group\n * @private\n */\nLineGraph.prototype._convertYcoordinates = function (datapoints, group) {\n var axis = this.yAxisLeft;\n var svgHeight = Number(this.svg.style.height.replace('px', ''));\n if (group.options.yAxisOrientation == 'right') {\n axis = this.yAxisRight;\n }\n for (var i = 0; i < datapoints.length; i++) {\n datapoints[i].screen_y = Math.round(axis.convertValue(datapoints[i].y));\n }\n group.setZeroPosition(Math.min(svgHeight, axis.convertValue(0)));\n};\n\n\nexport default LineGraph;\n","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = 'string';\nlet bool = 'boolean';\nlet number = 'number';\nlet array = 'array';\nlet date = 'date';\nlet object = 'object'; // should only be in a __type__ property\nlet dom = 'dom';\nlet moment = 'moment';\nlet any = 'any';\n\n\nlet allOptions = {\n configure: {\n enabled: {'boolean': bool},\n filter: {'boolean': bool,'function': 'function'},\n container: {dom},\n __type__: {object,'boolean': bool,'function': 'function'}\n },\n\n //globals :\n alignCurrentTime: {string, 'undefined': 'undefined'}, \n yAxisOrientation: {string:['left','right']},\n defaultGroup: {string},\n sort: {'boolean': bool},\n sampling: {'boolean': bool},\n stack:{'boolean': bool},\n graphHeight: {string, number},\n shaded: {\n enabled: {'boolean': bool},\n orientation: {string:['bottom','top','zero','group']}, // top, bottom, zero, group\n groupId: {object},\n __type__: {'boolean': bool,object}\n },\n style: {string:['line','bar','points']}, // line, bar\n barChart: {\n width: {number},\n minWidth: {number},\n sideBySide: {'boolean': bool},\n align: {string:['left','center','right']},\n __type__: {object}\n },\n interpolation: {\n enabled: {'boolean': bool},\n parametrization: {string:['centripetal', 'chordal','uniform']}, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n alpha: {number},\n __type__: {object,'boolean': bool}\n },\n drawPoints: {\n enabled: {'boolean': bool},\n onRender: { 'function': 'function' },\n size: {number},\n style: {string:['square','circle']}, // square, circle\n __type__: {object,'boolean': bool,'function': 'function'}\n },\n dataAxis: {\n showMinorLabels: {'boolean': bool},\n showMajorLabels: {'boolean': bool},\n icons: {'boolean': bool},\n width: {string, number},\n visible: {'boolean': bool},\n alignZeros: {'boolean': bool},\n left:{\n range: {min:{number,'undefined': 'undefined'},max:{number,'undefined': 'undefined'},__type__: {object}},\n format: {'function': 'function'},\n title: {text:{string,number,'undefined': 'undefined'},style:{string,'undefined': 'undefined'},__type__: {object}},\n __type__: {object}\n },\n right:{\n range: {min:{number,'undefined': 'undefined'},max:{number,'undefined': 'undefined'},__type__: {object}},\n format: {'function': 'function'},\n title: {text:{string,number,'undefined': 'undefined'},style:{string,'undefined': 'undefined'},__type__: {object}},\n __type__: {object}\n },\n __type__: {object}\n },\n legend: {\n enabled: {'boolean': bool},\n icons: {'boolean': bool},\n left: {\n visible: {'boolean': bool},\n position: {string:['top-right','bottom-right','top-left','bottom-left']},\n __type__: {object}\n },\n right: {\n visible: {'boolean': bool},\n position: {string:['top-right','bottom-right','top-left','bottom-left']},\n __type__: {object}\n },\n __type__: {object,'boolean': bool}\n },\n groups: {\n visibility: {any},\n __type__: {object}\n },\n\n autoResize: {'boolean': bool},\n throttleRedraw: {number}, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511\n clickToUse: {'boolean': bool},\n end: {number, date, string, moment},\n format: {\n minorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n week: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n quarter: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object}\n },\n majorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n week: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n quarter: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object}\n },\n __type__: {object}\n },\n moment: {'function': 'function'},\n height: {string, number},\n hiddenDates: {\n start: {date, number, string, moment},\n end: {date, number, string, moment},\n repeat: {string},\n __type__: {object, array}\n },\n locale:{string},\n locales:{\n __any__: {any},\n __type__: {object}\n },\n max: {date, number, string, moment},\n maxHeight: {number, string},\n maxMinorChars: {number},\n min: {date, number, string, moment},\n minHeight: {number, string},\n moveable: {'boolean': bool},\n multiselect: {'boolean': bool},\n orientation: {string},\n showCurrentTime: {'boolean': bool},\n showMajorLabels: {'boolean': bool},\n showMinorLabels: {'boolean': bool},\n start: {date, number, string, moment},\n timeAxis: {\n scale: {string,'undefined': 'undefined'},\n step: {number,'undefined': 'undefined'},\n __type__: {object}\n },\n width: {string, number},\n zoomable: {'boolean': bool},\n zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']},\n zoomMax: {number},\n zoomMin: {number},\n zIndex: {number},\n __type__: {object}\n};\n\nlet configureOptions = {\n global: {\n alignCurrentTime: ['none', 'year', 'month', 'quarter', 'week', 'isoWeek', 'day', 'date', 'hour', 'minute', 'second'], \n //yAxisOrientation: ['left','right'], // TDOO: enable as soon as Grahp2d doesn't crash when changing this on the fly\n sort: true,\n sampling: true,\n stack:false,\n shaded: {\n enabled: false,\n orientation: ['zero','top','bottom','group'] // zero, top, bottom\n },\n style: ['line','bar','points'], // line, bar\n barChart: {\n width: [50,5,100,5],\n minWidth: [50,5,100,5],\n sideBySide: false,\n align: ['left','center','right'] // left, center, right\n },\n interpolation: {\n enabled: true,\n parametrization: ['centripetal','chordal','uniform'] // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n },\n drawPoints: {\n enabled: true,\n size: [6,2,30,1],\n style: ['square', 'circle'] // square, circle\n },\n dataAxis: {\n showMinorLabels: true,\n showMajorLabels: true,\n icons: false,\n width: [40,0,200,1],\n visible: true,\n alignZeros: true,\n left:{\n //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},\n //format: function (value) {return value;},\n title: {text:'',style:''}\n },\n right:{\n //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},\n //format: function (value) {return value;},\n title: {text:'',style:''}\n }\n },\n legend: {\n enabled: false,\n icons: true,\n left: {\n visible: true,\n position: ['top-right','bottom-right','top-left','bottom-left'] // top/bottom - left,right\n },\n right: {\n visible: true,\n position: ['top-right','bottom-right','top-left','bottom-left'] // top/bottom - left,right\n }\n },\n\n autoResize: true,\n clickToUse: false,\n end: '',\n format: {\n minorLabels: {\n millisecond:'SSS',\n second: 's',\n minute: 'HH:mm',\n hour: 'HH:mm',\n weekday: 'ddd D',\n day: 'D',\n week: 'w',\n month: 'MMM',\n quarter: '[Q]Q',\n year: 'YYYY'\n },\n majorLabels: {\n millisecond:'HH:mm:ss',\n second: 'D MMMM HH:mm',\n minute: 'ddd D MMMM',\n hour: 'ddd D MMMM',\n weekday: 'MMMM YYYY',\n day: 'MMMM YYYY',\n week: 'MMMM YYYY',\n month: 'YYYY',\n quarter: 'YYYY',\n year: ''\n }\n },\n\n height: '',\n locale: '',\n max: '',\n maxHeight: '',\n maxMinorChars: [7, 0, 20, 1],\n min: '',\n minHeight: '',\n moveable:true,\n orientation: ['both', 'bottom', 'top'],\n showCurrentTime: false,\n showMajorLabels: true,\n showMinorLabels: true,\n start: '',\n width: '100%',\n zoomable: true,\n zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],\n zoomMax: [315360000000000, 10, 315360000000000, 1],\n zoomMin: [10, 10, 315360000000000, 1],\n zIndex: 0\n }\n};\n\nexport {allOptions, configureOptions};\n","import moment from '../module/moment';\nimport util from '../util';\nimport { DataSet } from 'vis-data';\nimport { DataView } from 'vis-data';\nimport Range from './Range';\nimport Core from './Core';\nimport TimeAxis from './component/TimeAxis';\nimport CurrentTime from './component/CurrentTime';\nimport CustomTime from './component/CustomTime';\nimport LineGraph from './component/LineGraph';\n\nimport { Validator } from '../shared/Validator';\nimport { printStyle } from '../shared/Validator';\nimport { allOptions } from './optionsGraph2d';\nimport { configureOptions } from './optionsGraph2d';\n\nimport Configurator from '../shared/Configurator';\n\n/**\n * Create a timeline visualization\n * @param {HTMLElement} container\n * @param {vis.DataSet | Array} [items]\n * @param {vis.DataSet | Array | vis.DataView | Object} [groups]\n * @param {Object} [options] See Graph2d.setOptions for the available options.\n * @constructor Graph2d\n * @extends Core\n */\nfunction Graph2d (container, items, groups, options) {\n // if the third element is options, the forth is groups (optionally);\n if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {\n var forthArgument = options;\n options = groups;\n groups = forthArgument;\n }\n\n // TODO: REMOVE THIS in the next MAJOR release\n // see https://github.com/almende/vis/issues/2511\n if (options && options.throttleRedraw) {\n console.warn(\"Graph2d option \\\"throttleRedraw\\\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.\");\n }\n\n var me = this;\n this.defaultOptions = {\n start: null,\n end: null,\n\n autoResize: true,\n\n orientation: {\n axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'\n item: 'bottom' // not relevant for Graph2d\n },\n\n moment: moment,\n\n width: null,\n height: null,\n maxHeight: null,\n minHeight: null\n };\n this.options = util.deepExtend({}, this.defaultOptions);\n\n // Create the DOM, props, and emitter\n this._create(container);\n\n // all components listed here will be repainted automatically\n this.components = [];\n\n this.body = {\n dom: this.dom,\n domProps: this.props,\n emitter: {\n on: this.on.bind(this),\n off: this.off.bind(this),\n emit: this.emit.bind(this)\n },\n hiddenDates: [],\n util: {\n toScreen: me._toScreen.bind(me),\n toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width\n toTime: me._toTime.bind(me),\n toGlobalTime : me._toGlobalTime.bind(me)\n }\n };\n\n // range\n this.range = new Range(this.body);\n this.components.push(this.range);\n this.body.range = this.range;\n\n // time axis\n this.timeAxis = new TimeAxis(this.body);\n this.components.push(this.timeAxis);\n //this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);\n\n // current time bar\n this.currentTime = new CurrentTime(this.body);\n this.components.push(this.currentTime);\n\n // item set\n this.linegraph = new LineGraph(this.body);\n\n this.components.push(this.linegraph);\n\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n\n this.on('tap', function (event) {\n me.emit('click', me.getEventProperties(event))\n });\n this.on('doubletap', function (event) {\n me.emit('doubleClick', me.getEventProperties(event))\n });\n this.dom.root.oncontextmenu = function (event) {\n me.emit('contextmenu', me.getEventProperties(event))\n };\n \n //Single time autoscale/fit\n this.initialFitDone = false;\n this.on('changed', function (){\n if (me.itemsData == null) return;\n if (!me.initialFitDone && !me.options.rollingMode) {\n me.initialFitDone = true;\n if (me.options.start != undefined || me.options.end != undefined) {\n if (me.options.start == undefined || me.options.end == undefined) {\n var range = me.getItemRange();\n }\n\n var start = me.options.start != undefined ? me.options.start : range.min;\n var end = me.options.end != undefined ? me.options.end : range.max;\n me.setWindow(start, end, {animation: false});\n } else {\n me.fit({animation: false});\n }\n }\n\n if (!me.initialDrawDone && (me.initialRangeChangeDone || (!me.options.start && !me.options.end) \n || me.options.rollingMode)) {\n me.initialDrawDone = true;\n me.dom.root.style.visibility = 'visible';\n me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen);\n if (me.options.onInitialDrawComplete) {\n setTimeout(() => {\n return me.options.onInitialDrawComplete();\n }, 0)\n }\n }\n });\n \n // apply options\n if (options) {\n this.setOptions(options);\n }\n\n // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!\n if (groups) {\n this.setGroups(groups);\n }\n\n // create itemset\n if (items) {\n this.setItems(items);\n }\n\n // draw for the first time\n this._redraw();\n}\n\n// Extend the functionality from Core\nGraph2d.prototype = new Core();\n\nGraph2d.prototype.setOptions = function (options) {\n // validate options\n let errorFound = Validator.validate(options, allOptions);\n if (errorFound === true) {\n console.log('%cErrors have been found in the supplied options object.', printStyle);\n }\n\n Core.prototype.setOptions.call(this, options);\n};\n\n/**\n * Set items\n * @param {vis.DataSet | Array | null} items\n */\nGraph2d.prototype.setItems = function(items) {\n var initialLoad = (this.itemsData == null);\n\n // convert to type DataSet when needed\n var newDataSet;\n if (!items) {\n newDataSet = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n newDataSet = items;\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(items, {\n type: {\n start: 'Date',\n end: 'Date'\n }\n });\n }\n\n // set items\n this.itemsData = newDataSet;\n this.linegraph && this.linegraph.setItems(newDataSet);\n\n if (initialLoad) {\n if (this.options.start != undefined || this.options.end != undefined) {\n var start = this.options.start != undefined ? this.options.start : null;\n var end = this.options.end != undefined ? this.options.end : null;\n this.setWindow(start, end, {animation: false});\n }\n else {\n this.fit({animation: false});\n }\n }\n};\n\n/**\n * Set groups\n * @param {vis.DataSet | Array} groups\n */\nGraph2d.prototype.setGroups = function(groups) {\n // convert to type DataSet when needed\n var newDataSet;\n if (!groups) {\n newDataSet = null;\n }\n else if (groups instanceof DataSet || groups instanceof DataView) {\n newDataSet = groups;\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(groups);\n }\n\n this.groupsData = newDataSet;\n this.linegraph.setGroups(newDataSet);\n};\n\n/**\n * 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).\n * @param {vis.GraphGroup.id} groupId\n * @param {number} width\n * @param {number} height\n * @returns {{icon: SVGElement, label: string, orientation: string}|string}\n */\nGraph2d.prototype.getLegend = function(groupId, width, height) {\n if (width === undefined) {width = 15;}\n if (height === undefined) {height = 15;}\n if (this.linegraph.groups[groupId] !== undefined) {\n return this.linegraph.groups[groupId].getLegend(width,height);\n }\n else {\n return \"cannot find group:'\" + groupId + \"'\";\n }\n};\n\n/**\n * This checks if the visible option of the supplied group (by ID) is true or false.\n * @param {vis.GraphGroup.id} groupId\n * @returns {boolean}\n */\nGraph2d.prototype.isGroupVisible = function(groupId) {\n if (this.linegraph.groups[groupId] !== undefined) {\n return (this.linegraph.groups[groupId].visible && (this.linegraph.options.groups.visibility[groupId] === undefined || this.linegraph.options.groups.visibility[groupId] == true));\n }\n else {\n return false;\n }\n};\n\n\n/**\n * Get the data range of the item set.\n * @returns {{min: Date, max: Date}} range A range with a start and end Date.\n * When no minimum is found, min==null\n * When no maximum is found, max==null\n */\nGraph2d.prototype.getDataRange = function() {\n var min = null;\n var max = null;\n\n // calculate min from start filed\n for (var groupId in this.linegraph.groups) {\n if (this.linegraph.groups.hasOwnProperty(groupId)) {\n if (this.linegraph.groups[groupId].visible == true) {\n for (var i = 0; i < this.linegraph.groups[groupId].itemsData.length; i++) {\n var item = this.linegraph.groups[groupId].itemsData[i];\n var value = util.convert(item.x, 'Date').valueOf();\n min = min == null ? value : min > value ? value : min;\n max = max == null ? value : max < value ? value : max;\n }\n }\n }\n }\n\n return {\n min: (min != null) ? new Date(min) : null,\n max: (max != null) ? new Date(max) : null\n };\n};\n\n\n/**\n * Generate Timeline related information from an event\n * @param {Event} event\n * @return {Object} An object with related information, like on which area\n * The event happened, whether clicked on an item, etc.\n */\nGraph2d.prototype.getEventProperties = function (event) {\n var clientX = event.center ? event.center.x : event.clientX;\n var clientY = event.center ? event.center.y : event.clientY;\n var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);\n var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);\n var time = this._toTime(x);\n\n var customTime = CustomTime.customTimeFromTarget(event);\n\n var element = util.getTarget(event);\n var what = null;\n if (util.hasParent(element, this.timeAxis.dom.foreground)) {what = 'axis';}\n else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {what = 'axis';}\n else if (util.hasParent(element, this.linegraph.yAxisLeft.dom.frame)) {what = 'data-axis';}\n else if (util.hasParent(element, this.linegraph.yAxisRight.dom.frame)) {what = 'data-axis';}\n else if (util.hasParent(element, this.linegraph.legendLeft.dom.frame)) {what = 'legend';}\n else if (util.hasParent(element, this.linegraph.legendRight.dom.frame)) {what = 'legend';}\n else if (customTime != null) {what = 'custom-time';}\n else if (util.hasParent(element, this.currentTime.bar)) {what = 'current-time';}\n else if (util.hasParent(element, this.dom.center)) {what = 'background';}\n\n var value = [];\n var yAxisLeft = this.linegraph.yAxisLeft;\n var yAxisRight = this.linegraph.yAxisRight;\n if (!yAxisLeft.hidden && this.itemsData.length > 0) {\n value.push(yAxisLeft.screenToValue(y));\n }\n if (!yAxisRight.hidden && this.itemsData.length > 0) {\n value.push(yAxisRight.screenToValue(y));\n }\n\n return {\n event: event,\n customTime: customTime ? customTime.options.id : null,\n what: what,\n pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,\n pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,\n x: x,\n y: y,\n time: time,\n value: value\n }\n};\n\n/**\n * Load a configurator\n * @return {Object}\n * @private\n */\nGraph2d.prototype._createConfigurator = function () {\n return new Configurator(this, this.dom.container, configureOptions);\n};\n\n\nexport default Graph2d;\n","// utils\nimport util from 'vis-util';\nimport * as DOMutil from './lib/DOMutil';\n\n// data\nimport { DataSet, DataView, Queue } from 'vis-data';\n\n\n// Timeline\nimport Timeline from './lib/timeline/Timeline';\nimport Graph2d from './lib/timeline/Graph2d';\n\nimport Core from './lib/timeline/Core';\nimport * as DateUtil from './lib/timeline/DateUtil';\nimport Range from './lib/timeline/Range';\nimport * as stack from './lib/timeline/Stack';\nimport TimeStep from './lib/timeline/TimeStep';\n\nimport Item from './lib/timeline/component/item/Item';\nimport BackgroundItem from './lib/timeline/component/item/BackgroundItem';\nimport BoxItem from './lib/timeline/component/item/BoxItem';\nimport PointItem from './lib/timeline/component/item/PointItem';\nimport RangeItem from './lib/timeline/component/item/RangeItem';\n\nimport BackgroundGroup from './lib/timeline/component/BackgroundGroup';\nimport Component from './lib/timeline/component/Component';\nimport CurrentTime from './lib/timeline/component/CurrentTime';\nimport CustomTime from './lib/timeline/component/CustomTime';\nimport DataAxis from './lib/timeline/component/DataAxis';\nimport DataScale from './lib/timeline/component/DataScale';\nimport GraphGroup from './lib/timeline/component/GraphGroup';\nimport Group from './lib/timeline/component/Group';\nimport ItemSet from './lib/timeline/component/ItemSet';\nimport Legend from './lib/timeline/component/Legend';\nimport LineGraph from './lib/timeline/component/LineGraph';\nimport TimeAxis from './lib/timeline/component/TimeAxis';\n\n// bundled external libraries\nimport moment from './lib/module/moment';\nimport Hammer from './lib/module/hammer';\nimport keycharm from 'keycharm';\n\nconst defaultLanguage = DOMutil.getNavigatorLanguage()\nmoment.locale(defaultLanguage)\n\nconst timeline = {\n Core ,\n DateUtil,\n Range,\n stack,\n TimeStep,\n\n components: {\n items: {\n Item,\n BackgroundItem,\n BoxItem,\n PointItem,\n RangeItem,\n },\n\n BackgroundGroup,\n Component,\n CurrentTime,\n CustomTime,\n DataAxis,\n DataScale,\n GraphGroup,\n Group,\n ItemSet,\n Legend,\n LineGraph,\n TimeAxis\n }\n}\n\nexport {\n util,\n DOMutil,\n\n DataSet,\n DataView,\n Queue,\n\n Timeline,\n Graph2d,\n\n timeline,\n\n moment,\n Hammer,\n keycharm\n};\nexport default {\n util,\n DOMutil,\n\n DataSet,\n DataView,\n Queue,\n\n Timeline,\n Graph2d,\n\n timeline,\n\n moment,\n Hammer,\n keycharm\n};\n"],"names":["_defineProperty","obj","key","value","Object","defineProperty","enumerable","configurable","writable","_arrayWithoutHoles","arr","Array","isArray","i","arr2","length","arrayWithoutHoles","_iterableToArray","iter","Symbol","iterator","prototype","toString","call","from","iterableToArray","_nonIterableSpread","TypeError","nonIterableSpread","_toConsumableArray","toConsumableArray","commonjsGlobal","globalThis","window","global","self","commonjsRequire","Error","createCommonjsModule","fn","module","exports","_typeof_1","_typeof2","constructor","_typeof","moment","factory","hookCallback","hooks","apply","arguments","setHookCallback","callback","input","isObject","isObjectEmpty","getOwnPropertyNames","k","hasOwnProperty","isUndefined","isNumber","isDate","Date","map","res","push","hasOwnProp","a","b","extend","valueOf","createUTC","format","locale","strict","createLocalOrUTC","utc","defaultParsingFlags","empty","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","meridiem","rfc2822","weekdayMismatch","getParsingFlags","m","_pf","some","fun","t","len","isValid","_isValid","flags","parsedParts","isNowValid","isNaN","_d","getTime","invalidWeekday","_strict","bigHour","undefined","isFrozen","createInvalid","NaN","momentProperties","copyConfig","to","prop","val","_isAMomentObject","_i","_f","_l","_tzm","_isUTC","_offset","_locale","updateInProgress","Moment","config","updateOffset","isMoment","absFloor","number","Math","ceil","floor","toInt","argumentForCoercion","coercedNumber","isFinite","compareArrays","array1","array2","dontConvert","min","lengthDiff","abs","diffs","warn","msg","suppressDeprecationWarnings","console","deprecate","firstTime","deprecationHandler","args","arg","slice","join","stack","deprecations","deprecateSimple","name","isFunction","Function","set","_config","_dayOfMonthOrdinalParseLenient","RegExp","_dayOfMonthOrdinalParse","source","_ordinalParse","mergeConfigs","parentConfig","childConfig","Locale","keys","defaultCalendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","calendar","mom","now","output","_calendar","defaultLongDateFormat","LTS","LT","L","LL","LLL","LLLL","longDateFormat","_longDateFormat","formatUpper","toUpperCase","replace","defaultInvalidDate","invalidDate","_invalidDate","defaultOrdinal","defaultDayOfMonthOrdinalParse","ordinal","_ordinal","defaultRelativeTime","future","past","s","ss","mm","h","hh","d","dd","M","MM","y","yy","relativeTime","withoutSuffix","string","isFuture","_relativeTime","pastFuture","diff","aliases","addUnitAlias","unit","shorthand","lowerCase","toLowerCase","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedInput","normalizedProp","priorities","addUnitPriority","priority","getPrioritizedUnits","unitsObj","u","sort","zeroFill","targetLength","forceSign","absNumber","zerosToFill","sign","pow","max","substr","formattingTokens","localFormattingTokens","formatFunctions","formatTokenFunctions","addFormatToken","token","padded","func","localeData","removeFormattingTokens","match","makeFormatFunction","array","formatMoment","expandFormat","replaceLongDateFormatTokens","lastIndex","test","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchOffset","matchShortOffset","matchTimestamp","matchWord","regexes","addRegexToken","regex","strictRegex","isStrict","getParseRegexForToken","unescapeFormat","regexEscape","matched","p1","p2","p3","p4","tokens","addParseToken","addWeekParseToken","_w","addTimeToArrayFromToken","_a","YEAR","MONTH","DATE","HOUR","MINUTE","SECOND","MILLISECOND","WEEK","WEEKDAY","year","parseTwoDigitYear","parseInt","daysInYear","isLeapYear","getSetYear","makeGetSet","getIsLeapYear","keepTime","set$1","get","month","date","daysInMonth","stringGet","stringSet","prioritized","mod","n","x","indexOf","o","modMonth","monthsShort","months","monthsShortRegex","monthsRegex","monthsParse","MONTHS_IN_FORMAT","defaultLocaleMonths","split","localeMonths","_months","isFormat","defaultLocaleMonthsShort","localeMonthsShort","_monthsShort","handleStrictParse","monthName","ii","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","localeMonthsParse","_monthsParseExact","setMonth","dayOfMonth","getSetMonth","getDaysInMonth","defaultMonthsShortRegex","computeMonthsParse","_monthsShortStrictRegex","_monthsShortRegex","defaultMonthsRegex","_monthsStrictRegex","_monthsRegex","cmpLenRev","shortPieces","longPieces","mixedPieces","createDate","ms","getFullYear","setFullYear","createUTCDate","UTC","getUTCFullYear","setUTCFullYear","firstWeekOffset","dow","doy","fwd","fwdlw","getUTCDay","dayOfYearFromWeeks","week","weekday","localWeekday","weekOffset","dayOfYear","resYear","resDayOfYear","weekOfYear","resWeek","weeksInYear","weekOffsetNext","localeWeek","_week","defaultLocaleWeek","localeFirstDayOfWeek","localeFirstDayOfYear","getSetWeek","add","getSetISOWeek","weekdaysMin","weekdaysShort","weekdays","weekdaysMinRegex","weekdaysShortRegex","weekdaysRegex","weekdaysParse","parseWeekday","parseIsoWeekday","shiftWeekdays","ws","concat","defaultLocaleWeekdays","localeWeekdays","_weekdays","day","defaultLocaleWeekdaysShort","localeWeekdaysShort","_weekdaysShort","defaultLocaleWeekdaysMin","localeWeekdaysMin","_weekdaysMin","handleStrictParse$1","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","localeWeekdaysParse","_weekdaysParseExact","_fullWeekdaysParse","getSetDayOfWeek","getDay","getSetLocaleDayOfWeek","getSetISODayOfWeek","defaultWeekdaysRegex","computeWeekdaysParse","_weekdaysStrictRegex","_weekdaysRegex","defaultWeekdaysShortRegex","_weekdaysShortStrictRegex","_weekdaysShortRegex","defaultWeekdaysMinRegex","_weekdaysMinStrictRegex","_weekdaysMinRegex","minPieces","minp","shortp","longp","hFormat","hours","kFormat","minutes","seconds","lowercase","matchMeridiem","_meridiemParse","kInput","_isPm","isPM","_meridiem","pos","pos1","pos2","localeIsPM","charAt","defaultLocaleMeridiemParse","localeMeridiem","isLower","getSetHour","baseConfig","dayOfMonthOrdinalParse","meridiemParse","locales","localeFamilies","globalLocale","normalizeLocale","chooseLocale","names","j","next","loadLocale","oldLocale","_abbr","aliasedRequire","getSetGlobalLocale","e","values","data","getLocale","defineLocale","abbr","parentLocale","forEach","updateLocale","tmpLocale","listLocales","checkOverflow","_overflowDayOfYear","_overflowWeeks","_overflowWeekday","defaults","c","currentDateArray","nowValue","_useUTC","getUTCMonth","getUTCDate","getMonth","getDate","configFromArray","currentDate","expectedWeekday","yearToUse","dayOfYearFromWeekInfo","_dayOfYear","_nextDay","setUTCMinutes","getUTCMinutes","w","weekYear","temp","weekdayOverflow","GG","W","E","createLocal","curWeek","gg","extendedIsoRegex","basicIsoRegex","tzRegex","isoDates","isoTimes","aspNetJsonRegex","configFromISO","l","exec","allowTime","dateFormat","timeFormat","tzFormat","configFromStringAndFormat","extractFromRFC2822Strings","yearStr","monthStr","dayStr","hourStr","minuteStr","secondStr","result","untruncateYear","preprocessRFC2822","checkWeekday","weekdayStr","parsedInput","weekdayProvided","weekdayActual","obsOffsets","UT","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","calculateOffset","obsOffset","militaryOffset","numOffset","hm","configFromRFC2822","parsedArray","configFromString","createFromInputFallback","ISO_8601","RFC_2822","skipped","stringLength","totalParsedInputLength","meridiemFixWrap","hour","isPm","meridiemHour","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","score","configFromObject","minute","second","millisecond","createFromConfig","prepareConfig","preparse","configFromInput","isUTC","prototypeMin","other","prototypeMax","pickBy","moments","ordering","isDurationValid","unitHasDecimal","parseFloat","isValid$1","createInvalid$1","createDuration","Duration","duration","years","quarters","quarter","weeks","isoWeek","days","milliseconds","_milliseconds","_days","_data","_bubble","isDuration","absRound","round","offset","separator","utcOffset","offsetFromString","chunkOffset","matcher","matches","chunk","parts","cloneWithOffset","model","clone","setTime","local","getDateOffset","getTimezoneOffset","getSetOffset","keepLocalTime","keepMinutes","localAdjust","_changeInProgress","addSubtract","getSetZone","setOffsetToUTC","setOffsetToLocal","subtract","setOffsetToParsedOffset","tZone","hasAlignedHourOffset","isDaylightSavingTime","isDaylightSavingTimeShifted","_isDSTShifted","toArray","isLocal","isUtcOffset","isUtc","aspNetRegex","isoRegex","ret","diffRes","parseIso","momentsDifference","invalid","inp","positiveMomentsDifference","base","isAfter","isBefore","createAdder","direction","period","dur","tmp","isAdding","getCalendarFormat","myMoment","calendar$1","time","formats","sod","startOf","calendarFormat","localInput","endOf","isBetween","inclusivity","localFrom","localTo","isSame","inputMs","isSameOrAfter","isSameOrBefore","asFloat","that","zoneDelta","monthDiff","wholeMonthDiff","anchor","anchor2","adjust","defaultFormat","defaultFormatUtc","toISOString","keepOffset","toDate","inspect","zone","prefix","datetime","suffix","inputString","postformat","humanize","fromNow","toNow","newLocaleData","lang","MS_PER_SECOND","MS_PER_MINUTE","MS_PER_HOUR","MS_PER_400_YEARS","mod$1","dividend","divisor","localStartOfDate","utcStartOfDate","startOfDate","isoWeekday","unix","toObject","toJSON","isValid$2","parsingFlags","invalidAt","creationData","isoWeekYear","addWeekYearFormatToken","getter","getSetWeekYear","getSetWeekYearHelper","getSetISOWeekYear","getISOWeeksInYear","getWeeksInYear","weekInfo","weeksTarget","setWeekAll","dayOfYearData","getSetQuarter","getSetDayOfMonth","getSetDayOfYear","getSetMinute","getSetSecond","parseMs","getSetMillisecond","getZoneAbbr","getZoneName","proto","isoWeeks","isoWeeksInYear","parseZone","isDST","zoneAbbr","zoneName","dates","isDSTShifted","createUnix","createInZone","preParsePostFormat","proto$1","firstDayOfYear","firstDayOfWeek","get$1","index","field","setter","listMonthsImpl","out","listWeekdaysImpl","localeSorted","shift","listMonths","listMonthsShort","listWeekdays","listWeekdaysShort","listWeekdaysMin","langData","mathAbs","addSubtract$1","add$1","subtract$1","absCeil","bubble","monthsFromDays","monthsToDays","daysToMonths","as","valueOf$1","makeAs","alias","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asQuarters","asYears","clone$1","get$2","makeGetter","thresholds","substituteTimeAgo","relativeTime$1","posNegDuration","getSetRelativeTimeRounding","roundingFunction","getSetRelativeTimeThreshold","threshold","limit","withSuffix","abs$1","toISOString$1","Y","D","toFixed","total","totalSign","ymSign","daysSign","hmsSign","proto$2","toIsoString","version","relativeTimeRounding","relativeTimeThreshold","HTML5_FMT","DATETIME_LOCAL","DATETIME_LOCAL_SECONDS","DATETIME_LOCAL_MS","TIME","TIME_SECONDS","TIME_MS","byteToHex","stringifyUUID","buf","bth","random","crypto","getRandomValues","_rnds8","Uint8Array","whatwgRNG","_rnds","r","byteToHex$1","i$1","seedBytes","defaultNodeId","defaultClockseq","uuid4","options","rnds","rng","ownKeys","object","enumerableOnly","getOwnPropertySymbols","filter","sym","getOwnPropertyDescriptor","_objectSpread","target","getOwnPropertyDescriptors","defineProperties","ASPDateRegex","fullHexRE","shortHexRE","Number","recursiveDOMDelete","DOMobject","hasChildNodes","child","firstChild","removeChild","isString","String","parse","copyOrDelete","allowDeletion","doDeletion","fillIfDefined","aProp","bProp","assign","selectiveExtend","props","_len","others","_key","_others","p","selectiveDeepExtend","deepExtend","selectiveNotDeepExtend","propsToExclude","protoExtend","equalArray","convert","type","Boolean","getType","_value","never","copyAndExtendArray","newValue","copyArray","getAbsoluteLeft","elem","getBoundingClientRect","left","getAbsoluteRight","right","getAbsoluteTop","top","addClassName","classNames","classes","className","newClasses","removeClassName","oldClasses","_key2","updateProperty","throttle","scheduled","requestAnimationFrame","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","preventDefault","event","returnValue","getTarget","srcElement","Element","nodeType","parentNode","hasParent","parent","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","hexToRGB","hex","g","overrideOpacity","color","opacity","rgb","_rgb","RGBToHex","red","green","blue","parseColor","inputColor","defaultColor","colorStr","isValidRGB","isValidHex","hsv","hexToHSV","lighterColorHSV","v","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","_color","RGBToHSV","minRGB","maxRGB","hue","saturation","cssUtil","cssText","styles","style","trim","_key3","_value2","addCssText","currentStyles","newStyles","removeCssText","removeStyles","_key4","HSVToRGB","f","q","isOk","isValidRGBA","rgba","selectiveBridgeObject","fields","referenceObject","objectTo","create","bridgeObject","insertSort","compare","mergeOptions","mergeTarget","globalOptions","isPresent","isEmpty","doMerge","src","dst","srcOption","globalPassed","globalOption","globalEnabled","enabled","binarySearchCustom","orderedItems","comparator","field2","maxIterations","iteration","low","high","middle","item","_value3","searchResult","binarySearchValue","sidePreference","prevValue","nextValue","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","getScrollBarWidth","inner","document","createElement","width","height","outer","position","visibility","appendChild","body","w1","offsetWidth","w2","clientWidth","topMost","pile","accessors","candidate","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","_step","done","member","err","return","util","freeze","randomUUID","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","resetElements","getSVGElement","svgContainer","createElementNS","getDOMElement","DOMContainer","insertBefore","drawPoint","groupTemplate","labelObj","point","setAttributeNS","size","label","xOffset","yOffset","content","textContent","drawBar","rect","getNavigatorLanguage","languages","userLanguage","language","browserLanguage","_classCallCheck","instance","Constructor","classCallCheck","_defineProperties","descriptor","_createClass","protoProps","staticProps","createClass","_assertThisInitialized","ReferenceError","assertThisInitialized","_possibleConstructorReturn","possibleConstructorReturn","getPrototypeOf","_getPrototypeOf","setPrototypeOf","__proto__","_setPrototypeOf","_inherits","subClass","superClass","inherits","createCommonjsModule$1","byteToHex$2","i$2","random$1","byteToHex$1$1","i$1$1","seedBytes$1","defaultNodeId$1","defaultClockseq$1","isId","Queue","_queue","_timeout","_extended","delay","Infinity","setOptions","_flushIfNeeded","destroy","flush","methods","method","original","me","queue","context","entry","_this","clearTimeout","setTimeout","splice","DataSetPart","_subscribers","remove","update","subscribe","on","unsubscribe","off","_trigger","payload","senderId","subscribers","subscriber","DataSet","_DataSetPart","_options","_idProp","fieldId","_type","addedIds","id","_addItem","items","_this2","updatedIds","oldData","updatedData","idProp","addOrUpdate","origId","fullItem","oldItem","_updateItem","_id","first","ids","returnType","itemIds","itemId","_getItem","order","_sort","_filterFields","_i2","_len2","_i3","_len3","resultant","_id2","getIds","_i4","_len4","_i5","_len5","_id3","_i6","_len6","_id4","_i7","_len7","_i8","_len8","_id5","getDataSet","_i9","_len9","_id6","_item","mappedItems","reduce","filteredItem","av","bv","removedIds","removedItems","_remove","ident","clear","maxField","itemField","minField","distinct","fieldType","count","exists","_i10","_len10","types","raw","converted","JSON","stringify","DataView","_ids","_onEvent","bind","setData","refresh","oldIds","newIds","error","viewOptions","thisFilter","optionsFilter","defaultFilter","params","oldItems","updatedItems","it","fails","propertyIsEnumerable","classof","IndexedObject","requireObjectCoercible","O","check","EXISTS","DESCRIPTORS","PREFERRED_STRING","nativeDefineProperty","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","definePropertyModule","createPropertyDescriptor","hide","SHARED","store","setGlobal","mode","IS_PURE","copyright","shared","WeakMap","nativeFunctionToString","postfix","uid","has","enforce","getterFor","TYPE","state","NATIVE_WEAK_MAP","wmget","wmhas","wmset","metadata","STATE","sharedKey","hiddenKeys","objectHas","nativePropertyIsEnumerable","NASHORN_BUG","V","nativeGetOwnPropertyDescriptor","toIndexedObject","propertyIsEnumerableModule","replacement","isForced","feature","detection","normalize","POLYFILL","NATIVE","aFunction","require$$0","wrapConstructor","NativeConstructor","Wrapper","TARGET","GLOBAL","STATIC","stat","PROTO","nativeSource","path","targetPrototype","FORCED","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","forced","noTargetGet","wrap","sham","real","argument","F","IE_PROTO","ObjectPrototype","CORRECT_PROTOTYPE_GETTER","NATIVE_SYMBOL","ITERATOR","wellKnownSymbol","BUGGY_SAFARI_ITERATORS","IteratorPrototype","PrototypeOfArrayIteratorPrototype","arrayIterator","toInteger","integer","createMethod","IS_INCLUDES","$this","el","fromIndex","toLength","toAbsoluteIndex","includes","internalObjectKeys","enumBugKeys","Properties","objectKeys","variable","namespace","getBuiltIn","PROTOTYPE","Empty","createDict","iframe","documentCreateElement","lt","script","gt","js","iframeDocument","display","html","contentWindow","open","write","close","TO_STRING_TAG","CORRECT_ARGUMENTS","classofRaw","tryGet","tag","callee","METHOD_REQUIRED","TAG","SET_METHOD","returnThis","IteratorConstructor","NAME","setToStringTag","Iterators","CORRECT_SETTER","aPossiblePrototype","IteratorsCore","KEYS","VALUES","ENTRIES","Iterable","DEFAULT","IS_SET","createIteratorConstructor","getIterationMethod","KIND","defaultIterator","IterablePrototype","entries","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","CurrentIteratorPrototype","KEY","redefine","$","ARRAY_ITERATOR","setInternalState","InternalStateModule","getInternalState","defineIterator","iterated","kind","Arguments","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","COLLECTION_NAME","DOMIterables","Collection","CollectionPrototype","SPECIES","originalArray","C","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","callbackfn","specificCreate","boundFunction","arraySpeciesCreate","every","find","findIndex","METHOD_NAME","$forEach","sloppyArrayMethod","CONSTRUCTOR","entryVirtual","ArrayPrototype","own","foo","$filter","arrayMethodHasSpeciesSupport","MSIE","scheduler","handler","timeout","boundArgs","setInterval","require$$1","factories","construct","argsLength","list","partArgs","bound","FunctionPrototype","objectDefinePropertyModile","desc","_Object$defineProperty","wrappedWellKnownSymbolModule","defineWellKnownSymbol","CONVERT_TO_STRING","S","charCodeAt","codeAt","STRING_ITERATOR","WrappedWellKnownSymbolModule","propertyKey","IS_CONCAT_SPREADABLE","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","SPECIES_SUPPORT","isConcatSpreadable","spreadable","A","createProperty","nativeGetOwnPropertyNames","windowNames","getWindowNames","HIDDEN","SYMBOL","TO_PRIMITIVE","$Symbol","nativeJSONStringify","getOwnPropertyDescriptorModule","getOwnPropertyNamesExternal","AllSymbols","ObjectPrototypeSymbols","StringToSymbolRegistry","SymbolToStringRegistry","WellKnownSymbolsStore","QObject","USE_SETTER","findChild","setSymbolDescriptor","nativeObjectCreate","ObjectPrototypeDescriptor","description","symbol","isSymbol","$defineProperty","$defineProperties","properties","$getOwnPropertySymbols","$propertyIsEnumerable","$create","$getOwnPropertyDescriptor","$getOwnPropertyNames","IS_OBJECT_PROTOTYPE","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","keyFor","useSetter","useSimple","replacer","$replacer","_Symbol","_Symbol$iterator","FAILS_ON_PRIMITIVES","nativeGetPrototypeOf","_Object$setPrototypeOf","_Object$getPrototypeOf","_Object$create","this","require","T","nativeKeys","whitespace","whitespaces","ltrim","rtrim","start","end","nativeParseFloat","trimmedString","parseFloatImplementation","$JSON","core","Component","resized","_previousWidth","_previousHeight","nativeSort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","SLOPPY_METHOD","comparefn","repeat","str","RangeError","StringPrototype","convertHiddenOptions","hiddenDates","_Array$isArray","_repeatInstanceProperty","dateItem","updateHiddenDates","domProps","centerContainer","range","totalRange","pixelTime","startDate","endDate","runUntil","dayOffset","log","removeDuplicates","startHidden","getIsHidden","endHidden","rangeStart","rangeEnd","hidden","startToFront","endToFront","_applyRange","safeDates","printDates","stepOverHiddenDates","timeStep","previousTime","stepInHidden","currentValue","current","_end","switchedYear","switchedMonth","switchedDay","toScreen","Core","conversion","scale","getHiddenDurationBetween","hiddenBeforeStart","getHiddenDurationBeforeStart","rangeAfterEnd","correctTimeForHidden","toTime","hiddenDuration","totalDuration","partialDuration","accumulatedHiddenDuration","getAccumulatedHiddenDuration","getHiddenDurationBefore","timeOffset","requiredDuration","previousPoint","snapAwayFromHidden","correctionEnabled","isHidden","Range","millisecondsPerPixelCache","rolling","deltaDifference","scaleOffset","defaultOptions","rtl","moveable","zoomable","zoomMin","zoomMax","rollingMode","follow","touch","animationTimer","emitter","_bindInstanceProperty","_onDragStart","_onDrag","_onDragEnd","_onMouseWheel","_onTouch","_onPinch","dom","rollingModeBtn","startRolling","setRange","stopRolling","interval","rollingModeOffset","animation","center","currentTimeTimer","_setTimeout","frameCallback","byUser","finalStart","finalEnd","_cancelAnimation","initStart","initEnd","easingName","easingFunction","_JSON$stringify","_Object$keys","initTime","_Date$now","anyChanged","dragging","ease","changed","DateUtil","emit","timeoutID","newStart","newEnd","_parseFloat","compensation","totalHidden","previousDelta","_isInsideRange","allowDragging","root","cursor","validateDirection","delta","deltaX","deltaY","diffRange","safeStart","safeEnd","wheelDelta","detail","zoomKey","zoomFriction","pointerDate","pointer","getPointer","clientX","clientY","_pointerToDate","zoom","centerDate","hiddenDurationBefore","hiddenDurationAfter","centerContainerRect","elementRect","moveTo","$some","MAXIMUM_ALLOWED_LENGTH_EXCEEDED","deleteCount","actualStart","argumentsLength","insertCount","actualDeleteCount","$indexOf","nativeIndexOf","NEGATIVE_ZERO","searchElement","Emitter","mixin","_callbacks","once","removeListener","removeAllListeners","callbacks","cb","listeners","hasListeners","_firstTarget","propagating","hammer","Manager","Hammer","PropagatingHammer","wrapper","pointerType","isFirst","_handlers","events","propagatedHandler","eventType","hammers","idx","srcEvent","_handled","stopped","stopPropagation","srcStop","firstTarget","elemHammer","hammerMock","noop","modifiedHammer","OurHammer","onTouch","inputHandler","onRelease","isFinal","disablePreventDefaultVertically","pinchRecognizer","TOUCH_ACTION_PAN_Y","getTouchAction","nativeParseInt","radix","parseIntImplementation","TimeStep","minimumStep","_start","autoScale","step","FORMAT","setMinimumStep","roundToMinor","priorCurrent","prev","showMajorLabels","enable","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","minorLabels","majorLabels","_moment","even","today","currentWeek","currentMonth","currentYear","_filterInstanceProperty","TimeAxis","foreground","lines","majorTexts","minorTexts","lineTop","orientation","axis","showMinorLabels","maxMinorChars","timeAxis","_create","bottom","parentChanged","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineHeight","minorLineWidth","majorLineHeight","majorLineWidth","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","backgroundVertical","_isResized","timeLabelsize","minorCharWidth","setMoment","setFormat","setScale","xNext","isMajor","showMinorGrid","prevWidth","line","xFirstMajorLabel","MAX","getCurrent","hasNext","getClassName","_repaintMinorText","getLabelMinor","_repaintMajorText","getLabelMajor","_repaintMajorLine","_repaintMinorLine","_parseInt","warnedForOverflow","leftTime","leftText","widthText","majorCharWidth","pop","text","createTextNode","innerHTML","_setXY","childNodes","directionX","transform","measureCharMinor","clientHeight","measureCharMajor","keycharm","container","_exportFunctions","_bound","keydown","keyup","_keys","fromCharCode","code","down","handleEvent","up","keyCode","shiftKey","bindAll","getKey","unbind","newBindings","reset","Activator","active","overlay","_onTapOverlay","onClick","_hasParent","deactivate","escListener","activate","monthsShortWithDots","monthsShortWithoutDots","nl","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","weekdaysParseExact","processRelativeTime","de","monthsParseExact","fr","monthsShortDot","es","plural","word","num","forms","relativeTimeWithPlural","weekdaysCaseReplace","nounCase","processHoursFunction","uk","ru","standalone","ja","ll","lll","llll","en","deleteSelected","en_EN","en_US","it_IT","it_CH","nl_NL","nl_BE","de_DE","fr_FR","fr_CA","fr_BE","es_ES","uk_UA","ru_RU","ja_JP","CustomTime","title","defaultLocales","customTime","eventParams","bar","drag","onMouseWheel","DIRECTION_ALL","warned","substring","redraw","editable","marker","setAttribute","focus","_onMarkerChange","_onMarkerChanged","setCustomTime","backgroundHorizontal","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","loadingScreen","scrollTop","scrollTopMin","initialDrawDone","_redraw","initialRangeChangeDone","_origRedraw","itemSet","initialItemSetDrawn","hammerUtil","isActive","LINE_HEIGHT","PAGE_HEIGHT","wheelDeltaY","wheelDeltaX","HORIZONTAL_AXIS","deltaMode","preferZoom","verticalScroll","horizontalScroll","adjusted","newScrollTop","_setScrollTop","wheelType","onmousewheel","onMouseScrollSide","itemAddedToTimeline","handleDragOver","getEventProperties","_indexOfInstanceProperty","dataTransfer","dropEffect","handleDrop","itemData","getData","_onAddItem","_onDropObjectOnItem","customTimes","redrawCount","timeAxis2","components","drawPoints","onRender","clickToUse","activator","_initAutoResize","component","configurator","_createConfigurator","configure","appliedOptions","setModuleOptions","setItems","setGroups","_stopAutoResize","getCustomTime","setCustomMarker","setCustomTitle","timestamp","_someInstanceProperty","getVisibleItems","getVisibleGroups","getDataRange","getRange","percentage","getWindow","newInterval","distance","setWindow","maxHeight","minHeight","rootOffsetWidth","offsetHeight","contentHeight","autoHeight","containerHeight","scrollbarWidth","leftContainerClientWidth","rightContainerClientWidth","_setDOM","_updateScrollTop","visibilityTop","visibilityBottom","contentsOverflow","DIRECTION_HORIZONTAL","MAX_REDRAW","centerWidth","currentTime","setCurrentTime","getCurrentTime","autoResize","_startAutoResize","_onResize","rootOffsetHeight","lastWidth","lastHeight","watchTimer","_setInterval","clearInterval","initialScrollTop","oldScrollTop","_getScrollTop","CurrentTime","showCurrentTime","alignCurrentTime","stop","isExtensible","preventExtensions","METADATA","setMetadata","objectID","weakData","fastKey","getWeakData","onFreeze","FREEZING","meta","REQUIRED","returnMethod","Result","iterate","iterable","AS_ENTRIES","IS_ITERATOR","iterFn","getIteratorMethod","isArrayIteratorMethod","callWithSafeIterationClosing","internalStateGetterFor","CONSTRUCTOR_NAME","common","IS_WEAK","NativePrototype","ADDER","exported","getConstructor","InternalMetadataModule","anInstance","collection","IS_ADDER","setStrong","unsafe","last","define","getEntry","previous","removed","redefineAll","ITERATOR_NAME","getInternalCollectionState","getInternalIteratorState","setSpecies","Set","collectionStrong","$map","$find","FIND","SKIPS_HOLES","iteratorMethod","require$$2","arrayLike","mapfn","mapping","SAFE_CLOSING","called","iteratorWithReturn","SKIP_CLOSING","ITERATION_SUPPORT","INCORRECT_ITERATION","checkCorrectnessOfIteration","_isIterable","_Array$from","nativeAssign","B","alphabet","chr","$includes","MATCH","isRegExp","regexp","correctIsRegExpLogic","searchString","notARegExp","arrayIncludes","stringIncludes","nativeSlice","fin","EPSILON","orderByStart","orderByEnd","aTime","bTime","margin","force","shouldBailItemsRedrawFunction","shouldBail","collidingItem","jj","collision","vertical","substack","subgroup","subgroupHeight","baseTop","nostack","subgroups","isStackSubgroups","newTop","visible","stackSubgroups","otherSubgroup","collisionByTimes","stackSubgroupsWithInnerStack","subgroupItems","doSubStack","subgroupOrder","horizontal","UNGROUPED","BACKGROUND","ReservedGroupIds","Group","groupId","subgroupStack","subgroupStackAll","subgroupVisibility","doInnerStack","shouldBailStackItems","subgroupIndex","subgroupOrderer","isVisible","stackDirty","nestedGroups","showNested","heightMode","groupHeightMode","nestedInGroup","visibleItems","itemsInRange","byStart","byEnd","checkRangedItems","groupEditable","groupTouchParams","isDragging","templateFunction","isReactComponent","treeLevel","markerHeight","lastMarkerHeight","redrawQueue","redrawQueueLength","dirty","displayed","returnQueue","needRedraw","fns","offsetTop","offsetLeft","timeoutOptions","onTimeout","bailOptions","relativeBailingTime","itemsSettingTime","bailTimeMs","timeoutMs","userBailFunction","bail","userContinueNotBail","didUserContinue","forceRestack","lastIsVisible","restack","isCluster","orderedClusters","cluster","_updateItemsInRange","visibleClusters","_updateClustersInRange","getVisibleItemsGroupedBySubgroup","orderFn","visibleSubgroupsItems","_sortInstanceProperty","_updateSubGroupHeights","customOrderedItems","_shouldBailItemsRedraw","repositionX","labelWidth","labelHeight","repositionY","_didMarkerHeightChange","_calculateGroupSizeAndPosition","_isGroupVisible","_redrawItems","_updateSubgroupsSizes","_calculateHeight","_didResize","_applyGroupHeight","_updateItemsVerticalPosition","_resetSubgroups","labelSet","setParent","_addToSubgroup","orderSubgroups","_includesInstanceProperty","_checkIfVisible","subgroupId","itemEnd","initialEnd","sortArray","sortField","_spliceInstanceProperty","_removeFromSubgroup","itemIndex","removeItem","startArray","endArray","oldVisibleItems","visibleItemsLookup","lowerBound","upperBound","startSearchFunction","endSearchFunction","_checkIfVisibleWithReference","initialPosByStart","_traceVisible","initialPosByEnd","initialPos","breakCondition","hasItems","show","oldVisibleClusters","visibleClustersLookup","oldSubgroup","newSubgroup","BackgroundGroup","Item","selected","groupShowing","selectable","setSelectability","_updateEditStatus","groupChanged","group","_moveToGroup","subGroupChanged","changeSubgroup","updateTime","dragCenter","dragCenterItem","hammerDragCenter","_onUpdateItem","box","dragLeft","overrideItems","deleteButton","optionsLocale","hammerDeleteButton","removeFromDataSet","tooltipOnItemUpdateTime","onItemUpdateTimeTooltip","touchParams","itemIsDragging","tooltipOffset","itemDistanceFromTop","isCloseToTop","template","itemsData","itemVisibleFrameContent","visibleFrameTemplateFunction","_getItemData","frameElement","itemVisibleFrameContentElement","getElementsByClassName","visibleFrameTemplate","_contentToString","dataAttributes","attributes","removeAttribute","outerHTML","updateGroup","tooltip","BoxItem","dot","align","widthInMs","getMillisecondsPerPixel","_updateContents","_updateDataAttributes","_updateStyle","sizes","_repaintOnItemUpdateTimeTooltip","_repaintDragCenter","_repaintDeleteButton","_createDomElement","_appendDomElement","_updateDirtyDomComponents","_getDomComponentsSizes","_updateDomComponentsSizes","_repaintDomAdditionals","repositionXY","boxX","boxY","dotX","dotY","lineX","lineY","lineWidth","dotWidth","lineStyle","lineHeight","itemSetHeight","PointItem","marginLeft","marginRight","translateX","pointX","pointY","RangeItem","frame","visibleFrame","baseClassName","maxWidth","getComputedStyle","whiteSpace","_repaintDragLeft","_repaintDragRight","limitSize","parentWidth","contentStartPosition","contentWidth","boxWidth","itemsAlwaysDraggable","dragLeftItem","dragRight","dragRightItem","BackgroundItem","itemSubgroup","Popup","overflowMethod","padding","doShow","isLeft","isTop","$every","TO_ENTRIES","$values","IS_RIGHT","memo","$reduce","ClusterItem","modifiedOptions","_Object$assign","fitOnDoubleClick","uiItems","_setupRange","eventEmitter","attached","detach","attach","rangeWidth","showStipes","repositionXWithRanges","repositionXWithoutRanges","_isStipeVisible","repositionStype","lineOffsetWidth","dotOffsetWidth","lineOffset","dotOffset","lineOffsetDirection","dotOffsetDirection","minWidth","_mapInstanceProperty","detachFromParent","_fit","stats","centers","avg","_reduceInstanceProperty","sum","ondblclick","_onDoubleClick","fitStart","fitEnd","_getFitRange","fitArgs","ClusterGenerator","groups","cache","newItem","dataChanged","applyOnChangedLevel","oldClusters","maxItems","clusterCriteria","level","granularity","timeWindow","levelChanged","cacheLevel","applyDataNow","_dropLevelsCache","_filterData","clusters","groupName","iMax","neighbors","clusterItems","getGroupId","_getClusterForItems","_Object$values2","currentGroupName","oldClustersLookup","itemsIds","oldClusterData","_everyInstanceProperty","clusterItem","setUiItems","titleTemplate","clusterContent","clusterOptions","createClusterItem","ItemSet","groupOrderSwap","fromGroup","toGroup","targetOrder","groupOrder","multiselect","snap","onDropObjectOnItem","objectData","onAdd","onUpdate","onMove","onRemove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup","showTooltips","followMouse","itemOptions","groupsData","sequentialSelection","itemListeners","_onAdd","clusterGenerator","_onUpdate","_onRemove","groupListeners","_onAddGroups","groupData","updatedGroups","nestedGroupId","updatedNestedGroup","_concatInstanceProperty","_onUpdateGroups","_onRemoveGroups","groupIds","selection","popup","popupTimer","_updateUngrouped","backgroundGroup","ALL","_onSelectItem","_onMultiSelectItem","groupHammer","_onGroupClick","_onGroupDragStart","_onGroupDrag","_onGroupDragEnd","DIRECTION_VERTICAL","_onMouseOver","_onMouseOut","_onMouseMove","addCallback","markDirty","refreshItems","restackGroups","_detachAllClusters","clearPopupTimer","idsToDeselect","selectedId","getItemById","unselect","select","rawVisibleItems","_findInstanceProperty","_clusterItems","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","scrolled","lastRangeStart","changedStackOption","lastStack","changedStackSubgroupsOption","lastStackSubgroups","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","redrawResults","groupResized","firstGroupIndex","firstGroupId","ungrouped","oldItemsData","_order","updateData","dataset","_getType","_removeItem","groupOptions","_orderNestedGroups","getOrderedNestedGroups","nestedGroupIds","nestedGroup","topGroupIds","itemFromTarget","itemProps","selectedItem","initialX","_cloneItemData","ctrlKey","metaKey","_onDragStartAddItem","baseGroupIndex","_getGroupIndex","itemsToDrag","getSelection","groupIndex","groupOffset","frameRect","getScale","getStep","groupFromTarget","containerRect","setPosition","domRootOffsetLeft","updateGroupAllowed","newGroupBase","initial","initialStart","updateTimeAllowed","newOffset","oldGroup","toggleGroupShowNested","nestingGroup","fullNestedGroups","nextLevel","node","classList","toggle","toggleGroupDragClassName","originalOrder","movingUp","targetGroup","draggedGroupHeight","targetGroupHeight","draggedGroup","newOrder","origOrder","draggedId","numGroups","curPos","orgOffset","slippedPosition","switchGroup","shouldBeGroup","switchGroupId","oldSelection","setSelection","newSelection","related","itemFromRelatedTarget","getTitle","setText","setPopupTimer","newItemData","itemGroup","lastSelectedGroup","multiselectPerGroup","_getItemRange","filteredSelection","cur","itemFromElement","relatedTarget","foregroundRect","getClusters","_updateClusters","newClustersIds","clustersToUnselect","selectionChanged","selectedIdx","errorFound","allOptions","printStyle","Validator","referenceOptions","subObject","usedOptions","__any__","getSuggestion","referenceOption","is_object","refOptionObj","__type__","checkFields","message","printLocation","optionType","refOptionType","print","localSearch","findInOptions","globalSearch","localSearchThreshold","globalSearchThreshold","indexMatch","closestMatch","recursive","closestMatchPath","lowerCaseOption","op","levenshteinDistance","matrix","bool","any","throttleRedraw","onInitialDrawComplete","loadingScreenTemplate","configureOptions","groupsDraggable","fill","endPos","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","ColorPicker","pixelRatio","generated","centerCoordinates","hueCircle","initialColor","previousColor","applied","updateCallback","closeCallback","_bindHammer","_setSize","setInitial","htmlColor","_isColorString","rgbaArray","rgbObj","alpha","_setColor","_generateHueCircle","storePrevious","_hide","_updatePicker","setColor","alert","angleConvert","PI","radius","sin","cos","colorPickerSelector","ctx","colorPickerCanvas","getContext","pixelRation","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","clearRect","putImageData","fillStyle","circle","brightnessRange","opacityRange","initialColorDiv","backgroundColor","newColorDiv","colorPickerDiv","noCanvas","fontWeight","opacityDiv","brightnessDiv","arrowDiv","onchange","_setOpacity","oninput","_setBrightness","brightnessLabel","opacityLabel","cancelButton","onclick","applyButton","_apply","saveButton","_save","loadButton","_loadLast","pinch","_moveSelector","sat","hfac","sfac","fillRect","strokeStyle","stroke","getImageData","centerY","centerX","angle","atan2","sqrt","newLeft","Configurator","parentModule","defaultContainer","changedOptions","allowCreation","initialized","popupCounter","showButton","moduleOptions","domElements","popupDiv","popupLimit","popupHistory","colorPicker","_removePopup","_clean","counter","_handleObject","_makeItem","_makeHeader","_makeButton","_push","_showPopupIfNeeded","div","objectLabel","selectedValue","_update","_makeLabel","popupString","popupValue","factor","_setupPopup","generateButton","_printOptions","onmouseover","onmouseout","optionsContainer","hideTimeout","deleteTimeout","correspondingElement","checkbox","checked","_showColorPicker","insertTo","setUpdateCallback","colorString","setCloseCallback","checkOnly","visibleInSet","subObj","newPath","_getValue","_handleArray","_makeTextInput","_makeCheckbox","draw","physics","solver","enabledPath","enabledValue","_makeColorField","_makeDropdown","_makeRange","_constructOptions","optionsObj","getOptions","Timeline","itemsDone","SyntaxError","forthArgument","directionFromDom","domNode","parentElement","loadingScreenFragment","_toScreen","toGlobalScreen","_toGlobalScreen","_toTime","toGlobalTime","_toGlobalTime","oncontextmenu","PointerEvent","onpointerdown","onpointermove","onpointerup","onmousemove","onmousedown","onmouseup","initialFitDone","getItemRange","fit","_onFit","validate","newDataSet","startPos","initialVerticalScroll","verticalAnimationFrame","willDraw","getItemVerticalScroll","itemTop","shouldScroll","scrollOffset","setFinalVerticalPosition","finalVerticalScroll","finalVerticalCallback","minItem","maxItem","getStart","getEnd","startSide","endSide","getWidthRight","getWidthLeft","lhs","rhs","customTimeFromTarget","snappedTime","what","pageX","pageY","timeline","itemsetHeight","currentScrollHeight","targetOffset","DataScale","autoScaleStart","autoScaleEnd","zeroAlign","formattingFunction","majorSteps","minorSteps","customLines","minorStepIdx","magnitudefactor","determineScale","rounded","minimumStepValue","orderOfMagnitude","LN10","solutionFound","stepSize","majorStep","convertValue","toPrecision","bottomOffset","major","is_major","formatValue","oldStepIdx","oldStart","oldEnd","increaseMagnitude","decreaseMagnitude","otherZero","otherStep","newRange","myOriginalZero","majorOffset","getFirstMajor","zeroOffset","pixels","DataAxis","svg","linegraphOptions","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","alignZeros","linegraphSVG","DOMelements","labels","conversionFactor","stepPixels","zeroCrossing","amountOfSteps","master","masterAxis","svgElements","iconsRemoved","amountOfGroups","_redrawLabels","framework","lineContainer","graphOptions","DOMutil","iconHeight","iconOffset","groupArray","getLegend","activeGroups","backgroundHorizontalOffsetWidth","_redrawGroupIcons","_cleanupIcons","_redrawTitle","customRange","followScale","maxLabelSize","getLines","_redrawLabel","_redrawLine","titleWidth","titleCharHeight","screenToValue","characterHeight","textAlign","largestWidth","textMinor","textMajor","textTitle","measureCharTitle","titleCharWidth","Points","getCallback","screen_x","screen_y","getGroupTemplate","callbackResult","drawIcon","fillHeight","outline","Bargraph","barWidth","originalWidth","barChart","bar1Height","bar2Height","processedGroupData","combinedData","intersections","coreDistance","drawData","barPoints","screen_end","_getDataIntersections","heightOffset","_getSafeDrawData","nextKey","amount","resolved","excludeFromStacking","zeroPosition","accumulatedNegative","accumulatedPositive","sideBySide","dataWidth","pointData","getStackedYRange","groupRanges","groupLabel","_getStackedYRange","yAxisOrientation","yMin","yMax","xpos","Line","calcPath","interpolation","_catmullRom","_linear","fillPath","shaded","drawShading","pathArray","subPathArray","svgHeight","dFill","zero","serializePath","inverse","_catmullRomUniform","p0","bp1","bp2","normalization","d1","d2","d3","N","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","GraphGroup","groupsUsingDefaultStyles","usingDefaultStyle","getItems","setZeroPosition","parametrization","Lines","Bars","icon","getYRange","Legend","side","iconSize","iconSpacing","addGroup","excludeFromLegend","removeGroup","textArea","scrollableHeight","drawLegendIcons","paddingTop","LineGraph","defaultGroup","sampling","graphHeight","dataAxis","legend","abortedGraphUpdate","updateSVGheight","updateSVGheightOnResize","forceGraphUpdate","lastStart","yAxisLeft","yAxisRight","legendLeft","legendRight","_removeGroup","_updateAllGroupData","_updateGroup","groupsContent","idMap","groupCounts","existingItemsMap","existing_items","newLength","extended","orginalY","_updateGraph","rangePerPixelInv","_getSortedGroupIds","grouplist","zIndex","az","bz","changeCalled","minDate","maxDate","_getRelevantData","_applySampling","_convertXcoordinates","_getYRanges","_updateYAxis","below","_stack","_convertYcoordinates","paths","subGroupId","subData","dx","dy","subPrevPoint","subNextPoint","dateComparator","dataContainer","increment","amountOfPoints","xDistance","pointsPerPixel","sampledData","combinedDataLeft","combinedDataRight","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","minVal","maxVal","ignore","_toggleAxisVisiblity","drawIcons","tempGroups","axisUsed","datapoints","Graph2d","linegraph","initialLoad","isGroupVisible","defaultLanguage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,eAAT,CAAyBC,GAAzB,EAA8BC,GAA9B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AGfnD,KAAK,EAALA,KAHe;EAIf7hD,KAAK,EAALA,OAJe;EAKf+qD,QAAQ,EAARA,QALe;EAOf4O,UAAU,EAAE;IACVx2B,KAAK,EAAE;MACL+oC,IAAI,EAAJA,IADK;MAELoG,cAAc,EAAdA,cAFK;MAGLtD,OAAO,EAAPA,OAHK;MAIL8B,SAAS,EAATA,SAJK;MAKLM,SAAS,EAATA;KANQ;IASVnF,eAAe,EAAfA,eATU;IAUV7uB,SAAS,EAATA,SAVU;IAWVqgB,WAAW,EAAXA,WAXU;IAYVlI,UAAU,EAAVA,UAZU;IAaVioC,QAAQ,EAARA,QAbU;IAcVrC,SAAS,EAATA,SAdU;IAeVmK,UAAU,EAAVA,UAfU;IAgBVvgC,KAAK,EAALA,KAhBU;IAiBV8S,OAAO,EAAPA,OAjBU;IAkBVmuB,MAAM,EAANA,MAlBU;IAmBVW,SAAS,EAATA,SAnBU;IAoBVh6C,QAAQ,EAARA;;CA3BJ;AA+BA,AAiBA,YAAe;EACbvwB,IAAI,EAAJA,IADa;EAEb8iE,OAAO,EAAPA,OAFa;EAIbx8D,OAAO,EAAPA,OAJa;EAKb+E,QAAQ,EAARA,QALa;EAMbjH,KAAK,EAALA,KANa;EAQbi3D,QAAQ,EAARA,QARa;EASb4T,OAAO,EAAPA,OATa;EAWbtQ,QAAQ,EAARA,QAXa;EAabliG,MAAM,EAANA,QAba;EAcbiwD,MAAM,EAANA,QAda;EAebgI,QAAQ,EAARA;CAfF;;;;;"} \ No newline at end of file diff --git a/includes/js/vis/dist/vis-timeline-graph2d.min.css b/includes/js/vis/dist/vis-timeline-graph2d.min.css index eeacbd8..9484bde 100644 --- a/includes/js/vis/dist/vis-timeline-graph2d.min.css +++ b/includes/js/vis/dist/vis-timeline-graph2d.min.css @@ -1 +1 @@ -.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}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%);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%);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%)}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%);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:1px solid #fff;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}div.vis-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;z-index:5}.vis-current-time{background-color:#ff7f6e;width:2px;z-index:1;pointer-events:none}.vis-rolling-mode-btn{height:40px;width:40px;position:absolute;top:7px;right:20px;border-radius:50%;font-size:28px;cursor:pointer;opacity:.8;color:#fff;font-weight:700;text-align:center;background:#3876c2}.vis-rolling-mode-btn:before{content:"\26F6"}.vis-rolling-mode-btn:hover{opacity:1}.vis-custom-time{background-color:#6e94ff;width:2px;cursor:move;z-index:1}.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-item{position:absolute;color:#1a1a1a;border-color:#97b0f8;border-width:1px;background-color:#d5ddf6;display:inline-block;z-index:1}.vis-item.vis-selected{border-color:#ffc200;background-color:#fff785;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: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-visible-frame{white-space:nowrap}.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-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px;transition:.4s;-o-transition:.4s;-moz-transition:.4s;-webkit-transition:.4s}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.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-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-nesting-group{cursor:pointer}.vis-nested-group{background:#f5f5f5}.vis-label.vis-nesting-group.expanded:before{content:"\25BC"}.vis-label.vis-nesting-group.collapsed-rtl:before{content:"\25C0"}.vis-label.vis-nesting-group.collapsed:before{content:"\25B6"}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.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-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.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-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{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,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.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}.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-timeline{position:relative;border:1px solid #bfbfbf;overflow:hidden;padding:0;margin:0;box-sizing:border-box} \ No newline at end of file +.vis-custom-time{background-color:#6e94ff;width:2px;cursor:move;z-index:1}.vis-custom-time>.vis-custom-time-marker{background-color:inherit;color:#fff;font-size:12px;white-space:nowrap;padding:3px 5px;top:0;cursor:initial;z-index:inherit}.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-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 [class*=span]{min-height:0;width:auto}.vis-item{position:absolute;color:#1a1a1a;border-color:#97b0f8;border-width:1px;background-color:#d5ddf6;display:inline-block;z-index:1}.vis-item.vis-selected{border-color:#ffc200;background-color:#fff785;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: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-visible-frame{white-space:nowrap}.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-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px;transition:.4s;-o-transition:.4s;-moz-transition:.4s;-webkit-transition:.4s}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.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-item.vis-cluster{vertical-align:center;text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-cluster-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item.vis-cluster-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-current-time{background-color:#ff7f6e;width:2px;z-index:1;pointer-events:none}.vis-rolling-mode-btn{height:40px;width:40px;position:absolute;top:7px;right:20px;border-radius:50%;font-size:28px;cursor:pointer;opacity:.8;color:#fff;font-weight:700;text-align:center;background:#3876c2}.vis-rolling-mode-btn:before{content:"\26F6"}.vis-rolling-mode-btn:hover{opacity:1}.vis-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.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-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{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,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.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}.vis-timeline{position:relative;border:1px solid #bfbfbf;overflow:hidden;padding:0;margin:0;box-sizing:border-box}.vis-loading-screen{width:100%;height:100%;position:absolute;top:0;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-group-is-dragging{background:rgba(0,0,0,.1)}.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-nesting-group{cursor:pointer}.vis-label.vis-nested-group.vis-group-level-unknown-but-gte1{background:#f5f5f5}.vis-label.vis-nested-group.vis-group-level-0{background-color:#fff}.vis-ltr .vis-label.vis-nested-group.vis-group-level-0 .vis-inner{padding-left:0}.vis-rtl .vis-label.vis-nested-group.vis-group-level-0 .vis-inner{padding-right:0}.vis-label.vis-nested-group.vis-group-level-1{background-color:rgba(0,0,0,.05)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-1 .vis-inner{padding-left:15px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-1 .vis-inner{padding-right:15px}.vis-label.vis-nested-group.vis-group-level-2{background-color:rgba(0,0,0,.1)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-2 .vis-inner{padding-left:30px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-2 .vis-inner{padding-right:30px}.vis-label.vis-nested-group.vis-group-level-3{background-color:rgba(0,0,0,.15)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-3 .vis-inner{padding-left:45px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-3 .vis-inner{padding-right:45px}.vis-label.vis-nested-group.vis-group-level-4{background-color:rgba(0,0,0,.2)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-4 .vis-inner{padding-left:60px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-4 .vis-inner{padding-right:60px}.vis-label.vis-nested-group.vis-group-level-5{background-color:rgba(0,0,0,.25)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-5 .vis-inner{padding-left:75px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-5 .vis-inner{padding-right:75px}.vis-label.vis-nested-group.vis-group-level-6{background-color:rgba(0,0,0,.3)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-6 .vis-inner{padding-left:90px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-6 .vis-inner{padding-right:90px}.vis-label.vis-nested-group.vis-group-level-7{background-color:rgba(0,0,0,.35)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-7 .vis-inner{padding-left:105px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-7 .vis-inner{padding-right:105px}.vis-label.vis-nested-group.vis-group-level-8{background-color:rgba(0,0,0,.4)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-8 .vis-inner{padding-left:120px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-8 .vis-inner{padding-right:120px}.vis-label.vis-nested-group.vis-group-level-9{background-color:rgba(0,0,0,.45)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-9 .vis-inner{padding-left:135px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-9 .vis-inner{padding-right:135px}.vis-label.vis-nested-group{background-color:rgba(0,0,0,.5)}.vis-ltr .vis-label.vis-nested-group .vis-inner{padding-left:150px}.vis-rtl .vis-label.vis-nested-group .vis-inner{padding-right:150px}.vis-group-level-unknown-but-gte1{border:1px solid red}.vis-label.vis-nesting-group:before{display:inline-block;width:15px}.vis-label.vis-nesting-group.expanded:before{content:"\25BC"}.vis-label.vis-nesting-group.collapsed:before{content:"\25B6"}.vis-rtl .vis-label.vis-nesting-group.collapsed:before{content:"\25C0"}.vis-ltr .vis-label:not(.vis-nesting-group):not(.vis-group-level-0){padding-left:15px}.vis-rtl .vis-label:not(.vis-nesting-group):not(.vis-group-level-0){padding-right:15px}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}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}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%);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%);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%)}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%);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:1px solid #fff;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 .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}div.vis-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;z-index:5} \ No newline at end of file diff --git a/includes/js/vis/dist/vis-timeline-graph2d.min.js b/includes/js/vis/dist/vis-timeline-graph2d.min.js index a8c1968..bf416de 100644 --- a/includes/js/vis/dist/vis-timeline-graph2d.min.js +++ b/includes/js/vis/dist/vis-timeline-graph2d.min.js @@ -1,40 +1,52 @@ /** - * vis.js - * https://github.com/almende/vis + * vis-timeline and vis-graph2d + * https://visjs.github.io/vis-timeline/ * - * A dynamic, browser-based visualization library. + * Create a fully customizable, interactive timeline with items and ranges. * - * @version 4.20.0 - * @date 2017-05-21 + * @version 0.0.0-no-version + * @date 2020-01-04T00:10:26.063Z * - * @license - * Copyright (C) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs * - * Vis.js is dual licensed under both + * @license + * vis.js is dual licensed under both * - * * The Apache 2.0 License - * http://www.apache.org/licenses/LICENSE-2.0 + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 * - * and + * and * - * * The MIT License - * http://opensource.org/licenses/MIT + * 2. The MIT License + * http://opensource.org/licenses/MIT * - * Vis.js may be distributed under either license. + * 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(87),e.DataSet=i(88),e.DataView=i(92),e.Queue=i(91),e.Timeline=i(93),e.Graph2d=i(129),e.timeline={Core:i(102),DateUtil:i(101),Range:i(98),stack:i(106),TimeStep:i(104),components:{items:{Item:i(108),BackgroundItem:i(112),BoxItem:i(110),PointItem:i(111),RangeItem:i(107)},BackgroundGroup:i(109),Component:i(100),CurrentTime:i(124),CustomTime:i(122),DataAxis:i(131),DataScale:i(132),GraphGroup:i(133),Group:i(105),ItemSet:i(103),Legend:i(137),LineGraph:i(130),TimeAxis:i(119)}},e.moment=i(82),e.Hammer=i(95),e.keycharm=i(121)},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}var n=i(2),s=o(n),r=i(55),a=o(r),h=i(58),d=o(h),l=i(62),u=o(l),p=i(82),c=i(86);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=f.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return c.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==(0,u.default)(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var n in t)void 0!==i[n]&&("object"!==(0,u.default)(i[n])?void 0!==i[n]&&null!==i[n]||void 0===t[n]||o!==!0?t[n]=i[n]:delete t[n]:"object"===(0,u.default)(t[n])&&e.fillIfDefined(t[n],i[n],o))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&t.indexOf(s)==-1)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=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(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){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 m={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(0,d.default)(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=m.split(t.style.cssText),n=m.split(i),s=e.extend(o,n);t.style.cssText=m.join(s)},e.removeCssText=function(t,e){var i=m.split(t.style.cssText),o=m.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=m.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":(0,u.default)(i))){for(var o=(0,a.default)(i),n=0;n0&&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]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=(0,a.default)(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;r<=a&&s0)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:p=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 t<.5?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 t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o},e.topMost=function(t,e){var i=void 0;Array.isArray(e)||(e=[e]);var o=!0,n=!1,r=void 0;try{for(var a,h=(0,s.default)(t);!(o=(a=h.next()).done);o=!0){var d=a.value;if(d){i=d[e[0]];for(var l=1;l=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,i):"values"==e?n(0,t[i]):n(0,[i,t[i]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports={}},function(t,e,i){var o=i(10),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e,i){var o=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(14),n=i(15),s=i(30),r=i(20),a=i(31),h=i(8),d=i(32),l=i(46),u=i(48),p=i(47)("iterator"),c=!([].keys&&"next"in[].keys()),f="@@iterator",m="keys",g="values",v=function(){return this};t.exports=function(t,e,i,y,b,_,w){d(i,e,y);var x,D,S,k=function(t){if(!c&&t in O)return O[t];switch(t){case m:return function(){return new i(this,t)};case g:return function(){return new i(this,t)}}return function(){return new i(this,t)}},T=e+" Iterator",C=b==g,M=!1,O=t.prototype,E=O[p]||O[f]||b&&O[b],P=E||k(b),N=b?C?k("entries"):P:void 0,A="Array"==e?O.entries||E:E;if(A&&(S=u(A.call(new t)),S!==Object.prototype&&(l(S,T,!0),o||a(S,p)||r(S,p,v))),C&&E&&E.name!==g&&(M=!0,P=function(){return E.call(this)}),o&&!w||!c&&!M&&O[p]||r(O,p,P),h[e]=P,h[T]=v,b)if(x={values:C?P:k(g),keys:_?P:k(m),entries:N},w)for(D in x)D in O||s(O,D,x[D]);else n(n.P+n.F*(c||M),e,x);return x}},function(t,e){t.exports=!0},function(t,e,i){var o=i(16),n=i(17),s=i(18),r=i(20),a="prototype",h=function(t,e,i){var d,l,u,p=t&h.F,c=t&h.G,f=t&h.S,m=t&h.P,g=t&h.B,v=t&h.W,y=c?n:n[e]||(n[e]={}),b=y[a],_=c?o:f?o[e]:(o[e]||{})[a];c&&(i=e);for(d in i)l=!p&&_&&void 0!==_[d],l&&d in y||(u=l?_[d]:i[d],y[d]=c&&"function"!=typeof _[d]?i[d]:g&&l?s(u,o):v&&_[d]==u?function(t){var e=function(e,i,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,o)}return t.apply(this,arguments)};return e[a]=t[a],e}(u):m&&"function"==typeof u?s(Function.call,u):u,m&&((y.virtual||(y.virtual={}))[d]=u,t&h.R&&b&&!b[d]&&r(b,d,u)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(21),n=i(29);t.exports=i(25)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(22),n=i(24),s=i(28),r=Object.defineProperty;e.f=i(25)?Object.defineProperty:function(t,e,i){if(o(t),e=s(e,!0),o(i),n)try{return r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(23);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(25)&&!i(26)(function(){return 7!=Object.defineProperty(i(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){t.exports=!i(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var o=i(23),n=i(16).document,s=o(n)&&o(n.createElement);t.exports=function(t){return s?n.createElement(t):{}}},function(t,e,i){var o=i(23);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){t.exports=i(20)},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(33),n=i(29),s=i(46),r={};i(20)(r,i(47)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=o(r,{next:n(1,i)}),s(t,e+" Iterator")}},function(t,e,i){var o=i(22),n=i(34),s=i(44),r=i(41)("IE_PROTO"),a=function(){},h="prototype",d=function(){var t,e=i(27)("iframe"),o=s.length,n="<",r=">";for(e.style.display="none",i(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(n+"script"+r+"document.F=Object"+n+"/script"+r),t.close(),d=t.F;o--;)delete d[h][s[o]];return d()};t.exports=Object.create||function(t,e){var i;return null!==t?(a[h]=o(t),i=new a,a[h]=null,i[r]=t):i=d(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(21),n=i(22),s=i(35);t.exports=i(25)?Object.defineProperties:function(t,e){n(t);for(var i,r=s(e),a=r.length,h=0;a>h;)o.f(t,i=r[h++],e[i]);return t}},function(t,e,i){var o=i(36),n=i(44);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(31),n=i(9),s=i(37)(!1),r=i(41)("IE_PROTO");t.exports=function(t,e){var i,a=n(t),h=0,d=[];for(i in a)i!=r&&o(a,i)&&d.push(i);for(;e.length>h;)o(a,i=e[h++])&&(~s(d,i)||d.push(i));return d}},function(t,e,i){var o=i(9),n=i(38),s=i(40);t.exports=function(t){return function(e,i,r){var a,h=o(e),d=n(h.length),l=s(r,d);if(t&&i!=i){for(;d>l;)if(a=h[l++],a!=a)return!0}else for(;d>l;l++)if((t||l in h)&&h[l]===i)return t||l||0;return!t&&-1}}},function(t,e,i){var o=i(39),n=Math.min;t.exports=function(t){return t>0?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:i)(t)}},function(t,e,i){var o=i(39),n=Math.max,s=Math.min;t.exports=function(t,e){return t=o(t),t<0?n(t+e,0):s(t,e)}},function(t,e,i){var o=i(42)("keys"),n=i(43);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(16),n="__core-js_shared__",s=o[n]||(o[n]={});t.exports=function(t){return s[t]||(s[t]={})}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){t.exports=i(16).document&&document.documentElement},function(t,e,i){var o=i(21).f,n=i(31),s=i(47)("toStringTag");t.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,s)&&o(t,s,{configurable:!0,value:e})}},function(t,e,i){var o=i(42)("wks"),n=i(43),s=i(16).Symbol,r="function"==typeof s,a=t.exports=function(t){return o[t]||(o[t]=r&&s[t]||(r?s:n)("Symbol."+t))};a.store=o},function(t,e,i){var o=i(31),n=i(49),s=i(41)("IE_PROTO"),r=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),o(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?r:null}},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(51)(!0);i(13)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=o(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){var o=i(39),n=i(12);t.exports=function(t){return function(e,i){var s,r,a=String(n(e)),h=o(i),d=a.length;return h<0||h>=d?t?"":void 0:(s=a.charCodeAt(h),s<55296||s>56319||h+1===d||(r=a.charCodeAt(h+1))<56320||r>57343?t?a.charAt(h):s:t?a.slice(h,h+2):(s-55296<<10)+(r-56320)+65536)}}},function(t,e,i){var o=i(22),n=i(53);t.exports=i(17).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return o(e.call(t))}},function(t,e,i){var o=i(54),n=i(47)("iterator"),s=i(8);t.exports=i(17).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||s[o(t)]}},function(t,e,i){var o=i(11),n=i(47)("toStringTag"),s="Arguments"==o(function(){return arguments}()),r=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,i,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=r(e=Object(t),n))?i:s?o(e):"Object"==(a=o(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,i){t.exports={default:i(56),__esModule:!0}},function(t,e,i){i(57);var o=i(17).Object;t.exports=function(t,e){return o.create(t,e)}},function(t,e,i){var o=i(15);o(o.S,"Object",{create:i(33)})},function(t,e,i){t.exports={default:i(59),__esModule:!0}},function(t,e,i){i(60),t.exports=i(17).Object.keys},function(t,e,i){var o=i(49),n=i(35);i(61)("keys",function(){return function(t){return n(o(t))}})},function(t,e,i){var o=i(15),n=i(17),s=i(26);t.exports=function(t,e){var i=(n.Object||{})[t]||Object[t],r={};r[t]=e(i),o(o.S+o.F*s(function(){i(1)}),"Object",r)}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(63),s=o(n),r=i(66),a=o(r),h="function"==typeof a.default&&"symbol"==typeof s.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===h(s.default)?function(t){return"undefined"==typeof t?"undefined":h(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":h(t)}},function(t,e,i){t.exports={default:i(64),__esModule:!0}},function(t,e,i){i(50),i(4),t.exports=i(65).f("iterator")},function(t,e,i){e.f=i(47)},function(t,e,i){t.exports={default:i(67),__esModule:!0}},function(t,e,i){i(68),i(79),i(80),i(81),t.exports=i(17).Symbol},function(t,e,i){var o=i(16),n=i(31),s=i(25),r=i(15),a=i(30),h=i(69).KEY,d=i(26),l=i(42),u=i(46),p=i(43),c=i(47),f=i(65),m=i(70),g=i(71),v=i(72),y=i(75),b=i(22),_=i(9),w=i(28),x=i(29),D=i(33),S=i(76),k=i(78),T=i(21),C=i(35),M=k.f,O=T.f,E=S.f,P=o.Symbol,N=o.JSON,A=N&&N.stringify,I="prototype",R=c("_hidden"),L=c("toPrimitive"),F={}.propertyIsEnumerable,H=l("symbol-registry"),Y=l("symbols"),j=l("op-symbols"),G=Object[I],z="function"==typeof P,W=o.QObject,U=!W||!W[I]||!W[I].findChild,V=s&&d(function(){return 7!=D(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(t,e,i){var o=M(G,e);o&&delete G[e],O(t,e,i),o&&t!==G&&O(G,e,o)}:O,B=function(t){var e=Y[t]=D(P[I]);return e._k=t,e},q=z&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},X=function(t,e,i){return t===G&&X(j,e,i),b(t),e=w(e,!0),b(i),n(Y,e)?(i.enumerable?(n(t,R)&&t[R][e]&&(t[R][e]=!1),i=D(i,{enumerable:x(0,!1)})):(n(t,R)||O(t,R,x(1,{})),t[R][e]=!0),V(t,e,i)):O(t,e,i)},Z=function(t,e){b(t);for(var i,o=v(e=_(e)),n=0,s=o.length;s>n;)X(t,i=o[n++],e[i]);return t},K=function(t,e){return void 0===e?D(t):Z(D(t),e)},$=function(t){var e=F.call(this,t=w(t,!0));return!(this===G&&n(Y,t)&&!n(j,t))&&(!(e||!n(this,t)||!n(Y,t)||n(this,R)&&this[R][t])||e)},J=function(t,e){if(t=_(t),e=w(e,!0),t!==G||!n(Y,e)||n(j,e)){var i=M(t,e);return!i||!n(Y,e)||n(t,R)&&t[R][e]||(i.enumerable=!0),i}},Q=function(t){for(var e,i=E(_(t)),o=[],s=0;i.length>s;)n(Y,e=i[s++])||e==R||e==h||o.push(e);return o},tt=function(t){for(var e,i=t===G,o=E(i?j:_(t)),s=[],r=0;o.length>r;)!n(Y,e=o[r++])||i&&!n(G,e)||s.push(Y[e]);return s};z||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(i){this===G&&e.call(j,i),n(this,R)&&n(this[R],t)&&(this[R][t]=!1),V(this,t,x(1,i))};return s&&U&&V(G,t,{configurable:!0,set:e}),B(t)},a(P[I],"toString",function(){return this._k}),k.f=J,T.f=X,i(77).f=S.f=Q,i(74).f=$,i(73).f=tt,s&&!i(14)&&a(G,"propertyIsEnumerable",$,!0),f.f=function(t){return B(c(t))}),r(r.G+r.W+r.F*!z,{Symbol:P});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)c(et[it++]);for(var et=C(c.store),it=0;et.length>it;)m(et[it++]);r(r.S+r.F*!z,"Symbol",{for:function(t){return n(H,t+="")?H[t]:H[t]=P(t)},keyFor:function(t){if(q(t))return g(H,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){U=!0},useSimple:function(){U=!1}}),r(r.S+r.F*!z,"Object",{create:K,defineProperty:X,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:tt}),N&&r(r.S+r.F*(!z||d(function(){var t=P();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!q(t)){for(var e,i,o=[t],n=1;arguments.length>n;)o.push(arguments[n++]);return e=o[1],"function"==typeof e&&(i=e),!i&&y(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!q(e))return e}),o[1]=e,A.apply(N,o)}}}),P[I][L]||i(20)(P[I],L,P[I].valueOf),u(P,"Symbol"),u(Math,"Math",!0),u(o.JSON,"JSON",!0)},function(t,e,i){var o=i(43)("meta"),n=i(23),s=i(31),r=i(21).f,a=0,h=Object.isExtensible||function(){return!0},d=!i(26)(function(){return h(Object.preventExtensions({}))}),l=function(t){r(t,o,{value:{i:"O"+ ++a,w:{}}})},u=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,o)){if(!h(t))return"F";if(!e)return"E";l(t)}return t[o].i},p=function(t,e){if(!s(t,o)){if(!h(t))return!0;if(!e)return!1;l(t)}return t[o].w},c=function(t){return d&&f.NEED&&h(t)&&!s(t,o)&&l(t),t},f=t.exports={KEY:o,NEED:!1,fastKey:u,getWeak:p,onFreeze:c}},function(t,e,i){var o=i(16),n=i(17),s=i(14),r=i(65),a=i(21).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=s?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:r.f(t)})}},function(t,e,i){var o=i(35),n=i(9);t.exports=function(t,e){for(var i,s=n(t),r=o(s),a=r.length,h=0;a>h;)if(s[i=r[h++]]===e)return i}},function(t,e,i){var o=i(35),n=i(73),s=i(74);t.exports=function(t){var e=o(t),i=n.f;if(i)for(var r,a=i(t),h=s.f,d=0;a.length>d;)h.call(t,r=a[d++])&&e.push(r);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(11);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(9),n=i(77).f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return n(t)}catch(t){return r.slice()}};t.exports.f=function(t){return r&&"[object Window]"==s.call(t)?a(t):n(o(t))}},function(t,e,i){var o=i(36),n=i(44).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,n)}},function(t,e,i){var o=i(74),n=i(29),s=i(9),r=i(28),a=i(31),h=i(24),d=Object.getOwnPropertyDescriptor;e.f=i(25)?d:function(t,e){if(t=s(t),e=r(e,!0),h)try{return d(t,e)}catch(t){}if(a(t,e))return n(!o.f.call(t,e),t[e])}},function(t,e){},function(t,e,i){i(70)("asyncIterator")},function(t,e,i){i(70)("observable")},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(83)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return _o.apply(null,arguments)}function i(t){_o=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){var e;for(e in t)return!1;return!0}function r(t){return void 0===t}function a(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var i,o=[];for(i=0;i0)for(i=0;i0?"future":"past"];return T(i)?i(e):i.replace(/%s/i,e)}function L(t,e){var i=t.toLowerCase();Ro[i]=Ro[i+"s"]=Ro[e]=t}function F(t){return"string"==typeof t?Ro[t]||Ro[t.toLowerCase()]:void 0}function H(t){var e,i,o={};for(i in t)l(t,i)&&(e=F(i),e&&(o[e]=t[i]));return o}function Y(t,e){Lo[t]=e}function j(t){var e=[];for(var i in t)e.push({unit:i,priority:Lo[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function G(t,i){return function(o){return null!=o?(W(this,t,o),e.updateOffset(this,i),this):z(this,t)}}function z(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function W(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function U(t){return t=F(t),T(this[t])?this[t]():this}function V(t,e){if("object"==typeof t){t=H(t);for(var i=j(t),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function q(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(jo[t]=n),e&&(jo[e[0]]=function(){return B(n.apply(this,arguments),e[1],e[2])}),i&&(jo[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Z(t){var e,i,o=t.match(Fo);for(e=0,i=o.length;e=0&&Ho.test(t);)t=t.replace(Ho,i),Ho.lastIndex=0,o-=1;return t}function J(t,e,i){sn[t]=T(e)?e:function(t,o){return t&&i?i:e}}function Q(t,e){return l(sn,t)?sn[t](e._strict,e._locale):new RegExp(tt(t))}function tt(t){return et(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function et(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),a(e)&&(o=function(t,i){i[e]=w(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function wt(t,e,i){var o=7+e-i,n=(7+_t(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 d<=0?(s=t-1,r=gt(s)+d):d>gt(t)?(s=t+1,r=d-gt(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 r<1?(n=t.year()-1,o=r+St(n,e,i)):r>St(t.year(),e,i)?(o=r-St(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function St(t,e,i){var o=wt(t,e,i),n=wt(t+1,e,i);return(gt(t)-o+n)/7}function kt(t){return Dt(t,this._week.dow,this._week.doy).week}function Tt(){return this._week.dow}function Ct(){return this._week.doy}function Mt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ot(t){var e=Dt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Et(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Pt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Nt(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone}function At(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function It(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Rt(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=p([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=gn.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===e?(n=gn.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=gn.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===e?(n=gn.call(this._weekdaysParse,r),n!==-1?n:(n=gn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=gn.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===e?(n=gn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=gn.call(this._weekdaysParse,r),n!==-1?n:(n=gn.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=gn.call(this._minWeekdaysParse,r),n!==-1?n:(n=gn.call(this._weekdaysParse,r),n!==-1?n:(n=gn.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function Lt(t,e,i){var o,n,s;if(this._weekdaysParseExact)return Rt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=p([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 Ft(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Et(t,this.localeData()),this.add(t-e,"d")):e}function Ht(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 Yt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Pt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function jt(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Cn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Gt(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Mn),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function zt(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=On),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wt(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=p([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),h.push(s),d.push(o),d.push(n),d.push(s);for(r.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=et(a[e]),h[e]=et(h[e]),d[e]=et(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Ut(){return this.hours()%12||12}function Vt(){return this.hours()||24}function Bt(t,e){q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function qt(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Zt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Kt(t){return t?t.toLowerCase().replace("_","-"):t}function $t(t){for(var e,i,o,n,s=0;s0;){if(o=Jt(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&x(n,i,!0)>=e-1)break;e--}s++}return null}function Jt(e){var i=null;if(!In[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=En._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Qt(i)}catch(t){}return In[e]}function Qt(t,e){var i;return t&&(i=r(e)?ie(t):te(t,e),i&&(En=i)),En._abbr}function te(t,e){if(null!==e){var i=An;if(e.abbr=t,null!=In[t])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 See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=In[t]._config;else if(null!=e.parentLocale){if(null==In[e.parentLocale])return Rn[e.parentLocale]||(Rn[e.parentLocale]=[]),Rn[e.parentLocale].push({name:t,config:e}),null;i=In[e.parentLocale]._config}return In[t]=new O(M(i,e)),Rn[t]&&Rn[t].forEach(function(t){te(t.name,t.config)}),Qt(t),In[t]}return delete In[t],null}function ee(t,e){if(null!=e){var i,o=An;null!=In[t]&&(o=In[t]._config),e=M(o,e),i=new O(e),i.parentLocale=In[t],In[t]=i,Qt(t)}else null!=In[t]&&(null!=In[t].parentLocale?In[t]=In[t].parentLocale:null!=In[t]&&delete In[t]);return In[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return En;if(!o(t)){if(e=Jt(t))return e;t=[t]}return $t(t)}function oe(){return Mo(In)}function ne(t){var e,i=t._a;return i&&f(t).overflow===-2&&(e=i[hn]<0||i[hn]>11?hn:i[dn]<1||i[dn]>st(i[an],i[hn])?dn:i[ln]<0||i[ln]>24||24===i[ln]&&(0!==i[un]||0!==i[pn]||0!==i[cn])?ln:i[un]<0||i[un]>59?un:i[pn]<0||i[pn]>59?pn:i[cn]<0||i[cn]>999?cn:-1,f(t)._overflowDayOfYear&&(edn)&&(e=dn),f(t)._overflowWeeks&&e===-1&&(e=fn),f(t)._overflowWeekday&&e===-1&&(e=mn),f(t).overflow=e),t}function se(t){var e,i,o,n,s,r,a=t._i,h=Ln.exec(a)||Fn.exec(a);if(h){for(f(t).iso=!0,e=0,i=Yn.length;e10?"YYYY ":"YY "),s="HH:mm"+(i[4]?":ss":""),i[1]){var u=new Date(i[2]),p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][u.getDay()];if(i[1].substr(0,3)!==p)return f(t).weekdayMismatch=!0,void(t._isValid=!1)}switch(i[5].length){case 2:0===h?a=" +0000":(h=l.indexOf(i[5][1].toUpperCase())-12,a=(h<0?" -":" +")+(""+h).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:a=d[i[5]];break;default:a=d[" GMT"]}i[5]=a,t._i=i.splice(1).join(""),r=" ZZ",t._f=o+n+s+r,pe(t),f(t).rfc2822=!0}else t._isValid=!1}function ae(t){var i=Gn.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(se(t),void(t._isValid===!1&&(delete t._isValid,re(t),t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t)))))}function he(t,e,i){return null!=t?t:null!=e?e:i}function de(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function le(t){var e,i,o,n,s=[];if(!t._d){for(o=de(t),t._w&&null==t._a[dn]&&null==t._a[hn]&&ue(t),null!=t._dayOfYear&&(n=he(t._a[an],o[an]),(t._dayOfYear>gt(n)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=_t(n,0,t._dayOfYear),t._a[hn]=i.getUTCMonth(),t._a[dn]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ln]&&0===t._a[un]&&0===t._a[pn]&&0===t._a[cn]&&(t._nextDay=!0,t._a[ln]=0),t._d=(t._useUTC?_t:bt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ln]=24)}}function ue(t){var e,i,o,n,s,r,a,h;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)s=1,r=4,i=he(e.GG,t._a[an],Dt(_e(),1,4).year),o=he(e.W,1),n=he(e.E,1),(n<1||n>7)&&(h=!0);else{s=t._locale._week.dow,r=t._locale._week.doy;var d=Dt(_e(),s,r);i=he(e.gg,t._a[an],d.year),o=he(e.w,d.week),null!=e.d?(n=e.d,(n<0||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s}o<1||o>St(i,s,r)?f(t)._overflowWeeks=!0:null!=h?f(t)._overflowWeekday=!0:(a=xt(i,o,n,s,r),t._a[an]=a.year,t._dayOfYear=a.dayOfYear)}function pe(t){if(t._f===e.ISO_8601)return void se(t);if(t._f===e.RFC_2822)return void re(t);t._a=[],f(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=$(t._f,t._locale).match(Fo)||[],i=0;i0&&f(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),jo[s]?(o?f(t).empty=!1:f(t).unusedTokens.push(s),nt(s,o,t)):t._strict&&!o&&f(t).unusedTokens.push(s);f(t).charsLeftOver=h-d,a.length>0&&f(t).unusedInput.push(a),t._a[ln]<=12&&f(t).bigHour===!0&&t._a[ln]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[ln]=ce(t._locale,t._a[ln],t._meridiem),le(t),ne(t)}function ce(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&e<12&&(e+=12),o||12!==e||(e=0),e):e}function fe(t){var e,i,o,n,s;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ge(){if(!r(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),t=ve(t),t._a){var e=t._isUTC?p(t._a):_e(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ze(){return!!this.isValid()&&!this._isUTC}function We(){return!!this.isValid()&&this._isUTC}function Ue(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ve(t,e){var i,o,n,s=t,r=null;return Me(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:a(t)?(s={},e?s[e]=t:s.milliseconds=t):(r=Xn.exec(t))?(i="-"===r[1]?-1:1,s={y:0,d:w(r[dn])*i,h:w(r[ln])*i,m:w(r[un])*i,s:w(r[pn])*i,ms:w(Oe(1e3*r[cn]))*i}):(r=Zn.exec(t))?(i="-"===r[1]?-1:1,s={y:Be(r[2],i),M:Be(r[3],i),w:Be(r[4],i),d:Be(r[5],i),h:Be(r[6],i),m:Be(r[7],i),s:Be(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Xe(_e(s.from),_e(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new Ce(s),Me(t)&&l(t,"_locale")&&(o._locale=t._locale),o}function Be(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function qe(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 Xe(t,e){var i;return t.isValid()&&e.isValid()?(e=Ne(e,t),t.isBefore(e)?i=qe(t,e):(i=qe(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ze(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(k(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=Ve(i,o),Ke(this,n,t),this}}function Ke(t,i,o,n){var s=i._milliseconds,r=Oe(i._days),a=Oe(i._months);t.isValid()&&(n=null==n||n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&W(t,"Date",z(t,"Date")+r*o),a&<(t,z(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function $e(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Je(t,i){var o=t||_e(),n=Ne(o,this).startOf("day"),s=e.calendarFormat(this,n)||"sameElse",r=i&&(T(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,_e(o)))}function Qe(){return new y(this)}function ti(t,e){var i=b(t)?t:_e(t);return!(!this.isValid()||!i.isValid())&&(e=F(r(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()9999?K(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):T(Date.prototype.toISOString)?this.toDate().toISOString():K(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function li(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',o=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]';return this.format(i+o+n+s)}function ui(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var i=K(this,t);return this.localeData().postformat(i)}function pi(t,e){return this.isValid()&&(b(t)&&t.isValid()||_e(t).isValid())?Ve({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ci(t){return this.from(_e(),t)}function fi(t,e){return this.isValid()&&(b(t)&&t.isValid()||_e(t).isValid())?Ve({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function mi(t){return this.to(_e(),t)}function gi(t){var e;return void 0===t?this._locale._abbr:(e=ie(t),null!=e&&(this._locale=e),this)}function vi(){return this._locale}function yi(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 bi(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 _i(){return this._d.valueOf()-6e4*(this._offset||0)}function wi(){return Math.floor(this.valueOf()/1e3)}function xi(){return new Date(this.valueOf())}function Di(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Si(){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 ki(){return this.isValid()?this.toISOString():null}function Ti(){return m(this)}function Ci(){return u({},f(this))}function Mi(){return f(this).overflow}function Oi(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ei(t,e){q(0,[t,t.length],0,e)}function Pi(t){return Ri.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ni(t){return Ri.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Ai(){return St(this.year(),1,4)}function Ii(){var t=this.localeData()._week;return St(this.year(),t.dow,t.doy)}function Ri(t,e,i,o,n){var s;return null==t?Dt(this,o,n).year:(s=St(t,o,n),e>s&&(e=s),Li.call(this,t,e,i,o,n))}function Li(t,e,i,o,n){var s=xt(t,e,i,o,n),r=_t(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Fi(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Hi(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 Yi(t,e){e[cn]=w(1e3*("0."+t))}function ji(){return this._isUTC?"UTC":""}function Gi(){return this._isUTC?"Coordinated Universal Time":""}function zi(t){return _e(1e3*t)}function Wi(){return _e.apply(null,arguments).parseZone()}function Ui(t){return t}function Vi(t,e,i,o){var n=ie(),s=p().set(o,e);return n[i](s,t)}function Bi(t,e,i){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return Vi(t,e,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=Vi(t,o,i,"month");return n; -}function qi(t,e,i,o){"boolean"==typeof t?(a(e)&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,a(e)&&(i=e,e=void 0),e=e||"");var n=ie(),s=t?n._week.dow:0;if(null!=i)return Vi(e,(i+s)%7,o,"day");var r,h=[];for(r=0;r<7;r++)h[r]=Vi(e,(r+s)%7,o,"day");return h}function Xi(t,e){return Bi(t,e,"months")}function Zi(t,e){return Bi(t,e,"monthsShort")}function Ki(t,e,i){return qi(t,e,i,"weekdays")}function $i(t,e,i){return qi(t,e,i,"weekdaysShort")}function Ji(t,e,i){return qi(t,e,i,"weekdaysMin")}function Qi(){var t=this._data;return this._milliseconds=rs(this._milliseconds),this._days=rs(this._days),this._months=rs(this._months),t.milliseconds=rs(t.milliseconds),t.seconds=rs(t.seconds),t.minutes=rs(t.minutes),t.hours=rs(t.hours),t.months=rs(t.months),t.years=rs(t.years),this}function to(t,e,i,o){var n=Ve(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function eo(t,e){return to(this,t,e,1)}function io(t,e){return to(this,t,e,-1)}function oo(t){return t<0?Math.floor(t):Math.ceil(t)}function no(){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||s<=0&&r<=0&&a<=0||(s+=864e5*oo(ro(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=_(s/1e3),h.seconds=t%60,e=_(t/60),h.minutes=e%60,i=_(e/60),h.hours=i%24,r+=_(i/24),n=_(so(r)),a+=n,r-=oo(ro(n)),o=_(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function so(t){return 4800*t/146097}function ro(t){return 146097*t/4800}function ao(t){if(!this.isValid())return NaN;var e,i,o=this._milliseconds;if(t=F(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+so(e),"month"===t?i:i/12;switch(e=this._days+Math.round(ro(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 ho(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN}function lo(t){return function(){return this.as(t)}}function uo(t){return t=F(t),this.isValid()?this[t+"s"]():NaN}function po(t){return function(){return this.isValid()?this._data[t]:NaN}}function co(){return _(this.days()/7)}function fo(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function mo(t,e,i){var o=Ve(t).abs(),n=xs(o.as("s")),s=xs(o.as("m")),r=xs(o.as("h")),a=xs(o.as("d")),h=xs(o.as("M")),d=xs(o.as("y")),l=n<=Ds.ss&&["s",n]||n0,l[4]=i,fo.apply(null,l)}function go(t){return void 0===t?xs:"function"==typeof t&&(xs=t,!0)}function vo(t,e){return void 0!==Ds[t]&&(void 0===e?Ds[t]:(Ds[t]=e,"s"===t&&(Ds.ss=e-1),!0))}function yo(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=mo(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function bo(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i,o=Ss(this._milliseconds)/1e3,n=Ss(this._days),s=Ss(this._months);t=_(o/60),e=_(t/60),o%=60,t%=60,i=_(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,u=o,p=this.asSeconds();return p?(p<0?"-":"")+"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 _o,wo;wo=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;o68?1900:2e3)};var xn=G("FullYear",!0);q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Y("week",5),Y("isoWeek",5),J("w",Bo),J("ww",Bo,zo),J("W",Bo),J("WW",Bo,zo),ot(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=w(t)});var Dn={dow:0,doy:6};q("d",0,"do","day"),q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),J("d",Bo),J("e",Bo),J("E",Bo),J("dd",function(t,e){return e.weekdaysMinRegex(t)}),J("ddd",function(t,e){return e.weekdaysShortRegex(t)}),J("dddd",function(t,e){return e.weekdaysRegex(t)}),ot(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:f(i).invalidWeekday=t}),ot(["d","e","E"],function(t,e,i,o){e[o]=w(t)});var Sn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),kn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Tn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cn=nn,Mn=nn,On=nn;q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Ut),q("k",["kk",2],0,Vt),q("hmm",0,0,function(){return""+Ut.apply(this)+B(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Ut.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),Bt("a",!0),Bt("A",!1),L("hour","h"),Y("hour",13),J("a",qt),J("A",qt),J("H",Bo),J("h",Bo),J("k",Bo),J("HH",Bo,zo),J("hh",Bo,zo),J("kk",Bo,zo),J("hmm",qo),J("hmmss",Xo),J("Hmm",qo),J("Hmmss",Xo),it(["H","HH"],ln),it(["k","kk"],function(t,e,i){var o=w(t);e[ln]=24===o?0:o}),it(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),it(["h","hh"],function(t,e,i){e[ln]=w(t),f(i).bigHour=!0}),it("hmm",function(t,e,i){var o=t.length-2;e[ln]=w(t.substr(0,o)),e[un]=w(t.substr(o)),f(i).bigHour=!0}),it("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[ln]=w(t.substr(0,o)),e[un]=w(t.substr(o,2)),e[pn]=w(t.substr(n)),f(i).bigHour=!0}),it("Hmm",function(t,e,i){var o=t.length-2;e[ln]=w(t.substr(0,o)),e[un]=w(t.substr(o))}),it("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[ln]=w(t.substr(0,o)),e[un]=w(t.substr(o,2)),e[pn]=w(t.substr(n))});var En,Pn=/[ap]\.?m?\.?/i,Nn=G("Hours",!0),An={calendar:Oo,longDateFormat:Eo,invalidDate:Po,ordinal:No,dayOfMonthOrdinalParse:Ao,relativeTime:Io,months:yn,monthsShort:bn,week:Dn,weekdays:Sn,weekdaysMin:Tn,weekdaysShort:kn,meridiemParse:Pn},In={},Rn={},Ln=/^\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)?)?$/,Fn=/^\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)?)?$/,Hn=/Z|[+-]\d\d(?::?\d\d)?/,Yn=[["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}/]],jn=[["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/]],Gn=/^\/?Date\((\-?\d+)/i,zn=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;e.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){},e.RFC_2822=function(){};var Wn=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:g()}),Vn=function(){return Date.now?Date.now():+new Date},Bn=["year","quarter","month","week","day","hour","minute","second","millisecond"];Ee("Z",":"),Ee("ZZ",""),J("Z",en),J("ZZ",en),it(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Pe(en,t)});var qn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Xn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Zn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ve.fn=Ce.prototype,Ve.invalid=Te;var Kn=Ze(1,"add"),$n=Ze(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Jn=S("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)});q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ei("gggg","weekYear"),Ei("ggggg","weekYear"),Ei("GGGG","isoWeekYear"),Ei("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),J("G",Qo),J("g",Qo),J("GG",Bo,zo),J("gg",Bo,zo),J("GGGG",Ko,Uo),J("gggg",Ko,Uo),J("GGGGG",$o,Vo),J("ggggg",$o,Vo),ot(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=w(t)}),ot(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),q("Q",0,"Qo","quarter"),L("quarter","Q"),Y("quarter",7),J("Q",Go),it("Q",function(t,e){e[hn]=3*(w(t)-1)}),q("D",["DD",2],"Do","date"),L("date","D"),Y("date",9),J("D",Bo),J("DD",Bo,zo),J("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),it(["D","DD"],dn),it("Do",function(t,e){e[dn]=w(t.match(Bo)[0],10)});var Qn=G("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Y("dayOfYear",4),J("DDD",Zo),J("DDDD",Wo),it(["DDD","DDDD"],function(t,e,i){i._dayOfYear=w(t)}),q("m",["mm",2],0,"minute"),L("minute","m"),Y("minute",14),J("m",Bo),J("mm",Bo,zo),it(["m","mm"],un);var ts=G("Minutes",!1);q("s",["ss",2],0,"second"),L("second","s"),Y("second",15),J("s",Bo),J("ss",Bo,zo),it(["s","ss"],pn);var es=G("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),Y("millisecond",16),J("S",Zo,Go),J("SS",Zo,zo),J("SSS",Zo,Wo);var is;for(is="SSSS";is.length<=9;is+="S")J(is,Jo);for(is="S";is.length<=9;is+="S")it(is,Yi);var os=G("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var ns=y.prototype;ns.add=Kn,ns.calendar=Je,ns.clone=Qe,ns.diff=ri,ns.endOf=bi,ns.format=ui,ns.from=pi,ns.fromNow=ci,ns.to=fi,ns.toNow=mi,ns.get=U,ns.invalidAt=Mi,ns.isAfter=ti,ns.isBefore=ei,ns.isBetween=ii,ns.isSame=oi,ns.isSameOrAfter=ni,ns.isSameOrBefore=si,ns.isValid=Ti,ns.lang=Jn,ns.locale=gi,ns.localeData=vi,ns.max=Un,ns.min=Wn,ns.parsingFlags=Ci,ns.set=V,ns.startOf=yi,ns.subtract=$n,ns.toArray=Di,ns.toObject=Si,ns.toDate=xi,ns.toISOString=di,ns.inspect=li,ns.toJSON=ki,ns.toString=hi,ns.unix=wi,ns.valueOf=_i,ns.creationData=Oi,ns.year=xn,ns.isLeapYear=yt,ns.weekYear=Pi,ns.isoWeekYear=Ni,ns.quarter=ns.quarters=Fi,ns.month=ut,ns.daysInMonth=pt,ns.week=ns.weeks=Mt,ns.isoWeek=ns.isoWeeks=Ot,ns.weeksInYear=Ii,ns.isoWeeksInYear=Ai,ns.date=Qn,ns.day=ns.days=Ft,ns.weekday=Ht,ns.isoWeekday=Yt,ns.dayOfYear=Hi,ns.hour=ns.hours=Nn,ns.minute=ns.minutes=ts,ns.second=ns.seconds=es,ns.millisecond=ns.milliseconds=os,ns.utcOffset=Ie,ns.utc=Le,ns.local=Fe,ns.parseZone=He,ns.hasAlignedHourOffset=Ye,ns.isDST=je,ns.isLocal=ze,ns.isUtcOffset=We,ns.isUtc=Ue,ns.isUTC=Ue,ns.zoneAbbr=ji,ns.zoneName=Gi,ns.dates=S("dates accessor is deprecated. Use date instead.",Qn),ns.months=S("months accessor is deprecated. Use month instead",ut),ns.years=S("years accessor is deprecated. Use year instead",xn),ns.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Re),ns.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ge);var ss=O.prototype;ss.calendar=E,ss.longDateFormat=P,ss.invalidDate=N,ss.ordinal=A,ss.preparse=Ui,ss.postformat=Ui,ss.relativeTime=I,ss.pastFuture=R,ss.set=C,ss.months=rt,ss.monthsShort=at,ss.monthsParse=dt,ss.monthsRegex=ft,ss.monthsShortRegex=ct,ss.week=kt,ss.firstDayOfYear=Ct,ss.firstDayOfWeek=Tt,ss.weekdays=Nt,ss.weekdaysMin=It,ss.weekdaysShort=At,ss.weekdaysParse=Lt,ss.weekdaysRegex=jt,ss.weekdaysShortRegex=Gt,ss.weekdaysMinRegex=zt,ss.isPM=Xt,ss.meridiem=Zt,Qt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",Qt),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",ie);var rs=Math.abs,as=lo("ms"),hs=lo("s"),ds=lo("m"),ls=lo("h"),us=lo("d"),ps=lo("w"),cs=lo("M"),fs=lo("y"),ms=po("milliseconds"),gs=po("seconds"),vs=po("minutes"),ys=po("hours"),bs=po("days"),_s=po("months"),ws=po("years"),xs=Math.round,Ds={ss:44,s:45,m:45,h:22,d:26,M:11},Ss=Math.abs,ks=Ce.prototype;return ks.isValid=ke,ks.abs=Qi,ks.add=eo,ks.subtract=io,ks.as=ao,ks.asMilliseconds=as,ks.asSeconds=hs,ks.asMinutes=ds,ks.asHours=ls,ks.asDays=us,ks.asWeeks=ps,ks.asMonths=cs,ks.asYears=fs,ks.valueOf=ho,ks._bubble=no,ks.get=uo,ks.milliseconds=ms,ks.seconds=gs,ks.minutes=vs,ks.hours=ys,ks.days=bs,ks.weeks=co,ks.months=_s,ks.years=ws,ks.humanize=yo,ks.toISOString=bo,ks.toString=bo,ks.toJSON=bo,ks.locale=gi,ks.localeData=vi,ks.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bo),ks.lang=Jn,q("X",0,0,"unix"),q("x",0,0,"valueOf"),J("x",Qo),J("X",on),it("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,i){i._d=new Date(w(t))}),e.version="2.18.1",i(_e),e.fn=ns,e.min=xe,e.max=De,e.now=Vn,e.utc=p,e.unix=zi,e.months=Xi,e.isDate=h,e.locale=Qt,e.invalid=g,e.duration=Ve,e.isMoment=b,e.weekdays=Ki,e.parseZone=Wi,e.localeData=ie,e.isDuration=Me,e.monthsShort=Zi,e.weekdaysMin=Ji,e.defineLocale=te,e.updateLocale=ee,e.locales=oe,e.weekdaysShort=$i,e.normalizeUnits=F,e.relativeTimeRounding=go,e.relativeTimeThreshold=vo,e.calendarFormat=$e,e.prototype=ns,e})}).call(e,i(84)(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=85},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){n<16&&(e[o+n++]=u[t])});n<16;)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:v+1,d=a-g+(h-v)/1e4;if(d<0&&void 0===t.clockseq&&(r=r+1&16383),(d<0||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,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 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 p=t.node||f,c=0;c<6;c++)s[n+c]=p[c];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;a<16;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;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],u={},p=0;p<256;p++)l[p]=(p+256).toString(16).substr(1),u[l[p]]=p;var c=r(),f=[1|c[0],c[1],c[2],c[3],c[4],c[5]],m=16383&(c[6]<<8|c[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;i0?(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){n<0&&(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){return t&&t.__esModule?t:{default:t}}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=(0,l.default)(this._options.type),o=0,n=i.length;on?1:or)&&(s=h,r=d)}return s},n.prototype.min=function(t){var e,i,o=this._data,n=(0,l.default)(o),s=null,r=null;for(e=0,i=n.length;ethis.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){return t&&t.__esModule?t:{default:t}}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 s=i(58),r=o(s),a=i(1),h=i(88);n.prototype.setData=function(t){var e,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=e.length;os)&&(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;this.range.setRange(r-a/2,r+a/2,{animation:h})}}},o.prototype.fit=function(t){var e,i=!t||void 0===t.animation||t.animation,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,{animation:i}))},o.prototype.getItemRange=function(){var t=this.getDataRange(),e=null!==t.min?t.min.valueOf():null,i=null!==t.max?t.max.valueOf():null,o=null,n=null;if(null!=e&&null!=i){var r=function(t){return s.convert(t.data.start,"Date").valueOf()},a=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return s.convert(e,"Date").valueOf()},h=i-e;h<=0&&(h=10);var d=h/this.props.center.width;if(s.forEach(this.itemSet.items,function(t){t.groupShowing&&(t.show(),t.repositionX());var s=r(t),h=a(t);if(this.options.rtl)var l=s-(t.getWidthRight()+10)*d,u=h+(t.getWidthLeft()+10)*d;else var l=s-(t.getWidthLeft()+10)*d,u=h+(t.getWidthRight()+10)*d;li&&(i=u,n=t)}.bind(this)),o&&n){var l=o.getWidthLeft()+10,u=n.getWidthRight()+10,p=this.props.center.width-l-u;p>0&&(this.options.rtl?(e=r(o)-u*h/p,i=a(n)+l*h/p):(e=r(o)-l*h/p,i=a(n)+u*h/p))}}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}},o.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=s.convert(i.start,"Date").valueOf(),n=s.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||oe)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},o.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=s.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-s.getAbsoluteLeft(this.dom.centerContainer);var n=i-s.getAbsoluteTop(this.dom.centerContainer),r=this.itemSet.itemFromTarget(t),a=this.itemSet.groupFromTarget(t),h=p.customTimeFromTarget(t),d=this.itemSet.options.snap||null,l=this.body.util.getScale(),u=this.body.util.getStep(),c=this._toTime(o),f=d?d(c,l,u):c,m=s.getTarget(t),g=null;return null!=r?g="item":null!=h?g="custom-time":s.hasParent(m,this.timeAxis.dom.foreground)?g="axis":this.timeAxis2&&s.hasParent(m,this.timeAxis2.dom.foreground)?g="axis":s.hasParent(m,this.itemSet.dom.labelSet)?g="group-label":s.hasParent(m,this.currentTime.bar)?g="current-time":s.hasParent(m,this.dom.center)&&(g="background"),{event:t,item:r?r.id:null,group:a?a.groupId:null,what:g,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:c,snappedTime:f}},o.prototype.toggleRollingMode=function(){this.range.rolling?this.range.stopRolling():(void 0==this.options.rollingMode&&this.setOptions(this.options),this.range.startRolling())},t.exports=o},function(t,e){function i(t){if(t)return o(t)}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;n0?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);e!==-1&&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.7 - 2016-04-22 - * http://hammerjs.github.io/ - * - * Copyright (c) 2016 Jorik Tangelder; - * Licensed under the MIT license */ -!function(n,s,r,a){function h(t,e,i){return setTimeout(c(t,i),e)}function d(t,e,i){return!!Array.isArray(t)&&(l(t,i[e],i),!0)}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\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 p(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&mt(o,i)}function c(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==yt?t.apply(e?e[0]||a:a,e):t}function m(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;oi[e]}):o.sort()),o}function S(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=A(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=wt(),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=_t(d.x)>_t(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,N(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!==It&&s.eventType!==Lt||(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 N(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Ft&&(h>At||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=_t(u.x)>_t(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 A(t){for(var e=[],i=0;i=_t(e)?t<0?Yt:jt:e<0?Gt:zt}function F(t,e,i){i||(i=Bt);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=Bt);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],qt)+H(t[1],t[0],qt)}function j(t,e){return F(e[0],e[1],qt)/F(t[0],t[1],qt)}function G(){this.evEl=Zt,this.evWin=Kt,this.pressed=!1,C.apply(this,arguments)}function z(){this.evEl=Qt,this.evWin=te,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function W(){this.evTarget=ie,this.evWin=oe,this.started=!1,C.apply(this,arguments)}function U(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(Lt|Ft)&&(i=D(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=se,this.targetIds={},C.apply(this,arguments)}function B(t,e){var i=x(t.touches),o=this.targetIds;if(e&(It|Rt)&&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===It)for(n=0;n-1&&o.splice(t,1)};setTimeout(n,re)}}function K(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-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;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=De)},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),p(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},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)}}),p(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(Lt|Ft)&&!n)this.reset();else if(t.eventType&It)this.reset(),this._timer=h(function(){this.state=we,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return we;return De},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===we&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),p(ht,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),p(dt,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Wt|Ut,pointers:1},getTouchAction:function(){return st.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Wt|Ut)?e=t.overallVelocity:i&Wt?e=t.overallVelocityX:i&Ut&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&_t(e)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[pe]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance1e3&&(i=1e3),e.body.dom.rollingModeBtn.style.visibility="hidden",e.currentTimeTimer=setTimeout(t,i)}var e=this;t()},n.prototype.stopRolling=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),this.rolling=!1,this.body.dom.rollingModeBtn.style.visibility="visible")},n.prototype.setRange=function(t,e,i,o){i||(i={}),i.byUser!==!0&&(i.byUser=!1);var n=this,s=void 0!=t?p.convert(t,"Date").valueOf():null,r=void 0!=e?p.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),i.animation){var h=this.start,l=this.end,c="object"===(0,u.default)(i.animation)&&"duration"in i.animation?i.animation.duration:500,f="object"===(0,u.default)(i.animation)&&"easingFunction"in i.animation?i.animation.easingFunction:"easeInOutQuad",g=p.easingFunctions[f];if(!g)throw new Error("Unknown easing function "+(0,d.default)(f)+". Choose from: "+(0,a.default)(p.easingFunctions).join(", "));var v=(new Date).valueOf(),y=!1,b=function t(){if(!n.props.touch.dragging){var e=(new Date).valueOf(),a=e-v,d=g(a/c),u=a>c,p=u||null===s?s:h+(s-h)*d,f=u||null===r?r:l+(r-l)*d;_=n._applyRange(p,f),m.updateHiddenDates(n.options.moment,n.body,n.options.hiddenDates),y=y||_;var b={start:new Date(n.start),end:new Date(n.end),byUser:i.byUser,event:i.event};if(_&&n.body.emitter.emit("rangechange",b),u){if(y&&(n.body.emitter.emit("rangechanged",b),o))return o()}else n.animationTimer=setTimeout(t,20)}};return b()}var _=this._applyRange(s,r);if(m.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),_){var w={start:new Date(this.start),end:new Date(this.end),byUser:i.byUser,event:i.event};if(this.body.emitter.emit("rangechange",w),clearTimeout(n.timeoutID),n.timeoutID=setTimeout(function(){n.body.emitter.emit("rangechanged",w)},200),o)return o()}},n.prototype.getMillisecondsPerPixel=function(){return(this.end-this.start)/this.body.dom.center.clientWidth},n.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},n.prototype._applyRange=function(t,e){var i,o=null!=t?p.convert(t,"Date").valueOf():this.start,n=null!=e?p.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?p.convert(this.options.max,"Date").valueOf():null,r=null!=this.options.min?p.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(ns&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=r&&o=this.start-h&&n<=this.end?(o=this.start,n=this.end):(i=a-(n-o),o-=i/2,n+=i/2)}}if(null!==this.options.zoomMax){var d=parseFloat(this.options.zoomMax);d<0&&(d=0),n-o>d&&(this.end-this.start===d&&othis.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},n.prototype.getRange=function(){return{start:this.start,end:this.end}},n.prototype.conversion=function(t,e){return n.conversion(this.start,this.end,t,e)},n.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}},n.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.stopRolling(),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"))},n.prototype._onDrag=function(t){if(t&&this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;s(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,n=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=n;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,d=this.props.touch.end+a,l=m.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),u=m.snapAwayFromHidden(this.body.hiddenDates,d,this.previousDelta-i,!0);if(l!=h||u!=d)return this.deltaDifference+=i,this.props.touch.start=l,this.props.touch.end=u,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,d);var p=new Date(this.start),c=new Date(this.end);this.body.emitter.emit("rangechange",{start:p,end:c,byUser:!0,event:t}),this.body.emitter.emit("panmove")}},n.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,event:t}))},n.prototype._onMouseWheel=function(t){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable){if(this.options.horizontalScroll){t.preventDefault();var i=e*(this.end-this.start)/20,o=this.start-i,n=this.end-i,s={animation:!1,byUser:!0,event:t};this.setRange(o,n,s)}}else if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){var r;r=e<0?1-e/5:1/(1+e/5);var a;if(this.rolling)a=this.start+(this.end-this.start)*this.options.rollingMode.offset;else{var h=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center);a=this._pointerToDate(h)}this.zoom(r,a,e,t),t.preventDefault()}},n.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},n.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)),this.stopRolling();var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=m.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=1-e<=0,this.endToFront=e-1<=0;var h=m.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),d=m.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&d==a||(this.props.touch.start=h,this.props.touch.end=d,this.scaleOffset=1-t.scale,r=h,a=d);var l={animation:!1,byUser:!0,event:t};this.setRange(r,a,l),this.startToFront=!1,this.endToFront=!0}},n.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-p.getAbsoluteLeft(this.body.dom.centerContainer);else var i=p.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},n.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(s(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},n.prototype.getPointer=function(t,e){return this.options.rtl?{x:p.getAbsoluteRight(e)-t.x,y:t.y-p.getAbsoluteTop(e)}:{x:t.x-p.getAbsoluteLeft(e),y:t.y-p.getAbsoluteTop(e)}},n.prototype.zoom=function(t,e,i,o){null==e&&(e=(this.start+this.end)/2);var n=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),s=m.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),r=n-s,a=e-s+(this.start-(e-s))*t,h=e+r+(this.end-(e+r))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var d=m.snapAwayFromHidden(this.body.hiddenDates,a,i,!0),l=m.snapAwayFromHidden(this.body.hiddenDates,h,-i,!0);d==a&&l==h||(a=d,h=l);var u={animation:!1,byUser:!0,event:o};this.setRange(a,h,u),this.startToFront=!1,this.endToFront=!0},n.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},n.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i,s={animation:!1,byUser:!0,event:null};this.setRange(o,n,s)},t.exports=n},function(t,e,i){i(95);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){this.options=null,this.props=null}var n=i(1);o.prototype.setOptions=function(t){t&&n.extend(this.options,t)},o.prototype.redraw=function(){return!1},o.prototype.destroy=function(){},o.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=o; -},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=4*a){var p=0,c=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(p=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-p,"days"),c.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"),c.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(p=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(p,"months"),c.add(1,"months");break;case"yearly":d.year()!=l.year()&&(p=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(p,"years"),c.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;d=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=r&&nt.range.end){var h={start:t.range.start,end:i};i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,h,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale}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=e&&r=e&&r<=i&&(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=i.start&&a=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?o<0?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=o&&t-1||h))return t.dataTransfer.dropEffect="move",h=!0,!1}function n(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation();try{var e=JSON.parse(t.dataTransfer.getData("text"));if(!e.content)return}catch(t){return!1}return h=!1,t.center={x:t.clientX,y:t.clientY},s.itemSet._onAddItem(t),s.emit("drop",s.getEventProperties(t)),!1}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.rollingModeBtn=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.rollingModeBtn.className="vis-rolling-mode-btn",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.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.rollingModeBtn),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.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.on("rangechange",function(){this.initialDrawDone===!0&&this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("panmove",this._onDrag.bind(this));var s=this;this._origRedraw=this._redraw.bind(this),this._redraw=p.throttle(this._origRedraw),this.on("_change",function(t){s.itemSet&&s.itemSet.initialItemSetDrawn&&t&&1==t.queue?s._redraw():s._origRedraw()}),this.hammer=new l(this.dom.root);var r=this.hammer.get("pinch").set({enable:!0});u.disablePreventDefaultVertically(r),this.hammer.get("pan").set({threshold:5,direction:l.DIRECTION_HORIZONTAL}),this.listeners={};var a=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];a.forEach(function(t){var e=function(e){s.isActive()&&s.emit(t,e)};s.hammer.on(t,e),s.listeners[t]=e}),u.onTouch(this.hammer,function(t){s.emit("touch",t)}.bind(this)),u.onRelease(this.hammer,function(t){s.emit("release",t)}.bind(this)),this.dom.centerContainer.addEventListener?(this.dom.centerContainer.addEventListener("mousewheel",e.bind(this),!1),this.dom.centerContainer.addEventListener("DOMMouseScroll",e.bind(this),!1)):this.dom.centerContainer.attachEvent("onmousewheel",e.bind(this)),this.dom.left.parentNode.addEventListener("scroll",i.bind(this)),this.dom.right.parentNode.addEventListener("scroll",i.bind(this));var h=!1;if(this.dom.center.addEventListener("dragover",o.bind(this),!1),this.dom.center.addEventListener("drop",n.bind(this),!1),this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root)},n.prototype.setOptions=function(t){if(t){var e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","rtl","zoomKey","horizontalScroll","verticalScroll"];if(p.selectiveExtend(e,this.options,t),this.dom.rollingModeBtn.style.visibility="hidden",this.options.rtl&&(this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"),this.options.verticalScroll&&(this.options.rtl?this.dom.rightContainer.className="vis-panel vis-right vis-vertical-scroll":this.dom.leftContainer.className="vis-panel vis-left vis-vertical-scroll"),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"===(0,h.default)(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 i=this.timeAxis2=new c(this.body);i.setOptions=function(t){var e=t?p.extend({},t):{};e.orientation="top",c.prototype.setOptions.call(i,e)},this.components.push(i)}}else if(this.timeAxis2){var o=this.components.indexOf(this.timeAxis2);o!==-1&&this.components.splice(o,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&m.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new f(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 n=p.deepExtend({},this.options);this.components.forEach(function(t){p.deepExtend(n,t.options)}),this.configurator.setModuleOptions({global:n})}this._redraw()},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.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},n.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 "+(0,r.default)(e));i.length>0&&i[0].setCustomTime(t)},n.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 "+(0,r.default)(t));return e[0].getCustomTime()},n.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 "+(0,r.default)(e));if(i.length>0)return i[0].setCustomTitle(t)},n.prototype.getEventProperties=function(t){return{event:t}},n.prototype.addCustomTime=function(t,e){var i=void 0!==t?p.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 "+(0,r.default)(e)+" already exists");var n=new g(this.body,p.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},n.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 "+(0,r.default)(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))},n.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},n.prototype.fit=function(t,e){var i=this.getDataRange();if(null!==i.min||null!==i.max){var o=i.max-i.min,n=new Date(i.min.valueOf()-.01*o),s=new Date(i.max.valueOf()+.01*o),r=!t||void 0===t.animation||t.animation;this.range.setRange(n,s,{animation:r},e)}},n.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},n.prototype.setWindow=function(t,e,i,o){"function"==typeof arguments[2]&&(o=arguments[2],i={});var n;if(1==arguments.length){var s=arguments[0];n=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:n})}else if(2==arguments.length&&"function"==typeof arguments[1]){var s=arguments[0];o=arguments[1],n=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:n},o)}else n=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,{animation:n},o)},n.prototype.moveTo=function(t,e,i){"function"==typeof arguments[1]&&(i=arguments[1],e={});var o=this.range.end-this.range.start,n=p.convert(t,"Date").valueOf(),s=n-o/2,r=n+o/2,a=!e||void 0===e.animation||e.animation;this.range.setRange(s,r,{animation:a},i)},n.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},n.prototype.zoomIn=function(t,e,i){if(!(!t||t<0||t>1)){"function"==typeof arguments[1]&&(i=arguments[1],e={});var o=this.getWindow(),n=o.start.valueOf(),s=o.end.valueOf(),r=s-n,a=r/(1+t),h=(r-a)/2,d=n+h,l=s-h;this.setWindow(d,l,e,i)}},n.prototype.zoomOut=function(t,e,i){if(!(!t||t<0||t>1)){"function"==typeof arguments[1]&&(i=arguments[1],e={});var o=this.getWindow(),n=o.start.valueOf(),s=o.end.valueOf(),r=s-n,a=n-r*t/2,h=s+r*t/2;this.setWindow(a,h,e,i)}},n.prototype.redraw=function(){this._redraw()},n.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){m.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(p.addClassName(o.root,"vis-top"),p.removeClassName(o.root,"vis-bottom")):(p.removeClassName(o.root,"vis-top"),p.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=p.option.asSize(e.maxHeight,""),o.root.style.minHeight=p.option.asSize(e.minHeight,""),o.root.style.width=p.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,i.borderRootHeight=o.root.offsetHeight-o.root.clientHeight,i.borderRootWidth=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&&(i.borderRootWidth=i.borderRootHeight),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 n=Math.max(i.left.height,i.center.height,i.right.height),s=i.top.height+n+i.bottom.height+i.borderRootHeight+i.border.top+i.border.bottom;o.root.style.height=p.option.asSize(e.height,s+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-i.borderRootHeight;var r=i.root.height-i.top.height-i.bottom.height-i.borderRootHeight;i.centerContainer.height=r,i.leftContainer.height=r,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-i.borderRootWidth,this.initialDrawDone||(i.scrollbarWidth=p.getScrollBarWidth()),e.verticalScroll?e.rtl?(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth+i.scrollbarWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth+i.scrollbarWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right),this._setDOM();var a=this._updateScrollTop();"top"!=e.orientation.item&&(a+=Math.max(i.centerContainer.height-i.center.height-i.border.top-i.border.bottom,0)),o.center.style.top=a+"px";var h=0==i.scrollTop?"hidden":"",d=i.scrollTop==i.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=h,o.shadowBottom.style.visibility=d,o.shadowTopLeft.style.visibility=h,o.shadowBottomLeft.style.visibility=d,o.shadowTopRight.style.visibility=h,o.shadowBottomRight.style.visibility=d,e.verticalScroll&&(o.rightContainer.className="vis-panel vis-right vis-vertical-scroll",o.leftContainer.className="vis-panel vis-left vis-vertical-scroll",o.shadowTopRight.style.visibility="hidden",o.shadowBottomRight.style.visibility="hidden",o.shadowTopLeft.style.visibility="hidden",o.shadowBottomLeft.style.visibility="hidden",o.left.style.top="0px",o.right.style.top="0px"),(!e.verticalScroll||i.center.heighti.centerContainer.height;this.hammer.get("pan").set({direction:u?l.DIRECTION_ALL:l.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var c=5;if(t){if(this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTope&&o.push(h.id):h.lefti&&o.push(h.id)}return o},n.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;in)return}}if(i&&i!=this.groupTouchParams.group){var h=e.get(i.groupId),d=e.get(this.groupTouchParams.group.groupId);d&&h&&(this.options.groupOrderSwap(d,h,e),e.update(d),e.update(h));var u=e.getIds({order:this.options.groupOrder});if(!l.equalArray(u,this.groupTouchParams.originalOrder))for(var c=this.groupTouchParams.originalOrder,f=this.groupTouchParams.group.groupId,m=Math.min(c.length,u.length),g=0,v=0,y=0;g=m)break;if(u[g+v]!=f)if(c[g+y]!=f){var b=u.indexOf(c[g+y]),_=e.get(u[g+v]),w=e.get(c[g+y]);this.options.groupOrderSwap(_,w,e),e.update(_),e.update(w);var x=u[g+v];u[g+v]=c[g+y],u[b]=x,g++}else y=1;else v=1}}}},n.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=l.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(!l.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,r=Math.min(s.length,n.length),a=0;a=r)break;var h=n.indexOf(s[a]),d=o.get(n[a]),u=o.get(s[a]);e.options.groupOrderSwap(d,u,o),o.update(d),o.update(u);var p=n[a];n[a]=s[a],n[h]=p,a++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},n.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})}},n.prototype._onMouseOver=function(t){var e=this.itemFromTarget(t);if(e){var i=this.itemFromRelatedTarget(t);if(e!==i){var o=e.getTitle();if(this.options.showTooltips&&o){null==this.popup&&(this.popup=new w(this.body.dom.root,this.options.tooltip.overflowMethod||"flip")),this.popup.setText(o);var n=this.body.dom.centerContainer;this.popup.setPosition(t.clientX-l.getAbsoluteLeft(n)+n.offsetLeft,t.clientY-l.getAbsoluteTop(n)+n.offsetTop),this.popup.show()}else null!=this.popup&&this.popup.hide();this.body.emitter.emit("itemover",{item:e.id,event:t})}}},n.prototype._onMouseOut=function(t){var e=this.itemFromTarget(t);if(e){var i=this.itemFromRelatedTarget(t);e!==i&&(null!=this.popup&&this.popup.hide(),this.body.emitter.emit("itemout",{item:e.id,event:t}))}},n.prototype._onMouseMove=function(t){var e=this.itemFromTarget(t);if(e&&this.options.showTooltips&&this.options.tooltip.followMouse&&this.popup&&!this.popup.hidden){var i=this.body.dom.centerContainer;this.popup.setPosition(t.clientX-l.getAbsoluteLeft(i)+i.offsetLeft,t.clientY-l.getAbsoluteTop(i)+i.offsetTop),this.popup.show()}},n.prototype._onMouseWheel=function(t){this.touchParams.itemIsDragging&&this._onDragEnd(t)},n.prototype._onUpdateItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this;if(t){var i=e.itemsData.get(t.id);this.options.onUpdate(i,function(t){t&&e.itemsData.getDataSet().update(t)})}}},n.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){if(this.options.rtl)var n=l.getAbsoluteRight(this.dom.frame),s=n-t.center.x;else var n=l.getAbsoluteLeft(this.dom.frame),s=t.center.x-n;var r,a=this.body.util.toTime(s),h=this.body.util.getScale(),d=this.body.util.getStep();if("drop"==t.type){if(r=JSON.parse(t.dataTransfer.getData("text")),r.content=r.content?r.content:"new item",r.start=r.start?r.start:i?i(a,h,d):a,r.type=r.type||"box",r[this.itemsData._fieldId]=r.id||l.randomUUID(),"range"==r.type&&!r.end){var u=this.body.util.toTime(s+this.props.width/5);r.end=i?i(u,h,d):u}}else if(r={start:i?i(a,h,d):a,content:"new item"},r[this.itemsData._fieldId]=l.randomUUID(),"range"===this.options.type){var u=this.body.util.toTime(s+this.props.width/5);r.end=i?i(u,h,d):u}var p=this.groupFromTarget(t);p&&(r.group=p.groupId),r=this._cloneItemData(r),this.options.onAdd(r,function(i){i&&(e.itemsData.getDataSet().add(i),"drop"==t.type&&e.setSelection([i.id]))})}}},n.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],o=t.srcEvent&&t.srcEvent.shiftKey||!1;if(o&&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=n._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 _||i.push(d.id)}}}else{var p=i.indexOf(e.id);p==-1?i.push(e.id):i.splice(p,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}},n._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},n.prototype.itemFromElement=function(t){for(var e=t;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},n.prototype.itemFromTarget=function(t){return this.itemFromElement(t.target)},n.prototype.itemFromRelatedTarget=function(t){return this.itemFromElement(t.relatedTarget)},n.prototype.groupFromTarget=function(t){var e=t.center?t.center.y:t.clientY,i=this.groupIds;i.length<=0&&this.groupsData&&(i=this.groupsData.getIds({order:this.options.groupOrder}));for(var o=0;oa&&ea)return s}else if(0===o&&e0&&this.current.milliseconds()0&&this.current.seconds()0&&this.current.minutes()0&&this.current.hours()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("week"==e)o.weekday()>2?(o.weekday(0),o.add(1,"week")):o.weekday(0),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.scale){case"year":case"month":case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(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"week":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){if(void 0==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);var e=this.format.minorLabels[this.scale];switch(this.scale){case"week":if(this.isMajor()&&0!==t.weekday())return"";default:return e&&e.length>0?this.moment(t).format(e):""}},o.prototype.getLabelMajor=function(t){if(void 0==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);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,d=[];switch(this.scale){case"millisecond": -d.push(e(a)),d.push(t(a.milliseconds()));break;case"second":d.push(e(a)),d.push(t(a.seconds()));break;case"minute":d.push(e(a)),d.push(t(a.minutes()));break;case"hour":d.push("vis-h"+a.hours()+this.step==4?"-h"+(a.hours()+4):""),d.push(e(a)),d.push(t(a.hours()));break;case"weekday":d.push("vis-"+a.format("dddd").toLowerCase()),d.push(e(a)),d.push(i(a)),d.push(t(a.date()));break;case"day":d.push("vis-day"+a.date()),d.push("vis-"+a.format("MMMM").toLowerCase()),d.push(e(a)),d.push(o(a)),d.push(this.step<=2?e(a):""),d.push(this.step<=2?"vis-"+a.format("dddd").toLowerCase():""),d.push(t(a.date()-1));break;case"week":d.push("vis-week"+a.format("w")),d.push(i(a)),d.push(t(a.week()));break;case"month":d.push("vis-"+a.format("MMMM").toLowerCase()),d.push(o(a)),d.push(t(a.month()));break;case"year":d.push("vis-year"+a.year()),d.push(n(a)),d.push(t(a.year()))}return d.filter(String).join(" ")},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,this.stackDirty=!0,e&&e.nestedGroups&&(this.nestedGroups=e.nestedGroups,0==e.showNested?this.showNested=!1:this.showNested=!0),this.nestedInGroup=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.itemsInRange=[],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 s=i(58),r=o(s),a=i(1),h=i(106);i(107);n.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.style.position="absolute",this.dom.marker.innerHTML="",this.dom.background.appendChild(this.dom.marker)},n.prototype.setData=function(t){var e,i;if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=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 e instanceof Object?i(t,this.dom.inner):void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";if(this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?a.removeClassName(this.dom.inner,"vis-hidden"):a.addClassName(this.dom.inner,"vis-hidden"),t&&t.nestedGroups){this.nestedGroups&&this.nestedGroups==t.nestedGroups||(this.nestedGroups=t.nestedGroups),void 0===t.showNested&&void 0!==this.showNested||(0==t.showNested?this.showNested=!1:this.showNested=!0),a.addClassName(this.dom.label,"vis-nesting-group");var o=this.itemSet.options.rtl?"collapsed-rtl":"collapsed";this.showNested?(a.removeClassName(this.dom.label,o),a.addClassName(this.dom.label,"expanded")):(a.removeClassName(this.dom.label,"expanded"),a.addClassName(this.dom.label,o))}else if(this.nestedGroups){this.nestedGroups=null;var o=this.itemSet.options.rtl?"collapsed-rtl":"collapsed";a.removeClassName(this.dom.label,o),a.removeClassName(this.dom.label,"expanded"),a.removeClassName(this.dom.label,"vis-nesting-group")}t&&t.nestedInGroup&&(a.addClassName(this.dom.label,"vis-nested-group"),this.itemSet.options&&this.itemSet.options.rtl?this.dom.inner.style.paddingRight="30px":this.dom.inner.style.paddingLeft="30px");var n=t&&t.className||null;n!=this.className&&(this.className&&(a.removeClassName(this.dom.label,this.className),a.removeClassName(this.dom.foreground,this.className),a.removeClassName(this.dom.background,this.className),a.removeClassName(this.dom.axis,this.className)),a.addClassName(this.dom.label,n),a.addClassName(this.dom.foreground,n),a.addClassName(this.dom.background,n),a.addClassName(this.dom.axis,n),this.className=n),this.style&&(a.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(a.addCssText(this.dom.label,t.style),this.style=t.style)},n.prototype.getLabelWidth=function(){return this.props.label.width},n.prototype.redraw=function(t,e,i){var o=!1,n=this.dom.marker.clientHeight;n!=this.lastMarkerHeight&&(this.lastMarkerHeight=n,a.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(e);var s=this.dom.foreground;this.top=s.offsetTop,this.right=s.offsetLeft,this.width=s.offsetWidth;var r=this.isVisible;this.isVisible=this._isGroupVisible(t,e);var d=i||this.stackDirty||this.isVisible&&!r;if(d){if("function"==typeof this.itemSet.options.order){var l=this,u=!1;a.forEach(this.items,function(t){t.displayed||(t.redraw(),l.visibleItems.push(t)),t.repositionX(u)});var p=this.orderedItems.byStart.slice().sort(function(t,e){return l.itemSet.options.order(t.data,e.data)});h.stack(p,e,!0),this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?h.stack(this.visibleItems,e,!0):h.nostack(this.visibleItems,e,this.subgroups,this.itemSet.options.stackSubgroups);this.stackDirty=!1}this._updateSubgroupsSizes();var c=this._calculateHeight(e),s=this.dom.foreground;this.top=s.offsetTop,this.right=s.offsetLeft,this.width=s.offsetWidth,o=a.updateProperty(this,"height",c)||o,o=a.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=a.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=c+"px",this.dom.foreground.style.height=c+"px",this.dom.label.style.height=c+"px";for(var f=0,m=this.visibleItems.length;f0){var e=this;this.resetSubgroups(),a.forEach(this.visibleItems,function(i){void 0!==i.data.subgroup&&(e.subgroups[i.data.subgroup].height=Math.max(e.subgroups[i.data.subgroup].height,i.height+t.item.vertical),e.subgroups[i.data.subgroup].visible=!0)})}},n.prototype._isGroupVisible=function(t,e){var i=this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop;return i},n.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,n=i[0].top+i[0].height;if(a.forEach(i,function(t){o=Math.min(o,t.top),n=Math.max(n,t.top+t.height)}),o>t.axis){var s=o-t.axis;n-=s,a.forEach(i,function(t){t.top-=s})}e=n+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},n.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)},n.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)},n.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),this.stackDirty=!0,void 0!==t.data.subgroup&&(this._addToSubgroup(t),this.orderSubgroups()),this.visibleItems.indexOf(t)==-1){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},n.prototype._addToSubgroup=function(t,e){e=e||t.data.subgroup,void 0!=e&&void 0===this.subgroups[e]&&(this.subgroups[e]={height:0,top:0,start:t.data.start,end:t.data.end,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),new Date(t.data.start)new Date(this.subgroups[e].end)&&(this.subgroups[e].end=t.data.end),this.subgroups[e].items.push(t)},n.prototype._updateSubgroupsSizes=function(){var t=this;if(t.subgroups)for(var e in t.subgroups){var i=t.subgroups[e].items[0].data.start,o=t.subgroups[e].items[0].data.end;t.subgroups[e].items.forEach(function(t){new Date(t.data.start)new Date(o)&&(o=t.data.end)}),t.subgroups[e].start=i,t.subgroups[e].end=o}},n.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=0&&(i.items.splice(o,1),i.items.length?this._updateSubgroupsSizes():delete this.subgroups[e])}}},n.prototype.removeFromDataSet=function(t){this.itemSet.removeItem(t.id)},n.prototype.order=function(){for(var t=a.toArray(this.items),e=[],i=[],o=0;o0)for(var l=0;lh}),1==this.checkRangedItems)for(this.checkRangedItems=!1,l=0;lh})}for(var l=0;l=0;s--){var r=e[s];if(n(r))break;void 0===o[r.id]&&(o[r.id]=!0,i.push(r))}for(var s=t+1;so[r].index&&e.collisionByTimes(o[n],o[r])){s=o[r];break}null!=s&&(o[n].top=s.top+s.height)}while(s)}for(var a=0;ae.right&&t.top-o.vertical+ie.top:t.left-o.horizontal+ie.left&&t.top-o.vertical+ie.top},e.collisionByTimes=function(t,e){return t.start<=e.start&&t.end>=e.start&&t.tope.top||e.start<=t.start&&e.end>=t.start&&e.topt.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(95),i(108));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.startt.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.visibleFrame=document.createElement("div"),t.visibleFrame.className="vis-item-visible-frame",t.box.appendChild(t.visibleFrame),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._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=this.editable.updateTime||this.editable.updateGroup,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._repaintOnItemUpdateTimeTooltip(t.box),this._repaintDeleteButton(t.box),this._repaintDragCenter(),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||(n<-o&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n+.5,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:n<0?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":(this.dom.content.style.left=e+"px",this.dom.content.style.width="calc(100% - "+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){return t&&t.__esModule?t:{default:t}}function n(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.groupShowing=!0,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this._updateEditStatus()}var s=i(62),r=o(s),a=i(58),h=o(a),d=i(95),l=i(1),u=i(82);n.prototype.stack=!0,n.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&null!=this.parent&&this.parent.itemSet._moveToGroup(this,t.group),this.parent.stackDirty=!0;var i=void 0!=t.subgroup&&this.data.subgroup!=t.subgroup;i&&null!=this.parent&&this.parent.changeSubgroup(this,this.data.subgroup,t.subgroup),this.data=t,this._updateEditStatus(),this.dirty=!0,this.displayed&&this.redraw()},n.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},n.prototype.isVisible=function(t){return!1},n.prototype.show=function(){return!1},n.prototype.hide=function(){return!1},n.prototype.redraw=function(){},n.prototype.repositionX=function(){},n.prototype.repositionY=function(){},n.prototype._repaintDragCenter=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragCenter){var t=this,e=document.createElement("div");e.className="vis-drag-center",e.dragCenterItem=this;var i=new d(e);i.on("tap",function(e){t.parent.itemSet.body.emitter.emit("click",{event:e,item:t.id})}),i.on("doubletap",function(e){e.stopPropagation(),t.parent.itemSet._onUpdateItem(t),t.parent.itemSet.body.emitter.emit("doubleClick",{event:e,item:t.id})}),this.dom.box?this.dom.box.appendChild(e):this.dom.point&&this.dom.point.appendChild(e),this.dom.dragCenter=e}else!this.selected&&this.dom.dragCenter&&(this.dom.dragCenter.parentNode&&this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter),this.dom.dragCenter=null)},n.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.overrideItems||null==this.editable)&&this.options.editable.remove||!this.options.editable.overrideItems&&null!=this.editable&&this.editable.remove;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 d(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)},n.prototype._repaintOnItemUpdateTimeTooltip=function(t){if(this.options.tooltipOnItemUpdateTime){var e=(this.options.editable.updateTime||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){var i=document.createElement("div");i.className="vis-onUpdateTime-tooltip",t.appendChild(i),this.dom.onItemUpdateTimeTooltip=i}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.options.rtl?this.dom.onItemUpdateTimeTooltip.style.right=this.dom.content.style.right:this.dom.onItemUpdateTimeTooltip.style.left=this.dom.content.style.left;var o,n=50,s=this.parent.itemSet.body.domProps.scrollTop;o="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;var r=o+this.parent.top-n<-s;r?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=this.height+2+"px"):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=this.height+2+"px");var a,h;this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(h=this.options.tooltipOnItemUpdateTime.template.bind(this),a=h(this.data)):(a="start: "+u(this.data.start).format("MM/DD/YYYY hh:mm"),this.data.end&&(a+="
end: "+u(this.data.end).format("MM/DD/YYYY hh:mm"))),this.dom.onItemUpdateTimeTooltip.innerHTML=a}}},n.prototype._updateContents=function(t){var e,i,o,n,s=this.parent.itemSet.itemsData.get(this.id),r=this.dom.box||this.dom.point,a=r.getElementsByClassName("vis-item-visible-frame")[0];if(this.options.visibleFrameTemplate?(n=this.options.visibleFrameTemplate.bind(this),o=n(s,r)):o="",a)if(o instanceof Object&&!(o instanceof Element))n(s,a);else{var h=this._contentToString(this.itemVisibleFrameContent)!==this._contentToString(o);if(h){if(o instanceof Element)a.innerHTML="",a.appendChild(o);else if(void 0!=o)a.innerHTML=o;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.itemVisibleFrameContent=o}}if(this.options.template?(i=this.options.template.bind(this),e=i(s,t,this.data)):e=this.data.content,e instanceof Object&&!(e instanceof Element))i(s,t);else{var h=this._contentToString(this.content)!==this._contentToString(e);if(h){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}}},n.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=(0,h.default)(this.data)}for(var i=0;it.start&&this.data.start.getTime()-ot.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-o/2t.start&&this.data.startt.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._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,i=this.options.orientation.item;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups;n[o].index;this.dom.box.style.height=this.parent.subgroups[o].height+"px","top"==i?this.dom.box.style.top=this.parent.top+this.parent.subgroups[o].top+"px":this.dom.box.style.top=this.parent.top+this.parent.height-this.parent.subgroups[o].top-this.parent.subgroups[o].height+"px",this.dom.box.style.bottom=""}else this.parent instanceof s?(e=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.bottom="bottom"==i?"0":"",this.dom.box.style.top="top"==i?"0":""):(e=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=e+"px"},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(114),s=o(n),r=i(115),a=o(r),h=function(){function t(e,i){(0,s.default)(this,t),this.container=e,this.overflowMethod=i||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return(0,a.default)(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=0,r=0;if("flip"==this.overflowMethod){var a=!1,h=!0;this.y-en-this.padding&&(a=!0),s=a?this.x-i:this.x,r=h?this.y-e:this.y}else r=this.y-e,r+e+this.padding>o&&(r=o-e-this.padding),rn&&(s=n-i-this.padding),s=.4*y}if(this.options.showMinorLabels&&v){var T=this._repaintMinorText(c,_,t,w);T.style.width=x+"px"}m&&this.options.showMajorLabels?(c>0&&(void 0==D&&(D=c),T=this._repaintMajorText(c,s.getLabelMajor(),t,w)),b=this._repaintMajorLine(c,x,t,w)):v?b=this._repaintMinorLine(c,x,t,w):b&&(b.style.width=parseInt(b.style.width)+x+"px")}if(S!==k||p||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+k+" lines."),p=!0),this.options.showMajorLabels){var C=this.body.util.toTime(0),M=s.getLabelMajor(C),O=M.length*(this.props.majorCharWidth||10)+10;(void 0==D||O1e3&&(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,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.printStyle=void 0;var n=i(89),s=o(n),r=i(62),a=o(r),h=i(58),d=o(h),l=i(114),u=o(l),p=i(115),c=o(p),f=i(1),m=!1,g=void 0,v="background: #FFeeee; color: #dd0000",y=function(){function t(){(0,u.default)(this,t)}return(0,c.default)(t,null,[{key:"validate",value:function(e,i,o){m=!1,g=i;var n=i;return void 0!==o&&(n=i[o]),t.parse(e,n,[]),m}},{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,r){var a=t.getType(i[e]),h=s[a];void 0!==h?"array"===t.getType(h)&&h.indexOf(i[e])===-1?(console.log('%cInvalid option detected in "'+e+'". Allowed values are:'+t.print(h)+' not "'+i[e]+'". '+t.printLocation(r,e),v),m=!0):"object"===a&&"__any__"!==n&&(r=f.copyAndExtendArray(r,e),t.parse(i[e],o[n],r)):void 0===s.any&&(console.log('%cInvalid type received for "'+e+'". Expected: '+t.print((0,d.default)(s))+". Received ["+a+'] "'+i[e]+'"'+t.printLocation(r,e),v),m=!0)}},{key:"getType",value:function(t){var e="undefined"==typeof t?"undefined":(0,a.default)(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,g,[],!0),r=8,a=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',v):s.distance<=a&&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,""),v):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),v):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print((0,d.default)(i))+t.printLocation(o,e),v),m=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[],h=e.toLowerCase(),d=void 0;for(var l in i){var u=void 0;if(void 0!==i[l].__type__&&n===!0){var p=t.findInOptions(e,i[l],f.copyAndExtendArray(o,l));s>p.distance&&(r=p.closestMatch,a=p.path,s=p.distance,d=p.indexMatch)}else l.toLowerCase().indexOf(h)!==-1&&(d=l),u=t.levenshteinDistance(e,l),s>u&&(r=l,a=f.copyArray(o),s=u)}return{closestMatch:r,path:a,distance:s,indexMatch:d}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;n3&&void 0!==arguments[3]?arguments[3]:1;(0,d.default)(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},p.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new c(n),this.wrapper=void 0}return(0,u.default)(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":(0,a.default)(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&&e.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);if(this.options.showButton===!0){var s=document.createElement("div");s.className="vis-configuration vis-config-button",s.innerHTML="generate options",s.onclick=function(){t._printOptions()},s.onmouseover=function(){s.className="vis-configuration vis-config-button hover"},s.onmouseout=function(){s.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(s)}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;t1?i-1:0),n=1;n2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+":":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&&t.indexOf(e)!==-1&&(n=t.indexOf(e));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(e*l),d=a.max,h="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 c=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,c,a,u);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&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=p.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 d=this._getValue(h);if(a instanceof Array)this._handleArray(a,d,h);else if("string"==typeof a)this._makeTextInput(a,d,h);else if("boolean"==typeof a)this._makeCheckbox(a,d,h);else if(a instanceof Object){var l=!0;if(e.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(l=!1),l===!0)if(void 0!==a.enabled){var u=p.copyAndExtendArray(h,"enabled"),c=this._getValue(u);if(c===!0){var f=this._makeLabel(r,h,!0);this._makeItem(h,f),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,c,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||t,t="false"!==t&&t;for(var n=0;nvar options = "+(0,s.default)(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:1;(0,a.default)(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(0,d.default)(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"};if("string"==typeof t)return e[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),p.isString(t)===!0){if(p.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(p.isValidRGBA(t)===!0){var r=t.substr(5).substr(0,t.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(p.isValidHex(t)===!0){var a=p.hexToRGB(t);i={r:a.r,g:a.g,b:a.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: "+(0,s.default)(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e===!0&&(this.previousColor=p.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])||arguments[1];e===!0&&(this.initialColor=p.extend({},t)),this.color=t;var i=p.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=p.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=p.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]?arguments[0]:this.color,e=p.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(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var t=this;this.drag={},this.pinch={},this.hammer=new l(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),u.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 a=2*Math.PI/360,h=1/360,d=1/this.r,l=void 0;for(s=0;s<360;s++)for(r=0;rr?r:t,e=null==e?r:e0&&l.push(u.screenToValue(n)),!c.hidden&&this.itemsData.length>0&&l.push(c.screenToValue(n)),{event:t,what:d,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:r,value:l}},o.prototype._createConfigurator=function(){return new v(this,this.dom.container,g)},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this.id=a.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=a.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=a.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 s=i(62),r=o(s),a=i(1),h=i(87),d=i(88),l=i(92),u=i(100),p=i(131),c=i(133),f=i(137),m=i(134),g=i(136),v=i(135),y="__ungrouped__";n.prototype=new u,n.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 p(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new p(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new f(this.body,this.options.legend,"left",this.options.groups), -this.legendRight=new f(this.body,this.options.legend,"right",this.options.groups),this.show()},n.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",""))0){var a={};for(this._getRelevantData(r,a,n,s),this._applySampling(r,a),e=0;e0)switch(t.options.style){case"line":l.hasOwnProperty(r[e])||(l[r[e]]=g.calcPath(a[r[e]],t)),g.draw(l[r[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||v.draw(a[r[e]],t,this.framework);break;case"bar":}}}return h.cleanupElements(this.svgElements),!1},n.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;at[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}},n.prototype._getRelevantData=function(t,e,i,o){var n,s,r,h;if(t.length>0)for(s=0;s0)for(var o=0;o0){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;l0){for(s=0;s0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(o):h=h.concat(o):i[t[s]]=n.getYRange(o,t[s]));m.getStackedYRange(a,i,t,"__barStackLeft","left"),m.getStackedYRange(h,i,t,"__barStackRight","right")}},n.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;ui?i:a,d=di?i:h,l=l=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 a=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(a=this.props.titleCharHeight);var d=this.options.icons===!0?Math.max(this.options.iconWidth,a)+this.options.labelOffsetX+15:a+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-d&&this.options.visible===!0?(this.width=this.maxLabelSize+d,this.options.width=this.width+"px",h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+d),this.options.width=this.width+"px",h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),e=!1),e},n.prototype.convertValue=function(t){return this.scale.convertValue(t)},n.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},n.prototype._redrawLabel=function(t,e,i,o,n){var s=h.getDOMElement("div",this.DOMelements.labels,this.dom.frame);s.className=o,s.innerHTML=e,"left"===i?(s.style.left="-"+this.options.labelOffsetX+"px",s.style.textAlign="right"):(s.style.right="-"+this.options.labelOffsetX+"px",s.style.textAlign="left"),s.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&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;i<0&&(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=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.minorStepIdxo+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&ue.x?1:-1})):this.itemsData=[]},n.prototype.getItems=function(){return this.itemsData},n.prototype.setZeroPosition=function(t){this.zeroPosition=t},n.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];a.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),a.mergeOptions(this.options,t,"interpolation"),a.mergeOptions(this.options,t,"drawPoints"),a.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==(0,r.default)(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))}},n.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||t.visible,this.style=t.style,this.setOptions(t.options)},n.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":d.drawIcon(this,o,n,t,e,i);break;case"points":case"point":l.drawIcon(this,o,n,t,e,i);break;case"bar":h.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},n.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;ot[o].y?t[o].y:e,i=i0&&(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 t0?(o=t0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n0){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;n0&&(f=1/f),m=3*g*(g+v),m>0&&(m=1/m),a={screen_x:(-b*o.screen_x+p*n.screen_x+_*s.screen_x)*f,screen_y:(-b*o.screen_y+p*n.screen_y+_*s.screen_y)*f},h={screen_x:(y*n.screen_x+c*s.screen_x-b*r.screen_x)*m,screen_y:(y*n.screen_y+c*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")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},n.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=(0,r.default)(this.groups);t.sort(function(t,e){return t>>0,n=0;n0)for(i=0;i=0?i?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var H=/(\[[^\[]*\])|(\\)?([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,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,W={},z={};function U(t,e,i,n){var s=n;"string"==typeof n&&(s=function(){return this[n]()}),t&&(z[t]=s),e&&(z[e[0]]=function(){return F(s.apply(this,arguments),e[1],e[2])}),i&&(z[i]=function(){return this.localeData().ordinal(s.apply(this,arguments),t)})}function V(t,e){return t.isValid()?(e=B(e,t.localeData()),W[e]=W[e]||function(t){var e,i,n,s=t.match(H);for(e=0,i=s.length;e=0&&G.test(t);)t=t.replace(G,n),G.lastIndex=0,i-=1;return t}var X=/\d/,q=/\d\d/,Z=/\d{3}/,$=/\d{4}/,J=/[+-]?\d{6}/,K=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,it=/\d{1,4}/,nt=/[+-]?\d{1,6}/,st=/\d+/,rt=/[+-]?\d+/,ot=/Z|[+-]\d\d:?\d\d/gi,at=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ht={};function ut(t,e,i){ht[t]=Y(e)?e:function(t,n){return t&&i?i:e}}function dt(t,e){return d(ht,t)?ht[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,s){return e||i||n||s}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function mt(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),l(e)&&(n=function(t,i){i[e]=D(t)}),i=0;i68?1900:2e3)};var Ot,Ct=Yt("FullYear",!0);function Yt(t,e){return function(i){return null!=i?(Et(this,t,i),n.updateOffset(this,e),this):Pt(this,t)}}function Pt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Et(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Tt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Lt(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function Lt(t,e){if(isNaN(t)||isNaN(e))return NaN;var i,n=(e%(i=12)+i)%i;return t+=(e-n)/12,1===n?Tt(t)?29:28:31-n%7%2}Ot=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(a=new Date(t+400,e,i,n,s,r,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,s,r,o),a}function Ut(t){var e;if(t<100&&t>=0){var i=Array.prototype.slice.call(arguments);i[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Vt(t,e,i){var n=7+e-i;return-(7+Ut(t,0,n).getUTCDay()-e)%7+n-1}function Bt(t,e,i,n,s){var r,o,a=1+7*(e-1)+(7+i-n)%7+Vt(t,n,s);return a<=0?o=Mt(r=t-1)+a:a>Mt(t)?(r=t+1,o=a-Mt(t)):(r=t,o=a),{year:r,dayOfYear:o}}function Xt(t,e,i){var n,s,r=Vt(t.year(),e,i),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?n=o+qt(s=t.year()-1,e,i):o>qt(t.year(),e,i)?(n=o-qt(t.year(),e,i),s=t.year()+1):(s=t.year(),n=o),{week:n,year:s}}function qt(t,e,i){var n=Vt(t,e,i),s=Vt(t+1,e,i);return(Mt(t)-n+s)/7}function Zt(t,e){return t.slice(e,7).concat(t.slice(0,e))}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),j("week",5),j("isoWeek",5),ut("w",K),ut("ww",K,q),ut("W",K),ut("WW",K,q),pt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=D(t)})),U("d",0,"do","day"),U("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),U("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),U("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),ut("d",K),ut("e",K),ut("E",K),ut("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ut("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ut("dddd",(function(t,e){return e.weekdaysRegex(t)})),pt(["dd","ddd","dddd"],(function(t,e,i,n){var s=i._locale.weekdaysParse(t,n,i._strict);null!=s?e.d=s:m(i).invalidWeekday=t})),pt(["d","e","E"],(function(t,e,i,n){e[n]=D(t)}));var $t="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Jt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Kt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qt(t,e,i){var n,s,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(s=Ot.call(this._weekdaysParse,o))?s:null:"ddd"===e?-1!==(s=Ot.call(this._shortWeekdaysParse,o))?s:null:-1!==(s=Ot.call(this._minWeekdaysParse,o))?s:null:"dddd"===e?-1!==(s=Ot.call(this._weekdaysParse,o))?s:-1!==(s=Ot.call(this._shortWeekdaysParse,o))?s:-1!==(s=Ot.call(this._minWeekdaysParse,o))?s:null:"ddd"===e?-1!==(s=Ot.call(this._shortWeekdaysParse,o))?s:-1!==(s=Ot.call(this._weekdaysParse,o))?s:-1!==(s=Ot.call(this._minWeekdaysParse,o))?s:null:-1!==(s=Ot.call(this._minWeekdaysParse,o))?s:-1!==(s=Ot.call(this._weekdaysParse,o))?s:-1!==(s=Ot.call(this._shortWeekdaysParse,o))?s:null}var te=lt,ee=lt,ie=lt;function ne(){function t(t,e){return e.length-t.length}var e,i,n,s,r,o=[],a=[],l=[],h=[];for(e=0;e<7;e++)i=f([2e3,1]).day(e),n=this.weekdaysMin(i,""),s=this.weekdaysShort(i,""),r=this.weekdays(i,""),o.push(n),a.push(s),l.push(r),h.push(n),h.push(s),h.push(r);for(o.sort(t),a.sort(t),l.sort(t),h.sort(t),e=0;e<7;e++)a[e]=ct(a[e]),l[e]=ct(l[e]),h[e]=ct(h[e]);this._weekdaysRegex=new RegExp("^("+h.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 se(){return this.hours()%12||12}function re(t,e){U(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function oe(t,e){return e._meridiemParse}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,se),U("k",["kk",2],0,(function(){return this.hours()||24})),U("hmm",0,0,(function(){return""+se.apply(this)+F(this.minutes(),2)})),U("hmmss",0,0,(function(){return""+se.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)})),U("Hmm",0,0,(function(){return""+this.hours()+F(this.minutes(),2)})),U("Hmmss",0,0,(function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)})),re("a",!0),re("A",!1),I("hour","h"),j("hour",13),ut("a",oe),ut("A",oe),ut("H",K),ut("h",K),ut("k",K),ut("HH",K,q),ut("hh",K,q),ut("kk",K,q),ut("hmm",Q),ut("hmmss",tt),ut("Hmm",Q),ut("Hmmss",tt),mt(["H","HH"],bt),mt(["k","kk"],(function(t,e,i){var n=D(t);e[bt]=24===n?0:n})),mt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),mt(["h","hh"],(function(t,e,i){e[bt]=D(t),m(i).bigHour=!0})),mt("hmm",(function(t,e,i){var n=t.length-2;e[bt]=D(t.substr(0,n)),e[wt]=D(t.substr(n)),m(i).bigHour=!0})),mt("hmmss",(function(t,e,i){var n=t.length-4,s=t.length-2;e[bt]=D(t.substr(0,n)),e[wt]=D(t.substr(n,2)),e[kt]=D(t.substr(s)),m(i).bigHour=!0})),mt("Hmm",(function(t,e,i){var n=t.length-2;e[bt]=D(t.substr(0,n)),e[wt]=D(t.substr(n))})),mt("Hmmss",(function(t,e,i){var n=t.length-4,s=t.length-2;e[bt]=D(t.substr(0,n)),e[wt]=D(t.substr(n,2)),e[kt]=D(t.substr(s))}));var ae,le=Yt("Hours",!0),he={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:At,monthsShort:Nt,week:{dow:0,doy:6},weekdays:$t,weekdaysMin:Kt,weekdaysShort:Jt,meridiemParse:/[ap]\.?m?\.?/i},ue={},de={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(e){var i=null;if(!ue[e]&&t&&t.exports)try{i=ae._abbr,o(),me(i)}catch(t){}return ue[e]}function me(t,e){var i;return t&&((i=a(e)?ge(t):pe(t,e))?ae=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ae._abbr}function pe(t,e){if(null!==e){var i,n=he;if(e.abbr=t,null!=ue[t])C("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ue[t]._config;else if(null!=e.parentLocale)if(null!=ue[e.parentLocale])n=ue[e.parentLocale]._config;else{if(null==(i=fe(e.parentLocale)))return de[e.parentLocale]||(de[e.parentLocale]=[]),de[e.parentLocale].push({name:t,config:e}),null;n=i._config}return ue[t]=new E(P(n,e)),de[t]&&de[t].forEach((function(t){pe(t.name,t.config)})),me(t),ue[t]}return delete ue[t],null}function ge(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ae;if(!s(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,i,n,s,r=0;r0;){if(n=fe(s.slice(0,e).join("-")))return n;if(i&&i.length>=e&&S(s,i,!0)>=e-1)break;e--}r++}return ae}(t)}function ve(t){var e,i=t._a;return i&&-2===m(t).overflow&&(e=i[yt]<0||i[yt]>11?yt:i[_t]<1||i[_t]>Lt(i[vt],i[yt])?_t:i[bt]<0||i[bt]>24||24===i[bt]&&(0!==i[wt]||0!==i[kt]||0!==i[Dt])?bt:i[wt]<0||i[wt]>59?wt:i[kt]<0||i[kt]>59?kt:i[Dt]<0||i[Dt]>999?Dt:-1,m(t)._overflowDayOfYear&&(e_t)&&(e=_t),m(t)._overflowWeeks&&-1===e&&(e=St),m(t)._overflowWeekday&&-1===e&&(e=xt),m(t).overflow=e),t}function ye(t,e,i){return null!=t?t:null!=e?e:i}function _e(t){var e,i,s,r,o,a=[];if(!t._d){for(s=function(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[_t]&&null==t._a[yt]&&function(t){var e,i,n,s,r,o,a,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,i=ye(e.GG,t._a[vt],Xt(Ie(),1,4).year),n=ye(e.W,1),((s=ye(e.E,1))<1||s>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var h=Xt(Ie(),r,o);i=ye(e.gg,t._a[vt],h.year),n=ye(e.w,h.week),null!=e.d?((s=e.d)<0||s>6)&&(l=!0):null!=e.e?(s=e.e+r,(e.e<0||e.e>6)&&(l=!0)):s=r}n<1||n>qt(i,r,o)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(a=Bt(i,n,s,r,o),t._a[vt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(o=ye(t._a[vt],s[vt]),(t._dayOfYear>Mt(o)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),i=Ut(o,0,t._dayOfYear),t._a[yt]=i.getUTCMonth(),t._a[_t]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=s[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[bt]&&0===t._a[wt]&&0===t._a[kt]&&0===t._a[Dt]&&(t._nextDay=!0,t._a[bt]=0),t._d=(t._useUTC?Ut:zt).apply(null,a),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[bt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(m(t).weekdayMismatch=!0)}}var be=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,we=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ke=/Z|[+-]\d\d(?::?\d\d)?/,De=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Se=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],xe=/^\/?Date\((\-?\d+)/i;function Me(t){var e,i,n,s,r,o,a=t._i,l=be.exec(a)||we.exec(a);if(l){for(m(t).iso=!0,e=0,i=De.length;e0&&m(t).unusedInput.push(o),a=a.slice(a.indexOf(i)+i.length),h+=i.length),z[r]?(i?m(t).empty=!1:m(t).unusedTokens.push(r),gt(r,i,t)):t._strict&&!i&&m(t).unusedTokens.push(r);m(t).charsLeftOver=l-h,a.length>0&&m(t).unusedInput.push(a),t._a[bt]<=12&&!0===m(t).bigHour&&t._a[bt]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[bt]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[bt],t._meridiem),_e(t),ve(t)}else Ye(t);else Me(t)}function Ee(t){var e=t._i,i=t._f;return t._locale=t._locale||ge(t._l),null===e||void 0===i&&""===e?g({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),w(e)?new b(ve(e)):(h(e)?t._d=e:s(i)?function(t){var e,i,n,s,r;if(0===t._f.length)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(s=0;sthis?this:t:g()}));function Re(t,e){var i,n;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return Ie();for(i=e[0],n=1;n=0?new Date(t+400,e,i)-ui:new Date(t,e,i).valueOf()}function fi(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-ui:Date.UTC(t,e,i)}function mi(t,e){U(0,[t,t.length],0,e)}function pi(t,e,i,n,s){var r;return null==t?Xt(this,n,s).year:(e>(r=qt(t,n,s))&&(e=r),gi.call(this,t,e,i,n,s))}function gi(t,e,i,n,s){var r=Bt(t,e,i,n,s),o=Ut(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}U(0,["gg",2],0,(function(){return this.weekYear()%100})),U(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),mi("gggg","weekYear"),mi("ggggg","weekYear"),mi("GGGG","isoWeekYear"),mi("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),j("weekYear",1),j("isoWeekYear",1),ut("G",rt),ut("g",rt),ut("GG",K,q),ut("gg",K,q),ut("GGGG",it,$),ut("gggg",it,$),ut("GGGGG",nt,J),ut("ggggg",nt,J),pt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=D(t)})),pt(["gg","GG"],(function(t,e,i,s){e[s]=n.parseTwoDigitYear(t)})),U("Q",0,"Qo","quarter"),I("quarter","Q"),j("quarter",7),ut("Q",X),mt("Q",(function(t,e){e[yt]=3*(D(t)-1)})),U("D",["DD",2],"Do","date"),I("date","D"),j("date",9),ut("D",K),ut("DD",K,q),ut("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),mt(["D","DD"],_t),mt("Do",(function(t,e){e[_t]=D(t.match(K)[0])}));var vi=Yt("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),j("dayOfYear",4),ut("DDD",et),ut("DDDD",Z),mt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=D(t)})),U("m",["mm",2],0,"minute"),I("minute","m"),j("minute",14),ut("m",K),ut("mm",K,q),mt(["m","mm"],wt);var yi=Yt("Minutes",!1);U("s",["ss",2],0,"second"),I("second","s"),j("second",15),ut("s",K),ut("ss",K,q),mt(["s","ss"],kt);var _i,bi=Yt("Seconds",!1);for(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()})),I("millisecond","ms"),j("millisecond",16),ut("S",et,X),ut("SS",et,q),ut("SSS",et,Z),_i="SSSS";_i.length<=9;_i+="S")ut(_i,st);function wi(t,e){e[Dt]=D(1e3*("0."+t))}for(_i="S";_i.length<=9;_i+="S")mt(_i,wi);var ki=Yt("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Di=b.prototype;function Si(t){return t}Di.add=ei,Di.calendar=function(t,e){var i=t||Ie(),s=Ve(i,this).startOf("day"),r=n.calendarFormat(this,s)||"sameElse",o=e&&(Y(e[r])?e[r].call(this,i):e[r]);return this.format(o||this.localeData().calendar(r,this,Ie(i)))},Di.clone=function(){return new b(this)},Di.diff=function(t,e,i){var n,s,r;if(!this.isValid())return NaN;if(!(n=Ve(t,this)).isValid())return NaN;switch(s=6e4*(n.utcOffset()-this.utcOffset()),e=A(e)){case"year":r=ni(this,n)/12;break;case"month":r=ni(this,n);break;case"quarter":r=ni(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-s)/864e5;break;case"week":r=(this-n-s)/6048e5;break;default:r=this-n}return i?r:k(r)},Di.endOf=function(t){var e;if(void 0===(t=A(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?fi:ci;switch(t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=hi-di(e+(this._isUTC?0:this.utcOffset()*li),hi)-1;break;case"minute":e=this._d.valueOf(),e+=li-di(e,li)-1;break;case"second":e=this._d.valueOf(),e+=ai-di(e,ai)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},Di.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)},Di.from=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Ie(t).isValid())?$e({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Di.fromNow=function(t){return this.from(Ie(),t)},Di.to=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Ie(t).isValid())?$e({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Di.toNow=function(t){return this.to(Ie(),t)},Di.get=function(t){return Y(this[t=A(t)])?this[t]():this},Di.invalidAt=function(){return m(this).overflow},Di.isAfter=function(t,e){var i=w(t)?t:Ie(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=A(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()9999?V(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Y(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(i,"Z")):V(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Di.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+s)},Di.toJSON=function(){return this.isValid()?this.toISOString():null},Di.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Di.unix=function(){return Math.floor(this.valueOf()/1e3)},Di.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Di.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Di.year=Ct,Di.isLeapYear=function(){return Tt(this.year())},Di.weekYear=function(t){return pi.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Di.isoWeekYear=function(t){return pi.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Di.quarter=Di.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Di.month=Ft,Di.daysInMonth=function(){return Lt(this.year(),this.month())},Di.week=Di.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Di.isoWeek=Di.isoWeeks=function(t){var e=Xt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Di.weeksInYear=function(){var t=this.localeData()._week;return qt(this.year(),t.dow,t.doy)},Di.isoWeeksInYear=function(){return qt(this.year(),1,4)},Di.date=vi,Di.day=Di.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},Di.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Di.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Di.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Di.hour=Di.hours=le,Di.minute=Di.minutes=yi,Di.second=Di.seconds=bi,Di.millisecond=Di.milliseconds=ki,Di.utcOffset=function(t,e,i){var s,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ue(at,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(s=Be(this)),this._offset=t,this._isUTC=!0,null!=s&&this.add(s,"m"),r!==t&&(!e||this._changeInProgress?ti(this,$e(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Be(this)},Di.utc=function(t){return this.utcOffset(0,t)},Di.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Be(this),"m")),this},Di.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ue(ot,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Di.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ie(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Di.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Di.isLocal=function(){return!!this.isValid()&&!this._isUTC},Di.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Di.isUtc=Xe,Di.isUTC=Xe,Di.zoneAbbr=function(){return this._isUTC?"UTC":""},Di.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Di.dates=M("dates accessor is deprecated. Use date instead.",vi),Di.months=M("months accessor is deprecated. Use month instead",Ft),Di.years=M("years accessor is deprecated. Use year instead",Ct),Di.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),Di.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=Ee(t))._a){var e=t._isUTC?f(t._a):Ie(t._a);this._isDSTShifted=this.isValid()&&S(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var xi=E.prototype;function Mi(t,e,i,n){var s=ge(),r=f().set(n,e);return s[i](r,t)}function Ti(t,e,i){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return Mi(t,e,i,"month");var n,s=[];for(n=0;n<12;n++)s[n]=Mi(t,n,i,"month");return s}function Oi(t,e,i,n){"boolean"==typeof t?(l(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,l(e)&&(i=e,e=void 0),e=e||"");var s,r=ge(),o=t?r._week.dow:0;if(null!=i)return Mi(e,(i+o)%7,n,"day");var a=[];for(s=0;s<7;s++)a[s]=Mi(e,(s+o)%7,n,"day");return a}xi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return Y(n)?n.call(e,i):n},xi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},xi.invalidDate=function(){return this._invalidDate},xi.ordinal=function(t){return this._ordinal.replace("%d",t)},xi.preparse=Si,xi.postformat=Si,xi.relativeTime=function(t,e,i,n){var s=this._relativeTime[i];return Y(s)?s(t,e,i,n):s.replace(/%d/i,t)},xi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return Y(i)?i(e):i.replace(/%s/i,e)},xi.set=function(t){var e,i;for(i in t)Y(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},xi.months=function(t,e){return t?s(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||It).test(e)?"format":"standalone"][t.month()]:s(this._months)?this._months:this._months.standalone},xi.monthsShort=function(t,e){return t?s(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[It.test(e)?"format":"standalone"][t.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},xi.monthsParse=function(t,e,i){var n,s,r;if(this._monthsParseExact)return Rt.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(s=f([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},xi.monthsRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Wt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Gt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},xi.monthsShortRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Wt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Ht),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},xi.week=function(t){return Xt(t,this._week.dow,this._week.doy).week},xi.firstDayOfYear=function(){return this._week.doy},xi.firstDayOfWeek=function(){return this._week.dow},xi.weekdays=function(t,e){var i=s(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Zt(i,this._week.dow):t?i[t.day()]:i},xi.weekdaysMin=function(t){return!0===t?Zt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},xi.weekdaysShort=function(t){return!0===t?Zt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},xi.weekdaysParse=function(t,e,i){var n,s,r;if(this._weekdaysParseExact)return Qt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=f([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},xi.weekdaysRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},xi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},xi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ie),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},xi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},xi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},me("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===D(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=M("moment.lang is deprecated. Use moment.locale instead.",me),n.langData=M("moment.langData is deprecated. Use moment.localeData instead.",ge);var Ci=Math.abs;function Yi(t,e,i,n){var s=$e(e,i);return t._milliseconds+=n*s._milliseconds,t._days+=n*s._days,t._months+=n*s._months,t._bubble()}function Pi(t){return t<0?Math.floor(t):Math.ceil(t)}function Ei(t){return 4800*t/146097}function Li(t){return 146097*t/4800}function Ii(t){return function(){return this.as(t)}}var Ai=Ii("ms"),Ni=Ii("s"),Ri=Ii("m"),ji=Ii("h"),Fi=Ii("d"),Hi=Ii("w"),Gi=Ii("M"),Wi=Ii("Q"),zi=Ii("y");function Ui(t){return function(){return this.isValid()?this._data[t]:NaN}}var Vi=Ui("milliseconds"),Bi=Ui("seconds"),Xi=Ui("minutes"),qi=Ui("hours"),Zi=Ui("days"),$i=Ui("months"),Ji=Ui("years"),Ki=Math.round,Qi={ss:44,s:45,m:45,h:22,d:26,M:11};function tn(t,e,i,n,s){return s.relativeTime(e||1,!!i,t,n)}var en=Math.abs;function nn(t){return(t>0)-(t<0)||+t}function sn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=en(this._milliseconds)/1e3,n=en(this._days),s=en(this._months);t=k(i/60),e=k(t/60),i%=60,t%=60;var r=k(s/12),o=s%=12,a=n,l=e,h=t,u=i?i.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var c=d<0?"-":"",f=nn(this._months)!==nn(d)?"-":"",m=nn(this._days)!==nn(d)?"-":"",p=nn(this._milliseconds)!==nn(d)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(a?m+a+"D":"")+(l||h||u?"T":"")+(l?p+l+"H":"")+(h?p+h+"M":"")+(u?p+u+"S":"")}var rn=Fe.prototype;return rn.isValid=function(){return this._isValid},rn.abs=function(){var t=this._data;return this._milliseconds=Ci(this._milliseconds),this._days=Ci(this._days),this._months=Ci(this._months),t.milliseconds=Ci(t.milliseconds),t.seconds=Ci(t.seconds),t.minutes=Ci(t.minutes),t.hours=Ci(t.hours),t.months=Ci(t.months),t.years=Ci(t.years),this},rn.add=function(t,e){return Yi(this,t,e,1)},rn.subtract=function(t,e){return Yi(this,t,e,-1)},rn.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=A(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Ei(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Li(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},rn.asMilliseconds=Ai,rn.asSeconds=Ni,rn.asMinutes=Ri,rn.asHours=ji,rn.asDays=Fi,rn.asWeeks=Hi,rn.asMonths=Gi,rn.asQuarters=Wi,rn.asYears=zi,rn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN},rn._bubble=function(){var t,e,i,n,s,r=this._milliseconds,o=this._days,a=this._months,l=this._data;return r>=0&&o>=0&&a>=0||r<=0&&o<=0&&a<=0||(r+=864e5*Pi(Li(a)+o),o=0,a=0),l.milliseconds=r%1e3,t=k(r/1e3),l.seconds=t%60,e=k(t/60),l.minutes=e%60,i=k(e/60),l.hours=i%24,o+=k(i/24),s=k(Ei(o)),a+=s,o-=Pi(Li(s)),n=k(a/12),a%=12,l.days=o,l.months=a,l.years=n,this},rn.clone=function(){return $e(this)},rn.get=function(t){return t=A(t),this.isValid()?this[t+"s"]():NaN},rn.milliseconds=Vi,rn.seconds=Bi,rn.minutes=Xi,rn.hours=qi,rn.days=Zi,rn.weeks=function(){return k(this.days()/7)},rn.months=$i,rn.years=Ji,rn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=function(t,e,i){var n=$e(t).abs(),s=Ki(n.as("s")),r=Ki(n.as("m")),o=Ki(n.as("h")),a=Ki(n.as("d")),l=Ki(n.as("M")),h=Ki(n.as("y")),u=s<=Qi.ss&&["s",s]||s0,u[4]=i,tn.apply(null,u)}(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},rn.toISOString=sn,rn.toString=sn,rn.toJSON=sn,rn.locale=si,rn.localeData=oi,rn.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",sn),rn.lang=ri,U("X",0,0,"unix"),U("x",0,0,"valueOf"),ut("x",rt),ut("X",/[+-]?\d+(\.\d{1,3})?/),mt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),mt("x",(function(t,e,i){i._d=new Date(D(t))})),n.version="2.24.0",e=Ie,n.fn=Di,n.min=function(){return Re("isBefore",[].slice.call(arguments,0))},n.max=function(){return Re("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=f,n.unix=function(t){return Ie(1e3*t)},n.months=function(t,e){return Ti(t,e,"months")},n.isDate=h,n.locale=me,n.invalid=g,n.duration=$e,n.isMoment=w,n.weekdays=function(t,e,i){return Oi(t,e,i,"weekdays")},n.parseZone=function(){return Ie.apply(null,arguments).parseZone()},n.localeData=ge,n.isDuration=He,n.monthsShort=function(t,e){return Ti(t,e,"monthsShort")},n.weekdaysMin=function(t,e,i){return Oi(t,e,i,"weekdaysMin")},n.defineLocale=pe,n.updateLocale=function(t,e){if(null!=e){var i,n,s=he;null!=(n=fe(t))&&(s=n._config),e=P(s,e),(i=new E(e)).parentLocale=ue[t],ue[t]=i,me(t)}else null!=ue[t]&&(null!=ue[t].parentLocale?ue[t]=ue[t].parentLocale:null!=ue[t]&&delete ue[t]);return ue[t]},n.locales=function(){return T(ue)},n.weekdaysShort=function(t,e,i){return Oi(t,e,i,"weekdaysShort")},n.normalizeUnits=A,n.relativeTimeRounding=function(t){return void 0===t?Ki:"function"==typeof t&&(Ki=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Qi[t]&&(void 0===e?Qi[t]:(Qi[t]=e,"s"===t&&(Qi.ss=e-1),!0))},n.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},n.prototype=Di,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()})),u=[],d=0;d<256;d++)u[d]=(d+256).toString(16).substr(1);for(var c=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var t=new Uint8Array(16);return function(){return crypto.getRandomValues(t),t}}var e=new Array(16);return function(){for(var t,i=0;i<16;i++)0==(3&i)&&(t=4294967296*Math.random()),e[i]=t>>>((3&i)<<3)&255;return e}}(),f=[],m=0;m<256;m++)f[m]=(m+256).toString(16).substr(1);var p=c();p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7];function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=e&&i||0;"string"==typeof t&&(e="binary"===t?new Array(16):void 0,t={});var s=t.random||(t.rng||c)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var r=0;r<16;r++)e[n+r]=s[r];return e||function(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++]]}(s)}function v(t,e){var i=Object.keys(t);return Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t)),e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i}var y=/^\/?Date\((-?\d+)/i,_=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,b=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;function w(t){return t instanceof Number||"number"==typeof t}function k(t){if(t)for(;!0===t.hasChildNodes();){var e=t.firstChild;e&&(k(e),t.removeChild(e))}}function D(t){return t instanceof String||"string"==typeof t}function S(t){return"object"===l(t)&&null!==t}function x(t){if(t instanceof Date)return!0;if(D(t)){if(y.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1}function M(t){return h.isMoment(t)}function T(t,e,i,n){var s=!1;!0===n&&(s=null===e[i]&&void 0!==t[i]),s?delete t[i]:t[i]=e[i]}function O(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var n in t)if(void 0!==e[n])if(null===e[n]||"object"!==l(e[n]))T(t,e,n,i);else{var s=t[n],r=e[n];S(s)&&S(r)&&O(s,r,i)}}var C=Object.assign;function Y(t,e){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var s=0;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&-1===t.indexOf(s))if(i[s]&&i[s].constructor===Object)void 0===e[s]&&(e[s]={}),e[s].constructor===Object?L(e[s],i[s]):T(e,i,s,n);else if(Array.isArray(i[s])){e[s]=[];for(var r=0;r2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)||!0===i)if(e[s]&&e[s].constructor===Object)void 0===t[s]&&(t[s]={}),t[s].constructor===Object?L(t[s],e[s],i):T(t,e,s,n);else if(Array.isArray(e[s])){t[s]=[];for(var r=0;r=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)}function Z(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)}function $(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}function J(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,e=null;return t&&(t.target?e=t.target:t.srcElement&&(e=t.srcElement)),e instanceof Element&&(null==e.nodeType||3!=e.nodeType||(e=e.parentNode)instanceof Element)?e:null}function K(t,e){for(var i=t;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1}var Q={asBoolean:function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},asNumber:function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},asString:function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},asSize:function(t,e){return"function"==typeof t&&(t=t()),D(t)?t:w(t)?t+"px":e||null},asElement:function(t,e){return"function"==typeof t&&(t=t()),t||e||null}};function tt(t){var e;switch(t.length){case 3:case 4:return(e=b.exec(t))?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return(e=_.exec(t))?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function et(t,e){if(-1!==t.indexOf("rgba"))return t;if(-1!==t.indexOf("rgb")){var i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}var n=tt(t);return null==n?t:"rgba("+n.r+","+n.g+","+n.b+","+e+")"}function it(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function nt(t,e){if(D(t)){var i=t;if(ct(i)){var n=i.substr(4).substr(0,i.length-5).split(",").map((function(t){return parseInt(t)}));i=it(n[0],n[1],n[2])}if(!0===dt(i)){var s=ut(i),r={h:s.h,s:.8*s.s,v:Math.min(1,1.02*s.v)},o={h:s.h,s:Math.min(1,1.25*s.s),v:.8*s.v},a=ht(o.h,o.s,o.v),l=ht(r.h,r.s,r.v);return{background:i,border:a,highlight:{background:l,border:a},hover:{background:l,border:a}}}return{background:i,border:i,highlight:{background:i,border:i},hover:{background:i,border:i}}}return e?{background:t.background||e.background,border:t.border||e.border,highlight:D(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||e.highlight.background,border:t.highlight&&t.highlight.border||e.highlight.border},hover:D(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||e.hover.border,background:t.hover&&t.hover.background||e.hover.background}}:{background:t.background||void 0,border:t.border||void 0,highlight:D(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:D(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}}function st(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,Math.min(e,i)),s=Math.max(t,Math.max(e,i));return n===s?{h:0,s:0,v:n}:{h:60*((t===n?3:i===n?1:5)-(t===n?e-i:i===n?t-e:i-t)/(s-n))/360,s:(s-n)/s,v:s}}var rt={split:function(t){var e={};return t.split(";").forEach((function(t){if(""!=t.trim()){var i=t.split(":"),n=i[0].trim(),s=i[1].trim();e[n]=s}})),e},join:function(t){return Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")}};function ot(t,i){var n=function(t){for(var i=1;i0&&e(n,t[s-1])<0;s--)t[s]=t[s-1];t[s]=n}return t}function vt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=function(t){return null!=t},r=function(t){return null!==t&&"object"===l(t)};if(!r(t))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!s(i))throw new Error("Parameter option must have a value");if(!r(n))throw new Error("Parameter globalOptions must be an object");var o=e[i],a=r(n)&&!function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[i]:void 0,h=a?a.enabled:void 0;if(void 0!==o){if("boolean"==typeof o)return r(t[i])||(t[i]={}),void(t[i].enabled=o);if(null===o&&!r(t[i])){if(!s(a))return;t[i]=Object.create(a)}if(r(o)){var u=!0;void 0!==o.enabled?u=o.enabled:void 0!==h&&(u=a.enabled),function(t,e,i){r(t[i])||(t[i]={});var n=e[i],s=t[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(s[o]=n[o])}(t,e,i),t[i].enabled=u}}}function yt(t,e,i,n){for(var s=0,r=0,o=t.length-1;r<=o&&s<1e4;){var a=Math.floor((r+o)/2),l=t[a],h=e(void 0===n?l[i]:l[i][n]);if(0==h)return a;-1==h?r=a+1:o=a-1,s++}return-1}function _t(t,e,i,n,s){var r,o,a,l,h=0,u=0,d=t.length-1;for(s=null!=s?s:function(t,e){return t==e?0:t0)return"before"==n?Math.max(0,l-1):l;if(s(o,e)<0&&s(a,e)>0)return"before"==n?l:Math.min(t.length-1,l+1);s(o,e)<0?u=l+1:d=l-1,h++}return-1}var bt={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}};function wt(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),i-n}function kt(t,e){var i;Array.isArray(e)||(e=[e]);var n=!0,s=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;if(l){i=l[e[0]];for(var h=1;h0?(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}function Ct(t,e,i,n){var s;return e.hasOwnProperty(t)?e[t].redundant.length>0?(s=e[t].redundant[0],e[t].redundant.shift()):(s=document.createElement(t),void 0!==n?i.insertBefore(s,n):i.appendChild(s)):(s=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(s,n):i.appendChild(s)),e[t].used.push(s),s}function Yt(t,e,i,n,s,r){var o;if("circle"==i.style?((o=Ot("circle",n,s)).setAttributeNS(null,"cx",t),o.setAttributeNS(null,"cy",e),o.setAttributeNS(null,"r",.5*i.size)):((o=Ot("rect",n,s)).setAttributeNS(null,"x",t-.5*i.size),o.setAttributeNS(null,"y",e-.5*i.size),o.setAttributeNS(null,"width",i.size),o.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&o.setAttributeNS(null,"style",i.styles),o.setAttributeNS(null,"class",i.className+" vis-point"),r){var a=Ot("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(e+=r.yOffset),r.content&&(a.textContent=r.content),r.className&&a.setAttributeNS(null,"class",r.className+" vis-label"),a.setAttributeNS(null,"x",t),a.setAttributeNS(null,"y",e)}return o}function Pt(t,e,i,n,s,r,o,a){if(0!=n){n<0&&(e-=n*=-1);var l=Ot("rect",r,o);l.setAttributeNS(null,"x",t-.5*i),l.setAttributeNS(null,"y",e),l.setAttributeNS(null,"width",i),l.setAttributeNS(null,"height",n),l.setAttributeNS(null,"class",s),a&&l.setAttributeNS(null,"style",a)}}function Et(){return navigator?navigator.languages&&navigator.languages.length?navigator.languages:navigator.userLanguage||navigator.language||navigator.browserLanguage||"en":"en"}var Lt=Object.freeze({prepareElements:xt,cleanupElements:Mt,resetElements:Tt,getSVGElement:Ot,getDOMElement:Ct,drawPoint:Yt,drawBar:Pt,getNavigatorLanguage:Et}); +/** + * vis-data - data + * http://visjs.org/ + * + * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data. + * + * @version 6.1.0 + * @date 2019-07-16T13:37:00Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */var It=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t};function At(t,e){return t(e={exports:{}},e.exports),e.exports}var Nt=At((function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(n){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=i=function(t){return e(t)}:t.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},i(n)}t.exports=i}));var Rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function jt(t,e){for(var i=0;i>>((3&i)<<3)&255;return e}}(),qt=[],Zt=0;Zt<256;Zt++)qt[Zt]=(Zt+256).toString(16).substr(1);var $t=Xt();$t[0],$t[1],$t[2],$t[3],$t[4],$t[5],$t[6],$t[7];function Jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=e&&i||0;"string"==typeof t&&(e="binary"===t?new Array(16):void 0,t={});var s=t.random||(t.rng||Xt)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var r=0;r<16;r++)e[n+r]=s[r];return e||function(t,e){var i=e||0,n=Vt;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++]]}(s)}function Kt(t){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Qt(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}for(var te=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports=function(){var e,i;function n(){return e.apply(null,arguments)}function s(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return void 0===t}function a(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var i,n=[];for(i=0;i>>0,n=0;n0)for(i=0;i=0?i?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var F=/(\[[^\[]*\])|(\\)?([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,H=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,G={},W={};function z(t,e,i,n){var s=n;"string"==typeof n&&(s=function(){return this[n]()}),t&&(W[t]=s),e&&(W[e[0]]=function(){return j(s.apply(this,arguments),e[1],e[2])}),i&&(W[i]=function(){return this.localeData().ordinal(s.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=V(e,t.localeData()),G[e]=G[e]||function(t){var e,i,n,s=t.match(F);for(e=0,i=s.length;e=0&&H.test(t);)t=t.replace(H,n),H.lastIndex=0,i-=1;return t}var B=/\d/,X=/\d\d/,q=/\d{3}/,Z=/\d{4}/,$=/[+-]?\d{6}/,J=/\d\d?/,K=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,tt=/\d{1,3}/,et=/\d{1,4}/,it=/[+-]?\d{1,6}/,nt=/\d+/,st=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,ot=/Z|[+-]\d\d(?::?\d\d)?/gi,at=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lt={};function ht(t,e,i){lt[t]=C(e)?e:function(t,n){return t&&i?i:e}}function ut(t,e){return u(lt,t)?lt[t](e._strict,e._locale):new RegExp(dt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,s){return e||i||n||s}))))}function dt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ct={};function ft(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),a(e)&&(n=function(t,i){i[e]=k(t)}),i=0;i68?1900:2e3)};var Tt,Ot=Ct("FullYear",!0);function Ct(t,e){return function(i){return null!=i?(Pt(this,t,i),n.updateOffset(this,e),this):Yt(this,t)}}function Yt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Pt(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Mt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Et(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function Et(t,e){if(isNaN(t)||isNaN(e))return NaN;var i,n=(e%(i=12)+i)%i;return t+=(e-n)/12,1===n?Mt(t)?29:28:31-n%7%2}Tt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(a=new Date(t+400,e,i,n,s,r,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,s,r,o),a}function zt(t){var e;if(t<100&&t>=0){var i=Array.prototype.slice.call(arguments);i[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ut(t,e,i){var n=7+e-i;return-(7+zt(t,0,n).getUTCDay()-e)%7+n-1}function Vt(t,e,i,n,s){var r,o,a=1+7*(e-1)+(7+i-n)%7+Ut(t,n,s);return a<=0?o=xt(r=t-1)+a:a>xt(t)?(r=t+1,o=a-xt(t)):(r=t,o=a),{year:r,dayOfYear:o}}function Bt(t,e,i){var n,s,r=Ut(t.year(),e,i),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?n=o+Xt(s=t.year()-1,e,i):o>Xt(t.year(),e,i)?(n=o-Xt(t.year(),e,i),s=t.year()+1):(s=t.year(),n=o),{week:n,year:s}}function Xt(t,e,i){var n=Ut(t,e,i),s=Ut(t+1,e,i);return(xt(t)-n+s)/7}function qt(t,e){return t.slice(e,7).concat(t.slice(0,e))}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),R("week",5),R("isoWeek",5),ht("w",J),ht("ww",J,X),ht("W",J),ht("WW",J,X),mt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=k(t)})),z("d",0,"do","day"),z("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),z("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),z("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),R("day",11),R("weekday",11),R("isoWeekday",11),ht("d",J),ht("e",J),ht("E",J),ht("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ht("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ht("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,i,n){var s=i._locale.weekdaysParse(t,n,i._strict);null!=s?e.d=s:f(i).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,i,n){e[n]=k(t)}));var Zt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$t="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Jt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Kt(t,e,i){var n,s,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=c([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(s=Tt.call(this._weekdaysParse,o))?s:null:"ddd"===e?-1!==(s=Tt.call(this._shortWeekdaysParse,o))?s:null:-1!==(s=Tt.call(this._minWeekdaysParse,o))?s:null:"dddd"===e?-1!==(s=Tt.call(this._weekdaysParse,o))?s:-1!==(s=Tt.call(this._shortWeekdaysParse,o))?s:-1!==(s=Tt.call(this._minWeekdaysParse,o))?s:null:"ddd"===e?-1!==(s=Tt.call(this._shortWeekdaysParse,o))?s:-1!==(s=Tt.call(this._weekdaysParse,o))?s:-1!==(s=Tt.call(this._minWeekdaysParse,o))?s:null:-1!==(s=Tt.call(this._minWeekdaysParse,o))?s:-1!==(s=Tt.call(this._weekdaysParse,o))?s:-1!==(s=Tt.call(this._shortWeekdaysParse,o))?s:null}var te=at,ee=at,ie=at;function ne(){function t(t,e){return e.length-t.length}var e,i,n,s,r,o=[],a=[],l=[],h=[];for(e=0;e<7;e++)i=c([2e3,1]).day(e),n=this.weekdaysMin(i,""),s=this.weekdaysShort(i,""),r=this.weekdays(i,""),o.push(n),a.push(s),l.push(r),h.push(n),h.push(s),h.push(r);for(o.sort(t),a.sort(t),l.sort(t),h.sort(t),e=0;e<7;e++)a[e]=dt(a[e]),l[e]=dt(l[e]),h[e]=dt(h[e]);this._weekdaysRegex=new RegExp("^("+h.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 se(){return this.hours()%12||12}function re(t,e){z(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function oe(t,e){return e._meridiemParse}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,se),z("k",["kk",2],0,(function(){return this.hours()||24})),z("hmm",0,0,(function(){return""+se.apply(this)+j(this.minutes(),2)})),z("hmmss",0,0,(function(){return""+se.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)})),z("Hmm",0,0,(function(){return""+this.hours()+j(this.minutes(),2)})),z("Hmmss",0,0,(function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)})),re("a",!0),re("A",!1),L("hour","h"),R("hour",13),ht("a",oe),ht("A",oe),ht("H",J),ht("h",J),ht("k",J),ht("HH",J,X),ht("hh",J,X),ht("kk",J,X),ht("hmm",K),ht("hmmss",Q),ht("Hmm",K),ht("Hmmss",Q),ft(["H","HH"],_t),ft(["k","kk"],(function(t,e,i){var n=k(t);e[_t]=24===n?0:n})),ft(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),ft(["h","hh"],(function(t,e,i){e[_t]=k(t),f(i).bigHour=!0})),ft("hmm",(function(t,e,i){var n=t.length-2;e[_t]=k(t.substr(0,n)),e[bt]=k(t.substr(n)),f(i).bigHour=!0})),ft("hmmss",(function(t,e,i){var n=t.length-4,s=t.length-2;e[_t]=k(t.substr(0,n)),e[bt]=k(t.substr(n,2)),e[wt]=k(t.substr(s)),f(i).bigHour=!0})),ft("Hmm",(function(t,e,i){var n=t.length-2;e[_t]=k(t.substr(0,n)),e[bt]=k(t.substr(n))})),ft("Hmmss",(function(t,e,i){var n=t.length-4,s=t.length-2;e[_t]=k(t.substr(0,n)),e[bt]=k(t.substr(n,2)),e[wt]=k(t.substr(s))}));var ae,le=Ct("Hours",!0),he={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:It,monthsShort:At,week:{dow:0,doy:6},weekdays:Zt,weekdaysMin:Jt,weekdaysShort:$t,meridiemParse:/[ap]\.?m?\.?/i},ue={},de={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(e){var i=null;if(!ue[e]&&t&&t.exports)try{i=ae._abbr,Qt(),me(i)}catch(t){}return ue[e]}function me(t,e){var i;return t&&((i=o(e)?ge(t):pe(t,e))?ae=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ae._abbr}function pe(t,e){if(null!==e){var i,n=he;if(e.abbr=t,null!=ue[t])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ue[t]._config;else if(null!=e.parentLocale)if(null!=ue[e.parentLocale])n=ue[e.parentLocale]._config;else{if(null==(i=fe(e.parentLocale)))return de[e.parentLocale]||(de[e.parentLocale]=[]),de[e.parentLocale].push({name:t,config:e}),null;n=i._config}return ue[t]=new P(Y(n,e)),de[t]&&de[t].forEach((function(t){pe(t.name,t.config)})),me(t),ue[t]}return delete ue[t],null}function ge(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ae;if(!s(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,i,n,s,r=0;r0;){if(n=fe(s.slice(0,e).join("-")))return n;if(i&&i.length>=e&&D(s,i,!0)>=e-1)break;e--}r++}return ae}(t)}function ve(t){var e,i=t._a;return i&&-2===f(t).overflow&&(e=i[vt]<0||i[vt]>11?vt:i[yt]<1||i[yt]>Et(i[gt],i[vt])?yt:i[_t]<0||i[_t]>24||24===i[_t]&&(0!==i[bt]||0!==i[wt]||0!==i[kt])?_t:i[bt]<0||i[bt]>59?bt:i[wt]<0||i[wt]>59?wt:i[kt]<0||i[kt]>999?kt:-1,f(t)._overflowDayOfYear&&(eyt)&&(e=yt),f(t)._overflowWeeks&&-1===e&&(e=Dt),f(t)._overflowWeekday&&-1===e&&(e=St),f(t).overflow=e),t}function ye(t,e,i){return null!=t?t:null!=e?e:i}function _e(t){var e,i,s,r,o,a=[];if(!t._d){for(s=function(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[yt]&&null==t._a[vt]&&function(t){var e,i,n,s,r,o,a,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,i=ye(e.GG,t._a[gt],Bt(Ie(),1,4).year),n=ye(e.W,1),((s=ye(e.E,1))<1||s>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var h=Bt(Ie(),r,o);i=ye(e.gg,t._a[gt],h.year),n=ye(e.w,h.week),null!=e.d?((s=e.d)<0||s>6)&&(l=!0):null!=e.e?(s=e.e+r,(e.e<0||e.e>6)&&(l=!0)):s=r}n<1||n>Xt(i,r,o)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(a=Vt(i,n,s,r,o),t._a[gt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(o=ye(t._a[gt],s[gt]),(t._dayOfYear>xt(o)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=zt(o,0,t._dayOfYear),t._a[vt]=i.getUTCMonth(),t._a[yt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=s[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[_t]&&0===t._a[bt]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[_t]=0),t._d=(t._useUTC?zt:Wt).apply(null,a),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[_t]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(f(t).weekdayMismatch=!0)}}var be=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,we=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ke=/Z|[+-]\d\d(?::?\d\d)?/,De=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Se=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],xe=/^\/?Date\((\-?\d+)/i;function Me(t){var e,i,n,s,r,o,a=t._i,l=be.exec(a)||we.exec(a);if(l){for(f(t).iso=!0,e=0,i=De.length;e0&&f(t).unusedInput.push(o),a=a.slice(a.indexOf(i)+i.length),h+=i.length),W[r]?(i?f(t).empty=!1:f(t).unusedTokens.push(r),pt(r,i,t)):t._strict&&!i&&f(t).unusedTokens.push(r);f(t).charsLeftOver=l-h,a.length>0&&f(t).unusedInput.push(a),t._a[_t]<=12&&!0===f(t).bigHour&&t._a[_t]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[_t]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[_t],t._meridiem),_e(t),ve(t)}else Ye(t);else Me(t)}function Ee(t){var e=t._i,i=t._f;return t._locale=t._locale||ge(t._l),null===e||void 0===i&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),b(e)?new _(ve(e)):(l(e)?t._d=e:s(i)?function(t){var e,i,n,s,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(s=0;sthis?this:t:p()}));function Re(t,e){var i,n;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return Ie();for(i=e[0],n=1;n=0?new Date(t+400,e,i)-ui:new Date(t,e,i).valueOf()}function fi(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-ui:Date.UTC(t,e,i)}function mi(t,e){z(0,[t,t.length],0,e)}function pi(t,e,i,n,s){var r;return null==t?Bt(this,n,s).year:(e>(r=Xt(t,n,s))&&(e=r),gi.call(this,t,e,i,n,s))}function gi(t,e,i,n,s){var r=Vt(t,e,i,n,s),o=zt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}z(0,["gg",2],0,(function(){return this.weekYear()%100})),z(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),mi("gggg","weekYear"),mi("ggggg","weekYear"),mi("GGGG","isoWeekYear"),mi("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),R("weekYear",1),R("isoWeekYear",1),ht("G",st),ht("g",st),ht("GG",J,X),ht("gg",J,X),ht("GGGG",et,Z),ht("gggg",et,Z),ht("GGGGG",it,$),ht("ggggg",it,$),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,i,s){e[s]=n.parseTwoDigitYear(t)})),z("Q",0,"Qo","quarter"),L("quarter","Q"),R("quarter",7),ht("Q",B),ft("Q",(function(t,e){e[vt]=3*(k(t)-1)})),z("D",["DD",2],"Do","date"),L("date","D"),R("date",9),ht("D",J),ht("DD",J,X),ht("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),ft(["D","DD"],yt),ft("Do",(function(t,e){e[yt]=k(t.match(J)[0])}));var vi=Ct("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),R("dayOfYear",4),ht("DDD",tt),ht("DDDD",q),ft(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=k(t)})),z("m",["mm",2],0,"minute"),L("minute","m"),R("minute",14),ht("m",J),ht("mm",J,X),ft(["m","mm"],bt);var yi=Ct("Minutes",!1);z("s",["ss",2],0,"second"),L("second","s"),R("second",15),ht("s",J),ht("ss",J,X),ft(["s","ss"],wt);var _i,bi=Ct("Seconds",!1);for(z("S",0,0,(function(){return~~(this.millisecond()/100)})),z(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),z(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),z(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),z(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),z(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),z(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),R("millisecond",16),ht("S",tt,B),ht("SS",tt,X),ht("SSS",tt,q),_i="SSSS";_i.length<=9;_i+="S")ht(_i,nt);function wi(t,e){e[kt]=k(1e3*("0."+t))}for(_i="S";_i.length<=9;_i+="S")ft(_i,wi);var ki=Ct("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var Di=_.prototype;function Si(t){return t}Di.add=ei,Di.calendar=function(t,e){var i=t||Ie(),s=Ve(i,this).startOf("day"),r=n.calendarFormat(this,s)||"sameElse",o=e&&(C(e[r])?e[r].call(this,i):e[r]);return this.format(o||this.localeData().calendar(r,this,Ie(i)))},Di.clone=function(){return new _(this)},Di.diff=function(t,e,i){var n,s,r;if(!this.isValid())return NaN;if(!(n=Ve(t,this)).isValid())return NaN;switch(s=6e4*(n.utcOffset()-this.utcOffset()),e=I(e)){case"year":r=ni(this,n)/12;break;case"month":r=ni(this,n);break;case"quarter":r=ni(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-s)/864e5;break;case"week":r=(this-n-s)/6048e5;break;default:r=this-n}return i?r:w(r)},Di.endOf=function(t){var e;if(void 0===(t=I(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?fi:ci;switch(t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=hi-di(e+(this._isUTC?0:this.utcOffset()*li),hi)-1;break;case"minute":e=this._d.valueOf(),e+=li-di(e,li)-1;break;case"second":e=this._d.valueOf(),e+=ai-di(e,ai)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},Di.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},Di.from=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Ie(t).isValid())?$e({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Di.fromNow=function(t){return this.from(Ie(),t)},Di.to=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Ie(t).isValid())?$e({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Di.toNow=function(t){return this.to(Ie(),t)},Di.get=function(t){return C(this[t=I(t)])?this[t]():this},Di.invalidAt=function(){return f(this).overflow},Di.isAfter=function(t,e){var i=b(t)?t:Ie(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=I(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()9999?U(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(i,"Z")):U(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Di.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+s)},Di.toJSON=function(){return this.isValid()?this.toISOString():null},Di.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Di.unix=function(){return Math.floor(this.valueOf()/1e3)},Di.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Di.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Di.year=Ot,Di.isLeapYear=function(){return Mt(this.year())},Di.weekYear=function(t){return pi.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Di.isoWeekYear=function(t){return pi.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Di.quarter=Di.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Di.month=jt,Di.daysInMonth=function(){return Et(this.year(),this.month())},Di.week=Di.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Di.isoWeek=Di.isoWeeks=function(t){var e=Bt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Di.weeksInYear=function(){var t=this.localeData()._week;return Xt(this.year(),t.dow,t.doy)},Di.isoWeeksInYear=function(){return Xt(this.year(),1,4)},Di.date=vi,Di.day=Di.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},Di.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Di.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Di.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Di.hour=Di.hours=le,Di.minute=Di.minutes=yi,Di.second=Di.seconds=bi,Di.millisecond=Di.milliseconds=ki,Di.utcOffset=function(t,e,i){var s,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ue(ot,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(s=Be(this)),this._offset=t,this._isUTC=!0,null!=s&&this.add(s,"m"),r!==t&&(!e||this._changeInProgress?ti(this,$e(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Be(this)},Di.utc=function(t){return this.utcOffset(0,t)},Di.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Be(this),"m")),this},Di.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ue(rt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Di.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ie(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Di.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Di.isLocal=function(){return!!this.isValid()&&!this._isUTC},Di.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Di.isUtc=Xe,Di.isUTC=Xe,Di.zoneAbbr=function(){return this._isUTC?"UTC":""},Di.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Di.dates=x("dates accessor is deprecated. Use date instead.",vi),Di.months=x("months accessor is deprecated. Use month instead",jt),Di.years=x("years accessor is deprecated. Use year instead",Ot),Di.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),Di.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),(t=Ee(t))._a){var e=t._isUTC?c(t._a):Ie(t._a);this._isDSTShifted=this.isValid()&&D(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var xi=P.prototype;function Mi(t,e,i,n){var s=ge(),r=c().set(n,e);return s[i](r,t)}function Ti(t,e,i){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return Mi(t,e,i,"month");var n,s=[];for(n=0;n<12;n++)s[n]=Mi(t,n,i,"month");return s}function Oi(t,e,i,n){"boolean"==typeof t?(a(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,a(e)&&(i=e,e=void 0),e=e||"");var s,r=ge(),o=t?r._week.dow:0;if(null!=i)return Mi(e,(i+o)%7,n,"day");var l=[];for(s=0;s<7;s++)l[s]=Mi(e,(s+o)%7,n,"day");return l}xi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return C(n)?n.call(e,i):n},xi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},xi.invalidDate=function(){return this._invalidDate},xi.ordinal=function(t){return this._ordinal.replace("%d",t)},xi.preparse=Si,xi.postformat=Si,xi.relativeTime=function(t,e,i,n){var s=this._relativeTime[i];return C(s)?s(t,e,i,n):s.replace(/%d/i,t)},xi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return C(i)?i(e):i.replace(/%s/i,e)},xi.set=function(t){var e,i;for(i in t)C(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},xi.months=function(t,e){return t?s(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Lt).test(e)?"format":"standalone"][t.month()]:s(this._months)?this._months:this._months.standalone},xi.monthsShort=function(t,e){return t?s(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Lt.test(e)?"format":"standalone"][t.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},xi.monthsParse=function(t,e,i){var n,s,r;if(this._monthsParseExact)return Nt.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(s=c([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},xi.monthsRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Gt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=Ht),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},xi.monthsShortRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Gt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Ft),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},xi.week=function(t){return Bt(t,this._week.dow,this._week.doy).week},xi.firstDayOfYear=function(){return this._week.doy},xi.firstDayOfWeek=function(){return this._week.dow},xi.weekdays=function(t,e){var i=s(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?qt(i,this._week.dow):t?i[t.day()]:i},xi.weekdaysMin=function(t){return!0===t?qt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},xi.weekdaysShort=function(t){return!0===t?qt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},xi.weekdaysParse=function(t,e,i){var n,s,r;if(this._weekdaysParseExact)return Kt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=c([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},xi.weekdaysRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},xi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},xi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||ne.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ie),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},xi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},xi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},me("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=x("moment.lang is deprecated. Use moment.locale instead.",me),n.langData=x("moment.langData is deprecated. Use moment.localeData instead.",ge);var Ci=Math.abs;function Yi(t,e,i,n){var s=$e(e,i);return t._milliseconds+=n*s._milliseconds,t._days+=n*s._days,t._months+=n*s._months,t._bubble()}function Pi(t){return t<0?Math.floor(t):Math.ceil(t)}function Ei(t){return 4800*t/146097}function Li(t){return 146097*t/4800}function Ii(t){return function(){return this.as(t)}}var Ai=Ii("ms"),Ni=Ii("s"),Ri=Ii("m"),ji=Ii("h"),Fi=Ii("d"),Hi=Ii("w"),Gi=Ii("M"),Wi=Ii("Q"),zi=Ii("y");function Ui(t){return function(){return this.isValid()?this._data[t]:NaN}}var Vi=Ui("milliseconds"),Bi=Ui("seconds"),Xi=Ui("minutes"),qi=Ui("hours"),Zi=Ui("days"),$i=Ui("months"),Ji=Ui("years"),Ki=Math.round,Qi={ss:44,s:45,m:45,h:22,d:26,M:11};function tn(t,e,i,n,s){return s.relativeTime(e||1,!!i,t,n)}var en=Math.abs;function nn(t){return(t>0)-(t<0)||+t}function sn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=en(this._milliseconds)/1e3,n=en(this._days),s=en(this._months);t=w(i/60),e=w(t/60),i%=60,t%=60;var r=w(s/12),o=s%=12,a=n,l=e,h=t,u=i?i.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var c=d<0?"-":"",f=nn(this._months)!==nn(d)?"-":"",m=nn(this._days)!==nn(d)?"-":"",p=nn(this._milliseconds)!==nn(d)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(a?m+a+"D":"")+(l||h||u?"T":"")+(l?p+l+"H":"")+(h?p+h+"M":"")+(u?p+u+"S":"")}var rn=Fe.prototype;return rn.isValid=function(){return this._isValid},rn.abs=function(){var t=this._data;return this._milliseconds=Ci(this._milliseconds),this._days=Ci(this._days),this._months=Ci(this._months),t.milliseconds=Ci(t.milliseconds),t.seconds=Ci(t.seconds),t.minutes=Ci(t.minutes),t.hours=Ci(t.hours),t.months=Ci(t.months),t.years=Ci(t.years),this},rn.add=function(t,e){return Yi(this,t,e,1)},rn.subtract=function(t,e){return Yi(this,t,e,-1)},rn.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=I(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Ei(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Li(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},rn.asMilliseconds=Ai,rn.asSeconds=Ni,rn.asMinutes=Ri,rn.asHours=ji,rn.asDays=Fi,rn.asWeeks=Hi,rn.asMonths=Gi,rn.asQuarters=Wi,rn.asYears=zi,rn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},rn._bubble=function(){var t,e,i,n,s,r=this._milliseconds,o=this._days,a=this._months,l=this._data;return r>=0&&o>=0&&a>=0||r<=0&&o<=0&&a<=0||(r+=864e5*Pi(Li(a)+o),o=0,a=0),l.milliseconds=r%1e3,t=w(r/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,i=w(e/60),l.hours=i%24,o+=w(i/24),s=w(Ei(o)),a+=s,o-=Pi(Li(s)),n=w(a/12),a%=12,l.days=o,l.months=a,l.years=n,this},rn.clone=function(){return $e(this)},rn.get=function(t){return t=I(t),this.isValid()?this[t+"s"]():NaN},rn.milliseconds=Vi,rn.seconds=Bi,rn.minutes=Xi,rn.hours=qi,rn.days=Zi,rn.weeks=function(){return w(this.days()/7)},rn.months=$i,rn.years=Ji,rn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=function(t,e,i){var n=$e(t).abs(),s=Ki(n.as("s")),r=Ki(n.as("m")),o=Ki(n.as("h")),a=Ki(n.as("d")),l=Ki(n.as("M")),h=Ki(n.as("y")),u=s<=Qi.ss&&["s",s]||s0,u[4]=i,tn.apply(null,u)}(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},rn.toISOString=sn,rn.toString=sn,rn.toJSON=sn,rn.locale=si,rn.localeData=oi,rn.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",sn),rn.lang=ri,z("X",0,0,"unix"),z("x",0,0,"valueOf"),ht("x",st),ht("X",/[+-]?\d+(\.\d{1,3})?/),ft("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),ft("x",(function(t,e,i){i._d=new Date(k(t))})),n.version="2.24.0",e=Ie,n.fn=Di,n.min=function(){return Re("isBefore",[].slice.call(arguments,0))},n.max=function(){return Re("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=c,n.unix=function(t){return Ie(1e3*t)},n.months=function(t,e){return Ti(t,e,"months")},n.isDate=l,n.locale=me,n.invalid=p,n.duration=$e,n.isMoment=b,n.weekdays=function(t,e,i){return Oi(t,e,i,"weekdays")},n.parseZone=function(){return Ie.apply(null,arguments).parseZone()},n.localeData=ge,n.isDuration=He,n.monthsShort=function(t,e){return Ti(t,e,"monthsShort")},n.weekdaysMin=function(t,e,i){return Oi(t,e,i,"weekdaysMin")},n.defineLocale=pe,n.updateLocale=function(t,e){if(null!=e){var i,n,s=he;null!=(n=fe(t))&&(s=n._config),e=Y(s,e),(i=new P(e)).parentLocale=ue[t],ue[t]=i,me(t)}else null!=ue[t]&&(null!=ue[t].parentLocale?ue[t]=ue[t].parentLocale:null!=ue[t]&&delete ue[t]);return ue[t]},n.locales=function(){return M(ue)},n.weekdaysShort=function(t,e,i){return Oi(t,e,i,"weekdaysShort")},n.normalizeUnits=I,n.relativeTimeRounding=function(t){return void 0===t?Ki:"function"==typeof t&&(Ki=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Qi[t]&&(void 0===e?Qi[t]:(Qi[t]=e,"s"===t&&(Qi.ss=e-1),!0))},n.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},n.prototype=Di,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()})),ee=[],ie=0;ie<256;ie++)ee[ie]=(ie+256).toString(16).substr(1);for(var ne=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var t=new Uint8Array(16);return function(){return crypto.getRandomValues(t),t}}var e=new Array(16);return function(){for(var t,i=0;i<16;i++)0==(3&i)&&(t=4294967296*Math.random()),e[i]=t>>>((3&i)<<3)&255;return e}}(),se=[],re=0;re<256;re++)se[re]=(re+256).toString(16).substr(1);var oe=ne(),ae=(oe[0],oe[1],oe[2],oe[3],oe[4],oe[5],oe[6],oe[7],/^\/?Date\((-?\d+)/i);function le(t){return t instanceof Number||"number"==typeof t}function he(t){return t instanceof String||"string"==typeof t}function ue(t){return te.isMoment(t)}function de(t,e){var i;if(void 0!==t){if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return he(t)&&!isNaN(Date.parse(t))?te(t).valueOf():Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(le(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(ue(t))return new Date(t.valueOf());if(he(t))return(i=ae.exec(t))?new Date(Number(i[1])):te(new Date(t)).toDate();throw new Error("Cannot convert object of type "+ce(t)+" to type Date");case"Moment":if(le(t))return te(t);if(t instanceof Date)return te(t.valueOf());if(ue(t))return te(t);if(he(t))return i=ae.exec(t),te(i?Number(i[1]):t);throw new Error("Cannot convert object of type "+ce(t)+" to type Date");case"ISODate":if(le(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(ue(t))return t.toDate().toISOString();if(he(t))return(i=ae.exec(t))?new Date(Number(i[1])).toISOString():te(t).format();throw new Error("Cannot convert object of type "+ce(t)+" to type ISODate");case"ASPDate":if(le(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(he(t))return"/Date("+((i=ae.exec(t))?new Date(Number(i[1])).valueOf():new Date(t).valueOf())+")/";throw new Error("Cannot convert object of type "+ce(t)+" to type ASPDate");default:throw new Error("Unknown type ".concat(e))}}}function ce(t){var e=Kt(t);return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function fe(t){return"string"==typeof t||"number"==typeof t}var me=function(){function t(e){Rt(this,t),this._queue=[],this._timeout=null,this._extended=null,this.delay=null,this.max=1/0,this.setOptions(e)}return Ft(t,[{key:"setOptions",value:function(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,e=this._extended.methods,i=0;ithis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=setTimeout((function(){t.flush()}),this.delay))}},{key:"flush",value:function(){this._queue.splice(0).forEach((function(t){t.fn.apply(t.context||t.fn,t.args||[])}))}}],[{key:"extend",value:function(e,i){var n=new t(i);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){n.flush()};var s=[{name:"flush",original:void 0}];if(i&&i.replace)for(var r=0;rs?1:ns)&&(n=a,s=l)}return n}},{key:"min",value:function(t){for(var e=this._data,i=Object.keys(e),n=null,s=null,r=0,o=i.length;r0?Ji:$i)(t)},Qi=Math.min,tn=function(t){return t>0?Qi(Ki(t),9007199254740991):0},en=Math.max,nn=Math.min,sn=function(t,e){var i=Ki(t);return i<0?en(i+e,0):nn(i,e)},rn=function(t){return function(e,i,n){var s,r=Ce(e),o=tn(r.length),a=sn(n,o);if(t&&i!=i){for(;o>a;)if((s=r[a++])!=s)return!0}else for(;o>a;a++)if((t||a in r)&&r[a]===i)return t||a||0;return!t&&-1}},on={includes:rn(!0),indexOf:rn(!1)},an=on.indexOf,ln=function(t,e){var i,n=Ce(t),s=0,r=[];for(i in n)!si(ui,i)&&si(n,i)&&r.push(i);for(;e.length>s;)si(n,i=e[s++])&&(~an(r,i)||r.push(i));return r},hn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],un=Object.keys||function(t){return ln(t,hn)},dn=Ge?Object.defineProperties:function(t,e){Xe(t);for(var i,n=un(e),s=n.length,r=0;s>r;)$e.f(t,i=n[r++],e[i]);return t},cn=function(t){return"function"==typeof t?t:void 0},fn=function(t,e){return arguments.length<2?cn(Li[t])||cn(He[t]):Li[t]&&Li[t][e]||He[t]&&He[t][e]},mn=fn("document","documentElement"),pn=hi("IE_PROTO"),gn=function(){},vn=function(){var t,e=Ve("iframe"),i=hn.length;for(e.style.display="none",mn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("