diff --git a/.gitignore b/.gitignore index 03d39d10..fbaaa115 100755 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ bower_components .sass-cache nbproject coverage +.bowerrc diff --git a/AUTHORS b/AUTHORS index 76660b68..74895976 100755 --- a/AUTHORS +++ b/AUTHORS @@ -3,3 +3,4 @@ Kuba Wolanin (@kubawolanin) Sam Turner (@digiltd) Ingo Sigmund (@isigmund) Andreas Gebauer (@andreasgebauer) +Lucky Mallari (@luckymallari) diff --git a/doc/habpanel.md b/doc/habpanel.md index 340df1ad..0cc5c468 100644 --- a/doc/habpanel.md +++ b/doc/habpanel.md @@ -145,7 +145,7 @@ Apart from the storage configuration discussed above, the settings screen contai | Additional stylesheet | Reference the relative URL of an additional CSS file which will be included and can be used to override the styles defined by the theme. For additional information on how you can customize HABPanel's styles, go to: [HABPanel Development & Advanced Features: Start Here!](https://community.openhab.org/t/habpanel-development-advanced-features-start-here/30755/1) | Drawer heading image | Reference the URL of an image (expected width: 265 pixels) which will replace the header in the side drawer | Hide the drawer's footer | Check to remove the bottom black part of the side drawer containing the date & time -| Hide toolbar buttons (speak/refresh/fullscreen) | Check those boxes to hide the corresponding button in the default dashboard header top-right corner +| Hide toolbar buttons (screensaver/speak/refresh/fullscreen) | Check those boxes to hide the corresponding button in the default dashboard header top-right corner | Show a clock in the header | If checked, a clock will be displayed in the main menu and the dashboards | Header clock format (shown if "Show a clock in the header" is checked) | Use an [AngularJS' date filter format string](https://docs.angularjs.org/api/ng/filter/date) to customize the clock format in the header. The default is `HH:mm` | Prevent scrolling (when not editing) | When enabled, it is impossible to scroll the dashboard on a tablet (and it prevents the "elastic" bouncing effect on iOS/Safari) diff --git a/web/app/app.js b/web/app/app.js index 33427024..b97eefce 100755 --- a/web/app/app.js +++ b/web/app/app.js @@ -18,7 +18,8 @@ 'ngFileSaver', 'snap', 'tmh.dynamicLocale', - 'pascalprecht.translate' + 'pascalprecht.translate', + 'as.sortable' ]) .config(['$routeProvider', 'localStorageServiceProvider', 'tmhDynamicLocaleProvider', '$translateProvider', '$translatePartialLoaderProvider', function($routeProvider, localStorageServiceProvider, tmhDynamicLocaleProvider, $translateProvider, $translatePartialLoaderProvider) { localStorageServiceProvider.setStorageType('localStorage'); @@ -180,6 +181,20 @@ }] } }) + .when('/settings/screensaver', { + templateUrl: 'app/settings/settings.screensaver.html', + controller: 'ScreensaverSettingsCtrl', + resolve: { + dashboards: ['PersistenceService', '$q', function (persistenceService, $q) { + var dashboards = persistenceService.getDashboards(true); + if (persistenceService.isEditingLocked()) return $q.reject("Editing is locked"); + return dashboards; + }], + translations: ['TranslationService', function (TranslationService) { + return TranslationService.enterPart('admin'); + }] + } + }) .otherwise({ redirectTo: '/' }); diff --git a/web/app/dashboard/dashboard.view.controller.js b/web/app/dashboard/dashboard.view.controller.js index d98307b0..05b504a2 100755 --- a/web/app/dashboard/dashboard.view.controller.js +++ b/web/app/dashboard/dashboard.view.controller.js @@ -2,13 +2,14 @@ .module('app') .controller('DashboardViewCtrl', DashboardViewController); - DashboardViewController.$inject = ['$scope', '$location', '$rootScope', '$routeParams', '$timeout', 'dashboard', 'PersistenceService', 'OHService', 'Fullscreen', 'snapRemote', 'SpeechService', 'TranslationService']; - function DashboardViewController($scope, $location, $rootScope, $routeParams, $timeout, dashboard, PersistenceService, OHService, Fullscreen, snapRemote, SpeechService, TranslationService) { + DashboardViewController.$inject = ['$scope', '$location', '$rootScope', '$routeParams', '$timeout', 'dashboard', 'PersistenceService', 'OHService', 'Fullscreen', 'snapRemote', 'SpeechService', 'TranslationService', 'ScreensaverService']; + function DashboardViewController($scope, $location, $rootScope, $routeParams, $timeout, dashboard, PersistenceService, OHService, Fullscreen, snapRemote, SpeechService, TranslationService, ScreensaverService) { var vm = this; vm.dashboard = dashboard; vm.speakTooltip = TranslationService.translate('dashboard.toolbar.speak', 'Speak'); vm.refreshTooltip = TranslationService.translate('dashboard.toolbar.refresh', 'Refresh'); vm.fullscreenTooltip = TranslationService.translate('dashboard.toolbar.fullscreen', 'Fullscreen'); + vm.screensaverToolTip = TranslationService.translate('dashboard.toolbar.screensaver', 'Screensaver'); vm.gridsterOptions = { margins: (vm.dashboard.widget_margin) ? @@ -73,6 +74,14 @@ $location.url("/edit/" + dashboard.id); }; + vm.startScreensaver = function() { + ScreensaverService.start(true); + } + vm.isScreensaverEnabled = function() { + return ScreensaverService.isEnabled; + } + + vm.isScreensaverRunning = ScreensaverService.isRunning; // Speech recognition vm.isListening = false; diff --git a/web/app/dashboard/dashboard.view.html b/web/app/dashboard/dashboard.view.html index 569de082..4bfd6f3d 100755 --- a/web/app/dashboard/dashboard.view.html +++ b/web/app/dashboard/dashboard.view.html @@ -2,7 +2,6 @@ - @@ -15,6 +14,9 @@ title="{{vm.speakTooltip}}"> + + +

{{vm.dashboard.name}} @@ -40,7 +42,7 @@

tooltip-placement="top"> -
+
  • diff --git a/web/app/services/openhab.service.js b/web/app/services/openhab.service.js index 299cf7bc..0c99f404 100755 --- a/web/app/services/openhab.service.js +++ b/web/app/services/openhab.service.js @@ -1,5 +1,5 @@ -(function() { -'use strict'; +(function () { + 'use strict'; angular .module('app.services') @@ -7,8 +7,32 @@ .value('OH2ServiceConfiguration', {}) .service('OH2StorageService', OH2StorageService); - OHService.$inject = ['$rootScope', '$http', '$q', '$timeout', '$interval', '$filter', '$location', 'SpeechService', 'tmhDynamicLocale', '$translate']; - function OHService($rootScope, $http, $q, $timeout, $interval, $filter, $location, SpeechService, tmhDynamicLocale, $translate) { + OHService.$inject = [ + '$rootScope', + '$http', + '$q', + '$timeout', + '$interval', + '$filter', + '$location', + 'SpeechService', + 'tmhDynamicLocale', + '$translate', + 'ScreensaverService' + ]; + function OHService( + $rootScope, + $http, + $q, + $timeout, + $interval, + $filter, + $location, + SpeechService, + tmhDynamicLocale, + $translate, + ScreensaverService + ) { this.getItem = getItem; this.getItems = getItems; this.getLocale = getLocale; @@ -30,29 +54,29 @@ function loadItems() { $http.get('/rest/items') - .then(function (data) { - if (angular.isArray(data.data)) { - console.log("Loaded " + data.data.length + " openHAB items"); - $rootScope.reconnecting = false; - $rootScope.items = data.data; - if (!liveUpdatesEnabled) registerEventSource(); - } else { - console.warn("Items not found? Retrying in 5 seconds"); + .then(function (data) { + if (angular.isArray(data.data)) { + console.log("Loaded " + data.data.length + " openHAB items"); + $rootScope.reconnecting = false; + $rootScope.items = data.data; + if (!liveUpdatesEnabled) registerEventSource(); + } else { + console.warn("Items not found? Retrying in 5 seconds"); + $rootScope.reconnecting = true; + $rootScope.items = []; + $timeout(loadItems, 5000); + } + $rootScope.$emit('openhab-update'); + }, + function (err) { + console.warn("Error loading openHAB items... retrying in 5 seconds"); $rootScope.reconnecting = true; - $rootScope.items = []; $timeout(loadItems, 5000); - } - $rootScope.$emit('openhab-update'); - }, - function (err) { - console.warn("Error loading openHAB items... retrying in 5 seconds"); - $rootScope.reconnecting = true; - $timeout(loadItems, 5000); - }); + }); } function getItem(name) { - var item = $filter('filter')($rootScope.items, {name: name}, true); + var item = $filter('filter')($rootScope.items, { name: name }, true); return (item) ? item[0] : null; } @@ -67,9 +91,9 @@ */ function sendCmd(item, cmd) { $http({ - method : 'POST', - url : '/rest/items/' + item, - data : cmd, + method: 'POST', + url: '/rest/items/' + item, + data: cmd, headers: { 'Content-Type': 'text/plain' } }).then(function (data) { console.log('Command sent: ' + item + '=' + cmd); @@ -90,47 +114,47 @@ deferred.resolve(locale); } else { $http.get('/rest/services/org.eclipse.smarthome.core.i18nprovider/config') - .then(function (response) { - var language; - if (!response.data.language) { - if (navigator && navigator.languages) { - locale = navigator.languages[0]; - language = locale.split('-')[0]; - } else if (navigator && navigator.language) { - locale = navigator.language; - language = locale.split('-')[0]; + .then(function (response) { + var language; + if (!response.data.language) { + if (navigator && navigator.languages) { + locale = navigator.languages[0]; + language = locale.split('-')[0]; + } else if (navigator && navigator.language) { + locale = navigator.language; + language = locale.split('-')[0]; + } else { + locale = language = 'en'; + } } else { - locale = language = 'en'; + language = response.data.language; + locale = response.data.language + ((response.data.region) ? '-' + response.data.region : ''); } - } else { - language = response.data.language; - locale = response.data.language + ((response.data.region) ? '-' + response.data.region : ''); - } - /* consider the region only for selected common exceptions where the date/number formats - are significantly different than the language's default. - If more are needed change the gulpfile.js too and run the 'vendor-angular-i18n' gulp task */ - if (['es-ar', 'de-at', 'en-au', 'fr-be', 'es-bo', 'pt-br', 'en-ca', + /* consider the region only for selected common exceptions where the date/number formats + are significantly different than the language's default. + If more are needed change the gulpfile.js too and run the 'vendor-angular-i18n' gulp task */ + if (['es-ar', 'de-at', 'en-au', 'fr-be', 'es-bo', 'pt-br', 'en-ca', 'fr-ca', 'fr-ch', 'es-co', 'en-gb', 'en-hk', 'zh-hk', 'en-ie', 'en-in', 'fr-lu', 'es-mx', 'en-nz', 'en-sg', 'zh-sg', 'es-us', 'zh-tw', 'en-za'].indexOf(locale.toLowerCase()) < 0) { - locale = language; - } + locale = language; + } - if (language !== "en") { - console.log('Setting interface language to: ' + language); - $translate.use(language); - } + if (language !== "en") { + console.log('Setting interface language to: ' + language); + $translate.use(language); + } - console.log('Setting locale to: ' + locale); - tmhDynamicLocale.set(locale.toLowerCase()); + console.log('Setting locale to: ' + locale); + tmhDynamicLocale.set(locale.toLowerCase()); - deferred.resolve(locale); - }, function(error) { - console.warn('Couldn\'t retrieve locale settings. Setting default to "en-US"'); - locale = 'en-US'; - deferred.resolve(locale); - }); + deferred.resolve(locale); + }, function (error) { + console.warn('Couldn\'t retrieve locale settings. Setting default to "en-US"'); + locale = 'en-US'; + deferred.resolve(locale); + }); } return deferred.promise; @@ -143,13 +167,13 @@ */ function sendVoice(text) { $http({ - method : 'POST', - url : '/rest/voice/interpreters', - data : text, + method: 'POST', + url: '/rest/voice/interpreters', + data: text, headers: { 'Content-Type': 'text/plain' } }).then(function (data) { console.log('Voice command sent: "' + text + '"'); - }, function(error) { + }, function (error) { console.error('Error occured while sending voice command.'); }); } @@ -157,9 +181,9 @@ function reloadItems() { loadItems(); } - + function registerEventSource() { - if (typeof(EventSource) !== "undefined") { + if (typeof (EventSource) !== "undefined") { var source = new EventSource('/rest/events'); liveUpdatesEnabled = true; @@ -171,7 +195,7 @@ if (evtdata.type === 'ItemStateEvent' || evtdata.type === 'ItemStateChangedEvent' || evtdata.type === 'GroupItemStateChangedEvent') { var payload = JSON.parse(evtdata.payload); var newstate = payload.value; - var item = $filter('filter')($rootScope.items, {name: topicparts[2]}, true)[0]; + var item = $filter('filter')($rootScope.items, { name: topicparts[2] }, true)[0]; if (item && item.state !== payload.value) { $rootScope.$apply(function () { console.log("Updating " + item.name + " state from " + item.state + " to " + payload.value); @@ -187,6 +211,7 @@ } if (item.state && $rootScope.settings.dashboard_control_item === item.name) { console.log('Dashboard control item state changed, attempting navigation to: ' + item.state); + ScreensaverService.stop(true); $location.url('/view/' + item.state); } } else { @@ -220,11 +245,11 @@ if (prevAudioUrl !== audioUrl) { if (context) { $http({ - url : audioUrl, - method : 'GET', - responseType : 'arraybuffer' - }).then(function(response) { - context.decodeAudioData(response.data, function(buffer) { + url: audioUrl, + method: 'GET', + responseType: 'arraybuffer' + }).then(function (response) { + context.decodeAudioData(response.data, function (buffer) { audioBuffer = buffer; var source = context.createBufferSource(); source.buffer = buffer; @@ -248,7 +273,7 @@ catch (e) { console.warn("Error while handling audio event: " + e.toString()); if (context) - context.close(); + context.close(); } } } catch (e) { @@ -325,7 +350,7 @@ url: '/rest/services/' + SERVICE_NAME + '/config', data: OH2ServiceConfiguration, headers: { 'Content-Type': 'application/json' } - }).then (function (resp) { + }).then(function (resp) { console.log('openHAB 2 service configuration saved'); deferred.resolve(); }, function (err) { @@ -340,14 +365,14 @@ function saveCurrentPanelConfig() { var deferred = $q.defer(); - var lastUpdatedTime = $rootScope.panelsRegistry[getCurrentPanelConfig()].updatedTime; + var lastUpdatedTime = $rootScope.panelsRegistry[getCurrentPanelConfig()].updatedTime; // fetch the current configuration again (to perform optimistic concurrency on the current panel config only) tryGetServiceConfiguration().then(function () { var config = $rootScope.panelsRegistry[getCurrentPanelConfig()]; if (!config) { console.warn('Warning: creating new panel config!'); - config = $rootScope.panelsRegistry[getCurrentPanelConfig()] = { }; + config = $rootScope.panelsRegistry[getCurrentPanelConfig()] = {}; } var currentUpdatedTime = config.updatedTime; if (Date.parse(currentUpdatedTime) > Date.parse(lastUpdatedTime)) { @@ -414,6 +439,7 @@ else $rootScope.customwidgets = {}; } + $rootScope.$broadcast("currentPanelConfigLoaded"); } function setCurrentPanelConfig(name) { diff --git a/web/app/services/persistence.service.js b/web/app/services/persistence.service.js index 7e95de5e..5ad0bb9c 100755 --- a/web/app/services/persistence.service.js +++ b/web/app/services/persistence.service.js @@ -19,6 +19,8 @@ $rootScope.menucolumns = localStorageService.get("menucolumns") || 1; $rootScope.settings = localStorageService.get("settings") || {}; $rootScope.customwidgets = localStorageService.get("customwidgets") || {}; + + $rootScope.$broadcast('configurationLoaded'); } function saveConfigurationToLocalStorage() { @@ -28,6 +30,8 @@ localStorageService.set("menucolumns", $rootScope.menucolumns); localStorageService.set("settings", $rootScope.settings); localStorageService.set("customwidgets", $rootScope.customwidgets); + + $rootScope.$broadcast('configurationChanged'); } //////////////// diff --git a/web/app/services/screensaver.service.js b/web/app/services/screensaver.service.js new file mode 100644 index 00000000..ea1e9cc0 --- /dev/null +++ b/web/app/services/screensaver.service.js @@ -0,0 +1,349 @@ +(function () { + 'use strict'; + + angular + .module('app.services') + .service('ScreensaverService', ScreensaverService) + .run(['ScreensaverService', function (ScreensaverService) { + ScreensaverService.init(); + }]); + + ScreensaverService.$inject = [ + 'PersistenceService', + 'OH2StorageService', + '$location', + '$interval', + '$timeout', + '$rootScope', + 'localStorageService', + '$route', + '$log', + '$document' + ]; + + function ScreensaverService( + PersistenceService, + OH2StorageService, + $location, + $interval, + $timeout, + $rootScope, + localStorageService, + $route, + $log, + $document + ) { + + var _fallbackEventsToWatch = 'keydown DOMMouseScroll mousewheel mousedown touchstart touchmove'; + var _isIdle = false; + var _isRunning = false; + var _config = null; + var _slideshowTimer = null; + var _idleTimer = null; + var _slideshowDashboards = null; + var _currentDbIndex = 0; + var log = function (m) { + $log.log("ScreensaverService: " + m); + } + + var initConfig = function () { + if (_config) + return; + + // Set default + _config = { + idleTimeoutSec: 60 * 5, + slideshowIntervalSec: 5, + isEnabled: false, + eventsToWatch: { + 'mousedown': true, + 'keydown': true, + 'mousewheel': true, + 'touchstart': true, + 'touchmove': true + }, + additionalEventsToWatch: [], + onStart: { + type: 'slideshow', + dashboardsExcluded: [], + dashboards: (function () { + _slideshowDashboards = PersistenceService.getDashboards(); + var dbs = []; + var order = 0; + angular.forEach(_slideshowDashboards, function (db) { + dbs.push({ + id: db.id, + order: ++order + }); + }); + return dbs; + })(), + dashboard: null + }, + onStop: { + type: 'stop', + dashboard: null + } + }; + } + + var getEventsToWatch = function () { + var e1 = []; + for (var k in _config.eventsToWatch) { + if (_config.eventsToWatch[k]) + e1.push(k); + } + var e2 = _config.additionalEventsToWatch || []; + // Use _defaultEventsToWatch if empty. Otherwise screensaver will never stop! + var e3 = e1.concat(e2).join(' ').trim() || _fallbackEventsToWatch; + return e3; + } + + var enable = function () { + _config.isEnabled = true; + saveSettings(); + } + + var disable = function () { + _config.isEnabled = false; + saveSettings(); + } + + var toggle = function (isEnabled) { + if (isEnabled) + enable(); + else + disable(); + } + + var isRunning = function () { + return _isRunning; + } + + var onIdle = function () { + _isIdle = true; + start(); + } + + var onAwake = function () { + _isIdle = false; + stop(); + } + + var watchEvents = function () { + $document.on(getEventsToWatch(), onAwake); + } + + var unWatchEvents = function () { + $document.off(getEventsToWatch(), onAwake); + } + + var dashboardExists = function (dbId) { + return $rootScope.dashboards.findIndex(function (db) { return db.id == dbId }) != -1; + } + + var removeDashboard = function (dbId, whichDb, isSave) { + whichDb = whichDb || _config.onStart.dashboards; + var idx = whichDb.findIndex(function (db) { return db.id == dbId }); + if (idx != -1) { + whichDb.splice(idx, 1); + } + + if (typeof (isSave) === 'undefined') + isSave = true; + + if (isSave) + saveSettings(); + } + + var nextDashboard = function () { + _slideshowDashboards = (_config.onStart.dashboards || []).sort( + function (a, b) { return a.order - b.order; } + ); + + // No dashboards found + if (_slideshowDashboards.length <= 0) { + log("Stopping slideshow. No dashboard found."); + stop(); + return; + } + + // Only 1 dashboard found + if (_slideshowDashboards.length == 1) { + // Change configuration to gotodashboard + _config.onStop.type === 'gotodashboard'; + saveSettings(); + $interval.cancel(_slideshowTimer); + _slideshowTimer = null; + log("Stopping slideshow. No dashboard found."); + $location.url("/view/ " + _config.onStart.dashboard); + return; + } + + var nextDbId = _slideshowDashboards[_currentDbIndex].id; + if (!dashboardExists(nextDbId)) { + removeDashboard(nextDbId); + nextDashboard(); + return; + } + _currentDbIndex = ++_currentDbIndex < _slideshowDashboards.length ? _currentDbIndex : 0; + $location.url("/view/" + nextDbId); + } + + var slideshow = function () { + log("Screensaver (" + _config.onStart.type + ") started in dashboard " + $route.current.params.i); + _currentDbIndex = 0; + nextDashboard(); + _slideshowTimer = $interval(nextDashboard, (_config.slideshowIntervalSec || 10) * 1000); + } + + var start = function () { + if (_isRunning) + return; + + _isRunning = true; + watchEvents(); + + if (_config.onStart.type === 'slideshow') { + slideshow(); + } else { + $location.url("/view/" + _config.onStart.dashboard) + } + }; + + var stop = function (isFromOHService) { + if (!_isRunning) + return; + + unWatchEvents(); + $interval.cancel(_slideshowTimer); + _slideshowTimer = null; + _isRunning = false; + log("Screensaver stopped."); + + if (_config.isEnabled) { + idleTimerStart(); + } + + if (isFromOHService) + return; + + if (_config.onStop.type === 'gotodashboard') { + $location.url("/view/" + _config.onStop.dashboard); + } + }; + + var idleTimerStart = function () { + _idleTimer = $timeout(onIdle, _config.idleTimeoutSec * 1000); + } + + var idleTimerStop = function () { + $timeout.cancel(_idleTimer); + _idleTimer = null; + } + + var init = function () { + $timeout(function () { + initConfig(); + if (!_config || !_config.idleTimeoutSec || !_config.isEnabled) + return; + idleTimerStart(); + }); + }; + + var saveSettings = function (config) { + config = config || _config; + // Uniqify our arrays + function onlyUnique(value, index, self) { return self.indexOf(value) === index; } + config.onStart.dashboards = config.onStart.dashboards.filter(onlyUnique); + config.onStart.dashboardsExcluded = config.onStart.dashboardsExcluded.filter(onlyUnique); + $rootScope.settings.screensaver = _config; + OH2StorageService.saveCurrentPanelConfig().then(function () { + _config = config; + init(); + }); + return true; + } + + Object.defineProperty(this, "isEnabled", { + get: function () { return _config.isEnabled; }, + set: function (v) { + _config.isEnabled = v; + saveSettings(_config); + } + }) + + Object.defineProperty(this, "config", { + get: function () { return _config; } + }) + + var reConfig = function () { + _config = $rootScope.settings.screensaver || _config; + if (!_config) { + initConfig(); + } + + var freshDashboards = PersistenceService.getDashboards(); + if (!freshDashboards) { + _config.isEnabled = false; + saveSettings(); + return; + } + + // Iterate through _config.onStart.dashboards, remove all dashboards not in $rootScope.dashboards + angular.forEach(_config.onStart.dashboards, function (ours) { + if ($rootScope.dashboards.findIndex(function (theirs) { return theirs.id == ours.id }) === -1) + removeDashboard(ours.id, _config.onStart.dashboards, false); + }); + // Iterate through _config.onStart.dashboardsExcluded, remove all dashboards not in $rootScope.dashboards + angular.forEach(_config.onStart.dashboardsExcluded, function (ours) { + if ($rootScope.dashboards.findIndex(function (theirs) { return theirs.id == ours.id }) === -1) + removeDashboard(ours.id, _config.onStart.dashboardsExcluded, false); + }); + + // Iterate through $rootScope.dashboards. + // Anything new here will be added to _config.onStart.dashboardsExcluded + var combined = _config.onStart.dashboards.concat(_config.onStart.dashboardsExcluded); + angular.forEach($rootScope.dashboards, function (theirs) { + var isFound = combined.findIndex(function (ours) { return ours.id == theirs.id; }) !== -1; + if (!isFound) + _config.onStart.dashboardsExcluded.push({ id: theirs.id }); + }); + + if (!combined.length) { + _config.isEnabled = false; + stop(); + } else { + + if (combined.length < 2) { + _config.onStart.type = 'gotodashboard'; + if (!_config.onStart.dashboard || !dashboardExists(_config.onStart.dashboard)) + _config.onStart.dashboard = combined[0] && combined[0].id; + } + + if (!_config.onStop.dashboard || !dashboardExists(_config.onStop.dashboard)) { + _config.onStop.dashboard = freshDashboards[0].id; + if (_config.onStop.type === 'gotodashboard') { + _config.onStop.type = 'stop'; + } + } + } + saveSettings(); + } + + /* Monitor Configuration Changes to modify _config */ + $rootScope.$on('configurationChanged', reConfig); + $rootScope.$on('configurationLoaded', reConfig); + $rootScope.$on("currentPanelConfigLoaded", reConfig); + + /* Exposed APIs */ + this.init = init; + this.start = start; + this.stop = stop; + this.isRunning = isRunning; + this.saveSettings = saveSettings; + this.toggle = toggle; + + return this; + } +})(); diff --git a/web/app/settings/settings.controller.js b/web/app/settings/settings.controller.js index 1dbcbd9a..3e190e4f 100755 --- a/web/app/settings/settings.controller.js +++ b/web/app/settings/settings.controller.js @@ -1,12 +1,12 @@ -(function() { -'use strict'; +(function () { + 'use strict'; angular .module('app') .controller('SettingsCtrl', SettingsController); - SettingsController.$inject = ['$rootScope', '$timeout', '$window', 'OHService', 'OH2ServiceConfiguration', 'OH2StorageService', 'PersistenceService', 'SpeechService', 'themes', 'prompt', 'TranslationService']; - function SettingsController($rootScope, $timeout, $window, OHService, OH2ServiceConfiguration, OH2StorageService, PersistenceService, SpeechService, themes, prompt, TranslationService) { + SettingsController.$inject = ['$rootScope', '$timeout', '$window', 'OHService', 'OH2ServiceConfiguration', 'OH2StorageService', 'PersistenceService', 'SpeechService', 'themes', 'prompt', 'TranslationService', 'ScreensaverService']; + function SettingsController($rootScope, $timeout, $window, OHService, OH2ServiceConfiguration, OH2StorageService, PersistenceService, SpeechService, themes, prompt, TranslationService, ScreensaverService) { var vm = this; vm.themes = themes.data; @@ -31,12 +31,12 @@ message: TranslationService.translate("settings.storage.panelconfiguration.dialog.message", "Please choose a name for the new panel configuration (letters and digits only please):"), input: true }).then(function (name) { - vm.panelsRegistry[name] = { - "dashboards" : $rootScope.dashboards, - "menucolumns" : $rootScope.menucolumns, + vm.panelsRegistry[name] = { + "dashboards": $rootScope.dashboards, + "menucolumns": $rootScope.menucolumns, "customwidgets": $rootScope.customwidgets, - "settings" : $rootScope.settings, - "updatedTime" : new Date().toISOString() + "settings": $rootScope.settings, + "updatedTime": new Date().toISOString() }; vm.storageOption = name; OH2StorageService.setCurrentPanelConfig(name); @@ -101,6 +101,16 @@ clock_format: TranslationService.translate('settings.panel.appearance.show_clock.header_format.hint', 'Default: shortTime, use AngularJS date format') }; + vm.screensaver = { + isEnabled: ScreensaverService.isEnabled, + toggle: function () { + ScreensaverService.toggle(vm.screensaver.isEnabled) + } + }; + + vm.dashboardsConfigured = function () { return $rootScope.dashboards.length > 0 }; + + activate(); //////////////// @@ -123,9 +133,9 @@ vm.voices = speechSynthesis.getVoices(); }); } - + iNoBounce.disable(); - + } } })(); \ No newline at end of file diff --git a/web/app/settings/settings.html b/web/app/settings/settings.html index bd57660c..e39119e1 100755 --- a/web/app/settings/settings.html +++ b/web/app/settings/settings.html @@ -78,6 +78,7 @@

    Appearan
     
    +       @@ -96,6 +97,24 @@

    Custo Manage > +
    +
    +

    ScreenSaver

    +

    {{vm.isScreensaverEnable}}

    + + +
    + You need at least 1 dashboard to enable screensaver. +
    + +


    diff --git a/web/app/settings/settings.screensaver.controller.js b/web/app/settings/settings.screensaver.controller.js new file mode 100644 index 00000000..450ba3c2 --- /dev/null +++ b/web/app/settings/settings.screensaver.controller.js @@ -0,0 +1,149 @@ +(function () { + 'use strict'; + + angular + .module('app') + .controller('ScreensaverSettingsCtrl', ScreensaverSettingsCtrl); + + ScreensaverSettingsCtrl.$inject = [ + '$rootScope', + '$scope', + 'PersistenceService', + 'TranslationService', + 'ScreensaverService', + 'dashboards', + '$location', + 'prompt', + '$route', + '$timeout' + ]; + + function ScreensaverSettingsCtrl( + $rootScope, + $scope, + PersistenceService, + TranslationService, + ScreensaverService, + dashboards, + $location, + prompt, + $route, + $timeout + ) { + + $scope._form = { mainForm: {} }; + $scope.dashboards = angular.copy(dashboards); + $scope.config = angular.copy(ScreensaverService.config); + $scope.errorMessages = []; + $scope.infoMessages = []; + $scope.translations = { + reorder: TranslationService.translate("screensaver.settings.common.reorder", "Reorder"), + updateSuccess: TranslationService.translate("screensaver.settings.update.success", "Screensaver settings updated."), + updateFail: TranslationService.translate("screensaver.settings.update.fail", "Screensaver settings update failed."), + atleast2Db: TranslationService.translate("screensaver.settings.error.atleast2dashboard", "You need at least 2 configured dashboards in the rotation settings to enable slideshow."), + cancelconfirmTitle: TranslationService.translate("screensaver.settings.cancelconfirm.title", "Cancel Changes?"), + cancelconfirmMsg: TranslationService.translate("screensaver.settings.cancelconfirm.message", "You have unsaved changes. Clicking OK will revert to previous settings."), + headingGeneral: TranslationService.translate("screensaver.settings.heading.general", "General"), + headingonstart: TranslationService.translate("screensaver.settings.heading.onstart", "On Start"), + headingonstop: TranslationService.translate("screensaver.settings.heading.onstop", "On Stop"), + headingadvanced: TranslationService.translate("screensaver.settings.heading.advanced", "Advanced"), + showadvanced: TranslationService.translate("screensaver.settings.heading.showadvanced", "Show advanced settings"), + errorAtLeast1Sec: TranslationService.translate("screensaver.settings.error.errorAtLeast1Sec", "Interval must be at least 1 second."), + idleTimeouterror: TranslationService.translate("screensaver.settings.error.errorAtLeast10Secs", "Timeout must be at least 10 seconds."), + } + + var errorMap = { + atleast2Db: $scope.translations.atleast2Db, + dashboardTimeout: $scope.translations.errorAtLeast1Sec, + idleTimeout: $scope.translations.idleTimeouterror, + } + + var addErrorMessage = function (m) { $scope.errorMessages.indexOf(m) === -1 && $scope.errorMessages.push(m); } + var addInfoMessage = function (m) { $scope.infoMessages.indexOf(m) === -1 && $scope.infoMessages.push(m); } + $scope.clearErrorMessage = function (idx) { $scope.errorMessages.splice(idx, 1); } + $scope.clearInfoMessage = function (idx) { $scope.infoMessages.splice(idx, 1); } + + var reorderModel = function (model) { + var i = 0; + angular.forEach(model, function (d) { + d.order = i++; + }); + } + + var checkErrors = function () { + $scope.config.onStart.type == 'slideshow' + && $scope._form.mainForm.dashboards.$setValidity('atleast2Db', $scope.config.onStart.dashboards.length > 1); + + angular.forEach($scope._form.mainForm.$error, function (v, k) { + var isAdded = errorMap[k] && (addErrorMessage(errorMap[k]) || true); + if (!isAdded) { + angular.forEach(v, function (err) { + err.$name + && errorMap[err.$name] + && addErrorMessage(errorMap[err.$name]); + }); + } + }); + } + + $scope.save = function () { + checkErrors(); + if ($scope._form.mainForm.$invalid) + return; + + if (ScreensaverService.saveSettings($scope.config)) { + addInfoMessage($scope.translations.updateSuccess); + $scope._form.mainForm.$setPristine(); + } + else { + addErrorMessage($scope.translations.updateFail); + } + + } + + $scope.cancel = function () { + if (!$scope._form.mainForm.$pristine) { + prompt({ + title: $scope.translations.cancelconfirmTitle, + message: $scope.translations.cancelconfirmMsg + }).then(function () { + $route.reload(); + }); + return; + } + + $location.url('/settings'); + } + + $scope.validate = function () { + $timeout(function () { + $scope.errorMessages = []; + $scope.infoMessages = []; + checkErrors(); + if ($scope._form.mainForm.$dirty) { + $scope.clearInfoMessage($scope.infoMessages.indexOf($scope.translations.updateSuccess)); + } + }); + } + + var onMovedOrChanged = function (model) { + $scope._form.mainForm.$setDirty(); + $scope.validate(); + reorderModel(model); + }; + + $scope.sortableOptions = { + allowDuplicates: false, + itemMoved: function (event) { + onMovedOrChanged(event.dest.sortableScope.modelValue); + }, + orderChanged: function (event) { + onMovedOrChanged(event.dest.sortableScope.modelValue); + } + } + + $timeout($scope.validate); + + return ScreensaverSettingsCtrl; + } +})(); diff --git a/web/app/settings/settings.screensaver.html b/web/app/settings/settings.screensaver.html new file mode 100644 index 00000000..19ef8326 --- /dev/null +++ b/web/app/settings/settings.screensaver.html @@ -0,0 +1,192 @@ +
    +
    + + + +

    Screensaver

    +
    + +
    {{infoMessage}}
    +
    {{errorMessage}}
    + +
    +
    +
    You need at least 1 dashboard to enable screensaver.
    + +
    +
    +
    +

    +
      +
    • + +
      + + + Seconds of being idle until screensaver kicks in + +
      +
    • + +
    +
    +
    +

    +
      +
    • + +
      + + + + + What to do when screensaver starts + + + +
        +
      • Dashboard Slideshow - rotates between dashboards.
      • +
      • Go to dashboard - activates the selected dashboard.
      • +
      +
      +
      +
    • +
      +
    • + +
      + + + Duration to switch to the next dashboard + +
      +
    • +
    • + +
      +
      +
      + {{db.id}} + +
      +
      +
      +
    • +
    • + +
      +
      +
      + {{db.id}} + +
      +
      +
      +
    • +
      +
      +
    • + + +
    • +
      +
    +
    +
    +

    +
      +
    • + +
      + + + + + What to do when screensaver starts + + + +
        +
      • Stop - simply stops screensaver wherever it may be.
      • +
      • Go to dashboard - activates the selected dashboard.
      • +
      +
      +
      +
    • +
      +
    • + + +
    • +
      +
    +
    +
    + +
      +
    • + +
      + + Events to watch to determine idleness. + + +
      +
    • + +
    • + +
      + + + Additional events to watch to determine idleness, separated by a comma (,). +
      + Example: keypress,keyup +
      +
      +
      +
    • +
    +
    + +
    + + +
    +
    +
    +
    \ No newline at end of file diff --git a/web/assets/i18n/admin/admin.pot b/web/assets/i18n/admin/admin.pot index b3fb60a4..a7886110 100755 --- a/web/assets/i18n/admin/admin.pot +++ b/web/assets/i18n/admin/admin.pot @@ -365,6 +365,21 @@ msgctxt "settings.panel.customwidgets.manage" msgid "Manage" msgstr "" +#. Screensaver settings +msgctxt "settings.panel.screensaver" +msgid "ScreenSaver" +msgstr "" + +#. Screensaver settings enable +msgctxt "settings.panel.screensaver.enable" +msgid "Enable" +msgstr "" + +#. Screensaver Settings Button +msgctxt "settings.panel.screensaver.settings" +msgid "Settings" +msgstr "" + #. Voice support (section header) - formerly (<=2.2.0) : "Voice feedback" msgctxt "settings.panel.voicesupport.header" msgid "Voice Support" @@ -939,3 +954,204 @@ msgctxt "widgetgallery.widgetsdetected.dialog.message" msgid "Warning: please confirm you wish to update existing widgets, overwriting any eventual changes made locally! If unsure, cancel and click Show details to review the list of affected widgets." msgstr "" +# DASHBOARD SCREENSAVER SETTINGS + +#. Screensaver Settings Main Header +msgctxt "screensaver.settings.header" +msgid "Screensaver" +msgstr "" + +#. Screensaver Settings Additionalevents Example +msgctxt "screensaver.settings.additionalevents.example" +msgid "Example: keypress,keyup" +msgstr "" + +#. Screensaver Settings Additionalevents Info +msgctxt "screensaver.settings.additionalevents.info" +msgid "Additional events to watch to determine idleness, separated by a comma (,)." +msgstr "" + +#. Screensaver Settings Additionalevents Label +msgctxt "screensaver.settings.additionalevents.label" +msgid "Additional Events (optional): " +msgstr "" + +#. Screensaver Settings Common Reorder +msgctxt "screensaver.settings.common.reorder" +msgid "Reorder" +msgstr "" + +#. Screensaver Settings Common Dashboard +msgctxt "screensaver.settings.common.dashboard" +msgid "Dashboard: " +msgstr "" + +#. Screensaver Settings Common Gotodashboard +msgctxt "screensaver.settings.common.gotodashboard" +msgid "Go to dashboard" +msgstr "" + +#. Screensaver Settings Common Perform +msgctxt "screensaver.settings.common.perform" +msgid "Perform: " +msgstr "" + +#. Screensaver Settings Common Stop +msgctxt "screensaver.settings.common.stop" +msgid "Stop" +msgstr "" + +#. Screensaver Settings Eventstowatch Info +msgctxt "screensaver.settings.eventstowatch.info" +msgid "Events to watch to determine idleness." +msgstr "" + +#. Screensaver Settings Eventstowatch Label +msgctxt "screensaver.settings.eventstowatch.label" +msgid "Events to Watch: " +msgstr "" + +#. Screensaver Settings Idletimeout Info +msgctxt "screensaver.settings.idletimeout.info" +msgid "Seconds of being idle until screensaver kicks in" +msgstr "" + +#. Screensaver Settings Idletimeout Label +msgctxt "screensaver.settings.idletimeout.label" +msgid "Idle Timeout: " +msgstr "" + +#. Screensaver Settings Onstarttype Info +msgctxt "screensaver.settings.onstarttype.info" +msgid "What to do when screensaver starts" +msgstr "" + +#. Screensaver Settings On Start Type Help Line 1 +msgctxt "screensaver.settings.onstarttype.help.line1" +msgid "Dashboard Slideshow - rotates between dashboards." +msgstr "" + +#. Screensaver Settings On Start Type Help Line 2 +msgctxt "screensaver.settings.onstarttype.help.line2" +msgid "Go to dashboard - activates the selected dashboard." +msgstr "" + +#. Screensaver Settings On Stop Type Help Line 1 +msgctxt "screensaver.settings.onstoptype.help.line1" +msgid "Stop - simply stops screensaver wherever it may be" +msgstr "" + +#. Screensaver Settings On Stop Type Help Line 2 +msgctxt "screensaver.settings.onstoptype.help.line2" +msgid "Go to dashboard - activates the selected dashboard." +msgstr "" + +#. Screensaver Settings Onstarttype Options Slideshow +msgctxt "screensaver.settings.onstarttype.options.slideshow" +msgid "Dashboard Slideshow" +msgstr "" + +#. Screensaver Settings Onstop Info +msgctxt "screensaver.settings.onstop.info" +msgid "What to do when screensaver stops" +msgstr "" + +#. Screensaver Settings Slideshow Dashboards Label +msgctxt "screensaver.settings.slideshow.dashboards.label" +msgid "Dashboards to rotate:" +msgstr "" + +#. Screensaver Settings Slideshow Excluded Dashboards Label +msgctxt "screensaver.settings.slideshow.dashboardsExcluded.label" +msgid "Excluded Dashboards: " +msgstr "" + +#. Screensaver Settings Slideshow Dashboardtimeout Info +msgctxt "screensaver.settings.slideshow.dashboardtimeout.info" +msgid "Duration to switch to the next dashboard" +msgstr "" + +#. Screensaver Settings Slideshow Dashboardtimeout Label +msgctxt "screensaver.settings.slideshow.dashboardtimeout.label" +msgid "Slideshow Interval: " +msgstr "" + +#. Screensaver Settings Error No Dashboard +msgctxt "screensaver.settings.error.missingdashboard" +msgid "You need at least 1 dashboard to enable screensaver." +msgstr "" + +#. Screensaver Settings Error Number of Dashboard +msgctxt "screensaver.settings.error.atleast2dashboard" +msgid "You need at least 2 configured dashboards in the rotation settings to enable slideshow." +msgstr "" + +#. Screensaver Settings Cancel Dialog Title +msgctxt "screensaver.settings.dialog.cancelconfirm.title" +msgid "Cancel Changes?" +msgstr "" + +#. Screensaver Settings Cancel Dialog MEssage +msgctxt "screensaver.settings.dialog.cancelconfirm.message" +msgid "You have unsaved changes. Clicking OK will revert to previous settings." +msgstr "" + +#. Screensaver Settings Save Button Text +msgctxt "screensaver.settings.button.save" +msgid "Save" +msgstr "" + +#. Screensaver Settings Cancel Button Text +msgctxt "screensaver.settings.button.cancel" +msgid "Cancel" +msgstr "" + +#. Screensaver Settings Back Button Text +msgctxt "screensaver.settings.button.back" +msgid "Back" +msgstr "" + +#. Screensaver Settings Update Success +msgctxt "screensaver.settings.update.success" +msgid "Screensaver settings updated." +msgstr "" + +#. Screensaver Settings Update Fail +msgctxt "screensaver.settings.update.fail" +msgid "Screensaver settings update failed." +msgstr "" + +#. Screensaver Settings Heading General +msgctxt "screensaver.settings.heading.general" +msgid "General" +msgstr "" + +#. Screensaver Settings Heading On Start +msgctxt "screensaver.settings.heading.onstart" +msgid "On Start" +msgstr "" + +#. Screensaver Settings Heading On Stop +msgctxt "screensaver.settings.heading.onstop" +msgid "On Stop" +msgstr "" + +#. Screensaver Settings Heading Advanced +msgctxt "screensaver.settings.heading.advanced" +msgid "Advanced" +msgstr "" + +#. Screensaver Settings Advanced Settings Toggle +msgctxt "screensaver.settings.heading.showadvanced" +msgid "Show advanced settings" +msgstr "" + +#. Screensaver Settings Error At Least 1 Second +msgctxt "screensaver.settings.error.errorAtLeast1Sec" +msgid "Interval must be at least 1 second." +msgstr "" + +#. Screensaver Settings Error At Least 10 Seconds +msgctxt "screensaver.settings.error.errorAtLeast10Secs" +msgid "Interval must be at least 1 second." +msgstr "" diff --git a/web/assets/i18n/main/main.pot b/web/assets/i18n/main/main.pot index 73b5f4ee..954d0964 100755 --- a/web/assets/i18n/main/main.pot +++ b/web/assets/i18n/main/main.pot @@ -204,6 +204,11 @@ msgctxt "dashboard.toolbar.fullscreen" msgid "Fullscreen" msgstr "" +#. Dashboard toolbar screensaver button tooltip +msgctxt "dashboard.toolbar.screensaver" +msgid "Screensaver" +msgstr "" + #. Displayed at the bottom after clicking on the Speak button msgctxt "dashboard.speaknow" msgid "Speak now..." diff --git a/web/assets/styles/common.scss b/web/assets/styles/common.scss index c4e67495..b8d91d51 100755 --- a/web/assets/styles/common.scss +++ b/web/assets/styles/common.scss @@ -47,7 +47,7 @@ h1 { font-size: $font-size-base; text-align: center; margin-left: 80px; - margin-right: 80px; + margin-right: 80px; //line-height: 1.5; //padding-top: 6px; position: absolute; diff --git a/web/assets/styles/screensaver.scss b/web/assets/styles/screensaver.scss new file mode 100644 index 00000000..3c2a2d46 --- /dev/null +++ b/web/assets/styles/screensaver.scss @@ -0,0 +1,135 @@ +.ss.as-sortable-handle { + display: block; + cursor: move; + padding: .625em; + border: solid 1px #ddd; + background: #fff; + width: calc(100% - 1em); + margin: .5em; + .glyphicon { + opacity: .25 + } +} + +.as-sortable-placeholder { + @extend .ss.as-sortable-handle; + opacity: .6; +} + +.screensaver-settings { + font-size: 16px; + color: #000; + input:not([type='checkbox']), + option, + select { + color: #000; + padding: .25em; + min-width: 20rem; + } + .scrollable { + &.box { + padding: 1em; + .tab-content { + padding: 1em; + } + } + } + .d-block { + display: block; + } + .f-normal { + font-weight: normal; + } + .settings-outer, + .settings-inner { + list-style-type: none; + padding: 0; + } + .settings-outer { + max-width: 50em; + } + .settings-outer li, + .settings-inner { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + top: .25em; + position: relative; + } + .settings-inner { + padding: 0 .5em; + justify-content: space-between; + } + .settings-outer li:not(:last-child) { + margin-bottom: 1.25em; + } + .settings-outer li>label, + .settings-outer li p { + flex: 1 0 50%; + max-width: 8.75em; + text-align: left; + margin-right: 1em; + } + .settings-outer li>label, + .settings-inner { + flex: 1 0 13.75em; + } + .settings-inner li { + width: 6.25em; + p { + margin: 0; + } + } + div.cancelsave { + margin-top: 1.25em; + } + .helpinfo { + cursor: pointer; + ul { + list-style: circle; + li { + display: list-item; + margin-bottom: auto !important; + } + } + .glyphicon-question-sign { + color: #5bc0de !important; + position: relative; + top: .125em; + } + } + div { + .as-sortable { + color: #000; + min-height: 3.75em; + width: 20em; + &.positive { + background: rgb(177, 218, 177); + } + &.negative { + background: rgb(255, 173, 173); + } + .as-sortable-item-handle { + margin: 0; + padding: 0; + } + .as-sortable-handle .glyphicon { + top: .25em; + opacity: .25 + } + .as-sortable-drag { + opacity: .8 !important; + } + } + } + .box { + margin-top: .625em; + margin-bottom: .625em; + } + label { + font-weight: normal; + } + h4.inline { + display: inline; + } +} \ No newline at end of file diff --git a/web/bower.json b/web/bower.json index 71e97b64..23533c52 100755 --- a/web/bower.json +++ b/web/bower.json @@ -57,7 +57,8 @@ "aCKolor": "https://github.com/ghys/aCKolor.git#3.0.2-habpanel", "angular-translate": "^2.17.0", "angular-translate-loader-static-files": "^2.17.0", - "angular-translate-loader-partial": "^2.17.0" + "angular-translate-loader-partial": "^2.17.0", + "ng-sortable": "^1.3.8" }, "resolutions": { "angular": "~1.5.9" diff --git a/web/gulpfile.js b/web/gulpfile.js index 38938db3..fb5fa5b0 100755 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -192,7 +192,8 @@ gulp.task('vendor-js', ['uglify-timeline'], function() { 'bower_components/d3-timeline/dist/d3-timeline.js', 'bower_components/aCKolor/dist/js/aCKolor.min.js', 'node_modules/n3-charts/build/LineChart.min.js', - 'vendor/angular-web-colorpicker.js' + 'vendor/angular-web-colorpicker.js', + 'bower_components/ng-sortable/dist/ng-sortable.min.js' ]).pipe(concat('vendor.js')).pipe(gulp.dest('vendor')); }); diff --git a/web/index.html b/web/index.html index d4c3f118..360699e9 100755 --- a/web/index.html +++ b/web/index.html @@ -83,6 +83,7 @@ + @@ -97,6 +98,7 @@ + diff --git a/web/package.json b/web/package.json index cf42299b..37729c5c 100755 --- a/web/package.json +++ b/web/package.json @@ -12,6 +12,11 @@ { "name": "Kuba Wolanin", "email": "hi@kubawolanin.com" + }, + { + "name": "Lucky Mallari", + "email": "luckymallari@gmail.com", + "url": "https://github.com/luckymallari" } ], "repository": { diff --git a/web/vendor/styles.min.css b/web/vendor/styles.min.css index f94c0766..434552e7 100644 --- a/web/vendor/styles.min.css +++ b/web/vendor/styles.min.css @@ -6,7 +6,7 @@ * http://github.com/angular-ui/ui-select * Version: 0.19.7 - 2017-04-15T14:28:36.790Z * License: MIT - */.ui-select-highlight{font-weight:700}.ui-select-offscreen{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.ui-select-choices-row:hover{background-color:#f5f5f5}.ng-dirty.ng-invalid>a.select2-choice{border-color:#d44950}.select2-result-single{padding-left:0}.select2-locked>.select2-search-choice-close{display:none}.select-locked>.ui-select-match-close{display:none}body>.select2-container.open{z-index:9999}.ui-select-container.select2.direction-up .ui-select-match,.ui-select-container[theme=select2].direction-up .ui-select-match{border-radius:4px;border-top-left-radius:0;border-top-right-radius:0}.ui-select-container.select2.direction-up .ui-select-dropdown,.ui-select-container[theme=select2].direction-up .ui-select-dropdown{border-radius:4px;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-width:1px;border-top-style:solid;box-shadow:0 -4px 8px rgba(0,0,0,.25);margin-top:-4px}.ui-select-container.select2.direction-up .ui-select-dropdown .select2-search,.ui-select-container[theme=select2].direction-up .ui-select-dropdown .select2-search{margin-top:4px}.ui-select-container.select2.direction-up.select2-dropdown-open .ui-select-match,.ui-select-container[theme=select2].direction-up.select2-dropdown-open .ui-select-match{border-bottom-color:#5897fb}.ui-select-container[theme=select2] .ui-select-dropdown .ui-select-search-hidden,.ui-select-container[theme=select2] .ui-select-dropdown .ui-select-search-hidden input{opacity:0;height:0;min-height:0;padding:0;margin:0;border:0}.selectize-input.selectize-focus{border-color:#007fbb!important}.selectize-control.single>.selectize-input>input{width:100%}.selectize-control.multi>.selectize-input>input{margin:0!important}.selectize-control>.selectize-dropdown{width:100%}.ng-dirty.ng-invalid>div.selectize-input{border-color:#d44950}.ui-select-container[theme=selectize].direction-up .ui-select-dropdown{box-shadow:0 -4px 8px rgba(0,0,0,.25);margin-top:-2px}.ui-select-container[theme=selectize] input.ui-select-search-hidden{opacity:0;height:0;min-height:0;padding:0;margin:0;border:0;width:0}.btn-default-focus{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.ui-select-bootstrap .ui-select-toggle{position:relative}.ui-select-bootstrap .ui-select-toggle>.caret{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.input-group>.ui-select-bootstrap.dropdown{position:static}.input-group>.ui-select-bootstrap>input.ui-select-search.form-control{border-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.ui-select-bootstrap>input.ui-select-search.form-control.direction-up{border-radius:4px!important;border-top-right-radius:0!important;border-bottom-right-radius:0!important}.ui-select-bootstrap .ui-select-search-hidden{opacity:0;height:0;min-height:0;padding:0;margin:0;border:0}.ui-select-bootstrap>.ui-select-match>.btn{text-align:left!important}.ui-select-bootstrap>.ui-select-match>.caret{position:absolute;top:45%;right:15px}.ui-select-bootstrap>.ui-select-choices,.ui-select-bootstrap>.ui-select-no-choice{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:-1px}body>.ui-select-bootstrap.open{z-index:1000}.ui-select-multiple.ui-select-bootstrap{height:auto;padding:3px 3px 0 3px}.ui-select-multiple.ui-select-bootstrap input.ui-select-search{background-color:transparent!important;border:none;outline:0;height:1.666666em;margin-bottom:3px}.ui-select-multiple.ui-select-bootstrap .ui-select-match .close{font-size:1.6em;line-height:.75}.ui-select-multiple.ui-select-bootstrap .ui-select-match-item{outline:0;margin:0 3px 3px 0}.ui-select-multiple .ui-select-match-item{position:relative}.ui-select-multiple .ui-select-match-item.dropping .ui-select-match-close{pointer-events:none}.ui-select-multiple:hover .ui-select-match-item.dropping-before:before{content:"";position:absolute;top:0;right:100%;height:100%;margin-right:2px;border-left:1px solid #428bca}.ui-select-multiple:hover .ui-select-match-item.dropping-after:after{content:"";position:absolute;top:0;left:100%;height:100%;margin-left:2px;border-right:1px solid #428bca}.ui-select-bootstrap .ui-select-choices-row>span{cursor:pointer;display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-bootstrap .ui-select-choices-row>span:focus,.ui-select-bootstrap .ui-select-choices-row>span:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.ui-select-bootstrap .ui-select-choices-row.active>span{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.ui-select-bootstrap .ui-select-choices-row.active.disabled>span,.ui-select-bootstrap .ui-select-choices-row.disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.ui-select-match.ng-hide-add,.ui-select-search.ng-hide-add{display:none!important}.ui-select-bootstrap.ng-dirty.ng-invalid>button.btn.ui-select-match{border-color:#d44950}.ui-select-container[theme=bootstrap].direction-up .ui-select-dropdown{box-shadow:0 -4px 8px rgba(0,0,0,.25)}.ui-select-bootstrap .ui-select-match-text{width:100%;padding-right:1em}.ui-select-bootstrap .ui-select-match-text span{display:inline-block;width:100%;overflow:hidden}.ui-select-bootstrap .ui-select-toggle>a.btn{position:absolute;height:10px;right:10px;margin-top:-2px}.ui-select-refreshing.glyphicon{position:absolute;right:0;padding:8px 27px}@-webkit-keyframes ui-select-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes ui-select-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.ui-select-spin{-webkit-animation:ui-select-spin 2s infinite linear;animation:ui-select-spin 2s infinite linear}.ui-select-refreshing.ng-animate{-webkit-animation:none 0s}body,html{margin:0;padding:0;width:100%;height:100%;overflow:hidden}.snap-content,.snap-drawers,.x-snap-content,.x-snap-drawers,[data-snap-content],[data-snap-drawers],[snap-content],[snap-drawers],[snap\:content],[snap\:drawers],[x-snap-content],[x-snap-drawers],snap-content,snap-drawers{position:absolute;height:auto;top:0;bottom:0;width:auto;left:0;right:0}.snap-drawer,.x-snap-drawer,[data-snap-drawer],[snap-drawer],[snap\:drawer],[x-snap-drawer],snap-drawer{position:absolute;height:auto;top:0;bottom:0;overflow:auto;-webkit-transition:top .2s linear;-moz-transition:top .2s linear;-o-transition:top .2s linear;transition:top .2s linear;-webkit-transition:bottom .2s linear;-moz-transition:bottom .2s linear;-o-transition:bottom .2s linear;transition:bottom .2s linear;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;overflow-scrolling:touch;width:265px}.snap-content{z-index:2;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);overflow:auto;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;overflow-scrolling:touch}.snap-drawer-left{left:0;z-index:1}.snap-drawer-right{right:0;z-index:1}.snapjs-left .snap-drawer-right,.snapjs-right .snap-drawer-left{display:none}.snapjs-expand-left .snap-drawer-left,.snapjs-expand-right .snap-drawer-right{width:100%}a-ckolor-wheel{display:block;position:absolute;z-index:9999;filter:none!important}.c-ckolor__input-row{margin:14px 0}.c-ckolor__input-row.center{text-align:center}.c-ckolor__input-wrapper{width:200px;height:60px;line-height:60px;padding:7px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.14),0 3px 10px rgba(0,0,0,.035);border-radius:2px;margin:7px 0;font-size:14px;color:#555;font-family:sans-serif;text-transform:uppercase;cursor:pointer}.c-ckolor__input-wrapper button{outline:0!important;background:0 0;border:none;-webkit-appearance:none;width:50px;font-size:40px;padding:5px;color:#fff;opacity:.7;box-shadow:none;margin:-4px 0 0 0;cursor:pointer;transition:all .2s}.c-ckolor__input-wrapper button:hover{transform:scale(1.05);opacity:1}.c-ckolor__input-wrapper span{display:inline-block;vertical-align:middle}.c-ckolor__modal{overflow:hidden;position:fixed}.c-ckolor__overlay{width:100%;height:100%;position:fixed;left:0;top:0;background:radial-gradient(ellipse at 50% 250px,rgba(19,49,63,.91) 0,rgba(0,0,0,.91) 100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:9999}.c-ckolor__overlay input[type=number],.c-ckolor__overlay input[type=text]{color:#aaa;font-size:12px;text-align:center;font-style:normal;text-transform:uppercase;display:inline-block;height:19px;background:rgba(255,255,255,.07);border:none;box-shadow:none;box-sizing:border-box;padding:0 3px;margin:0;width:100%;border-radius:2px;-webkit-appearance:none;outline:0!important;transition:all .2s}.c-ckolor__overlay input[type=number]:focus,.c-ckolor__overlay input[type=number]:hover,.c-ckolor__overlay input[type=text]:focus,.c-ckolor__overlay input[type=text]:hover{background:rgba(255,255,255,.14)}.c-ckolor__overlay input[type=number][type=number],.c-ckolor__overlay input[type=text][type=number]{-moz-appearance:textfield}.c-ckolor__overlay input[type=number][type=number]::-webkit-inner-spin-button,.c-ckolor__overlay input[type=number][type=number]::-webkit-outer-spin-button,.c-ckolor__overlay input[type=text][type=number]::-webkit-inner-spin-button,.c-ckolor__overlay input[type=text][type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.c-ckolor__overlay .c-ckolor__swatch{margin:0 0 0 1px;width:0;height:0;display:inline-block;vertical-align:middle;padding:18px;position:relative}.c-ckolor__overlay .c-ckolor__swatch span{display:block;width:100%;height:100%;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07),0 1px 0 1px rgba(0,0,0,.07);border-radius:50%;position:absolute;top:0;left:0}.c-ckolor__overlay .c-ckolor__input-wrapper{width:30%;overflow:hidden;background:0 0;box-shadow:none;color:#aaa;display:inline-block;padding:0;margin:0 1px;line-height:14px}.c-ckolor__overlay .c-ckolor__input-wrapper.smaller{width:30px}.c-ckolor__overlay .c-ckolor__input-wrapper.button{width:calc(50% - 22px);vertical-align:middle;text-align:center;margin:0 0 0 2px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown{width:20%;overflow:visible;position:relative;vertical-align:middle;text-align:center;font-size:12px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown div{margin-left:3px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown div:before{content:"\f0dd";display:inline-block;font:normal normal normal 14px/1 FontAwesome;margin:0 3px 0 0;position:relative;top:-3px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown ul{margin:0;padding:0;display:block;position:absolute;height:auto;overflow:hidden;max-height:0;background:rgba(255,255,255,.77);width:100%;color:#333;border-radius:2px;transition:all .2s}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown ul li{display:block;padding:5px 7px;box-shadow:0 1px 0 rgba(0,0,0,.05)}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown ul li:hover{background:#fff}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown:hover ul{max-height:140px}.c-ckolor__overlay .c-ckolor__input-wrapper.hex{width:100%}.c-ckolor__overlay .c-ckolor__input-wrapper.hex input{text-align:left}.c-ckolor_previous-color-container{margin:28px auto 14px;box-sizing:border-box;padding:28px 7px 0;box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 -1px 0 rgba(0,0,0,.2);text-align:center}.c-ckolor_previous-swatch{height:0;display:inline-block;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 0 0 1px rgba(0,0,0,.12);padding:3%;margin:1.7%;border-radius:50%;transition:transform .2s}.c-ckolor_previous-swatch:hover{transform:scale(1.1)}.c-ckolor__overlay-blur>*{filter:blur(3px);transition:filter .2s}.c-ckolor__overlay-inner-outer{position:relative;overflow:auto;width:100%;height:100%}.c-ckolor__overlay-inner{width:280px;position:relative;margin:35px auto 20px}.c-ckolor__overlay-inputs{width:40%;display:inline-block;vertical-align:middle;position:relative;top:2px}.c-ckolor__alpha-wrapper{background:linear-gradient(0deg,rgba(138,138,138,.14) 0,rgba(138,138,138,.14) 1px,transparent 1px,transparent 5px),linear-gradient(90deg,rgba(138,138,138,.14) 0,rgba(138,138,138,.14) 1px,transparent 1px,transparent 5px);background-repeat:repeat;background-size:5px 5px;background-position:7px 6px;border-radius:50px}.c-ckolor__alpha,.c-ckolor__saturation{position:relative;width:100%;height:21px;border-radius:50px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07),0 1px 0 1px rgba(0,0,0,.07)}.c-ckolor__alpha:hover .c-ckolor__alpha-handle,.c-ckolor__saturation:hover .c-ckolor__saturation-handle{transform:scale(1.1);background:rgba(255,255,255,.7);box-shadow:inset 0 0 0 1px #fff,inset 0 2px 14px rgba(0,0,0,.16),0 1px 3px rgba(0,0,0,.25),0 7px 14px rgba(0,0,0,.2)}.c-ckolor__alpha-handle,.c-ckolor__saturation-handle{pointer-events:none;position:absolute;width:14px;height:14px;background:rgba(255,255,255,.4);border-radius:50%;top:3px;left:50%;margin-left:-7px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.79),inset 0 2px 14px rgba(0,0,0,.22),0 1px 3px rgba(0,0,0,.14);transition:transform .2s,background .2s,box-shadow .2s;cursor:pointer;transform:scale(1)}.c-ckolor__swatch{width:50px;height:50px;display:inline-block;vertical-align:middle;border-radius:2px}.c-ckolor__wheel-scoop{pointer-events:none;position:absolute;top:50%;left:50%;width:20px;height:20px;border-radius:50%;background:red;margin:-11px 0 0 -11px;box-shadow:0 0 0 2px #fff;transition:transform .2s}.c-ckolor__wheel{overflow:hidden;position:absolute;border-radius:50%;width:0;height:0;padding:50%;position:relative;box-shadow:0 0 0 6px #fff;margin-bottom:28px;cursor:pointer;background:#fff;border-radius:50%;z-index:0}.c-ckolor__wheel,.c-ckolor__wheel *{user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-drag:none;-webkit-user-select:none;-ms-user-select:none}.c-ckolor__wheel-color{display:block}.c-ckolor__wheel-color:nth-child(1){transform:rotate(10deg)}.c-ckolor__wheel-color:nth-child(2){transform:rotate(20deg)}.c-ckolor__wheel-color:nth-child(3){transform:rotate(30deg)}.c-ckolor__wheel-color:nth-child(4){transform:rotate(40deg)}.c-ckolor__wheel-color:nth-child(5){transform:rotate(50deg)}.c-ckolor__wheel-color:nth-child(6){transform:rotate(60deg)}.c-ckolor__wheel-color:nth-child(7){transform:rotate(70deg)}.c-ckolor__wheel-color:nth-child(8){transform:rotate(80deg)}.c-ckolor__wheel-color:nth-child(9){transform:rotate(90deg)}.c-ckolor__wheel-color:nth-child(10){transform:rotate(100deg)}.c-ckolor__wheel-color:nth-child(11){transform:rotate(110deg)}.c-ckolor__wheel-color:nth-child(12){transform:rotate(120deg)}.c-ckolor__wheel-color:nth-child(13){transform:rotate(130deg)}.c-ckolor__wheel-color:nth-child(14){transform:rotate(140deg)}.c-ckolor__wheel-color:nth-child(15){transform:rotate(150deg)}.c-ckolor__wheel-color:nth-child(16){transform:rotate(160deg)}.c-ckolor__wheel-color:nth-child(17){transform:rotate(170deg)}.c-ckolor__wheel-color:nth-child(18){transform:rotate(180deg)}.c-ckolor__wheel-color:nth-child(19){transform:rotate(190deg)}.c-ckolor__wheel-color:nth-child(20){transform:rotate(200deg)}.c-ckolor__wheel-color:nth-child(21){transform:rotate(210deg)}.c-ckolor__wheel-color:nth-child(22){transform:rotate(220deg)}.c-ckolor__wheel-color:nth-child(23){transform:rotate(230deg)}.c-ckolor__wheel-color:nth-child(24){transform:rotate(240deg)}.c-ckolor__wheel-color:nth-child(25){transform:rotate(250deg)}.c-ckolor__wheel-color:nth-child(26){transform:rotate(260deg)}.c-ckolor__wheel-color:nth-child(27){transform:rotate(270deg)}.c-ckolor__wheel-color:nth-child(28){transform:rotate(280deg)}.c-ckolor__wheel-color:nth-child(29){transform:rotate(290deg)}.c-ckolor__wheel-color:nth-child(30){transform:rotate(300deg)}.c-ckolor__wheel-color:nth-child(31){transform:rotate(310deg)}.c-ckolor__wheel-color:nth-child(32){transform:rotate(320deg)}.c-ckolor__wheel-color:nth-child(33){transform:rotate(330deg)}.c-ckolor__wheel-color:nth-child(34){transform:rotate(340deg)}.c-ckolor__wheel-color:nth-child(35){transform:rotate(350deg)}.c-ckolor__wheel-color:nth-child(36){transform:rotate(360deg)}.c-ckolor__wheel-color:nth-child(37){transform:rotate(370deg)}.c-ckolor__wheel-color,.c-ckolor__wheel-color-inner1,.c-ckolor__wheel-color-inner2,.c-ckolor__wheel-color-inner2-2,.c-ckolor__wheel-value{width:100%;height:100%;position:absolute;top:0;left:0;pointer-events:none;overflow:hidden}.c-ckolor__wheel-colors{width:120%;height:120%;margin-left:-10%;margin-top:-10%;position:relative;filter:blur(14px);background:#000;position:absolute;top:0;left:0}.c-ckolor__wheel-color-inner1{transform:rotate(60deg) translate(50%,50%)}.c-ckolor__wheel-color-inner2{transform:rotate(-79deg) translate(49%,26%);transform-origin:0;background-image:linear-gradient(177deg,transparent 30%,rgba(0,0,0,.35) 38%,rgba(0,0,0,.5) 42%,rgba(0,0,0,.9) 55%),linear-gradient(177deg,rgba(255,255,255,.9) 13%,rgba(255,255,255,0) 30%)}.c-ckolor__wheel-value{box-shadow:inset 0 0 3px rgba(255,255,255,.53),inset 0 0 5px 1px rgba(0,0,0,.12),inset 0 0 0 1px rgba(0,0,0,.38),0 0 0 1px #000;background:radial-gradient(ellipse at center,rgba(255,255,255,.2) 0,rgba(255,255,255,0) 18%),radial-gradient(ellipse at center,rgba(255,255,255,.3) 0,rgba(255,255,255,0) 11%),radial-gradient(ellipse at center,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 6%),radial-gradient(ellipse at center,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 3%);pointer-events:all;border-radius:50%;overflow:hidden}.c-ckolor__wheel-value:hover .c-ckolor__wheel-scoop{transform:scale(1.1)}.chart-legend{margin-left:20px}.chart-legend .item{cursor:pointer;font-family:sans-serif;height:16px;font-size:.8em;font-weight:100;display:inline-block;margin-right:10px}.chart-legend .item>*{vertical-align:middle;display:inline-block}.chart-legend .item>.legend-label{height:16px;line-height:17px}.chart-legend .item>.icon{width:16px;border-radius:50%;height:16px;margin-right:5px;background-repeat:no-repeat;background-position:50% 25%}.chart-legend .item.legend-hidden{opacity:.4}.chart-legend .item.column>.icon{background-image:url("data:image/svg+xml;utf8,")}.chart-legend .item.dot>.icon{background-image:url("data:image/svg+xml;utf8,")}.chart-legend .item.dashed-line>.icon{background-image:url("data:image/svg+xml;utf8,\a \a \a \a ")}.chart-legend .item.line>.icon{background-image:url("data:image/svg+xml;utf8,\a \a \a \a ")}.chart-legend .item.area>.icon{background-image:url("data:image/svg+xml;utf8,")}.tooltip-line{stroke:grey;stroke-width:1;shape-rendering:crispEdges}.tooltip-dot{stroke-width:2px;fill:#fff}.chart-tooltip{position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;z-index:100;box-shadow:1px 1px 2px rgba(61,61,61,.5);padding:5px 10px;border-radius:1px;font-family:sans-serif;font-weight:100}.chart-tooltip>.abscissas{margin-bottom:5px;font-size:.7em;white-space:nowrap}.chart-tooltip .tooltip-item{font-size:.8em;white-space:nowrap}.chart-tooltip .tooltip-item:not(:last-child){margin-bottom:.2em}.chart-tooltip .tooltip-item>*{display:inline-block}.chart-tooltip .tooltip-item>:not(:last-child){margin-right:.4em}.chart-tooltip .tooltip-item .color-dot{width:10px;height:10px;border-radius:50%}.chart-tooltip .tooltip-item .y-value{font-weight:500}.chart{position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chart .axis{font:10px Roboto;shape-rendering:crispEdges}.chart .axis.x2-axis{display:none}.chart .axis>path{fill:none;stroke:#000}.chart .axis>.tick>text{fill:#000}.chart .axis>.tick>line{stroke:#000}.chart .grid .tick>text{display:none}.chart .grid .tick>line{stroke:#eee;stroke-width:1;shape-rendering:crispEdges}.chart .dot-series circle{fill:#fff;stroke-width:2px}.chart .line-series path{stroke-width:1px}.chart .column-series{fill-opacity:.3}.chart .area-series{opacity:.3}.chart .chart-brush{fill:rgba(166,166,166,.5)}.chart .hline{shape-rendering:crispEdges;stroke-width:1px}/*! + */.ui-select-highlight{font-weight:700}.ui-select-offscreen{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:0!important;top:0!important}.ui-select-choices-row:hover{background-color:#f5f5f5}.ng-dirty.ng-invalid>a.select2-choice{border-color:#d44950}.select2-result-single{padding-left:0}.select2-locked>.select2-search-choice-close{display:none}.select-locked>.ui-select-match-close{display:none}body>.select2-container.open{z-index:9999}.ui-select-container.select2.direction-up .ui-select-match,.ui-select-container[theme=select2].direction-up .ui-select-match{border-radius:4px;border-top-left-radius:0;border-top-right-radius:0}.ui-select-container.select2.direction-up .ui-select-dropdown,.ui-select-container[theme=select2].direction-up .ui-select-dropdown{border-radius:4px;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-width:1px;border-top-style:solid;box-shadow:0 -4px 8px rgba(0,0,0,.25);margin-top:-4px}.ui-select-container.select2.direction-up .ui-select-dropdown .select2-search,.ui-select-container[theme=select2].direction-up .ui-select-dropdown .select2-search{margin-top:4px}.ui-select-container.select2.direction-up.select2-dropdown-open .ui-select-match,.ui-select-container[theme=select2].direction-up.select2-dropdown-open .ui-select-match{border-bottom-color:#5897fb}.ui-select-container[theme=select2] .ui-select-dropdown .ui-select-search-hidden,.ui-select-container[theme=select2] .ui-select-dropdown .ui-select-search-hidden input{opacity:0;height:0;min-height:0;padding:0;margin:0;border:0}.selectize-input.selectize-focus{border-color:#007fbb!important}.selectize-control.single>.selectize-input>input{width:100%}.selectize-control.multi>.selectize-input>input{margin:0!important}.selectize-control>.selectize-dropdown{width:100%}.ng-dirty.ng-invalid>div.selectize-input{border-color:#d44950}.ui-select-container[theme=selectize].direction-up .ui-select-dropdown{box-shadow:0 -4px 8px rgba(0,0,0,.25);margin-top:-2px}.ui-select-container[theme=selectize] input.ui-select-search-hidden{opacity:0;height:0;min-height:0;padding:0;margin:0;border:0;width:0}.btn-default-focus{color:#333;background-color:#ebebeb;border-color:#adadad;text-decoration:none;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.ui-select-bootstrap .ui-select-toggle{position:relative}.ui-select-bootstrap .ui-select-toggle>.caret{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.input-group>.ui-select-bootstrap.dropdown{position:static}.input-group>.ui-select-bootstrap>input.ui-select-search.form-control{border-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.ui-select-bootstrap>input.ui-select-search.form-control.direction-up{border-radius:4px!important;border-top-right-radius:0!important;border-bottom-right-radius:0!important}.ui-select-bootstrap .ui-select-search-hidden{opacity:0;height:0;min-height:0;padding:0;margin:0;border:0}.ui-select-bootstrap>.ui-select-match>.btn{text-align:left!important}.ui-select-bootstrap>.ui-select-match>.caret{position:absolute;top:45%;right:15px}.ui-select-bootstrap>.ui-select-choices,.ui-select-bootstrap>.ui-select-no-choice{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:-1px}body>.ui-select-bootstrap.open{z-index:1000}.ui-select-multiple.ui-select-bootstrap{height:auto;padding:3px 3px 0 3px}.ui-select-multiple.ui-select-bootstrap input.ui-select-search{background-color:transparent!important;border:none;outline:0;height:1.666666em;margin-bottom:3px}.ui-select-multiple.ui-select-bootstrap .ui-select-match .close{font-size:1.6em;line-height:.75}.ui-select-multiple.ui-select-bootstrap .ui-select-match-item{outline:0;margin:0 3px 3px 0}.ui-select-multiple .ui-select-match-item{position:relative}.ui-select-multiple .ui-select-match-item.dropping .ui-select-match-close{pointer-events:none}.ui-select-multiple:hover .ui-select-match-item.dropping-before:before{content:"";position:absolute;top:0;right:100%;height:100%;margin-right:2px;border-left:1px solid #428bca}.ui-select-multiple:hover .ui-select-match-item.dropping-after:after{content:"";position:absolute;top:0;left:100%;height:100%;margin-left:2px;border-right:1px solid #428bca}.ui-select-bootstrap .ui-select-choices-row>span{cursor:pointer;display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-bootstrap .ui-select-choices-row>span:focus,.ui-select-bootstrap .ui-select-choices-row>span:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.ui-select-bootstrap .ui-select-choices-row.active>span{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.ui-select-bootstrap .ui-select-choices-row.active.disabled>span,.ui-select-bootstrap .ui-select-choices-row.disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.ui-select-match.ng-hide-add,.ui-select-search.ng-hide-add{display:none!important}.ui-select-bootstrap.ng-dirty.ng-invalid>button.btn.ui-select-match{border-color:#d44950}.ui-select-container[theme=bootstrap].direction-up .ui-select-dropdown{box-shadow:0 -4px 8px rgba(0,0,0,.25)}.ui-select-bootstrap .ui-select-match-text{width:100%;padding-right:1em}.ui-select-bootstrap .ui-select-match-text span{display:inline-block;width:100%;overflow:hidden}.ui-select-bootstrap .ui-select-toggle>a.btn{position:absolute;height:10px;right:10px;margin-top:-2px}.ui-select-refreshing.glyphicon{position:absolute;right:0;padding:8px 27px}@-webkit-keyframes ui-select-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes ui-select-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.ui-select-spin{-webkit-animation:ui-select-spin 2s infinite linear;animation:ui-select-spin 2s infinite linear}.ui-select-refreshing.ng-animate{-webkit-animation:none 0s}body,html{margin:0;padding:0;width:100%;height:100%;overflow:hidden}.snap-content,.snap-drawers,.x-snap-content,.x-snap-drawers,[data-snap-content],[data-snap-drawers],[snap-content],[snap-drawers],[snap\:content],[snap\:drawers],[x-snap-content],[x-snap-drawers],snap-content,snap-drawers{position:absolute;height:auto;top:0;bottom:0;width:auto;left:0;right:0}.snap-drawer,.x-snap-drawer,[data-snap-drawer],[snap-drawer],[snap\:drawer],[x-snap-drawer],snap-drawer{position:absolute;height:auto;top:0;bottom:0;overflow:auto;-webkit-transition:top .2s linear;-moz-transition:top .2s linear;-o-transition:top .2s linear;transition:top .2s linear;-webkit-transition:bottom .2s linear;-moz-transition:bottom .2s linear;-o-transition:bottom .2s linear;transition:bottom .2s linear;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;overflow-scrolling:touch;width:265px}.snap-content{z-index:2;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);overflow:auto;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;overflow-scrolling:touch}.snap-drawer-left{left:0;z-index:1}.snap-drawer-right{right:0;z-index:1}.snapjs-left .snap-drawer-right,.snapjs-right .snap-drawer-left{display:none}.snapjs-expand-left .snap-drawer-left,.snapjs-expand-right .snap-drawer-right{width:100%}a-ckolor-wheel{display:block;position:absolute;z-index:9999;filter:none!important}.c-ckolor__input-row{margin:14px 0}.c-ckolor__input-row.center{text-align:center}.c-ckolor__input-wrapper{width:200px;height:60px;line-height:60px;padding:7px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.14),0 3px 10px rgba(0,0,0,.035);border-radius:2px;margin:7px 0;font-size:14px;color:#555;font-family:sans-serif;text-transform:uppercase;cursor:pointer}.c-ckolor__input-wrapper button{outline:0!important;background:0 0;border:none;-webkit-appearance:none;width:50px;font-size:40px;padding:5px;color:#fff;opacity:.7;box-shadow:none;margin:-4px 0 0 0;cursor:pointer;transition:all .2s}.c-ckolor__input-wrapper button:hover{transform:scale(1.05);opacity:1}.c-ckolor__input-wrapper span{display:inline-block;vertical-align:middle}.c-ckolor__modal{overflow:hidden;position:fixed}.c-ckolor__overlay{width:100%;height:100%;position:fixed;left:0;top:0;background:radial-gradient(ellipse at 50% 250px,rgba(19,49,63,.91) 0,rgba(0,0,0,.91) 100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:9999}.c-ckolor__overlay input[type=number],.c-ckolor__overlay input[type=text]{color:#aaa;font-size:12px;text-align:center;font-style:normal;text-transform:uppercase;display:inline-block;height:19px;background:rgba(255,255,255,.07);border:none;box-shadow:none;box-sizing:border-box;padding:0 3px;margin:0;width:100%;border-radius:2px;-webkit-appearance:none;outline:0!important;transition:all .2s}.c-ckolor__overlay input[type=number]:focus,.c-ckolor__overlay input[type=number]:hover,.c-ckolor__overlay input[type=text]:focus,.c-ckolor__overlay input[type=text]:hover{background:rgba(255,255,255,.14)}.c-ckolor__overlay input[type=number][type=number],.c-ckolor__overlay input[type=text][type=number]{-moz-appearance:textfield}.c-ckolor__overlay input[type=number][type=number]::-webkit-inner-spin-button,.c-ckolor__overlay input[type=number][type=number]::-webkit-outer-spin-button,.c-ckolor__overlay input[type=text][type=number]::-webkit-inner-spin-button,.c-ckolor__overlay input[type=text][type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.c-ckolor__overlay .c-ckolor__swatch{margin:0 0 0 1px;width:0;height:0;display:inline-block;vertical-align:middle;padding:18px;position:relative}.c-ckolor__overlay .c-ckolor__swatch span{display:block;width:100%;height:100%;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07),0 1px 0 1px rgba(0,0,0,.07);border-radius:50%;position:absolute;top:0;left:0}.c-ckolor__overlay .c-ckolor__input-wrapper{width:30%;overflow:hidden;background:0 0;box-shadow:none;color:#aaa;display:inline-block;padding:0;margin:0 1px;line-height:14px}.c-ckolor__overlay .c-ckolor__input-wrapper.smaller{width:30px}.c-ckolor__overlay .c-ckolor__input-wrapper.button{width:calc(50% - 22px);vertical-align:middle;text-align:center;margin:0 0 0 2px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown{width:20%;overflow:visible;position:relative;vertical-align:middle;text-align:center;font-size:12px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown div{margin-left:3px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown div:before{content:"\f0dd";display:inline-block;font:normal normal normal 14px/1 FontAwesome;margin:0 3px 0 0;position:relative;top:-3px}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown ul{margin:0;padding:0;display:block;position:absolute;height:auto;overflow:hidden;max-height:0;background:rgba(255,255,255,.77);width:100%;color:#333;border-radius:2px;transition:all .2s}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown ul li{display:block;padding:5px 7px;box-shadow:0 1px 0 rgba(0,0,0,.05)}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown ul li:hover{background:#fff}.c-ckolor__overlay .c-ckolor__input-wrapper.dropdown:hover ul{max-height:140px}.c-ckolor__overlay .c-ckolor__input-wrapper.hex{width:100%}.c-ckolor__overlay .c-ckolor__input-wrapper.hex input{text-align:left}.c-ckolor_previous-color-container{margin:28px auto 14px;box-sizing:border-box;padding:28px 7px 0;box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 -1px 0 rgba(0,0,0,.2);text-align:center}.c-ckolor_previous-swatch{height:0;display:inline-block;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 0 0 1px rgba(0,0,0,.12);padding:3%;margin:1.7%;border-radius:50%;transition:transform .2s}.c-ckolor_previous-swatch:hover{transform:scale(1.1)}.c-ckolor__overlay-blur>*{filter:blur(3px);transition:filter .2s}.c-ckolor__overlay-inner-outer{position:relative;overflow:auto;width:100%;height:100%}.c-ckolor__overlay-inner{width:280px;position:relative;margin:35px auto 20px}.c-ckolor__overlay-inputs{width:40%;display:inline-block;vertical-align:middle;position:relative;top:2px}.c-ckolor__alpha-wrapper{background:linear-gradient(0deg,rgba(138,138,138,.14) 0,rgba(138,138,138,.14) 1px,transparent 1px,transparent 5px),linear-gradient(90deg,rgba(138,138,138,.14) 0,rgba(138,138,138,.14) 1px,transparent 1px,transparent 5px);background-repeat:repeat;background-size:5px 5px;background-position:7px 6px;border-radius:50px}.c-ckolor__alpha,.c-ckolor__saturation{position:relative;width:100%;height:21px;border-radius:50px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07),0 1px 0 1px rgba(0,0,0,.07)}.c-ckolor__alpha:hover .c-ckolor__alpha-handle,.c-ckolor__saturation:hover .c-ckolor__saturation-handle{transform:scale(1.1);background:rgba(255,255,255,.7);box-shadow:inset 0 0 0 1px #fff,inset 0 2px 14px rgba(0,0,0,.16),0 1px 3px rgba(0,0,0,.25),0 7px 14px rgba(0,0,0,.2)}.c-ckolor__alpha-handle,.c-ckolor__saturation-handle{pointer-events:none;position:absolute;width:14px;height:14px;background:rgba(255,255,255,.4);border-radius:50%;top:3px;left:50%;margin-left:-7px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.79),inset 0 2px 14px rgba(0,0,0,.22),0 1px 3px rgba(0,0,0,.14);transition:transform .2s,background .2s,box-shadow .2s;cursor:pointer;transform:scale(1)}.c-ckolor__swatch{width:50px;height:50px;display:inline-block;vertical-align:middle;border-radius:2px}.c-ckolor__wheel-scoop{pointer-events:none;position:absolute;top:50%;left:50%;width:20px;height:20px;border-radius:50%;background:red;margin:-11px 0 0 -11px;box-shadow:0 0 0 2px #fff;transition:transform .2s}.c-ckolor__wheel{overflow:hidden;position:absolute;border-radius:50%;width:0;height:0;padding:50%;position:relative;box-shadow:0 0 0 6px #fff;margin-bottom:28px;cursor:pointer;background:#fff;border-radius:50%;z-index:0}.c-ckolor__wheel,.c-ckolor__wheel *{user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-drag:none;-webkit-user-select:none;-ms-user-select:none}.c-ckolor__wheel-color{display:block}.c-ckolor__wheel-color:nth-child(1){transform:rotate(10deg)}.c-ckolor__wheel-color:nth-child(2){transform:rotate(20deg)}.c-ckolor__wheel-color:nth-child(3){transform:rotate(30deg)}.c-ckolor__wheel-color:nth-child(4){transform:rotate(40deg)}.c-ckolor__wheel-color:nth-child(5){transform:rotate(50deg)}.c-ckolor__wheel-color:nth-child(6){transform:rotate(60deg)}.c-ckolor__wheel-color:nth-child(7){transform:rotate(70deg)}.c-ckolor__wheel-color:nth-child(8){transform:rotate(80deg)}.c-ckolor__wheel-color:nth-child(9){transform:rotate(90deg)}.c-ckolor__wheel-color:nth-child(10){transform:rotate(100deg)}.c-ckolor__wheel-color:nth-child(11){transform:rotate(110deg)}.c-ckolor__wheel-color:nth-child(12){transform:rotate(120deg)}.c-ckolor__wheel-color:nth-child(13){transform:rotate(130deg)}.c-ckolor__wheel-color:nth-child(14){transform:rotate(140deg)}.c-ckolor__wheel-color:nth-child(15){transform:rotate(150deg)}.c-ckolor__wheel-color:nth-child(16){transform:rotate(160deg)}.c-ckolor__wheel-color:nth-child(17){transform:rotate(170deg)}.c-ckolor__wheel-color:nth-child(18){transform:rotate(180deg)}.c-ckolor__wheel-color:nth-child(19){transform:rotate(190deg)}.c-ckolor__wheel-color:nth-child(20){transform:rotate(200deg)}.c-ckolor__wheel-color:nth-child(21){transform:rotate(210deg)}.c-ckolor__wheel-color:nth-child(22){transform:rotate(220deg)}.c-ckolor__wheel-color:nth-child(23){transform:rotate(230deg)}.c-ckolor__wheel-color:nth-child(24){transform:rotate(240deg)}.c-ckolor__wheel-color:nth-child(25){transform:rotate(250deg)}.c-ckolor__wheel-color:nth-child(26){transform:rotate(260deg)}.c-ckolor__wheel-color:nth-child(27){transform:rotate(270deg)}.c-ckolor__wheel-color:nth-child(28){transform:rotate(280deg)}.c-ckolor__wheel-color:nth-child(29){transform:rotate(290deg)}.c-ckolor__wheel-color:nth-child(30){transform:rotate(300deg)}.c-ckolor__wheel-color:nth-child(31){transform:rotate(310deg)}.c-ckolor__wheel-color:nth-child(32){transform:rotate(320deg)}.c-ckolor__wheel-color:nth-child(33){transform:rotate(330deg)}.c-ckolor__wheel-color:nth-child(34){transform:rotate(340deg)}.c-ckolor__wheel-color:nth-child(35){transform:rotate(350deg)}.c-ckolor__wheel-color:nth-child(36){transform:rotate(360deg)}.c-ckolor__wheel-color:nth-child(37){transform:rotate(370deg)}.c-ckolor__wheel-color,.c-ckolor__wheel-color-inner1,.c-ckolor__wheel-color-inner2,.c-ckolor__wheel-color-inner2-2,.c-ckolor__wheel-value{width:100%;height:100%;position:absolute;top:0;left:0;pointer-events:none;overflow:hidden}.c-ckolor__wheel-colors{width:120%;height:120%;margin-left:-10%;margin-top:-10%;position:relative;filter:blur(14px);background:#000;position:absolute;top:0;left:0}.c-ckolor__wheel-color-inner1{transform:rotate(60deg) translate(50%,50%)}.c-ckolor__wheel-color-inner2{transform:rotate(-79deg) translate(49%,26%);transform-origin:0;background-image:linear-gradient(177deg,transparent 30%,rgba(0,0,0,.35) 38%,rgba(0,0,0,.5) 42%,rgba(0,0,0,.9) 55%),linear-gradient(177deg,rgba(255,255,255,.9) 13%,rgba(255,255,255,0) 30%)}.c-ckolor__wheel-value{box-shadow:inset 0 0 3px rgba(255,255,255,.53),inset 0 0 5px 1px rgba(0,0,0,.12),inset 0 0 0 1px rgba(0,0,0,.38),0 0 0 1px #000;background:radial-gradient(ellipse at center,rgba(255,255,255,.2) 0,rgba(255,255,255,0) 18%),radial-gradient(ellipse at center,rgba(255,255,255,.3) 0,rgba(255,255,255,0) 11%),radial-gradient(ellipse at center,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 6%),radial-gradient(ellipse at center,rgba(255,255,255,.5) 0,rgba(255,255,255,0) 3%);pointer-events:all;border-radius:50%;overflow:hidden}.c-ckolor__wheel-value:hover .c-ckolor__wheel-scoop{transform:scale(1.1)}.as-sortable-item,.as-sortable-placeholder{display:block}.as-sortable-item{-ms-touch-action:none;touch-action:none;-webkit-touch-callout:none}.as-sortable-item-handle{cursor:move;cursor:-webkit-grab;cursor:-moz-grab}.as-sortable-drag{position:absolute;pointer-events:none;z-index:9999}.as-sortable-hidden{display:none!important}.as-sortable-un-selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chart-legend{margin-left:20px}.chart-legend .item{cursor:pointer;font-family:sans-serif;height:16px;font-size:.8em;font-weight:100;display:inline-block;margin-right:10px}.chart-legend .item>*{vertical-align:middle;display:inline-block}.chart-legend .item>.legend-label{height:16px;line-height:17px}.chart-legend .item>.icon{width:16px;border-radius:50%;height:16px;margin-right:5px;background-repeat:no-repeat;background-position:50% 25%}.chart-legend .item.legend-hidden{opacity:.4}.chart-legend .item.column>.icon{background-image:url("data:image/svg+xml;utf8,")}.chart-legend .item.dot>.icon{background-image:url("data:image/svg+xml;utf8,")}.chart-legend .item.dashed-line>.icon{background-image:url("data:image/svg+xml;utf8,\a \a \a \a ")}.chart-legend .item.line>.icon{background-image:url("data:image/svg+xml;utf8,\a \a \a \a ")}.chart-legend .item.area>.icon{background-image:url("data:image/svg+xml;utf8,")}.tooltip-line{stroke:grey;stroke-width:1;shape-rendering:crispEdges}.tooltip-dot{stroke-width:2px;fill:#fff}.chart-tooltip{position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;z-index:100;box-shadow:1px 1px 2px rgba(61,61,61,.5);padding:5px 10px;border-radius:1px;font-family:sans-serif;font-weight:100}.chart-tooltip>.abscissas{margin-bottom:5px;font-size:.7em;white-space:nowrap}.chart-tooltip .tooltip-item{font-size:.8em;white-space:nowrap}.chart-tooltip .tooltip-item:not(:last-child){margin-bottom:.2em}.chart-tooltip .tooltip-item>*{display:inline-block}.chart-tooltip .tooltip-item>:not(:last-child){margin-right:.4em}.chart-tooltip .tooltip-item .color-dot{width:10px;height:10px;border-radius:50%}.chart-tooltip .tooltip-item .y-value{font-weight:500}.chart{position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chart .axis{font:10px Roboto;shape-rendering:crispEdges}.chart .axis.x2-axis{display:none}.chart .axis>path{fill:none;stroke:#000}.chart .axis>.tick>text{fill:#000}.chart .axis>.tick>line{stroke:#000}.chart .grid .tick>text{display:none}.chart .grid .tick>line{stroke:#eee;stroke-width:1;shape-rendering:crispEdges}.chart .dot-series circle{fill:#fff;stroke-width:2px}.chart .line-series path{stroke-width:1px}.chart .column-series{fill-opacity:.3}.chart .area-series{opacity:.3}.chart .chart-brush{fill:rgba(166,166,166,.5)}.chart .hline{shape-rendering:crispEdges;stroke-width:1px}.as-sortable-placeholder,.ss.as-sortable-handle{display:block;cursor:move;padding:.625em;border:solid 1px #ddd;background:#fff;width:calc(100% - 1em);margin:.5em}.as-sortable-placeholder .glyphicon,.ss.as-sortable-handle .glyphicon{opacity:.25}.as-sortable-placeholder{opacity:.6}.screensaver-settings{font-size:16px;color:#000}.screensaver-settings input:not([type=checkbox]),.screensaver-settings option,.screensaver-settings select{color:#000;padding:.25em;min-width:20rem}.screensaver-settings .scrollable.box{padding:1em}.screensaver-settings .scrollable.box .tab-content{padding:1em}.screensaver-settings .d-block{display:block}.screensaver-settings .f-normal{font-weight:400}.screensaver-settings .settings-inner,.screensaver-settings .settings-outer{list-style-type:none;padding:0}.screensaver-settings .settings-outer{max-width:50em}.screensaver-settings .settings-inner,.screensaver-settings .settings-outer li{display:flex;flex-wrap:wrap;align-items:flex-start;top:.25em;position:relative}.screensaver-settings .settings-inner{padding:0 .5em;justify-content:space-between}.screensaver-settings .settings-outer li:not(:last-child){margin-bottom:1.25em}.screensaver-settings .settings-outer li p,.screensaver-settings .settings-outer li>label{flex:1 0 50%;max-width:8.75em;text-align:left;margin-right:1em}.screensaver-settings .settings-inner,.screensaver-settings .settings-outer li>label{flex:1 0 13.75em}.screensaver-settings .settings-inner li{width:6.25em}.screensaver-settings .settings-inner li p{margin:0}.screensaver-settings div.cancelsave{margin-top:1.25em}.screensaver-settings .helpinfo{cursor:pointer}.screensaver-settings .helpinfo ul{list-style:circle}.screensaver-settings .helpinfo ul li{display:list-item;margin-bottom:auto!important}.screensaver-settings .helpinfo .glyphicon-question-sign{color:#5bc0de!important;position:relative;top:.125em}.screensaver-settings div .as-sortable{color:#000;min-height:3.75em;width:20em}.screensaver-settings div .as-sortable.positive{background:#b1dab1}.screensaver-settings div .as-sortable.negative{background:#ffadad}.screensaver-settings div .as-sortable .as-sortable-item-handle{margin:0;padding:0}.screensaver-settings div .as-sortable .as-sortable-handle .glyphicon{top:.25em;opacity:.25}.screensaver-settings div .as-sortable .as-sortable-drag{opacity:.8!important}.screensaver-settings .box{margin-top:.625em;margin-bottom:.625em}.screensaver-settings label{font-weight:400}.screensaver-settings h4.inline{display:inline}/*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) diff --git a/web/vendor/styles.scss b/web/vendor/styles.scss index 2e0080f8..d3845cf8 100644 --- a/web/vendor/styles.scss +++ b/web/vendor/styles.scss @@ -13,8 +13,10 @@ @import "../bower_components/angular-ui-select/dist/select"; @import "../bower_components/angular-snap/angular-snap"; @import "../bower_components/aCKolor/dist/css/aCKolor.min"; +@import "../bower_components/ng-sortable/dist/ng-sortable.min"; @import "node_modules/n3-charts/build/LineChart"; @import "../assets/styles/reset.scss"; +@import "../assets/styles/screensaver.scss"; @import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap.scss"; @import "../assets/styles/[^reset]*.scss"; @import '../app/widgets/**/*.scss'; \ No newline at end of file diff --git a/web/vendor/vendor.js b/web/vendor/vendor.js index 3196d23a..afc74324 100644 --- a/web/vendor/vendor.js +++ b/web/vendor/vendor.js @@ -645,7 +645,7 @@ return angular.module('angular-clipboard', []) * Licence: MIT *******************************************************/ "use strict";!function(){var ui={},Knob=function(element,value,options){this.element=element,this.value=value,this.options=options,this.inDrag=!1};Knob.prototype.valueToRadians=function(value,valueEnd,angleEnd,angleStart,valueStart){return valueEnd=valueEnd||100,valueStart=valueStart||0,angleEnd=angleEnd||360,angleStart=angleStart||0,Math.PI/180*((value-valueStart)*(angleEnd-angleStart)/(valueEnd-valueStart)+angleStart)},Knob.prototype.radiansToValue=function(radians,valueEnd,valueStart,angleEnd,angleStart){return valueEnd=valueEnd||100,valueStart=valueStart||0,angleEnd=angleEnd||360,angleStart=angleStart||0,(180/Math.PI*radians-angleStart)*(valueEnd-valueStart)/(angleEnd-angleStart)+valueStart},Knob.prototype.hasRanges=function(){return"undefined"!=typeof this.options.ranges&&this.options.ranges.length>0},Knob.prototype.getBarColor=function(ranges,value){var colorValue=this.options.barColor;return this.hasRanges()&&this.options.rangesEnabled&&ranges.forEach(function(arrayItem){value>=arrayItem.min&&value=arrayItem.min&&valuethis.options.trackWidth?(diff=(this.options.barWidth-this.options.trackWidth)/2,trackInnerRadius-=diff,trackOuterRadius-=diff):this.options.barWidth=0&&y<=0||x>=0&&y>=0?delta=90:(delta=270,that.options.startAngle<0&&(delta=-90)),radians=(delta+arc)*(Math.PI/180),that.value=that.radiansToValue(radians,that.options.max,that.options.min,that.options.endAngle,that.options.startAngle),that.value>=that.options.min&&that.value<=that.options.max&&(that.value=Math.round(~~((that.value<0?-.5:.5)+that.value/that.options.step)*that.options.step*100)/100,that.options.step<1&&(that.value=that.value.toFixed(1)),update(that.value),that.valueArc.endAngle(that.valueToRadians(that.value,that.options.max,that.options.endAngle,that.options.startAngle,that.options.min)),that.valueElem.attr("d",that.valueArc),that.valueElem.attr("style","fill: "+that.getBarColor(that.options.ranges,that.value)),isFinal&&(that.changeArc.endAngle(that.valueToRadians(that.value,that.options.max,that.options.endAngle,that.options.startAngle,that.options.min)),that.changeElem.attr("d",that.changeArc),"function"==typeof that.options.onEnd&&that.options.onEnd(that.value)),that.options.displayInput)){var v=that.value;"function"==typeof that.options.inputFormatter&&(v=that.options.inputFormatter(v)),d3.select(that.element).select("#text").text(v+that.options.unit||""),d3.select(that.element).select("#text").attr("style","fill: "+that.getTextColor(that.options.ranges,that.value))}}d3.select(this.element).select("svg").remove();var that=this;that.createArcs();var dragBehavior=d3.behavior.drag().on("drag",dragInteraction).on("dragend",clickInteraction);that.drawArcs(clickInteraction,dragBehavior),that.options.animate.enabled?that.valueElem.transition().ease(that.options.animate.ease).duration(that.options.animate.duration).tween("",function(){var i=d3.interpolate(that.valueToRadians(that.options.startAngle,360),that.valueToRadians(that.value,that.options.max,that.options.endAngle,that.options.startAngle,that.options.min));return function(t){var val=i(t);that.valueElem.attr("d",that.valueArc.endAngle(val)),that.changeElem.attr("d",that.changeArc.endAngle(val))}}):(that.changeArc.endAngle(this.valueToRadians(this.value,this.options.max,this.options.endAngle,this.options.startAngle,this.options.min)),that.changeElem.attr("d",that.changeArc),that.valueArc.endAngle(this.valueToRadians(this.value,this.options.max,this.options.endAngle,this.options.startAngle,this.options.min)),that.valueElem.attr("d",that.valueArc))},Knob.prototype.setValue=function(newValue){if(!this.inDrag&&this.value>=this.options.min&&this.value<=this.options.max){var radians=this.valueToRadians(newValue,this.options.max,this.options.endAngle,this.options.startAngle,this.options.min);if(this.value=Math.round(~~((newValue<0?-.5:.5)+newValue/this.options.step)*this.options.step*100)/100,this.options.step<1&&(this.value=this.value.toFixed(1)),this.changeArc.endAngle(radians),d3.select(this.element).select("#changeArc").attr("d",this.changeArc),this.valueArc.endAngle(radians),d3.select(this.element).select("#valueArc").attr("d",this.valueArc),d3.select(this.element).select("#valueArc").attr("style","fill: "+this.getBarColor(this.options.ranges,this.value)),this.options.displayInput){var v=this.value;"function"==typeof this.options.inputFormatter&&(v=this.options.inputFormatter(v)),d3.select(this.element).select("#text").text(v+this.options.unit||""),d3.select(this.element).select("#text").attr("style","fill: "+this.getTextColor(this.options.ranges,this.value))}}},ui.Knob=Knob,ui.knobDirective=function(){return{restrict:"E",scope:{value:"=",options:"="},link:function(scope,element){scope.value=scope.value||0;var defaultOptions={skin:{type:"simple",width:10,color:"rgba(255,0,0,.5)",spaceWidth:5},animate:{enabled:!0,duration:1e3,ease:"bounce"},size:200,startAngle:0,endAngle:360,unit:"",displayInput:!0,inputFormatter:function(v){return v},readOnly:!1,trackWidth:50,barWidth:50,trackColor:"rgba(0,0,0,0)",barColor:"rgba(255,0,0,.5)",prevBarColor:"rgba(0,0,0,0)",textColor:"#222",barCap:0,trackCap:0,fontSize:"auto",subText:{enabled:!1,text:"",color:"gray",font:"auto"},bgColor:"",bgFull:!1,scale:{enabled:!1,type:"lines",color:"gray",width:4,quantity:20,height:10,spaceWidth:15},step:1,displayPrevious:!1,min:0,max:100,dynamicOptions:!1,rangesEnabled:!1,ranges:[{min:0,max:100,barColor:"rgba(255,0,0,0,0.5",textColor:"#222"}]};scope.options=angular.merge(defaultOptions,scope.options);var knob=new ui.Knob(element[0],scope.value,scope.options);if(scope.$watch("value",function(newValue,oldValue){null===newValue&&"undefined"==typeof newValue||"undefined"==typeof oldValue||newValue===oldValue||knob.setValue(newValue)}),scope.options.dynamicOptions){var isFirstWatchOnOptions=!0;scope.$watch("options",function(){if(isFirstWatchOnOptions)isFirstWatchOnOptions=!1;else{var newOptions=angular.merge(defaultOptions,scope.options);knob=new ui.Knob(element[0],scope.value,newOptions),drawKnob()}},!0)}var drawKnob=function(){knob.draw(function(value){scope.$apply(function(){scope.value=value})})};drawKnob()}}},angular.module("ui.knob",[]).directive("uiKnob",ui.knobDirective)}(); -(function(global){var startY=0;var enabled=false;var handleTouchmove=function(evt){var el=evt.target;while(el!==document.body){var style=window.getComputedStyle(el);if(!style){break}if(el.nodeName==="INPUT"&&el.getAttribute("type")==="range"){return}var scrolling=style.getPropertyValue("-webkit-overflow-scrolling");var overflowY=style.getPropertyValue("overflow-y");var height=parseInt(style.getPropertyValue("height"),10);var isScrollable=scrolling==="touch"&&(overflowY==="auto"||overflowY==="scroll");var canScroll=el.scrollHeight>el.offsetHeight;if(isScrollable&&canScroll){var curY=evt.touches?evt.touches[0].screenY:evt.screenY;var isAtTop=startY<=curY&&el.scrollTop===0;var isAtBottom=startY>=curY&&el.scrollHeight-el.scrollTop===height;if(isAtTop||isAtBottom){evt.preventDefault()}return}el=el.parentNode}evt.preventDefault()};var handleTouchstart=function(evt){startY=evt.touches?evt.touches[0].screenY:evt.screenY};var enable=function(){window.addEventListener("touchstart",handleTouchstart,false);window.addEventListener("touchmove",handleTouchmove,false);enabled=true};var disable=function(){window.removeEventListener("touchstart",handleTouchstart,false);window.removeEventListener("touchmove",handleTouchmove,false);enabled=false};var isEnabled=function(){return enabled};var testDiv=document.createElement("div");document.documentElement.appendChild(testDiv);testDiv.style.WebkitOverflowScrolling="touch";var scrollSupport="getComputedStyle"in window&&window.getComputedStyle(testDiv)["-webkit-overflow-scrolling"]==="touch";document.documentElement.removeChild(testDiv);if(scrollSupport){enable()}var iNoBounce={enable:enable,disable:disable,isEnabled:isEnabled};if(typeof module!=="undefined"&&module.exports){module.exports=iNoBounce}if(typeof global.define==="function"){(function(define){define("iNoBounce",[],function(){return iNoBounce})})(global.define)}else{global.iNoBounce=iNoBounce}})(this); +(function(global){var startY=0;var enabled=false;var handleTouchmove=function(evt){var el=evt.target;while(el!==document.body&&el!==document){var style=window.getComputedStyle(el);if(!style){break}if(el.nodeName==="INPUT"&&el.getAttribute("type")==="range"){return}var scrolling=style.getPropertyValue("-webkit-overflow-scrolling");var overflowY=style.getPropertyValue("overflow-y");var height=parseInt(style.getPropertyValue("height"),10);var isScrollable=scrolling==="touch"&&(overflowY==="auto"||overflowY==="scroll");var canScroll=el.scrollHeight>el.offsetHeight;if(isScrollable&&canScroll){var curY=evt.touches?evt.touches[0].screenY:evt.screenY;var isAtTop=startY<=curY&&el.scrollTop===0;var isAtBottom=startY>=curY&&el.scrollHeight-el.scrollTop===height;if(isAtTop||isAtBottom){evt.preventDefault()}return}el=el.parentNode}evt.preventDefault()};var handleTouchstart=function(evt){startY=evt.touches?evt.touches[0].screenY:evt.screenY};var enable=function(){window.addEventListener("touchstart",handleTouchstart,false);window.addEventListener("touchmove",handleTouchmove,false);enabled=true};var disable=function(){window.removeEventListener("touchstart",handleTouchstart,false);window.removeEventListener("touchmove",handleTouchmove,false);enabled=false};var isEnabled=function(){return enabled};var testDiv=document.createElement("div");document.documentElement.appendChild(testDiv);testDiv.style.WebkitOverflowScrolling="touch";var scrollSupport="getComputedStyle"in window&&window.getComputedStyle(testDiv)["-webkit-overflow-scrolling"]==="touch";document.documentElement.removeChild(testDiv);if(scrollSupport){enable()}var iNoBounce={enable:enable,disable:disable,isEnabled:isEnabled};if(typeof module!=="undefined"&&module.exports){module.exports=iNoBounce}if(typeof global.define==="function"){(function(define){define("iNoBounce",[],function(){return iNoBounce})})(global.define)}else{global.iNoBounce=iNoBounce}})(this); /** * oclazyload - Load modules on demand (lazy load) with angularJS * @version v1.0.9 @@ -654,8 +654,9 @@ return angular.module('angular-clipboard', []) * @author Olivier Combe */ !function(e,n){"use strict";var r=["ng","oc.lazyLoad"],o={},t=[],i=[],a=[],s=[],u=e.noop,c={},l=[],d=e.module("oc.lazyLoad",["ng"]);d.provider("$ocLazyLoad",["$controllerProvider","$provide","$compileProvider","$filterProvider","$injector","$animateProvider",function(d,f,p,m,v,y){function L(n,o,t){if(o){var i,s,d,f=[];for(i=o.length-1;i>=0;i--)if(s=o[i],e.isString(s)||(s=E(s)),s&&-1===l.indexOf(s)&&(!w[s]||-1!==a.indexOf(s))){var h=-1===r.indexOf(s);if(d=g(s),h&&(r.push(s),L(n,d.requires,t)),d._runBlocks.length>0)for(c[s]=[];d._runBlocks.length>0;)c[s].push(d._runBlocks.shift());e.isDefined(c[s])&&(h||t.rerun)&&(f=f.concat(c[s])),j(n,d._invokeQueue,s,t.reconfig),j(n,d._configBlocks,s,t.reconfig),u(h?"ocLazyLoad.moduleLoaded":"ocLazyLoad.moduleReloaded",s),o.pop(),l.push(s)}var p=n.getInstanceInjector();e.forEach(f,function(e){p.invoke(e)})}}function $(n,r){function t(n,r){var o,t=!0;return r.length&&(o=i(n),e.forEach(r,function(e){t=t&&i(e)!==o})),t}function i(n){return e.isArray(n)?M(n.toString()):e.isObject(n)?M(S(n)):e.isDefined(n)&&null!==n?M(n.toString()):n}var a=n[2][0],s=n[1],c=!1;e.isUndefined(o[r])&&(o[r]={}),e.isUndefined(o[r][s])&&(o[r][s]={});var l=function(e,n){o[r][s].hasOwnProperty(e)||(o[r][s][e]=[]),t(n,o[r][s][e])&&(c=!0,o[r][s][e].push(n),u("ocLazyLoad.componentLoaded",[r,s,e]))};if(e.isString(a))l(a,n[2][1]);else{if(!e.isObject(a))return!1;e.forEach(a,function(n,r){e.isString(n)?l(n,a[1]):l(r,n)})}return c}function j(n,r,o,i){if(r){var a,s,u,c;for(a=0,s=r.length;s>a;a++)if(u=r[a],e.isArray(u)){if(null!==n){if(!n.hasOwnProperty(u[0]))throw new Error("unsupported provider "+u[0]);c=n[u[0]]}var l=$(u,o);if("invoke"!==u[1])l&&e.isDefined(c)&&c[u[1]].apply(c,u[2]);else{var d=function(n){var r=t.indexOf(o+"-"+n);(-1===r||i)&&(-1===r&&t.push(o+"-"+n),e.isDefined(c)&&c[u[1]].apply(c,u[2]))};if(e.isFunction(u[2][0]))d(u[2][0]);else if(e.isArray(u[2][0]))for(var f=0,h=u[2][0].length;h>f;f++)e.isFunction(u[2][0][f])&&d(u[2][0][f])}}}}function E(n){var r=null;return e.isString(n)?r=n:e.isObject(n)&&n.hasOwnProperty("name")&&e.isString(n.name)&&(r=n.name),r}function _(n){if(!e.isString(n))return!1;try{return g(n)}catch(r){if(/No module/.test(r)||r.message.indexOf("$injector:nomod")>-1)return!1}}var w={},O={$controllerProvider:d,$compileProvider:p,$filterProvider:m,$provide:f,$injector:v,$animateProvider:y},x=!1,b=!1,z=[],D={};z.push=function(e){-1===this.indexOf(e)&&Array.prototype.push.apply(this,arguments)},this.config=function(n){e.isDefined(n.modules)&&(e.isArray(n.modules)?e.forEach(n.modules,function(e){w[e.name]=e}):w[n.modules.name]=n.modules),e.isDefined(n.debug)&&(x=n.debug),e.isDefined(n.events)&&(b=n.events)},this._init=function(o){if(0===i.length){var t=[o],a=["ng:app","ng-app","x-ng-app","data-ng-app"],u=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,c=function(e){return e&&t.push(e)};e.forEach(a,function(n){a[n]=!0,c(document.getElementById(n)),n=n.replace(":","\\:"),"undefined"!=typeof o[0]&&o[0].querySelectorAll&&(e.forEach(o[0].querySelectorAll("."+n),c),e.forEach(o[0].querySelectorAll("."+n+"\\:"),c),e.forEach(o[0].querySelectorAll("["+n+"]"),c))}),e.forEach(t,function(n){if(0===i.length){var r=" "+o.className+" ",t=u.exec(r);t?i.push((t[2]||"").replace(/\s+/g,",")):e.forEach(n.attributes,function(e){0===i.length&&a[e.name]&&i.push(e.value)})}})}0!==i.length||(n.jasmine||n.mocha)&&e.isDefined(e.mock)||console.error("No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.");var l=function d(n){if(-1===r.indexOf(n)){r.push(n);var o=e.module(n);j(null,o._invokeQueue,n),j(null,o._configBlocks,n),e.forEach(o.requires,d)}};e.forEach(i,function(e){l(e)}),i=[],s.pop()};var S=function(n){try{return JSON.stringify(n)}catch(r){var o=[];return JSON.stringify(n,function(n,r){if(e.isObject(r)&&null!==r){if(-1!==o.indexOf(r))return;o.push(r)}return r})}},M=function(e){var n,r,o,t=0;if(0==e.length)return t;for(n=0,o=e.length;o>n;n++)r=e.charCodeAt(n),t=(t<<5)-t+r,t|=0;return t};this.$get=["$log","$rootElement","$rootScope","$cacheFactory","$q",function(n,t,a,c,d){function f(e){var r=d.defer();return n.error(e.message),r.reject(e),r.promise}var p,m=c("ocLazyLoad");return x||(n={},n.error=e.noop,n.warn=e.noop,n.info=e.noop),O.getInstanceInjector=function(){return p?p:p=t.data("$injector")||e.injector()},u=function(e,r){b&&a.$broadcast(e,r),x&&n.info(e,r)},{_broadcast:u,_$log:n,_getFilesCache:function(){return m},toggleWatch:function(e){e?s.push(!0):s.pop()},getModuleConfig:function(n){if(!e.isString(n))throw new Error("You need to give the name of the module to get");return w[n]?e.copy(w[n]):null},setModuleConfig:function(n){if(!e.isObject(n))throw new Error("You need to give the module config object to set");return w[n.name]=n,n},getModules:function(){return r},isLoaded:function(n){var o=function(e){var n=r.indexOf(e)>-1;return n||(n=!!_(e)),n};if(e.isString(n)&&(n=[n]),e.isArray(n)){var t,i;for(t=0,i=n.length;i>t;t++)if(!o(n[t]))return!1;return!0}throw new Error("You need to define the module(s) name(s)")},_getModuleName:E,_getModule:function(e){try{return g(e)}catch(n){throw(/No module/.test(n)||n.message.indexOf("$injector:nomod")>-1)&&(n.message='The module "'+S(e)+'" that you are trying to load does not exist. '+n.message),n}},moduleExists:_,_loadDependencies:function(n,r){var o,t,i,a=[],s=this;if(n=s._getModuleName(n),null===n)return d.when();try{o=s._getModule(n)}catch(u){return f(u)}return t=s.getRequires(o),e.forEach(t,function(o){if(e.isString(o)){var t=s.getModuleConfig(o);if(null===t)return void z.push(o);o=t,t.name=void 0}if(s.moduleExists(o.name))return i=o.files.filter(function(e){return s.getModuleConfig(o.name).files.indexOf(e)<0}),0!==i.length&&s._$log.warn('Module "',n,'" attempted to redefine configuration for dependency. "',o.name,'"\n Additional Files Loaded:',i),e.isDefined(s.filesLoader)?void a.push(s.filesLoader(o,r).then(function(){return s._loadDependencies(o)})):f(new Error("Error: New dependencies need to be loaded from external files ("+o.files+"), but no loader has been defined."));if(e.isArray(o)){var u=[];e.forEach(o,function(e){var n=s.getModuleConfig(e);null===n?u.push(e):n.files&&(u=u.concat(n.files))}),u.length>0&&(o={files:u})}else e.isObject(o)&&o.hasOwnProperty("name")&&o.name&&(s.setModuleConfig(o),z.push(o.name));if(e.isDefined(o.files)&&0!==o.files.length){if(!e.isDefined(s.filesLoader))return f(new Error('Error: the module "'+o.name+'" is defined in external files ('+o.files+"), but no loader has been defined."));a.push(s.filesLoader(o,r).then(function(){return s._loadDependencies(o)}))}}),d.all(a)},inject:function(n){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],t=this,a=d.defer();if(e.isDefined(n)&&null!==n){if(e.isArray(n)){var s=[];return e.forEach(n,function(e){s.push(t.inject(e,r,o))}),d.all(s)}t._addToLoadList(t._getModuleName(n),!0,o)}if(i.length>0){var u=i.slice(),c=function f(e){z.push(e),D[e]=a.promise,t._loadDependencies(e,r).then(function(){try{l=[],L(O,z,r)}catch(e){return t._$log.error(e.message),void a.reject(e)}i.length>0?f(i.shift()):a.resolve(u)},function(e){a.reject(e)})};c(i.shift())}else{if(r&&r.name&&D[r.name])return D[r.name];a.resolve()}return a.promise},getRequires:function(n){var o=[];return e.forEach(n.requires,function(e){-1===r.indexOf(e)&&o.push(e)}),o},_invokeQueue:j,_registerInvokeList:$,_register:L,_addToLoadList:h,_unregister:function(n){e.isDefined(n)&&e.isArray(n)&&e.forEach(n,function(e){o[e]=void 0})}}}],this._init(e.element(n.document))}]);var f=e.bootstrap;e.bootstrap=function(n,r,o){return e.forEach(r.slice(),function(e){h(e,!0,!0)}),f(n,r,o)};var h=function(n,r,o){(s.length>0||r)&&e.isString(n)&&-1===i.indexOf(n)&&(i.push(n),o&&a.push(n))},g=e.module;e.module=function(e,n,r){return h(e,!1,!0),g(e,n,r)},"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="oc.lazyLoad")}(angular,window),function(e){"use strict";e.module("oc.lazyLoad").directive("ocLazyLoad",["$ocLazyLoad","$compile","$animate","$parse","$timeout",function(n,r,o,t,i){return{restrict:"A",terminal:!0,priority:1e3,compile:function(i,a){var s=i[0].innerHTML;return i.html(""),function(i,a,u){var c=t(u.ocLazyLoad);i.$watch(function(){return c(i)||u.ocLazyLoad},function(t){e.isDefined(t)&&n.load(t).then(function(){o.enter(s,a),r(a.contents())(i)})},!0)}}}}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q","$window","$interval",function(n,r,o,t){var i=!1,a=!1,s=o.document.getElementsByTagName("head")[0]||o.document.getElementsByTagName("body")[0];return n.buildElement=function(u,c,l){var d,f,h=r.defer(),g=n._getFilesCache(),p=function(e){var n=(new Date).getTime();return e.indexOf("?")>=0?"&"===e.substring(0,e.length-1)?e+"_dc="+n:e+"&_dc="+n:e+"?_dc="+n};switch(e.isUndefined(g.get(c))&&g.put(c,h.promise),u){case"css":d=o.document.createElement("link"),d.type="text/css",d.rel="stylesheet",d.href=l.cache===!1?p(c):c;break;case"js":d=o.document.createElement("script"),d.src=l.cache===!1?p(c):c;break;default:g.remove(c),h.reject(new Error('Requested type "'+u+'" is not known. Could not inject "'+c+'"'))}d.onload=d.onreadystatechange=function(e){d.readyState&&!/^c|loade/.test(d.readyState)||f||(d.onload=d.onreadystatechange=null,f=1,n._broadcast("ocLazyLoad.fileLoaded",c),h.resolve())},d.onerror=function(){g.remove(c),h.reject(new Error("Unable to load "+c))},d.async=l.serie?0:1;var m=s.lastChild;if(l.insertBefore){var v=e.element(e.isDefined(window.jQuery)?l.insertBefore:document.querySelector(l.insertBefore));v&&v.length>0&&(m=v[0])}if(m.parentNode.insertBefore(d,m),"css"==u){if(!i){var y=o.navigator.userAgent.toLowerCase();if(/iP(hone|od|ad)/.test(o.navigator.platform)){var L=o.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),$=parseFloat([parseInt(L[1],10),parseInt(L[2],10),parseInt(L[3]||0,10)].join("."));a=6>$}else if(y.indexOf("android")>-1){var j=parseFloat(y.slice(y.indexOf("android")+8));a=4.4>j}else if(y.indexOf("safari")>-1){var E=y.match(/version\/([\.\d]+)/i);a=E&&E[1]&&parseFloat(E[1])<6}}if(a)var _=1e3,w=t(function(){try{d.sheet.cssRules,t.cancel(w),d.onload()}catch(e){--_<=0&&d.onerror()}},20)}return h.promise},n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.filesLoader=function(o){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=[],a=[],s=[],u=[],c=null,l=n._getFilesCache();n.toggleWatch(!0),e.extend(t,o);var d=function(r){var o,d=null;if(e.isObject(r)&&(d=r.type,r=r.path),c=l.get(r),e.isUndefined(c)||t.cache===!1){if(null!==(o=/^(css|less|html|htm|js)?(?=!)/.exec(r))&&(d=o[1],r=r.substr(o[1].length+1,r.length)),!d)if(null!==(o=/[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(r)))d=o[1];else{if(n.jsLoader.hasOwnProperty("ocLazyLoadLoader")||!n.jsLoader.hasOwnProperty("requirejs"))return void n._$log.error("File type could not be determined. "+r);d="js"}"css"!==d&&"less"!==d||-1!==i.indexOf(r)?"html"!==d&&"htm"!==d||-1!==a.indexOf(r)?"js"===d||-1===s.indexOf(r)?s.push(r):n._$log.error("File type is not valid. "+r):a.push(r):i.push(r)}else c&&u.push(c)};if(t.serie?d(t.files.shift()):e.forEach(t.files,function(e){d(e)}),i.length>0){var f=r.defer();n.cssLoader(i,function(r){e.isDefined(r)&&n.cssLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),f.reject(r)):f.resolve()},t),u.push(f.promise)}if(a.length>0){var h=r.defer();n.templatesLoader(a,function(r){e.isDefined(r)&&n.templatesLoader.hasOwnProperty("ocLazyLoadLoader")?(n._$log.error(r),h.reject(r)):h.resolve()},t),u.push(h.promise)}if(s.length>0){var g=r.defer();n.jsLoader(s,function(r){e.isDefined(r)&&(n.jsLoader.hasOwnProperty("ocLazyLoadLoader")||n.jsLoader.hasOwnProperty("requirejs"))?(n._$log.error(r),g.reject(r)):g.resolve()},t),u.push(g.promise)}if(0===u.length){var p=r.defer(),m="Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.";return n._$log.error(m),p.reject(m),p.promise}return t.serie&&t.files.length>0?r.all(u).then(function(){return n.filesLoader(o,t)}):r.all(u)["finally"](function(e){return n.toggleWatch(!1),e})},n.load=function(o){var t,i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=this,s=null,u=[],c=r.defer(),l=e.copy(o),d=e.copy(i);if(e.isArray(l))return e.forEach(l,function(e){u.push(a.load(e,d))}),r.all(u).then(function(e){c.resolve(e)},function(e){c.reject(e)}),c.promise;if(e.isString(l)?(s=a.getModuleConfig(l),s||(s={files:[l]})):e.isObject(l)&&(s=e.isDefined(l.path)&&e.isDefined(l.type)?{files:[l]}:a.setModuleConfig(l)),null===s){var f=a._getModuleName(l);return t='Module "'+(f||"unknown")+'" is not configured, cannot load.',n._$log.error(t),c.reject(new Error(t)),c.promise}e.isDefined(s.template)&&(e.isUndefined(s.files)&&(s.files=[]),e.isString(s.template)?s.files.push(s.template):e.isArray(s.template)&&s.files.concat(s.template));var h=e.extend({},d,s);return e.isUndefined(s.files)&&e.isDefined(s.name)&&n.moduleExists(s.name)?n.inject(s.name,h,!0):(n.filesLoader(s,h).then(function(){n.inject(null,h).then(function(e){c.resolve(e)},function(e){c.reject(e)})},function(e){c.reject(e)}),c.promise)},n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.cssLoader=function(o,t,i){var a=[];e.forEach(o,function(e){a.push(n.buildElement("css",e,i))}),r.all(a).then(function(){t()},function(e){t(e)})},n.cssLoader.ocLazyLoadLoader=!0,n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$q",function(n,r){return n.jsLoader=function(o,t,i){var a=[];e.forEach(o,function(e){a.push(n.buildElement("js",e,i))}),r.all(a).then(function(){t()},function(e){t(e)})},n.jsLoader.ocLazyLoadLoader=!0,n}])}])}(angular),function(e){"use strict";e.module("oc.lazyLoad").config(["$provide",function(n){n.decorator("$ocLazyLoad",["$delegate","$templateCache","$q","$http",function(n,r,o,t){return n.templatesLoader=function(i,a,s){var u=[],c=n._getFilesCache();return e.forEach(i,function(n){var i=o.defer();u.push(i.promise),t.get(n,s).success(function(o){e.isString(o)&&o.length>0&&e.forEach(e.element(o),function(e){"SCRIPT"===e.nodeName&&"text/ng-template"===e.type&&r.put(e.id,e.innerHTML)}),e.isUndefined(c.get(n))&&c.put(n,!0),i.resolve()}).error(function(e){i.reject(new Error('Unable to load template file "'+n+'": '+e))})}),o.all(u).then(function(){a()},function(e){a(e)})},n.templatesLoader.ocLazyLoadLoader=!0,n}])}])}(angular),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,n){var r;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),t=o.length>>>0;if(0===t)return-1;var i=+n||0;if(Math.abs(i)===1/0&&(i=0),i>=t)return-1;for(r=Math.max(i>=0?i:t-Math.abs(i),0);t>r;){if(r in o&&o[r]===e)return r;r++}return-1}); -!function(){"use strict";function t(t,n){return{restrict:"EA",scope:{gmtOffset:"=gmtOffset",digitalFormat:"=digitalFormat",showDigital:"=showDigital",showAnalog:"=showAnalog",startTime:"=startTime",theme:"=theme"},template:'
    {{digital}}
    {{gmtInfo}}
    ',link:function(s,r,l){var g,m={},c=s.gmtOffset,f=s.digitalFormat?s.digitalFormat:"HH:mm:ss";m.showDigital=null!=s.showDigital?s.showDigital:void 0!==l.showDigital?!0:!1,m.showAnalog=null!=s.showAnalog?s.showAnalog:void 0!==l.showAnalog?!0:!1,m.showGmtInfo=void 0!==l.showGmtInfo?!0:!1,m.startTime=parseInt(s.startTime,10),s.themeClass=s.theme?s.theme:l.theme?l.theme:"light",m.showDigital||m.showAnalog||(m.showAnalog=!0,m.showDigital=!0),s.gmtInfo=!1,s.date=i(m),s.digital=m.showDigital?"Loading..":!1,s.analog=m.showAnalog,s.majors=new Array(12),s.minors=new Array(60);var h=null,d=function(){isNaN(m.startTime)||(m.startTime=m.startTime+1e3),h=i(m),s.date=h,m.showDigital&&(s.digital=o(h,f,c,n))};g=t(d,1e3),s.$watch("gmtOffset",function(t){c=t,m.gmtOffset=null!=c?a(c):!1,m.showGmtInfo&&m.gmtOffset!==!1&&(s.gmtInfo=e(m.gmtOffset)),d()}),s.$watch("digitalFormat",function(t,a){t!=a&&(f=t)}),s.$watch("showDigital",function(t,a){t!=a&&(m.showDigital=t,s.digital=m.showDigital?"Loading..":!1)}),s.$watch("showAnalog",function(t,a){t!=a&&(m.showAnalog=t,s.analog=t)}),s.$watch("theme",function(t,a){t!=a&&(s.themeClass=t?t:l.theme?l.theme:"light")}),r.on("$destroy",function(){t.cancel(g),g=null})}}}function a(t){t=parseFloat(t);var a=t>0?Math.floor(t):Math.ceil(t),e=t%1/.6;return a+e}function e(t){var a=t>0?Math.floor(t):Math.ceil(t),e=Math.round((t>0?t:-1*t)%1*60);return"GMT"+(0===t?"":(t>0?" +":" ")+n(a)+"."+s(e).substring(0,2))}function n(t){return 0>t?(t>-10?"-0":"-")+-1*t:(10>t?"0":"")+t}function s(t){return t+(10>t?"0":"")}function i(t){var a=isNaN(t.startTime)?new Date:new Date(t.startTime);if(null!==t.gmtOffset&&t.gmtOffset!==!1){var e=a.getTime()+6e4*a.getTimezoneOffset(),n=new Date(e+36e5*t.gmtOffset);return{hrs:n.getHours(),mins:n.getMinutes(),secs:n.getSeconds(),date:n}}return{hrs:a.getHours(),mins:a.getMinutes(),secs:a.getSeconds(),date:a}}function o(t,a,e,n){return n("date")(t.date,a,e)}angular.module("ds.clock",[]).directive("dsWidgetClock",["$interval","$filter",function(a,e){return t(a,e)}])}(); +!function(){"use strict";function t(t,s){return{restrict:"EA",scope:{gmtOffset:"=gmtOffset",digitalFormat:"=digitalFormat",showDigital:"=showDigital",showAnalog:"=showAnalog",startTime:"=startTime",theme:"=theme",majorsTotal:"=majorsTotal"},template:'
    {{digital}}
    {{gmtInfo}}
    ',link:function(n,r,l){var g,m={},c=n.gmtOffset,f=n.digitalFormat?n.digitalFormat:"HH:mm:ss";m.showDigital=null!=n.showDigital?n.showDigital:void 0!==l.showDigital?!0:!1,m.showAnalog=null!=n.showAnalog?n.showAnalog:void 0!==l.showAnalog?!0:!1,m.showGmtInfo=void 0!==l.showGmtInfo?!0:!1,m.startTime=parseInt(n.startTime,10),n.themeClass=n.theme?n.theme:l.theme?l.theme:"light",m.showDigital||m.showAnalog||(m.showAnalog=!0,m.showDigital=!0),n.gmtInfo=!1,n.date=i(m),n.digital=m.showDigital?"Loading..":!1,n.analog=m.showAnalog,n.majors=l.majorsTotal?new Array(parseInt(l.majorsTotal)):new Array(12),n.minors=new Array(60);var h=null,d=function(){isNaN(m.startTime)||(m.startTime=m.startTime+1e3),h=i(m),n.date=h,m.showDigital&&(n.digital=o(h,f,s))};g=t(d,1e3),n.$watch("gmtOffset",function(t){c=t,m.gmtOffset=null!=c?a(c):!1,m.showGmtInfo&&m.gmtOffset!==!1&&(n.gmtInfo=e(m.gmtOffset)),d()}),n.$watch("digitalFormat",function(t,a){t!=a&&(f=t)}),n.$watch("startTime",function(t,a){t!=a&&(m.startTime=parseInt(t,10))}),n.$watch("showDigital",function(t,a){t!=a&&(m.showDigital=t,n.digital=m.showDigital?"Loading..":!1)}),n.$watch("showAnalog",function(t,a){t!=a&&(m.showAnalog=t,n.analog=t)}),n.$watch("theme",function(t,a){t!=a&&(n.themeClass=t?t:l.theme?l.theme:"light")}),r.on("$destroy",function(){t.cancel(g),g=null})}}}function a(t){t=parseFloat(t);var a=t>0?Math.floor(t):Math.ceil(t),e=t%1/.6;return a+e}function e(t){var a=t>0?Math.floor(t):Math.ceil(t),e=Math.round((t>0?t:-1*t)%1*60);return"GMT"+(0===t?"":(t>0?" +":" ")+s(a)+"."+n(e).substring(0,2))}function s(t){return 0>t?(t>-10?"-0":"-")+-1*t:(10>t?"0":"")+t}function n(t){return t+(10>t?"0":"")}function i(t){var a=isNaN(t.startTime)?new Date:new Date(t.startTime);if(null!==t.gmtOffset&&t.gmtOffset!==!1){var e=a.getTime()+6e4*a.getTimezoneOffset(),s=new Date(e+36e5*t.gmtOffset);return{hrs:s.getHours(),mins:s.getMinutes(),secs:s.getSeconds(),date:s}}return{hrs:a.getHours(),mins:a.getMinutes(),secs:a.getSeconds(),date:a}}function o(t,a,e){return e("date")(t.date,a)}angular.module("ds.clock",[]).directive("dsWidgetClock",["$interval","$filter",function(a,e){return t(a,e)}])}(); //# sourceMappingURL=angular-clock.min.js.map + /*! * ui-select * http://github.com/angular-ui/ui-select @@ -687,15 +688,8 @@ return angular.module('angular-clipboard', []) */ (function(c,b){var a=a||function(k){var f={element:null,dragger:null,disable:"none",addBodyClasses:true,hyperextensible:true,resistance:0.5,flickThreshold:50,transitionSpeed:0.3,easing:"ease",maxPosition:266,minPosition:-266,tapToClose:true,touchToDrag:true,slideIntent:40,minDragDistance:5},e={simpleStates:{opening:null,towards:null,hyperExtending:null,halfway:null,flick:null,translation:{absolute:0,relative:0,sinceDirectionChange:0,percentage:0}}},h={},d={hasTouch:(b.ontouchstart===null),eventType:function(m){var l={down:(d.hasTouch?"touchstart":"mousedown"),move:(d.hasTouch?"touchmove":"mousemove"),up:(d.hasTouch?"touchend":"mouseup"),out:(d.hasTouch?"touchcancel":"mouseout")};return l[m]},page:function(l,m){return(d.hasTouch&&m.touches.length&&m.touches[0])?m.touches[0]["page"+l]:m["page"+l]},klass:{has:function(m,l){return(m.className).indexOf(l)!==-1},add:function(m,l){if(!d.klass.has(m,l)&&f.addBodyClasses){m.className+=" "+l}},remove:function(m,l){if(f.addBodyClasses){m.className=(m.className).replace(l,"").replace(/^\s+|\s+$/g,"")}}},dispatchEvent:function(l){if(typeof h[l]==="function"){return h[l].call()}},vendor:function(){var m=b.createElement("div"),n="webkit Moz O ms".split(" "),l;for(l in n){if(typeof m.style[n[l]+"Transition"]!=="undefined"){return n[l]}}},transitionCallback:function(){return(e.vendor==="Moz"||e.vendor==="ms")?"transitionend":e.vendor+"TransitionEnd"},canTransform:function(){return typeof f.element.style[e.vendor+"Transform"]!=="undefined"},deepExtend:function(l,n){var m;for(m in n){if(n[m]&&n[m].constructor&&n[m].constructor===Object){l[m]=l[m]||{};d.deepExtend(l[m],n[m])}else{l[m]=n[m]}}return l},angleOfDrag:function(l,o){var n,m;m=Math.atan2(-(e.startDragY-o),(e.startDragX-l));if(m<0){m+=2*Math.PI}n=Math.floor(m*(180/Math.PI)-180);if(n<0&&n>-180){n=360-Math.abs(n)}return Math.abs(n)},events:{addEvent:function g(m,l,n){if(m.addEventListener){return m.addEventListener(l,n,false)}else{if(m.attachEvent){return m.attachEvent("on"+l,n)}}},removeEvent:function g(m,l,n){if(m.addEventListener){return m.removeEventListener(l,n,false)}else{if(m.attachEvent){return m.detachEvent("on"+l,n)}}},prevent:function(l){if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}}},parentUntil:function(n,l){var m=typeof l==="string";while(n.parentNode){if(m&&n.getAttribute&&n.getAttribute(l)){return n}else{if(!m&&n===l){return n}}n=n.parentNode}return null}},i={translate:{get:{matrix:function(n){if(!d.canTransform()){return parseInt(f.element.style.left,10)}else{var m=c.getComputedStyle(f.element)[e.vendor+"Transform"].match(/\((.*)\)/),l=8;if(m){m=m[1].split(",");if(m.length===16){n+=l}return parseInt(m[n],10)}return 0}}},easeCallback:function(){f.element.style[e.vendor+"Transition"]="";e.translation=i.translate.get.matrix(4);e.easing=false;clearInterval(e.animatingInterval);if(e.easingTo===0){d.klass.remove(b.body,"snapjs-right");d.klass.remove(b.body,"snapjs-left")}d.dispatchEvent("animated");d.events.removeEvent(f.element,d.transitionCallback(),i.translate.easeCallback)},easeTo:function(l){if(!d.canTransform()){e.translation=l;i.translate.x(l)}else{e.easing=true;e.easingTo=l;f.element.style[e.vendor+"Transition"]="all "+f.transitionSpeed+"s "+f.easing;e.animatingInterval=setInterval(function(){d.dispatchEvent("animating")},1);d.events.addEvent(f.element,d.transitionCallback(),i.translate.easeCallback);i.translate.x(l)}if(l===0){f.element.style[e.vendor+"Transform"]=""}},x:function(m){if((f.disable==="left"&&m>0)||(f.disable==="right"&&m<0)){return}if(!f.hyperextensible){if(m===f.maxPosition||m>f.maxPosition){m=f.maxPosition}else{if(m===f.minPosition||m0,q=n,w;if((e.intentChecked&&!e.hasIntent)){return}if(f.addBodyClasses){if((o)>0){d.klass.add(b.body,"snapjs-left");d.klass.remove(b.body,"snapjs-right")}else{if((o)<0){d.klass.add(b.body,"snapjs-right");d.klass.remove(b.body,"snapjs-left")}}}if(e.hasIntent===false||e.hasIntent===null){var m=d.angleOfDrag(v,u),l=(m>=0&&m<=f.slideIntent)||(m<=360&&m>(360-f.slideIntent)),r=(m>=180&&m<=(180+f.slideIntent))||(m<=180&&m>=(180-f.slideIntent));if(!r&&!l){e.hasIntent=false}else{e.hasIntent=true}e.intentChecked=true}if((f.minDragDistance>=Math.abs(v-e.startDragX))||(e.hasIntent===false)){return}d.events.prevent(s);d.dispatchEvent("drag");e.dragWatchers.current=v;if(e.dragWatchers.last>v){if(e.dragWatchers.state!=="left"){e.dragWatchers.state="left";e.dragWatchers.hold=v}e.dragWatchers.last=v}else{if(e.dragWatchers.last(f.maxPosition/2),flick:Math.abs(e.dragWatchers.current-e.dragWatchers.hold)>f.flickThreshold,translation:{absolute:o,relative:n,sinceDirectionChange:(e.dragWatchers.current-e.dragWatchers.hold),percentage:(o/f.maxPosition)*100}}}else{if(f.minPosition>o){w=(o-f.minPosition)*f.resistance;q=n-w}e.simpleStates={opening:"right",towards:e.dragWatchers.state,hyperExtending:f.minPosition>o,halfway:o<(f.minPosition/2),flick:Math.abs(e.dragWatchers.current-e.dragWatchers.hold)>f.flickThreshold,translation:{absolute:o,relative:n,sinceDirectionChange:(e.dragWatchers.current-e.dragWatchers.hold),percentage:(o/f.minPosition)*100}}}i.translate.x(q+t)}},endDrag:function(m){if(e.isDragging){d.dispatchEvent("end");var l=i.translate.get.matrix(4);if(e.dragWatchers.current===0&&l!==0&&f.tapToClose){d.dispatchEvent("close");d.events.prevent(m);i.translate.easeTo(0);e.isDragging=false;e.startDragX=0;return}if(e.simpleStates.opening==="left"){if((e.simpleStates.halfway||e.simpleStates.hyperExtending||e.simpleStates.flick)){if(e.simpleStates.flick&&e.simpleStates.towards==="left"){i.translate.easeTo(0)}else{if((e.simpleStates.flick&&e.simpleStates.towards==="right")||(e.simpleStates.halfway||e.simpleStates.hyperExtending)){i.translate.easeTo(f.maxPosition)}}}else{i.translate.easeTo(0)}}else{if(e.simpleStates.opening==="right"){if((e.simpleStates.halfway||e.simpleStates.hyperExtending||e.simpleStates.flick)){if(e.simpleStates.flick&&e.simpleStates.towards==="right"){i.translate.easeTo(0)}else{if((e.simpleStates.flick&&e.simpleStates.towards==="left")||(e.simpleStates.halfway||e.simpleStates.hyperExtending)){i.translate.easeTo(f.minPosition)}}}else{i.translate.easeTo(0)}}}e.isDragging=false;e.startDragX=d.page("X",m)}}}},j=function(l){if(l.element){d.deepExtend(f,l);e.vendor=d.vendor();i.drag.listen()}};this.open=function(l){d.dispatchEvent("open");d.klass.remove(b.body,"snapjs-expand-left");d.klass.remove(b.body,"snapjs-expand-right");if(l==="left"){e.simpleStates.opening="left";e.simpleStates.towards="right";d.klass.add(b.body,"snapjs-left");d.klass.remove(b.body,"snapjs-right");i.translate.easeTo(f.maxPosition)}else{if(l==="right"){e.simpleStates.opening="right";e.simpleStates.towards="left";d.klass.remove(b.body,"snapjs-left");d.klass.add(b.body,"snapjs-right");i.translate.easeTo(f.minPosition)}}};this.close=function(){d.dispatchEvent("close");i.translate.easeTo(0)};this.expand=function(l){var m=c.innerWidth||b.documentElement.clientWidth;if(l==="left"){d.dispatchEvent("expandLeft");d.klass.add(b.body,"snapjs-expand-left");d.klass.remove(b.body,"snapjs-expand-right")}else{d.dispatchEvent("expandRight");d.klass.add(b.body,"snapjs-expand-right");d.klass.remove(b.body,"snapjs-expand-left");m*=-1}i.translate.easeTo(m)};this.on=function(l,m){h[l]=m;return this};this.off=function(l){if(h[l]){h[l]=false}};this.enable=function(){d.dispatchEvent("enable");i.drag.listen()};this.disable=function(){d.dispatchEvent("disable");i.drag.stopListening()};this.settings=function(l){d.deepExtend(f,l)};this.state=function(){var l,m=i.translate.get.matrix(4);if(m===f.maxPosition){l="left"}else{if(m===f.minPosition){l="right"}else{l="closed"}}return{state:l,info:e.simpleStates}};j(k)};if((typeof module!=="undefined")&&module.exports){module.exports=a}if(typeof ender==="undefined"){this.Snap=a}if((typeof define==="function")&&define.amd){define("snap",[],function(){return a})}}).call(this,window,document); -angular.module("snap",[]),function(){"use strict";var a=[1,8,5],b={full:a.join("."),major:a[0],minor:a[1],patch:a[2]};angular.module("snap").constant("SNAP_VERSION",b)}(),angular.module("snap").directive("snapClose",["$rootScope","snapRemote",function(a,b){"use strict";return{restrict:"A",link:function(c,d,e){d.bind("click",function(){b.close(c.$eval(e.snapId)),a.$digest()})}}}]),angular.module("snap").directive("snapContent",["SnapConstructor","snapRemote",function(a,b){"use strict";return{restrict:"AE",link:function(c,d,e){d.addClass("snap-content");var f=e.snapId;f&&(f=c.$eval(e.snapId));var g=angular.extend({},b.globalOptions),h=function(a,d){c.$watch(function(){return c.$eval(a)},function(a,c){angular.isDefined(c)&&a!==c&&b.getSnapper(f).then(function(b){var c={};c[d]=a,b.settings(c)})})};angular.forEach(e,function(a,b){0===b.indexOf("snapOpt")&&(b=b.substring(7),b.length&&(b=b[0].toLowerCase()+b.substring(1),g[b]=c.$eval(a),h(a,b)))}),g.element=d[0],angular.isDefined(e.snapOptions)&&e.snapOptions&&angular.extend(g,c.$eval(e.snapOptions)),b.register(new a(g),f),angular.isDefined(e.snapOptions)&&e.snapOptions&&c.$watch(e.snapOptions,function(a){b.getSnapper(f).then(function(b){b.settings(a)})},!0),c.$on("$destroy",function(){b.unregister(f)})}}}]),angular.module("snap").directive("snapDragger",["snapRemote",function(a){"use strict";return{restrict:"AE",link:function(b,c,d){var e=b.$eval(d.snapId);a.getSnapper(e).then(function(a){a.settings({dragger:c[0]})})}}}]),angular.module("snap").directive("snapDrawer",function(){"use strict";return{restrict:"AE",link:function(a,b,c){b.addClass("snap-drawer");var d=b.parent(),e=!0;for("right"===c.snapDrawer?b.addClass("snap-drawer-right"):b.addClass("snap-drawer-left");d.length;)d.hasClass("snap-drawers")&&(e=!1),d=d.parent();e&&b.wrap('
    ')}}}),angular.module("snap").directive("snapDrawers",function(){"use strict";return{restrict:"AE",compile:function(a,b){a.addClass("snap-drawers")}}}),angular.module("snap").directive("snapToggle",["$rootScope","snapRemote",function(a,b){"use strict";return{restrict:"A",link:function(c,d,e){var f=e.snapId,g=e.snapToggle||"left";if(f&&(f=c.$eval(f)),!e.snapUnsafe){var h=!1;d.bind("mousedown",function(a){h=!0,a.stopImmediatePropagation()}),d.bind("mouseup",function(a){h&&a.stopImmediatePropagation(),h=!1})}d.bind("click",function(){b.toggle(g,f),a.$digest()})}}}]),angular.module("snap").provider("SnapConstructor",function(){"use strict";var a;this.use=function(b){a=b},this.$get=["$window",function(b){var c=a||b.Snap;if(angular.isUndefined(c))throw new Error("Snap constructor is not defined. Make sure window.Snap is defined or supply your own with SnapConstructorProvider.use(MySnap).");return c}]}),angular.module("snap").provider("snapRemote",function(){"use strict";var a=this;return this.globalOptions={},this.$get=["$q",function(b){var c,d,e={},f="__DEFAULT_SNAPPER_ID__",g={};return g.globalOptions=a.globalOptions,g.getSnapper=function(a){return a=a||f,e.hasOwnProperty(a)||c(a),e[a].deferred.promise},g.register=function(a,b){b=b||f,e.hasOwnProperty(b)||c(b),e[b].isResolved&&c(b),d(a,b)},g.unregister=function(a){a=a||f,e.hasOwnProperty(a)&&delete e[a]},g.toggle=function(a,b){b=b||f,g.getSnapper(b).then(function(c){a===c.state().state?g.close(b):g.open(a,b)})},g.open=function(a,b){b=b||f,g.getSnapper(b).then(function(b){b.open(a)})},g.close=function(a){a=a||f,g.getSnapper(a).then(function(a){a.close()})},g.expand=function(a,b){b=b||f,g.getSnapper(b).then(function(b){b.expand(a)})},g.enable=function(a){a=a||f,g.getSnapper(a).then(function(a){a.enable()})},g.disable=function(a){a=a||f,g.getSnapper(a).then(function(a){a.disable()})},c=function(a){e[a]={deferred:b.defer(),isResolved:!1}},d=function(a,b){e[b].deferred.resolve(a),e[b].isResolved=!0},g}],this}); -/** @license - * eventsource.js - * Available under MIT License (MIT) - * https://github.com/Yaffle/EventSource/ - */ -!function(a){"use strict";function b(a,b,d,e,f){this._internal=new c(a,b,d,e,f)}function c(a,b,c,d,e){this.onStartCallback=b,this.onProgressCallback=c,this.onFinishCallback=d,this.thisArg=e,this.xhr=a,this.state=0,this.charOffset=0,this.offset=0,this.url="",this.withCredentials=!1,this.timeout=0}function d(){this._data={}}function e(){this._listeners=new d}function f(a){l(function(){throw a},0)}function g(a){this.type=a,this.target=void 0}function h(a,b){g.call(this,a),this.data=b.data,this.lastEventId=b.lastEventId}function i(a,b){e.call(this),this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url="",this.readyState=t,this.withCredentials=!1,this._internal=new j(this,a,b)}function j(a,c,d){this.url=c.toString(),this.readyState=t,this.withCredentials=q&&void 0!=d&&Boolean(d.withCredentials),this.es=a,this.initialRetry=E(1e3,0),this.heartbeatTimeout=E(45e3,0),this.lastEventId="",this.retry=this.initialRetry,this.wasActivity=!1;var e=void 0!=d&&void 0!=d.Transport?d.Transport:r,f=new e;this.transport=new b(f,this.onStart,this.onProgress,this.onFinish,this),this.timeout=0,this.currentState=s,this.dataBuffer=[],this.lastEventIdBuffer="",this.eventTypeBuffer="",this.state=x,this.fieldStart=0,this.valueStart=0,this.es.url=this.url,this.es.readyState=this.readyState,this.es.withCredentials=this.withCredentials,this.onTimeout()}function k(){this.CONNECTING=t,this.OPEN=u,this.CLOSED=v}var l=a.setTimeout,m=a.clearTimeout,n=function(){};b.prototype.open=function(a,b){this._internal.open(a,b)},b.prototype.cancel=function(){this._internal.cancel()},c.prototype.onStart=function(){if(1===this.state){this.state=2;var a=0,b="",c=void 0;if("contentType"in this.xhr)a=200,b="OK",c=this.xhr.contentType;else try{a=this.xhr.status,b=this.xhr.statusText,c=this.xhr.getResponseHeader("Content-Type")}catch(d){a=0,b="",c=void 0}void 0==c&&(c=""),this.onStartCallback.call(this.thisArg,a,b,c)}},c.prototype.onProgress=function(){if(this.onStart(),2===this.state||3===this.state){this.state=3;var a="";try{a=this.xhr.responseText}catch(b){}for(var c=this.charOffset,d=a.length,e=this.offset;d>e;e+=1){var f=a.charCodeAt(e);(f==="\n".charCodeAt(0)||f==="\r".charCodeAt(0))&&(this.charOffset=e+1)}this.offset=d;var g=a.slice(c,this.charOffset);this.onProgressCallback.call(this.thisArg,g)}},c.prototype.onFinish=function(){this.onProgress(),3===this.state&&(this.state=4,0!==this.timeout&&(m(this.timeout),this.timeout=0),this.onFinishCallback.call(this.thisArg))},c.prototype.onReadyStateChange=function(){void 0!=this.xhr&&(4===this.xhr.readyState?0===this.xhr.status?this.onFinish():this.onFinish():3===this.xhr.readyState?this.onProgress():2===this.xhr.readyState)},c.prototype.onTimeout2=function(){this.timeout=0;var b=/^data\:([^,]*?)(base64)?,([\S]*)$/.exec(this.url),c=b[1],d="base64"===b[2]?a.atob(b[3]):decodeURIComponent(b[3]);1===this.state&&(this.state=2,this.onStartCallback.call(this.thisArg,200,"OK",c)),(2===this.state||3===this.state)&&(this.state=3,this.onProgressCallback.call(this.thisArg,d)),3===this.state&&(this.state=4,this.onFinishCallback.call(this.thisArg))},c.prototype.onTimeout1=function(){this.timeout=0,this.open(this.url,this.withCredentials)},c.prototype.onTimeout0=function(){var a=this;this.timeout=l(function(){a.onTimeout0()},500),3===this.xhr.readyState&&this.onProgress()},c.prototype.handleEvent=function(a){"load"===a.type?this.onFinish():"error"===a.type?this.onFinish():"abort"===a.type?this.onFinish():"progress"===a.type?this.onProgress():"readystatechange"===a.type&&this.onReadyStateChange()},c.prototype.open=function(b,c){0!==this.timeout&&(m(this.timeout),this.timeout=0),this.url=b,this.withCredentials=c,this.state=1,this.charOffset=0,this.offset=0;var d=this,e=/^data\:([^,]*?)(?:;base64)?,[\S]*$/.exec(b);if(void 0!=e)return void(this.timeout=l(function(){d.onTimeout2()},0));if((!("ontimeout"in this.xhr)||"sendAsBinary"in this.xhr||"mozAnon"in this.xhr)&&void 0!=a.document&&void 0!=a.document.readyState&&"complete"!==a.document.readyState)return void(this.timeout=l(function(){d.onTimeout1()},4));this.xhr.onload=function(a){d.handleEvent({type:"load"})},this.xhr.onerror=function(){d.handleEvent({type:"error"})},this.xhr.onabort=function(){d.handleEvent({type:"abort"})},this.xhr.onprogress=function(){d.handleEvent({type:"progress"})},this.xhr.onreadystatechange=function(){d.handleEvent({type:"readystatechange"})},this.xhr.open("GET",b,!0),this.xhr.withCredentials=c,this.xhr.responseType="text","setRequestHeader"in this.xhr&&this.xhr.setRequestHeader("Accept","text/event-stream");try{this.xhr.send(void 0)}catch(f){throw f}"readyState"in this.xhr&&void 0!=a.opera&&(this.timeout=l(function(){d.onTimeout0()},0))},c.prototype.cancel=function(){0!==this.state&&4!==this.state&&(this.state=4,this.xhr.onload=n,this.xhr.onerror=n,this.xhr.onabort=n,this.xhr.onprogress=n,this.xhr.onreadystatechange=n,this.xhr.abort(),0!==this.timeout&&(m(this.timeout),this.timeout=0),this.onFinishCallback.call(this.thisArg)),this.state=0},d.prototype.get=function(a){return this._data[a+"~"]},d.prototype.set=function(a,b){this._data[a+"~"]=b},d.prototype["delete"]=function(a){delete this._data[a+"~"]},e.prototype.dispatchEvent=function(a){a.target=this;var b=a.type.toString(),c=this._listeners,d=c.get(b);if(void 0!=d)for(var e=d.length,g=void 0,h=0;e>h;h+=1){g=d[h];try{"function"==typeof g.handleEvent?g.handleEvent(a):g.call(this,a)}catch(i){f(i)}}},e.prototype.addEventListener=function(a,b){a=a.toString();var c=this._listeners,d=c.get(a);void 0==d&&(d=[],c.set(a,d));for(var e=d.length;e>=0;e-=1)if(d[e]===b)return;d.push(b)},e.prototype.removeEventListener=function(a,b){a=a.toString();var c=this._listeners,d=c.get(a);if(void 0!=d){for(var e=d.length,f=[],g=0;e>g;g+=1)d[g]!==b&&f.push(d[g]);0===f.length?c["delete"](a):c.set(a,f)}},h.prototype=g.prototype;var o=a.XMLHttpRequest,p=a.XDomainRequest,q=void 0!=o&&void 0!=(new o).withCredentials,r=q||void 0!=o&&void 0==p?o:p,s=-1,t=0,u=1,v=2,w=3,x=4,y=5,z=6,A=7,B=/^text\/event\-stream;?(\s*charset\=utf\-8)?$/i,C=1e3,D=18e6,E=function(a,b){var c=a;return c!==c&&(c=b),C>c?C:c>D?D:c},F=function(a,b,c){try{"function"==typeof b&&b.call(a,c)}catch(d){f(d)}};j.prototype.onStart=function(a,b,c){if(this.currentState===t)if(void 0==c&&(c=""),200===a&&B.test(c)){this.currentState=u,this.wasActivity=!0,this.retry=this.initialRetry,this.readyState=u,this.es.readyState=u;var d=new g("open");this.es.dispatchEvent(d),F(this.es,this.es.onopen,d)}else if(0!==a){var e="";e=200!==a?"EventSource's response has a status "+a+" "+b.replace(/\s+/g," ")+" that is not 200. Aborting the connection.":"EventSource's response has a Content-Type specifying an unsupported type: "+c.replace(/\s+/g," ")+". Aborting the connection.",f(new Error(e)),this.close();var d=new g("error");this.es.dispatchEvent(d),F(this.es,this.es.onerror,d)}},j.prototype.onProgress=function(a){if(this.currentState===u){var b=a.length;0!==b&&(this.wasActivity=!0);for(var c=0;b>c;c+=1){var d=a.charCodeAt(c);if(this.state===w&&d==="\n".charCodeAt(0))this.state=x;else if(this.state===w&&(this.state=x),d==="\r".charCodeAt(0)||d==="\n".charCodeAt(0)){if(this.state!==x){this.state===y&&(this.valueStart=c+1);var e=a.slice(this.fieldStart,this.valueStart-1),f=a.slice(this.valueStart+(this.valueStart16*this.initialRetry&&(this.retry=16*this.initialRetry),this.retry>D&&(this.retry=D);var a=this;this.timeout=l(function(){a.onTimeout()},this.retry),this.retry=2*this.retry+1,this.readyState=t,this.es.readyState=t;var b=new g("error");this.es.dispatchEvent(b),F(this.es,this.es.onerror,b)}},j.prototype.onTimeout=function(){if(this.timeout=0,this.currentState===s){this.wasActivity=!1;var a=this;this.timeout=l(function(){a.onTimeout()},this.heartbeatTimeout),this.currentState=t,this.dataBuffer.length=0,this.eventTypeBuffer="",this.lastEventIdBuffer=this.lastEventId,this.fieldStart=0,this.valueStart=0,this.state=x;var b=this.url.slice(0,5);b="data:"!==b&&"blob:"!==b?this.url+((-1===this.url.indexOf("?",0)?"?":"&")+"lastEventId="+encodeURIComponent(this.lastEventId)+"&r="+(Math.random()+1).toString().slice(2)):this.url;try{this.transport.open(b,this.withCredentials)}catch(c){throw this.close(),c}}else if(this.wasActivity){this.wasActivity=!1;var a=this;this.timeout=l(function(){a.onTimeout()},this.heartbeatTimeout)}else f(new Error("No activity within "+this.heartbeatTimeout+" milliseconds. Reconnecting.")),this.transport.cancel()},j.prototype.close=function(){this.currentState=v,this.transport.cancel(),0!==this.timeout&&(m(this.timeout),this.timeout=0),this.readyState=v,this.es.readyState=v},k.prototype=e.prototype,i.prototype=new k,i.prototype.close=function(){this._internal.close()},k.call(i),q&&(i.prototype.withCredentials=void 0);var G=function(){return void 0!=a.EventSource&&"withCredentials"in a.EventSource.prototype};void 0!=r&&(void 0==a.EventSource||q&&!G())&&(a.NativeEventSource=a.EventSource,a.EventSource=i)}("undefined"!=typeof window?window:this); - -!function(){d3.timeline=function(){function t(t){function n(t,n){return _.left+(t.starting_time-w)*W}function c(t,n){return _.left+(t.starting_time-w)*W+5}function l(){if(g||V.attr("height"))g?V.attr("height",g):g=V.attr("height");else{if(!A)throw"height of the timeline is not set";g=nt.height+nt.top-S.top,d3.select(t[0][0]).attr("height",g)}}function u(){if(f||S.width){if(!f||!S.width)try{f=V.attr("width")}catch(t){console.log(t)}}else try{if(f=V.attr("width"),!f)throw"width of the timeline is not set. As of Firefox 27, timeline().with(x) needs to be explicitly set in order to render"}catch(t){console.log(t)}}function v(n,e){t.append("svg:line").attr("x1",n).attr("y1",e.marginTop).attr("x2",n).attr("y2",g-e.marginBottom).style("stroke",e.color).style("stroke-width",e.width)}var B=t.append("g"),S=t[0][0].getBoundingClientRect(),V=d3.select(t[0][0]),L={},R=1,j=0,D=0;u(),F&&B.each(function(t,n){t.forEach(function(t,n){t.times.forEach(function(t,e){0===n&&0===e?(originTime=t.starting_time,t.starting_time=0,t.ending_time=t.ending_time-originTime):(t.starting_time=t.starting_time-originTime,t.ending_time=t.ending_time-originTime)})})}),(T||0===y||0===w)&&(B.each(function(t,n){t.forEach(function(t,n){T&&Object.keys(L).indexOf(n)==-1&&(L[n]=R,R++),t.times.forEach(function(t,n){0===w&&(t.starting_timeD&&(D=t.ending_time)})})}),0===y&&(y=D),0===w&&(w=j));var W=1/(y-w)*(f-_.left-_.right),q=d3.time.scale().domain([w,y]).range([_.left,f-_.right]),G=d3.svg.axis().scale(q).orient(s).tickFormat(m.format).tickSize(m.tickSize);null!=m.tickValues?G.tickValues(m.tickValues):G.ticks(m.numTicks||m.tickTime,m.tickInterval),B.each(function(o,l){N=o,o.forEach(function(o,l){function u(t,n){return T?_.top+(A+E)*L[l]:_.top}function s(t,n){return T?_.top+(A+E)*L[l]+.75*A:_.top+.75*A}var g=o.times,m="undefined"!=typeof o.label;if("undefined"!=typeof o.id&&console.warn("d3Timeline Warning: Ids per dataset is deprecated in favor of a 'class' key. Ids are now per data element."),d&&K(L,l,B,g,o),B.selectAll("svg").data(g).enter().append(function(t,n){return document.createElementNS(d3.ns.prefix.svg,"display"in t?t.display:k)}).attr("x",n).attr("y",u).attr("width",function(t,n){return(t.ending_time-t.starting_time)*W}).attr("cy",function(t,n){return u(t,n)+A/2}).attr("cx",n).attr("r",A/2).attr("height",A).style("fill",function(t,n){var e;return t.color?t.color:x?(e=t[x],p(e?e:o[x])):p(l)}).on("mousemove",function(t,n){e(t,l,o)}).on("mouseover",function(t,n){r(t,n,o)}).on("mouseout",function(t,n){i(t,n,o)}).on("click",function(t,n){a(t,l,o)}).attr("class",function(t,n){return o.class?"timelineSeries_"+o.class:"timelineSeries_"+l}).attr("id",function(t,n){return o.id&&!t.id?"timelineItem_"+o.id:t.id?t.id:"timelineItem_"+l+"_"+n}),B.selectAll("svg").data(g).enter().append("text").attr("x",c).attr("y",s).text(function(t){return t.label}),h){var w=A+E/2+_.top+(A+E)*L[l];t.append("svg:line").attr("class","row-separator").attr("x1",0+_.left).attr("x2",f-_.right).attr("y1",w).attr("y2",w).attr("stroke-width",1).attr("stroke",h)}m&&Q(t,L,l,m,o),"undefined"!=typeof o.icon&&t.append("image").attr("class","timeline-label").attr("transform","translate(0,"+(_.top+(A+E)*L[l])+")").attr("xlink:href",o.icon).attr("width",_.left).attr("height",A)})});var U=_.top+(A+E)*R,X=_.top,Z=Y?X:U;if(I&&P(B,G,Z),M&&J(B,G,R),f>S.width){var $=function(){var t=Math.min(0,Math.max(S.width-f,d3.event.translate[0]));tt.translate([t,0]),B.attr("transform","translate("+t+",0)"),o(t*W,q)},tt=d3.behavior.zoom().x(q).on("zoom",$);t.attr("class","scrollable").call(tt)}b&&B.selectAll(".tick text").attr("transform",function(t){return"rotate("+b+")translate("+(this.getBBox().width/2+10)+","+this.getBBox().height/2+")"});var nt=B[0][0].getBoundingClientRect();if(l(),O&&B.each(function(t,n){t.forEach(function(t){var n=t.times;n.forEach(function(t){v(q(t.starting_time),H),v(q(t.ending_time),H)})})}),z){var et=q(new Date);v(et,C)}}var n=["circle","rect"],e=function(){},r=function(){},i=function(){},a=function(){},o=function(){},c=function(t){return t},l=function(){},u=function(){},s="bottom",f=null,g=null,h=null,d=null,m={format:d3.time.format("%I %p"),tickTime:d3.time.hours,tickInterval:1,tickSize:6,tickValues:null},p=d3.scale.category20(),x=null,k="rect",w=0,v=0,y=0,_={left:30,right:30,top:30,bottom:30},T=!1,b=!1,F=!1,B=!1,A=20,E=5,S=60,I=!0,Y=!1,z=!1,M=!1,V={stroke:"stroke-dasharray",spacing:"4 10"},C={marginTop:25,marginBottom:0,width:1,color:p},O=!1,H={marginTop:25,marginBottom:0,width:1,color:p},L=!1,R=!1,j=!1,D="white",N={},P=function(t,n,e){L&&G(t,0,0),R&&q(t);t.append("g").attr("class","axis").attr("transform","translate(0,"+e+")").call(n)},W=function(t){var n=w.getFullYear();w.getFullYear()!=y.getFullYear()&&(n=w.getFullYear()+"-"+y.getFullYear()),t.append("text").attr("transform","translate(20, 0)").attr("x",0).attr("y",14).attr("class","calendarYear").text(n)},q=function(t){var n=6,e=_.left-S,r=(f-_.left)/n,i=f-_.right-r+S,a=t.append("g").attr("class","axis").attr("transform","translate(0, 20)");j&&W(a),a.append("text").attr("transform","translate("+e+", 0)").attr("x",0).attr("y",14).attr("class","chevron").text("<").on("click",function(){return l(w,N)}),a.append("text").attr("transform","translate("+i+", 0)").attr("x",0).attr("y",14).attr("class","chevron").text(">").on("click",function(){return u(y,N)})},G=function(t,n,e){t.insert("rect").attr("class","row-green-bar").attr("x",n).attr("width",f).attr("y",e).attr("height",A).attr("fill",D)},J=function(t,n,e){t.append("g").attr("class","axis").attr("transform","translate(0,"+(_.top+(A+E)*e)+")").attr(V.stroke,V.spacing).call(n.tickFormat("").tickSize(-(_.top+(A+E)*(e-1)+3),0,0))},K=function(t,n,e,r,i){var a=(A+E)*t[n]+_.top;e.selectAll("svg").data(r).enter().insert("rect").attr("class","row-green-bar").attr("x",B?0:_.left).attr("width",B?f:f-_.right-_.left).attr("y",a).attr("height",A).attr("fill",d instanceof Function?d(i,n):d)},Q=function(t,n,e,r,i){var o=A+E,l=_.top+o/2+o*(n[e]||1);t.append("text").attr("class","timeline-label").attr("transform","translate("+v+","+l+")").text(r?c(i.label):i.id).on("click",function(t,n){a(t,e,i)})};return t.margin=function(n){return arguments.length?(_=n,t):_},t.orient=function(n){return arguments.length?(s=n,t):s},t.itemHeight=function(n){return arguments.length?(A=n,t):A},t.itemMargin=function(n){return arguments.length?(E=n,t):E},t.navMargin=function(n){return arguments.length?(S=n,t):S},t.height=function(n){return arguments.length?(g=n,t):g},t.width=function(n){return arguments.length?(f=n,t):f},t.display=function(e){return arguments.length&&n.indexOf(e)!=-1?(k=e,t):k},t.labelFormat=function(n){return arguments.length?(c=n,t):c},t.tickFormat=function(n){return arguments.length?(m=n,t):m},t.hover=function(n){return arguments.length?(e=n,t):e},t.mouseover=function(n){return arguments.length?(r=n,t):r},t.mouseout=function(n){return arguments.length?(i=n,t):i},t.click=function(n){return arguments.length?(a=n,t):a},t.scroll=function(n){return arguments.length?(o=n,t):o},t.colors=function(n){return arguments.length?(p=n,t):p},t.beginning=function(n){return arguments.length?(w=n,t):w},t.ending=function(n){return arguments.length?(y=n,t):y},t.labelMargin=function(n){return arguments.length?(v=n,t):v},t.rotateTicks=function(n){return arguments.length?(b=n,t):b},t.stack=function(){return T=!T,t},t.relativeTime=function(){return F=!F,t},t.showBorderLine=function(){return O=!O,t},t.showBorderFormat=function(n){return arguments.length?(H=n,t):H},t.showToday=function(){return z=!z,t},t.showTodayFormat=function(n){return arguments.length?(C=n,t):C},t.colorProperty=function(n){return arguments.length?(x=n,t):x},t.rowSeparators=function(n){return arguments.length?(h=n,t):h},t.background=function(n){return arguments.length?(d=n,t):d},t.showTimeAxis=function(){return I=!I,t},t.showAxisTop=function(){return Y=!Y,t},t.showAxisCalendarYear=function(){return j=!j,t},t.showTimeAxisTick=function(){return M=!M,t},t.fullLengthBackgrounds=function(){return B=!B,t},t.showTimeAxisTickFormat=function(n){return arguments.length?(V=n,t):V},t.showAxisHeaderBackground=function(n){return L=!L,n&&(D=n),t},t.navigate=function(n,e){return arguments.length?(l=n,u=e,R=!R,t):[l,u]},t}}(); +angular.module("snap",[]),function(){"use strict";var a=[1,8,6],b={full:a.join("."),major:a[0],minor:a[1],patch:a[2]};angular.module("snap").constant("SNAP_VERSION",b)}(),angular.module("snap").directive("snapClose",["$rootScope","snapRemote",function(a,b){"use strict";return{restrict:"A",link:function(c,d,e){d.bind("click",function(){b.close(c.$eval(e.snapId)),a.$digest()})}}}]),angular.module("snap").directive("snapContent",["SnapConstructor","snapRemote",function(a,b){"use strict";return{restrict:"AE",link:function(c,d,e){d.addClass("snap-content");var f=e.snapId;f&&(f=c.$eval(e.snapId));var g=angular.extend({},b.globalOptions),h=function(a,d){c.$watch(function(){return c.$eval(a)},function(a,c){angular.isDefined(c)&&a!==c&&b.getSnapper(f).then(function(b){var c={};c[d]=a,b.settings(c)})})};angular.forEach(e,function(a,b){0===b.indexOf("snapOpt")&&(b=b.substring(7),b.length&&(b=b[0].toLowerCase()+b.substring(1),g[b]=c.$eval(a),h(a,b)))}),g.element=d[0],angular.isDefined(e.snapOptions)&&e.snapOptions&&angular.extend(g,c.$eval(e.snapOptions)),b.register(new a(g),f),angular.isDefined(e.snapOptions)&&e.snapOptions&&c.$watch(e.snapOptions,function(a){b.getSnapper(f).then(function(b){b.settings(a)})},!0),c.$on("$destroy",function(){b.unregister(f)})}}}]),angular.module("snap").directive("snapDragger",["snapRemote",function(a){"use strict";return{restrict:"AE",link:function(b,c,d){var e=b.$eval(d.snapId);a.getSnapper(e).then(function(a){a.settings({dragger:c[0]})})}}}]),angular.module("snap").directive("snapDrawer",function(){"use strict";return{restrict:"AE",link:function(a,b,c){b.addClass("snap-drawer");var d=b.parent(),e=!0;for("right"===c.snapDrawer?b.addClass("snap-drawer-right"):b.addClass("snap-drawer-left");d.length;)d.hasClass("snap-drawers")&&(e=!1),d=d.parent();e&&b.wrap('
    ')}}}),angular.module("snap").directive("snapDrawers",function(){"use strict";return{restrict:"AE",compile:function(a,b){a.addClass("snap-drawers")}}}),angular.module("snap").directive("snapToggle",["$rootScope","snapRemote",function(a,b){"use strict";return{restrict:"A",link:function(c,d,e){var f=e.snapId,g=e.snapToggle||"left";if(f&&(f=c.$eval(f)),!e.snapUnsafe){var h=!1;d.bind("mousedown",function(a){h=!0,a.stopImmediatePropagation()}),d.bind("mouseup",function(a){h&&a.stopImmediatePropagation(),h=!1})}d.bind("click",function(){b.toggle(g,f),a.$digest()})}}}]),angular.module("snap").provider("SnapConstructor",function(){"use strict";var a;this.use=function(b){a=b},this.$get=["$window",function(b){var c=a||b.Snap;if(angular.isUndefined(c))throw new Error("Snap constructor is not defined. Make sure window.Snap is defined or supply your own with SnapConstructorProvider.use(MySnap).");return c}]}),angular.module("snap").provider("snapRemote",function(){"use strict";var a=this;return this.globalOptions={},this.$get=["$q",function(b){var c,d,e={},f="__DEFAULT_SNAPPER_ID__",g={};return g.globalOptions=a.globalOptions,g.getSnapper=function(a){return a=a||f,e.hasOwnProperty(a)||c(a),e[a].deferred.promise},g.register=function(a,b){b=b||f,e.hasOwnProperty(b)||c(b),e[b].isResolved&&c(b),d(a,b)},g.unregister=function(a){a=a||f,e.hasOwnProperty(a)&&delete e[a]},g.toggle=function(a,b){b=b||f,g.getSnapper(b).then(function(c){a===c.state().state?g.close(b):g.open(a,b)})},g.open=function(a,b){b=b||f,g.getSnapper(b).then(function(b){b.open(a)})},g.close=function(a){a=a||f,g.getSnapper(a).then(function(a){a.close()})},g.expand=function(a,b){b=b||f,g.getSnapper(b).then(function(b){b.expand(a)})},g.enable=function(a){a=a||f,g.getSnapper(a).then(function(a){a.enable()})},g.disable=function(a){a=a||f,g.getSnapper(a).then(function(a){a.disable()})},c=function(a){e[a]={deferred:b.defer(),isResolved:!1}},d=function(a,b){e[b].deferred.resolve(a),e[b].isResolved=!0},g}],this}); +!function(){d3.timeline=function(){function t(t){function n(t,n){return _.left+(t.starting_time-w)*j}function c(t,n){return _.left+(t.starting_time-w)*j+5}function l(n,e){t.append("svg:line").attr("x1",n).attr("y1",e.marginTop).attr("x2",n).attr("y2",g-e.marginBottom).style("stroke",e.color).style("stroke-width",e.width)}var u=t.append("g"),v=t[0][0].getBoundingClientRect(),B=d3.select(t[0][0]),S={},V=1,L=0,R=0;!function(){if(f||v.width){if(!f||!v.width)try{f=B.attr("width")}catch(t){console.log(t)}}else try{if(!(f=B.attr("width")))throw"width of the timeline is not set. As of Firefox 27, timeline().with(x) needs to be explicitly set in order to render"}catch(t){console.log(t)}}(),F&&u.each(function(t,n){t.forEach(function(t,n){t.times.forEach(function(t,e){0===n&&0===e?(originTime=t.starting_time,t.starting_time=0,t.ending_time=t.ending_time-originTime):(t.starting_time=t.starting_time-originTime,t.ending_time=t.ending_time-originTime)})})}),(T||0===y||0===w)&&(u.each(function(t,n){t.forEach(function(t,n){T&&-1==Object.keys(S).indexOf(n)&&(S[n]=V,V++),t.times.forEach(function(t,n){0===w&&(t.starting_timeR&&(R=t.ending_time)})})}),0===y&&(y=R),0===w&&(w=L));var j=1/(y-w)*(f-_.left-_.right),D=d3.time.scale().domain([w,y]).range([_.left,f-_.right]),W=d3.svg.axis().scale(D).orient(s).tickFormat(d.format).tickSize(d.tickSize);null!=d.tickValues?W.tickValues(d.tickValues):W.ticks(d.numTicks||d.tickTime,d.tickInterval),u.each(function(o,l){N=o,o.forEach(function(o,l){function s(t,n){return T?_.top+(A+E)*S[l]:_.top}function g(t,n){return T?_.top+(A+E)*S[l]+.75*A:_.top+.75*A}var d=o.times,w=void 0!==o.label;if(void 0!==o.id&&console.warn("d3Timeline Warning: Ids per dataset is deprecated in favor of a 'class' key. Ids are now per data element."),m&&K(S,l,u,d,o),u.selectAll("svg").data(d).enter().append(function(t,n){return document.createElementNS(d3.ns.prefix.svg,"display"in t?t.display:k)}).attr("x",n).attr("y",s).attr("width",function(t,n){return(t.ending_time-t.starting_time)*j}).attr("cy",function(t,n){return s(t,n)+A/2}).attr("cx",n).attr("r",A/2).attr("height",A).style("fill",function(t,n){var e;return t.color?t.color:x?(e=t[x],p(e?e:o[x])):p(l)}).on("mousemove",function(t,n){e(t,l,o)}).on("mouseover",function(t,n){r(t,n,o)}).on("mouseout",function(t,n){i(t,n,o)}).on("click",function(t,n){a(t,l,o)}).attr("class",function(t,n){return o.class?"timelineSeries_"+o.class:"timelineSeries_"+l}).attr("id",function(t,n){return o.id&&!t.id?"timelineItem_"+o.id:t.id?t.id:"timelineItem_"+l+"_"+n}),u.selectAll("svg").data(d).enter().append("text").attr("x",c).attr("y",g).text(function(t){return t.label}),h){var v=A+E/2+_.top+(A+E)*S[l];t.append("svg:line").attr("class","row-separator").attr("x1",0+_.left).attr("x2",f-_.right).attr("y1",v).attr("y2",v).attr("stroke-width",1).attr("stroke",h)}w&&Q(t,S,l,w,o),void 0!==o.icon&&t.append("image").attr("class","timeline-label").attr("transform","translate(0,"+(_.top+(A+E)*S[l])+")").attr("xlink:href",o.icon).attr("width",_.left).attr("height",A)})});var q=_.top+(A+E)*V,G=_.top,U=Y?G:q;if(I&&P(u,W,U),M&&J(u,W,V),f>v.width){var X=function(){var t=Math.min(0,Math.max(v.width-f,d3.event.translate[0]));Z.translate([t,0]),u.attr("transform","translate("+t+",0)"),o(t*j,D)},Z=d3.behavior.zoom().x(D).on("zoom",X);t.attr("class","scrollable").call(Z)}b&&u.selectAll(".tick text").attr("transform",function(t){return"rotate("+b+")translate("+(this.getBBox().width/2+10)+","+this.getBBox().height/2+")"});var $=u[0][0].getBoundingClientRect();if(function(){if(g||B.attr("height"))g?B.attr("height",g):g=B.attr("height");else{if(!A)throw"height of the timeline is not set";g=$.height+$.top-v.top,d3.select(t[0][0]).attr("height",g)}}(),O&&u.each(function(t,n){t.forEach(function(t){t.times.forEach(function(t){l(D(t.starting_time),H),l(D(t.ending_time),H)})})}),z){l(D(new Date),C)}}var n=["circle","rect"],e=function(){},r=function(){},i=function(){},a=function(){},o=function(){},c=function(t){return t},l=function(){},u=function(){},s="bottom",f=null,g=null,h=null,m=null,d={format:d3.time.format("%I %p"),tickTime:d3.time.hours,tickInterval:1,tickSize:6,tickValues:null},p=d3.scale.category20(),x=null,k="rect",w=0,v=0,y=0,_={left:30,right:30,top:30,bottom:30},T=!1,b=!1,F=!1,B=!1,A=20,E=5,S=60,I=!0,Y=!1,z=!1,M=!1,V={stroke:"stroke-dasharray",spacing:"4 10"},C={marginTop:25,marginBottom:0,width:1,color:p},O=!1,H={marginTop:25,marginBottom:0,width:1,color:p},L=!1,R=!1,j=!1,D="white",N={},P=function(t,n,e){L&&G(t,0,0),R&&q(t);t.append("g").attr("class","axis").attr("transform","translate(0,"+e+")").call(n)},W=function(t){var n=w.getFullYear();w.getFullYear()!=y.getFullYear()&&(n=w.getFullYear()+"-"+y.getFullYear()),t.append("text").attr("transform","translate(20, 0)").attr("x",0).attr("y",14).attr("class","calendarYear").text(n)},q=function(t){var n=_.left-S,e=(f-_.left)/6,r=f-_.right-e+S,i=t.append("g").attr("class","axis").attr("transform","translate(0, 20)");j&&W(i),i.append("text").attr("transform","translate("+n+", 0)").attr("x",0).attr("y",14).attr("class","chevron").text("<").on("click",function(){return l(w,N)}),i.append("text").attr("transform","translate("+r+", 0)").attr("x",0).attr("y",14).attr("class","chevron").text(">").on("click",function(){return u(y,N)})},G=function(t,n,e){t.insert("rect").attr("class","row-green-bar").attr("x",n).attr("width",f).attr("y",e).attr("height",A).attr("fill",D)},J=function(t,n,e){t.append("g").attr("class","axis").attr("transform","translate(0,"+(_.top+(A+E)*e)+")").attr(V.stroke,V.spacing).call(n.tickFormat("").tickSize(-(_.top+(A+E)*(e-1)+3),0,0))},K=function(t,n,e,r,i){var a=(A+E)*t[n]+_.top;e.selectAll("svg").data(r).enter().insert("rect").attr("class","row-green-bar").attr("x",B?0:_.left).attr("width",B?f:f-_.right-_.left).attr("y",a).attr("height",A).attr("fill",m instanceof Function?m(i,n):m)},Q=function(t,n,e,r,i){var o=A+E,l=_.top+o/2+o*(n[e]||1);t.append("text").attr("class","timeline-label").attr("transform","translate("+v+","+l+")").text(r?c(i.label):i.id).on("click",function(t,n){a(t,e,i)})};return t.margin=function(n){return arguments.length?(_=n,t):_},t.orient=function(n){return arguments.length?(s=n,t):s},t.itemHeight=function(n){return arguments.length?(A=n,t):A},t.itemMargin=function(n){return arguments.length?(E=n,t):E},t.navMargin=function(n){return arguments.length?(S=n,t):S},t.height=function(n){return arguments.length?(g=n,t):g},t.width=function(n){return arguments.length?(f=n,t):f},t.display=function(e){return arguments.length&&-1!=n.indexOf(e)?(k=e,t):k},t.labelFormat=function(n){return arguments.length?(c=n,t):c},t.tickFormat=function(n){return arguments.length?(d=n,t):d},t.hover=function(n){return arguments.length?(e=n,t):e},t.mouseover=function(n){return arguments.length?(r=n,t):r},t.mouseout=function(n){return arguments.length?(i=n,t):i},t.click=function(n){return arguments.length?(a=n,t):a},t.scroll=function(n){return arguments.length?(o=n,t):o},t.colors=function(n){return arguments.length?(p=n,t):p},t.beginning=function(n){return arguments.length?(w=n,t):w},t.ending=function(n){return arguments.length?(y=n,t):y},t.labelMargin=function(n){return arguments.length?(v=n,t):v},t.rotateTicks=function(n){return arguments.length?(b=n,t):b},t.stack=function(){return T=!T,t},t.relativeTime=function(){return F=!F,t},t.showBorderLine=function(){return O=!O,t},t.showBorderFormat=function(n){return arguments.length?(H=n,t):H},t.showToday=function(){return z=!z,t},t.showTodayFormat=function(n){return arguments.length?(C=n,t):C},t.colorProperty=function(n){return arguments.length?(x=n,t):x},t.rowSeparators=function(n){return arguments.length?(h=n,t):h},t.background=function(n){return arguments.length?(m=n,t):m},t.showTimeAxis=function(){return I=!I,t},t.showAxisTop=function(){return Y=!Y,t},t.showAxisCalendarYear=function(){return j=!j,t},t.showTimeAxisTick=function(){return M=!M,t},t.fullLengthBackgrounds=function(){return B=!B,t},t.showTimeAxisTickFormat=function(n){return arguments.length?(V=n,t):V},t.showAxisHeaderBackground=function(n){return L=!L,n&&(D=n),t},t.navigate=function(n,e){return arguments.length?(l=n,u=e,R=!R,t):[l,u]},t}}(); !function(o){o.factory("CKolorFactory",function(){var o={alpha:100,ckoloring:!1,defaultColor:"#FFFFFF",display:"hex",inputHsl:{h:null,s:null,l:null},hex:null,hsl:{h:null,s:null,l:null},hues:[75,85,95,105,115,125,135,145,155,165,175,185,195,205,215,225,235,245,255,265,275,285,295,305,315,325,335,345,355,5,15,25,35,45,55,65],model:null,modelId:null,originalFormat:null,previousColors:[],rgb:{r:null,g:null,b:null},circleWidth:0,init:function(l){o.alpha=100,o.defaultColor=l.defaultColor?o.validHex(l.defaultColor):"#FFFFFF",o.model=l.model,o.modelId=l.modelId;var r=angular.fromJson(localStorage.aCKolorPreviousColors);r&&(o.previousColors=r);var e=o.convertTo();e&&(o.hsl.h=o.inputHsl.h=e.h,o.hsl.s=o.inputHsl.s=e.s,o.hsl.l=o.inputHsl.l=e.l,o.rgb=o.hslToRgb(e),o.hex=o.rgbToHex(o.rgb),o.display=o.originalFormat)},save:function(){if(100===o.alpha)switch(o.originalFormat){case"hex":o.model=o.hex;break;case"hsl":o.model="hsl("+o.hsl.h+","+o.hsl.s+"%,"+o.hsl.l+"%)";break;case"rgb":o.model="rgb("+o.rgb.r+","+o.rgb.g+","+o.rgb.b+")"}else"hsl"===o.originalFormat?o.model="hsla("+o.hsl.h+","+o.hsl.s+"%,"+o.hsl.l+"%,"+o.alpha/100+")":o.model="rgba("+o.rgb.r+","+o.rgb.g+","+o.rgb.b+","+o.alpha/100+")";o.previousColors.indexOf(o.model)===-1&&(o.previousColors.unshift(o.model),o.previousColors.length>20&&(o.previousColors.length=20),localStorage.aCKolorPreviousColors=angular.toJson(o.previousColors)),o.toggleCKoloring()},previousColorClick:function(l){var r=(o.originalFormat,o.convertTo(l));r&&(o.hsl.h=o.inputHsl.h=r.h,o.hsl.s=o.inputHsl.s=r.s,o.hsl.l=o.inputHsl.l=r.l,o.rgb=o.hslToRgb(r),o.hex=o.rgbToHex(o.rgb),o.display=o.originalFormat),o.updateHSL()},toggleCKoloring:function(){o.ckoloring=!1},updateColorDisplay:function(l){return o.display=l,o.display},updateHSL:function(){o.hex=o.rgbToHex(o.hslToRgb(o.hsl)),o.rgb=o.hslToRgb(o.hsl),o.inputHsl=o.hsl},updateRGB:function(){o.hex=o.rgbToHex(o.rgb),o.hsl=o.rgbToHsl(o.rgb)},updateHEX:function(){o.hex=o.validHex(o.hex);var l=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o.hex);o.hex&&7===o.hex.length&&l&&(o.rgb=o.hexToRgb(o.hex),o.hsl=o.rgbToHsl(o.rgb))},validHex:function(o){var l=o.split("");return"#"===l[0]&&l.shift(),3===l.length&&(l=l.concat(l)),o="#"+l.join("")},hueLightFromRadial:function(l,r){var e,t;l.changedTouches?(e=l.changedTouches[0].clientX,t=l.changedTouches[0].clientY):(e=l.pageX,t=l.pageY);var n=r.getBoundingClientRect(),a=n.width/2,i=n.left,s=n.top,c=a+i,u=a+s,h=e-c,d=t-u,g=Math.atan2(d,h)*(180/Math.PI),v=g;v<0&&(v+=360);var p=Math.abs(h),m=Math.abs(d),b=Math.round(100-100*Math.sqrt(p*p+m*m)/a);return o.hsl.l=b>-1?b<101?b:100:0,o.hsl.h=Math.round(v)>-1||Math.round(v)<360?Math.round(v):0,o.updateHSL(),o.radialXY(),{h:o.hsl.h,l:o.hsl.l}},radialXY:function(){var l=o.circleWidth/2,r=l*((100-o.hsl.l)/100),e=o.hsl.h,t=l+r*Math.cos(e*Math.PI/180),n=2*l-(l+-(r*Math.sin(e*Math.PI/180)));return{x:t,y:n}},convertTo:function(l){l=l?l:o.model?o.model:"null";var r;return l.indexOf("#")>-1?(l=o.validHex(l),r=o.hexToRgb(l),o.originalFormat="hex",o.rgbToHsl(r)):l.indexOf("hsla")>-1?(l=l.split("(")[1],l=l.substring(0,l.length-1),l=l.split(","),o.originalFormat="hsl",o.alpha=100*l[3],{h:parseInt(l[0]),s:parseInt(l[1]),l:parseInt(l[2])}):l.indexOf("hsl")>-1?(l=l.split("(")[1],l=l.substring(0,l.length-1),l=l.split(","),o.originalFormat="hsl",{h:parseInt(l[0]),s:parseInt(l[1]),l:parseInt(l[2])}):l.indexOf("rgba")>-1?(l=l.split("(")[1],l=l.substring(0,l.length-1),l=l.split(","),o.originalFormat="rgb",o.alpha=100*l[3],o.rgbToHsl({r:parseInt(l[0]),g:parseInt(l[1]),b:parseInt(l[2])})):l.indexOf("rgb")>-1?(l=l.split("(")[1],l=l.substring(0,l.length-1),l=l.split(","),o.originalFormat="rgb",o.rgbToHsl({r:parseInt(l[0]),g:parseInt(l[1]),b:parseInt(l[2])})):l.indexOf("transparent")>-1?(o.originalFormat="rgb",o.alpha=0,r=o.hexToRgb(o.defaultColor),o.rgbToHsl(r)):(o.originalFormat="rgb",r=o.hexToRgb(o.defaultColor),o.rgbToHsl(r))},hexToRgb:function(o){var l=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);return l?{r:parseInt(l[1],16),g:parseInt(l[2],16),b:parseInt(l[3],16)}:null},rgbToHsl:function(l){var r,e,t=l.r/255,n=l.g/255,a=l.b/255,i=Math.max(t,n,a),s=Math.min(t,n,a),c=(i+s)/2;if(i==s)r=e=0;else{var u=i-s;switch(e=c>.5?u/(2-i-s):u/(i+s),i){case t:r=(n-a)/u+(n
    ',link:function(t,n){function a(){t.blur!==!0&&void 0!==t.blur||u.removeClass("c-ckolor__overlay-blur"),u.removeClass("c-ckolor__modal")}function i(){h&&h.offsetWidth?l.circleWidth=h.offsetWidth:e(function(){i()},200)}var s=function(){for(var o="",l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<35;r++)o+=l.charAt(Math.floor(Math.random()*l.length));return o},c=o[0].body,u=angular.element(c),h=c.querySelector(".c-ckolor__wheel"),d=s();t.CKolorFactory=l,t.type||(t.type="hidden"),t.toggleCKoloring=function(){var o=c.querySelector("a-ckolor-wheel");if(!o){var e="",n=r(e)(t);u.append(n),h=c.querySelector(".c-ckolor__wheel")}t.blur!==!0&&void 0!==t.blur||u.addClass("c-ckolor__overlay-blur"),u.addClass("c-ckolor__modal"),l.init({model:t.model,modelId:d,defaultColor:t.defaultColor}),l.ckoloring=!0,i()},t.$watch(function(){return l.model},function(o,r){if(o!==r&&l.modelId===d&&o!==t.model){a();var e,n,i;switch(l.originalFormat){case"hex":e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(l.model),e&&(t.model=l.model);break;case"rgb":try{for(n=l.model.split("(")[1].split(")")[0].split(","),e=!0,i=0;i255||n[i]<0)&&(e=!1);e&&(t.model=l.model)}catch(o){}break;case"hsl":try{for(n=l.model.split("(")[1].split(")")[0].split(","),e=!0,i=0;i360||n[i]<0)&&(e=!1):(isNaN(n[i])||n[i]>100||n[i]<0)&&(e=!1);e&&(t.model=l.model)}catch(o){}}t.onChange&&t.onChange(t.model)}}),t.$watch(function(){return l.ckoloring},function(o,r){if(l.ckoloring===!1&&l.modelId===d&&(a(),h)){var e=c.querySelector("a-ckolor-wheel");e.remove(),h=null}})}}}])}(angular.module("aCKolor")),function(o){o.directive("aCkolorWheel",["$timeout","$document","CKolorFactory","$window",function(o,l,r,e){return{restrict:"E",template:'
    ',link:function(e,t){e.CKolorFactory=r;var n=l[0].body,a=t[0].querySelector(".c-ckolor__wheel-value"),i=(t[0].querySelector(".c-ckolor__wheel-scoop"),t[0].querySelector(".c-ckolor__close-btn"),t[0].querySelector(".c-ckolor__save-btn"),t[0].querySelector(".c-ckolor__saturation")),s=(t[0].querySelector(".c-ckolor__saturation-handle"),t[0].querySelector(".c-ckolor__alpha"),t[0].querySelector(".c-ckolor__alpha-handle"),t[0].querySelector(".c-ckolor__overlay-inner"),null),c=null,u=function(l){a||(a=t[0].querySelector(".c-ckolor__wheel-value")),a&&o(function(){r.hueLightFromRadial(l,a)})};e.updateHueLightFromRadial=function(o){u(o)};var h=function(l){var e=(l.changedTouches?l.changedTouches[0].clientX:l.pageX)-c.left,t=Math.round(e/c.width*100);t<0?t=0:t>100&&(t=100),r.hsl.s=t,o(function(){r.updateHSL()})},d=function(o){n.removeEventListener("mousemove",u,!0),n.removeEventListener("touchmove",u,!0),n.removeEventListener("mousemove",h,!0),n.removeEventListener("touchmove",h,!0)},g=function(o){s=a.getBoundingClientRect(),u(o),n.addEventListener("mousemove",u,!0),a.addEventListener("touchmove",u,!1)},v=function(o){c=i.getBoundingClientRect(),h(o),n.addEventListener("mousemove",h,!0),i.addEventListener("touchmove",h,!1)};a.addEventListener("mousedown",g,!0),a.addEventListener("touchstart",g,!0),i.addEventListener("mousedown",v,!0),i.addEventListener("touchstart",v,!1),n.addEventListener("mouseup",d,!0),n.addEventListener("touchend",d,!1),e.$watchCollection(function(){return r.hls},function(o,l){o!==l&&!isNaN(o.h)&&!isNaN(o.l)&&!isNaN(o.s)&&o.h>=0&&o.h<=360&&o.l>=0&&o.l<=255&&o.s>=0&&o.s<=255&&r.updateHSL()})}}}])}(angular.module("aCKolor")); //# sourceMappingURL=aCKolor.min.js.map @@ -765,3 +759,5 @@ angular.module('web.colorpicker').directive('webColorpicker', function() { } } }) + +!function(){"use strict";angular.module("as.sortable",[]).constant("sortableConfig",{itemClass:"as-sortable-item",handleClass:"as-sortable-item-handle",placeHolderClass:"as-sortable-placeholder",dragClass:"as-sortable-drag",hiddenClass:"as-sortable-hidden",dragging:"as-sortable-dragging"})}(),function(){"use strict";var mainModule=angular.module("as.sortable");mainModule.factory("$helper",["$document","$window",function($document,$window){return{height:function(element){return element[0].getBoundingClientRect().height},width:function(element){return element[0].getBoundingClientRect().width},offset:function(element,scrollableContainer){var boundingClientRect=element[0].getBoundingClientRect();return scrollableContainer||(scrollableContainer=$document[0].documentElement),{width:boundingClientRect.width||element.prop("offsetWidth"),height:boundingClientRect.height||element.prop("offsetHeight"),top:boundingClientRect.top+($window.pageYOffset||scrollableContainer.scrollTop-scrollableContainer.offsetTop),left:boundingClientRect.left+($window.pageXOffset||scrollableContainer.scrollLeft-scrollableContainer.offsetLeft)}},eventObj:function(event){var obj=event;return void 0!==event.targetTouches?obj=event.targetTouches.item(0):void 0!==event.originalEvent&&void 0!==event.originalEvent.targetTouches&&(obj=event.originalEvent.targetTouches.item(0)),obj},isTouchInvalid:function(event){var touchInvalid=!1;return void 0!==event.touches&&event.touches.length>1?touchInvalid=!0:void 0!==event.originalEvent&&void 0!==event.originalEvent.touches&&event.originalEvent.touches.length>1&&(touchInvalid=!0),touchInvalid},positionStarted:function(event,target,scrollableContainer){var pos={};return pos.offsetX=event.pageX-this.offset(target,scrollableContainer).left,pos.offsetY=event.pageY-this.offset(target,scrollableContainer).top,pos.startX=pos.lastX=event.pageX,pos.startY=pos.lastY=event.pageY,pos.nowX=pos.nowY=pos.distX=pos.distY=pos.dirAx=0,pos.dirX=pos.dirY=pos.lastDirX=pos.lastDirY=pos.distAxX=pos.distAxY=0,pos},calculatePosition:function(pos,event){pos.lastX=pos.nowX,pos.lastY=pos.nowY,pos.nowX=event.pageX,pos.nowY=event.pageY,pos.distX=pos.nowX-pos.lastX,pos.distY=pos.nowY-pos.lastY,pos.lastDirX=pos.dirX,pos.lastDirY=pos.dirY,pos.dirX=0===pos.distX?0:pos.distX>0?1:-1,pos.dirY=0===pos.distY?0:pos.distY>0?1:-1;var newAx=Math.abs(pos.distX)>Math.abs(pos.distY)?1:0;pos.dirAx!==newAx?(pos.distAxX=0,pos.distAxY=0):(pos.distAxX+=Math.abs(pos.distX),0!==pos.dirX&&pos.dirX!==pos.lastDirX&&(pos.distAxX=0),pos.distAxY+=Math.abs(pos.distY),0!==pos.dirY&&pos.dirY!==pos.lastDirY&&(pos.distAxY=0)),pos.dirAx=newAx},movePosition:function(event,element,pos,container,containerPositioning,scrollableContainer){var bounds,useRelative="relative"===containerPositioning;element.x=event.pageX-pos.offsetX,element.y=event.pageY-pos.offsetY,container&&(bounds=this.offset(container,scrollableContainer),useRelative&&(element.x-=bounds.left,element.y-=bounds.top,bounds.left=0,bounds.top=0),element.x=bounds.width+bounds.left-this.offset(element).width&&(element.x=bounds.width+bounds.left-this.offset(element).width),element.y=bounds.height+bounds.top-this.offset(element).height&&(element.y=bounds.height+bounds.top-this.offset(element).height)),element.css({left:element.x+"px",top:element.y+"px"}),this.calculatePosition(pos,event)},dragItem:function(item){return{index:item.index(),parent:item.sortableScope,source:item,targetElement:null,targetElementOffset:null,sourceInfo:{index:item.index(),itemScope:item.itemScope,sortableScope:item.sortableScope},canMove:function(itemPosition,targetElement,targetElementOffset){return this.targetElement!==targetElement?(this.targetElement=targetElement,this.targetElementOffset=targetElementOffset,!0):itemPosition.dirX*(targetElementOffset.left-this.targetElementOffset.left)>0||itemPosition.dirY*(targetElementOffset.top-this.targetElementOffset.top)>0?(this.targetElementOffset=targetElementOffset,!0):!1},moveTo:function(parent,index){this.parent=parent,this.isSameParent()&&this.source.index()-1&&(removedItem=$scope.modelValue.splice(index,1)[0]),removedItem},$scope.isEmpty=function(){return $scope.modelValue&&0===$scope.modelValue.length},$scope.accept=function(sourceItemHandleScope,destScope,destItemScope){return $scope.callbacks.accept(sourceItemHandleScope,destScope,destItemScope)}}]),mainModule.directive("asSortable",function(){return{require:"ngModel",restrict:"A",scope:!0,controller:"as.sortable.sortableController",link:function(scope,element,attrs,ngModelController){var ngModel,callbacks;ngModel=ngModelController,ngModel&&(ngModel.$render=function(){scope.modelValue=ngModel.$modelValue},scope.element=element,element.data("_scope",scope),callbacks={accept:null,orderChanged:null,itemMoved:null,dragStart:null,dragMove:null,dragCancel:null,dragEnd:null},callbacks.accept=function(sourceItemHandleScope,destSortableScope,destItemScope){return!0},callbacks.orderChanged=function(event){},callbacks.itemMoved=function(event){},callbacks.dragStart=function(event){},callbacks.dragMove=angular.noop,callbacks.dragCancel=function(event){},callbacks.dragEnd=function(event){},scope.$watch(attrs.asSortable,function(newVal,oldVal){angular.forEach(newVal,function(value,key){callbacks[key]?"function"==typeof value&&(callbacks[key]=value):scope.options[key]=value}),scope.callbacks=callbacks},!0),angular.isDefined(attrs.isDisabled)&&scope.$watch(attrs.isDisabled,function(newVal,oldVal){angular.isUndefined(newVal)||(scope.isDisabled=newVal)},!0))}}})}(),function(){"use strict";function isParent(possibleParent,elem){return elem&&"HTML"!==elem.nodeName?elem.parentNode===possibleParent?!0:isParent(possibleParent,elem.parentNode):!1}var mainModule=angular.module("as.sortable");mainModule.controller("as.sortable.sortableItemHandleController",["$scope",function($scope){this.scope=$scope,$scope.itemScope=null,$scope.type="handle"}]),mainModule.directive("asSortableItemHandle",["sortableConfig","$helper","$window","$document","$timeout",function(sortableConfig,$helper,$window,$document,$timeout){return{require:"^asSortableItem",scope:!0,restrict:"A",controller:"as.sortable.sortableItemHandleController",link:function(scope,element,attrs,itemController){function insertBefore(targetElement,targetScope){"table-row"!==placeHolder.css("display")&&placeHolder.css("display","block"),targetScope.sortableScope.options.clone||(targetElement[0].parentNode.insertBefore(placeHolder[0],targetElement[0]),dragItemInfo.moveTo(targetScope.sortableScope,targetScope.index()))}function insertAfter(targetElement,targetScope){"table-row"!==placeHolder.css("display")&&placeHolder.css("display","block"),targetScope.sortableScope.options.clone||(targetElement.after(placeHolder),dragItemInfo.moveTo(targetScope.sortableScope,targetScope.index()+1))}function fetchScope(element){for(var scope;!scope&&element.length;)scope=element.data("_scope"),scope||(element=element.parent());return scope}function rollbackDragChanges(){scope.itemScope.sortableScope.cloning||placeElement.replaceWith(scope.itemScope.element),placeHolder.remove(),dragElement.remove(),dragElement=null,dragHandled=!1,containment.css("cursor",""),containment.removeClass("as-sortable-un-selectable")}var dragElement,placeHolder,placeElement,itemPosition,dragItemInfo,containment,containerPositioning,dragListen,scrollableContainer,dragStart,dragMove,dragEnd,dragCancel,isDraggable,placeHolderIndex,bindDrag,unbindDrag,bindEvents,unBindEvents,hasTouch,isIOS,longTouchStart,longTouchCancel,longTouchTimer,dragHandled,createPlaceholder,isPlaceHolderPresent,escapeListen,isDisabled=!1,isLongTouch=!1;hasTouch="ontouchstart"in $window,isIOS=/iPad|iPhone|iPod/.test($window.navigator.userAgent)&&!$window.MSStream,sortableConfig.handleClass&&element.addClass(sortableConfig.handleClass),scope.itemScope=itemController.scope,element.data("_scope",scope),scope.$watchGroup(["sortableScope.isDisabled","sortableScope.options.longTouch"],function(newValues){isDisabled!==newValues[0]?(isDisabled=newValues[0],isDisabled?unbindDrag():bindDrag()):isLongTouch!==newValues[1]?(isLongTouch=newValues[1],unbindDrag(),bindDrag()):bindDrag()}),scope.$on("$destroy",function(){angular.element($document[0].body).unbind("keydown",escapeListen)}),createPlaceholder=function(itemScope){return"function"==typeof scope.sortableScope.options.placeholder?angular.element(scope.sortableScope.options.placeholder(itemScope)):"string"==typeof scope.sortableScope.options.placeholder?angular.element(scope.sortableScope.options.placeholder):angular.element($document[0].createElement(itemScope.element.prop("tagName")))},dragListen=function(event){var startPosition,unbindMoveListen=function(){angular.element($document).unbind("mousemove",moveListen),angular.element($document).unbind("touchmove",moveListen),element.unbind("mouseup",unbindMoveListen),element.unbind("touchend",unbindMoveListen),element.unbind("touchcancel",unbindMoveListen)},moveListen=function(e){e.preventDefault();var eventObj=$helper.eventObj(e);startPosition||(startPosition={clientX:eventObj.clientX,clientY:eventObj.clientY}),Math.abs(eventObj.clientX-startPosition.clientX)+Math.abs(eventObj.clientY-startPosition.clientY)>10&&(unbindMoveListen(),dragStart(event))};angular.element($document).bind("mousemove",moveListen),angular.element($document).bind("touchmove",moveListen),element.bind("mouseup",unbindMoveListen),element.bind("touchend",unbindMoveListen),element.bind("touchcancel",unbindMoveListen),event.stopPropagation()},dragStart=function(event){var eventObj,tagName;(hasTouch||2!==event.button&&3!==event.which)&&(hasTouch&&$helper.isTouchInvalid(event)||!dragHandled&&isDraggable(event)&&(dragHandled=!0,event.preventDefault(),eventObj=$helper.eventObj(event),scope.sortableScope=scope.sortableScope||scope.itemScope.sortableScope,scope.callbacks=scope.callbacks||scope.itemScope.callbacks,scope.itemScope.sortableScope.options.clone||scope.itemScope.sortableScope.options.ctrlClone&&event.ctrlKey?scope.itemScope.sortableScope.cloning=!0:scope.itemScope.sortableScope.cloning=!1,scrollableContainer=angular.element($document[0].querySelector(scope.sortableScope.options.scrollableContainer)).length>0?$document[0].querySelector(scope.sortableScope.options.scrollableContainer):$document[0].documentElement,containment=scope.sortableScope.options.containment?$helper.findAncestor(element,scope.sortableScope.options.containment):angular.element($document[0].body),containment.css("cursor","move"),containment.css("cursor","-webkit-grabbing"),containment.css("cursor","-moz-grabbing"),containment.addClass("as-sortable-un-selectable"),containerPositioning=scope.sortableScope.options.containerPositioning||"absolute",dragItemInfo=$helper.dragItem(scope),tagName=scope.itemScope.element.prop("tagName"),dragElement=angular.element($document[0].createElement(scope.sortableScope.element.prop("tagName"))).addClass(scope.sortableScope.element.attr("class")).addClass(sortableConfig.dragClass),dragElement.css("width",$helper.width(scope.itemScope.element)+"px"),dragElement.css("height",$helper.height(scope.itemScope.element)+"px"),placeHolder=createPlaceholder(scope.itemScope).addClass(sortableConfig.placeHolderClass).addClass(scope.sortableScope.options.additionalPlaceholderClass),placeHolder.css("width",$helper.width(scope.itemScope.element)+"px"),placeHolder.css("height",$helper.height(scope.itemScope.element)+"px"),placeElement=angular.element($document[0].createElement(tagName)),sortableConfig.hiddenClass&&placeElement.addClass(sortableConfig.hiddenClass),itemPosition=$helper.positionStarted(eventObj,scope.itemScope.element,scrollableContainer),scope.itemScope.sortableScope.options.clone||scope.itemScope.element.after(placeHolder),scope.itemScope.sortableScope.cloning?dragElement.append(scope.itemScope.element.clone()):(scope.itemScope.element.after(placeElement),dragElement.append(scope.itemScope.element)),containment.append(dragElement),$helper.movePosition(eventObj,dragElement,itemPosition,containment,containerPositioning,scrollableContainer),scope.sortableScope.$apply(function(){scope.callbacks.dragStart(dragItemInfo.eventArgs())}),bindEvents()))},isDraggable=function(event){var elementClicked,sourceScope,isDraggable;for(elementClicked=angular.element(event.target),sourceScope=fetchScope(elementClicked),isDraggable=sourceScope&&"handle"===sourceScope.type;isDraggable&&elementClicked[0]!==element[0];)$helper.noDrag(elementClicked)&&(isDraggable=!1),elementClicked=elementClicked.parent();return isDraggable},dragMove=function(event){var eventObj,targetX,targetY,targetScope,targetElement;if((!hasTouch||!$helper.isTouchInvalid(event))&&dragHandled&&dragElement){if(event.preventDefault(),eventObj=$helper.eventObj(event),scope.callbacks.dragMove!==angular.noop&&scope.sortableScope.$apply(function(){scope.callbacks.dragMove(itemPosition,containment,eventObj)}),targetX=eventObj.pageX-$document[0].documentElement.scrollLeft,targetY=eventObj.pageY-($window.pageYOffset||$document[0].documentElement.scrollTop),dragElement.addClass(sortableConfig.hiddenClass),targetElement=angular.element($document[0].elementFromPoint(targetX,targetY)),dragElement.removeClass(sortableConfig.hiddenClass),$helper.movePosition(eventObj,dragElement,itemPosition,containment,containerPositioning,scrollableContainer),dragElement.addClass(sortableConfig.dragging),targetScope=fetchScope(targetElement),!targetScope||!targetScope.type)return;if("handle"===targetScope.type&&(targetScope=targetScope.itemScope),"item"!==targetScope.type&&"sortable"!==targetScope.type)return;if("item"===targetScope.type&&targetScope.accept(scope,targetScope.sortableScope,targetScope)){targetElement=targetScope.element;var targetElementOffset=$helper.offset(targetElement,scrollableContainer);if(!dragItemInfo.canMove(itemPosition,targetElement,targetElementOffset))return;var placeholderIndex=placeHolderIndex(targetScope.sortableScope.element);0>placeholderIndex?insertBefore(targetElement,targetScope):placeholderIndex<=targetScope.index()?insertAfter(targetElement,targetScope):insertBefore(targetElement,targetScope)}"sortable"===targetScope.type&&targetScope.accept(scope,targetScope)&&!isParent(targetScope.element[0],targetElement[0])&&(isPlaceHolderPresent(targetElement)||targetScope.options.clone||(targetElement[0].appendChild(placeHolder[0]),dragItemInfo.moveTo(targetScope,targetScope.modelValue.length)))}},placeHolderIndex=function(targetElement){var itemElements,i;if(targetElement.hasClass(sortableConfig.placeHolderClass))return 0;for(itemElements=targetElement.children(),i=0;i=0},dragEnd=function(event){dragHandled&&(event.preventDefault(),dragElement&&(rollbackDragChanges(),dragItemInfo.apply(),scope.sortableScope.$apply(function(){dragItemInfo.isSameParent()?dragItemInfo.isOrderChanged()&&scope.callbacks.orderChanged(dragItemInfo.eventArgs()):scope.callbacks.itemMoved(dragItemInfo.eventArgs())}),scope.sortableScope.$apply(function(){scope.callbacks.dragEnd(dragItemInfo.eventArgs())}),dragItemInfo=null),unBindEvents())},dragCancel=function(event){dragHandled&&(event.preventDefault(),dragElement&&(rollbackDragChanges(),scope.sortableScope.$apply(function(){scope.callbacks.dragCancel(dragItemInfo.eventArgs())}),dragItemInfo=null),unBindEvents())},bindDrag=function(){hasTouch&&(isLongTouch?isIOS?(element.bind("touchstart",longTouchStart),element.bind("touchend",longTouchCancel),element.bind("touchmove",longTouchCancel)):element.bind("contextmenu",dragListen):element.bind("touchstart",dragListen)),element.bind("mousedown",dragListen)},unbindDrag=function(){element.unbind("touchstart",longTouchStart),element.unbind("touchend",longTouchCancel),element.unbind("touchmove",longTouchCancel),element.unbind("contextmenu",dragListen),element.unbind("touchstart",dragListen),element.unbind("mousedown",dragListen)},longTouchStart=function(event){longTouchTimer=$timeout(function(){dragListen(event)},500)},longTouchCancel=function(){$timeout.cancel(longTouchTimer)},escapeListen=function(event){27===event.keyCode&&dragCancel(event)},angular.element($document[0].body).bind("keydown",escapeListen),bindEvents=function(){angular.element($document).bind("touchmove",dragMove),angular.element($document).bind("touchend",dragEnd),angular.element($document).bind("touchcancel",dragCancel),angular.element($document).bind("mousemove",dragMove),angular.element($document).bind("mouseup",dragEnd)},unBindEvents=function(){angular.element($document).unbind("touchend",dragEnd),angular.element($document).unbind("touchcancel",dragCancel),angular.element($document).unbind("touchmove",dragMove),angular.element($document).unbind("mouseup",dragEnd),angular.element($document).unbind("mousemove",dragMove)}}}}])}(),function(){"use strict";var mainModule=angular.module("as.sortable");mainModule.controller("as.sortable.sortableItemController",["$scope",function($scope){this.scope=$scope,$scope.sortableScope=null,$scope.modelValue=null,$scope.type="item",$scope.index=function(){return $scope.$index},$scope.itemData=function(){return $scope.sortableScope.modelValue[$scope.$index]}}]),mainModule.directive("asSortableItem",["sortableConfig",function(sortableConfig){return{require:["^asSortable","?ngModel"],restrict:"A",controller:"as.sortable.sortableItemController",link:function(scope,element,attrs,ctrl){var sortableController=ctrl[0],ngModelController=ctrl[1];sortableConfig.itemClass&&element.addClass(sortableConfig.itemClass),scope.sortableScope=sortableController.scope,ngModelController?ngModelController.$render=function(){scope.modelValue=ngModelController.$modelValue}:scope.modelValue=sortableController.scope.modelValue[scope.$index],scope.element=element,element.data("_scope",scope)}}}])}(); \ No newline at end of file