From cefde002227857125fb72527bbe2cfab5fe6ba02 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen Date: Wed, 22 Aug 2018 14:55:15 +0200 Subject: [PATCH] OS2DISP-155: Squashed changes --- CHANGELOG.md | 4 ++++ .../public/apps/adminApp/user/admin-user.html | 2 +- .../apps/adminApp/user/adminUserController.js | 13 +++++++--- .../mainModule/controller/baseController.js | 10 ++++++++ .../assets/build/os2displayadmin.min.js | 24 ++++++++++++++++++- 5 files changed, 48 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02c9c9f..d06b94d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.1 + +* Merged https://github.com/os2display/admin-bundle/pull/6: Only display the add role modal if the user has admin privileges. + ## 1.1.0 * Made media upload buttons sticky. diff --git a/Resources/public/apps/adminApp/user/admin-user.html b/Resources/public/apps/adminApp/user/admin-user.html index 0b1ea66..588175b 100644 --- a/Resources/public/apps/adminApp/user/admin-user.html +++ b/Resources/public/apps/adminApp/user/admin-user.html @@ -57,7 +57,7 @@
-
'}}]),angular.module("ikShared").directive("ikSlideEditable",["templateFactory","$timeout",function(t,n){"use strict";return{restrict:"E",scope:{ikWidth:"@",ikSlide:"="},link:function(i,o,e){i.templateURL="bundles/os2displayadmin/apps/ikShared/elements/slide/slide-loading.html?"+window.config.version,i.$watch("ikSlide",function(e,t){e&&("image"===i.ikSlide.media_type?(i.ikSlide.currentImage="",0{{ slideError }}
'}}]),angular.module("ikShared").directive("ikSharedSlide",[function(){"use strict";return{restrict:"E",scope:{ikWidth:"@",ikSlide:"="},link:function(t,e,i){t.templateURL="bundles/os2displayadmin/apps/ikShared/elements/slide/slide-loading.html?"+window.config.version,i.$observe("ikSlide",function(e){e&&(t.ikSlide.media_thumbs&&0'}}]),angular.module("ikShared").directive("ikScreenOverview",["busService",function(e){"use strict";return{restrict:"E",scope:{ikSelectedScreens:"=",ikOverlay:"@"},controller:["$scope","$filter","$controller","screenFactory","userService","busService",function(o,t,e,n,i,s){e("BaseSearchController",{$scope:o}),o.showFromUser=localStorage.getItem("overview.media.search_filter_default")?localStorage.getItem("overview.media.search_filter_default"):"all",o.screens=[];var r=null;o.updateSearch=function(){o.baseQuery.text=o.search_text,o.loading=!0,n.searchScreens(o.baseQuery).then(function(e){o.hits=e.hits;for(var t=[],i=0;i",link:function(e,t,i){if(a){var o=e.$eval(i.ikThumb);if(h(o.file)&&l(o.file)){var n=t.find("canvas"),s=new FileReader;s.onload=function(e){var t=new Image;t.onload=r,t.src=e.target.result},s.readAsDataURL(o.file)}}function r(){var e=o.width?o.width:this.width/this.height*o.height,t=o.height?o.height:this.height/this.width*o.width;n.attr({width:e,height:t}),n[0].getContext("2d").drawImage(this,0,0,e,t)}}}}]),angular.module("ikShared").directive("autoGrow",function(){"use strict";return{restrict:"A",scope:{fontSize:"@"},link:function(e,t){var i=$(t),o=function(e){e.css("height","0px");var t=e.prop("scrollHeight"),i=e.css("min-height").replace("px","");e.css("height",Math.max(t,i)+"px")};t.bind("keyup",function(){o(i)}),e.$watch("fontSize",function(e){e&&o(i)}),setTimeout(function(){o(i)},100)}}}),angular.module("ikShared").directive("includeReplace",function(){"use strict";return{require:"ngInclude",restrict:"A",link:function(e,t){t.replaceWith(t.children())}}}),function(){"use strict";angular.module("itkControlPanel",[]).directive("controlPanel",["busService",function(e){return{restrict:"E",scope:{template:"=",data:"=",screen:"=",display:"=",saveAction:"&",region:"=",options:"="},replace:!0,link:function(t){t.selectedTab=null,e.$emit("bodyService.addClass","is-screen"),t.getContent=function(){return t.template},t.clickTab=function(e){t.selectedTab=e},t.toggleChannelType=function(e){t.channelType=e},t.$on("$destroy",function(){document.getElementsByTagName("body")[0].style.overflow=""})},template:'
'}}])}.call(this),function(){"use strict";angular.module("ngModal",[]).directive("modalDialog",[function(){return{restrict:"E",scope:{show:"=",onClose:"&?"},replace:!0,transclude:!0,link:function(i){i.hideModal=function(){i.show=!1},i.$watch("show",function(e,t){if(document.getElementsByTagName("body")[0].style.overflow=e&&!t?"hidden":"",!e&&t&&null!==i.onClose)return i.onClose()})},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/ngModal/ng-modal.html?"+window.config.version}}])}.call(this),angular.module("ikShared").directive("ikDisabledList",[function(){"use strict";return{restrict:"E",replace:!1,scope:{elements:"="},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/disabledList/disabled-list.html?"+window.config.version}}]),function(){"use strict";angular.module("itkScreenTemplatePickerWidget",[]).directive("screenTemplatePickerWidget",["templateFactory","busService",function(e,i){return{restrict:"E",scope:{screen:"="},replace:!0,link:function(t){t.templates=[],e.getEnabledScreenTemplates().then(function(e){t.templates=e},function(e){i.$emit("log.error",{cause:e,msg:"Kunne ikke loade templates."})}),t.pickTemplate=function(e){t.screen.template=angular.copy(e)}},templateUrl:"bundles/os2displayadmin/apps/ikShared/widgets/screenTemplatePickerWidget/screenTemplatePickerWidget.html?"+window.config.version}}])}.call(this),function(){"use strict";angular.module("itkTextWidget",[]).directive("textWidget",function(){return{restrict:"E",scope:{field:"=",placeholderText:"@"},replace:!0,template:''}})}.call(this),function(){"use strict";angular.module("itkTextAreaWidget",[]).directive("textAreaWidget",function(){return{restrict:"E",scope:{field:"=",placeholderText:"@"},replace:!0,template:''}})}.call(this),function(){"use strict";angular.module("itkNumberWidget",[]).directive("numberWidget",function(){return{restrict:"E",scope:{field:"=",placeholderText:"@"},replace:!0,template:''}})}.call(this),function(){"use strict";angular.module("itkChannelPickerWidget",[]).directive("channelPickerWidget",["userService","channelFactory","busService",function(t,n,s){return{restrict:"E",replace:!0,templateUrl:"bundles/os2displayadmin/apps/ikShared/widgets/channelPickerWidget/channel-picker-widget.html?"+window.config.version,scope:{screen:"=",region:"="},link:function(o){o.sharingEnabled=window.config.sharingService.enabled,o.loading=!1,o.showFromUser="all",o.sort={created_at:"desc"},o.selectedGroup=null,o.currentUser=t.getCurrentUser();var e=s.$on("itkChannelPickerWidget.currentUserGroups",function(e,t){o.userGroups=t});t.getCurrentUserGroups("itkChannelPickerWidget.currentUserGroups"),o.pager={size:5,page:0},o.hits=0,o.channels=[],o.search={fields:"title",text:"",filter:{bool:{must:[]}},sort:{created_at:{order:"desc"}},pager:o.pager},o.updateSearch=function(){var e=angular.copy(o.search);e.text=o.search_text,null!==o.selectedGroup&&e.filter.bool.must.push({terms:{groups:[o.selectedGroup.id]}}),o.loading=!0,n.searchChannels(e).then(function(e){o.hits=e.hits;for(var t=[],i=0;i=t?i.push(n):n.from&&n.from>=t&&i.push(n)}return i}}),angular.module("ikApp").controller("ScreenController",["$scope","$controller","$location","$routeParams","$timeout","screenFactory","channelFactory","sharedChannelFactory","templateFactory","busService","userService",function(t,e,i,o,n,s,r,a,h,l,d){"use strict";e("BaseEntityController",{$scope:t,entityType:"screen"}),t.loading=!0,t.sharingEnabled=window.config.sharingService.enabled,t.screen={},t.toolbarTemplate=null,t.display=!1,t.region=null,t.controlPanelData={userGroups:t.userGroups,baseUnavailableGroups:t.baseUnavailableGroups},t.$watch("userGroups",function(){t.controlPanelData.userGroups=t.userGroups}),t.$watch("baseUnavailableGroups",function(){t.controlPanelData.baseUnavailableGroups=t.baseUnavailableGroups}),o.id?null===o.id||void 0===o.id||""===o.id?i.path("/screen-overview"):s.getEditScreen(o.id).then(function(e){t.loading=!1,t.screen=e,t.screen.channel_screen_regions.forEach(function(e){e.shared_channel&&(e.shared_channel.content=JSON.parse(e.shared_channel.content),e.shared_channel.title=e.shared_channel.content.title,e.shared_channel.slides=e.shared_channel.content.slides)}),t.screen==={}&&i.path("/screen")},function(e){l.$emit("log.error",{cause:e,msg:"Skærmen med id: "+o.id+" blev ikke fundet"})}):(t.screen=s.emptyScreen(),h.getScreenTemplate("full-screen").then(function(e){t.screen.template=e,t.loading=!1},function(e){404===e&&h.getEnabledScreenTemplates().then(function(e){t.screen.template=angular.copy(e[0]),t.screen.orientation=e[0].orientation,t.loading=!1},function(e){l.$emit("log.error",{cause:e,msg:"Skabelonerne blev ikke loaded"})})})),t.saveScreenAndClose=function(){t.displayToolbar=!1,t.region=null,s.saveScreen().then(function(e){l.$emit("log.info",{msg:"Skærmen ("+e.title+") er gemt",timeout:5e3}),n(function(){i.path("/screen-overview")},1e3)},function(e){l.$emit("log.error",{cause:e,msg:"Skærmen blev ikke gemt"})})},t.saveScreen=function(){t.displayToolbar=!1,t.region=null,s.saveScreen().then(function(e){l.$emit("log.info",{msg:"Skærmen ("+e.title+") er gemt",timeout:5e3})},function(e){l.$emit("log.error",{cause:e,msg:"Skærmen blev ikke gemt"})})},t.triggerTool=function(e){t.screen.template.tools.hasOwnProperty(e.name)?t.toolbarTemplate=t.screen.template.tools[e.name]:t.toolbarTemplate="bundles/os2displayadmin/apps/ikShared/toolbars/"+e.name+".html?"+window.config.version,t.region=e.region,t.displayToolbar=!0}}]),angular.module("ikApp").controller("SharedChannelController",["$scope","$location","$routeParams","$timeout","screenFactory","sharedChannelFactory","busService",function(t,i,e,o,n,s,r){"use strict";function a(e){t.step=e,t.templatePath="bundles/os2displayadmin/apps/ikApp/pages/sharedChannel/shared-channel-step"+t.step+".html?"+window.config.version}t.steps=1,t.step=1,t.channel={},t.channel.slides=[],t.status="edit",n.getScreens().then(function(e){t.screens=e},function(e){r.$emit("log.error",{cause:e,msg:"Kunne ikke hente skærme."})}),e.id&&e.index?s.getSharedChannel(e.id,e.index).then(function(e){t.channel=JSON.parse(e.content),t.channel==={}&&i.path("/channel-sharing-overview"),a(1)},function(e){r.$emit("log.error",{cause:e,msg:"Delt kanal kunne ikke hentes."})}):i.path("/channel-sharing-overview"),t.submitStep=function(){i.path("/channel-sharing-overview")},t.goToStep=function(e){a(e)}}]),angular.module("ikApp").controller("AdminSharingController",["busService","sharedChannelFactory","$scope",function(t,e,i){"use strict";i.saving=!1,i.availableIndexes=[],e.getAvailableIndexes().then(function(e){e.forEach(function(e){"shared"===e.tag&&i.availableIndexes.push(e)})},function(e){t.$emit("log.error",{cause:e,msg:"Hentning af tilgængelige delingsindeks fejlede."})}),i.chosenIndexes=[],e.getSharingIndexes().then(function(e){i.chosenIndexes=e},function(e){t.$emit("log.error",{cause:e,msg:"Hentning af valgte delingsindeks fejlede."})}),i.save=function(){i.saving=!0,e.saveSharingIndexes(i.chosenIndexes).then(function(){t.$emit("log.info",{msg:"Delingsindeks gemt",timeout:3e3}),i.saving=!1},function(e){t.$emit("log.error",{cause:e,msg:"Delingsindeks blev ikke gemt."}),i.saving=!1})}}]),angular.module("ikApp").controller("AdminTemplatesController",["busService","templateFactory","$scope",function(t,e,o){"use strict";o.saving=!1,o.screenTemplates=[],o.slideTemplates=[],o.enabledScreenTemplates=[],o.enabledSlideTemplates=[],e.getScreenTemplates().then(function(e){o.screenTemplates=e;for(var t=[],i=0;ie.schedule_to)},n.getScheduledText=function(e){var t="";return e.published||(t+="Ikke udgivet!
"),e.hasOwnProperty("schedule_from")&&(t=t+"Udgivet fra: "+s("date")(1e3*e.schedule_from,"dd/MM/yyyy HH:mm")+".
"),e.hasOwnProperty("schedule_to")&&(t=t+"Udgivet til: "+s("date")(1e3*e.schedule_to,"dd/MM/yyyy HH:mm")+"."),t},n.goToStep=function(e){var t=1;n.validation.titleSet()&&(t+=3),e<=t&&d(e)},n.pushRight=function(e){e===n.channel.slides.length-1?u(n.channel.slides,e,0):u(n.channel.slides,e,e+1)},n.pushLeft=function(e){u(n.channel.slides,e,0===e?n.channel.slides.length-1:e-1)},n.handleDrop=function(e,t){e=parseInt(e.split("index-")[1]),t=parseInt(t.split("index-")[1]);var i=n.channel.slides.splice(e,1);n.channel.slides.splice(t,0,i[0])},n.sortSlides=function(e){var t=n.lastSortUsed===e;"random"!==(n.lastSortUsed=e)?n.channel.slides=s("orderBy")(n.channel.slides,t?"-":""+e):n.channel.slides=function(e){for(var t,i,o=e.length;0!==o;)i=Math.floor(Math.random()*o),t=e[o-=1],e[o]=e[i],e[i]=t;return e}(n.channel.slides)}}]),angular.module("ikApp").controller("ChannelOverviewController",["$scope","sharedChannelFactory","channelFactory","busService",function(i,e,o,n){"use strict";i.shareDialogShow=!1,i.shareDialogChannel=null,window.config.sharingService.enabled&&(i.$on("ikChannelShare.clickShare",function(e,t){i.shareDialogShow=!0,i.shareDialogChannel=t,o.getChannel(t.id).then(function(e){i.shareDialogChannel=e,i.shareDialogChannel.sharing_indexes||(i.shareDialogChannel.sharing_indexes=[])},function(e){n.$emit("log.error",{cause:e,msg:"Hentning af kanal fejlede"})})}),i.sharingIndexes=[],e.getSharingIndexes().then(function(e){i.sharingIndexes=e},function(e){n.$emit("log.error",{cause:e,msg:"Hentning af delingsindeks fejlede."})}),i.saveSharingChannel=function(){o.channelShare(i.shareDialogChannel).then(function(){n.$emit("log.info",{msg:"Delingskonfiguration af kanal lykkedes.",timeout:3e3})},function(e){n.$emit("log.error",{cause:e,msg:"Deling af kanal fejlede."})})})}]),angular.module("ikApp").controller("MediaOverviewController",["$scope","$location",function(e,i){"use strict";e.$on("mediaOverview.selectMedia",function(e,t){i.path("/media/"+t.id)})}]),angular.module("ikApp").controller("MediaEditController",["$scope","$controller","$location","$routeParams","$timeout","mediaFactory","busService","userService",function(t,e,i,o,n,s,r,a){"use strict";e("BaseEntityController",{$scope:t,entityType:"media"}),t.loading=!0,s.getMedia(o.id).then(function(e){n(function(){t.media=e,t.media==={}&&i.path("/media-overview")})},function(e){r.$emit("log.error",{cause:e,msg:"Kunne ikke hente media med id: "+o.id}),i.path("/media-overview")}).then(function(){t.loading=!1}),t.updateMedia=function(){t.loading=!0,s.updateMedia(t.media).then(function(){n(function(){r.$emit("log.info",{msg:"Media opdateret.",timeout:3e3})})},function(e){r.$emit("log.error",{cause:e,msg:"Opdatering af media fejlede."})}).then(function(){t.loading=!1})},t.delete=function(){t.loading=!0,s.deleteMedia(t.media.id).then(function(){r.$emit("log.info",{msg:"Media slettet.",timeout:3e3}),n(function(){i.path("/media-overview")},500)},function(e){r.$emit("log.error",{cause:e,msg:"Sletning af media fejlede."})}).then(function(){t.loading=!1})},t.getContentType=function(e){return e?e.content_type.split("/")[0]:""},t.videoPath=function(e,t){var i="";return e.provider_metadata.forEach(function(e){e.format===t&&(i=e.reference),"thumbnail_landscape"===t&&e.thumbnails.forEach(function(e){"mp4_landscape"===e.label&&(i=e.reference)})}),i}}]),angular.module("ikApp").controller("SlideOverviewController",["$scope","$location",function(e,i){"use strict";e.$on("slideOverview.clickSlide",function(e,t){i.path("/slide/"+t.id)})}]),angular.module("ikApp").controller("SlideController",["$scope","$controller","$location","$routeParams","$timeout","slideFactory","templateFactory","channelFactory","busService","userService",function(n,e,t,i,o,s,r,a,h,l){"use strict";function d(e){n.step=e,n.templatePath="bundles/os2displayadmin/apps/ikApp/pages/slide/slide-step"+n.step+".html?"+window.config.version}function u(e){return!!n.slide&&""!==n.slide[e]}e("BaseEntityController",{$scope:n,entityType:"slide"}),n.steps=6,n.slide={},n.templates=[],r.getEnabledSlideTemplates().then(function(e){for(var t in e)e.hasOwnProperty(t)&&n.templates.push(e[t])},function(e){h.$emit("log.error",{cause:e,msg:"Kunne ikke hente slide templates."})}),n.editor={channelOverviewEditor:!1,toggleChannelOverviewEditor:function(){h.$emit("bodyService.toggleClass","is-locked"),n.editor.channelOverviewEditor=!n.editor.channelOverviewEditor}},n.$on("channelOverview.clickChannel",function(e,t){n.toggleChannel(t)}),i.id?null===i.id||void 0===i.id||""===i.id?t.path("/slide"):(s.clearCurrentSlide(),s.getEditSlide(i.id).then(function(e){n.slide=e,n.slide.status="edit-slide",n.slide==={}&&t.path("/slide"),d(3)},function(e){h.$emit("log.error",{cause:e,msg:"Kunne ikke hente slide med id: "+i.id}),t.path("/slide-overview")})):(n.slide=s.emptySlide(),n.slide.channels=[],d(1)),n.submitStep=function(){n.step===n.steps?(n.disableSubmitButton=!0,""===n.slide.duration&&(n.slide.duration=15),s.saveSlide().then(function(){h.$emit("log.info",{msg:"Slide er gemt",timeout:3e3}),o(function(){t.path("/slide-overview")},1e3)},function(e){h.$emit("log.error",{cause:e,msg:"Kunne ikke gemme slide"}),n.disableSubmitButton=!1})):d(n.step+1)},n.validation={titleSet:function(){return u("title")},templateSet:function(){return u("template")}},n.goToStep=function(e){var t=1;n.validation.titleSet()&&(t++,n.validation.templateSet()&&(t+=4)),e<=t&&d(e)},n.selectTemplate=function(t){n.slide.template=t;var i=null;n.templates.forEach(function(e){e.id===t&&(i=e)}),null!==i&&(n.slide.slide_type=i.slide_type,n.slide.options||(n.slide.options={}),n.slide.orientation=i.orientation,angular.forEach(i.empty_options,function(e,t){void 0===n.slide.options[t]&&(n.slide.options[t]=angular.copy(e))}),""===n.slide.options.headline&&(n.slide.options.headline=n.slide.title),n.slide.media_type=i.media_type)},n.channelSelected=function(t){var i=!1;return n.slide.channels.forEach(function(e){t.id===e.id&&(i=!0)}),i},n.hasChannel=function(t){var i=!1;return n.slide.channels.forEach(function(e){t.id===e.id&&(i=!0)}),i},n.toggleChannel=function(i){var o=null;n.slide.channels.forEach(function(e,t){i.id===e.id&&(o=t)}),null!==o?n.slide.channels.splice(o,1):n.slide.channels.push(i)}}]),angular.module("ikApp").controller("SlideEditController",["$scope","slideFactory","busService","templateFactory","$compile","$templateRequest",function(o,e,n,t,s,i){"use strict";e.getEditSlide(null).then(function(e){o.slide=e,t.getSlideTemplate(e.template).then(function(e){o.template=e},function(e){n.$emit("log.error",{cause:e,msg:"Kunne ikke loade værktøjer til slidet."})})},function(e){n.$emit("log.error",{cause:e,msg:"Kunne ikke hente slide."})}),n.$emit("bodyService.removeClass","is-locked"),o.editor={editorOpen:!1,hideEditors:function(){n.$emit("bodyService.removeClass","is-locked"),o.editor.editorOpen=!1,o.selectedTool=null;var e=document.getElementById("slide-edit-tool");angular.element(e).html(s("")(o))}},o.openTool=function(e){n.$emit("bodyService.toggleClass","is-locked"),o.editor.editorOpen=!0,e.id||(e.id="base-editor"),o.selectedTool=e;var t=document.getElementById("slide-edit-tool"),i="
<"+e.id+' slide="slide" close="editor.hideEditors()" '+(e.template?'template="'+e.template+'"':"")+' tool="selectedTool">
";angular.element(t).html(s(i)(o))}}]),function(){"use strict";angular.module("itkDateComponent",[]).directive("dateComponent",["$interval",function(i){return{restrict:"E",replace:!0,templateUrl:"bundles/os2displayadmin/apps/ikApp/shared/components/date/date.html?"+window.config.version,scope:{theme:"@"},link:function(e){e.thisDate=new Date;var t=i(function(){e.thisDate=new Date},6e4);e.$on("$destroy",function(){angular.isDefined(t)&&(i.cancel(t),t=void 0)})}}}])}.call(this),function(){"use strict";angular.module("itkDigitalClockComponent",[]).directive("digitalClockComponent",["$interval",function(i){return{restrict:"E",replace:!0,templateUrl:"bundles/os2displayadmin/apps/ikApp/shared/components/digital-clock/digital-clock.html?"+window.config.version,scope:{},link:function(e){e.thisDate=new Date;var t=i(function(){e.thisDate=Date.now()},1e3);e.$on("$destroy",function(){angular.isDefined(t)&&(i.cancel(t),t=void 0)})}}}])}.call(this),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vis=t():e.vis=t()}(this,function(){return function(i){function o(e){if(n[e])return n[e].exports;var t=n[e]={exports:{},id:e,loaded:!1};return i[e].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}var n={};return o.m=i,o.c=n,o.p="",o(0)}([function(e,t,i){var o=i(1);o.extend(t,i(7)),o.extend(t,i(24)),o.extend(t,i(60))},function(e,h,t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=t(2),i=t(6);h.isNumber=function(e){return e instanceof Number||"number"==typeof e},h.recursiveDOMDelete=function(e){if(e)for(;!0===e.hasChildNodes();)h.recursiveDOMDelete(e.firstChild),e.removeChild(e.firstChild)},h.giveRange=function(e,t,i,o){if(t==e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)},h.isString=function(e){return e instanceof String||"string"==typeof e},h.isDate=function(e){if(e instanceof Date)return!0;if(h.isString(e)){if(s.exec(e))return!0;if(!isNaN(Date.parse(e)))return!0}return!1},h.randomUUID=function(){return i.v4()},h.assignAllKeys=function(e,t){for(var i in e)e.hasOwnProperty(i)&&"object"!==n(e[i])&&(e[i]=t)},h.fillIfDefined=function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2];for(var o in e)void 0!==t[o]&&("object"!==n(t[o])?void 0!==t[o]&&null!==t[o]||void 0===e[o]||!0!==i?e[o]=t[o]:delete e[o]:"object"===n(e[o])&&h.fillIfDefined(e[o],t[o],i))},h.protoExtend=function(e,t){for(var i=1;i=t&&r(n,i,!0)>=t-1)break;t--}s++}return null}(e)}function t(e,t){var i=e.toLowerCase();Qe[i]=Qe[i+"s"]=Qe[t]=e}function P(e){return"string"==typeof e?Qe[e]||Qe[e.toLowerCase()]:void 0}function I(e){var t,i,o={};for(i in e)g(e,i)&&(t=P(i))&&(o[t]=e[i]);return o}function i(t,i){return function(e){return null!=e?(R(this,t,e),v.updateOffset(this,i),this):A(this,t)}}function A(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function R(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function L(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(k(this[e=P(e)]))return this[e](t);return this}function N(e,t,i){var o=""+Math.abs(e),n=t-o.length,s=0<=e;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function z(e,t,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),e&&(ot[e]=n),t&&(ot[t[0]]=function(){return N(n.apply(this,arguments),t[1],t[2])}),i&&(ot[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function F(e,t){return e.isValid()?(t=B(t,e.localeData()),it[t]=it[t]||function(o){var e,n,t,s=o.match(et);for(e=0,n=s.length;eY(i[xt],i[kt])?St:i[Ot]<0||24J(e)?(s=e+1,r=l-J(e)):(s=e,r=l),{year:s,dayOfYear:r}}function ie(e,t,i){var o,n,s=ee(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(n=e.year()-1,o=r+oe(n,t,i)):r>oe(e.year(),t,i)?(o=r-oe(e.year(),t,i),n=e.year()+1):(n=e.year(),o=r),{week:o,year:n}}function oe(e,t,i){var o=ee(e,t,i),n=ee(e+1,t,i);return(J(e)-o+n)/7}function ne(e,t,i){return null!=e?e:null!=t?t:i}function se(e){var t,i,o,n,s,r,a,h,l,d,u,c,p,f,m,g=[];if(!e._d){for(f=e,m=void 0,m=new Date(v.now()),o=f._useUTC?[m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()]:[m.getFullYear(),m.getMonth(),m.getDate()],e._w&&null==e._a[St]&&null==e._a[kt]&&(p=c=u=d=l=h=a=r=void 0,null!=(r=(s=e)._w).GG||null!=r.W||null!=r.E?(d=1,u=4,a=ne(r.GG,s._a[xt],ie(le(),1,4).year),h=ne(r.W,1),((l=ne(r.E,1))<1||7oe(a,d,u)?y(s)._overflowWeeks=!0:null!=p?y(s)._overflowWeekday=!0:(c=te(a,h,l,d,u),s._a[xt]=c.year,s._dayOfYear=c.dayOfYear)),e._dayOfYear&&(n=ne(e._a[xt],o[xt]),e._dayOfYear>J(n)&&(y(e)._overflowDayOfYear=!0),i=Z(n,0,e._dayOfYear),e._a[kt]=i.getUTCMonth(),e._a[St]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=g[t]=o[t];for(;t<7;t++)e._a[t]=g[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ot]&&0===e._a[Ct]&&0===e._a[Mt]&&0===e._a[Dt]&&(e._nextDay=!0,e._a[Ot]=0),e._d=(e._useUTC?Z:function(e,t,i,o,n,s,r){var a=new Date(e,t,i,o,n,s,r);return e<100&&0<=e&&isFinite(a.getFullYear())&&a.setFullYear(e),a}).apply(null,g),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ot]=24)}}function re(e){if(e._f!==v.ISO_8601){e._a=[],y(e).empty=!0;var t,i,o,n,s,r,a,h,l,d,u,c,p=""+e._i,f=p.length,m=0;for(o=B(e._f,e._locale).match(et)||[],t=0;t>>0,o=0;oi.valueOf():i.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},li.isDSTShifted=function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(f(e,this),(e=ae(e))._a){var t=e._isUTC?u(e._a):le(e._a);this._isDSTShifted=this.isValid()&&0>>((3&t)<<3)&255;return n}}for(var s=[],a={},h=0;h<256;h++)s[h]=(h+256).toString(16).substr(1),a[s[h]]=h;var l=r(),f=[1|l[0],l[1],l[2],l[3],l[4],l[5]],m=16383&(l[6]<<8|l[7]),g=0,v=0,d=t;d.v1=function(e,t,i){var o=t&&i||0,n=t||[],s=void 0!==(e=e||{}).clockseq?e.clockseq:m,r=void 0!==e.msecs?e.msecs:(new Date).getTime(),a=void 0!==e.nsecs?e.nsecs:v+1,h=r-g+(a-v)/1e4;if(h<0&&void 0===e.clockseq&&(s=s+1&16383),(h<0||g>>24&255,n[o++]=l>>>16&255,n[o++]=l>>>8&255,n[o++]=255&l;var d=r/4294967296*1e4&268435455;n[o++]=d>>>8&255,n[o++]=255&d,n[o++]=d>>>24&15|16,n[o++]=d>>>16&255,n[o++]=s>>>8|128,n[o++]=255&s;for(var u=e.node||f,c=0;c<6;c++)n[o+c]=u[c];return t||p(n)},d.v4=t,d.parse=function(e,t,i){var o=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){n<16&&(t[o+n++]=a[e])});n<16;)t[o+n++]=0;return t},d.unparse=p,u.exports=d}).call(e,function(){return this}())},function(e,t,i){t.util=i(1),t.DOMutil=i(8),t.DataSet=i(9),t.DataView=i(11),t.Queue=i(10),t.Graph3d=i(12),t.graph3d={Camera:i(16),Filter:i(17),Point2d:i(15),Point3d:i(14),Slider:i(18),StepNumber:i(19)},t.moment=i(2),t.Hammer=i(20),t.keycharm=i(23)},function(e,l){l.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},l.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var i=0;ithis.max&&this.flush(),clearTimeout(this._timeout),0e[o][t]&&(i.min=e[o][t]),i.max"+this.xLabel+":"+e.point.x+""+this.yLabel+":"+e.point.y+""+this.zLabel+":"+e.point.z+"",t.style.left="0",t.style.top="0",this.frame.appendChild(t),this.frame.appendChild(i),this.frame.appendChild(o);var n=t.offsetWidth,s=t.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,l=e.screen.x-n/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-n),i.style.left=e.screen.x+"px",i.style.top=e.screen.y-r+"px",t.style.left=l+"px",t.style.top=e.screen.y-r-s+"px",o.style.left=e.screen.x-a/2+"px",o.style.top=e.screen.y-h/2+"px"},w.prototype._hideTooltip=function(){if(this.tooltip)for(var e in this.tooltip.dataPoint=null,this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(e)){var t=this.tooltip.dom[e];t&&t.parentNode&&t.parentNode.removeChild(t)}},e.exports=w},function(e,t){function i(e){return e?function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e):void 0}(e.exports=i).prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){o.off(e,i),t.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var o,n=0;n.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===e&&void 0===t||this.calculateCameraOrientation()},o.prototype.getArmRotation=function(){var e={};return e.horizontal=this.armRotation.horizontal,e.vertical=this.armRotation.vertical,e},o.prototype.setArmLength=function(e){void 0!==e&&(this.armLength=e,this.armLength<.71&&(this.armLength=.71),5=this.values.length)throw"Error: index out of range";return this.values[e]},o.prototype._getDataPoints=function(e){if(void 0===e&&(e=this.index),void 0===e)return[];var t;if(this.dataPoints[e])t=this.dataPoints[e];else{var i={};i.column=this.column,i.value=this.values[e];var o=new n(this.data,{filter:function(e){return e[i.column]==i.value}}).get();t=this.graph._getDataPoints(o),this.dataPoints[e]=t}return t},o.prototype.setOnLoadCallback=function(e){this.onLoadCallback=e},o.prototype.selectValue=function(e){if(e>=this.values.length)throw"Error: index out of range";this.index=e,this.value=this.values[e]},o.prototype.loadInBackground=function(e){void 0===e&&(e=0);var t=this.graph.frame;if(ethis.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(e){var t=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10;return e/(this.values.length-1)*t+3},o.prototype._onMouseMove=function(e){var t=e.clientX-this.startClientX,i=this.startSlideX+t,o=this.leftToIndex(i);this.setIndex(o),n.preventDefault()},o.prototype._onMouseUp=function(e){this.frame.style.cursor="auto",n.removeEventListener(document,"mousemove",this.onmousemove),n.removeEventListener(document,"mouseup",this.onmouseup),n.preventDefault()},e.exports=o},function(e,t){function i(e,t,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(e,t,i,o)}i.prototype.setRange=function(e,t,i,o){this._start=e||0,this._end=t||0,this.setStep(i,o)},i.prototype.setStep=function(e,t){void 0===e||e<=0||(void 0!==t&&(this.prettyStep=t),!0===this.prettyStep?this._step=i.calculatePrettyStep(e):this._step=e)},i.calculatePrettyStep=function(e){var t=function(e){return Math.log(e)/Math.LN10},i=Math.pow(10,Math.round(t(e))),o=2*Math.pow(10,Math.round(t(e/2))),n=5*Math.pow(10,Math.round(t(e/5))),s=i;return Math.abs(o-e)<=Math.abs(s-e)&&(s=o),Math.abs(n-e)<=Math.abs(s-e)&&(s=n),s<=0&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(){this._current=this._start-this._start%this._step},i.prototype.next=function(){this._current+=this._step},i.prototype.end=function(){return this._current>this._end},e.exports=i},function(e,t,i){if("undefined"!=typeof window){var o=i(21),n=window.Hammer||i(22);e.exports=o(n,{preventDefault:"mouse"})}else e.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(e,t,i){var o,n,s;n=[],void 0===(s="function"==typeof(o=function(){var d=null;return function o(n,e){function t(e){return e.match(/[^ ]+/g)}function s(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var t=!1;e.stopPropagation=function(){t=!0};var i=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof i&&(e.srcEvent.stopPropagation=function(){i(),e.stopPropagation()});for(var o=e.firstTarget=d;o&&!t;){var n=o.hammer;if(n)for(var s,r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=s.console&&(s.console.warn||s.console.log);return i&&i.call(s.console,n,t),o.apply(this,arguments)}}function i(e,t,i){var o,n=t.prototype;(o=e.prototype=Object.create(n)).constructor=e,o._super=n,i&&K(o,i)}function r(e,t){return function(){return e.apply(t,arguments)}}function l(e,t){return typeof e==Q?e.apply(t&&t[0]||_,t):e}function d(e,t){return e===_?t:e}function u(t,e,i){n(f(e),function(e){t.addEventListener(e,i,!1)})}function c(t,e,i){n(f(e),function(e){t.removeEventListener(e,i,!1)})}function x(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function p(e,t){return-1t[i]}):o.sort()),o}function y(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;ste(m.y)?m.x:m.y,t.scale=r?(y=r.pointers,b=o,D(b[0],b[1],ke)/D(y[0],y[1],ke)):1,t.rotation=r?(g=r.pointers,v=o,E(v[1],v[0],ke)+E(g[1],g[0],ke)):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,o,n,s,r=e.lastInterval||t,a=t.timeStamp-r.timeStamp;if(t.eventType!=pe&&(dete(d.y)?d.x:d.y,s=M(h,l),e.lastInterval=t}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=o,t.velocityY=n,t.direction=s}(i,t);var g,v;var y,b;var w=e.element;x(t.srcEvent.target,w)&&(w=t.srcEvent.target),t.target=w}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function S(e){for(var t=[],i=0;i=te(t)?e<0?me:ge:t<0?ve:ye}function D(e,t,i){i||(i=xe);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(o*o+n*n)}function E(e,t,i){i||(i=xe);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,o)/Math.PI}function T(){this.evEl=Oe,this.evWin=Ce,this.allow=!0,this.pressed=!1,w.apply(this,arguments)}function P(){this.evEl=Ee,this.evWin=Te,w.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function I(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,w.apply(this,arguments)}function A(){this.evTarget=Ae,this.targetIds={},w.apply(this,arguments)}function R(){w.apply(this,arguments);var e=r(this.handler,this);this.touch=new A(this.manager,e),this.mouse=new T(this.manager,e)}function L(e,t){this.manager=e,this.set(t)}function N(e){this.options=K({},this.defaults,e||{}),this.id=se++,this.manager=null,this.options.enable=d(this.options.enable,!0),this.state=je,this.simultaneous={},this.requireFail=[]}function z(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function F(e){return e==ye?"down":e==ve?"up":e==me?"left":e==ge?"right":""}function B(e,t){var i=t.manager;return i?i.get(e):e}function j(){N.apply(this,arguments)}function H(){j.apply(this,arguments),this.pX=null,this.pY=null}function W(){j.apply(this,arguments)}function $(){N.apply(this,arguments),this._timer=null,this._input=null}function U(){j.apply(this,arguments)}function Y(){j.apply(this,arguments)}function G(){N.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function V(e,t){return(t=t||{}).recognizers=d(t.recognizers,V.defaults.preset),new q(e,t)}function q(e,t){var i;this.options=K({},V.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.element=e,this.input=new((i=this).options.inputClass||(ae?P:he?A:re?R:T))(i,k),this.touchAction=new L(this,this.options.touchAction),X(this,!0),n(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function X(e,i){var o=e.element;o.style&&n(e.options.cssProps,function(e,t){o.style[y(o.style,t)]=i?e:""})}var K,Z=["","webkit","Moz","MS","ms","o"],J=a.createElement("div"),Q="function",ee=Math.round,te=Math.abs,ie=Date.now;K="function"!=typeof Object.assign?function(e){if(e===_||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;it.threshold&&n&t.direction},attrTest:function(e){return j.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=F(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),i(W,j,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ze]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),i($,N,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distancet.time;if(this._input=e,!o||!i||e.eventType&(ce|pe)&&!n)this.reset();else if(e.eventType&ue)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&ce)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&ce?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ie(),this.manager.emit(this.options.event,this._input)))}}),i(U,j,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ze]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),i(Y,j,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:be|we,pointers:1},getTouchAction:function(){return H.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(be|we)?t=e.overallVelocity:i&be?t=e.overallVelocityX:i&we&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&te(t)>this.options.velocity&&e.eventType&ce},emit:function(e){var t=F(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),i(G,N,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ne]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance"+e+":":e+":",o}},{key:"_makeDropdown",value:function(e,t,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==t&&-1!==e.indexOf(t)&&(n=e.indexOf(t));for(var s=0;svar options = "+JSON.stringify(e,null,2)+""}},{key:"getOptions",value:function(){for(var e={},t=0;tn.distance?console.log('%cUnknown option detected: "'+e+'" in '+c.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+c.printLocation(n.path,n.closestMatch,""),l):o.distance<=8?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+o.closestMatch+'"?'+c.printLocation(o.path,e),l):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+c.print(Object.keys(t))+c.printLocation(i,e),l),h=!0}},{key:"findInOptions",value:function(e,t,i){var o=!(arguments.length<=3||void 0===arguments[3])&&arguments[3],n=1e9,s="",r=[],a=e.toLowerCase(),h=void 0;for(var l in t){var d=void 0;if(void 0!==t[l].__type__&&!0===o){var u=c.findInOptions(e,t[l],p.copyAndExtendArray(i,l));n>u.distance&&(s=u.closestMatch,r=u.path,n=u.distance,h=u.indexMatch)}else-1!==l.toLowerCase().indexOf(a)&&(h=l),(d=c.levenshteinDistance(e,l))this.start&&nthis.end?(o=this.start,n=this.end):(o+=(i=n-o-h)/2,n-=i/2))}var l=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(e,t){return o.conversion(this.start,this.end,e,t)},o.conversion=function(e,t,i,o){return void 0===o&&(o=0),0!=i&&t-e!=0?{offset:e,scale:i/(t-e-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(e){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(e)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(e){if(this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var t=this.options.direction;c(t);var i="horizontal"==t?e.deltaX:e.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start;o-=y.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);var n="horizontal"==t?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var s=i/n*o;else s=-i/n*o;var r=this.props.touch.start+s,a=this.props.touch.end+s,h=y.snapAwayFromHidden(this.body.hiddenDates,r,this.previousDelta-i,!0),l=y.snapAwayFromHidden(this.body.hiddenDates,a,this.previousDelta-i,!0);if(h!=r||l!=a)return this.deltaDifference+=i,this.props.touch.start=h,this.props.touch.end=l,void this._onDrag(e);this.previousDelta=i,this._applyRange(r,a);var d=new Date(this.start),u=new Date(this.end);this.body.emitter.emit("rangechange",{start:d,end:u,byUser:!0})}},o.prototype._onDragEnd=function(e){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(e){if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(e)&&(!this.options.zoomKey||e[this.options.zoomKey])){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),t){var i;i=t<0?1-t/5:1/(1+t/5);var o=this.getPointer({x:e.clientX,y:e.clientY},this.body.dom.center),n=this._pointerToDate(o);this.zoom(i,n,t)}e.preventDefault()}},o.prototype._onTouch=function(e){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(e){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(e.center,this.body.dom.center));var t=1/(e.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=y.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=y.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*t,a=i+s+(this.props.touch.end-(i+s))*t;this.startToFront=1-t<=0,this.endToFront=t-1<=0;var h=y.snapAwayFromHidden(this.body.hiddenDates,r,1-t,!0),l=y.snapAwayFromHidden(this.body.hiddenDates,a,t-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-e.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(e){var t=e.center?e.center.x:e.clientX;if(this.options.rtl)var i=t-v.getAbsoluteLeft(this.body.dom.centerContainer);else i=v.getAbsoluteRight(this.body.dom.centerContainer)-t;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(e){var t,i=this.options.direction;if(c(i),"horizontal"==i)return this.body.util.toTime(e.x).valueOf();var o=this.body.domProps.center.height;return t=this.conversion(o),e.y/t.scale+t.offset},o.prototype.getPointer=function(e,t){return this.options.rtl?{x:v.getAbsoluteRight(t)-e.x,y:e.y-v.getAbsoluteTop(t)}:{x:e.x-v.getAbsoluteLeft(t),y:e.y-v.getAbsoluteTop(t)}},o.prototype.zoom=function(e,t,i){null==t&&(t=(this.start+this.end)/2);var o=y.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=y.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,t),s=o-n,r=t-n+(this.start-(t-n))*e,a=t+s+(this.end-(t+s))*e;this.startToFront=!(0=t[o].start&&t[n].end<=t[o].end?t[n].remove=!0:t[n].start>=t[o].start&&t[n].start<=t[o].end?(t[o].end=t[n].end,t[n].remove=!0):t[n].end>=t[o].start&&t[n].end<=t[o].end&&(t[o].start=t[n].start,t[n].remove=!0));for(o=0;o=i.start&&a=t.start&&hthis.props.centerContainer.height;this.hammer.get("pan").set({direction:p?f.DIRECTION_ALL:f.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});if(t){if(this.redrawCount<5)return void this.body.emitter.emit("_change");console.log("WARNING: infinite loop in redraw?")}else this.redrawCount=0;this.initialDrawDone=!0,this.body.emitter.emit("changed")}},o.prototype.repaint=function(){throw new Error("Function repaint is deprecated. Use redraw instead.")},o.prototype.setCurrentTime=function(e){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");this.currentTime.setCurrentTime(e)},o.prototype.getCurrentTime=function(){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");return this.currentTime.getCurrentTime()},o.prototype._toTime=function(e){return g.toTime(this,e,this.props.center.width)},o.prototype._toGlobalTime=function(e){return g.toTime(this,e,this.props.root.width)},o.prototype._toScreen=function(e){return g.toScreen(this,e,this.props.center.width)},o.prototype._toGlobalScreen=function(e){return g.toScreen(this,e,this.props.root.width)},o.prototype._initAutoResize=function(){1==this.options.autoResize?this._startAutoResize():this._stopAutoResize()},o.prototype._startAutoResize=function(){var e=this;this._stopAutoResize(),this._onResize=function(){return 1!=e.options.autoResize?void e._stopAutoResize():void(e.dom.root&&(e.dom.root.offsetWidth==e.props.lastWidth&&e.dom.root.offsetHeight==e.props.lastHeight||(e.props.lastWidth=e.dom.root.offsetWidth,e.props.lastHeight=e.dom.root.offsetHeight,e.body.emitter.emit("_change"))))},m.addEventListener(window,"resize",this._onResize),e.dom.root&&(e.props.lastWidth=e.dom.root.offsetWidth,e.props.lastHeight=e.dom.root.offsetHeight),this.watchTimer=setInterval(this._onResize,1e3)},o.prototype._stopAutoResize=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0),this._onResize&&(m.removeEventListener(window,"resize",this._onResize),this._onResize=null)},o.prototype._onTouch=function(e){this.touch.allowDragging=!0,this.touch.initialScrollTop=this.props.scrollTop},o.prototype._onPinch=function(e){this.touch.allowDragging=!1},o.prototype._onDrag=function(e){if(this.touch.allowDragging){var t=e.deltaY,i=this._getScrollTop();this._setScrollTop(this.touch.initialScrollTop+t)!=i&&this.emit("verticalDrag")}},o.prototype._setScrollTop=function(e){return this.props.scrollTop=e,this._updateScrollTop(),this.props.scrollTop},o.prototype._updateScrollTop=function(){var e=Math.min(this.props.centerContainer.height-this.props.center.height,0);return e!=this.props.scrollTopMin&&("top"!=this.options.orientation.item&&(this.props.scrollTop+=e-this.props.scrollTopMin),this.props.scrollTopMin=e),0t&&o.push(a.id):a.lefti&&o.push(a.id)}return o},u.prototype._deselect=function(e){for(var t=this.selection,i=0,o=t.length;i=s.min&&l<=s.max)||this.options.multiselectPerGroup&&n!=this.itemsData.get(a.id).group||a instanceof m||i.push(a.id)}}else{var d=i.indexOf(t.id);-1==d?i.push(t.id):i.splice(d,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:e})}}},u._getItemRange=function(e){var t=null,i=null;return e.forEach(function(e){(null==i||e.startt)&&(t=e.end):(null==t||e.start>t)&&(t=e.start)}),{min:i,max:t}},u.prototype.itemFromTarget=function(e){for(var t=e.target;t;){if(t.hasOwnProperty("timeline-item"))return t["timeline-item"];t=t.parentNode}return null},u.prototype.groupFromTarget=function(e){for(var t=e.center?e.center.y:e.clientY,i=0;ie.axis){var s=o-e.axis;n-=s,p.forEach(i,function(e){e.top-=s})}t=n+e.item.vertical/2}else t=0;return Math.max(t,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var e=this.dom.label;e.parentNode&&e.parentNode.removeChild(e);var t=this.dom.foreground;t.parentNode&&t.parentNode.removeChild(t);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(e){if((this.items[e.id]=e).setParent(this),void 0!==e.data.subgroup&&(void 0===this.subgroups[e.data.subgroup]&&(this.subgroups[e.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[e.data.subgroup].items.push(e)),this.orderSubgroups(),-1==this.visibleItems.indexOf(e)){var t=this.itemSet.body.range;this._checkIfVisible(e,this.visibleItems,t)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var e=[];if("string"==typeof this.subgroupOrderer){for(var t in this.subgroups)e.push({subgroup:t,sortField:this.subgroups[t].items[0].data[this.subgroupOrderer]});e.sort(function(e,t){return e.sortField-t.sortField})}else if("function"==typeof this.subgroupOrderer){for(var t in this.subgroups)e.push(this.subgroups[t].items[0].data);e.sort(this.subgroupOrderer)}if(0l}),1==this.checkRangedItems)for(this.checkRangedItems=!1,n=0;nl})}for(n=0;nt.right&&e.top-i.vertical+.001t.top:e.left-i.horizontal+.001t.left&&e.top-i.vertical+.001t.top}},function(e,t,i){function o(e,t,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,e){if(null==e.start)throw new Error('Property "start" missing in item '+e.id);if(null==e.end)throw new Error('Property "end" missing in item '+e.id)}n.call(this,e,t,i)}var n=(i(20),i(39));(o.prototype=new n(null,null,null)).baseClassName="vis-item vis-range",o.prototype.isVisible=function(e){return this.data.starte.start},o.prototype.redraw=function(){var e=this.dom;if(e||(this.dom={},(e=this.dom).box=document.createElement("div"),e.frame=document.createElement("div"),e.frame.className="vis-item-overflow",e.box.appendChild(e.frame),e.content=document.createElement("div"),e.content.className="vis-item-content",e.frame.appendChild(e.content),(e.box["timeline-item"]=this).dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!e.box.parentNode){var t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(e.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||!0===this.editable)&&!1!==this.editable,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");e.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(e.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintDeleteButton(e.box),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var e=this.dom.box;e.parentNode&&e.parentNode.removeChild(e),this.displayed=!1}},o.prototype.repositionX=function(e){var t,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==e&&!0!==e||(n<-o&&(n=-o),2*oe.start-t&&this.data.starte.start-t&&this.data.starte.start},o.prototype.redraw=function(){var e=this.dom;if(e||(this.dom={},(e=this.dom).box=document.createElement("div"),e.frame=document.createElement("div"),e.frame.className="vis-item-overflow",e.box.appendChild(e.frame),e.content=document.createElement("div"),e.content.className="vis-item-content",e.frame.appendChild(e.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!e.box.parentNode){var t=this.parent.dom.background;if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(e.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");e.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(e.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=s.prototype.show,o.prototype.hide=s.prototype.hide,o.prototype.repositionX=s.prototype.repositionX,o.prototype.repositionY=function(e){var t,i="top"===this.options.orientation.item;if(this.dom.content.style.top=i?"":"0",this.dom.content.style.bottom=i?"0":"",void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,s=n[o].index;if(1==i){t=this.parent.subgroups[o].height+e.item.vertical,t+=0==s?e.axis-.5*e.item.vertical:0;var r=this.parent.top;for(var a in n)n.hasOwnProperty(a)&&1==n[a].visible&&n[a].indexs&&(r+=l)}t=this.parent.subgroups[o].height+e.item.vertical,this.dom.box.style.top=this.parent.height-h+r+"px",this.dom.box.style.bottom=""}}else this.parent instanceof d?(t=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=i?"0":"",this.dom.box.style.bottom=i?"":"0"):(t=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=t+"px"},e.exports=o},function(e,t,i){function o(e,t){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:k.FORMAT,moment:r,timeAxis:null},this.options=x.extend({},this.defaultOptions),this.body=e,this._create(),this.setOptions(t)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},x=i(1),s=i(31),k=i(35),S=i(32),r=i(2);(o.prototype=new s).setOptions=function(e){e&&(x.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,e),x.selectiveDeepExtend(["format"],this.options,e),"orientation"in e&&("string"==typeof e.orientation?this.options.orientation.axis=e.orientation:"object"===n(e.orientation)&&"axis"in e.orientation&&(this.options.orientation.axis=e.orientation.axis)),"locale"in e&&("function"==typeof r.locale?r.locale(e.locale):r.lang(e.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var e=this.props,t=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=t.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;e.minorLabelHeight=s?e.minorCharHeight:0,e.majorLabelHeight=r?e.majorCharHeight:0,e.height=e.minorLabelHeight+e.majorLabelHeight,e.width=t.offsetWidth,e.minorLineHeight=this.body.domProps.root.height-e.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),e.minorLineWidth=1,e.majorLineHeight=e.minorLineHeight+e.majorLabelHeight,e.majorLineWidth=1;var a=t.nextSibling,h=i.nextSibling;return t.parentNode&&t.parentNode.removeChild(t),i.parentNode&&i.parentNode.removeChild(i),t.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(t,a):o.appendChild(t),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var e=this.options.orientation.axis,t=x.convert(this.body.range.start,"Number"),i=x.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-S.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var s=new k(new Date(t),new Date(i),n,this.body.hiddenDates);s.setMoment(this.options.moment),this.options.format&&s.setFormat(this.options.format),this.options.timeAxis&&s.setScale(this.options.timeAxis),this.step=s;var r=this.dom;r.redundant.lines=r.lines,r.redundant.majorTexts=r.majorTexts,r.redundant.minorTexts=r.minorTexts,r.lines=[],r.majorTexts=[],r.minorTexts=[];var a,h,l,d,u,c,p,f=0,m=void 0,g=0;for(s.start(),a=s.getCurrent(),l=this.body.util.toScreen(a);s.hasNext()&&g<1e3;){g++,d=s.isMajor(),p=s.getClassName(),c=s.getLabelMinor(),a,h=l,s.next(),a=s.getCurrent(),s.isMajor();var v=.4*f<=(f=(l=this.body.util.toScreen(a))-h);if(this.options.showMinorLabels&&v){var y=this._repaintMinorText(h,c,e,p);y.style.width=f+"px"}d&&this.options.showMajorLabels?(0e[a].x){r=t[h],s=0==h?r:t[h-1],i=h;break}}void 0===r&&(s=t[t.length-1],r=t[t.length-1]),o=r.x-s.x,n=r.y-s.y,e[a].y=0==o?e[a].orginalY+r.y:e[a].orginalY+n/o*(e[a].x-s.x)+s.y}},o.prototype._getRelevantData=function(e,t,i,o){var n,s,r,a;if(0this.width-a&&!0===this.options.visible?(this.width=this.maxLabelSize+a,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+a),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},o.prototype.convertValue=function(e){return this.scale.convertValue(e)},o.prototype.screenToValue=function(e){return this.scale.screenToValue(e)},o.prototype._redrawLabel=function(e,t,i,o,n){var s=h.getDOMElement("div",this.DOMelements.labels,this.dom.frame);s.className=o,s.innerHTML=t,"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=e-.5*n+this.options.labelOffsetY+"px",t+="";var r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSizeh.magnitudefactor*h.minorSteps[h.minorStepIdx]*.5?t+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:t};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=l(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=l(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(e){this.majorCharHeight=e},i.prototype.setHeight=function(e){this.containerHeight=e},i.prototype.determineScale=function(){var e=this._end-this._start;this.scale=this.containerHeight/e;var t=this.majorCharHeight/this.scale,i=0o+1e-5)r(),l=!1;else{if(!this.autoScaleStart&&this._startt.x?1:-1})):this.itemsData=[]},o.prototype.getItems=function(){return this.itemsData},o.prototype.setZeroPosition=function(e){this.zeroPosition=e},o.prototype.setOptions=function(e){if(void 0!==e){s.selectiveDeepExtend(["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"],this.options,e),"function"==typeof e.drawPoints&&(e.drawPoints={onRender:e.drawPoints}),s.mergeOptions(this.options,e,"interpolation"),s.mergeOptions(this.options,e,"drawPoints"),s.mergeOptions(this.options,e,"shaded"),e.interpolation&&"object"==n(e.interpolation)&&e.interpolation.parametrization&&("uniform"==e.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==e.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},o.prototype.update=function(e){this.group=e,this.content=e.content||"graph",this.className=e.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===e.visible||e.visible,this.style=e.style,this.setOptions(e.options)},o.prototype.getLegend=function(e,t,i,o,n){null!=i&&null!=i||(i={svg:document.createElementNS("http://www.w3.org/2000/svg","svg"),svgElements:{},options:this.options,groups:[this]});switch(null!=o&&null!=o||(o=0),null!=n&&null!=n||(n=.5*t),this.options.style){case"line":a.drawIcon(this,o,n,e,t,i);break;case"points":case"point":h.drawIcon(this,o,n,e,t,i);break;case"bar":r.drawIcon(this,o,n,e,t,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},o.prototype.getYRange=function(e){for(var t=e[0].y,i=e[0].y,o=0;oe[o].y?e[o].y:t,i=it[s].screen_y?t[s].screen_y:o,n=ne[r].accumulatedNegative?e[r].accumulatedNegative:o)>e[r].accumulatedPositive?e[r].accumulatedPositive:o,n=(n=n")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var e=Object.keys(this.groups);e.sort(function(e,t){return ee.left&&this.shape.tope.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}}],[{key:"parseOptions",value:function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];if(_.selectiveNotDeepExtend(["color","font","fixed","shadow"],e,t,i),_.mergeOptions(e,t,"shadow",i,o),void 0!==t.color&&null!==t.color){var n=_.parseColor(t.color);_.fillIfDefined(e.color,n)}else!0===i&&null===t.color&&(e.color=_.bridgeObject(o.color));void 0!==t.fixed&&null!==t.fixed&&("boolean"==typeof t.fixed?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(void 0!==t.fixed.x&&"boolean"==typeof t.fixed.x&&(e.fixed.x=t.fixed.x),void 0!==t.fixed.y&&"boolean"==typeof t.fixed.y&&(e.fixed.y=t.fixed.y))),void 0!==t.font&&null!==t.font?r.default.parseOptions(e.font,t):!0===i&&null===t.font&&(e.font=_.bridgeObject(o.font)),void 0!==t.scaling&&_.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)}}]),s}();t.default=s},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var m=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=function(){function o(e,t){for(var i=0;i=this.nodeOptions.scaling.label.maxVisible&&(s=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var a=this.size.yLine,h=this._getColor(r),l=m(h,2),d=l[0],u=l[1],c=this._setAlignment(e,i,a,n),p=m(c,2);i=p[0],a=p[1],e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+s+"px "+this.fontOptions.face,e.fillStyle=d,this.isEdgeLabel||"left"!==this.fontOptions.align?e.textAlign="center":(e.textAlign=this.fontOptions.align,i-=.5*this.size.width),0this.imageObj.height?(i=this.imageObj.width/this.imageObj.height,e=2*this.options.size*i||this.imageObj.width,t=2*this.options.size||this.imageObj.height):(i=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,e=2*this.options.size,t=2*this.options.size*i):(e=this.imageObj.width,t=this.imageObj.height),this.width=e,this.height=t,this.radius=.5*this.width)}},{key:"_drawRawCircle",value:function(e,t,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,h),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.circle(t,i,s),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),0i.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(e,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=this.from.x,i=this.from.y,o=this.to.x,n=this.to.y,s=e.left,r=e.top;return this.edgeType.getDistanceToEdge(t,i,o,n,s,r)<10}return!1}},{key:"_rotateForLabelAlignment",value:function(e){var t=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(t,i);(o<-1&&i<0||0Math.abs(t)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*e,n=this.to.x+r*e):(o=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6],a=d(r,2),h=a[0],l=a[1];return this._getDistanceToBezierEdge(e,t,i,o,n,s,h,l)}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=d(t,2),o=i[0],n=i[1],s=e,r=[];return r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3),{x:r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,y:r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y}}}]),o}();t.default=a},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var o,n=function(){function o(e,t){for(var i=0;io.shape.height?(t=o.x+.5*o.shape.width,i=o.y-n):(t=o.x+n,i=o.y-.5*o.shape.height),[t,i,n]}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=0,l=this.options.selfReferenceSize,d=void 0,u=void 0,c=void 0,p=.5*(s+r);s<=r&&h<10&&(p=.5*(s+r),d=this._pointOnCircle(o,n,l,p),u=Math.atan2(e.y-d.y,e.x-d.x),c=e.distanceToBorder(t,u)-Math.sqrt(Math.pow(d.x-e.x,2)+Math.pow(d.y-e.y,2)),!(Math.abs(c)<.05));)0n&&this.labelModule.size.tops?0:a}},{key:"_getDistanceToLine",value:function(e,t,i,o,n,s){var r=i-e,a=o-t,h=((n-e)*r+(s-t)*a)/(r*r+a*a);1=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s):this.from.ythis.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s)),"discrete"===o&&(e=nMath.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n):this.from.ythis.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n)),"discrete"===o&&(t=sMath.abs(this.from.y-this.to.y)&&(e=this.from.x=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s,e=this.to.xthis.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s,e=this.to.x>e?this.to.x:e):this.from.ythis.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s,e=this.to.x>e?this.to.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.ythis.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n,t=this.to.yt?0t?0this.thetaInversed?this._calculateForces(n,i,o,t,e):4===e.childrenCount?(this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)):e.children.data.id!=t.id&&this._calculateForces(n,i,o,t,e)}}},{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(t=e=.1),this.overlapAvoidanceFactor<1&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(e,3),r=t*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(e,t){for(var i=void 0,o=t.length,n=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,h=1;ht.x?e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NW"):this._placeInRegion(e,t,"SW"):e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NE"):this._placeInRegion(e,t,"SE")}},{key:"_placeInRegion",value:function(e,t,i){switch(e.children[i].childrenCount){case 0:e.children[i].children.data=t,e.children[i].childrenCount=1,this._updateBranchMass(e.children[i],t);break;case 1:e.children[i].children.data.x===t.x&&e.children[i].children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(e.children[i]),this._placeInTree(e.children[i],t));break;case 4:this._placeInTree(e.children[i],t)}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY,s=e.range.minY+r;break;case"NE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY,s=e.range.minY+r;break;case"SW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY+r,s=e.range.maxY;break;case"SE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY+r,s=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){void 0===i&&(i="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),o}();t.default=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function o(e,t){for(var i=0;i=e&&i.push(n.id)}for(var s=0;so?r.x:o,n=r.ys?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]||arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[e])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0!==this.body.nodes[e].containedNodes){var o=this.body.nodes[e],n=o.containedNodes,s=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},a={x:o.x,y:o.y};for(var h in n)if(n.hasOwnProperty(h)){var l=this.body.nodes[h];r[h]={x:l.x,y:l.y}}var d=t.releaseFunction(a,r);for(var u in n)if(n.hasOwnProperty(u)){var c=this.body.nodes[u];void 0!==d[u]&&(c.x=void 0===d[u].x?o.x:d[u].x,c.y=void 0===d[u].y?o.y:d[u].y)}}else for(var p in n)if(n.hasOwnProperty(p)){var f=this.body.nodes[p];!1===(f=n[p]).options.fixed.x&&(f.x=o.x),!1===f.options.fixed.y&&(f.y=o.y)}for(var m in n)if(n.hasOwnProperty(m)){var g=this.body.nodes[m];g.vx=o.vx,g.vy=o.vy,g.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[m]}for(var v=[],y=0;yo&&(o=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i;var r=(t/=i)-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return o(t=e[i[a]]).shape.boundingBox.left&&(s=t.shape.boundingBox.left),rt.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n(t=e[i[a]]).x&&(s=t.x),rt.y&&(o=t.y),n.5*this.body.nodeIndices.length)return void this.fit(e,!1);i=u.default.getRange(this.body.nodes,e.nodes),o=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,o*=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600)}else{this.body.emitter.emit("_resizeNodes"),i=u.default.getRange(this.body.nodes,e.nodes);var r=1.1*Math.abs(i.maxX-i.minX),a=1.1*Math.abs(i.maxY-i.minY),h=this.canvas.frame.canvas.clientWidth/r,l=this.canvas.frame.canvas.clientHeight/a;o=h<=l?h:l}1o&&(s=o-t-this.padding),sn&&(r=n-i-this.padding),rk.options.hierarchical.nodeSpacing){var h={};h[e.id]=!0;var l={};l[t.id]=!0,C(e,h),C(t,l);var d=(i=t,o=b(e.id),n=b(i.id),Math.min(o,n)),u=M(h,d),c=D(u,4),p=(c[0],c[1]),f=(c[2],c[3],M(l,d)),m=D(f,4),g=m[0],v=(m[1],m[2]);if((m[3],Math.abs(p-g))>k.options.hierarchical.nodeSpacing){var y=p-g+k.options.hierarchical.nodeSpacing;y<-v+k.options.hierarchical.nodeSpacing&&(y=-v+k.options.hierarchical.nodeSpacing),y<0&&(k._shiftBlock(t.id,y),(S=!0)===s&&k._centerParent(t))}}},h=function(e,l){for(var t=l.id,i=l.edges,o=k.hierarchicalLevels[l.id],s=k.options.hierarchical.levelSeparation*k.options.hierarchical.levelSeparation,r={},n=[],a=0;an.hierarchicalLevels[e.id]){var i=e.id,o=t.id;void 0===n.hierarchicalChildrenReference[i]&&(n.hierarchicalChildrenReference[i]=[]),n.hierarchicalChildrenReference[i].push(o),void 0===n.hierarchicalParentReference[o]&&(n.hierarchicalParentReference[o]=[]),n.hierarchicalParentReference[o].push(i)}})}},{key:"_crawlNetwork",value:function(){var s=this,r=arguments.length<=0||void 0===arguments[0]?function(){}:arguments[0],e=arguments[1],a={},t=0,i=function e(t,i){if(void 0===a[t.id]){void 0===s.hierarchicalTrees[t.id]&&(s.hierarchicalTrees[t.id]=i,s.treeIndex=Math.max(i,s.treeIndex)),a[t.id]=!0;for(var o=void 0,n=0;n"===D||"--"===D;){var i,o=D;u();var n=f(e);if(n)i=n;else{if(E!=k.IDENTIFIER)throw v("Identifier or subgraph expected");l(e,{id:i=D}),u()}a(e,d(e,t,i,o,g())),t=i}}function g(){for(var e=null;"["===D;){for(u(),e={};""!==D&&"]"!=D;){if(E!=k.IDENTIFIER)throw v("Attribute name expected");var t=D;if(u(),"="!=D)throw v("Equal sign = expected");if(u(),E!=k.IDENTIFIER)throw v("Attribute value expected");r(e,t,D),u(),","==D&&u()}if("]"!=D)throw v("Bracket ] expected");u()}return e}function v(e){return new SyntaxError(e+', got "'+y(D,30)+'" (char '+C+")")}function y(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function b(e,t,i){for(var o=t.split("."),n=o.pop(),s=e,r=0;r":!0,"--":!0},O="",C=0,M="",D="",E=k.NULL,T=/[a-zA-Z_0-9.:#]/;t.parseDOT=i,t.DOTToGraph=function(e){var t=i(e),r={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:String(e.label||e.id)};h(t,w(e.attr,_)),t.image&&(t.shape="image"),r.nodes.push(t)}),t.edges){var a=function(e){var t={from:e.from,to:e.to};return h(t,w(e.attr,x)),t.arrows="->"===e.type?"to":void 0,t};t.edges.forEach(function(n){var e,t,i,o,s;e=n.from instanceof Object?n.from.nodes:{id:n.from},t=n.to instanceof Object?n.to.nodes:{id:n.to},n.from instanceof Object&&n.from.edges&&n.from.edges.forEach(function(e){var t=a(e);r.edges.push(t)}),i=e,o=t,s=function(e,t){var i=d(r,e.id,t.id,n.type,n.attr),o=a(i);r.edges.push(o)},Array.isArray(i)?i.forEach(function(t){Array.isArray(o)?o.forEach(function(e){s(t,e)}):s(t,o)}):Array.isArray(o)?o.forEach(function(e){s(i,e)}):s(i,o),n.to instanceof Object&&n.to.edges&&n.to.edges.forEach(function(e){var t=a(e);r.edges.push(t)})})}return t.attr&&(r.options=t.attr),r}},function(e,t){t.parseGephi=function(e,t){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==t&&(void 0!==t.fixed&&(n.nodes.fixed=t.fixed),void 0!==t.parseColor&&(n.nodes.parseColor=t.parseColor),void 0!==t.inheritColor&&(n.edges.inheritColor=t.inheritColor));for(var s=e.edges,r=e.nodes,a=0;a=1970?t.unix():null}),i.bind("blur",function(){var e=moment(n.$viewValue,s);e&&e.isValid()&&e.year()>=1970?n.$modelValue=e.unix():n.$modelValue=moment().unix(),n.$setViewValue(moment(1e3*n.$modelValue).format(s)),n.$render()}),t.watch&&t.$watch(function(){return n.$modelValue},function(e){e&&(r.value=moment(1e3*e).format(s),i.datetimepicker("destroy"),i.datetimepicker(r))})})}}}]),angular.module("datetimePicker").directive("hourPicker",function(){return{restrict:"A",require:"^ngModel",link:function(e,t){t.datetimepicker({datepicker:!1,format:"G"})}}}),angular.module("datetimePicker").directive("datetimePickerText",["$timeout",function(e){return{restrict:"A",require:"^ngModel",link:function(t,i,o,n){var s="DD/MM/YYYY HH:mm";e(function(){n.$formatters.unshift(function(e){return e?moment(1e3*e).format(s):""}),n.$parsers.unshift(function(e){if(""==e)return null;var t=moment(e,s);return t&&t.isValid()&&t.year()>=1970?t.unix():null}),n.$modelValue&&(n.$setViewValue(moment(1e3*n.$modelValue).format(s)),n.$render()),i.bind("blur",function(){var e=moment(n.$viewValue,s);e&&e.isValid()&&e.year()>=1970?n.$modelValue=e.unix():n.$modelValue=moment().unix(),n.$setViewValue(moment(1e3*n.$modelValue).format(s)),n.$render()})})}}}]),angular.module("styleguideComponentsModule",[]),angular.module("styleguideComponentsModule").directive("box",function(){return{restrict:"E",transclude:!0,replace:!0,scope:{heading:"@"},template:'

{{ heading }}

'}}),angular.module("styleguideComponentsModule").directive("buttonIconLink",function(){return{restrict:"E",replace:!0,scope:{buttonLink:"@",icon:"@",click:"&"},template:''}}),angular.module("styleguideComponentsModule").directive("contentList",function(){return{restrict:"E",replace:!0,scope:{items:"=",max:"=",filter:"=",order:"="},template:'
'}}),angular.module("styleguideComponentsModule").directive("contentListItem",function(){return{restrict:"E",replace:!0,scope:{item:"="},template:'
{{ item.title }}{{ item.title }}{{ item.text }}
'}}),angular.module("styleguideComponentsModule").directive("panelMenu",["$document",function(e){return{restrict:"E",replace:!0,scope:{items:"="},link:function(e){function t(i){e.$apply(function(){e.menuOpen=!1,document.removeEventListener("click",t)})}e.menuOpen=!1,e.toggleMenu=function(){e.menuOpen=!e.menuOpen,setTimeout(function(){e.menuOpen&&document.addEventListener("click",t)})}},template:'
more_vert
'}}]),angular.module("styleguideComponentsModule").directive("popup",function(){return{restrict:"E",replace:!0,transclude:!0,template:''}}),angular.module("ikShared").factory("mediaFactory",["$http","$q","busService",function(e,t,i){"use strict";var o={};return o.getAllMedia=function(){var i=t.defer();return e.get("/api/media").success(function(e){i.resolve(e)}).error(function(){i.reject()}),i.promise},o.searchMedia=function(e){var o=t.defer();e.type="Os2Display\\MediaBundle\\Entity\\Media";var n=CryptoJS.MD5(JSON.stringify(e)).toString();return e.callbacks={hits:"searchService.hits-"+n,error:"searchService.error-"+n},i.$once(e.callbacks.hits,function(e,t){o.resolve(t)}),i.$once(e.callbacks.error,function(e,t){i.$emit("log.error",{cause:t,msg:"Kunne ikke hente søgeresultater."}),o.reject(t)}),i.$emit("searchService.request",e),o.promise},o.loadMediaBulk=function(i){var o=t.defer(),n="?ids[]="+i.join("&ids[]=");return e.get("/api/bulk/media/api"+n).success(function(e,t){o.resolve(e)}).error(function(e,t){o.reject(t)}),o.promise},o.getMedia=function(i){var o=t.defer();return e.get("/api/media/"+i).success(function(e){o.resolve(e)}).error(function(e,t){o.reject(t)}),o.promise},o.updateMedia=function(i){var o=t.defer();return e.put("/api/media/"+i.id,i).success(function(e){o.resolve(e)}).error(function(e,t){o.reject(t)}),o.promise},o.deleteMedia=function(i){var o=t.defer();return e["delete"]("/api/media/"+i).success(function(e){o.resolve(e)}).error(function(e,t){o.reject(t)}),o.promise},o}]),angular.module("ikShared").factory("templateFactory",["$q","$http",function(e,t){"use strict";var i={},o=null,n=null;return i.getSlideTemplates=function(){var i=e.defer();return null!==o?i.resolve(o):t.get("/api/templates/slides/all").success(function(e){o=e,i.resolve(o)}).error(function(e,t){i.reject(t)}),i.promise},i.getSlideTemplate=function(t){var o=e.defer();return i.getSlideTemplates().then(function(e){for(var i=0;i link[href='"+e.css_path+"']")||$("head").append('')}))}),i.play=function(){angular.isDefined(i.interval)?(e.cancel(i.interval),i.interval=void 0,i.buttonState="play"):(i.slideIndex=(i.slideIndex+1)%i.ikChannel.slides.length,i.interval=e(function(){i.slideIndex=(i.slideIndex+1)%i.ikChannel.slides.length},2e3),i.buttonState="pause")},i.redirectToChannel=function(){i.ikClickable&&t.path("/shared-channel/"+i.ikChannel.unique_id+"/"+i.ikSharingIndex)},i.$on("$destroy",function(){angular.isDefined(i.interval)&&(e.cancel(i.interval),i.interval=void 0)})},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/sharedChannel/shared-channel-template.html?"+window.config.version}}]),angular.module("ikShared").directive("sharedChannelOverview",["sharedChannelFactory","userService","$timeout","busService",function(e,t,i,o){"use strict";return{restrict:"E",scope:{ikSelectedChannels:"=",ikOverlay:"@",ikSingleSlide:"="},link:function(i){i.index={},i.loading=!1,i.pickIndexDialog=!1,i.displaySharingOption=window.config.sharingService.enabled,i.sharingIndexes=[],e.getSharingIndexes().then(function(e){i.sharingIndexes=e}),i.sort={created_at:"desc"},i.currentUser=t.getCurrentUser(),i.showFromUser=localStorage.getItem("overview.shared_channel.search_filter_default")?localStorage.getItem("overview.shared_channel.search_filter_default"):"all",i.pager={size:6,page:0},i.hits=0,i.channels=[];var n={fields:"title",text:"",filter:{bool:{must:{}}},sort:{ +created_at:{order:"desc"}},pager:i.pager};i.updateSearch=function(){return n.text=i.search_text,angular.isUndefined(i.index.index)?void o.$emit("log.info",{msg:"Du skal vælge et indeks først.",timeout:3e3}):(i.loading=!0,void e.searchChannels(n,i.index.index).then(function(e){i.loading=!1,i.hits=e.hits,i.channels=e.results},function(e){o.$emit("log.error",{cause:e,msg:"Hentning af søgeresultater fejlede."}),i.loading=!1}))},i.$on("channel-deleted",function(){i.updateSearch()}),i.channelSelected=function(e){if(!i.ikSelectedChannels)return!1;var t=!1;return i.ikSelectedChannels.forEach(function(i){i.unique_id==e.unique_id&&(t=!0)}),t},i.clickSharedChannel=function(e,t){i.$emit("channelSharingOverview.clickSharedChannel",e,t)},i.setIndex=function(e){i.index=e,i.pickIndexDialog=!1,i.updateSearch()},i.setUser=function(e){localStorage.setItem("overview.shared_channel.search_filter_default",e),i.showFromUser!==e&&(i.showFromUser=e,i.updateSearch())},i.setSearchFilters=function(){if(delete n.filter,"all"!==i.showFromUser&&(n.filter={bool:{must:[]}}),"all"!==i.showFromUser){var e={};e.term={user:i.currentUser.id},n.filter.bool.must.push(e)}i.updateSearch()},i.setSort=function(e,t){void 0!==i.sort[e]&&i.sort[e]===t||(i.sort={},i.sort[e]=t,n.sort={},n.sort[e]={order:t},i.updateSearch())}},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/sharedChannelOverview/shared-channel-overview.html?"+window.config.version}}]),angular.module("ikShared").directive("ikChannel",["$interval","$location",function(e,t){"use strict";return{restrict:"E",scope:{ikWidth:"@",ikChannel:"=",ikSingleSlide:"=",ikClickable:"="},link:function(i,o,n){i.slideIndex=0,i.playText="",n.$observe("ikChannel",function(e){e&&(i.ikChannel.slides.length<=0?i.templateURL="bundles/os2displayadmin/apps/ikShared/elements/channel/empty.html?"+window.config.version:(i.templateURL="bundles/os2displayadmin/apps/ikShared/elements/channel/non-empty.html?"+window.config.version,i.buttonState="play"))}),i.play=function(){angular.isDefined(i.interval)?(e.cancel(i.interval),i.interval=void 0,i.buttonState="play"):(i.slideIndex=(i.slideIndex+1)%i.ikChannel.slides.length,i.interval=e(function(){i.slideIndex=(i.slideIndex+1)%i.ikChannel.slides.length},2e3),i.buttonState="pause")},i.redirectToChannel=function(){i.ikClickable&&t.path("/channel/"+i.ikChannel.id)},i.$on("$destroy",function(){angular.isDefined(i.interval)&&(e.cancel(i.interval),i.interval=void 0)})},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/channel/channel-template.html?"+window.config.version}}]),angular.module("ikShared").directive("ikChannelOverview",["busService",function(e){"use strict";return{restrict:"E",scope:{ikSelectedChannels:"=",ikOverlay:"@"},controller:["$scope","$filter","$controller","channelFactory",function(t,i,o,n){o("BaseSearchController",{$scope:t}),t.showFromUser=localStorage.getItem("overview.channel.search_filter_default")?localStorage.getItem("overview.channel.search_filter_default"):"all",t.displaySharingOption=window.config.sharingService.enabled,t.channels=[];var s=null;t.updateSearch=function(){t.baseQuery.text=t.search_text,t.loading=!0,n.searchChannels(t.baseQuery).then(function(i){t.hits=i.hits;for(var o=[],r=0;re.publish_to)return!1;if(e.hasOwnProperty("schedule_repeat")&&e.schedule_repeat){if(!(e.hasOwnProperty("schedule_repeat_days")&&e.schedule_repeat_days.length>0))return!1;for(var n=0;ne.schedule_repeat_to)return!1}}return!0},t.getScheduledText=function(e){var t="";if(e.hasOwnProperty("publish_from")&&(t=t+"Udgivet fra: "+i("date")(1e3*e.publish_from,"dd/MM/yyyy HH:mm")+".
"),e.hasOwnProperty("publish_to")&&(t=t+"Udgivet til: "+i("date")(1e3*e.publish_to,"dd/MM/yyyy HH:mm")+".
"),e.hasOwnProperty("schedule_repeat")&&e.schedule_repeat){t+="Vises disse dage:
";for(var o=0;o"),e.hasOwnProperty("schedule_repeat_to")&&(t=t+"Til: "+e.schedule_repeat_to+":00
")}return t},t.setSearchFilters()}],templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/channelOverview/channel-overview-directive.html?"+window.config.version}}]),angular.module("ikShared").directive("ikPager",[function(){"use strict";return{restrict:"E",replace:!0,scope:!0,controller:["$scope",function(e){e.pagesFrom=0,e.pagesPerLine=10,e.changePage=function(t){e.pager.page=t,e.updateSearch(),e.pagesFrom=Math.floor(e.pager.page/e.pagesPerLine)*e.pagesPerLine},e.prevPage=function(){e.pager.page>0&&(e.pager.page--,e.updateSearch()),e.pager.page0&&(e.pager.page=e.pager.page-e.pagesPerLine,e.pager.page<0&&(e.pager.page=0),e.updateSearch()),e.pagesFrom=Math.floor(e.pager.page/e.pagesPerLine)*e.pagesPerLine},e.nextLine=function(){e.pager.page=e.pager.max&&(e.pager.page=e.pager.max-1),e.updateSearch()),e.pagesFrom=Math.floor(e.pager.page/e.pagesPerLine)*e.pagesPerLine},e.$watch("hits",function(t){var i=[];if(e.pager.max=0,t>e.pager.size){e.pager.max=Math.ceil(t/e.pager.size);for(var o=0;oDate.now())},t.slideOverviewClickSlide=function(e){t.$emit("slideOverview.clickSlide",e)},t.slideScheduledNow=function(e){if(!e.published)return!1;var t=new Date;return t=parseInt(t.getTime()/1e3),!(e.hasOwnProperty("schedule_from")&&te.schedule_to)},t.getScheduledText=function(e){var t="";return e.published||(t+="Ikke udgivet!
"),e.hasOwnProperty("schedule_from")&&(t=t+"Udgivet fra: "+i("date")(1e3*e.schedule_from,"dd/MM/yyyy HH:mm")+".
"),e.hasOwnProperty("schedule_to")&&(t=t+"Udgivet til: "+i("date")(1e3*e.schedule_to,"dd/MM/yyyy HH:mm")+"."),t},t.setSearchFilters()}],templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/slideOverview/slide-overview-directive.html?"+window.config.version}}]),angular.module("ikShared").directive("ikSlide",["slideFactory","templateFactory",function(e,t){"use strict";return{restrict:"E",scope:{ikWidth:"@",ikSlide:"="},link:function(e,i,o){e.templateURL="bundles/os2displayadmin/apps/ikShared/elements/slide/slide-loading.html?"+window.config.version,o.$observe("ikSlide",function(i){i&&("image"===e.ikSlide.media_type?e.ikSlide.media.length>0?e.ikSlide.currentImage=e.ikSlide.media[0].urls.default_landscape_small:e.ikSlide.currentImage="":e.ikSlide.media.length>0&&e.ikSlide.media[0].provider_metadata.length>0&&e.ikSlide.media[0].provider_metadata[0].thumbnails&&e.ikSlide.media[0].provider_metadata[0].thumbnails.length>0?e.ikSlide.currentImage=e.ikSlide.media[0].provider_metadata[0].thumbnails[1].reference:e.ikSlide.currentImage="",void 0!==e.ikSlide.logo&&null!==e.ikSlide.logo?e.ikSlide.currentLogo=e.ikSlide.logo.urls.default_landscape:e.ikSlide.currentLogo="",t.getSlideTemplate(e.ikSlide.template).then(function(t){t.enabled?(e.template=t,e.templateURL=e.template.paths.preview,e.theStyle={width:""+e.ikWidth+"px",height:""+parseFloat(e.template.ideal_dimensions.height*parseFloat(e.ikWidth/e.template.ideal_dimensions.width))+"px"},e.ikSlide.options.fontsize&&(e.theStyle.fontsize=""+parseFloat(e.ikSlide.options.fontsize*parseFloat(e.ikWidth/e.template.ideal_dimensions.width))+"px")):e.slideError='"'+t.name+'" skabelonen er ikke aktiveret.'},function(){e.slideError='"'+e.ikSlide.template+'" skabelonen blev ikke fundet.'}))})},template:'
{{ slideError }}
'}}]),angular.module("ikShared").directive("ikSlideEditable",["templateFactory","$timeout",function(e,t){"use strict";return{restrict:"E",scope:{ikWidth:"@",ikSlide:"="},link:function(i,o,n){i.templateURL="bundles/os2displayadmin/apps/ikShared/elements/slide/slide-loading.html?"+window.config.version,i.$watch("ikSlide",function(e,n){e&&("image"===i.ikSlide.media_type?(i.ikSlide.currentImage="",i.ikSlide.media.length>0&&(i.ikSlide.currentImage=i.ikSlide.media[0].urls.default_landscape)):"video"===i.ikSlide.media_type&&(i.ikSlide.currentVideo={mp4:"",ogg:"",webm:""},i.ikSlide.media.length>0&&void 0!==i.ikSlide.media[0]&&(i.ikSlide.media.length>0&&i.ikSlide.media[0].provider_metadata.length>0&&(i.ikSlide.currentVideo={},i.ikSlide.media[0].provider_metadata[0]&&(i.ikSlide.currentVideo.mp4=i.ikSlide.media[0].provider_metadata[0].reference),i.ikSlide.media[0].provider_metadata[1]&&(i.ikSlide.currentVideo.ogg=i.ikSlide.media[0].provider_metadata[1].reference),i.ikSlide.media[0].provider_metadata[2]&&(i.ikSlide.currentVideo.webm=i.ikSlide.media[0].provider_metadata[2].reference)),t(function(){o.find("#videoPlayer").load()},1e3))),i.ikSlide.currentLogo="",void 0!==i.ikSlide.logo&&null!==i.ikSlide.logo&&(i.ikSlide.currentLogo=i.ikSlide.logo.urls.default_landscape),i.theStyle&&(i.theStyle.fontsize=""+parseFloat(i.ikSlide.options.fontsize*parseFloat(i.ikWidth/i.template.ideal_dimensions.width))+"px"))},!0),i.$watch("ikSlide.template",function(){i.slideError=null,e.getSlideTemplate(i.ikSlide.template).then(function(e){t(function(){e.enabled?(i.template=e,i.slideTemplateURL=i.template.paths.edit,i.templateURL="bundles/os2displayadmin/apps/ikShared/elements/slide/slide-edit.html?"+window.config.version,i.theStyle={width:""+i.ikWidth+"px",height:""+parseFloat(i.template.ideal_dimensions.height*parseFloat(i.ikWidth/i.template.ideal_dimensions.width))+"px",fontsize:""+parseFloat(i.ikSlide.options.fontsize*parseFloat(i.ikWidth/i.template.ideal_dimensions.width))+"px"}):i.slideError='"'+e.name+'" skabelonen er ikke aktiveret.'})},function(){i.slideError='"'+i.ikSlide.template+'" skabelonen blev ikke fundet.'})})},template:'
{{ slideError }}
'}}]),angular.module("ikShared").directive("ikSharedSlide",[function(){"use strict";return{restrict:"E",scope:{ikWidth:"@",ikSlide:"="},link:function(e,t,i){e.templateURL="bundles/os2displayadmin/apps/ikShared/elements/slide/slide-loading.html?"+window.config.version,i.$observe("ikSlide",function(t){t&&(e.ikSlide.media_thumbs&&e.ikSlide.media_thumbs.length>0&&(e.ikSlide.currentImage=e.ikSlide.media_thumbs[0]),e.ikSlide.currentLogo=e.ikSlide.logo,e.templateURL=e.ikSlide.preview_path,e.theStyle={width:""+e.ikWidth+"px",height:""+parseFloat(1080*parseFloat(e.ikWidth/1920))+"px"},e.ikSlide.options.fontsize&&(e.theStyle.fontsize=""+parseFloat(e.ikSlide.options.fontsize*parseFloat(e.ikWidth/1920))+"px"))})},template:'
'}}]),angular.module("ikShared").directive("ikScreenOverview",["busService",function(e){"use strict";return{restrict:"E",scope:{ikSelectedScreens:"=",ikOverlay:"@"},controller:["$scope","$filter","$controller","screenFactory","userService","busService",function(e,t,i,o,n,s){i("BaseSearchController",{$scope:e}),e.showFromUser=localStorage.getItem("overview.media.search_filter_default")?localStorage.getItem("overview.media.search_filter_default"):"all",e.screens=[];var r=null;e.updateSearch=function(){e.baseQuery.text=e.search_text,e.loading=!0,o.searchScreens(e.baseQuery).then(function(t){e.hits=t.hits;for(var i=[],n=0;n5?i.uploader.progress-5:i.uploader.progress},i.uploader.onAfterAddingFile=function(e){e.formData=[{title:"",logo:!1}],"logo"===i.ikUploadType&&(e.formData[0].logo=!0)},i.uploader.onAfterAddingAll=function(){i.currentStep++},i.uploader.onErrorItem=function(e,t,o){i.uploadErrors=!0,i.uploadInProgress=!1,i.clearQueue(),i.uploadErrorText="Der skete en fejl under upload af filer (fejlkode: "+o+")."},i.uploader.onCompleteAll=function(){i.uploadComplete=!0,i.uploadInProgress=!1},i.uploader.onSuccessItem=function(e,t){i.$emit("mediaUpload.uploadSuccess",{image:e,id:t[0],queue:i.uploader.queue})},i.hideError=function(){i.uploadErrorText=!1},i.$on("$destory",function(){n()})}],templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/mediaUpload/media-upload-directive.html?"+window.config.version}}]),angular.module("ikShared").directive("ikThumb",["$window",function(e){"use strict";var t={support:!(!e.FileReader||!e.CanvasRenderingContext2D),isFile:function(t){return angular.isObject(t)&&t instanceof e.File},isImage:function(e){var t="|"+e.type.slice(e.type.lastIndexOf("/")+1);return"|jpg|png|jpeg|bmp|gif|".indexOf(t)!==-1}};return{restrict:"A",template:"",link:function(e,i,o){function n(e){var t=new Image;t.onload=s,t.src=e.target.result}function s(){var e=r.width?r.width:this.width/this.height*r.height,t=r.height?r.height:this.height/this.width*r.width;a.attr({width:e,height:t}),a[0].getContext("2d").drawImage(this,0,0,e,t)}if(t.support){var r=e.$eval(o.ikThumb);if(t.isFile(r.file)&&t.isImage(r.file)){var a=i.find("canvas"),h=new FileReader;h.onload=n,h.readAsDataURL(r.file)}}}}}]),angular.module("ikShared").directive("autoGrow",function(){"use strict";return{restrict:"A",scope:{fontSize:"@"},link:function(e,t){var i=$(t),o=function(e){e.css("height","0px");var t=e.prop("scrollHeight"),i=e.css("min-height").replace("px","");e.css("height",Math.max(t,i)+"px")};t.bind("keyup",function(){o(i)}),e.$watch("fontSize",function(e){e&&o(i)}),setTimeout(function(){o(i)},100)}}}),angular.module("ikShared").directive("includeReplace",function(){"use strict";return{require:"ngInclude",restrict:"A",link:function(e,t){t.replaceWith(t.children())}}}),function(){"use strict";var e;e=angular.module("itkControlPanel",[]),e.directive("controlPanel",["busService",function(e){return{restrict:"E",scope:{template:"=",data:"=",screen:"=",display:"=",saveAction:"&",region:"=",options:"="},replace:!0,link:function(t){t.selectedTab=null,e.$emit("bodyService.addClass","is-screen"),t.getContent=function(){return t.template},t.clickTab=function(e){t.selectedTab=e},t.toggleChannelType=function(e){t.channelType=e},t.$on("$destroy",function(){document.getElementsByTagName("body")[0].style.overflow=""})},template:'
'}}])}.call(this),function(){"use strict";var e;e=angular.module("ngModal",[]),e.directive("modalDialog",[function(){return{restrict:"E",scope:{show:"=",onClose:"&?"},replace:!0,transclude:!0,link:function(e){e.hideModal=function(){e.show=!1},e.$watch("show",function(t,i){if(t&&!i?document.getElementsByTagName("body")[0].style.overflow="hidden":document.getElementsByTagName("body")[0].style.overflow="",!t&&i&&null!==e.onClose)return e.onClose()})},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/ngModal/ng-modal.html?"+window.config.version}}])}.call(this),angular.module("ikShared").directive("ikDisabledList",[function(){"use strict";return{restrict:"E",replace:!1,scope:{elements:"="},templateUrl:"bundles/os2displayadmin/apps/ikShared/elements/disabledList/disabled-list.html?"+window.config.version}}]),function(){"use strict";var e;e=angular.module("itkScreenTemplatePickerWidget",[]),e.directive("screenTemplatePickerWidget",["templateFactory","busService",function(e,t){return{restrict:"E",scope:{screen:"="},replace:!0,link:function(i){i.templates=[],e.getEnabledScreenTemplates().then(function(e){i.templates=e},function(e){t.$emit("log.error",{cause:e,msg:"Kunne ikke loade templates."})}),i.pickTemplate=function(e){i.screen.template=angular.copy(e)}},templateUrl:"bundles/os2displayadmin/apps/ikShared/widgets/screenTemplatePickerWidget/screenTemplatePickerWidget.html?"+window.config.version}}])}.call(this),function(){"use strict";var e;e=angular.module("itkTextWidget",[]),e.directive("textWidget",function(){return{restrict:"E",scope:{field:"=",placeholderText:"@"},replace:!0,template:''}})}.call(this),function(){"use strict";var e;e=angular.module("itkTextAreaWidget",[]),e.directive("textAreaWidget",function(){return{restrict:"E",scope:{field:"=",placeholderText:"@"},replace:!0,template:''}})}.call(this),function(){"use strict";var e;e=angular.module("itkNumberWidget",[]),e.directive("numberWidget",function(){return{restrict:"E",scope:{field:"=",placeholderText:"@"},replace:!0,template:''}})}.call(this),function(){"use strict";var e;e=angular.module("itkChannelPickerWidget",[]),e.directive("channelPickerWidget",["userService","channelFactory","busService",function(e,t,i){return{restrict:"E",replace:!0,templateUrl:"bundles/os2displayadmin/apps/ikShared/widgets/channelPickerWidget/channel-picker-widget.html?"+window.config.version,scope:{screen:"=",region:"="},link:function(o){o.sharingEnabled=window.config.sharingService.enabled,o.loading=!1,o.showFromUser="all",o.sort={created_at:"desc"},o.selectedGroup=null,o.currentUser=e.getCurrentUser();var n=i.$on("itkChannelPickerWidget.currentUserGroups",function(e,t){o.userGroups=t});e.getCurrentUserGroups("itkChannelPickerWidget.currentUserGroups"),o.pager={size:5,page:0},o.hits=0,o.channels=[],o.search={fields:"title",text:"",filter:{bool:{must:[]}},sort:{created_at:{order:"desc"}},pager:o.pager},o.updateSearch=function(){var e=angular.copy(o.search);e.text=o.search_text,null!==o.selectedGroup&&e.filter.bool.must.push({terms:{groups:[o.selectedGroup.id]}}),o.loading=!0,t.searchChannels(e).then(function(e){o.hits=e.hits;for(var n=[],s=0;s1?i.subMenuItems=o[e[1]]:i.subMenuItems=[]}};t.$on("$locationChangeSuccess",function(){i.url=e.url(),n()}),t.$emit("menuApp.requestSubMenuItems")}}}]),angular.module("messageApp").directive("messages",["busService","$timeout",function(e,t){"use strict";var i=window.config.itkLog;return{restrict:"E",templateUrl:"bundles/os2displayadmin/apps/messageApp/directive/messages.html?"+i.version,link:function(i){i.expanded=!1,i.messages={},e.$on("messages.add",function o(e,o){i.$apply(function(){var e=CryptoJS.MD5(JSON.stringify(o)).toString();o.hash=e,i.messages[e]=o,void 0!==o.timeout&&t(function(){i.close(o)},o.timeout)})}),e.$on("messages.clear",function(e,t){i.clear()}),i.toggleExpanded=function(){i.expanded=!i.expanded},i.close=function(e){delete i.messages[e.hash]},i.clear=function(){i.messages=[]}}}}]),angular.module("ikApp").config(["$sceDelegateProvider","$translateProvider",function(e,t){"use strict";t.useSanitizeValueStrategy("escape").useStaticFilesLoader({prefix:"bundles/os2displayadmin/apps/ikApp/translations/locale-",suffix:".json"}).preferredLanguage("da").fallbackLanguage("da").forceAsyncReload(!0),e.resourceUrlWhitelist(["self","**"])}]),angular.module("ikApp").config(["$routeProvider",function(e){"use strict";e.when("/",{redirectTo:"/channel-overview"}).when("/admin-sharing",{controller:"AdminSharingController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/adminSharing/admin-sharing.html?"+window.config.version}).when("/admin-templates",{controller:"AdminTemplatesController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/adminTemplates/admin-templates.html?"+window.config.version}).when("/channel-overview",{controller:"ChannelOverviewController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/channelOverview/channel-overview.html?"+window.config.version}).when("/slide-overview",{controller:"SlideOverviewController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/slideOverview/slide-overview.html?"+window.config.version}).when("/screen-overview",{templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/screenOverview/screen-overview.html?"+window.config.version}).when("/media-overview",{controller:"MediaOverviewController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/mediaOverview/media-overview.html?"+window.config.version}).when("/shared-channel-overview",{templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/sharedChannelOverview/shared-channel-overview.html?"+window.config.version}).when("/screen",{controller:"ScreenController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/screen/screen.html?"+window.config.version}).when("/screen/:id",{controller:"ScreenController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/screen/screen.html?"+window.config.version}).when("/slide",{controller:"SlideController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/slide/slide.html?"+window.config.version}).when("/slide/:id",{controller:"SlideController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/slide/slide.html?"+window.config.version}).when("/shared-channel/:id/:index",{controller:"SharedChannelController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/sharedChannel/shared-channel.html?"+window.config.version}).when("/channel",{controller:"ChannelController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/channel/channel.html?"+window.config.version}).when("/channel/:id",{controller:"ChannelController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/channel/channel.html?"+window.config.version}).when("/media/upload",{templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/mediaUpload/media-upload.html?"+window.config.version}).when("/media/:id",{controller:"MediaEditController",templateUrl:"bundles/os2displayadmin/apps/ikApp/pages/mediaEdit/media-edit.html?"+window.config.version})}]),angular.module("ikApp").filter("activeEvents",function(){"use strict";return function(e){if(!angular.isArray(e))return!1;for(var t=parseInt(Date.now()/1e3),i=[],o=0;o=t?i.push(n):n.from&&n.from>=t&&i.push(n)}return i}}),angular.module("ikApp").controller("ScreenController",["$scope","$controller","$location","$routeParams","$timeout","screenFactory","channelFactory","sharedChannelFactory","templateFactory","busService","userService",function(e,t,i,o,n,s,r,a,h,d,l){"use strict";function u(){o.id?null===o.id||void 0===o.id||""===o.id?i.path("/screen-overview"):s.getEditScreen(o.id).then(function(t){e.loading=!1,e.screen=t,e.screen.channel_screen_regions.forEach(function(e){e.shared_channel&&(e.shared_channel.content=JSON.parse(e.shared_channel.content),e.shared_channel.title=e.shared_channel.content.title,e.shared_channel.slides=e.shared_channel.content.slides)}),e.screen==={}&&i.path("/screen")},function(e){d.$emit("log.error",{cause:e,msg:"Skærmen med id: "+o.id+" blev ikke fundet"})}):(e.screen=s.emptyScreen(),h.getScreenTemplate("full-screen").then(function(t){e.screen.template=t,e.loading=!1},function(t){404===t&&h.getEnabledScreenTemplates().then(function(t){e.screen.template=angular.copy(t[0]),e.screen.orientation=t[0].orientation,e.loading=!1},function(e){d.$emit("log.error",{cause:e,msg:"Skabelonerne blev ikke loaded"})})}))}t("BaseEntityController",{$scope:e,entityType:"screen"}),e.loading=!0,e.sharingEnabled=window.config.sharingService.enabled,e.screen={},e.toolbarTemplate=null,e.display=!1,e.region=null,e.controlPanelData={userGroups:e.userGroups,baseUnavailableGroups:e.baseUnavailableGroups},e.$watch("userGroups",function(){e.controlPanelData.userGroups=e.userGroups}),e.$watch("baseUnavailableGroups",function(){e.controlPanelData.baseUnavailableGroups=e.baseUnavailableGroups}),u(),e.saveScreenAndClose=function(){e.displayToolbar=!1,e.region=null,s.saveScreen().then(function(e){d.$emit("log.info",{msg:"Skærmen ("+e.title+") er gemt",timeout:5e3}),n(function(){i.path("/screen-overview")},1e3)},function(e){d.$emit("log.error",{cause:e,msg:"Skærmen blev ikke gemt"})})},e.saveScreen=function(){e.displayToolbar=!1,e.region=null,s.saveScreen().then(function(e){d.$emit("log.info",{msg:"Skærmen ("+e.title+") er gemt",timeout:5e3})},function(e){d.$emit("log.error",{cause:e,msg:"Skærmen blev ikke gemt"})})},e.triggerTool=function(t){e.screen.template.tools.hasOwnProperty(t.name)?e.toolbarTemplate=e.screen.template.tools[t.name]:e.toolbarTemplate="bundles/os2displayadmin/apps/ikShared/toolbars/"+t.name+".html?"+window.config.version,e.region=t.region,e.displayToolbar=!0}}]),angular.module("ikApp").controller("SharedChannelController",["$scope","$location","$routeParams","$timeout","screenFactory","sharedChannelFactory","busService",function(e,t,i,o,n,s,r){"use strict";function a(t){e.step=t,e.templatePath="bundles/os2displayadmin/apps/ikApp/pages/sharedChannel/shared-channel-step"+e.step+".html?"+window.config.version}function h(){i.id&&i.index?s.getSharedChannel(i.id,i.index).then(function(i){e.channel=JSON.parse(i.content),e.channel==={}&&t.path("/channel-sharing-overview"),a(1)},function(e){r.$emit("log.error",{cause:e,msg:"Delt kanal kunne ikke hentes."})}):t.path("/channel-sharing-overview")}e.steps=1,e.step=1,e.channel={},e.channel.slides=[],e.status="edit",n.getScreens().then(function(t){e.screens=t},function(e){r.$emit("log.error",{cause:e,msg:"Kunne ikke hente skærme."})}),h(),e.submitStep=function(){t.path("/channel-sharing-overview")},e.goToStep=function(e){a(e)}}]),angular.module("ikApp").controller("AdminSharingController",["busService","sharedChannelFactory","$scope",function(e,t,i){"use strict";i.saving=!1,i.availableIndexes=[],t.getAvailableIndexes().then(function(e){e.forEach(function(e){"shared"===e.tag&&i.availableIndexes.push(e)})},function(t){e.$emit("log.error",{cause:t,msg:"Hentning af tilgængelige delingsindeks fejlede."})}),i.chosenIndexes=[],t.getSharingIndexes().then(function(e){i.chosenIndexes=e},function(t){e.$emit("log.error",{cause:t,msg:"Hentning af valgte delingsindeks fejlede."})}),i.save=function(){i.saving=!0,t.saveSharingIndexes(i.chosenIndexes).then(function(){e.$emit("log.info",{msg:"Delingsindeks gemt",timeout:3e3}),i.saving=!1},function(t){e.$emit("log.error",{cause:t,msg:"Delingsindeks blev ikke gemt."}),i.saving=!1})}}]),angular.module("ikApp").controller("AdminTemplatesController",["busService","templateFactory","$scope",function(e,t,i){"use strict";i.saving=!1,i.screenTemplates=[],i.slideTemplates=[],i.enabledScreenTemplates=[],i.enabledSlideTemplates=[],t.getScreenTemplates().then(function(e){i.screenTemplates=e;for(var t=[],o=0;oe.schedule_to)},e.getScheduledText=function(e){var t="";return e.published||(t+="Ikke udgivet!
"),e.hasOwnProperty("schedule_from")&&(t=t+"Udgivet fra: "+s("date")(1e3*e.schedule_from,"dd/MM/yyyy HH:mm")+".
"),e.hasOwnProperty("schedule_to")&&(t=t+"Udgivet til: "+s("date")(1e3*e.schedule_to,"dd/MM/yyyy HH:mm")+"."),t},e.goToStep=function(t){var i=1;e.validation.titleSet()&&(i+=3),t<=i&&l(t)},e.pushRight=function(t){t===e.channel.slides.length-1?p(e.channel.slides,t,0):p(e.channel.slides,t,t+1)},e.pushLeft=function(t){0===t?p(e.channel.slides,t,e.channel.slides.length-1):p(e.channel.slides,t,t-1)},e.handleDrop=function(t,i){t=parseInt(t.split("index-")[1]),i=parseInt(i.split("index-")[1]);var o=e.channel.slides.splice(t,1);e.channel.slides.splice(i,0,o[0])},e.sortSlides=function(t){var i=e.lastSortUsed===t;return e.lastSortUsed=t,"random"===t?void(e.channel.slides=f(e.channel.slides)):void(e.channel.slides=s("orderBy")(e.channel.slides,i?"-":""+t))}}]),angular.module("ikApp").controller("ChannelOverviewController",["$scope","sharedChannelFactory","channelFactory","busService",function(e,t,i,o){"use strict";e.shareDialogShow=!1,e.shareDialogChannel=null,window.config.sharingService.enabled&&(e.$on("ikChannelShare.clickShare",function(t,n){e.shareDialogShow=!0,e.shareDialogChannel=n,i.getChannel(n.id).then(function(t){e.shareDialogChannel=t,e.shareDialogChannel.sharing_indexes||(e.shareDialogChannel.sharing_indexes=[])},function(e){o.$emit("log.error",{cause:e,msg:"Hentning af kanal fejlede"})})}),e.sharingIndexes=[],t.getSharingIndexes().then(function(t){e.sharingIndexes=t},function(e){o.$emit("log.error",{cause:e,msg:"Hentning af delingsindeks fejlede."})}),e.saveSharingChannel=function(){i.channelShare(e.shareDialogChannel).then(function(){o.$emit("log.info",{msg:"Delingskonfiguration af kanal lykkedes.",timeout:3e3})},function(e){o.$emit("log.error",{cause:e,msg:"Deling af kanal fejlede."})})})}]),angular.module("ikApp").controller("MediaOverviewController",["$scope","$location",function(e,t){"use strict";e.$on("mediaOverview.selectMedia",function(e,i){t.path("/media/"+i.id)})}]),angular.module("ikApp").controller("MediaEditController",["$scope","$controller","$location","$routeParams","$timeout","mediaFactory","busService","userService",function(e,t,i,o,n,s,r,a){"use strict";t("BaseEntityController",{$scope:e,entityType:"media"}),e.loading=!0,s.getMedia(o.id).then(function(t){n(function(){e.media=t,e.media==={}&&i.path("/media-overview")})},function(e){r.$emit("log.error",{cause:e,msg:"Kunne ikke hente media med id: "+o.id}),i.path("/media-overview")}).then(function(){e.loading=!1}),e.updateMedia=function(){e.loading=!0,s.updateMedia(e.media).then(function(){n(function(){r.$emit("log.info",{msg:"Media opdateret.",timeout:3e3})})},function(e){r.$emit("log.error",{cause:e,msg:"Opdatering af media fejlede."})}).then(function(){e.loading=!1})},e["delete"]=function(){e.loading=!0,s.deleteMedia(e.media.id).then(function(){r.$emit("log.info",{msg:"Media slettet.",timeout:3e3}),n(function(){i.path("/media-overview")},500)},function(e){r.$emit("log.error",{cause:e,msg:"Sletning af media fejlede."})}).then(function(){e.loading=!1})},e.getContentType=function(e){if(!e)return"";var t=e.content_type.split("/");return t[0]},e.videoPath=function(e,t){var i="";return e.provider_metadata.forEach(function(e){e.format===t&&(i=e.reference),"thumbnail_landscape"===t&&e.thumbnails.forEach(function(e){"mp4_landscape"===e.label&&(i=e.reference)})}),i}}]),angular.module("ikApp").controller("SlideOverviewController",["$scope","$location",function(e,t){"use strict";e.$on("slideOverview.clickSlide",function(e,i){t.path("/slide/"+i.id)})}]),angular.module("ikApp").controller("SlideController",["$scope","$controller","$location","$routeParams","$timeout","slideFactory","templateFactory","channelFactory","busService","userService",function(e,t,i,o,n,s,r,a,h,d){"use strict";function l(t){e.step=t,e.templatePath="bundles/os2displayadmin/apps/ikApp/pages/slide/slide-step"+e.step+".html?"+window.config.version}function u(){o.id?null===o.id||void 0===o.id||""===o.id?i.path("/slide"):(s.clearCurrentSlide(),s.getEditSlide(o.id).then(function(t){e.slide=t,e.slide.status="edit-slide",e.slide==={}&&i.path("/slide"),l(3)},function(e){h.$emit("log.error",{cause:e,msg:"Kunne ikke hente slide med id: "+o.id}),i.path("/slide-overview")})):(e.slide=s.emptySlide(),e.slide.channels=[],l(1))}function c(t){return!!e.slide&&""!==e.slide[t]}t("BaseEntityController",{$scope:e,entityType:"slide"}),e.steps=6,e.slide={},e.templates=[],r.getEnabledSlideTemplates().then(function(t){for(var i in t)t.hasOwnProperty(i)&&e.templates.push(t[i])},function(e){h.$emit("log.error",{cause:e,msg:"Kunne ikke hente slide templates."})}),e.editor={channelOverviewEditor:!1,toggleChannelOverviewEditor:function(){h.$emit("bodyService.toggleClass","is-locked"),e.editor.channelOverviewEditor=!e.editor.channelOverviewEditor}},e.$on("channelOverview.clickChannel",function(t,i){e.toggleChannel(i)}),u(),e.submitStep=function(){e.step===e.steps?(e.disableSubmitButton=!0,""===e.slide.duration&&(e.slide.duration=15),s.saveSlide().then(function(){h.$emit("log.info",{msg:"Slide er gemt",timeout:3e3}),n(function(){i.path("/slide-overview")},1e3)},function(t){h.$emit("log.error",{cause:t,msg:"Kunne ikke gemme slide"}),e.disableSubmitButton=!1})):l(e.step+1)},e.validation={titleSet:function(){return c("title")},templateSet:function(){return c("template")}},e.goToStep=function(t){var i=1;e.validation.titleSet()&&(i++,e.validation.templateSet()&&(i+=4)),t<=i&&l(t)},e.selectTemplate=function(t){e.slide.template=t;var i=null;e.templates.forEach(function(e){e.id===t&&(i=e)}),null!==i&&(e.slide.slide_type=i.slide_type,e.slide.options||(e.slide.options={}),e.slide.orientation=i.orientation,angular.forEach(i.empty_options,function(t,i){void 0===e.slide.options[i]&&(e.slide.options[i]=angular.copy(t))}),""===e.slide.options.headline&&(e.slide.options.headline=e.slide.title),e.slide.media_type=i.media_type)},e.channelSelected=function(t){var i=!1;return e.slide.channels.forEach(function(e){t.id===e.id&&(i=!0)}),i},e.hasChannel=function(t){var i=!1;return e.slide.channels.forEach(function(e){t.id===e.id&&(i=!0)}),i},e.toggleChannel=function(t){var i=null;e.slide.channels.forEach(function(e,o){t.id===e.id&&(i=o)}),null!==i?e.slide.channels.splice(i,1):e.slide.channels.push(t)}}]),angular.module("ikApp").controller("SlideEditController",["$scope","slideFactory","busService","templateFactory","$compile","$templateRequest",function(e,t,i,o,n,s){"use strict";t.getEditSlide(null).then(function(t){e.slide=t,o.getSlideTemplate(t.template).then(function(t){e.template=t},function(e){i.$emit("log.error",{cause:e,msg:"Kunne ikke loade værktøjer til slidet."})})},function(e){i.$emit("log.error",{cause:e,msg:"Kunne ikke hente slide."})}),i.$emit("bodyService.removeClass","is-locked"),e.editor={editorOpen:!1,hideEditors:function(){i.$emit("bodyService.removeClass","is-locked"),e.editor.editorOpen=!1,e.selectedTool=null;var t=document.getElementById("slide-edit-tool");angular.element(t).html(n("")(e))}},e.openTool=function(t){i.$emit("bodyService.toggleClass","is-locked"),e.editor.editorOpen=!0,t.id||(t.id="base-editor"),e.selectedTool=t;var o=document.getElementById("slide-edit-tool"),s="
<"+t.id+' slide="slide" close="editor.hideEditors()" '+(t.template?'template="'+t.template+'"':"")+' tool="selectedTool">
";angular.element(o).html(n(s)(e))}}]),function(){"use strict";var e;e=angular.module("itkDateComponent",[]),e.directive("dateComponent",["$interval",function(e){return{restrict:"E",replace:!0,templateUrl:"bundles/os2displayadmin/apps/ikApp/shared/components/date/date.html?"+window.config.version,scope:{theme:"@"},link:function(t){t.thisDate=new Date;var i=e(function(){t.thisDate=new Date},6e4);t.$on("$destroy",function(){angular.isDefined(i)&&(e.cancel(i),i=void 0)})}}}])}.call(this),function(){"use strict";var e;e=angular.module("itkDigitalClockComponent",[]),e.directive("digitalClockComponent",["$interval",function(e){return{restrict:"E",replace:!0,templateUrl:"bundles/os2displayadmin/apps/ikApp/shared/components/digital-clock/digital-clock.html?"+window.config.version,scope:{},link:function(t){t.thisDate=new Date;var i=e(function(){t.thisDate=Date.now()},1e3);t.$on("$destroy",function(){angular.isDefined(i)&&(e.cancel(i),i=void 0)})}}}])}.call(this),!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vis=t():e.vis=t()}(this,function(){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){var o=i(1);o.extend(t,i(7)),o.extend(t,i(24)),o.extend(t,i(60))},function(e,t,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=i(2),s=i(6);t.isNumber=function(e){return e instanceof Number||"number"==typeof e},t.recursiveDOMDelete=function(e){if(e)for(;e.hasChildNodes()===!0;)t.recursiveDOMDelete(e.firstChild),e.removeChild(e.firstChild)},t.giveRange=function(e,t,i,o){if(t==e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)},t.isString=function(e){return e instanceof String||"string"==typeof e},t.isDate=function(e){if(e instanceof Date)return!0;if(t.isString(e)){var i=r.exec(e);if(i)return!0;if(!isNaN(Date.parse(e)))return!0}return!1},t.randomUUID=function(){return s.v4()},t.assignAllKeys=function(e,t){for(var i in e)e.hasOwnProperty(i)&&"object"!==o(e[i])&&(e[i]=t)},t.fillIfDefined=function(e,i){var n=!(arguments.length<=2||void 0===arguments[2])&&arguments[2];for(var s in e)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===e[s]||n!==!0?e[s]=i[s]:delete e[s]:"object"===o(e[s])&&t.fillIfDefined(e[s],i[s],n))},t.protoExtend=function(e,t){for(var i=1;ii;i++)if(e[i]!=t[i])return!1;return!0},t.convert=function(e,i){var o;if(void 0!==e){if(null===e)return null;if(!i)return e;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(e);case"number":case"Number":return Number(e.valueOf());case"string":case"String":return String(e);case"Date":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(n.isMoment(e))return new Date(e.valueOf());if(t.isString(e))return o=r.exec(e),o?new Date(Number(o[1])):n(e).toDate();throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"Moment":if(t.isNumber(e))return n(e);if(e instanceof Date)return n(e.valueOf());if(n.isMoment(e))return n(e);if(t.isString(e))return o=r.exec(e),n(o?Number(o[1]):e);throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"ISODate":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(n.isMoment(e))return e.toDate().toISOString();if(t.isString(e))return o=r.exec(e),o?new Date(Number(o[1])).toISOString():new Date(e).toISOString();throw new Error("Cannot convert object of type "+t.getType(e)+" to type ISODate");case"ASPDate":if(t.isNumber(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(t.isString(e)){o=r.exec(e);var s;return s=o?new Date(Number(o[1])).valueOf():new Date(e).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+t.getType(e)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var r=/^\/?Date\((\-?\d+)/i;t.getType=function(e){var t="undefined"==typeof e?"undefined":o(e);return"object"==t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"==t?"Number":"boolean"==t?"Boolean":"string"==t?"String":void 0===t?"undefined":t},t.copyAndExtendArray=function(e,t){for(var i=[],o=0;oi;i++)t(e[i],i,e);else for(i in e)e.hasOwnProperty(i)&&t(e[i],i,e)},t.toArray=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(e[i]);return t},t.updateProperty=function(e,t,i){return e[t]!==i&&(e[t]=i,!0)},t.throttle=function(e,t){var i=null,o=!1;return function n(){i?o=!0:(o=!1,e(),i=setTimeout(function(){i=null,o&&n()},t))}},t.addEventListener=function(e,t,i,o){e.addEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.addEventListener(t,i,o)):e.attachEvent("on"+t,i)},t.removeEventListener=function(e,t,i,o){e.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.removeEventListener(t,i,o)):e.detachEvent("on"+t,i)},t.preventDefault=function(e){e||(e=window.event),e.preventDefault?e.preventDefault():e.returnValue=!1},t.getTarget=function(e){e||(e=window.event);var t;return e.target?t=e.target:e.srcElement&&(t=e.srcElement),void 0!=t.nodeType&&3==t.nodeType&&(t=t.parentNode),t},t.hasParent=function(e,t){for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1},t.option={},t.option.asBoolean=function(e,t){return"function"==typeof e&&(e=e()),null!=e?0!=e:t||null},t.option.asNumber=function(e,t){return"function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null},t.option.asString=function(e,t){return"function"==typeof e&&(e=e()),null!=e?String(e):t||null},t.option.asSize=function(e,i){return"function"==typeof e&&(e=e()),t.isString(e)?e:t.isNumber(e)?e+"px":i||null},t.option.asElement=function(e,t){return"function"==typeof e&&(e=e()),e||t||null},t.hexToRGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,i,o){return t+t+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},t.overrideOpacity=function(e,i){if(-1!=e.indexOf("rgba"))return e;if(-1!=e.indexOf("rgb")){var o=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=t.hexToRGB(e);return null==o?e:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},t.RGBToHex=function(e,t,i){ +return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},t.parseColor=function(e){var i;if(t.isString(e)===!0){if(t.isValidRGB(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",").map(function(e){return parseInt(e)});e=t.RGBToHex(o[0],o[1],o[2])}if(t.isValidHex(e)===!0){var n=t.hexToHSV(e),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=t.HSVToHex(r.h,r.s,r.v),h=t.HSVToHex(s.h,s.s,s.v);i={background:e,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else i={},i.background=e.background||void 0,i.border=e.border||void 0,t.isString(e.highlight)?i.highlight={border:e.highlight,background:e.highlight}:(i.highlight={},i.highlight.background=e.highlight&&e.highlight.background||void 0,i.highlight.border=e.highlight&&e.highlight.border||void 0),t.isString(e.hover)?i.hover={border:e.hover,background:e.hover}:(i.hover={},i.hover.background=e.hover&&e.hover.background||void 0,i.hover.border=e.hover&&e.hover.border||void 0);return i},t.RGBToHSV=function(e,t,i){e/=255,t/=255,i/=255;var o=Math.min(e,Math.min(t,i)),n=Math.max(e,Math.max(t,i));if(o==n)return{h:0,s:0,v:o};var s=e==o?t-i:i==o?e-t:i-e,r=e==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var i=e.split(":"),o=i[0].trim(),n=i[1].trim();t[o]=n}}),t},join:function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join("; ")}};t.addCssText=function(e,i){var o=a.split(e.style.cssText),n=a.split(i),s=t.extend(o,n);e.style.cssText=a.join(s)},t.removeCssText=function(e,t){var i=a.split(e.style.cssText),o=a.split(t);for(var n in o)o.hasOwnProperty(n)&&delete i[n];e.style.cssText=a.join(i)},t.HSVToRGB=function(e,t,i){var o,n,s,r=Math.floor(6*e),a=6*e-r,h=i*(1-t),d=i*(1-a*t),l=i*(1-(1-a)*t);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},t.HSVToHex=function(e,i,o){var n=t.HSVToRGB(e,i,o);return t.RGBToHex(n.r,n.g,n.b)},t.hexToHSV=function(e){var i=t.hexToRGB(e);return t.RGBToHSV(i.r,i.g,i.b)},t.isValidHex=function(e){var t=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return t},t.isValidRGB=function(e){e=e.replace(" ","");var t=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e);return t},t.isValidRGBA=function(e){e=e.replace(" ","");var t=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(e);return t},t.selectiveBridgeObject=function(e,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s0&&t(o,e[n-1])<0;n--)e[n]=e[n-1];e[n]=o}return e},t.mergeOptions=function(e,t,i){var o=(!(arguments.length<=3||void 0===arguments[3])&&arguments[3],arguments.length<=4||void 0===arguments[4]?{}:arguments[4]);if(null===t[i])e[i]=Object.create(o[i]);else if(void 0!==t[i])if("boolean"==typeof t[i])e[i].enabled=t[i];else{void 0===t[i].enabled&&(e[i].enabled=!0);for(var n in t[i])t[i].hasOwnProperty(n)&&(e[i][n]=t[i][n])}},t.binarySearchCustom=function(e,t,i,o){for(var n=1e4,s=0,r=0,a=e.length-1;a>=r&&n>s;){var h=Math.floor((r+a)/2),d=e[h],l=void 0===o?d[i]:d[i][o],u=t(l);if(0==u)return h;-1==u?r=h+1:a=h-1,s++}return-1},t.binarySearchValue=function(e,t,i,o,n){for(var s,r,a,h,d=1e4,l=0,u=0,c=e.length-1,n=void 0!=n?n:function(e,t){return e==t?0:t>e?-1:1};c>=u&&d>l;){if(h=Math.floor(.5*(c+u)),s=e[Math.max(0,h-1)][i],r=e[h][i],a=e[Math.min(e.length-1,h+1)][i],0==n(r,t))return h;if(n(s,t)<0&&n(r,t)>0)return"before"==o?Math.max(0,h-1):h;if(n(r,t)<0&&n(a,t)>0)return"before"==o?h:Math.min(e.length-1,h+1);n(r,t)<0?u=h+1:c=h-1,l++}return-1},t.easingFunctions={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return.5>e?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return.5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return.5>e?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return.5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e}}},function(e,t,i){e.exports="undefined"!=typeof window&&window.moment||i(3)},function(e,t,i){(function(e){!function(t,i){e.exports=i()}(this,function(){function t(){return ro.apply(null,arguments)}function i(e){ro=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var i,o=[];for(i=0;i0)for(i in ho)o=ho[i],n=t[o],p(n)||(e[o]=n);return e}function m(e){f(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),lo===!1&&(lo=!0,t.updateOffset(this),lo=!1)}function g(e){return e instanceof m||null!=e&&null!=e._isAMomentObject}function v(e){return 0>e?Math.ceil(e):Math.floor(e)}function y(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=v(t)),i}function b(e,t,i){var o,n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(o=0;n>o;o++)(i&&e[o]!==t[o]||!i&&y(e[o])!==y(t[o]))&&r++;return r+s}function w(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function _(e,i){var o=!0;return a(function(){return null!=t.deprecationHandler&&t.deprecationHandler(null,e),o&&(w(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),o=!1),i.apply(this,arguments)},i)}function x(e,i){null!=t.deprecationHandler&&t.deprecationHandler(e,i),uo[e]||(w(i),uo[e]=!0)}function k(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e){var t,i;for(i in e)t=e[i],k(t)?this[i]=t:this["_"+i]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(e,t){var i,o=a({},e);for(i in t)r(t,i)&&(S(e[i])&&S(t[i])?(o[i]={},a(o[i],e[i]),a(o[i],t[i])):null!=t[i]?o[i]=t[i]:delete o[i]);return o}function M(e){null!=e&&this.set(e)}function D(e){return e?e.toLowerCase().replace("_","-"):e}function E(e){for(var t,i,o,n,s=0;s0;){if(o=T(n.slice(0,t).join("-")))return o;if(i&&i.length>=t&&b(n,i,!0)>=t-1)break;t--}s++}return null}function T(t){var i=null;if(!mo[t]&&"undefined"!=typeof e&&e&&e.exports)try{i=po._abbr,!function(){var e=new Error('Cannot find module "./locale"');throw e.code="MODULE_NOT_FOUND",e}(),P(i)}catch(o){}return mo[t]}function P(e,t){var i;return e&&(i=p(t)?R(e):I(e,t),i&&(po=i)),po._abbr}function I(e,t){return null!==t?(t.abbr=e,null!=mo[e]?(x("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),t=C(mo[e]._config,t)):null!=t.parentLocale&&(null!=mo[t.parentLocale]?t=C(mo[t.parentLocale]._config,t):x("parentLocaleUndefined","specified parentLocale is not defined yet")),mo[e]=new M(t),P(e),mo[e]):(delete mo[e],null)}function A(e,t){if(null!=t){var i;null!=mo[e]&&(t=C(mo[e]._config,t)),i=new M(t),i.parentLocale=mo[e],mo[e]=i,P(e)}else null!=mo[e]&&(null!=mo[e].parentLocale?mo[e]=mo[e].parentLocale:null!=mo[e]&&delete mo[e]);return mo[e]}function R(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return po;if(!o(e)){if(t=T(e))return t;e=[e]}return E(e)}function L(){return co(mo)}function N(e,t){var i=e.toLowerCase();go[i]=go[i+"s"]=go[t]=e}function z(e){return"string"==typeof e?go[e]||go[e.toLowerCase()]:void 0}function F(e){var t,i,o={};for(i in e)r(e,i)&&(t=z(i),t&&(o[t]=e[i]));return o}function B(e,i){return function(o){return null!=o?(H(this,e,o),t.updateOffset(this,i),this):j(this,e)}}function j(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function H(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function W(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(e=z(e),k(this[e]))return this[e](t);return this}function $(e,t,i){var o=""+Math.abs(e),n=t-o.length,s=e>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function U(e,t,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),e&&(wo[e]=n),t&&(wo[t[0]]=function(){return $(n.apply(this,arguments),t[1],t[2])}),i&&(wo[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function Y(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function G(e){var t,i,o=e.match(vo);for(t=0,i=o.length;i>t;t++)wo[o[t]]?o[t]=wo[o[t]]:o[t]=Y(o[t]);return function(t){var n,s="";for(n=0;i>n;n++)s+=o[n]instanceof Function?o[n].call(t,e):o[n];return s}}function V(e,t){return e.isValid()?(t=q(t,e.localeData()),bo[t]=bo[t]||G(t),bo[t](e)):e.localeData().invalidDate()}function q(e,t){function i(e){return t.longDateFormat(e)||e}var o=5;for(yo.lastIndex=0;o>=0&&yo.test(e);)e=e.replace(yo,i),yo.lastIndex=0,o-=1;return e}function X(e,t,i){Fo[e]=k(t)?t:function(e,o){return e&&i?i:t}}function K(e,t){return r(Fo,e)?Fo[e](t._strict,t._locale):new RegExp(Z(e))}function Z(e){return J(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,o,n){return t||i||o||n}))}function J(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(e,t){var i,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,i){i[t]=y(e)}),i=0;io;++o)s=h([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?(n=fo.call(this._shortMonthsParse,r),-1!==n?n:null):(n=fo.call(this._longMonthsParse,r),-1!==n?n:null):"MMM"===t?(n=fo.call(this._shortMonthsParse,r),-1!==n?n:(n=fo.call(this._longMonthsParse,r),-1!==n?n:null)):(n=fo.call(this._longMonthsParse,r),-1!==n?n:(n=fo.call(this._shortMonthsParse,r),-1!==n?n:null))}function re(e,t,i){var o,n,s;if(this._monthsParseExact)return se.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;12>o;o++){if(n=h([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(i&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!i&&this._monthsParse[o].test(e))return o}}function ae(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=y(t);else if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return i=Math.min(e.date(),ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function he(e){return null!=e?(ae(this,e),t.updateOffset(this,!0),this):j(this,"Month")}function de(){return ie(this.year(),this.month())}function le(e){return this._monthsParseExact?(r(this,"_monthsRegex")||ce.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function ue(e){return this._monthsParseExact?(r(this,"_monthsRegex")||ce.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ce(){function e(e,t){return t.length-e.length}var t,i,o=[],n=[],s=[];for(t=0;12>t;t++)i=h([2e3,t]),o.push(this.monthsShort(i,"")),n.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(o.sort(e),n.sort(e),s.sort(e),t=0;12>t;t++)o[t]=J(o[t]),n[t]=J(n[t]),s[t]=J(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function pe(e){var t,i=e._a;return i&&-2===l(e).overflow&&(t=i[Ho]<0||i[Ho]>11?Ho:i[Wo]<1||i[Wo]>ie(i[jo],i[Ho])?Wo:i[$o]<0||i[$o]>24||24===i[$o]&&(0!==i[Uo]||0!==i[Yo]||0!==i[Go])?$o:i[Uo]<0||i[Uo]>59?Uo:i[Yo]<0||i[Yo]>59?Yo:i[Go]<0||i[Go]>999?Go:-1,l(e)._overflowDayOfYear&&(jo>t||t>Wo)&&(t=Wo),l(e)._overflowWeeks&&-1===t&&(t=Vo),l(e)._overflowWeekday&&-1===t&&(t=qo),l(e).overflow=t),e}function fe(e){var t,i,o,n,s,r,a=e._i,h=en.exec(a)||tn.exec(a);if(h){for(l(e).iso=!0,t=0,i=nn.length;i>t;t++)if(nn[t][1].exec(h[1])){n=nn[t][0],o=nn[t][2]!==!1;break}if(null==n)return void(e._isValid=!1);if(h[3]){for(t=0,i=sn.length;i>t;t++)if(sn[t][1].exec(h[3])){s=(h[2]||" ")+sn[t][0];break}if(null==s)return void(e._isValid=!1)}if(!o&&null!=s)return void(e._isValid=!1);if(h[4]){if(!on.exec(h[4]))return void(e._isValid=!1);r="Z"}e._f=n+(s||"")+(r||""),Ee(e)}else e._isValid=!1}function me(e){var i=rn.exec(e._i);return null!==i?void(e._d=new Date((+i[1]))):(fe(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function ge(e,t,i,o,n,s,r){var a=new Date(e,t,i,o,n,s,r);return 100>e&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function ve(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function ye(e){return be(e)?366:365}function be(e){return e%4===0&&e%100!==0||e%400===0}function we(){return be(this.year())}function _e(e,t,i){var o=7+t-i,n=(7+ve(e,0,o).getUTCDay()-t)%7;return-n+o-1}function xe(e,t,i,o,n){var s,r,a=(7+i-o)%7,h=_e(e,o,n),d=1+7*(t-1)+a+h;return 0>=d?(s=e-1,r=ye(s)+d):d>ye(e)?(s=e+1,r=d-ye(e)):(s=e,r=d),{year:s,dayOfYear:r}}function ke(e,t,i){var o,n,s=_e(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return 1>r?(n=e.year()-1,o=r+Se(n,t,i)):r>Se(e.year(),t,i)?(o=r-Se(e.year(),t,i),n=e.year()+1):(n=e.year(),o=r),{week:o,year:n}}function Se(e,t,i){var o=_e(e,t,i),n=_e(e+1,t,i);return(ye(e)-o+n)/7}function Oe(e,t,i){return null!=e?e:null!=t?t:i}function Ce(e){var i=new Date(t.now());return e._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function Me(e){var t,i,o,n,s=[];if(!e._d){for(o=Ce(e),e._w&&null==e._a[Wo]&&null==e._a[Ho]&&De(e),e._dayOfYear&&(n=Oe(e._a[jo],o[jo]),e._dayOfYear>ye(n)&&(l(e)._overflowDayOfYear=!0),i=ve(n,0,e._dayOfYear),e._a[Ho]=i.getUTCMonth(),e._a[Wo]=i.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=s[t]=o[t];for(;7>t;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[$o]&&0===e._a[Uo]&&0===e._a[Yo]&&0===e._a[Go]&&(e._nextDay=!0,e._a[$o]=0),e._d=(e._useUTC?ve:ge).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[$o]=24)}}function De(e){var t,i,o,n,s,r,a,h;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(s=1,r=4,i=Oe(t.GG,e._a[jo],ke(ze(),1,4).year),o=Oe(t.W,1),n=Oe(t.E,1),(1>n||n>7)&&(h=!0)):(s=e._locale._week.dow,r=e._locale._week.doy,i=Oe(t.gg,e._a[jo],ke(ze(),s,r).year),o=Oe(t.w,1),null!=t.d?(n=t.d,(0>n||n>6)&&(h=!0)):null!=t.e?(n=t.e+s,(t.e<0||t.e>6)&&(h=!0)):n=s),1>o||o>Se(i,s,r)?l(e)._overflowWeeks=!0:null!=h?l(e)._overflowWeekday=!0:(a=xe(i,o,n,s,r),e._a[jo]=a.year,e._dayOfYear=a.dayOfYear)}function Ee(e){if(e._f===t.ISO_8601)return void fe(e);e._a=[],l(e).empty=!0;var i,o,n,s,r,a=""+e._i,h=a.length,d=0;for(n=q(e._f,e._locale).match(vo)||[],i=0;i0&&l(e).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),wo[s]?(o?l(e).empty=!1:l(e).unusedTokens.push(s),te(s,o,e)):e._strict&&!o&&l(e).unusedTokens.push(s);l(e).charsLeftOver=h-d,a.length>0&&l(e).unusedInput.push(a),l(e).bigHour===!0&&e._a[$o]<=12&&e._a[$o]>0&&(l(e).bigHour=void 0),l(e).parsedDateParts=e._a.slice(0),l(e).meridiem=e._meridiem,e._a[$o]=Te(e._locale,e._a[$o],e._meridiem),Me(e),pe(e)}function Te(e,t,i){var o;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(o=e.isPM(i),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Pe(e){var t,i,o,n,s;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;ns)&&(o=s,i=t));a(e,i||t)}function Ie(e){if(!e._d){var t=F(e._i);e._a=s([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Me(e)}}function Ae(e){var t=new m(pe(Re(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Re(e){var t=e._i,i=e._f;return e._locale=e._locale||R(e._l),null===t||void 0===i&&""===t?c({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),g(t)?new m(pe(t)):(o(i)?Pe(e):i?Ee(e):n(t)?e._d=t:Le(e),u(e)||(e._d=null),e))}function Le(e){var i=e._i;void 0===i?e._d=new Date(t.now()):n(i)?e._d=new Date(i.valueOf()):"string"==typeof i?me(e):o(i)?(e._a=s(i.slice(0),function(e){return parseInt(e,10)}),Me(e)):"object"==typeof i?Ie(e):"number"==typeof i?e._d=new Date(i):t.createFromInputFallback(e)}function Ne(e,t,i,o,n){var s={};return"boolean"==typeof i&&(o=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=i,s._i=e,s._f=t,s._strict=o,Ae(s)}function ze(e,t,i,o){return Ne(e,t,i,o,!1)}function Fe(e,t){var i,n;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return ze();for(i=t[0],n=1;ne&&(e=-e,i="-"),i+$(~~(e/60),2)+t+$(~~e%60,2)})}function Ue(e,t){var i=(t||"").match(e)||[],o=i[i.length-1]||[],n=(o+"").match(un)||["-",0,0],s=+(60*n[1])+y(n[2]);return"+"===n[0]?s:-s}function Ye(e,i){var o,s;return i._isUTC?(o=i.clone(),s=(g(e)||n(e)?e.valueOf():ze(e).valueOf())-o.valueOf(),o._d.setTime(o._d.valueOf()+s),t.updateOffset(o,!1),o):ze(e).local()}function Ge(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ve(e,i){var o,n=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Ue(Lo,e):Math.abs(e)<16&&(e=60*e),!this._isUTC&&i&&(o=Ge(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),n!==e&&(!i||this._changeInProgress?lt(this,nt(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?n:Ge(this):null!=e?this:NaN}function qe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Xe(e){return this.utcOffset(0,e)}function Ke(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ge(this),"m")),this}function Ze(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ue(Ro,this._i)),this}function Je(e){return!!this.isValid()&&(e=e?ze(e).utcOffset():0,(this.utcOffset()-e)%60===0)}function Qe(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function et(){if(!p(this._isDSTShifted))return this._isDSTShifted;var e={};if(f(e,this),e=Re(e),e._a){var t=e._isUTC?h(e._a):ze(e._a);this._isDSTShifted=this.isValid()&&b(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function tt(){return!!this.isValid()&&!this._isUTC}function it(){return!!this.isValid()&&this._isUTC}function ot(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function nt(e,t){var i,o,n,s=e,a=null;return We(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(a=cn.exec(e))?(i="-"===a[1]?-1:1,s={y:0,d:y(a[Wo])*i,h:y(a[$o])*i,m:y(a[Uo])*i,s:y(a[Yo])*i,ms:y(a[Go])*i}):(a=pn.exec(e))?(i="-"===a[1]?-1:1,s={y:st(a[2],i),M:st(a[3],i),w:st(a[4],i),d:st(a[5],i),h:st(a[6],i),m:st(a[7],i),s:st(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=at(ze(s.from),ze(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new He(s),We(e)&&r(e,"_locale")&&(o._locale=e._locale),o}function st(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function rt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function at(e,t){var i;return e.isValid()&&t.isValid()?(t=Ye(t,e),e.isBefore(t)?i=rt(e,t):(i=rt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ht(e){return 0>e?-1*Math.round(-1*e):Math.round(e)}function dt(e,t){return function(i,o){var n,s;return null===o||isNaN(+o)||(x(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=nt(i,o),lt(this,n,e),this}}function lt(e,i,o,n){var s=i._milliseconds,r=ht(i._days),a=ht(i._months);e.isValid()&&(n=null==n||n,s&&e._d.setTime(e._d.valueOf()+s*o),r&&H(e,"Date",j(e,"Date")+r*o),a&&ae(e,j(e,"Month")+a*o),n&&t.updateOffset(e,r||a))}function ut(e,t){var i=e||ze(),o=Ye(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse",r=t&&(k(t[s])?t[s]():t[s]);return this.format(r||this.localeData().calendar(s,this,ze(i)))}function ct(){return new m(this)}function pt(e,t){var i=g(e)?e:ze(e);return!(!this.isValid()||!i.isValid())&&(t=z(p(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()t-s?(i=e.clone().add(n-1,"months"),o=(t-s)/(s-i)):(i=e.clone().add(n+1,"months"),o=(t-s)/(i-s)),-(n+o)||0}function _t(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function xt(){var e=this.clone().utc();return 0s&&(t=s),qt.call(this,e,t,i,o,n))}function qt(e,t,i,o,n){var s=xe(e,t,i,o,n),r=ve(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Xt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Kt(e){return ke(e,this._week.dow,this._week.doy).week}function Zt(){return this._week.dow}function Jt(){return this._week.doy}function Qt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function ei(e){var t=ke(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ti(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function ii(e,t){return o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function oi(e){return this._weekdaysShort[e.day()]}function ni(e){return this._weekdaysMin[e.day()]}function si(e,t,i){var o,n,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;7>o;++o)s=h([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?(n=fo.call(this._weekdaysParse,r),-1!==n?n:null):"ddd"===t?(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:null):(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:null):"dddd"===t?(n=fo.call(this._weekdaysParse,r),-1!==n?n:(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:null))):"ddd"===t?(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:(n=fo.call(this._weekdaysParse,r),-1!==n?n:(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:null))):(n=fo.call(this._minWeekdaysParse,r),-1!==n?n:(n=fo.call(this._weekdaysParse,r),-1!==n?n:(n=fo.call(this._shortWeekdaysParse,r),-1!==n?n:null)))}function ri(e,t,i){var o,n,s;if(this._weekdaysParseExact)return si.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(n=h([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(i&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(i&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!i&&this._weekdaysParse[o].test(e))return o}}function ai(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=ti(e,this.localeData()),this.add(e-t,"d")):t}function hi(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function di(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function li(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this), +e?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex}function ui(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ci(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||pi.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function pi(){function e(e,t){return t.length-e.length}var t,i,o,n,s,r=[],a=[],d=[],l=[];for(t=0;7>t;t++)i=h([2e3,1]).day(t),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),d.push(s),l.push(o),l.push(n),l.push(s);for(r.sort(e),a.sort(e),d.sort(e),l.sort(e),t=0;7>t;t++)a[t]=J(a[t]),d[t]=J(d[t]),l[t]=J(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function fi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function mi(){return this.hours()%12||12}function gi(){return this.hours()||24}function vi(e,t){U(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function yi(e,t){return t._meridiemParse}function bi(e){return"p"===(e+"").toLowerCase().charAt(0)}function wi(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function _i(e,t){t[Go]=y(1e3*("0."+e))}function xi(){return this._isUTC?"UTC":""}function ki(){return this._isUTC?"Coordinated Universal Time":""}function Si(e){return ze(1e3*e)}function Oi(){return ze.apply(null,arguments).parseZone()}function Ci(e,t,i){var o=this._calendar[e];return k(o)?o.call(t,i):o}function Mi(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function Di(){return this._invalidDate}function Ei(e){return this._ordinal.replace("%d",e)}function Ti(e){return e}function Pi(e,t,i,o){var n=this._relativeTime[i];return k(n)?n(e,t,i,o):n.replace(/%d/i,e)}function Ii(e,t){var i=this._relativeTime[e>0?"future":"past"];return k(i)?i(t):i.replace(/%s/i,t)}function Ai(e,t,i,o){var n=R(),s=h().set(o,t);return n[i](s,e)}function Ri(e,t,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Ai(e,t,i,"month");var o,n=[];for(o=0;12>o;o++)n[o]=Ai(e,o,i,"month");return n}function Li(e,t,i,o){"boolean"==typeof e?("number"==typeof t&&(i=t,t=void 0),t=t||""):(t=e,i=t,e=!1,"number"==typeof t&&(i=t,t=void 0),t=t||"");var n=R(),s=e?n._week.dow:0;if(null!=i)return Ai(t,(i+s)%7,o,"day");var r,a=[];for(r=0;7>r;r++)a[r]=Ai(t,(r+s)%7,o,"day");return a}function Ni(e,t){return Ri(e,t,"months")}function zi(e,t){return Ri(e,t,"monthsShort")}function Fi(e,t,i){return Li(e,t,i,"weekdays")}function Bi(e,t,i){return Li(e,t,i,"weekdaysShort")}function ji(e,t,i){return Li(e,t,i,"weekdaysMin")}function Hi(){var e=this._data;return this._milliseconds=jn(this._milliseconds),this._days=jn(this._days),this._months=jn(this._months),e.milliseconds=jn(e.milliseconds),e.seconds=jn(e.seconds),e.minutes=jn(e.minutes),e.hours=jn(e.hours),e.months=jn(e.months),e.years=jn(e.years),this}function Wi(e,t,i,o){var n=nt(t,i);return e._milliseconds+=o*n._milliseconds,e._days+=o*n._days,e._months+=o*n._months,e._bubble()}function $i(e,t){return Wi(this,e,t,1)}function Ui(e,t){return Wi(this,e,t,-1)}function Yi(e){return 0>e?Math.floor(e):Math.ceil(e)}function Gi(){var e,t,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||0>=s&&0>=r&&0>=a||(s+=864e5*Yi(qi(a)+r),r=0,a=0),h.milliseconds=s%1e3,e=v(s/1e3),h.seconds=e%60,t=v(e/60),h.minutes=t%60,i=v(t/60),h.hours=i%24,r+=v(i/24),n=v(Vi(r)),a+=n,r-=Yi(qi(n)),o=v(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function Vi(e){return 4800*e/146097}function qi(e){return 146097*e/4800}function Xi(e){var t,i,o=this._milliseconds;if(e=z(e),"month"===e||"year"===e)return t=this._days+o/864e5,i=this._months+Vi(t),"month"===e?i:i/12;switch(t=this._days+Math.round(qi(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Ki(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function Zi(e){return function(){return this.as(e)}}function Ji(e){return e=z(e),this[e+"s"]()}function Qi(e){return function(){return this._data[e]}}function eo(){return v(this.days()/7)}function to(e,t,i,o,n){return n.relativeTime(t||1,!!i,e,o)}function io(e,t,i){var o=nt(e).abs(),n=is(o.as("s")),s=is(o.as("m")),r=is(o.as("h")),a=is(o.as("d")),h=is(o.as("M")),d=is(o.as("y")),l=n=s&&["m"]||s=r&&["h"]||r=a&&["d"]||a=h&&["M"]||h=d&&["y"]||["yy",d];return l[2]=t,l[3]=+e>0,l[4]=i,to.apply(null,l)}function oo(e,t){return void 0!==os[e]&&(void 0===t?os[e]:(os[e]=t,!0))}function no(e){var t=this.localeData(),i=io(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function so(){var e,t,i,o=ns(this._milliseconds)/1e3,n=ns(this._days),s=ns(this._months);e=v(o/60),t=v(e/60),o%=60,e%=60,i=v(s/12),s%=12;var r=i,a=s,h=n,d=t,l=e,u=o,c=this.asSeconds();return c?(0>c?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||u?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var ro,ao;ao=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,o=0;i>o;o++)if(o in t&&e.call(this,t[o],o,t))return!0;return!1};var ho=t.momentProperties=[],lo=!1,uo={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var co;co=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)r(e,t)&&i.push(t);return i};var po,fo,mo={},go={},vo=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,yo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bo={},wo={},_o=/\d/,xo=/\d\d/,ko=/\d{3}/,So=/\d{4}/,Oo=/[+-]?\d{6}/,Co=/\d\d?/,Mo=/\d\d\d\d?/,Do=/\d\d\d\d\d\d?/,Eo=/\d{1,3}/,To=/\d{1,4}/,Po=/[+-]?\d{1,6}/,Io=/\d+/,Ao=/[+-]?\d+/,Ro=/Z|[+-]\d\d:?\d\d/gi,Lo=/Z|[+-]\d\d(?::?\d\d)?/gi,No=/[+-]?\d+(\.\d{1,3})?/,zo=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Fo={},Bo={},jo=0,Ho=1,Wo=2,$o=3,Uo=4,Yo=5,Go=6,Vo=7,qo=8;fo=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t=e?""+e:"+"+e}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),N("year","y"),X("Y",Ao),X("YY",Co,xo),X("YYYY",To,So),X("YYYYY",Po,Oo),X("YYYYYY",Po,Oo),Q(["YYYYY","YYYYYY"],jo),Q("YYYY",function(e,i){i[jo]=2===e.length?t.parseTwoDigitYear(e):y(e)}),Q("YY",function(e,i){i[jo]=t.parseTwoDigitYear(e)}),Q("Y",function(e,t){t[jo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return y(e)+(y(e)>68?1900:2e3)};var an=B("FullYear",!0);t.ISO_8601=function(){};var hn=_("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=ze.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:c()}),dn=_("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=ze.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:c()}),ln=function(){return Date.now?Date.now():+new Date};$e("Z",":"),$e("ZZ",""),X("Z",Lo),X("ZZ",Lo),Q(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Ue(Lo,e)});var un=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var cn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,pn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;nt.fn=He.prototype;var fn=dt(1,"add"),mn=dt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var gn=_("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Wt("gggg","weekYear"),Wt("ggggg","weekYear"),Wt("GGGG","isoWeekYear"),Wt("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),X("G",Ao),X("g",Ao),X("GG",Co,xo),X("gg",Co,xo),X("GGGG",To,So),X("gggg",To,So),X("GGGGG",Po,Oo),X("ggggg",Po,Oo),ee(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,o){t[o.substr(0,2)]=y(e)}),ee(["gg","GG"],function(e,i,o,n){i[n]=t.parseTwoDigitYear(e)}),U("Q",0,"Qo","quarter"),N("quarter","Q"),X("Q",_o),Q("Q",function(e,t){t[Ho]=3*(y(e)-1)}),U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),X("w",Co),X("ww",Co,xo),X("W",Co),X("WW",Co,xo),ee(["w","ww","W","WW"],function(e,t,i,o){t[o.substr(0,1)]=y(e)});var vn={dow:0,doy:6};U("D",["DD",2],"Do","date"),N("date","D"),X("D",Co),X("DD",Co,xo),X("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Q(["D","DD"],Wo),Q("Do",function(e,t){t[Wo]=y(e.match(Co)[0],10)});var yn=B("Date",!0);U("d",0,"do","day"),U("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),U("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),U("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),X("d",Co),X("e",Co),X("E",Co),X("dd",function(e,t){return t.weekdaysMinRegex(e)}),X("ddd",function(e,t){return t.weekdaysShortRegex(e)}),X("dddd",function(e,t){return t.weekdaysRegex(e)}),ee(["dd","ddd","dddd"],function(e,t,i,o){var n=i._locale.weekdaysParse(e,o,i._strict);null!=n?t.d=n:l(i).invalidWeekday=e}),ee(["d","e","E"],function(e,t,i,o){t[o]=y(e)});var bn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_n="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xn=zo,kn=zo,Sn=zo;U("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),X("DDD",Eo),X("DDDD",ko),Q(["DDD","DDDD"],function(e,t,i){i._dayOfYear=y(e)}),U("H",["HH",2],0,"hour"),U("h",["hh",2],0,mi),U("k",["kk",2],0,gi),U("hmm",0,0,function(){return""+mi.apply(this)+$(this.minutes(),2)}),U("hmmss",0,0,function(){return""+mi.apply(this)+$(this.minutes(),2)+$(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+$(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+$(this.minutes(),2)+$(this.seconds(),2)}),vi("a",!0),vi("A",!1),N("hour","h"),X("a",yi),X("A",yi),X("H",Co),X("h",Co),X("HH",Co,xo),X("hh",Co,xo),X("hmm",Mo),X("hmmss",Do),X("Hmm",Mo),X("Hmmss",Do),Q(["H","HH"],$o),Q(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),Q(["h","hh"],function(e,t,i){t[$o]=y(e),l(i).bigHour=!0}),Q("hmm",function(e,t,i){var o=e.length-2;t[$o]=y(e.substr(0,o)),t[Uo]=y(e.substr(o)),l(i).bigHour=!0}),Q("hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[$o]=y(e.substr(0,o)),t[Uo]=y(e.substr(o,2)),t[Yo]=y(e.substr(n)),l(i).bigHour=!0}),Q("Hmm",function(e,t,i){var o=e.length-2;t[$o]=y(e.substr(0,o)),t[Uo]=y(e.substr(o))}),Q("Hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[$o]=y(e.substr(0,o)),t[Uo]=y(e.substr(o,2)),t[Yo]=y(e.substr(n))});var On=/[ap]\.?m?\.?/i,Cn=B("Hours",!0);U("m",["mm",2],0,"minute"),N("minute","m"),X("m",Co),X("mm",Co,xo),Q(["m","mm"],Uo);var Mn=B("Minutes",!1);U("s",["ss",2],0,"second"),N("second","s"),X("s",Co),X("ss",Co,xo),Q(["s","ss"],Yo);var Dn=B("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),X("S",Eo,_o),X("SS",Eo,xo),X("SSS",Eo,ko);var En;for(En="SSSS";En.length<=9;En+="S")X(En,Io);for(En="S";En.length<=9;En+="S")Q(En,_i);var Tn=B("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Pn=m.prototype;Pn.add=fn,Pn.calendar=ut,Pn.clone=ct,Pn.diff=bt,Pn.endOf=Pt,Pn.format=kt,Pn.from=St,Pn.fromNow=Ot,Pn.to=Ct,Pn.toNow=Mt,Pn.get=W,Pn.invalidAt=jt,Pn.isAfter=pt,Pn.isBefore=ft,Pn.isBetween=mt,Pn.isSame=gt,Pn.isSameOrAfter=vt,Pn.isSameOrBefore=yt,Pn.isValid=Ft,Pn.lang=gn,Pn.locale=Dt,Pn.localeData=Et,Pn.max=dn,Pn.min=hn,Pn.parsingFlags=Bt,Pn.set=W,Pn.startOf=Tt,Pn.subtract=mn,Pn.toArray=Lt,Pn.toObject=Nt,Pn.toDate=Rt,Pn.toISOString=xt,Pn.toJSON=zt,Pn.toString=_t,Pn.unix=At,Pn.valueOf=It,Pn.creationData=Ht,Pn.year=an,Pn.isLeapYear=we,Pn.weekYear=$t,Pn.isoWeekYear=Ut,Pn.quarter=Pn.quarters=Xt,Pn.month=he,Pn.daysInMonth=de,Pn.week=Pn.weeks=Qt,Pn.isoWeek=Pn.isoWeeks=ei,Pn.weeksInYear=Gt,Pn.isoWeeksInYear=Yt,Pn.date=yn,Pn.day=Pn.days=ai,Pn.weekday=hi,Pn.isoWeekday=di,Pn.dayOfYear=fi,Pn.hour=Pn.hours=Cn,Pn.minute=Pn.minutes=Mn,Pn.second=Pn.seconds=Dn,Pn.millisecond=Pn.milliseconds=Tn,Pn.utcOffset=Ve,Pn.utc=Xe,Pn.local=Ke,Pn.parseZone=Ze,Pn.hasAlignedHourOffset=Je,Pn.isDST=Qe,Pn.isDSTShifted=et,Pn.isLocal=tt,Pn.isUtcOffset=it,Pn.isUtc=ot,Pn.isUTC=ot,Pn.zoneAbbr=xi,Pn.zoneName=ki,Pn.dates=_("dates accessor is deprecated. Use date instead.",yn),Pn.months=_("months accessor is deprecated. Use month instead",he),Pn.years=_("years accessor is deprecated. Use year instead",an),Pn.zone=_("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qe);var In=Pn,An={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Rn={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ln="Invalid date",Nn="%d",zn=/\d{1,2}/,Fn={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Bn=M.prototype;Bn._calendar=An,Bn.calendar=Ci,Bn._longDateFormat=Rn,Bn.longDateFormat=Mi,Bn._invalidDate=Ln,Bn.invalidDate=Di,Bn._ordinal=Nn,Bn.ordinal=Ei,Bn._ordinalParse=zn,Bn.preparse=Ti,Bn.postformat=Ti,Bn._relativeTime=Fn,Bn.relativeTime=Pi,Bn.pastFuture=Ii,Bn.set=O,Bn.months=oe,Bn._months=Ko,Bn.monthsShort=ne,Bn._monthsShort=Zo,Bn.monthsParse=re,Bn._monthsRegex=Qo,Bn.monthsRegex=ue,Bn._monthsShortRegex=Jo,Bn.monthsShortRegex=le,Bn.week=Kt,Bn._week=vn,Bn.firstDayOfYear=Jt,Bn.firstDayOfWeek=Zt,Bn.weekdays=ii,Bn._weekdays=bn,Bn.weekdaysMin=ni,Bn._weekdaysMin=_n,Bn.weekdaysShort=oi,Bn._weekdaysShort=wn,Bn.weekdaysParse=ri,Bn._weekdaysRegex=xn,Bn.weekdaysRegex=li,Bn._weekdaysShortRegex=kn,Bn.weekdaysShortRegex=ui,Bn._weekdaysMinRegex=Sn,Bn.weekdaysMinRegex=ci,Bn.isPM=bi,Bn._meridiemParse=On,Bn.meridiem=wi,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i}}),t.lang=_("moment.lang is deprecated. Use moment.locale instead.",P),t.langData=_("moment.langData is deprecated. Use moment.localeData instead.",R);var jn=Math.abs,Hn=Zi("ms"),Wn=Zi("s"),$n=Zi("m"),Un=Zi("h"),Yn=Zi("d"),Gn=Zi("w"),Vn=Zi("M"),qn=Zi("y"),Xn=Qi("milliseconds"),Kn=Qi("seconds"),Zn=Qi("minutes"),Jn=Qi("hours"),Qn=Qi("days"),es=Qi("months"),ts=Qi("years"),is=Math.round,os={s:45,m:45,h:22,d:26,M:11},ns=Math.abs,ss=He.prototype;ss.abs=Hi,ss.add=$i,ss.subtract=Ui,ss.as=Xi,ss.asMilliseconds=Hn,ss.asSeconds=Wn,ss.asMinutes=$n,ss.asHours=Un,ss.asDays=Yn,ss.asWeeks=Gn,ss.asMonths=Vn,ss.asYears=qn,ss.valueOf=Ki,ss._bubble=Gi,ss.get=Ji,ss.milliseconds=Xn,ss.seconds=Kn,ss.minutes=Zn,ss.hours=Jn,ss.days=Qn,ss.weeks=eo,ss.months=es,ss.years=ts,ss.humanize=no,ss.toISOString=so,ss.toString=so,ss.toJSON=so,ss.locale=Dt,ss.localeData=Et,ss.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",so),ss.lang=gn,U("X",0,0,"unix"),U("x",0,0,"valueOf"),X("x",Ao),X("X",No),Q("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),Q("x",function(e,t,i){i._d=new Date(y(e))}),t.version="2.13.0",i(ze),t.fn=In,t.min=Be,t.max=je,t.now=ln,t.utc=h,t.unix=Si,t.months=Ni,t.isDate=n,t.locale=P,t.invalid=c,t.duration=nt,t.isMoment=g,t.weekdays=Fi,t.parseZone=Oi,t.localeData=R,t.isDuration=We,t.monthsShort=zi,t.weekdaysMin=ji,t.defineLocale=I,t.updateLocale=A,t.locales=L,t.weekdaysShort=Bi,t.normalizeUnits=z,t.relativeTimeThreshold=oo,t.prototype=In;var rs=t;return rs})}).call(t,i(4)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){function i(e){throw new Error("Cannot find module '"+e+"'.")}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id=5},function(e,t){(function(t){function i(e,t,i){var o=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[o+n++]=u[e])});16>n;)t[o+n++]=0;return t}function o(e,t){var i=t||0,o=l;return o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]}function n(e,t,i){var n=t&&i||0,s=t||[];e=e||{};var r=void 0!==e.clockseq?e.clockseq:m,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:v+1,d=a-g+(h-v)/1e4;if(0>d&&void 0===e.clockseq&&(r=r+1&16383),(0>d||a>g)&&void 0===e.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 c=e.node||f,p=0;6>p;p++)s[n+p]=c[p];return t?t:o(s)}function s(e,t,i){var n=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;16>a;a++)t[n+a]=s[a];return t||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof t?t:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var e,t=0;16>t;t++)0===(3&t)&&(e=4294967296*Math.random()),d[t]=e>>>((3&t)<<3)&255;return d}}for(var l=[],u={},c=0;256>c;c++)l[c]=(c+256).toString(16).substr(1),u[l[c]]=c;var p=r(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],m=16383&(p[6]<<8|p[7]),g=0,v=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,e.exports=y}).call(t,function(){return this}())},function(e,t,i){t.util=i(1),t.DOMutil=i(8),t.DataSet=i(9),t.DataView=i(11),t.Queue=i(10),t.Graph3d=i(12),t.graph3d={Camera:i(16),Filter:i(17),Point2d:i(15),Point3d:i(14),Slider:i(18),StepNumber:i(19)},t.moment=i(2),t.Hammer=i(20),t.keycharm=i(23)},function(e,t){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var i=0;i0?(o=t[e].redundant[0],t[e].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",e),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},i.appendChild(o)),t[e].used.push(o),o},t.getDOMElement=function(e,t,i,o){var n;return t.hasOwnProperty(e)?t[e].redundant.length>0?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElement(e),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(e),t[e]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),t[e].used.push(n),n},t.drawPoint=function(e,i,o,n,s,r){var a;if("circle"==o.style?(a=t.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=t.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",e-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=t.getSVGElement("text",n,s);r.xOffset&&(e+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i)}return a},t.drawBar=function(e,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=t.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",e-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(e,t,i){function o(e,t){if(e&&!Array.isArray(e)&&(t=e,e=null),this._options=t||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;n>o;o++){var s=i[o],r=this._options.type[s];"Date"==r||"ISODate"==r||"ASPDate"==r?this._type[s]="Date":this._type[s]=r}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},e&&this.add(e),this.setOptions(t)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(1),r=i(10);o.prototype.setOptions=function(e){e&&void 0!==e.queue&&(e.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=r.extend(this,{replace:["add","update","remove"]})),"object"===n(e.queue)&&this._queue.setOptions(e.queue)))},o.prototype.on=function(e,t){var i=this._subscribers[e];i||(i=[],this._subscribers[e]=i),i.push({callback:t})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(e,t){var i=this._subscribers[e];i&&(this._subscribers[e]=i.filter(function(e){return e.callback!=t}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(e,t,i){if("*"==e)throw new Error("Cannot trigger event *");var o=[];e in this._subscribers&&(o=o.concat(this._subscribers[e])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0,s=o.length;s>n;n++){var r=o[n];r.callback&&r.callback(e,t,i||null)}},o.prototype.add=function(e,t){var i,o=[],n=this;if(Array.isArray(e))for(var s=0,r=e.length;r>s;s++)i=n._addItem(e[s]),o.push(i);else{if(!(e instanceof Object))throw new Error("Unknown dataType");i=n._addItem(e),o.push(i)}return o.length&&this._trigger("add",{items:o},t),o},o.prototype.update=function(e,t){var i=[],o=[],n=[],r=[],a=this,h=a._fieldId,d=function(e){var t=e[h];if(a._data[t]){var d=s.extend({},a._data[t]);t=a._updateItem(e),o.push(t),r.push(e),n.push(d)}else t=a._addItem(e),i.push(t)};if(Array.isArray(e))for(var l=0,u=e.length;u>l;l++)e[l]instanceof Object?d(e[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!(e instanceof Object))throw new Error("Unknown dataType");d(e)}if(i.length&&this._trigger("add",{items:i},t),o.length){var c={items:o,oldData:n,data:r};this._trigger("update",c,t)}return i.concat(o)},o.prototype.get=function(e){var t,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,u,c,p,f=o&&o.type||this._options.type,m=o&&o.filter,g=[];if(void 0!=t)d=n._getItem(t,f),d&&m&&!m(d)&&(d=null);else if(void 0!=i)for(c=0,p=i.length;p>c;c++)d=n._getItem(i[c],f),m&&!m(d)||g.push(d);else for(l=Object.keys(this._data),c=0,p=l.length;p>c;c++)u=l[c],d=n._getItem(u,f),m&&!m(d)||g.push(d);if(o&&o.order&&void 0==t&&this._sort(g,o.order),o&&o.fields){var v=o.fields;if(void 0!=t)d=this._filterFields(d,v);else for(c=0,p=g.length;p>c;c++)g[c]=this._filterFields(g[c],v)}if("Object"==a){var y,b={};for(c=0,p=g.length;p>c;c++)y=g[c],b[y.id]=y;return b}return void 0!=t?d:g},o.prototype.getIds=function(e){var t,i,o,n,s,r=this._data,a=e&&e.filter,h=e&&e.order,d=e&&e.type||this._options.type,l=Object.keys(r),u=[];if(a)if(h){for(s=[],t=0,i=l.length;i>t;t++)o=l[t],n=this._getItem(o,d),a(n)&&s.push(n);for(this._sort(s,h),t=0,i=s.length;i>t;t++)u.push(s[t][this._fieldId])}else for(t=0,i=l.length;i>t;t++)o=l[t],n=this._getItem(o,d),a(n)&&u.push(n[this._fieldId]);else if(h){for(s=[],t=0,i=l.length;i>t;t++)o=l[t],s.push(r[o]);for(this._sort(s,h),t=0,i=s.length;i>t;t++)u.push(s[t][this._fieldId])}else for(t=0,i=l.length;i>t;t++)o=l[t],n=r[o],u.push(n[this._fieldId]);return u},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=this._data,d=Object.keys(h);if(t&&t.order){var l=this.get(t);for(i=0,o=l.length;o>i;i++)n=l[i],s=n[this._fieldId],e(n,s)}else for(i=0,o=d.length;o>i;i++)s=d[i],n=this._getItem(s,a),r&&!r(n)||e(n,s)},o.prototype.map=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=[],d=this._data,l=Object.keys(d);for(i=0,o=l.length;o>i;i++)n=l[i],s=this._getItem(n,a),r&&!r(s)||h.push(e(s,n));return t&&t.order&&this._sort(h,t.order),h},o.prototype._filterFields=function(e,t){if(!e)return e;var i,o,n={},s=Object.keys(e),r=s.length;if(Array.isArray(t))for(i=0;r>i;i++)o=s[i],-1!=t.indexOf(o)&&(n[o]=e[o]);else for(i=0;r>i;i++)o=s[i],t.hasOwnProperty(o)&&(n[t[o]]=e[o]);return n},o.prototype._sort=function(e,t){if(s.isString(t)){var i=t;e.sort(function(e,t){var o=e[i],n=t[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof t)throw new TypeError("Order must be a function or a string");e.sort(t)}},o.prototype.remove=function(e,t){var i,o,n,s=[];if(Array.isArray(e))for(i=0,o=e.length;o>i;i++)n=this._remove(e[i]),null!=n&&s.push(n);else n=this._remove(e),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},t),s},o.prototype._remove=function(e){if(s.isNumber(e)||s.isString(e)){if(this._data[e])return delete this._data[e],this.length--,e}else if(e instanceof Object){var t=e[this._fieldId];if(void 0!==t&&this._data[t])return delete this._data[t],this.length--,t}return null},o.prototype.clear=function(e){var t=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:t},e),t},o.prototype.max=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||d>r)&&(s=h,r=d)}return s},o.prototype.min=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||r>d)&&(s=h,r=d)}return s},o.prototype.distinct=function(e){var t,i,o,n=this._data,r=Object.keys(n),a=[],h=this._options.type&&this._options.type[e]||null,d=0;for(t=0,o=r.length;o>t;t++){var l=r[t],u=n[l],c=u[e],p=!1;for(i=0;d>i;i++)if(a[i]==c){p=!0;break}p||void 0===c||(a[d]=c,d++)}if(h)for(t=0,o=a.length;o>t;t++)a[t]=s.convert(a[t],h);return a},o.prototype._addItem=function(e){var t=e[this._fieldId];if(void 0!=t){if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists")}else t=s.randomUUID(),e[this._fieldId]=t;var i,o,n={},r=Object.keys(e);for(i=0,o=r.length;o>i;i++){var a=r[i],h=this._type[a];n[a]=s.convert(e[a],h)}return this._data[t]=n,this.length++,t},o.prototype._getItem=function(e,t){var i,o,n,r,a=this._data[e];if(!a)return null;var h={},d=Object.keys(a);if(t)for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=s.convert(o,t[i]);else for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=o;return h},o.prototype._updateItem=function(e){var t=e[this._fieldId];if(void 0==t)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(e)+")");var i=this._data[t];if(!i)throw new Error("Cannot update item: no item with id "+t+" found");for(var o=Object.keys(e),n=0,r=o.length;r>n;n++){var a=o[n],h=this._type[a];i[a]=s.convert(e[a],h)}return t},e.exports=o},function(e,t){function i(e){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(e)}i.prototype.setOptions=function(e){e&&"undefined"!=typeof e.delay&&(this.delay=e.delay),e&&"undefined"!=typeof e.max&&(this.max=e.max),this._flushIfNeeded()},i.extend=function(e,t){var o=new i(t);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){o.flush()};var n=[{name:"flush",original:void 0}];if(t&&t.replace)for(var s=0;sthis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var e=this;this._timeout=setTimeout(function(){e.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var e=this._queue.shift();e.fn.apply(e.context||e.fn,e.args||[])}},e.exports=i},function(e,t,i){function o(e,t){this._data=null,this._ids={},this.length=0,this._options=t||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(e)}var n=i(1),s=i(9);o.prototype.setData=function(e){var t,i,o,n;if(this._data&&(this._data.off&&this._data.off("*",this.listener),t=Object.keys(this._ids),this._ids={},this.length=0,this._trigger("remove",{items:t})),this._data=e,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",t=this._data.getIds({filter:this._options&&this._options.filter}),o=0,n=t.length;n>o;o++)i=t[o],this._ids[i]=!0;this.length=t.length,this._trigger("add",{items:t}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){var e,t,i,o=this._data.getIds({filter:this._options&&this._options.filter}),n=Object.keys(this._ids),s={},r=[],a=[];for(t=0,i=o.length;i>t;t++)e=o[t],s[e]=!0,this._ids[e]||(r.push(e),this._ids[e]=!0);for(t=0,i=n.length;i>t;t++)e=n[t],s[e]||(a.push(e),delete this._ids[e]);this.length+=r.length-a.length,r.length&&this._trigger("add",{items:r}),a.length&&this._trigger("remove",{items:a})},o.prototype.get=function(e){var t,i,o,s=this,r=n.getType(arguments[0]);"String"==r||"Number"==r||"Array"==r?(t=arguments[0],i=arguments[1],o=arguments[2]):(i=arguments[0],o=arguments[1]);var a=n.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(e){return s._options.filter(e)&&i.filter(e)});var h=[];return void 0!=t&&h.push(t),h.push(a),h.push(o),this._data&&this._data.get.apply(this._data,h)},o.prototype.getIds=function(e){var t;if(this._data){var i,o=this._options.filter;i=e&&e.filter?o?function(t){return o(t)&&e.filter(t)}:e.filter:o,t=this._data.getIds({filter:i,order:e&&e.order})}else t=[];return t},o.prototype.map=function(e,t){var i=[];if(this._data){var o,n=this._options.filter;o=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,i=this._data.map(e,{filter:o,order:t&&t.order})}else i=[];return i},o.prototype.getDataSet=function(){for(var e=this;e instanceof o;)e=e._data;return e||null},o.prototype._onEvent=function(e,t,i){var o,n,s,r,a=t&&t.items,h=this._data,d=[],l=[],u=[],c=[];if(a&&h){switch(e){case"add":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r&&(this._ids[s]=!0,l.push(s));break;case"update":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r?this._ids[s]?(u.push(s),d.push(t.data[o])):(this._ids[s]=!0,l.push(s)):this._ids[s]&&(delete this._ids[s],c.push(s));break;case"remove":for(o=0,n=a.length;n>o;o++)s=a[o],this._ids[s]&&(delete this._ids[s],c.push(s))}this.length+=l.length-c.length,l.length&&this._trigger("add",{items:l},i),u.length&&this._trigger("update",{items:u,data:d},i),c.length&&this._trigger("remove",{items:c},i)}},o.prototype.on=s.prototype.on,o.prototype.off=s.prototype.off,o.prototype._trigger=s.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,e.exports=o},function(e,t,i){function o(e,t,i){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=e,this.width="400px",this.height="400px",this.margin=10,this.defaultXCenter="55%",this.defaultYCenter="50%",this.xLabel="x",this.yLabel="y",this.zLabel="z";var n=function(e){return e};this.xValueLabel=n,this.yValueLabel=n,this.zValueLabel=n,this.filterLabel="time",this.legendLabel="value",this.style=o.STYLE.DOT,this.showPerspective=!0,this.showGrid=!0,this.keepAspectRatio=!0,this.showShadow=!1,this.showGrayBottom=!1,this.showTooltip=!1,this.verticalRatio=.5,this.animationInterval=1e3,this.animationPreload=!1,this.camera=new p,this.camera.setArmRotation(1,.5),this.camera.setArmLength(1.7),this.eye=new u(0,0,(-1)),this.dataTable=null,this.dataPoints=null,this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.colFilter=void 0,this.xMin=0,this.xStep=void 0,this.xMax=1,this.yMin=0,this.yStep=void 0,this.yMax=1,this.zMin=0,this.zStep=void 0,this.zMax=1,this.valueMin=0,this.valueMax=1,this.xBarWidth=1,this.yBarWidth=1,this.axisColor="#4D4D4D",this.gridColor="#D3D3D3",this.dataColor={fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},this.dotSizeRatio=.02,this.create(),this.setOptions(i),t&&this.setData(t)}function n(e){return"clientX"in e?e.clientX:e.targetTouches[0]&&e.targetTouches[0].clientX||0}function s(e){return"clientY"in e?e.clientY:e.targetTouches[0]&&e.targetTouches[0].clientY||0}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a=i(13),h=i(9),d=i(11),l=i(1),u=i(14),c=i(15),p=i(16),f=i(17),m=i(18),g=i(19);a(o.prototype),o.prototype._setScale=function(){this.scale=new u(1/(this.xMax-this.xMin),1/(this.yMax-this.yMin),1/(this.zMax-this.zMin)),this.keepAspectRatio&&(this.scale.x3&&(this.colFilter=3);else{if(this.style!==o.STYLE.DOTCOLOR&&this.style!==o.STYLE.DOTSIZE&&this.style!==o.STYLE.BARCOLOR&&this.style!==o.STYLE.BARSIZE)throw'Unknown style "'+this.style+'"';this.colX=0,this.colY=1,this.colZ=2,this.colValue=3,e.getNumberOfColumns()>4&&(this.colFilter=4)}},o.prototype.getNumberOfRows=function(e){return e.length},o.prototype.getNumberOfColumns=function(e){var t=0;for(var i in e[0])e[0].hasOwnProperty(i)&&t++;return t},o.prototype.getDistinctValues=function(e,t){for(var i=[],o=0;oe[o][t]&&(i.min=e[o][t]),i.maxe;e++){var f=(e-c)/(p-c),m=240*f,v=this._hsv2rgb(m,1,1);u.strokeStyle=v,u.beginPath(),u.moveTo(h,r+e),u.lineTo(a,r+e),u.stroke()}u.strokeStyle=this.axisColor,u.strokeRect(h,r,i,s)}if(this.style===o.STYLE.DOTSIZE&&(u.strokeStyle=this.axisColor,u.fillStyle=this.dataColor.fill,u.beginPath(),u.moveTo(h,r),u.lineTo(a,r),u.lineTo(a-i+t,d),u.lineTo(h,d),u.closePath(),u.fill(),u.stroke()),this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.DOTSIZE){var y=5,b=new g(this.valueMin,this.valueMax,(this.valueMax-this.valueMin)/5,(!0));for(b.start(),b.getCurrent()0?this.yMin:this.yMax,n=this._convert3Dto2D(new u(_,r,this.zMin)),Math.cos(2*w)>0?(m.textAlign="center",m.textBaseline="top",n.y+=b):Math.sin(2*w)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.xValueLabel(i.getCurrent())+" ",n.x,n.y),i.next()}for(m.lineWidth=1,o=void 0===this.defaultYStep,i=new g(this.yMin,this.yMax,this.yStep,o),i.start(),i.getCurrent()0?this.xMin:this.xMax,n=this._convert3Dto2D(new u(s,i.getCurrent(),this.zMin)),Math.cos(2*w)<0?(m.textAlign="center",m.textBaseline="top",n.y+=b):Math.sin(2*w)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(" "+this.yValueLabel(i.getCurrent())+" ",n.x,n.y),i.next();for(m.lineWidth=1,o=void 0===this.defaultZStep,i=new g(this.zMin,this.zMax,this.zStep,o),i.start(),i.getCurrent()0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax;!i.end();)e=this._convert3Dto2D(new u(s,r,i.getCurrent())),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(e.x,e.y),m.lineTo(e.x-b,e.y),m.stroke(),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(this.zValueLabel(i.getCurrent())+" ",e.x-5,e.y),i.next();m.lineWidth=1,e=this._convert3Dto2D(new u(s,r,this.zMin)),t=this._convert3Dto2D(new u(s,r,this.zMax)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(e.x,e.y),m.lineTo(t.x,t.y),m.stroke(),m.lineWidth=1,c=this._convert3Dto2D(new u(this.xMin,this.yMin,this.zMin)),p=this._convert3Dto2D(new u(this.xMax,this.yMin,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(c.x,c.y),m.lineTo(p.x,p.y),m.stroke(),c=this._convert3Dto2D(new u(this.xMin,this.yMax,this.zMin)),p=this._convert3Dto2D(new u(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(c.x,c.y),m.lineTo(p.x,p.y),m.stroke(),m.lineWidth=1,e=this._convert3Dto2D(new u(this.xMin,this.yMin,this.zMin)),t=this._convert3Dto2D(new u(this.xMin,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(e.x,e.y),m.lineTo(t.x,t.y),m.stroke(),e=this._convert3Dto2D(new u(this.xMax,this.yMin,this.zMin)),t=this._convert3Dto2D(new u(this.xMax,this.yMax,this.zMin)),m.strokeStyle=this.axisColor,m.beginPath(),m.moveTo(e.x,e.y),m.lineTo(t.x,t.y),m.stroke();var x=this.xLabel;x.length>0&&(l=.1/this.scale.y,s=(this.xMin+this.xMax)/2,r=Math.cos(w)>0?this.yMin-l:this.yMax+l,n=this._convert3Dto2D(new u(s,r,this.zMin)),Math.cos(2*w)>0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*w)<0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(x,n.x,n.y));var k=this.yLabel;k.length>0&&(d=.1/this.scale.x,s=Math.sin(w)>0?this.xMin-d:this.xMax+d,r=(this.yMin+this.yMax)/2,n=this._convert3Dto2D(new u(s,r,this.zMin)),Math.cos(2*w)<0?(m.textAlign="center",m.textBaseline="top"):Math.sin(2*w)>0?(m.textAlign="right",m.textBaseline="middle"):(m.textAlign="left",m.textBaseline="middle"),m.fillStyle=this.axisColor,m.fillText(k,n.x,n.y));var S=this.zLabel;S.length>0&&(h=30,s=Math.cos(w)>0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax,a=(this.zMin+this.zMax)/2,n=this._convert3Dto2D(new u(s,r,a)),m.textAlign="right",m.textBaseline="middle",m.fillStyle=this.axisColor,m.fillText(S,n.x-h,n.y))},o.prototype._hsv2rgb=function(e,t,i){var o,n,s,r,a,h;switch(r=i*t,a=Math.floor(e/60),h=r*(1-Math.abs(e/60%2-1)),a){case 0:o=r,n=h,s=0;break;case 1:o=h,n=r,s=0;break;case 2:o=0,n=r,s=h;break;case 3:o=0,n=h,s=r;break;case 4:o=h,n=0,s=r;break;case 5:o=r,n=0,s=h;break;default:o=0,n=0,s=0}return"RGB("+parseInt(255*o)+","+parseInt(255*n)+","+parseInt(255*s)+")"},o.prototype._redrawDataGrid=function(){var e,t,i,n,s,r,a,h,d,l,c,p,f=this.frame.canvas,m=f.getContext("2d");if(m.lineJoin="round",m.lineCap="round",!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(s=0;s0}else r=!0;r?(p=(e.point.z+t.point.z+i.point.z+n.point.z)/4,d=240*(1-(p-this.zMin)*this.scale.z/this.verticalRatio),l=1,this.showShadow?(c=Math.min(1+x.x/k/2,1),a=this._hsv2rgb(d,l,c),h=a):(c=1,a=this._hsv2rgb(d,l,c),h=this.axisColor)):(a="gray",h=this.axisColor),m.lineWidth=this._getStrokeWidth(e),m.fillStyle=a,m.strokeStyle=h,m.beginPath(),m.moveTo(e.screen.x,e.screen.y),m.lineTo(t.screen.x,t.screen.y),m.lineTo(n.screen.x,n.screen.y),m.lineTo(i.screen.x,i.screen.y),m.closePath(),m.fill(),m.stroke()}}else for(s=0;sc&&(c=0);var p,f,m;this.style===o.STYLE.DOTCOLOR?(p=240*(1-(d.point.value-this.valueMin)*this.scale.value),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)):this.style===o.STYLE.DOTSIZE?(f=this.dataColor.fill,m=this.dataColor.stroke):(p=240*(1-(d.point.z-this.zMin)*this.scale.z/this.verticalRatio),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)),i.lineWidth=this._getStrokeWidth(d),i.strokeStyle=m,i.fillStyle=f,i.beginPath(),i.arc(d.screen.x,d.screen.y,c,0,2*Math.PI,!0),i.fill(),i.stroke()}}},o.prototype._redrawDataBar=function(){var e,t,i,n,s=this.frame.canvas,r=s.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(e=0;e0){for(e=this.dataPoints[0],o.lineWidth=this._getStrokeWidth(e),o.lineJoin="round",o.lineCap="round",o.strokeStyle=this.dataColor.stroke,o.beginPath(),o.moveTo(e.screen.x,e.screen.y),t=1;t0?1:0>e?-1:0}var o=t[0],n=t[1],s=t[2],r=i((n.x-o.x)*(e.y-o.y)-(n.y-o.y)*(e.x-o.x)),a=i((s.x-n.x)*(e.y-n.y)-(s.y-n.y)*(e.x-n.x)),h=i((o.x-s.x)*(e.y-s.y)-(o.y-s.y)*(e.x-s.x));return!(0!=r&&0!=a&&r!=a||0!=a&&0!=h&&a!=h||0!=r&&0!=h&&r!=h)},o.prototype._dataPointFromXY=function(e,t){var i,n=100,s=null,r=null,a=null,h=new c(e,t);if(this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){s=this.dataPoints[i];var d=s.surfaces;if(d)for(var l=d.length-1;l>=0;l--){var u=d[l],p=u.corners,f=[p[0].screen,p[1].screen,p[2].screen],m=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,f)||this._insideTriangle(h,m))return s}}else for(i=0;ib)&&n>b&&(a=b,r=s)}}return r},o.prototype._showTooltip=function(e){var t,i,o;this.tooltip?(t=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(t=document.createElement("div"),t.style.position="absolute",t.style.padding="10px",t.style.border="1px solid #4d4d4d",t.style.color="#1a1a1a",t.style.background="rgba(255,255,255,0.7)",t.style.borderRadius="2px",t.style.boxShadow="5px 5px 10px rgba(128,128,128,0.5)",i=document.createElement("div"),i.style.position="absolute",i.style.height="40px",i.style.width="0",i.style.borderLeft="1px solid #4d4d4d",o=document.createElement("div"),o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.border="5px solid #4d4d4d",o.style.borderRadius="5px",this.tooltip={dataPoint:null,dom:{content:t,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=e,"function"==typeof this.showTooltip?t.innerHTML=this.showTooltip(e.point):t.innerHTML="
"+this.xLabel+":"+e.point.x+"
"+this.yLabel+":"+e.point.y+"
"+this.zLabel+":"+e.point.z+"
",t.style.left="0",t.style.top="0",this.frame.appendChild(t),this.frame.appendChild(i),this.frame.appendChild(o);var n=t.offsetWidth,s=t.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,d=e.screen.x-n/2;d=Math.min(Math.max(d,10),this.frame.clientWidth-10-n),i.style.left=e.screen.x+"px",i.style.top=e.screen.y-r+"px",t.style.left=d+"px",t.style.top=e.screen.y-r-s+"px",o.style.left=e.screen.x-a/2+"px",o.style.top=e.screen.y-h/2+"px"},o.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var e in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(e)){var t=this.tooltip.dom[e];t&&t.parentNode&&t.parentNode.removeChild(t)}}},e.exports=o},function(e,t){function i(e){return e?o(e):void 0}function o(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}e.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){o.off(e,i),t.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var o,n=0;no;++o)i[o].apply(this,t)}return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){function i(e,t,i){this.x=void 0!==e?e:0,this.y=void 0!==t?t:0,this.z=void 0!==i?i:0}i.subtract=function(e,t){var o=new i;return o.x=e.x-t.x,o.y=e.y-t.y,o.z=e.z-t.z,o},i.add=function(e,t){var o=new i;return o.x=e.x+t.x,o.y=e.y+t.y,o.z=e.z+t.z,o},i.avg=function(e,t){return new i((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2)},i.crossProduct=function(e,t){var o=new i;return o.x=e.y*t.z-e.z*t.y,o.y=e.z*t.x-e.x*t.z,o.z=e.x*t.y-e.y*t.x,o},i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.exports=i},function(e,t){function i(e,t){this.x=void 0!==e?e:0,this.y=void 0!==t?t:0}e.exports=i},function(e,t,i){function o(){this.armLocation=new n,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraLocation=new n,this.cameraRotation=new n(.5*Math.PI,0,0),this.calculateCameraOrientation()}var n=i(14);o.prototype.setArmLocation=function(e,t,i){this.armLocation.x=e,this.armLocation.y=t,this.armLocation.z=i,this.calculateCameraOrientation()},o.prototype.setArmRotation=function(e,t){void 0!==e&&(this.armRotation.horizontal=e),void 0!==t&&(this.armRotation.vertical=t,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===e&&void 0===t||this.calculateCameraOrientation()},o.prototype.getArmRotation=function(){var e={};return e.horizontal=this.armRotation.horizontal,e.vertical=this.armRotation.vertical,e},o.prototype.setArmLength=function(e){void 0!==e&&(this.armLength=e,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},o.prototype.getArmLength=function(){return this.armLength},o.prototype.getCameraLocation=function(){return this.cameraLocation},o.prototype.getCameraRotation=function(){return this.cameraRotation},o.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},e.exports=o},function(e,t,i){function o(e,t,i){this.data=e,this.column=t,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(e.get(),this.column),this.values.sort(function(e,t){return e>t?1:t>e?-1:0}),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var n=i(11);o.prototype.isLoaded=function(){return this.loaded},o.prototype.getLoadedProgress=function(){for(var e=this.values.length,t=0;this.dataPoints[t];)t++;return Math.round(t/e*100)},o.prototype.getLabel=function(){return this.graph.filterLabel},o.prototype.getColumn=function(){return this.column},o.prototype.getSelectedValue=function(){return void 0!==this.index?this.values[this.index]:void 0},o.prototype.getValues=function(){return this.values},o.prototype.getValue=function(e){if(e>=this.values.length)throw"Error: index out of range";return this.values[e]},o.prototype._getDataPoints=function(e){if(void 0===e&&(e=this.index),void 0===e)return[];var t;if(this.dataPoints[e])t=this.dataPoints[e];else{var i={};i.column=this.column,i.value=this.values[e];var o=new n(this.data,{filter:function(e){return e[i.column]==i.value}}).get();t=this.graph._getDataPoints(o),this.dataPoints[e]=t}return t},o.prototype.setOnLoadCallback=function(e){this.onLoadCallback=e},o.prototype.selectValue=function(e){if(e>=this.values.length)throw"Error: index out of range";this.index=e,this.value=this.values[e]},o.prototype.loadInBackground=function(e){void 0===e&&(e=0);var t=this.graph.frame;if(e0&&(e--,this.setIndex(e))},o.prototype.next=function(){var e=this.getIndex();e0?this.setIndex(0):this.index=void 0},o.prototype.setIndex=function(e){if(!(eo&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(e){var t=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=e/(this.values.length-1)*t,o=i+3;return o},o.prototype._onMouseMove=function(e){var t=e.clientX-this.startClientX,i=this.startSlideX+t,o=this.leftToIndex(i);this.setIndex(o),n.preventDefault()},o.prototype._onMouseUp=function(e){this.frame.style.cursor="auto",n.removeEventListener(document,"mousemove",this.onmousemove),n.removeEventListener(document,"mouseup",this.onmouseup),n.preventDefault()},e.exports=o},function(e,t){function i(e,t,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(e,t,i,o)}i.prototype.setRange=function(e,t,i,o){this._start=e?e:0,this._end=t?t:0,this.setStep(i,o)},i.prototype.setStep=function(e,t){void 0===e||0>=e||(void 0!==t&&(this.prettyStep=t),this.prettyStep===!0?this._step=i.calculatePrettyStep(e):this._step=e)},i.calculatePrettyStep=function(e){var t=function(e){return Math.log(e)/Math.LN10},i=Math.pow(10,Math.round(t(e))),o=2*Math.pow(10,Math.round(t(e/2))),n=5*Math.pow(10,Math.round(t(e/5))),s=i;return Math.abs(o-e)<=Math.abs(s-e)&&(s=o),Math.abs(n-e)<=Math.abs(s-e)&&(s=n),0>=s&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(){this._current=this._start-this._start%this._step},i.prototype.next=function(){this._current+=this._step},i.prototype.end=function(){return this._current>this._end},e.exports=i},function(e,t,i){if("undefined"!=typeof window){var o=i(21),n=window.Hammer||i(22);e.exports=o(n,{preventDefault:"mouse"})}else e.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(e,t,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(function(){var e=null;return function t(i,o){function n(e){return e.match(/[^ ]+/g)}function s(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var i=!1;t.stopPropagation=function(){i=!0};var o=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof o&&(t.srcEvent.stopPropagation=function(){o(),t.stopPropagation()}),t.firstTarget=e;for(var n=e;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a0?d._handlers[e]=o:(i.off(e,s),delete d._handlers[e]))}),d},d.emit=function(t,o){e=o.target,i.emit(t,o)},d.destroy=function(){var e=i.element.hammer,t=e.indexOf(d);-1!==t&&e.splice(t,1),e.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(e,t,i){var o;!function(n,s,r,a){function h(e,t,i){return setTimeout(p(e,i),t)}function d(e,t,i){return!!Array.isArray(e)&&(l(e,i[t],i),!0)}function l(e,t,i){var o;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(o=0;o\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),e.apply(this,arguments)}}function c(e,t,i){var o,n=t.prototype;o=e.prototype=Object.create(n),o.constructor=e,o._super=n,i&&ue(o,i)}function p(e,t){return function(){return e.apply(t,arguments)}}function f(e,t){return typeof e==fe?e.apply(t?t[0]||a:a,t):e}function m(e,t){return e===a?t:e}function g(e,t,i){l(w(t),function(t){e.addEventListener(t,i,!1)})}function v(e,t,i){l(w(t),function(t){e.removeEventListener(t,i,!1)})}function y(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function b(e,t){return e.indexOf(t)>-1}function w(e){return e.trim().split(/\s+/g)}function _(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var o=0;oi[t]}):o.sort()),o}function S(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=A(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=R(o);t.timeStamp=ve(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=F(a,h),t.distance=z(a,h),P(i,t),t.offsetDirection=N(t.deltaX,t.deltaY);var d=L(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=ge(d.x)>ge(d.y)?d.x:d.y,t.scale=r?j(r.pointers,o):1,t.rotation=r?B(r.pointers,o):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,I(i,t);var l=e.element;y(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function P(e,t){var i=t.center,o=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};t.eventType!==Te&&s.eventType!==Ie||(n=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-o.x),t.deltaY=n.y+(i.y-o.y)}function I(e,t){var i,o,n,s,r=e.lastInterval||t,h=t.timeStamp-r.timeStamp;if(t.eventType!=Ae&&(h>Ee||r.velocity===a)){var d=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,u=L(h,d,l);o=u.x,n=u.y,i=ge(u.x)>ge(u.y)?u.x:u.y,s=N(d,l),e.lastInterval=t}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=o,t.velocityY=n,t.direction=s}function A(e){for(var t=[],i=0;in;)i+=e[n].clientX,o+=e[n].clientY,n++;return{x:me(i/t),y:me(o/t)}}function L(e,t,i){return{x:t/e||0,y:i/e||0}}function N(e,t){return e===t?Re:ge(e)>=ge(t)?0>e?Le:Ne:0>t?ze:Fe}function z(e,t,i){i||(i=We);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(o*o+n*n)}function F(e,t,i){i||(i=We);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,o)/Math.PI}function B(e,t){return F(t[1],t[0],$e)+F(e[1],e[0],$e)}function j(e,t){return z(t[0],t[1],$e)/z(e[0],e[1],$e)}function H(){this.evEl=Ye,this.evWin=Ge,this.allow=!0,this.pressed=!1,M.apply(this,arguments)}function W(){this.evEl=Xe,this.evWin=Ke,M.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function $(){this.evTarget=Je,this.evWin=Qe,this.started=!1,M.apply(this,arguments)}function U(e,t){var i=x(e.touches),o=x(e.changedTouches);return t&(Ie|Ae)&&(i=k(i.concat(o),"identifier",!0)),[i,o]}function Y(){this.evTarget=tt,this.targetIds={},M.apply(this,arguments)}function G(e,t){var i=x(e.touches),o=this.targetIds;if(t&(Te|Pe)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(e.changedTouches),a=[],h=this.target;if(s=i.filter(function(e){return y(e.target,h)}),t===Te)for(n=0;na&&(t.push(e),a=t.length-1):n&(Ie|Ae)&&(i=!0),0>a||(t[a]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))}});var Ze={touchstart:Te,touchmove:Pe,touchend:Ie,touchcancel:Ae},Je="touchstart",Qe="touchstart touchmove touchend touchcancel";c($,M,{handler:function(e){var t=Ze[e.type];if(t===Te&&(this.started=!0),this.started){var i=U.call(this,e,t);t&(Ie|Ae)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Oe,srcEvent:e})}}});var et={touchstart:Te,touchmove:Pe,touchend:Ie,touchcancel:Ae},tt="touchstart touchmove touchend touchcancel";c(Y,M,{handler:function(e){var t=et[e.type],i=G.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Oe,srcEvent:e})}}),c(V,M,{handler:function(e,t,i){var o=i.pointerType==Oe,n=i.pointerType==Me;if(o)this.mouse.allow=!1;else if(n&&!this.mouse.allow)return;t&(Ie|Ae)&&(this.mouse.allow=!0),this.callback(e,t,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var it=S(pe.style,"touchAction"),ot=it!==a,nt="compute",st="auto",rt="manipulation",at="none",ht="pan-x",dt="pan-y";q.prototype={set:function(e){e==nt&&(e=this.compute()),ot&&this.manager.element.style&&(this.manager.element.style[it]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return l(this.manager.recognizers,function(t){f(t.options.enable,[t])&&(e=e.concat(t.getTouchAction())); +}),X(e.join(" "))},preventDefaults:function(e){if(!ot){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var o=this.actions,n=b(o,at),s=b(o,dt),r=b(o,ht);if(n){var a=1===e.pointers.length,h=e.distance<2,d=e.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return n||s&&i&Be||r&&i&je?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var lt=1,ut=2,ct=4,pt=8,ft=pt,mt=16,gt=32;K.prototype={defaults:{},set:function(e){return ue(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=Q(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)?this:(e=Q(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return e=Q(e,this),-1===_(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Q(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){i.manager.emit(t,e)}var i=this,o=this.state;pt>o&&t(i.options.event+Z(o)),t(i.options.event),e.additionalEvent&&t(e.additionalEvent),o>=pt&&t(i.options.event+Z(o))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=gt)},canEmit:function(){for(var e=0;es?Le:Ne,i=s!=this.pX,o=Math.abs(e.deltaX)):(n=0===r?Re:0>r?ze:Fe,i=r!=this.pY,o=Math.abs(e.deltaY))),e.direction=n,i&&o>t.threshold&&n&t.direction},attrTest:function(e){return ee.prototype.attrTest.call(this,e)&&(this.state&ut||!(this.state&ut)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=J(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),c(ie,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ut)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),c(oe,K,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[st]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distancet.time;if(this._input=e,!o||!i||e.eventType&(Ie|Ae)&&!n)this.reset();else if(e.eventType&Te)this.reset(),this._timer=h(function(){this.state=ft,this.tryEmit()},t.time,this);else if(e.eventType&Ie)return ft;return gt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===ft&&(e&&e.eventType&Ie?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ve(),this.manager.emit(this.options.event,this._input)))}}),c(ne,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ut)}}),c(se,ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Be|je,pointers:1},getTouchAction:function(){return te.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(Be|je)?t=e.overallVelocity:i&Be?t=e.overallVelocityX:i&je&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&ge(t)>this.options.velocity&&e.eventType&Ie},emit:function(e){var t=J(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),c(re,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rt]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance=t;t++)r[String.fromCharCode(t)]={code:65+(t-97),shift:!1};for(t=65;90>=t;t++)r[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;9>=t;t++)r[""+t]={code:48+t,shift:!1};for(t=1;12>=t;t++)r["F"+t]={code:111+t,shift:!1};for(t=0;9>=t;t++)r["num"+t]={code:96+t,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(e){d(e,"keydown")},h=function(e){d(e,"keyup")},d=function(e,t){if(void 0!==s[t][e.keyCode]){for(var o=s[t][e.keyCode],n=0;nt)&&(n=t),(null===s||i>s)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=!t||void 0===t.animation||t.animation;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(e){var t,i=!e||void 0===e.animation||e.animation,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(t=this.getDataRange(),this.moveTo(t.min.valueOf(),{animation:i})):(t=this.getItemRange(),this.range.setRange(t.min,t.max,i))},n.prototype.getItemRange=function(){var e=this,t=this.getDataRange(),i=null!==t.min?t.min.valueOf():null,o=null!==t.max?t.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,u;!function(){var t=function(e){return l.convert(e.data.start,"Date").valueOf()},c=function(e){var t=void 0!=e.data.end?e.data.end:e.data.start;return l.convert(t,"Date").valueOf()};r=o-i,0>=r&&(r=10),a=r/e.props.center.width,l.forEach(e.itemSet.items,function(e){e.show(),e.repositionX();var r=t(e),h=c(e);if(this.options.rtl)var d=r-(e.getWidthRight()+10)*a,l=h+(e.getWidthLeft()+10)*a;else var d=r-(e.getWidthLeft()+10)*a,l=h+(e.getWidthRight()+10)*a;i>d&&(i=d,n=e),l>o&&(o=l,s=e)}.bind(e)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,u=e.props.center.width-h-d,u>0&&(e.options.rtl?(i=t(n)-d*r/u,o=c(s)+h*r/u):(i=t(n)-h*r/u,o=c(s)+d*r/u)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var e=null,t=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===e||e>o)&&(e=o),(null===t||n>t)&&(t=n)}),{min:null!=e?new Date(e):null,max:null!=t?new Date(t):null}},n.prototype.getEventProperties=function(e){var t=e.center?e.center.x:e.clientX,i=e.center?e.center.y:e.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-t;else var o=t-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(e),r=this.itemSet.groupFromTarget(e),a=v.customTimeFromTarget(e),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),u=this.body.util.getStep(),c=this._toTime(o),p=h?h(c,d,u):c,f=l.getTarget(e),m=null;return null!=s?m="item":null!=a?m="custom-time":l.hasParent(f,this.timeAxis.dom.foreground)?m="axis":this.timeAxis2&&l.hasParent(f,this.timeAxis2.dom.foreground)?m="axis":l.hasParent(f,this.itemSet.dom.labelSet)?m="group-label":l.hasParent(f,this.currentTime.bar)?m="current-time":l.hasParent(f,this.dom.center)&&(m="background"),{event:e,item:s?s.id:null,group:r?r.groupId:null,what:m,pageX:e.srcEvent?e.srcEvent.pageX:e.pageX,pageY:e.srcEvent?e.srcEvent.pageY:e.pageY,x:o,y:n,time:c,snappedTime:p}},e.exports=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},e.optionsContainer=document.createElement("div"),e.optionsContainer.className="vis-configuration vis-config-option-container",e.domElements.push(e.optionsContainer),e.domElements.push(t)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e1?o-1:0),r=1;o>r;r++)n[r-1]=t[r];return n.forEach(function(e){s.appendChild(e)}),i.domElements.push(s),{v:i.domElements.length}}();if("object"===("undefined"==typeof a?"undefined":s(a)))return a.v}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerHTML=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0?o.innerHTML=""+e+":":o.innerHTML=e+":",o}},{key:"_makeDropdown",value:function(e,t,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==t&&-1!==e.indexOf(t)&&(n=e.indexOf(t));for(var s=0;st&&n>t*u?(a.min=Math.ceil(t*u),l=a.min,d="range increased"):n>t/u&&(a.min=Math.ceil(t/u),l=a.min,d="range increased"),t*u>s&&1!==s&&(a.max=Math.ceil(t*u),l=a.max,d="range increased"),a.value=t}else a.value=o;var c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;var p=this;a.onchange=function(){c.value=this.value,p._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};var f=this._makeLabel(i[i.length-1],i),m=this._makeItem(i,f,a,c);""!==d&&this.popupHistory[m]!==l&&(this.popupHistory[m]=l,this._setupPopup(d,m))}},{key:"_setupPopup",value:function(e,t){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCountervar options = "+JSON.stringify(e,null,2)+""}},{key:"getOptions",value:function(){for(var e={},t=0;ts;s++)for(r=0;rp?p+1:p;var f=l/this.r,m=a.RGBToHSV(this.color.r,this.color.g,this.color.b);m.h=p,m.s=f;var g=a.HSVToRGB(m.h,m.s,m.v);g.a=this.color.a,this.color=g,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),e}();t["default"]=h},function(e,t,i){i(20),t.onTouch=function(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on("hammer.input",t.inputHandler)},t.onRelease=function(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on("hammer.input",t.inputHandler)},t.offTouch=function(e,t){e.off("hammer.input",t.inputHandler)},t.offRelease=t.offTouch,t.disablePreventDefaultVertically=function(e){var t="pan-y";return e.getTouchAction=function(){return[t]},e}},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;is.distance?console.log('%cUnknown option detected: "'+t+'" in '+e.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+t+'". Did you mean "'+n.closestMatch+'"?'+e.printLocation(n.path,t),d):console.log('%cUnknown option detected: "'+t+'". Did you mean one of these: '+e.print(Object.keys(i))+e.printLocation(o,t),d),a=!0}},{key:"findInOptions",value:function(t,i,o){var n=!(arguments.length<=3||void 0===arguments[3])&&arguments[3],s=1e9,a="",h=[],d=t.toLowerCase(),l=void 0;for(var u in i){var c=void 0;if(void 0!==i[u].__type__&&n===!0){var p=e.findInOptions(t,i[u],r.copyAndExtendArray(o,u));s>p.distance&&(a=p.closestMatch,h=p.path,s=p.distance,l=p.indexMatch)}else-1!==u.toLowerCase().indexOf(d)&&(l=u),c=e.levenshteinDistance(t,u),s>c&&(a=u,h=r.copyArray(o),s=c)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(e,t){for(var i=arguments.length<=2||void 0===arguments[2]?"Problem value found at: \n":arguments[2],o="\n\n"+i+"options = {\n",n=0;ns;s++)o+=" ";o+=e[n]+": {\n"}for(var r=0;rc,r=s||null===n?n:l+(n-l)*i,p=s||null===a?a:u+(a-u)*i;y=h._applyRange(r,p),d.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),g=g||y,y&&h.body.emitter.emit("rangechange",{start:new Date(h.start),end:new Date(h.end),byUser:o}),s?g&&h.body.emitter.emit("rangechanged",{start:new Date(h.start),end:new Date(h.end),byUser:o}):h.animationTimer=setTimeout(w,20)}};return v()}var y=this._applyRange(n,a);if(d.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),y){var b={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",b),this.body.emitter.emit("rangechanged",b)}},o.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},o.prototype._applyRange=function(e,t){var i,o=null!=e?r.convert(e,"Date").valueOf():this.start,n=null!=t?r.convert(t,"Date").valueOf():this.end,s=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+e+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+t+'"');if(o>n&&(n=o),null!==a&&a>o&&(i=a-o,o+=i,n+=i,null!=s&&n>s&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=a&&a>o&&(o=a)),null!==this.options.zoomMin){var h=parseFloat(this.options.zoomMin);0>h&&(h=0),h>n-o&&(this.end-this.start===h&&o>this.start&&nd&&(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},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(e,t){return o.conversion(this.start,this.end,e,t)},o.conversion=function(e,t,i,o){return void 0===o&&(o=0),0!=i&&t-e!=0?{offset:e,scale:i/(t-e-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(e){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(e)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(e){if(this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var t=this.options.direction;n(t);var i="horizontal"==t?e.deltaX:e.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,s=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=s;var r="horizontal"==t?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,l=this.props.touch.end+a,u=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),c=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(u!=h||c!=l)return this.deltaDifference+=i,this.props.touch.start=u,this.props.touch.end=c,void this._onDrag(e);this.previousDelta=i,this._applyRange(h,l);var p=new Date(this.start),f=new Date(this.end);this.body.emitter.emit("rangechange",{start:p,end:f,byUser:!0})}},o.prototype._onDragEnd=function(e){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(e){if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(e)&&(!this.options.zoomKey||e[this.options.zoomKey])){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),t){var i;i=0>t?1-t/5:1/(1+t/5);var o=this.getPointer({x:e.clientX,y:e.clientY},this.body.dom.center),n=this._pointerToDate(o);this.zoom(i,n,t)}e.preventDefault()}},o.prototype._onTouch=function(e){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(e){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(e.center,this.body.dom.center));var t=1/(e.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*t,a=i+s+(this.props.touch.end-(i+s))*t;this.startToFront=0>=1-t,this.endToFront=0>=t-1;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,1-t,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,t-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-e.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(e){var t=e.center?e.center.x:e.clientX;if(this.options.rtl)var i=t-r.getAbsoluteLeft(this.body.dom.centerContainer);else var i=r.getAbsoluteRight(this.body.dom.centerContainer)-t;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(e){var t,i=this.options.direction;if(n(i),"horizontal"==i)return this.body.util.toTime(e.x).valueOf();var o=this.body.domProps.center.height;return t=this.conversion(o),e.y/t.scale+t.offset},o.prototype.getPointer=function(e,t){return this.options.rtl?{x:r.getAbsoluteRight(t)-e.x,y:e.y-r.getAbsoluteTop(t)}:{x:e.x-r.getAbsoluteLeft(t),y:e.y-r.getAbsoluteTop(t)}},o.prototype.zoom=function(e,t,i){null==t&&(t=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,t),s=o-n,r=t-n+(this.start-(t-n))*e,a=t+s+(this.end-(t+s))*e;this.startToFront=!(i>0),this.endToFront=!(-i>0);var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);h==r&&l==a||(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(e){var t=this.end-this.start,i=this.start+t*e,o=this.end+t*e;this.start=i,this.end=o},o.prototype.moveTo=function(e){var t=(this.start+this.end)/2,i=t-e,o=this.start-i,n=this.end-i;this.setRange(o,n)},e.exports=o},function(e,t){function i(e,t){this.options=null,this.props=null}i.prototype.setOptions=function(e){e&&util.extend(this.options,e)},i.prototype.redraw=function(){return!1},i.prototype.destroy=function(){},i.prototype._isResized=function(){var e=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,e},e.exports=i},function(e,t){t.convertHiddenOptions=function(e,i,o){if(o&&!Array.isArray(o))return t.convertHiddenOptions(e,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n=4*a){var c=0,p=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(c=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-c,"days"),p.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(c=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(c,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(c=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(c,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;p>d;)switch(i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()}),o[h].repeat){case"daily":d.add(1,"days"),l.add(1,"days");break;case"weekly":d.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":d.add(1,"months"),l.add(1,"months");break;case"yearly":d.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()})}}t.removeDuplicates(i);var g=t.isHidden(i.range.start,i.hiddenDates),v=t.isHidden(i.range.end,i.hiddenDates),y=i.range.start,b=i.range.end;1==g.hidden&&(y=1==i.range.startToFront?g.startDate-1:g.endDate+1),1==v.hidden&&(b=1==i.range.endToFront?v.startDate-1:v.endDate+1),1!=g.hidden&&1!=v.hidden||i.range._applyRange(y,b)}},t.removeDuplicates=function(e){for(var t=e.hiddenDates,i=[],o=0;o=t[o].start&&t[n].end<=t[o].end?t[n].remove=!0:t[n].start>=t[o].start&&t[n].start<=t[o].end?(t[o].end=t[n].end,t[n].remove=!0):t[n].end>=t[o].start&&t[n].end<=t[o].end&&(t[o].start=t[n].start,t[n].remove=!0));for(var o=0;o=r&&a>n){o=!0;break}}if(1==o&&n=t&&i>r&&(o+=r-s)}return o},t.correctTimeForHidden=function(e,i,o,n){return n=e(n).toDate().valueOf(),n-=t.getHiddenDurationBefore(e,i,o,n)},t.getHiddenDurationBefore=function(e,t,i,o){var n=0;o=e(o).toDate().valueOf();for(var s=0;s=i.start&&a=a&&(n+=a-r)}return n},t.getAccumulatedHiddenDuration=function(e,t,i){for(var o=0,n=0,s=t.start,r=0;r=t.start&&h=i)break;o+=h-a}}return o},t.snapAwayFromHidden=function(e,i,o,n){var s=t.isHidden(i,e);return 1==s.hidden?0>o?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},t.isHidden=function(e,t){for(var i=0;i=o&&n>e)return{hidden:!0,startDate:o,endDate:n}}return{hidden:!1,startDate:o,endDate:n}}},function(e,t,i){function o(){}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(13),r=i(20),a=i(28),h=i(1),d=(i(9),i(11),i(30),i(34),i(44)),l=i(45),u=i(32),c=i(46);s(o.prototype),o.prototype._create=function(e){function t(e){i.isActive()&&i.emit("mousewheel",e)}this.dom={},this.dom.container=e,this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"), +this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.on("rangechange",function(){this.initialDrawDone===!0&&this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("pan",this._onDrag.bind(this));var i=this;this.on("_change",function(e){e&&1==e.queue?i._redrawTimer||(i._redrawTimer=setTimeout(function(){i._redrawTimer=null,i._redraw()},0)):i._redraw()}),this.hammer=new r(this.dom.root);var o=this.hammer.get("pinch").set({enable:!0});a.disablePreventDefaultVertically(o),this.hammer.get("pan").set({threshold:5,direction:r.DIRECTION_HORIZONTAL}),this.listeners={};var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];if(n.forEach(function(e){var t=function(t){i.isActive()&&i.emit(e,t)};i.hammer.on(e,t),i.listeners[e]=t}),a.onTouch(this.hammer,function(e){i.emit("touch",e)}.bind(this)),a.onRelease(this.hammer,function(e){i.emit("release",e)}.bind(this)),this.dom.root.addEventListener("mousewheel",t),this.dom.root.addEventListener("DOMMouseScroll",t),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,!e)throw new Error("No container provided");e.appendChild(this.dom.root)},o.prototype.setOptions=function(e){if(e){var t=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","rtl","throttleRedraw"];if(h.selectiveExtend(t,this.options,e),this.options.rtl){var i=this.dom.leftContainer;this.dom.leftContainer=this.dom.rightContainer,this.dom.rightContainer=i,this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"}if(this.options.orientation={item:void 0,axis:void 0},"orientation"in e&&("string"==typeof e.orientation?this.options.orientation={item:e.orientation,axis:e.orientation}:"object"===n(e.orientation)&&("item"in e.orientation&&(this.options.orientation.item=e.orientation.item),"axis"in e.orientation&&(this.options.orientation.axis=e.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){var o=this.timeAxis2=new d(this.body);o.setOptions=function(e){var t=e?h.extend({},e):{};t.orientation="top",d.prototype.setOptions.call(o,t)},this.components.push(o)}}else if(this.timeAxis2){var s=this.components.indexOf(this.timeAxis2);-1!==s&&this.components.splice(s,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof e.drawPoints&&(e.drawPoints={onRender:e.drawPoints}),"hiddenDates"in this.options&&u.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in e&&(e.clickToUse?this.activator||(this.activator=new l(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),"showCustomTime"in e)throw new Error("Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])");this._initAutoResize()}if(this.components.forEach(function(t){return t.setOptions(e)}),"configure"in e){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(e.configure);var r=h.deepExtend({},this.options);this.components.forEach(function(e){h.deepExtend(r,e.options)}),this.configurator.setModuleOptions({global:r})}this._origRedraw?this._redraw():(this._origRedraw=this._redraw.bind(this),this._redraw=h.throttle(this._origRedraw,this.options.throttleRedraw))},o.prototype.isActive=function(){return!this.activator||this.activator.active},o.prototype.destroy=function(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(var e in this.listeners)this.listeners.hasOwnProperty(e)&&delete this.listeners[e];this.listeners=null,this.hammer=null,this.components.forEach(function(e){return e.destroy()}),this.body=null},o.prototype.setCustomTime=function(e,t){var i=this.customTimes.filter(function(e){return t===e.options.id});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));i.length>0&&i[0].setCustomTime(e)},o.prototype.getCustomTime=function(e){var t=this.customTimes.filter(function(t){return t.options.id===e});if(0===t.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));return t[0].getCustomTime()},o.prototype.setCustomTimeTitle=function(e,t){var i=this.customTimes.filter(function(e){return e.options.id===t});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));return i.length>0?i[0].setCustomTitle(e):void 0},o.prototype.getEventProperties=function(e){return{event:e}},o.prototype.addCustomTime=function(e,t){var i=void 0!==e?h.convert(e,"Date").valueOf():new Date,o=this.customTimes.some(function(e){return e.options.id===t});if(o)throw new Error("A custom time with id "+JSON.stringify(t)+" already exists");var n=new c(this.body,h.extend({},this.options,{time:i,id:t}));return this.customTimes.push(n),this.components.push(n),this._redraw(),t},o.prototype.removeCustomTime=function(e){var t=this.customTimes.filter(function(t){return t.options.id===e});if(0===t.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));t.forEach(function(e){this.customTimes.splice(this.customTimes.indexOf(e),1),this.components.splice(this.components.indexOf(e),1),e.destroy()}.bind(this))},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.fit=function(e){var t=this.getDataRange();if(null!==t.min||null!==t.max){var i=t.max-t.min,o=new Date(t.min.valueOf()-.01*i),n=new Date(t.max.valueOf()+.01*i),s=!e||void 0===e.animation||e.animation;this.range.setRange(o,n,s)}},o.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},o.prototype.setWindow=function(e,t,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0===n.animation||n.animation,this.range.setRange(n.start,n.end,o)}else o=!i||void 0===i.animation||i.animation,this.range.setRange(e,t,o)},o.prototype.moveTo=function(e,t){var i=this.range.end-this.range.start,o=h.convert(e,"Date").valueOf(),n=o-i/2,s=o+i/2,r=!t||void 0===t.animation||t.animation;this.range.setRange(n,s,r)},o.prototype.getWindow=function(){var e=this.range.getRange();return{start:new Date(e.start),end:new Date(e.end)}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){this.redrawCount++;var e=!1,t=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){u.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==t.orientation?(h.addClassName(o.root,"vis-top"),h.removeClassName(o.root,"vis-bottom")):(h.removeClassName(o.root,"vis-top"),h.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=h.option.asSize(t.maxHeight,""),o.root.style.minHeight=h.option.asSize(t.minHeight,""),o.root.style.width=h.option.asSize(t.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var n=o.root.offsetHeight-o.root.clientHeight,s=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(s=n),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var a=Math.max(i.left.height,i.center.height,i.right.height),d=i.top.height+a+i.bottom.height+n+i.border.top+i.border.bottom;o.root.style.height=h.option.asSize(t.height,d+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-n;var l=i.root.height-i.top.height-i.bottom.height-n;i.centerContainer.height=l,i.leftContainer.height=l,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-s,i.left.width=o.leftContainer.clientWidth||-i.border.left,i.leftContainer.width=i.left.width,i.right.width=o.rightContainer.clientWidth||-i.border.right,i.rightContainer.width=i.right.width;var c=i.root.width-i.left.width-i.right.width-s;i.center.width=c,i.centerContainer.width=c,i.top.width=c,i.bottom.width=c,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px",this._updateScrollTop();var p=this.props.scrollTop;"top"!=t.orientation.item&&(p+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=p+"px",o.left.style.left="0",o.left.style.top=p+"px",o.right.style.left="0",o.right.style.top=p+"px";var f=0==this.props.scrollTop?"hidden":"",m=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=f,o.shadowBottom.style.visibility=m,o.shadowTopLeft.style.visibility=f,o.shadowBottomLeft.style.visibility=m,o.shadowTopRight.style.visibility=f,o.shadowBottomRight.style.visibility=m;var g=this.props.center.height>this.props.centerContainer.height;this.hammer.get("pan").set({direction:g?r.DIRECTION_ALL:r.DIRECTION_HORIZONTAL}),this.components.forEach(function(t){e=t.redraw()||e});var v=5;if(e){if(this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTopt;t++)o=this.selection[t],n=this.items[o],n&&n.unselect();for(this.selection=[],t=0,i=e.length;i>t;t++)o=e[t],n=this.items[o],n&&(this.selection.push(o),n.select())},o.prototype.getSelection=function(){return this.selection.concat([])},o.prototype.getVisibleItems=function(){var e=this.body.range.getRange();if(this.options.rtl)var t=this.body.util.toScreen(e.start),i=this.body.util.toScreen(e.end);else var i=this.body.util.toScreen(e.start),t=this.body.util.toScreen(e.end);var o=[];for(var n in this.groups)if(this.groups.hasOwnProperty(n))for(var s=this.groups[n],r=s.visibleItems,a=0;at&&o.push(h.id):h.lefti&&o.push(h.id)}return o},o.prototype._deselect=function(e){for(var t=this.selection,i=0,o=t.length;o>i;i++)if(t[i]==e){t.splice(i,1);break}},o.prototype.redraw=function(){var e=this.options.margin,t=this.body.range,i=r.option.asSize,o=this.options,n=o.orientation.item,s=!1,a=this.dom.frame;this.props.top=this.body.domProps.top.height+this.body.domProps.border.top,this.options.rtl?this.props.right=this.body.domProps.right.width+this.body.domProps.border.right:this.props.left=this.body.domProps.left.width+this.body.domProps.border.left,a.className="vis-itemset",s=this._orderGroups()||s;var h=t.end-t.start,d=h!=this.lastVisibleInterval||this.props.width!=this.props.lastWidth;d&&(this.stackDirty=!0),this.lastVisibleInterval=h,this.props.lastWidth=this.props.width;var l=this.stackDirty,u=this._firstGroup(),c={item:e.item,axis:e.axis},p={item:e.item,axis:e.item.vertical/2},f=0,m=e.axis+e.item.vertical;return this.groups[y].redraw(t,p,l),r.forEach(this.groups,function(e){var i=e==u?c:p,o=e.redraw(t,i,l);s=o||s,f+=e.height}),f=Math.max(f,m),this.stackDirty=!1,a.style.height=i(f),this.props.width=a.offsetWidth,this.props.height=f,this.dom.axis.style.top=i("top"==n?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.options.rtl?this.dom.axis.style.right="0":this.dom.axis.style.left="0",s=this._isResized()||s},o.prototype._firstGroup=function(){var e="top"==this.options.orientation.item?0:this.groupIds.length-1,t=this.groupIds[e],i=this.groups[t]||this.groups[v];return i||null},o.prototype._updateUngrouped=function(){var e,t,i=this.groups[v];if(this.groups[y],this.groupsData){if(i){i.hide(),delete this.groups[v];for(t in this.items)if(this.items.hasOwnProperty(t)){e=this.items[t],e.parent&&e.parent.remove(e);var o=this._getGroupId(e.data),n=this.groups[o];n&&n.add(e)||e.hide()}}}else if(!i){var s=null,r=null;i=new u(s,r,this),this.groups[v]=i;for(t in this.items)this.items.hasOwnProperty(t)&&(e=this.items[t],i.add(e));i.show()}},o.prototype.getLabelSet=function(){return this.dom.labelSet},o.prototype.setItems=function(e){var t,i=this,o=this.itemsData;if(e){if(!(e instanceof a||e instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=e}else this.itemsData=null;if(o&&(r.forEach(this.itemListeners,function(e,t){o.off(t,e)}),t=o.getIds(),this._onRemove(t)),this.itemsData){var n=this.id;r.forEach(this.itemListeners,function(e,t){i.itemsData.on(t,e,n)}),t=this.itemsData.getIds(),this._onAdd(t),this._updateUngrouped()}this.body.emitter.emit("_change",{queue:!0})},o.prototype.getItems=function(){return this.itemsData},o.prototype.setGroups=function(e){var t,i=this;if(this.groupsData&&(r.forEach(this.groupListeners,function(e,t){i.groupsData.off(t,e)}),t=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(t)),e){if(!(e instanceof a||e instanceof h))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=e}else this.groupsData=null;if(this.groupsData){var o=this.id;r.forEach(this.groupListeners,function(e,t){i.groupsData.on(t,e,o)}),t=this.groupsData.getIds(),this._onAddGroups(t)}this._updateUngrouped(),this._order(),this.body.emitter.emit("_change",{queue:!0})},o.prototype.getGroups=function(){return this.groupsData},o.prototype.removeItem=function(e){var t=this.itemsData.get(e),i=this.itemsData.getDataSet();t&&this.options.onRemove(t,function(t){t&&i.remove(e)})},o.prototype._getType=function(e){return e.type||this.options.type||(e.end?"range":"box")},o.prototype._getGroupId=function(e){var t=this._getType(e);return"background"==t&&void 0==e.group?y:this.groupsData?e.group:v},o.prototype._onUpdate=function(e){var t=this;e.forEach(function(e){var i,n=t.itemsData.get(e,t.itemOptions),s=t.items[e],r=t._getType(n),a=o.types[r];if(s&&(a&&s instanceof a?t._updateItem(s,n):(i=s.selected,t._removeItem(s),s=null)),!s){if(!a)throw"rangeoverflow"==r?new TypeError('Item type "rangeoverflow" is deprecated. Use css styling instead: .vis-item.vis-range .vis-item-content {overflow: visible;}'):new TypeError('Unknown item type "'+r+'"');s=new a(n,t.conversion,t.options),s.id=e,t._addItem(s),i&&(this.selection.push(e),s.select())}}.bind(this)),this._order(),this.stackDirty=!0,this.body.emitter.emit("_change",{queue:!0})},o.prototype._onAdd=o.prototype._onUpdate,o.prototype._onRemove=function(e){var t=0,i=this;e.forEach(function(e){var o=i.items[e];o&&(t++,i._removeItem(o))}),t&&(this._order(),this.stackDirty=!0,this.body.emitter.emit("_change",{queue:!0}))},o.prototype._order=function(){r.forEach(this.groups,function(e){e.order()})},o.prototype._onUpdateGroups=function(e){this._onAddGroups(e)},o.prototype._onAddGroups=function(e){var t=this;e.forEach(function(e){var i=t.groupsData.get(e),o=t.groups[e];if(o)o.setData(i);else{if(e==v||e==y)throw new Error("Illegal group id. "+e+" is a reserved id.");var n=Object.create(t.options);r.extend(n,{height:null}),o=new u(e,i,t),t.groups[e]=o;for(var s in t.items)if(t.items.hasOwnProperty(s)){var a=t.items[s];a.data.group==e&&o.add(a)}o.order(),o.show()}}),this.body.emitter.emit("_change",{queue:!0})},o.prototype._onRemoveGroups=function(e){var t=this.groups;e.forEach(function(e){var i=t[e];i&&(i.hide(),delete t[e])}),this.markDirty(),this.body.emitter.emit("_change",{queue:!0})},o.prototype._orderGroups=function(){if(this.groupsData){var e=this.groupsData.getIds({order:this.options.groupOrder}),t=!r.equalArray(e,this.groupIds);if(t){var i=this.groups;e.forEach(function(e){i[e].hide()}),e.forEach(function(e){i[e].show()}),this.groupIds=e}return t}return!1},o.prototype._addItem=function(e){this.items[e.id]=e;var t=this._getGroupId(e.data),i=this.groups[t];i&&i.add(e)},o.prototype._updateItem=function(e,t){var i=e.data.group,o=e.data.subgroup;if(e.setData(t),i!=e.data.group||o!=e.data.subgroup){var n=this.groups[i];n&&n.remove(e);var s=this._getGroupId(e.data),r=this.groups[s];r&&r.add(e)}},o.prototype._removeItem=function(e){e.hide(),delete this.items[e.id];var t=this.selection.indexOf(e.id);-1!=t&&this.selection.splice(t,1),e.parent&&e.parent.remove(e)},o.prototype._constructByEndArray=function(e){for(var t=[],i=0;in+s)return}else{var a=t.height;if(n+a-s>o)return}}if(t&&t!=this.groupTouchParams.group){var h=this.groupsData,d=h.get(t.groupId),l=h.get(this.groupTouchParams.group.groupId);l&&d&&(this.options.groupOrderSwap(l,d,this.groupsData),this.groupsData.update(l),this.groupsData.update(d));var u=this.groupsData.getIds({order:this.options.groupOrder});if(!r.equalArray(u,this.groupTouchParams.originalOrder))for(var h=this.groupsData,c=this.groupTouchParams.originalOrder,p=this.groupTouchParams.group.groupId,f=Math.min(c.length,u.length),m=0,g=0,v=0;f>m;){for(;f>m+g&&f>m+v&&u[m+g]==c[m+v];)m++;if(m+g>=f)break;if(u[m+g]!=p)if(c[m+v]!=p){var y=u.indexOf(c[m+v]),b=h.get(u[m+g]),w=h.get(c[m+v]);this.options.groupOrderSwap(b,w,h),h.update(b),h.update(w);var _=u[m+g];u[m+g]=c[m+v],u[y]=_,m++}else v=1;else g=1}}}},o.prototype._onGroupDragEnd=function(e){if(this.options.groupEditable.order&&this.groupTouchParams.group){e.stopPropagation();var t=this,i=t.groupTouchParams.group.groupId,o=t.groupsData.getDataSet(),n=r.extend({},o.get(i));t.options.onMoveGroup(n,function(e){if(e)e[o._fieldId]=i,o.update(e);else{var n=o.getIds({order:t.options.groupOrder});if(!r.equalArray(n,t.groupTouchParams.originalOrder))for(var s=t.groupTouchParams.originalOrder,a=Math.min(s.length,n.length),h=0;a>h;){for(;a>h&&n[h]==s[h];)h++;if(h>=a)break;var d=n.indexOf(s[h]),l=o.get(n[h]),u=o.get(s[h]);t.options.groupOrderSwap(l,u,o),groupsData.update(l),groupsData.update(u);var c=n[h];n[h]=s[h],n[d]=c,h++}}}),t.body.emitter.emit("groupDragged",{groupId:i})}},o.prototype._onSelectItem=function(e){if(this.options.selectable){var t=e.srcEvent&&(e.srcEvent.ctrlKey||e.srcEvent.metaKey),i=e.srcEvent&&e.srcEvent.shiftKey;if(t||i)return void this._onMultiSelectItem(e);var o=this.getSelection(),n=this.itemFromTarget(e),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:e})}},o.prototype._onAddItem=function(e){if(this.options.selectable&&this.options.editable.add){var t=this,i=this.options.snap||null,o=this.itemFromTarget(e);if(o){var n=t.itemsData.get(o.id);this.options.onUpdate(n,function(e){e&&t.itemsData.getDataSet().update(e)})}else{if(this.options.rtl)var s=r.getAbsoluteRight(this.dom.frame),a=s-e.center.x;else var s=r.getAbsoluteLeft(this.dom.frame),a=e.center.x-s;var h=this.body.util.toTime(a),d=this.body.util.getScale(),l=this.body.util.getStep(),u={start:i?i(h,d,l):h,content:"new item"};if("range"===this.options.type){var c=this.body.util.toTime(a+this.props.width/5);u.end=i?i(c,d,l):c}u[this.itemsData._fieldId]=r.randomUUID();var p=this.groupFromTarget(e);p&&(u.group=p.groupId),u=this._cloneItemData(u),this.options.onAdd(u,function(e){e&&t.itemsData.getDataSet().add(e)})}}},o.prototype._onMultiSelectItem=function(e){if(this.options.selectable){var t=this.itemFromTarget(e);if(t){var i=this.options.multiselect?this.getSelection():[],n=e.srcEvent&&e.srcEvent.shiftKey||!1;if(n&&this.options.multiselect){var s=this.itemsData.get(t.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(t.id);var a=o._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,u=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&u<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof g||i.push(d.id)}}}else{var c=i.indexOf(t.id);-1==c?i.push(t.id):i.splice(c,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:e})}}},o._getItemRange=function(e){var t=null,i=null;return e.forEach(function(e){(null==i||e.startt)&&(t=e.end):(null==t||e.start>t)&&(t=e.start)}),{min:i,max:t}},o.prototype.itemFromTarget=function(e){for(var t=e.target;t;){if(t.hasOwnProperty("timeline-item"))return t["timeline-item"];t=t.parentNode}return null},o.prototype.groupFromTarget=function(e){for(var t=e.center?e.center.y:e.clientY,i=0;ia&&ta)return n}else if(0===i&&t0?e.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(e){this.autoScale=e},o.prototype.setMinimumStep=function(e){if(void 0!=e){var t=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*t>e&&(this.scale="year",this.step=1e3),500*t>e&&(this.scale="year",this.step=500),100*t>e&&(this.scale="year",this.step=100),50*t>e&&(this.scale="year",this.step=50),10*t>e&&(this.scale="year",this.step=10),5*t>e&&(this.scale="year",this.step=5),t>e&&(this.scale="year",this.step=1),3*i>e&&(this.scale="month",this.step=3),i>e&&(this.scale="month",this.step=1),5*o>e&&(this.scale="day",this.step=5),2*o>e&&(this.scale="day",this.step=2),o>e&&(this.scale="day",this.step=1),o/2>e&&(this.scale="weekday",this.step=1),4*n>e&&(this.scale="hour",this.step=4),n>e&&(this.scale="hour",this.step=1),15*s>e&&(this.scale="minute",this.step=15),10*s>e&&(this.scale="minute",this.step=10),5*s>e&&(this.scale="minute",this.step=5),s>e&&(this.scale="minute",this.step=1),15*r>e&&(this.scale="second",this.step=15),10*r>e&&(this.scale="second",this.step=10),5*r>e&&(this.scale="second",this.step=5),r>e&&(this.scale="second",this.step=1),200*a>e&&(this.scale="millisecond",this.step=200),100*a>e&&(this.scale="millisecond",this.step=100),50*a>e&&(this.scale="millisecond",this.step=50),10*a>e&&(this.scale="millisecond",this.step=10),5*a>e&&(this.scale="millisecond",this.step=5),a>e&&(this.scale="millisecond",this.step=1)}},o.snap=function(e,t,i){var o=n(e);if("year"==t){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"==t)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==t){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"==t){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"==t){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"==t){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"==t)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"==t){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.switchedYear=!1,this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.switchedMonth=!1,this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.switchedDay=!1,this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var e=this.moment(this.current);switch(this.scale){case"millisecond":return 0==e.milliseconds();case"second":return 0==e.seconds();case"minute":return 0==e.hours()&&0==e.minutes();case"hour":return 0==e.hours();case"weekday":case"day":return 1==e.date();case"month":return 0==e.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(e){void 0==e&&(e=this.current);var t=this.format.minorLabels[this.scale];return t&&t.length>0?this.moment(e).format(t):""},o.prototype.getLabelMajor=function(e){void 0==e&&(e=this.current);var t=this.format.majorLabels[this.scale];return t&&t.length>0?this.moment(e).format(t):""},o.prototype.getClassName=function(){function e(e){return e/h%2==0?" vis-even":" vis-odd"}function t(e){return e.isSame(new Date,"day")?" vis-today":e.isSame(s().add(1,"day"),"day")?" vis-tomorrow":e.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(e){return e.isSame(new Date,"week")?" vis-current-week":""}function o(e){return e.isSame(new Date,"month")?" vis-current-month":""}function n(e){return e.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return e(a.milliseconds()).trim();case"second":return e(a.seconds()).trim();case"minute":return e(a.minutes()).trim();case"hour":var d=a.hours();return 4==this.step&&(d=d+"-h"+(d+4)),"vis-h"+d+t(a)+e(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+t(a)+i(a)+e(a.date());case"day":var l=a.date(),u=a.format("MMMM").toLowerCase();return"vis-day"+l+" vis-"+u+o(a)+e(l-1);case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+e(a.month());case"year":var c=a.year();return"vis-year"+c+n(a)+e(c);default:return""}},e.exports=o},function(e,t,i){function o(e,t,i){this.groupId=e,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=t&&t.subgroupOrder,this.itemSet=i,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(t)}var n=i(1),s=i(37);i(38),o.prototype._create=function(){var e=document.createElement("div");this.itemSet.options.groupEditable.order?e.className="vis-label draggable":e.className="vis-label",this.dom.label=e;var t=document.createElement("div");t.className="vis-inner",e.appendChild(t),this.dom.inner=t;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.innerHTML="?",this.dom.background.appendChild(this.dom.marker)},o.prototype.setData=function(e){var t;if(t=this.itemSet.options&&this.itemSet.options.groupTemplate?this.itemSet.options.groupTemplate(e):e&&e.content,t instanceof Element){for(this.dom.inner.appendChild(t);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(t)}else void 0!==t&&null!==t?this.dom.inner.innerHTML=t:this.dom.inner.innerHTML=this.groupId||"";this.dom.label.title=e&&e.title||"",this.dom.inner.firstChild?n.removeClassName(this.dom.inner,"vis-hidden"):n.addClassName(this.dom.inner,"vis-hidden");var i=e&&e.className||null;i!=this.className&&(this.className&&(n.removeClassName(this.dom.label,this.className),n.removeClassName(this.dom.foreground,this.className),n.removeClassName(this.dom.background,this.className),n.removeClassName(this.dom.axis,this.className)),n.addClassName(this.dom.label,i),n.addClassName(this.dom.foreground,i),n.addClassName(this.dom.background,i),n.addClassName(this.dom.axis,i),this.className=i),this.style&&(n.removeCssText(this.dom.label,this.style),this.style=null),e&&e.style&&(n.addCssText(this.dom.label,e.style),this.style=e.style)},o.prototype.getLabelWidth=function(){return this.props.label.width},o.prototype.redraw=function(e,t,i){var o=!1,r=this.dom.marker.clientHeight;if(r!=this.lastMarkerHeight&&(this.lastMarkerHeight=r,n.forEach(this.items,function(e){e.dirty=!0,e.displayed&&e.redraw()}),i=!0),this._calculateSubGroupHeights(),"function"==typeof this.itemSet.options.order){if(i){var a=this,h=!1;n.forEach(this.items,function(e){e.displayed||(e.redraw(),a.visibleItems.push(e)),e.repositionX(h)});var d=this.orderedItems.byStart.slice().sort(function(e,t){return a.itemSet.options.order(e.data,t.data)});s.stack(d,t,!0)}this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,e)}else this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,e),this.itemSet.options.stack?s.stack(this.visibleItems,t,i):s.nostack(this.visibleItems,t,this.subgroups);var l=this._calculateHeight(t),u=this.dom.foreground;this.top=u.offsetTop,this.right=u.offsetLeft,this.width=u.offsetWidth,o=n.updateProperty(this,"height",l)||o,o=n.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=n.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=l+"px",this.dom.foreground.style.height=l+"px",this.dom.label.style.height=l+"px";for(var c=0,p=this.visibleItems.length;p>c;c++){var f=this.visibleItems[c];f.repositionY(t)}return o},o.prototype._calculateSubGroupHeights=function(){if(Object.keys(this.subgroups).length>0){var e=this;this.resetSubgroups(),n.forEach(this.visibleItems,function(t){void 0!==t.data.subgroup&&(e.subgroups[t.data.subgroup].height=Math.max(e.subgroups[t.data.subgroup].height,t.height),e.subgroups[t.data.subgroup].visible=!0)})}},o.prototype._calculateHeight=function(e){var t,i=this.visibleItems;if(i.length>0){var o=i[0].top,s=i[0].top+i[0].height;if(n.forEach(i,function(e){o=Math.min(o,e.top),s=Math.max(s,e.top+e.height)}),o>e.axis){var r=o-e.axis;s-=r,n.forEach(i,function(e){e.top-=r})}t=s+e.item.vertical/2}else t=0;return t=Math.max(t,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var e=this.dom.label;e.parentNode&&e.parentNode.removeChild(e);var t=this.dom.foreground;t.parentNode&&t.parentNode.removeChild(t);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(e){if(this.items[e.id]=e,e.setParent(this),void 0!==e.data.subgroup&&(void 0===this.subgroups[e.data.subgroup]&&(this.subgroups[e.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[e.data.subgroup].items.push(e)),this.orderSubgroups(),-1==this.visibleItems.indexOf(e)){var t=this.itemSet.body.range;this._checkIfVisible(e,this.visibleItems,t)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var e=[];if("string"==typeof this.subgroupOrderer){for(var t in this.subgroups)e.push({subgroup:t,sortField:this.subgroups[t].items[0].data[this.subgroupOrderer]});e.sort(function(e,t){return e.sortField-t.sortField})}else if("function"==typeof this.subgroupOrderer){for(var t in this.subgroups)e.push(this.subgroups[t].items[0].data);e.sort(this.subgroupOrderer)}if(e.length>0)for(var i=0;ie?-1:l>=e?0:1};if(t.length>0)for(s=0;sl}),1==this.checkRangedItems)for(this.checkRangedItems=!1,s=0;sl})}for(s=0;s=0&&(s=t[r],!n(s));r--)void 0===o[s.id]&&(o[s.id]=!0,i.push(s));for(r=e+1;rn;n++)e[n].top=null;for(n=0,s=e.length;s>n;n++){var r=e[n];if(r.stack&&null===r.top){r.top=i.axis;do{for(var a=null,h=0,d=e.length;d>h;h++){var l=e[h];if(null!==l.top&&l!==r&&l.stack&&t.collision(r,l,i.item,l.options.rtl)){a=l;break}}null!=a&&(r.top=a.top+a.height+i.item.vertical)}while(a)}}},t.nostack=function(e,t,i){var o,n,s;for(o=0,n=e.length;n>o;o++)if(void 0!==e[o].data.subgroup){s=t.axis;for(var r in i)i.hasOwnProperty(r)&&1==i[r].visible&&i[r].indext.right&&e.top-o.vertical+it.top:e.left-o.horizontal+it.left&&e.top-o.vertical+it.top}},function(e,t,i){function o(e,t,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,e){if(void 0==e.start)throw new Error('Property "start" missing in item '+e.id);if(void 0==e.end)throw new Error('Property "end" missing in item '+e.id)}n.call(this,e,t,i)}var n=(i(20),i(39));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(e){return this.data.starte.start},o.prototype.redraw=function(){var e=this.dom;if(e||(this.dom={},e=this.dom,e.box=document.createElement("div"),e.frame=document.createElement("div"),e.frame.className="vis-item-overflow",e.box.appendChild(e.frame),e.content=document.createElement("div"),e.content.className="vis-item-content",e.frame.appendChild(e.content),e.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!e.box.parentNode){var t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(e.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");e.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(e.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintDeleteButton(e.box),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var e=this.dom.box;e.parentNode&&e.parentNode.removeChild(e),this.displayed=!1}},o.prototype.repositionX=function(e){var t,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==e&&e!==!0||(-o>n&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:t=this.overflow?s>0?Math.max(-n,0):-i:0>n?-n:0,this.options.rtl?this.dom.content.style.right=t+"px":this.dom.content.style.left=t+"px"}},o.prototype.repositionY=function(){var e=this.options.orientation.item,t=this.dom.box;"top"==e?t.style.top=this.top+"px":t.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 e=document.createElement("div");e.className="vis-drag-left",e.dragLeftItem=this,this.dom.box.appendChild(e),this.dom.dragLeft=e}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 e=document.createElement("div");e.className="vis-drag-right",e.dragRightItem=this,this.dom.box.appendChild(e),this.dom.dragRight=e}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},e.exports=o},function(e,t,i){function o(e,t,i){this.id=null,this.parent=null,this.data=e,this.dom=null,this.conversion=t||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&"boolean"==typeof this.data.editable&&(this.editable=e.editable)}var n=i(20),s=i(1);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(e){var t=void 0!=e.group&&this.data.group!=e.group;t&&this.parent.itemSet._moveToGroup(this,e.group),e.hasOwnProperty("editable")&&"boolean"==typeof e.editable&&(this.editable=e.editable),this.data=e,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(e){this.displayed?(this.hide(),this.parent=e,this.parent&&this.show()):this.parent=e},o.prototype.isVisible=function(e){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(e){var t=(this.options.editable.remove||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&t&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new n(o).on("tap",function(e){e.stopPropagation(),i.parent.removeFromDataSet(i)}),e.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._updateContents=function(e){var t;if(this.options.template){var i=this.parent.itemSet.itemsData.get(this.id);t=this.options.template(i)}else t=this.data.content;var o=this._contentToString(this.content)!==this._contentToString(t);if(o){if(t instanceof Element)e.innerHTML="", +e.appendChild(t);else if(void 0!=t)e.innerHTML=t;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=t}},o.prototype._updateTitle=function(e){null!=this.data.title?e.title=this.data.title||"":e.removeAttribute("vis-title")},o.prototype._updateDataAttributes=function(e){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var t=[];if(Array.isArray(this.options.dataAttributes))t=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;t=Object.keys(this.data)}for(var i=0;in;n++){var r=this.visibleItems[n];r.repositionY(t)}return o},o.prototype.show=function(){this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background)},e.exports=o},function(e,t,i){function o(e,t,i){if(this.props={dot:{width:0,height:0},line:{width:0,height:0}},this.options=i,e&&void 0==e.start)throw new Error('Property "start" missing in item '+e);n.call(this,e,t,i)}var n=i(39);i(1),o.prototype=new n(null,null,null),o.prototype.isVisible=function(e){var t=(e.end-e.start)/4;return this.data.start>e.start-t&&this.data.starte.start-t&&this.data.starte.start},o.prototype.redraw=function(){var e=this.dom;if(e||(this.dom={},e=this.dom,e.box=document.createElement("div"),e.frame=document.createElement("div"),e.frame.className="vis-item-overflow",e.box.appendChild(e.frame),e.content=document.createElement("div"),e.content.className="vis-item-content",e.frame.appendChild(e.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!e.box.parentNode){var t=this.parent.dom.background;if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(e.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");e.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(e.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(e){var t="top"===this.options.orientation.item;this.dom.content.style.top=t?"":"0",this.dom.content.style.bottom=t?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,r=n[o].index;if(1==t){i=this.parent.subgroups[o].height+e.item.vertical,i+=0==r?e.axis-.5*e.item.vertical:0;var a=this.parent.top;for(var h in n)n.hasOwnProperty(h)&&1==n[h].visible&&n[h].indexr&&(a+=l)}i=this.parent.subgroups[o].height+e.item.vertical,this.dom.box.style.top=this.parent.height-d+a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof s?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=t?"0":"",this.dom.box.style.bottom=t?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},e.exports=o},function(e,t,i){function o(e,t){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:a.FORMAT,moment:d,timeAxis:null},this.options=s.extend({},this.defaultOptions),this.body=e,this._create(),this.setOptions(t)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(1),r=i(31),a=i(35),h=i(32),d=i(2);o.prototype=new r,o.prototype.setOptions=function(e){e&&(s.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,e),s.selectiveDeepExtend(["format"],this.options,e),"orientation"in e&&("string"==typeof e.orientation?this.options.orientation.axis=e.orientation:"object"===n(e.orientation)&&"axis"in e.orientation&&(this.options.orientation.axis=e.orientation.axis)),"locale"in e&&("function"==typeof d.locale?d.locale(e.locale):d.lang(e.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var e=this.props,t=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=t.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;e.minorLabelHeight=s?e.minorCharHeight:0,e.majorLabelHeight=r?e.majorCharHeight:0,e.height=e.minorLabelHeight+e.majorLabelHeight,e.width=t.offsetWidth,e.minorLineHeight=this.body.domProps.root.height-e.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),e.minorLineWidth=1,e.majorLineHeight=e.minorLineHeight+e.majorLabelHeight,e.majorLineWidth=1;var a=t.nextSibling,h=i.nextSibling;return t.parentNode&&t.parentNode.removeChild(t),i.parentNode&&i.parentNode.removeChild(i),t.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(t,a):o.appendChild(t),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var e=this.options.orientation.axis,t=s.convert(this.body.range.start,"Number"),i=s.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-h.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var r=new a(new Date(t),new Date(i),n,this.body.hiddenDates);r.setMoment(this.options.moment),this.options.format&&r.setFormat(this.options.format),this.options.timeAxis&&r.setScale(this.options.timeAxis),this.step=r;var d=this.dom;d.redundant.lines=d.lines,d.redundant.majorTexts=d.majorTexts,d.redundant.minorTexts=d.minorTexts,d.lines=[],d.majorTexts=[],d.minorTexts=[];var u,c,p,f,m,g,v,y,b,w,_=0,x=void 0,k=0,S=1e3;for(r.start(),c=r.getCurrent(),f=this.body.util.toScreen(c);r.hasNext()&&S>k;){k++,m=r.isMajor(),w=r.getClassName(),b=r.getLabelMinor(),u=c,p=f,r.next(),c=r.getCurrent(),g=r.isMajor(),f=this.body.util.toScreen(c),v=_,_=f-p;var O=_>=.4*v;if(this.options.showMinorLabels&&O){var C=this._repaintMinorText(p,b,e,w);C.style.width=_+"px"}m&&this.options.showMajorLabels?(p>0&&(void 0==x&&(x=p),C=this._repaintMajorText(p,r.getLabelMajor(),e,w)),y=this._repaintMajorLine(p,_,e,w)):O?y=this._repaintMinorLine(p,_,e,w):y&&(y.style.width=parseInt(y.style.width)+_+"px")}if(k!==S||l||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+S+" lines."),l=!0),this.options.showMajorLabels){var M=this.body.util.toTime(0),D=r.getLabelMajor(M),E=D.length*(this.props.majorCharWidth||10)+10;(void 0==x||x>E)&&this._repaintMajorText(0,D,e,w)}s.forEach(this.dom.redundant,function(e){for(;e.length;){var t=e.pop();t&&t.parentNode&&t.parentNode.removeChild(t)}})},o.prototype._repaintMinorText=function(e,t,i,o){var n=this.dom.redundant.minorTexts.shift();if(!n){var s=document.createTextNode("");n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.minorTexts.push(n),n.childNodes[0].nodeValue=t,n.style.top="top"==i?this.props.majorLabelHeight+"px":"0",this.options.rtl?(n.style.left="",n.style.right=e+"px"):n.style.left=e+"px",n.className="vis-text vis-minor "+o,n},o.prototype._repaintMajorText=function(e,t,i,o){var n=this.dom.redundant.majorTexts.shift();if(!n){var s=document.createTextNode(t);n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.majorTexts.push(n),n.childNodes[0].nodeValue=t,n.className="vis-text vis-major "+o,n.style.top="top"==i?"0":this.props.minorLabelHeight+"px",this.options.rtl?(n.style.left="",n.style.right=e+"px"):n.style.left=e+"px",n},o.prototype._repaintMinorLine=function(e,t,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top=s.majorLabelHeight+"px":n.style.top=this.body.domProps.top.height+"px",n.style.height=s.minorLineHeight+"px",this.options.rtl?(n.style.left="",n.style.right=e-s.minorLineWidth/2+"px",n.className="vis-grid vis-vertical-rtl vis-minor "+o):(n.style.left=e-s.minorLineWidth/2+"px",n.className="vis-grid vis-vertical vis-minor "+o),n.style.width=t+"px",n},o.prototype._repaintMajorLine=function(e,t,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top="0":n.style.top=this.body.domProps.top.height+"px",this.options.rtl?(n.style.left="",n.style.right=e-s.majorLineWidth/2+"px",n.className="vis-grid vis-vertical-rtl vis-major "+o):(n.style.left=e-s.majorLineWidth/2+"px",n.className="vis-grid vis-vertical vis-major "+o),n.style.height=s.majorLineHeight+"px",n.style.width=t+"px",n},o.prototype._calculateCharSize=function(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth};var l=!1;e.exports=o},function(e,t,i){function o(e){this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var t=this,i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];i.forEach(function(e){t.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){n(i.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function n(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var s=i(23),r=i(13),a=i(20),h=i(1);r(o.prototype),o.current=null,o.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},o.prototype.activate=function(){o.current&&o.current.deactivate(),o.current=this,this.active=!0,this.dom.overlay.style.display="none",h.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},o.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",h.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},o.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()},e.exports=o},function(e,t,i){function o(e,t){this.body=e,this.defaultOptions={moment:a,locales:h,locale:"en",id:void 0,title:void 0},this.options=s.extend({},this.defaultOptions),t&&t.time?this.customTime=t.time:this.customTime=new Date,this.eventParams={},this.setOptions(t),this._create()}var n=i(20),s=i(1),r=i(31),a=i(2),h=i(47);o.prototype=new r,o.prototype.setOptions=function(e){e&&s.selectiveExtend(["moment","locale","locales","id"],this.options,e)},o.prototype._create=function(){var e=document.createElement("div");e["custom-time"]=this,e.className="vis-custom-time "+(this.options.id||""),e.style.position="absolute",e.style.top="0px",e.style.height="100%",this.bar=e;var t=document.createElement("div");t.style.position="relative",t.style.top="0px",t.style.left="-10px",t.style.height="100%",t.style.width="20px",e.appendChild(t),this.hammer=new n(t),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:n.DIRECTION_HORIZONTAL})},o.prototype.destroy=function(){this.hide(),this.hammer.destroy(),this.hammer=null,this.body=null},o.prototype.redraw=function(){var e=this.body.dom.backgroundVertical;this.bar.parentNode!=e&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),e.appendChild(this.bar));var t=this.body.util.toScreen(this.customTime),i=this.options.locales[this.options.locale];i||(this.warned||(console.log("WARNING: options.locales['"+this.options.locale+"'] not found. See http://visjs.org/docs/timeline.html#Localization"),this.warned=!0),i=this.options.locales.en);var o=this.options.title;return void 0===o&&(o=i.time+": "+this.options.moment(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss"),o=o.charAt(0).toUpperCase()+o.substring(1)),this.bar.style.left=t+"px",this.bar.title=o,!1},o.prototype.hide=function(){this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar)},o.prototype.setCustomTime=function(e){this.customTime=s.convert(e,"Date"),this.redraw()},o.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())},o.prototype.setCustomTitle=function(e){this.options.title=e},o.prototype._onDragStart=function(e){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,e.stopPropagation()},o.prototype._onDrag=function(e){if(this.eventParams.dragging){var t=this.body.util.toScreen(this.eventParams.customTime)+e.deltaX,i=this.body.util.toTime(t);this.setCustomTime(i),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf())}),e.stopPropagation()}},o.prototype._onDragEnd=function(e){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf())}),e.stopPropagation())},o.customTimeFromTarget=function(e){for(var t=e.target;t;){if(t.hasOwnProperty("custom-time"))return t["custom-time"];t=t.parentNode}return null},e.exports=o},function(e,t){t.en={current:"current",time:"time"},t.en_EN=t.en,t.en_US=t.en,t.nl={current:"huidige",time:"tijd"},t.nl_NL=t.nl,t.nl_BE=t.nl},function(e,t,i){function o(e,t){this.body=e,this.defaultOptions={rtl:!1,showCurrentTime:!0,moment:r,locales:a,locale:"en"},this.options=n.extend({},this.defaultOptions),this.offset=0,this._create(),this.setOptions(t)}var n=i(1),s=i(31),r=i(2),a=i(47);o.prototype=new s,o.prototype._create=function(){var e=document.createElement("div");e.className="vis-current-time",e.style.position="absolute",e.style.top="0px",e.style.height="100%",this.bar=e},o.prototype.destroy=function(){this.options.showCurrentTime=!1,this.redraw(),this.body=null},o.prototype.setOptions=function(e){e&&n.selectiveExtend(["rtl","showCurrentTime","moment","locale","locales"],this.options,e)},o.prototype.redraw=function(){if(this.options.showCurrentTime){var e=this.body.dom.backgroundVertical;this.bar.parentNode!=e&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),e.appendChild(this.bar),this.start());var t=this.options.moment((new Date).valueOf()+this.offset),i=this.body.util.toScreen(t),o=this.options.locales[this.options.locale];o||(this.warned||(console.log("WARNING: options.locales['"+this.options.locale+"'] not found. See http://visjs.org/docs/timeline/#Localization"),this.warned=!0),o=this.options.locales.en);var n=o.current+" "+o.time+": "+t.format("dddd, MMMM Do YYYY, H:mm:ss");n=n.charAt(0).toUpperCase()+n.substring(1),this.options.rtl?this.bar.style.right=i+"px":this.bar.style.left=i+"px",this.bar.title=n}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1},o.prototype.start=function(){function e(){t.stop();var i=t.body.range.conversion(t.body.domProps.center.width).scale,o=1/i/10;30>o&&(o=30),o>1e3&&(o=1e3),t.redraw(),t.body.emitter.emit("currentTimeTick"),t.currentTimeTimer=setTimeout(e,o)}var t=this;e()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(e){var t=n.convert(e,"Date").valueOf(),i=(new Date).valueOf();this.offset=t-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},e.exports=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",u={configure:{enabled:{"boolean":o},filter:{"boolean":o,"function":"function"},container:{dom:h},__type__:{object:a,"boolean":o,"function":"function"}},align:{string:i},rtl:{"boolean":o,undefined:"undefined"},autoResize:{"boolean":o},throttleRedraw:{number:n},clickToUse:{"boolean":o},dataAttributes:{string:i,array:s},editable:{add:{"boolean":o,undefined:"undefined"},remove:{"boolean":o,undefined:"undefined"},updateGroup:{"boolean":o,undefined:"undefined"},updateTime:{"boolean":o,undefined:"undefined"},__type__:{"boolean":o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a}},__type__:{object:a}},moment:{"function":"function"},groupOrder:{string:i,"function":"function"},groupEditable:{add:{"boolean":o,undefined:"undefined"},remove:{"boolean":o,undefined:"undefined"},order:{"boolean":o,undefined:"undefined"},__type__:{"boolean":o,object:a}},groupOrderSwap:{"function":"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{"boolean":o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{"boolean":o},multiselect:{"boolean":o},multiselectPerGroup:{"boolean":o},onAdd:{"function":"function"},onUpdate:{"function":"function"},onMove:{"function":"function"},onMoving:{"function":"function"},onRemove:{"function":"function"},onAddGroup:{"function":"function"},onMoveGroup:{"function":"function"},onRemoveGroup:{"function":"function"},order:{"function":"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{"boolean":o},showCurrentTime:{"boolean":o},showMajorLabels:{"boolean":o},showMinorLabels:{"boolean":o},stack:{"boolean":o},snap:{"function":"function","null":"null"},start:{date:r,number:n,string:i,moment:d},template:{"function":"function"},groupTemplate:{"function":"function"},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{"boolean":o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},c={global:{align:["center","left","right"],direction:!1,autoResize:!0,throttleRedraw:[10,0,1e3,10],clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,start:"",type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};t.allOptions=u,t.configureOptions=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t,i,o){if(!(Array.isArray(i)||i instanceof u||i instanceof c)&&i instanceof Object){var n=o;o=i,i=n}var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(e),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new m(this.body),this.components.push(this.timeAxis),this.currentTime=new g(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(e){s.emit("click",s.getEventProperties(e))}),this.on("doubletap",function(e){s.emit("doubleClick",s.getEventProperties(e))}),this.dom.root.oncontextmenu=function(e){s.emit("contextmenu",s.getEventProperties(e))},o&&this.setOptions(o),i&&this.setGroups(i),t&&this.setItems(t),this._redraw()}var s=i(26),r=o(s),a=i(29),h=o(a),d=(i(13),i(20),i(2)),l=i(1),u=i(9),c=i(11),p=i(30),f=i(33),m=i(44),g=i(48),v=i(46),y=i(51),b=i(29).printStyle,w=i(59).allOptions,_=i(59).configureOptions; +n.prototype=new f,n.prototype.setOptions=function(e){var t=h["default"].validate(e,w);t===!0&&console.log("%cErrors have been found in the supplied options object.",b),f.prototype.setOptions.call(this,e)},n.prototype.setItems=function(e){var t,i=null==this.itemsData;if(t=e?e instanceof u||e instanceof c?e:new u(e,{type:{start:"Date",end:"Date"}}):null,this.itemsData=t,this.linegraph&&this.linegraph.setItems(t),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(e){var t;t=e?e instanceof u||e instanceof c?e:new u(e):null,this.groupsData=t,this.linegraph.setGroups(t)},n.prototype.getLegend=function(e,t,i){return void 0===t&&(t=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[e]?this.linegraph.groups[e].getLegend(t,i):"cannot find group:'"+e+"'"},n.prototype.isGroupVisible=function(e){return void 0!==this.linegraph.groups[e]&&(this.linegraph.groups[e].visible&&(void 0===this.linegraph.options.groups.visibility[e]||1==this.linegraph.options.groups.visibility[e]))},n.prototype.getDataRange=function(){var e=null,t=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;os?s:e,t=null==t?s:s>t?s:t}return{min:null!=e?new Date(e):null,max:null!=t?new Date(t):null}},n.prototype.getEventProperties=function(e){var t=e.center?e.center.x:e.clientX,i=e.center?e.center.y:e.clientY,o=t-l.getAbsoluteLeft(this.dom.centerContainer),n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this._toTime(o),r=v.customTimeFromTarget(e),a=l.getTarget(e),h=null;l.hasParent(a,this.timeAxis.dom.foreground)?h="axis":this.timeAxis2&&l.hasParent(a,this.timeAxis2.dom.foreground)?h="axis":l.hasParent(a,this.linegraph.yAxisLeft.dom.frame)?h="data-axis":l.hasParent(a,this.linegraph.yAxisRight.dom.frame)?h="data-axis":l.hasParent(a,this.linegraph.legendLeft.dom.frame)?h="legend":l.hasParent(a,this.linegraph.legendRight.dom.frame)?h="legend":null!=r?h="custom-time":l.hasParent(a,this.currentTime.bar)?h="current-time":l.hasParent(a,this.dom.center)&&(h="background");var d=[],u=this.linegraph.yAxisLeft,c=this.linegraph.yAxisRight;return u.hidden||d.push(u.screenToValue(n)),c.hidden||d.push(c.screenToValue(n)),{event:e,what:h,pageX:e.srcEvent?e.srcEvent.pageX:e.pageX,pageY:e.srcEvent?e.srcEvent.pageY:e.pageY,x:o,y:n,time:s,value:d}},n.prototype._createConfigurator=function(){return new r["default"](this,this.dom.container,_)},e.exports=n},function(e,t,i){function o(e,t){this.id=s.randomUUID(),this.body=e,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{},legend:{},groups:{visibility:{}}},this.options=s.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1,this.forceGraphUpdate=!0;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(e,t,o){i._onAdd(t.items)},update:function(e,t,o){i._onUpdate(t.items)},remove:function(e,t,o){i._onRemove(t.items)}},this.groupListeners={add:function(e,t,o){i._onAddGroups(t.items)},update:function(e,t,o){i._onUpdateGroups(t.items)},remove:function(e,t,o){i._onRemoveGroups(t.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(t),this.groupsUsingDefaultStyles=[0],this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=s.option.asSize(-i.props.width),i.forceGraphUpdate=!0,i.redraw.call(i)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups}}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(1),r=i(8),a=i(9),h=i(11),d=i(31),l=i(52),u=i(54),c=i(58),p=i(55),f=i(57),m=i(56),g="__ungrouped__";o.prototype=new d,o.prototype._create=function(){var e=document.createElement("div");e.className="vis-line-graph",this.dom.frame=e,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",e.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new l(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new l(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new c(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new c(this.body,this.options.legend,"right",this.options.groups),this.show()},o.prototype.setOptions=function(e){if(e){var t=["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===e.graphHeight&&void 0!==e.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==e.graphHeight&&parseInt((e.graphHeight+"").replace("px",""))i?-1:1});for(var o=new Array(e.length),n=0;n0){var h={};for(this._getRelevantData(a,h,n,s),this._applySampling(a,h),t=0;t0)switch(e.options.style){case"line":l.hasOwnProperty(a[t])||(l[a[t]]=f.calcPath(h[a[t]],e)),f.draw(l[a[t]],e,this.framework);case"point":case"points":"point"!=e.options.style&&"points"!=e.options.style&&1!=e.options.drawPoints.enabled||m.draw(h[a[t]],e,this.framework);break;case"bar":}}}return r.cleanupElements(this.svgElements),!1},o.prototype._stack=function(e,t){var i,o,n,s,r;i=0;for(var a=0;ae[a].x){r=t[h],s=0==h?r:t[h-1],i=h;break}}void 0===r&&(s=t[t.length-1],r=t[t.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?e[a].y=e[a].orginalY+r.y:e[a].y=e[a].orginalY+n/o*(e[a].x-s.x)+s.y}},o.prototype._getRelevantData=function(e,t,i,o){var n,r,a,h;if(e.length>0)for(r=0;re?-1:1},u=Math.max(0,s.binarySearchValue(d,i,"x","before",l)),c=Math.min(d.length,s.binarySearchValue(d,o,"x","after",l)+1);0>=c&&(c=d.length);var p=new Array(c-u);for(a=u;c>a;a++)h=n.itemsData[a],p[a-u]=h;t[e[r]]=p}else t[e[r]]=n.itemsData}},o.prototype._applySampling=function(e,t){var i;if(e.length>0)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;r>l;l+=s){var u=Math.round(l/s);d[u]=n[l]}t[e[o]]=d.splice(0,Math.round(r/s))}}},o.prototype._getYRanges=function(e,t,i){var o,n,s,r,a=[],h=[];if(e.length>0){for(s=0;s0&&(n=this.groups[e[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[e[s]]=n.getYRange(o,e[s]));p.getStackedYRange(a,i,e,"__barStackLeft","left"),p.getStackedYRange(h,i,e,"__barStackRight","right")}},o.prototype._updateYAxis=function(e,t){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(e.length>0){for(var u=0;ui?i:a,d=o>d?o:d):(r=!0,h=h>i?i:h,l=o>l?o:l));1==s&&this.yAxisLeft.setRange(a,d),1==r&&this.yAxisRight.setRange(h,l)}n=this._toggleAxisVisiblity(s,this.yAxisLeft)||n,n=this._toggleAxisVisiblity(r,this.yAxisRight)||n,1==r&&1==s?(this.yAxisLeft.drawIcons=!0,this.yAxisRight.drawIcons=!0):(this.yAxisLeft.drawIcons=!1,this.yAxisRight.drawIcons=!1),this.yAxisRight.master=!s,this.yAxisRight.masterAxis=this.yAxisLeft,0==this.yAxisRight.master?(1==r?this.yAxisLeft.lineOffset=this.yAxisRight.width:this.yAxisLeft.lineOffset=0,n=this.yAxisLeft.redraw()||n,n=this.yAxisRight.redraw()||n):n=this.yAxisRight.redraw()||n;for(var p=["__barStackLeft","__barStackRight","__lineStackLeft","__lineStackRight"],u=0;ue?-1:1});for(var a=0;a=0&&e._redrawLabel(o-2,t.val,i,"vis-y-axis vis-major",e.props.majorCharHeight),e.master===!0&&(n?e._redrawLine(o,i,"vis-grid vis-horizontal vis-major",e.options.majorLinesOffset,e.props.majorLineWidth):e._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",e.options.minorLinesOffset,e.props.minorLineWidth))});var d=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(d=this.props.titleCharHeight);var l=this.options.icons===!0?Math.max(this.options.iconWidth,d)+this.options.labelOffsetX+15:d+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-l&&this.options.visible===!0?(this.width=this.maxLabelSize+l,this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),t=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+l),this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),t=!0):(s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),t=!1),t},o.prototype.convertValue=function(e){return this.scale.convertValue(e)},o.prototype.screenToValue=function(e){return this.scale.screenToValue(e)},o.prototype._redrawLabel=function(e,t,i,o,n){var r=s.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=t,"left"===i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=e-.5*n+this.options.labelOffsetY+"px",t+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?t+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:t};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(e){this.majorCharHeight=e},i.prototype.setHeight=function(e){this.containerHeight=e},i.prototype.determineScale=function(){var e=this._end-this._start;this.scale=this.containerHeight/e;var t=this.majorCharHeight/this.scale,i=e>0?Math.round(Math.log(e)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;0>i&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r=t){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(e){return e%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var e=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(e-this._start%e)%e)},i.prototype.formatValue=function(e){var t=e.toPrecision(5);return"function"==typeof this.formattingFunction&&(t=this.formattingFunction(e)),"number"==typeof t?""+t:"string"==typeof t?t:e.toPrecision(5)},i.prototype.getLines=function(){for(var e=[],t=this.getStep(),i=(t-this._start%t)%t,o=this._start+i;this._end-o>1e-5;o+=t)o!=this._start&&e.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return e},i.prototype.followScale=function(e){var t=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};e.minorStepIdx<=1&&this.minorStepIdx<=1||e.minorStepIdx>1&&this.minorStepIdx>1||(e.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&&o-i>u?(s(),d=!1):d=!0}}},i.prototype.convertValue=function(e){return this.containerHeight-(e-this._start)*this.scale},i.prototype.screenToValue=function(e){return(this.containerHeight-e)/this.scale+this._start},e.exports=i},function(e,t,i){function o(e,t,i,o){this.id=t;var n=["sampling","style","sort","yAxisOrientation","barChart","drawPoints","shaded","interpolation","zIndex","excludeFromStacking","excludeFromLegend"];this.options=s.selectiveBridgeObject(n,i),this.usingDefaultStyle=void 0===e.className,this.groupsUsingDefaultStyles=o, +this.zeroPosition=0,this.update(e),1==this.usingDefaultStyle&&(this.groupsUsingDefaultStyles[0]+=1),this.itemsData=[],this.visible=void 0===e.visible||e.visible}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(1),r=(i(8),i(55)),a=i(57),h=i(56);o.prototype.setItems=function(e){null!=e?(this.itemsData=e,1==this.options.sort&&s.insertSort(this.itemsData,function(e,t){return e.x>t.x?1:-1})):this.itemsData=[]},o.prototype.getItems=function(){return this.itemsData},o.prototype.setZeroPosition=function(e){this.zeroPosition=e},o.prototype.setOptions=function(e){if(void 0!==e){var t=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];s.selectiveDeepExtend(t,this.options,e),"function"==typeof e.drawPoints&&(e.drawPoints={onRender:e.drawPoints}),s.mergeOptions(this.options,e,"interpolation"),s.mergeOptions(this.options,e,"drawPoints"),s.mergeOptions(this.options,e,"shaded"),e.interpolation&&"object"==n(e.interpolation)&&e.interpolation.parametrization&&("uniform"==e.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==e.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},o.prototype.update=function(e){this.group=e,this.content=e.content||"graph",this.className=e.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===e.visible||e.visible,this.style=e.style,this.setOptions(e.options)},o.prototype.getLegend=function(e,t,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*t),this.options.style){case"line":a.drawIcon(this,o,n,e,t,i);break;case"points":case"point":h.drawIcon(this,o,n,e,t,i);break;case"bar":r.drawIcon(this,o,n,e,t,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},o.prototype.getYRange=function(e){for(var t=e[0].y,i=e[0].y,o=0;oe[o].y?e[o].y:t,i=i0&&(i=Math.min(i,Math.abs(t[o-1].screen_x-t[o].screen_x))),0===i&&(void 0===e[t[o].screen_x]&&(e[t[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),e[t[o].screen_x].amount+=1)},o._getSafeDrawData=function(e,t,i){var o,n;return e0?(o=i>e?i:e,n=0,"left"===t.options.barChart.align?n-=.5*e:"right"===t.options.barChart.align&&(n+=.5*e)):(o=t.options.barChart.width,n=0,"left"===t.options.barChart.align?n-=.5*t.options.barChart.width:"right"===t.options.barChart.align&&(n+=.5*t.options.barChart.width)),{width:o,offset:n}},o.getStackedYRange=function(e,t,i,n,s){if(e.length>0){e.sort(function(e,t){return e.screen_x===t.screen_x?e.groupIdt[s].screen_y?t[s].screen_y:o,n=ne[r].accumulatedNegative?e[r].accumulatedNegative:o,o=o>e[r].accumulatedPositive?e[r].accumulatedPositive:o,n=n0){var i=[];return i=1==t.options.interpolation.enabled?o._catmullRom(e,t):o._linear(e)}},o.drawIcon=function(e,t,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",t),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",e.className),void 0!==e.style&&a.setAttributeNS(null,"style",e.style),a.setAttributeNS(null,"d","M"+t+","+i+" L"+(t+o)+","+i),1==e.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==e.options.shaded.orientation?h.setAttributeNS(null,"d","M"+t+", "+(i-d)+"L"+t+","+i+" L"+(t+o)+","+i+" L"+(t+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+t+","+i+" L"+t+","+(i+d)+" L"+(t+o)+","+(i+d)+"L"+(t+o)+","+i),h.setAttributeNS(null,"class",e.className+" vis-icon-fill"),void 0!==e.options.shaded.style&&""!==e.options.shaded.style&&h.setAttributeNS(null,"style",e.options.shaded.style)),1==e.options.drawPoints.enabled){var u={style:e.options.drawPoints.style,styles:e.options.drawPoints.styles,size:e.options.drawPoints.size,className:e.className};n.drawPoint(t+.5*o,i,u,r.svgElements,r.svg)}},o.drawShading=function(e,t,i,o){if(1==t.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==t.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==t.options.shaded.orientation?0:"bottom"==t.options.shaded.orientation?s:Math.min(Math.max(0,t.zeroPosition),s),h="group"==t.options.shaded.orientation&&null!=i&&void 0!=i?"M"+e[0][0]+","+e[0][1]+" "+this.serializePath(e,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"+e[0][0]+","+e[0][1]+" "+this.serializePath(e,a,!1)+" V"+d+" H"+e[0][0]+" Z",r.setAttributeNS(null,"class",t.className+" vis-fill"),void 0!==t.options.shaded.style&&r.setAttributeNS(null,"style",t.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(e,t,i){if(null!=e&&void 0!=e){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",t.className),void 0!==t.style&&o.setAttributeNS(null,"style",t.style);var s="L";1==t.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+e[0][0]+","+e[0][1]+" "+this.serializePath(e,s,!1))}},o.serializePath=function(e,t,i){if(e.length<2)return"";var o=t;if(i)for(var n=e.length-2;n>0;n--)o+=e[n][0]+","+e[n][1]+" ";else for(var n=1;nl;l++)t=0==l?e[0]:e[l-1],i=e[l],o=e[l+1],n=d>l+2?e[l+2]:o,s={screen_x:(-t.screen_x+6*i.screen_x+o.screen_x)*h,screen_y:(-t.screen_y+6*i.screen_y+o.screen_y)*h},r={screen_x:(i.screen_x+6*o.screen_x-n.screen_x)*h,screen_y:(i.screen_y+6*o.screen_y-n.screen_y)*h},a.push([s.screen_x,s.screen_y]),a.push([r.screen_x,r.screen_y]),a.push([o.screen_x,o.screen_y]);return a},o._catmullRom=function(e,t){var i=t.options.interpolation.alpha;if(0==i||void 0===i)return this._catmullRomUniform(e);var o,n,s,r,a,h,d,l,u,c,p,f,m,g,v,y,b,w,_,x=[];x.push([Math.round(e[0].screen_x),Math.round(e[0].screen_y)]);for(var k=e.length,S=0;k-1>S;S++)o=0==S?e[0]:e[S-1],n=e[S],s=e[S+1],r=k>S+2?e[S+2]:s,d=Math.sqrt(Math.pow(o.screen_x-n.screen_x,2)+Math.pow(o.screen_y-n.screen_y,2)),l=Math.sqrt(Math.pow(n.screen_x-s.screen_x,2)+Math.pow(n.screen_y-s.screen_y,2)),u=Math.sqrt(Math.pow(s.screen_x-r.screen_x,2)+Math.pow(s.screen_y-r.screen_y,2)),g=Math.pow(u,i),y=Math.pow(u,2*i),v=Math.pow(l,i),b=Math.pow(l,2*i),_=Math.pow(d,i),w=Math.pow(d,2*i),c=2*w+3*_*v+b,p=2*y+3*g*v+b,f=3*_*(_+v),f>0&&(f=1/f),m=3*g*(g+v),m>0&&(m=1/m),a={screen_x:(-b*o.screen_x+c*n.screen_x+w*s.screen_x)*f,screen_y:(-b*o.screen_y+c*n.screen_y+w*s.screen_y)*f},h={screen_x:(y*n.screen_x+p*s.screen_x-b*r.screen_x)*m,screen_y:(y*n.screen_y+p*s.screen_y-b*r.screen_y)*m},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(e){for(var t=[],i=0;ie?-1:1});for(var i=0;i")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var e=Object.keys(this.groups);e.sort(function(e,t){return t>e?-1:1}),s.resetElements(this.svgElements);var t=window.getComputedStyle(this.dom.frame).paddingTop,i=Number(t.replace("px","")),o=i,n=this.options.iconSize,r=.75*this.options.iconSize,a=i+.5*r+3;this.svg.style.width=n+5+i+"px";for(var h=0;h0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,t={},t.color=this.groups[this.groupsArray[i]],this.groups[e]=t}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,t={},t.color=this.defaultGroups[o],this.groups[e]=t}return t}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}();t["default"]=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;ie.left&&this.shape.tope.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}}],[{key:"parseOptions",value:function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["color","font","fixed","shadow"];if(z.selectiveNotDeepExtend(n,e,t,i),z.mergeOptions(e,t,"shadow",i,o),void 0!==t.color&&null!==t.color){var s=z.parseColor(t.color);z.fillIfDefined(e.color,s)}else i===!0&&null===t.color&&(e.color=z.bridgeObject(o.color));void 0!==t.fixed&&null!==t.fixed&&("boolean"==typeof t.fixed?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(void 0!==t.fixed.x&&"boolean"==typeof t.fixed.x&&(e.fixed.x=t.fixed.x),void 0!==t.fixed.y&&"boolean"==typeof t.fixed.y&&(e.fixed.y=t.fixed.y))),void 0!==t.font&&null!==t.font?a["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=z.bridgeObject(o.font)),void 0!==t.scaling&&z.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)}}]),e}();t["default"]=F},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),u=l[0],c=l[1],p=this._setAlignment(e,i,h,s),f=n(p,2);i=f[0],h=f[1],e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,e.fillStyle=u,this.isEdgeLabel||"left"!==this.fontOptions.align?e.textAlign="center":(e.textAlign=this.fontOptions.align,i-=.5*this.size.width),this.fontOptions.strokeWidth>0&&(e.lineWidth=this.fontOptions.strokeWidth,e.strokeStyle=c,e.lineJoin="round");for(var m=0;m0&&e.strokeText(this.lines[m],i,h),e.fillText(this.lines[m],i,h),h+=r}},{key:"_setAlignment",value:function(e,t,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){t=0,i=0;var n=2;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",i+=2*n):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}},{key:"_getColor",value:function(e){var t=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(e<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-e)));t=a.overrideOpacity(t,o),i=a.overrideOpacity(i,o)}return[t,i]}},{key:"getTextSize",value:function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],i={width:this._processLabel(e,t),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2],o=arguments.length<=3||void 0===arguments[3]?0:arguments[3],n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];this.labelDirty===!0&&(this.size.width=this._processLabel(e,t)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(e,t){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=e.measureText(o[0]).width;for(var s=1;n>s;s++){var r=e.measureText(o[s]).width;i=r>i?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2];if("string"==typeof t.font){var o=t.font.split(" ");e.size=o[0].replace("px",""),e.face=o[1],e.color=o[2]}else"object"===s(t.font)&&a.fillIfDefined(e,t.font,i);e.size=Number(e.size)}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height;var n=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-n,this.boundingBox.top=this.top-n,this.boundingBox.bottom=this.top+this.height+n,this.boundingBox.right=this.left+this.width+n}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}}]),t}(d["default"]);t["default"]=l},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;ithis.imageObj.height?(o=this.imageObj.width/this.imageObj.height,t=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,t=2*this.options.size,i=2*this.options.size*o):(t=this.imageObj.width,i=this.imageObj.height),this.width=t,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(e,t,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,h),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.circle(t,i,s),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),h>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore()}},{key:"_drawImageAtPosition",value:function(e){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e);var t=this.imageObj.width/this.width/this.body.view.scale;if(t>2&&this.options.shapeProperties.interpolation===!0){var i=this.imageObj.width,o=this.imageObj.height,n=document.createElement("canvas");n.width=i,n.height=i;var s=n.getContext("2d");t*=.5,i*=.5,o*=.5,s.drawImage(this.imageObj,0,0,i,o);for(var r=0,a=1;t>2&&4>a;)s.drawImage(n,r,0,i,o,r+i,0,i/2,o/2),r+=i,t*=.5,i*=.5,o*=.5,a+=1;e.drawImage(n,r,0,i,o,this.left,this.top,this.width,this.height)}else e.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(e)}}},{key:"_drawImageLabel",value:function(e,t,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(e);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,n,o,"hanging")}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(e,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=.5*this.width,o=.5*this.height,n=Math.sin(t)*i,s=Math.cos(t)*o;return i*o/Math.sqrt(n*n+s*s)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(e,t,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(e.font=(o?"bold ":"")+n+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e),e.fillText(this.options.icon.code,t,i),this.disableShadow(e)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),e.closePath()}this._drawImageAtPosition(e),this._drawImageLabel(e,t,i,o||n),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;ii.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(e,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=e.left,a=e.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return t>h}return!1}},{key:"_rotateForLabelAlignment",value:function(e){var t=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(t,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),e.rotate(o)}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(v.selectiveDeepExtend(n,e,t,i),v.mergeOptions(e,t,"smooth",i,o),v.mergeOptions(e,t,"shadow",i,o),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:i===!0&&null===t.dashes&&(e.dashes=Object.create(o.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),v.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)):i===!0&&null===t.scaling&&(e.scaling=Object.create(o.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var r=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=r.indexOf("to"),e.arrows.middle.enabled=-1!=r.indexOf("middle"),e.arrows.from.enabled=-1!=r.indexOf("from")}else{if("object"!==s(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));v.mergeOptions(e.arrows,t.arrows,"to",i,o.arrows),v.mergeOptions(e.arrows,t.arrows,"middle",i,o.arrows),v.mergeOptions(e.arrows,t.arrows,"from",i,o.arrows)}else i===!0&&null===t.arrows&&(e.arrows=Object.create(o.arrows));if(void 0!==t.color&&null!==t.color)if(e.color=v.deepExtend({},e.color,!0),v.isString(t.color))e.color.color=t.color,e.color.highlight=t.color,e.color.hover=t.color,e.color.inherit=!1;else{var a=!1;void 0!==t.color.color&&(e.color.color=t.color.color,a=!0),void 0!==t.color.highlight&&(e.color.highlight=t.color.highlight,a=!0),void 0!==t.color.hover&&(e.color.hover=t.color.hover,a=!0),void 0!==t.color.inherit&&(e.color.inherit=t.color.inherit),void 0!==t.color.opacity&&(e.color.opacity=Math.min(1,Math.max(0,t.color.opacity))),void 0===t.color.inherit&&a===!0&&(e.color.inherit=!1)}else i===!0&&null===t.color&&(e.color=v.bridgeObject(o.color));void 0!==t.font&&null!==t.font?h["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=v.bridgeObject(o.font))}}]),e}();t["default"]=y},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){for(var i=0;iMath.abs(t)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*e,n=this.to.x+r*e):(o=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6],h=a(r,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(e,t,i,o,n,s,d,l)}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=a(t,2),o=i[0],n=i[1],s=e,r=[];r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3);var h=r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,d=r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y;return{x:h,y:d}}}]),t}(l["default"]);t["default"]=u},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;il;l++)u=.1*l,g[0]=Math.pow(1-u,3),g[1]=3*u*Math.pow(1-u,2),g[2]=3*Math.pow(u,2)*(1-u),g[3]=Math.pow(u,3),c=g[0]*e+g[1]*r.x+g[2]*a.x+g[3]*i,p=g[0]*t+g[1]*r.y+g[2]*a.y+g[3]*o,l>0&&(d=this._getDistanceToLine(f,m,c,p,n,s),h=h>d?d:h),f=c,m=p;return h}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i=l&&h>d;){var m=.5*(l+u);if(i=this.getPoint(m,a),o=Math.atan2(p.y-i.y,p.x-i.x),n=p.distanceToBorder(t,o),s=Math.sqrt(Math.pow(i.x-p.x,2)+Math.pow(i.y-p.y,2)),r=n-s,Math.abs(r)r?f===!1?l=m:u=m:f===!1?u=m:l=m,d++}return i.t=m,i}},{key:"_getDistanceToBezierEdge",value:function(e,t,i,o,n,s,r){var a=1e9,h=void 0,d=void 0,l=void 0,u=void 0,c=void 0,p=e,f=t;for(d=1;10>d;d++)l=.1*d,u=Math.pow(1-l,2)*e+2*l*(1-l)*r.x+Math.pow(l,2)*i,c=Math.pow(1-l,2)*t+2*l*(1-l)*r.y+Math.pow(l,2)*o,d>0&&(h=this._getDistanceToLine(p,f,u,c,n,s),a=a>h?h:a),p=u,f=c;return a}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function e(e,t){for(var i=0;io.shape.height?(t=o.x+.5*o.shape.width,i=o.y-n):(t=o.x+n,i=o.y-.5*o.shape.height),[t,i,n]}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,u=void 0,c=void 0,p=void 0,f=void 0,m=void 0,g=.05,v=.5*(s+r);r>=s&&h>d&&(v=.5*(s+r),u=this._pointOnCircle(o,n,l,v),c=Math.atan2(e.y-u.y,e.x-u.x),p=e.distanceToBorder(t,c),f=Math.sqrt(Math.pow(u.x-e.x,2)+Math.pow(u.y-e.y,2)),m=p-f,!(Math.abs(m)0?a>0?s=v:r=v:a>0?r=v:s=v,d++;return u.t=v,u}},{key:"getLineWidth",value:function(e,t){return e===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(e,t,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,t===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(e,t,i,o){this.enableShadow(e),e.beginPath(),e.arc(t,i,o,0,2*Math.PI,!1),e.stroke(),this.disableShadow(e)}},{key:"getDistanceToEdge",value:function(e,t,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(e,t,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),u=l[0],c=l[1],p=l[2],f=u-s,m=c-r;h=Math.abs(Math.sqrt(f*f+m*m)-p)}return this.labelModule.size.lefts&&this.labelModule.size.topr?0:h}},{key:"_getDistanceToLine",value:function(e,t,i,o,n,s){var r=i-e,a=o-t,h=r*r+a*a,d=((n-e)*r+(s-t)*a)/h;d>1?d=1:0>d&&(d=0);var l=e+d*r,u=t+d*a,c=l-n,p=u-s;return Math.sqrt(c*c+p*p)}},{key:"getArrowData",value:function(e,t,i,o,s){var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,u=void 0,c=this.getLineWidth(o,s);if("from"===t?(h=this.from,d=this.to,l=.1,u=this.options.arrows.from.scaleFactor):"to"===t?(h=this.to,d=this.from,l=-.1,u=this.options.arrows.to.scaleFactor):(h=this.to,d=this.from,u=this.options.arrows.middle.scaleFactor),h!=d)if("middle"!==t)if(this.options.smooth.enabled===!0){a=this.findBorderPosition(h,e,{via:i});var p=this.getPoint(Math.max(0,Math.min(1,a.t+l)),i);r=Math.atan2(a.y-p.y,a.x-p.x)}else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.findBorderPosition(h,e);else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.getPoint(.5,i);else{var f=this._getCircleData(e),m=n(f,3),g=m[0],v=m[1],y=m[2];"from"===t?(a=this.findBorderPosition(this.from,e,{x:g,y:v,low:.25,high:.6,direction:-1}),r=-2*a.t*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===t?(a=this.findBorderPosition(this.from,e,{x:g,y:v,low:.6,high:1,direction:1}),r=-2*a.t*Math.PI+1.5*Math.PI-1.1*Math.PI):(a=this._pointOnCircle(g,v,y,.175),r=3.9269908169872414)}var b=15*u+3*c,w=a.x-.9*b*Math.cos(r),_=a.y-.9*b*Math.sin(r),x={x:w,y:_};return{point:a,core:x,angle:r,length:b}}},{key:"drawArrowHead",value:function(e,t,i,o){e.strokeStyle=this.getColor(e,t,i),e.fillStyle=e.strokeStyle,e.lineWidth=this.getLineWidth(t,i),e.arrow(o.point.x,o.point.y,o.angle,o.length),this.enableShadow(e),e.fill(),this.disableShadow(e)}},{key:"enableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor=this.options.shadow.color,e.shadowBlur=this.options.shadow.size,e.shadowOffsetX=this.options.shadow.x,e.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}]),e}();t["default"]=a},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s):this.from.ythis.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s)),"discrete"===o&&(e=i*s>n?this.from.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n):this.from.ythis.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n)),"discrete"===o&&(t=i*n>s?this.from.y:t));else if("straightCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(e=this.from.x,t=this.from.yMath.abs(this.from.y-this.to.y)&&(e=this.from.x=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s,e=this.to.xthis.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s,e=this.to.x>e?this.to.x:e):this.from.ythis.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s,e=this.to.x>e?this.to.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.ythis.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n,t=this.to.y1||this.startedStabilization===!0)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/es))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;st?s[e].x>0?t:-t:s[e].x,i.x+=s[e].x*o}else n[e].x=0,s[e].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[e].y,d=(n[e].y-h)/i.options.mass;s[e].y+=d*o,s[e].y=Math.abs(s[e].y)>t?s[e].y>0?t:-t:s[e].y,i.y+=s[e].y*o}else n[e].y=0,s[e].y=0;var l=Math.sqrt(Math.pow(s[e].x,2)+Math.pow(s[e].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&e[t].x&&e[t].y&&(this.freezeCache[t]={x:e[t].options.fixed.x,y:e[t].options.fixed.y},e[t].options.fixed.x=!0,e[t].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.options.stabilization.iterations:arguments[0];return"number"!=typeof t&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),t=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return e._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var e=0;this.stabilized===!1&&e0){var e=void 0,t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(t,i);this.barnesHutTree=n;for(var s=0;o>s;s++)e=t[i[s]],e.options.mass>0&&(this._getForceContribution(n.root.children.NW,e),this._getForceContribution(n.root.children.NE,e),this._getForceContribution(n.root.children.SW,e),this._getForceContribution(n.root.children.SE,e))}}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,n=Math.sqrt(i*i+o*o),n*e.calcSize>this.thetaInversed?this._calculateForces(n,i,o,t,e):4===e.childrenCount?(this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)):e.children.data.id!=t.id&&this._calculateForces(n,i,o,t,e)}}},{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(e,3),r=t*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(e,t){for(var i=void 0,o=t.length,n=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,h=1;o>h;h++){var d=e[t[h]].x,l=e[t[h]].y;e[t[h]].options.mass>0&&(n>d&&(n=d),d>r&&(r=d),s>l&&(s=l),l>a&&(a=l))}var u=Math.abs(r-n)-Math.abs(a-s);u>0?(s-=.5*u,a+=.5*u):(n+=.5*u,r-=.5*u);var c=1e-5,p=Math.max(c,Math.abs(r-n)),f=.5*p,m=.5*(n+r),g=.5*(s+a),v={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-f,maxX:m+f,minY:g-f,maxY:g+f},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(v.root);for(var y=0;o>y;y++)i=e[t[y]],i.options.mass>0&&this._placeInTree(v.root,i);return v}},{key:"_updateBranchMass",value:function(e,t){var i=e.mass+t.options.mass,o=1/i;e.centerOfMass.x=e.centerOfMass.x*e.mass+t.x*t.options.mass,e.centerOfMass.x*=o,e.centerOfMass.y=e.centerOfMass.y*e.mass+t.y*t.options.mass,e.centerOfMass.y*=o,e.mass=i;var n=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NW"):this._placeInRegion(e,t,"SW"):e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NE"):this._placeInRegion(e,t,"SE")}},{key:"_placeInRegion",value:function(e,t,i){switch(e.children[i].childrenCount){case 0:e.children[i].children.data=t,e.children[i].childrenCount=1,this._updateBranchMass(e.children[i],t);break;case 1:e.children[i].children.data.x===t.x&&e.children[i].children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(e.children[i]),this._placeInTree(e.children[i],t));break;case 4:this._placeInTree(e.children[i],t)}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY,s=e.range.minY+r;break;case"NE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY,s=e.range.minY+r;break;case"SW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY+r,s=e.range.maxY;break;case"SE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY+r,s=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){void 0===i&&(i="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;ii&&(s=.5*u>i?1:c*i+p,s/=i,o=e*s,n=t*s,l[r.id].x-=o,l[r.id].y-=n,l[a.id].x+=o,l[a.id].y+=n)}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;ii?-Math.pow(f*i,2)+Math.pow(f*p,2):0,0===i?i=.01:s/=i,o=e*s,n=t*s,c[r.id].x-=o,c[r.id].y-=n,c[a.id].x+=o,c[a.id].y+=n}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=t*r,o[n.id].y=i*r}}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i=e&&i.push(n.id)}for(var r=0;r0&&Object.keys(p).length>0&&m===!0&&o.push({nodes:c,edges:p})}}}for(var b=0;bo?r.x:o,n=r.ys?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]||arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[e])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[e].containedNodes)return void console.log("The node:"+e+" is not a cluster.");var o=this.body.nodes[e],n=o.containedNodes,s=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var c=t.releaseFunction(a,r);for(var p in n)if(n.hasOwnProperty(p)){var f=this.body.nodes[p];void 0!==c[p]&&(f.x=void 0===c[p].x?o.x:c[p].x,f.y=void 0===c[p].y?o.y:c[p].y)}}else for(var m in n)if(n.hasOwnProperty(m)){var g=this.body.nodes[m];g=n[m],g.options.fixed.x===!1&&(g.x=o.x),g.options.fixed.y===!1&&(g.y=o.y)}for(var v in n)if(n.hasOwnProperty(v)){var y=this.body.nodes[v];y.vx=o.vx,y.vy=o.vy,y.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[v]}for(var b=[],w=0;wo;)t.push(this.body.nodes[e].id),e=this.clusteredNodes[e].clusterId,o++;return t.push(this.body.nodes[e].id),t.reverse(),t}},{key:"_getConnectedId",value:function(e,t){return e.toId!=t?e.toId:e.fromId!=t?e.fromId:e.fromId}},{key:"_getHubSize",value:function(){for(var e=0,t=0,i=0,o=0,n=0;no&&(o=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i,t/=i;var r=t-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return h>o&&(h=o),h}}]),e}();t["default"]=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i0)for(var a=0;at.shape.boundingBox.left&&(s=t.shape.boundingBox.left),rt.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n0)for(var a=0;at.x&&(s=t.x),rt.y&&(o=t.y),n0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(t,this.options,e)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){e._redraw(!1)},0):window.requestAnimationFrame(function(){e._redraw(!1)}))}},{key:"_redraw",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(t),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var e=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,i=void 0;for(var o in t)t.hasOwnProperty(o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=e&&1!=t?i=.5*this.cameraState.scale*(e+t):1!=e?i=this.cameraState.scale*e:1!=t&&(i=this.cameraState.scale*t),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(-1!==e.indexOf("%")||-1!==e.indexOf("px"))return e;if(-1===e.indexOf("%"))return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var e=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_ALL}),r.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new s(this.frame),r.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.options.width:arguments[0],t=arguments.length<=1||void 0===arguments[1]?this.options.height:arguments[1];e=this._prepareValue(e),t=this._prepareValue(t);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t?(this._getCameraState(r),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,i=!0):(this.frame.canvas.width==Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&this.frame.canvas.height==Math.round(this.frame.canvas.clientHeight*this.pixelRatio)||this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i.5*this.body.nodeIndices.length)return void this.fit(e,!1);i=a["default"].getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a["default"].getRange(this.body.nodes,e.nodes);var l=1.1*Math.abs(i.maxX-i.minX),u=1.1*Math.abs(i.maxY-i.minY),c=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/u;o=p>=c?c:p}o>1?o=1:0===o&&(o=1);var f=a["default"].findCenter(i),m={position:f,scale:o,animation:e.animation};this.moveTo(m)}},{key:"focus",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(void 0!==this.body.nodes[e]){var i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){return void 0===e?void(e={}):(void 0===e.offset&&(e.offset={x:0,y:0}),void 0===e.offset.x&&(e.offset.x=0),void 0===e.offset.y&&(e.offset.y=0),void 0===e.scale&&(e.scale=this.body.view.scale),void 0===e.position&&(e.position=this.getViewPosition()),void 0===e.animation&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),void this.animateView(e))}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},0===e.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*e.animation.duration*.001)||1/60, +this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=h.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}();t["default"]=d},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var i=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),u=l.nodesChanged,c=l.edgesChanged,p=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",t,e),r=!0,p=!0):u===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),this.selectionHandler._generateClickEvent("selectNode",t,e),p=!0,r=!0):0>h-n&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),r=!0),a-o>0&&p===!1?(this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):a>0&&c===!0?(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):0>a-o&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineIfDifferent",value:function(e,t){for(var i=!1,o=!1,n=0;ne&&(e=1e-5),e>10&&(e=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=e/i,r=(1-s)*t.x+n.x*s,a=(1-s)*t.y+n.y*s;if(this.body.view.scale=e,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),e>i?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}}},{key:"onMouseWheel",value:function(e){if(this.options.zoomView===!0){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!==t){var i=this.body.view.scale,o=t/10;0>t&&(o/=1-o),i*=1+o;var n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(i,n)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,i=this.getPointer({x:e.clientX,y:e.clientY}),o=!1;if(void 0!==this.popup&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(o=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),o===!1&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=setTimeout(function(){return t._checkShowPopup(i)},this.options.tooltipDelay))),this.options.hover===!0){var n=this.selectionHandler.getNodeAt(i);void 0===n&&(n=this.selectionHandler.getEdgeAt(i)),this.selectionHandler.hoverObject(n)}}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},n=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,h=this.body.nodes,l=void 0,u=[],c=0;c0&&(this.popupObj=h[u[u.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var p=this.body.edgeIndices,f=this.body.edges,m=void 0,g=[],v=0;v0&&(this.popupObj=f[g[g.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d["default"](this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){var o=this.selectionHandler.getNodeAt(e);i=o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}();t["default"]=u},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)this.boundFunctions.hasOwnProperty(e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){this.body.view.scale*=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{key:"_zoomOut",value:function(){this.body.view.scale/=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}();t["default"]=h},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;io&&(s=o-t-this.padding),sn&&(r=n-i-this.padding),r0?t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var i=this.body.edges,o=0;o0?t===!0?this.body.edges[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_addToSelection",value:function(e){e instanceof a["default"]?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof a["default"]?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof a["default"]?(delete this.selectionObj.nodes[e.id],this._unselectConnectedEdges(e)):delete this.selectionObj.edges[e.id]}},{key:"unselectAll",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&this.selectionObj.edges[t].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedNode",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return this.selectionObj.nodes[e]}},{key:"_getSelectedEdge",value:function(){for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return this.selectionObj.edges[e]}},{key:"_getSelectedEdgeCount",value:function(){var e=0;for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedObjectCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(e+=1);return e}},{key:"_selectionIsEmpty",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return!1;for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].clusterSize>1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0;t0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1), +this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(i===!0)return this.body.emitter.emit("refresh"),l.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){void 0===e.physics||e.physics===!0?(e.physics={enabled:void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===r(e.physics)?(this.optionsBackup.physics.enabled=void 0===e.physics.enabled||e.physics.enabled,this.optionsBackup.physics.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var t="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(t="vertical"),void 0===e.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1}):void 0===e.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1):"boolean"==typeof e.edges.smooth?(this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t}):(void 0!==e.edges.smooth.type&&"dynamic"!==e.edges.smooth.type&&(t=e.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===e.edges.smooth.enabled||e.edges.smooth.enabled,type:void 0===e.edges.smooth.type?"dynamic":e.edges.smooth.type,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0!==e.edges.smooth.forceDirection&&e.edges.smooth.forceDirection},e.edges.smooth={enabled:void 0===e.edges.smooth.enabled||e.edges.smooth.enabled,type:t,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0!==e.edges.smooth.forceDirection&&e.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var t=0;ts){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l0){var e=void 0,t=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(e=this.body.nodes[t],void 0===e.options.x&&void 0===e.options.y&&(o=!1),void 0!==e.options.level?(i=!0,this.hierarchicalLevels[t]=e.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},o=function(){for(var t=a(),i=0;i0)for(var n=0;n=l&&(r=Math.min(u,r),a=Math.max(u,a))}return[r,a,o,n]},l=function _(t){var i=e.hierarchicalLevels[t];if(e.hierarchicalChildrenReference[t]){var o=e.hierarchicalChildrenReference[t];if(o.length>0)for(var n=0;n1)for(var a=0;ae.options.hierarchical.nodeSpacing){var c={};c[i.id]=!0;var p={};p[o.id]=!0,h(i,c),h(o,p);var f=u(i,o),m=d(c,f),g=s(m,4),v=(g[0],g[1]),y=(g[2],g[3],d(p,f)),b=s(y,4),w=b[0],_=(b[1],b[2]),x=(b[3],Math.abs(v-w));if(x>e.options.hierarchical.nodeSpacing){var k=v-w+e.options.hierarchical.nodeSpacing;k<-_+e.options.hierarchical.nodeSpacing&&(k=-_+e.options.hierarchical.nodeSpacing),0>k&&(e._shiftBlock(o.id,k),t=!0,n===!0&&e._centerParent(o))}}},m=function(o,n){for(var r=n.id,a=n.edges,l=e.hierarchicalLevels[n.id],u=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,c={},p=[],f=0;fr;r++){var a=v(o,i),h=y(o,i),d=40,l=Math.max(-d,Math.min(d,Math.round(a/h)));if(o-=l,void 0!==s[o])break;s[o]=r}return o},w=function(o){var r=e._getPositionForHierarchy(n);if(void 0===i[n.id]){var a={};a[n.id]=!0,h(n,a),i[n.id]=a}var l=d(i[n.id]),u=s(l,4),c=(u[0],u[1],u[2]),p=u[3],f=o-r,m=0;f>0?m=Math.min(f,p-e.options.hierarchical.nodeSpacing):0>f&&(m=-Math.min(-f,c-e.options.hierarchical.nodeSpacing)),0!=m&&(e._shiftBlock(n.id,m),t=!0)},_=function(i){var o=e._getPositionForHierarchy(n),r=e._getSpaceAroundNode(n),a=s(r,2),h=a[0],d=a[1],l=i-o,u=o;l>0?u=Math.min(o+(d-e.options.hierarchical.nodeSpacing),i):0>l&&(u=Math.max(o-(h-e.options.hierarchical.nodeSpacing),i)),u!==o&&(e._setPositionForHierarchy(n,u,void 0,!0),t=!0)},x=b(o,p);w(x),x=b(o,a),_(x)},g=function(i){var o=Object.keys(e.distributionOrdering);o=o.reverse();for(var n=0;i>n;n++){t=!1;for(var s=0;sn&&(t=!1,p(f,o,!0),t===!0);n++);},y=function(){for(var t in e.body.nodes)e.body.nodes.hasOwnProperty(t)&&e._centerParent(e.body.nodes[t])},b=function(){var t=Object.keys(e.distributionOrdering);t=t.reverse();for(var i=0;i0)for(var d=0;dv&&Math.abs(v)0&&Math.abs(v)0&&(r=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(s,r,t),this._validataPositionAndContinue(s,t,r),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){if(void 0!==this.hierarchicalChildrenReference[e]){for(var i=[],o=0;ot&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[e]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l0&&(t=this._getHubSize(),0!==t);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===t&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=1e5,i=function(e,t,i){},o=function(o,n,s){var r=e.hierarchicalLevels[o.id];void 0===r&&(e.hierarchicalLevels[o.id]=t);var a=i(d["default"].cloneOptions(o,"node"),d["default"].cloneOptions(n,"node"),d["default"].cloneOptions(s,"edge"));e.hierarchicalLevels[n.id]=e.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var e=this,t=1e4,i=function(i,o,n){var s=e.hierarchicalLevels[i.id];void 0===s&&(e.hierarchicalLevels[i.id]=t),n.toId==o.id?e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]+1:e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var e=1e9;for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&void 0!==this.hierarchicalLevels[t]&&(e=Math.min(this.hierarchicalLevels[t],e));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=e)}},{key:"_generateMap",value:function(){var e=this,t=function(t,i){if(e.hierarchicalLevels[i.id]>e.hierarchicalLevels[t.id]){var o=t.id,n=i.id;void 0===e.hierarchicalChildrenReference[o]&&(e.hierarchicalChildrenReference[o]=[]),e.hierarchicalChildrenReference[o].push(n),void 0===e.hierarchicalParentReference[n]&&(e.hierarchicalParentReference[n]=[]),e.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(t)}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?function(){}:arguments[0],i=arguments[1],o={},n=0,s=function d(i,n){if(void 0===o[i.id]){void 0===e.hierarchicalTrees[i.id]&&(e.hierarchicalTrees[i.id]=n,e.treeIndex=Math.max(n,e.treeIndex)),o[i.id]=!0;for(var s=void 0,r=0;r1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.sort(function(e,t){return e.x-t.x}):e.sort(function(e,t){return e.y-t.y}))}}]),e}();t["default"]=u},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===e&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(t.isCluster!==!0){var i=s.deepExtend({},t.options,!1);if(i.x=t.x,i.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,function(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var e=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var t=e.body.edges[e.edgeBeingEditedId],i=e._getNewTargetNode(t.from.x,t.from.y),o=e._getNewTargetNode(t.to.x,t.to.y);e.temporaryIds.nodes.push(i.id),e.temporaryIds.nodes.push(o.id),e.body.nodes[i.id]=i,e.body.nodeIndices.push(i.id),e.body.nodes[o.id]=o,e.body.nodeIndices.push(o.id),e._temporaryBindUI("onTouch",e._controlNodeTouch.bind(e)),e._temporaryBindUI("onTap",function(){}),e._temporaryBindUI("onHold",function(){}),e._temporaryBindUI("onDragStart",e._controlNodeDragStart.bind(e)),e._temporaryBindUI("onDrag",e._controlNodeDrag.bind(e)),e._temporaryBindUI("onDragEnd",e._controlNodeDragEnd.bind(e)),e._temporaryBindUI("onMouseMove",function(){}),e._temporaryBindEvent("beforeDrawing",function(e){var n=t.edgeType.findBorderPositions(e);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),e.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(t.length>0){for(var n=0;n0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:t,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(e,t){var i=s.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=s.extend({},this.body.view.translation);var t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(t.x),i.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var o=t.x-this.lastTouch.x,n=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(n[r])){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(e){var t=this,i={id:s.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&(t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,o={from:e,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(e){null!==e&&void 0!==e&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,o={id:this.edgeBeingEditedId,from:e,to:t};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(e){null===e||void 0===e||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}();t["default"]=h},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{"boolean":o},filter:{"boolean":o,string:i,array:s,"function":"function"},container:{dom:a},showButton:{"boolean":o},__type__:{object:r,"boolean":o,string:i,array:s,"function":"function"}},edges:{arrows:{to:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},middle:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},from:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{"boolean":o},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],"boolean":o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{"boolean":o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},__type__:{object:r,string:i}},hidden:{"boolean":o},hoverWidth:{"function":"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},length:{number:n,undefined:"undefined"},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},selectionWidth:{"function":"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},smooth:{enabled:{"boolean":o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],"boolean":o},__type__:{object:r,"boolean":o}},title:{string:i,undefined:"undefined"},width:{number:n},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{"boolean":o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{"boolean":o},dragView:{"boolean":o},hideEdgesOnDrag:{"boolean":o},hideNodesOnDrag:{"boolean":o},hover:{"boolean":o},keyboard:{enabled:{"boolean":o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{"boolean":o},__type__:{object:r,"boolean":o}},multiselect:{"boolean":o},navigationButtons:{"boolean":o},selectable:{"boolean":o},selectConnectedEdges:{"boolean":o},hoverConnectedEdges:{"boolean":o},tooltipDelay:{number:n},zoomView:{"boolean":o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{"boolean":o},hierarchical:{enabled:{"boolean":o},levelSeparation:{number:n},nodeSpacing:{number:n},treeSpacing:{number:n},blockShifting:{"boolean":o},edgeMinimization:{"boolean":o},parentCentralization:{"boolean":o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,"boolean":o}},__type__:{object:r}},manipulation:{enabled:{"boolean":o},initiallyActive:{"boolean":o},addNode:{"boolean":o,"function":"function"},addEdge:{"boolean":o,"function":"function"},editNode:{"function":"function"},editEdge:{"boolean":o,"function":"function"},deleteNode:{"boolean":o,"function":"function"},deleteEdge:{"boolean":o,"function":"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,"boolean":o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{"boolean":o},y:{"boolean":o},__type__:{object:r,"boolean":o}},font:{align:{string:i},color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},__type__:{object:r,string:i}},group:{string:i,number:n,undefined:"undefined"},hidden:{"boolean":o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{"boolean":o,array:s},borderRadius:{number:n},interpolation:{"boolean":o},useImageSize:{"boolean":o},useBorderWithImage:{"boolean":o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{"boolean":o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{"boolean":o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{"boolean":o},fit:{"boolean":o},__type__:{object:r,"boolean":o}},timestep:{number:n},adaptiveTimestep:{"boolean":o},__type__:{object:r,"boolean":o}},autoResize:{"boolean":o},clickToUse:{"boolean":o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05]},middle:{enabled:!1,scaleFactor:[1,0,3,.05]},from:{enabled:!1,scaleFactor:[1,0,3,.05]}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]},global:{locale:["en","nl"]}};t.allOptions=d,t.configureOptions=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var i=0;in&&h>a;){a+=1;var g=this._getHighestEnergyNode(i),v=s(g,4);for(u=v[0],l=v[1],c=v[2],p=v[3],f=l,m=0;f>r&&d>m;){m+=1,this._moveNode(u,c,p);var y=this._getEnergy(u),b=s(y,3);f=b[0],c=b[1],p=b[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,o=0,n=t[0],r=0,a=0,h=0;ho&&(o=c,n=d,r=p,a=f)}}return[n,o,r,a]}},{key:"_getEnergy",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,o=i[e].x,n=i[e].y,s=0,r=0,a=0;al;l++)for(var u=0;d-1>u;u++)for(var c=u+1;d>c;c++)o[t[u]][t[c]]=Math.min(o[t[u]][t[c]],o[t[u]][t[l]]+o[t[l]][t[c]]),o[t[c]][t[u]]=o[t[u]][t[c]];return o}}]),e}();t["default"]=n},function(e,t){"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,i){this.beginPath(),this.arc(e,t,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,i){this.beginPath(),this.rect(e-i,t-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,i){this.beginPath(),i*=1.15,t+=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t-(r-s)),this.lineTo(e+n,t+s),this.lineTo(e-n,t+s),this.lineTo(e,t-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,i){this.beginPath(),i*=1.15,t-=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t+(r-s)),this.lineTo(e+n,t-s),this.lineTo(e-n,t-s),this.lineTo(e,t+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,i){this.beginPath(),i*=.82,t+=.1*i;for(var o=0;10>o;o++){var n=o%2===0?1.3*i:.5*i;this.lineTo(e+n*Math.sin(2*o*Math.PI/10),t-n*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,i){this.beginPath(),this.lineTo(e,t+i),this.lineTo(e+i,t),this.lineTo(e,t-i),this.lineTo(e-i,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,i,o,n){var s=Math.PI/180;0>i-2*n&&(n=i/2),0>o-2*n&&(n=o/2),this.beginPath(),this.moveTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,270*s,360*s,!1),this.lineTo(e+i,t+o-n),this.arc(e+i-n,t+o-n,n,0,90*s,!1),this.lineTo(e+n,t+o),this.arc(e+n,t+o-n,n,90*s,180*s,!1),this.lineTo(e,t+n),this.arc(e+n,t+n,n,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse=function(e,t,i,o){var n=.5522848,s=i/2*n,r=o/2*n,a=e+i,h=t+o,d=e+i/2,l=t+o/2;this.beginPath(),this.moveTo(e,l),this.bezierCurveTo(e,l-r,d-s,t,d,t),this.bezierCurveTo(d+s,t,a,l-r,a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,e,l+r,e,l),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,i,o){var n=1/3,s=i,r=o*n,a=.5522848,h=s/2*a,d=r/2*a,l=e+s,u=t+r,c=e+s/2,p=t+r/2,f=t+(o-r/2),m=t+o;this.beginPath(),this.moveTo(l,p),this.bezierCurveTo(l,p+d,c+h,u,c,u),this.bezierCurveTo(c-h,u,e,p+d,e,p),this.bezierCurveTo(e,p-d,c-h,t,c,t),this.bezierCurveTo(c+h,t,l,p-d,l,p),this.lineTo(l,f),this.bezierCurveTo(l,f+d,c+h,m,c,m),this.bezierCurveTo(c-h,m,e,f+d,e,f),this.lineTo(e,p)},CanvasRenderingContext2D.prototype.arrow=function(e,t,i,o){var n=e-o*Math.cos(i),s=t-o*Math.sin(i),r=e-.9*o*Math.cos(i),a=t-.9*o*Math.sin(i),h=n+o/3*Math.cos(i+.5*Math.PI),d=s+o/3*Math.sin(i+.5*Math.PI),l=n+o/3*Math.cos(i-.5*Math.PI),u=s+o/3*Math.sin(i-.5*Math.PI);this.beginPath(),this.moveTo(e,t),this.lineTo(h,d),this.lineTo(r,a),this.lineTo(l,u),this.closePath()},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,i,o,n){this.beginPath(),this.moveTo(e,t);for(var s=n.length,r=i-e,a=o-t,h=a/r,d=Math.sqrt(r*r+a*a),l=0,u=!0,c=0,p=n[0];d>=.1;)p=n[l++%s],p>d&&(p=d),c=Math.sqrt(p*p/(1+h*h)),c=0>r?-c:c,e+=c,t+=h*c,u===!0?this.lineTo(e,t):this.moveTo(e,t),d-=p,u=!u})},function(e,t){function i(e){return P=e,p()}function o(){I=0,A=P.charAt(0)}function n(){I++,A=P.charAt(I)}function s(){return P.charAt(I+1)}function r(e){return N.test(e)}function a(e,t){if(e||(e={}),t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function h(e,t,i){for(var o=t.split("."),n=e;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function d(e,t){for(var i,o,n=null,s=[e],r=e;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;o>i;i++)if(t.id===r.nodes[i].id){n=r.nodes[i];break}for(n||(n={id:t.id},e.node&&(n.attr=a(n.attr,e.node))),i=s.length-1;i>=0;i--){var h=s[i];h.nodes||(h.nodes=[]),-1===h.nodes.indexOf(n)&&h.nodes.push(n)}t.attr&&(n.attr=a(n.attr,t.attr))}function l(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=a({},e.edge);t.attr=a(i,t.attr)}}function u(e,t,i,o,n){var s={from:t,to:i,type:o};return e.edge&&(s.attr=a({},e.edge)),s.attr=a(s.attr||{},n),s}function c(){for(L=E.NULL,R="";" "===A||"\t"===A||"\n"===A||"\r"===A;)n();do{var e=!1;if("#"===A){for(var t=I-1;" "===P.charAt(t)||"\t"===P.charAt(t);)t--;if("\n"===P.charAt(t)||""===P.charAt(t)){for(;""!=A&&"\n"!=A;)n();e=!0}}if("/"===A&&"/"===s()){for(;""!=A&&"\n"!=A;)n();e=!0}if("/"===A&&"*"===s()){for(;""!=A;){if("*"===A&&"/"===s()){n(),n();break}n()}e=!0}for(;" "===A||"\t"===A||"\n"===A||"\r"===A;)n()}while(e);if(""===A)return void(L=E.DELIMITER);var i=A+s();if(T[i])return L=E.DELIMITER,R=i,n(),void n();if(T[A])return L=E.DELIMITER,R=A,void n();if(r(A)||"-"===A){for(R+=A,n();r(A);)R+=A,n();return"false"===R?R=!1:"true"===R?R=!0:isNaN(Number(R))||(R=Number(R)),void(L=E.IDENTIFIER)}if('"'===A){for(n();""!=A&&('"'!=A||'"'===A&&'"'===s());)R+=A,'"'===A&&n(),n();if('"'!=A)throw _('End of string " expected');return n(),void(L=E.IDENTIFIER)}for(L=E.UNKNOWN;""!=A;)R+=A,n();throw new SyntaxError('Syntax error in part "'+x(R,30)+'"')}function p(){var e={};if(o(),c(),"strict"===R&&(e.strict=!0,c()),"graph"!==R&&"digraph"!==R||(e.type=R,c()),L===E.IDENTIFIER&&(e.id=R,c()),"{"!=R)throw _("Angle bracket { expected");if(c(),f(e),"}"!=R)throw _("Angle bracket } expected");if(c(),""!==R)throw _("End of file expected");return c(),delete e.node,delete e.edge,delete e.graph,e}function f(e){for(;""!==R&&"}"!=R;)m(e),";"===R&&c()}function m(e){var t=g(e);if(t)return void b(e,t);var i=v(e);if(!i){if(L!=E.IDENTIFIER)throw _("Identifier expected");var o=R;if(c(),"="===R){if(c(),L!=E.IDENTIFIER)throw _("Identifier expected");e[o]=R,c()}else y(e,o)}}function g(e){var t=null;if("subgraph"===R&&(t={},t.type="subgraph",c(),L===E.IDENTIFIER&&(t.id=R,c())),"{"===R){if(c(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,f(t),"}"!=R)throw _("Angle bracket } expected");c(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function v(e){return"node"===R?(c(),e.node=w(),"node"):"edge"===R?(c(),e.edge=w(),"edge"):"graph"===R?(c(),e.graph=w(),"graph"):null}function y(e,t){var i={id:t},o=w();o&&(i.attr=o),d(e,i),b(e,t)}function b(e,t){for(;"->"===R||"--"===R;){var i,o=R;c();var n=g(e);if(n)i=n;else{if(L!=E.IDENTIFIER)throw _("Identifier or subgraph expected");i=R,d(e,{id:i}),c()}var s=w(),r=u(e,t,i,o,s);l(e,r),t=i}}function w(){for(var e=null;"["===R;){for(c(),e={};""!==R&&"]"!=R;){if(L!=E.IDENTIFIER)throw _("Attribute name expected");var t=R;if(c(),"="!=R)throw _("Equal sign = expected");if(c(),L!=E.IDENTIFIER)throw _("Attribute value expected");var i=R;h(e,t,i),c(),","==R&&c()}if("]"!=R)throw _("Bracket ] expected");c()}return e}function _(e){return new SyntaxError(e+', got "'+x(R,30)+'" (char '+I+")")}function x(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function k(e,t,i){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}):Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}function S(e,t,i){for(var o=t.split("."),n=o.pop(),s=e,r=0;r":!0,"--":!0},P="",I=0,A="",R="",L=E.NULL,N=/[a-zA-Z_0-9.:#]/;t.parseDOT=i,t.DOTToGraph=C},function(e,t){function i(e,t){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==t&&(void 0!==t.fixed&&(n.nodes.fixed=t.fixed),void 0!==t.parseColor&&(n.nodes.parseColor=t.parseColor),void 0!==t.inheritColor&&(n.edges.inheritColor=t.inheritColor));for(var s=e.edges,r=e.nodes,a=0;a0&&(n.actions=o),t.userRoles.push(n)},c=function(o){t.loading=!0;var n=angular.copy(t.user);n.roles[o.id]=o.title,t.baseApiRequest("put","/api/user/"+t.user.id,n).then(function(e){i(function(){d(e)})},function(t){e.$emit("log.error",{cause:t.code,msg:l("user.messages.could_not_add_role_to_user")})}).then(function(){t.loading=!1})};if(n.id){if(!t.requireRole("ROLE_USER_ADMIN"))return e.$emit("log.error",{timeout:5e3,cause:403,msg:l("common.error.forbidden")}),void s.path("/");t.getEntity("user",{id:n.id}).then(function(e){i(function(){d(e)})},function(t){e.$emit("log.error",{timeout:5e3,cause:t.code,msg:l("user.messages.user_not_found")}),s.path("/admin")}).then(function(){t.loading=!1})}else t.loading=!1,d(t.baseCurrentUser);t.removeRoleFromUser=function(o){t.loading=!0;var n=angular.copy(t.user);delete n.roles[o],t.baseApiRequest("put","/api/user/"+t.user.id,n).then(function(e){e.id===h.getCurrentUser().id&&h.updateCurrentUser(),i(function(){d(e)})},function(t){e.$emit("log.error",{cause:t.code,msg:l("user.messages.could_not_remove_role_from_user")})}).then(function(){t.loading=!1})},t.showAddRoleModal=function(){o.showModal({templateUrl:"bundles/os2displayadmin/apps/adminApp/user/popup-add-role-to-user.html",controller:"PopupAddRoleToUser",inputs:{options:{type:"user/roles",list:t.userRoles,heading:l("user.action.search_for_role"),searchPlaceholder:"",clickCallback:c}}}).then(function(e){e.close.then(function(){})})},t.submitForm=function(i){if(!t.loading){if(i.$invalid)return void e.$emit("log.error",{timeout:5e3,cause:err.code,msg:l("common.form.invalid")});t.loading=!0,t.updateEntity("user",t.user).then(function(t){t.id===h.getCurrentUser().id&&h.updateCurrentUser(),d(t),e.$emit("log.info",{timeout:3e3,msg:l("user.messages.user_updated")})},function(t){409===t.code?e.$emit("log.error",{cause:t.code,msg:l("user.messages.user_not_updated_conflict")}):e.$emit("log.error",{cause:t.code,msg:l("user.messages.user_not_updated")})}).then(function(){t.loading=!1})}}}]),angular.module("adminApp").controller("PopupCreateUser",["busService","$scope","$timeout","close","$controller","$filter",function(e,t,i,o,n,s){"use strict";n("BaseApiController",{$scope:t});var r=s("translate");t.user={email:""},t.loading=!1,t.errors=[],t.forms={},t.closeModal=function(){o(null)},t.submitForm=function(i){if(!t.loading){if(t.errors=[],i.emailInput.$invalid)return void t.errors.push(r("user.texts.error_email_not_valid"));t.loading=!0,t.createEntity("user",t.user).then(function(t){e.$emit("log.info",{timeout:5e3,msg:r("user.messages.user_created")}),o(t)},function(e){400===e.code?t.errors.push(r("common.form.invalid")):409===e.code?t.errors.push(r("user.texts.user_not_created_conflict")):t.errors.push(r("user.texts.user_not_created"))}).then(function(){t.loading=!1})}}}]),angular.module("adminApp").controller("PopupDeleteUser",["busService","$scope","$timeout","close","$controller","user","$filter",function(e,t,i,o,n,s,r){"use strict";n("BaseApiController",{$scope:t});var a=r("translate");t.user=s,t.loading=!1,t.closeModal=function(){o(null)},t.submitForm=function(i){t.loading||(t.loading=!0,t.deleteEntity("user",t.user).then(function(){e.$emit("log.info",{timeout:5e3,msg:a("user.messages.user_deleted")}),o(t.user)},function(t){e.$emit("log.error",{cause:t.code,timeout:5e3,msg:a("user.messages.user_not_deleted")})}).then(function(){t.loading=!1}))}}]),angular.module("adminApp").controller("PopupAddRoleToUser",["busService","$scope","$timeout","$controller","close","options","$filter",function(e,t,i,o,n,s,r){"use strict";function a(e){var i=s.list.find(function(t){return t.id===e.id});i||t.elements.push({id:e.id,title:e.title,entity:e,click:t.clickCallback})}o("BaseApiController",{$scope:t});var h=r("translate");t.loading=!1,t.clickCallback=s.clickCallback,t.heading=s.heading,t.searchPlaceholder=s.searchPlaceholder,t.elements=[],t.getEntities(s.type).then(function(e){for(var t in e)a({id:t,title:e[t]})},function(t){e.$emit("log.error",{cause:t.code,msg:h("user.messages.roles_not_found")})}).then(function(){t.loading=!1}),t.closeModal=function(){n(null)}}]); \ No newline at end of file