From 0327757b709305ad0e5043e6ead2d34506cc56e3 Mon Sep 17 00:00:00 2001 From: tuj Date: Fri, 8 Feb 2019 12:43:43 +0100 Subject: [PATCH] Pr aarhus changes (#8) * Merged https://github.com/os2display/admin-bundle/pull/8: - Moved template load from templateService to .twig to speed up initial load and avoid multiple api calls. - Fixed shared channel overview html. --- CHANGELOG.md | 6 +++++ Controller/MainController.php | 22 +++++++--------- .../shared-channel-overview.html | 19 ++++++-------- .../apps/ikShared/services/templateFactory.js | 4 +-- .../assets/build/os2displayadmin.min.js | 26 ++----------------- Resources/views/Main/index.html.twig | 13 ++++++++-- version.json | 2 +- 7 files changed, 39 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d06b94d..97922e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 1.2.0 + +* Merged https://github.com/os2display/admin-bundle/pull/8: + - Moved template load from templateService to .twig to speed up initial load and avoid multiple api calls. + - Fixed shared channel overview html. + ## 1.1.1 * Merged https://github.com/os2display/admin-bundle/pull/6: Only display the add role modal if the user has admin privileges. diff --git a/Controller/MainController.php b/Controller/MainController.php index 2edb2df..453988f 100644 --- a/Controller/MainController.php +++ b/Controller/MainController.php @@ -20,18 +20,13 @@ class MainController extends Controller */ public function indexAction() { - // Add paths to css files for activated templates. - $templates = array(); - $slideTemplates = $this->container->get('os2display.template_service') - ->getEnabledSlideTemplates(); - foreach ($slideTemplates as $template) { - $templates[] = $template->getPathCss(); - } - $screenTemplates = $this->container->get('os2display.template_service') - ->getEnabledScreenTemplates(); - foreach ($screenTemplates as $template) { - $templates[] = $template->getPathCss(); - } + $templateService = $this->container->get('os2display.template_service'); + $serializer = $this->container->get('jms_serializer'); + + $templateRenderArray = [ + 'screens' => json_decode($serializer->serialize($templateService->getAllScreenTemplates(), 'json', SerializationContext::create()->setGroups(array('api')))), + 'slides' => json_decode($serializer->serialize($templateService->getAllSlideTemplates(), 'json', SerializationContext::create()->setGroups(array('api')))), + ]; // Get current user. $user = $this->getUser(); @@ -84,7 +79,8 @@ public function indexAction() 'apps' => $mergedApps, 'bootstrap' => $mergedBootstrap, 'modules' => $mergedModules, - 'templates' => $templates, + 'templates' => $templateRenderArray, + 'jsonTemplates' => json_encode($templateRenderArray), 'user' => $user ] ); diff --git a/Resources/public/apps/ikShared/elements/sharedChannelOverview/shared-channel-overview.html b/Resources/public/apps/ikShared/elements/sharedChannelOverview/shared-channel-overview.html index 1b3193c..7984a13 100644 --- a/Resources/public/apps/ikShared/elements/sharedChannelOverview/shared-channel-overview.html +++ b/Resources/public/apps/ikShared/elements/sharedChannelOverview/shared-channel-overview.html @@ -19,18 +19,15 @@
-
- -
{{channel.title}}
-
-
-
'}}]),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?c(n.channel.slides,e,0):c(n.channel.slides,e,e+1)},n.pushLeft=function(e){c(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 c(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 c("title")},templateSet:function(){return c("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();tt[i]=tt[i+"s"]=tt[t]=e}function P(e){return"string"==typeof e?tt[e]||tt[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&&(st[e]=n),t&&(st[t[0]]=function(){return N(n.apply(this,arguments),t[1],t[2])}),i&&(st[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function F(e,t){return e.isValid()?(t=B(t,e.localeData()),nt[t]=nt[t]||function(o){var e,n,t,s=o.match(it);for(e=0,n=s.length;eY(i[St],i[Ot])?Ct:i[Mt]<0||24Q(e)?(s=e+1,l-Q(e)):(s=e,l),{year:s,dayOfYear:r}}function oe(e,t,i){var o,n,s=te(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(n=e.year()-1,o=r+ne(n,t,i)):r>ne(e.year(),t,i)?(o=r-ne(e.year(),t,i),n=e.year()+1):(n=e.year(),o=r),{week:o,year:n}}function ne(e,t,i){var o=te(e,t,i),n=te(e+1,t,i);return(Q(e)-o+n)/7}function se(e,t,i){return null!=e?e:null!=t?t:i}function re(e){var t,i,o,n,s,r,a,h,l,d,c,u,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[Ct]&&null==e._a[Ot]&&(p=u=c=d=l=h=a=r=void 0,null!=(r=(s=e)._w).GG||null!=r.W||null!=r.E?(d=1,c=4,a=se(r.GG,s._a[St],oe(de(),1,4).year),h=se(r.W,1),((l=se(r.E,1))<1||7ne(a,d,c)?y(s)._overflowWeeks=!0:null!=p?y(s)._overflowWeekday=!0:(u=ie(a,h,l,d,c),s._a[St]=u.year,s._dayOfYear=u.dayOfYear)),e._dayOfYear&&(n=se(e._a[St],o[St]),e._dayOfYear>Q(n)&&(y(e)._overflowDayOfYear=!0),i=J(n,0,e._dayOfYear),e._a[Ot]=i.getUTCMonth(),e._a[Ct]=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[Mt]&&0===e._a[Dt]&&0===e._a[Et]&&0===e._a[Tt]&&(e._nextDay=!0,e._a[Mt]=0),e._d=(e._useUTC?J: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[Mt]=24)}}function ae(e){if(e._f!==v.ISO_8601){e._a=[],y(e).empty=!0;var t,i,o,n,s,r,a,h,l,d,c,u,p=""+e._i,f=p.length,m=0;for(o=B(e._f,e._locale).match(it)||[],t=0;t>>0,o=0;oi.valueOf():i.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ci.isDSTShifted=function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(f(e,this),(e=he(e))._a){var t=e._isUTC?c(e._a):de(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 c=e.node||f,u=0;u<6;u++)n[o+u]=c[u];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,c.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 c(t,e,i){n(f(e),function(e){t.addEventListener(e,i,!1)})}function u(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&(ue|pe)&&!n)this.reset();else if(e.eventType&ce)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&ue)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&ue?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&ue},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 '+u.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+u.printLocation(n.path,n.closestMatch,""),l):o.distance<=8?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+o.closestMatch+'"?'+u.printLocation(o.path,e),l):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+u.print(Object.keys(t))+u.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 c=u.findInOptions(e,t[l],p.copyAndExtendArray(i,l));n>c.distance&&(s=c.closestMatch,r=c.path,n=c.distance,h=c.indexMatch)}else-1!==l.toLowerCase().indexOf(a)&&(h=l),(d=u.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;u(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),c=new Date(this.end);this.body.emitter.emit("rangechange",{start:d,end:c,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(u(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},c.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})}}},c._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}},c.prototype.itemFromTarget=function(e){for(var t=e.target;t;){if(t.hasOwnProperty("timeline-item"))return t["timeline-item"];t=t.parentNode}return null},c.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,c,u,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(),u=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,u,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-r&&!0===this.options.visible?(this.width=this.maxLabelSize+r,this.options.width=this.width+"px",a.cleanupElements(this.DOMelements.lines),a.cleanupElements(this.DOMelements.labels),this.redraw(),!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+r),this.options.width=this.width+"px",a.cleanupElements(this.DOMelements.lines),a.cleanupElements(this.DOMelements.labels),this.redraw(),!0):(a.cleanupElements(this.DOMelements.lines),a.cleanupElements(this.DOMelements.labels),!1)},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=a.getDOMElement("div",this.DOMelements.labels,this.dom.frame);s.className=o,s.innerHTML=t,s.style.textAlign="left"===i?(s.style.left="-"+this.options.labelOffsetX+"px","right"):(s.style.right="-"+this.options.labelOffsetX+"px","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],c=l[1],u=this._setAlignment(e,i,a,n),p=m(u,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,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,2*this.options.size*i):(e=this.imageObj.width,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,i.y-h):(r=i.x+h,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,this.to.x+r*e):(o=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,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,o.y-n):(t=o.x+n,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,c=void 0,u=void 0,p=.5*(s+r);s<=r&&h<10&&(p=.5*(s+r),d=this._pointOnCircle(o,n,l,p),c=Math.atan2(e.y-d.y,e.x-d.x),u=e.distanceToBorder(t,c)-Math.sqrt(Math.pow(d.x-e.x,2)+Math.pow(d.y-e.y,2)),!(Math.abs(u)<.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 c in n)if(n.hasOwnProperty(c)){var u=this.body.nodes[c];void 0!==d[c]&&(u.x=void 0===d[c].x?o.x:d[c].x,u.y=void 0===d[c].y?o.y:d[c].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=c.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=c.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)),c=M(h,d),u=D(c,4),p=(u[0],u[1]),f=(u[2],u[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;c();var n=f(e);if(n)i=n;else{if(E!=k.IDENTIFIER)throw v("Identifier or subgraph expected");l(e,{id:i=D}),c()}a(e,d(e,t,i,o,g())),t=i}}function g(){for(var e=null;"["===D;){for(c(),e={};""!==D&&"]"!=D;){if(E!=k.IDENTIFIER)throw v("Attribute name expected");var t=D;if(c(),"="!=D)throw v("Equal sign = expected");if(c(),E!=k.IDENTIFIER)throw v("Attribute value expected");r(e,t,D),c(),","==D&&c()}if("]"!=D)throw v("Bracket ] expected");c()}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 + {% for template in templates.slides %} + + {% endfor %} + {% for template in templates.screens %} + {% endfor %} {% endif %} @@ -60,10 +63,16 @@ }, "version": "{{ version }}" }; + + + + {% if app.environment == 'prod' %} diff --git a/version.json b/version.json index f13a0be..7ef142e 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { "name": "Os2DisplayAdminBundle", - "version": "1.0.0", + "version": "1.2.0", "link": "https://github.com/os2display" }