TimeSliderController - directive controller
@param {import("ngeo/misc/WMSTime.js").WMSTime} ngeoWMSTime WMSTime service.
@constructor
@private
@hidden
@ngInject
@ngdoc controller
@ngname gmfTimeSliderController
512192
function Controller(ngeoWMSTime) {

  /**
   * @type {import("ngeo/misc/WMSTime.js").WMSTime}
   * @private
   */
  this.ngeoWMSTime_ = ngeoWMSTime;

  /**
   * Function called after date(s) changed/selected
   * @type {Function}
   */
  this.onDateSelected = () => undefined;


  /**
   * A time object for directive initialization
   * @type {?import('ngeo/datasource/OGC.js').TimeProperty}
   */
  this.time = null;

  /**
   * If the component is used to select a date range
   * @type {boolean}
   */
  this.isModeRange = false;

  /**
   * Minimal value of the slider (time in ms)
   * @type {number}
   */
  this.minValue = -1;

  /**
   * Maximal value of the slider (time in ms)
   * @type {number}
   */
  this.maxValue = 999999;

  /**
   * Used when WMS time object has a property 'values' instead of an interval
   * @type {?Array<number>}
   */
  this.timeValueList = null;

  /**
   * Default Slider options (used by ui-slider directive)
   * @type {?{
   *  range : boolean,
   *  min : number,
   *  max : number
   * }}
   */
  this.sliderOptions = null;

  /**
   * Model for the ui-slider directive (date in ms format)
   * @type {Array<number>|number}
   */
  this.dates = [];
}
567526
function TimeGridEvent(props) {
  const {
    style,
    className,
    event,
    accessors,
    isRtl,
    selected,
    label,
    continuesEarlier,
    continuesLater,
    getters,
    onClick,
    onDoubleClick,
    components: { event: Event, eventWrapper: EventWrapper },
  } = props
  let title = accessors.title(event)
  let tooltip = accessors.tooltip(event)
  let end = accessors.end(event)
  let start = accessors.start(event)

  let userProps = getters.eventProp(event, start, end, selected)

  let { height, top, width, xOffset } = style
  const inner = [
    <div key="1" className="rbc-event-label">
      {label}
    </div>,
    <div key="2" className="rbc-event-content">
      {Event ? <Event event={event} title={title} /> : title}
    </div>,
  ]

  return (
    <EventWrapper type="time" {...props}>
      <div
        onClick={onClick}
        onDoubleClick={onDoubleClick}
        style={{
          ...userProps.style,
          top: `${top}%`,
          height: `${height}%`,
          [isRtl ? 'right' : 'left']: `${Math.max(0, xOffset)}%`,
          width: `${width}%`,
        }}
        title={
          tooltip
            ? (typeof label === 'string' ? label + ': ' : '') + tooltip
            : undefined
        }
        className={cn('rbc-event', className, userProps.className, {
          'rbc-selected': selected,
          'rbc-event-continues-earlier': continuesEarlier,
          'rbc-event-continues-later': continuesLater,
        })}
      >
        {inner}
      </div>
    </EventWrapper>
  )
}
98326
function _renderTimesRow(bSkipFocus){

		var oDate = this._getFocusedDate();
		var oTimesRow = this.getAggregation("timesRow");

		if (!bSkipFocus) {
			oTimesRow.setDate(CalendarUtils._createLocalDate(oDate, true));
		} else {
			oTimesRow.displayDate(CalendarUtils._createLocalDate(oDate, true));
		}

		// change header buttons
		_updateHeader.call(this);

	}
711593
function _createTimelineGrid(filterOptions) {
			var gridParent = document.getElementById('sapUiSupportPerfHeaderTimelineBarWrapper');
			var gridLineNumbers = Math.round(gridParent.offsetWidth / 10);
			var filteredDuration = filterOptions.filterByTime.end - filterOptions.filterByTime.start;
			var gridLineStepInTime = parseInt(filteredDuration / gridLineNumbers);

			if (document.getElementById('grid')) {
				document.getElementById('grid').parentNode.removeChild(document.getElementById('grid'));
			}

			var grid = document.createElement('div');
			grid.innerHTML = '<div class="header"></div><div class="body"></div>';
			grid.id = 'grid';

			for (var i = 1; i <= gridLineNumbers; i++) {
				var divForBorder = document.createElement('div');
				var divForText = document.createElement('div');

				if (i % 5 === 0 || i === 1) {
					var time = parseInt(filterOptions.filterByTime.start);

					if (i !== 1) {
						time += i * gridLineStepInTime;
					}
					//to String
					time = time > 500 ? (time / 1000).toFixed(2) + ' s' : time + ' ms';

					divForText.setAttribute('data-time', time);
				}

				grid.querySelector('.body').appendChild(divForBorder);
				grid.querySelector('.header').appendChild(divForText);
			}

			document.querySelector('#sapUiSupportPerf').appendChild(grid);
		}
672725
function WorkflowProcessStepsController($scope, $state, wfmService, $timeout, $stateParams) {
  var self = this;
  var workorderId = $stateParams.workorderId;

  function updateWorkflowState(workorder) {
    //If the workflow is complete, then we can switch to the summary view.
    if (wfmService.isCompleted(workorder)) {
      return $state.go('app.workflowProcess.complete', {
        workorderId: workorder.id
      });
    }

    if (!wfmService.isOnStep(workorder)) {
      return $state.go('app.workflowProcess.begin', {
        workorderId: workorder.id
      });
    }

    $timeout(function() {
      self.workorder = workorder;
      self.workflow = workorder.workflow;
      self.result = workorder.results;
      self.stepIndex = wfmService.getCurrentStepIdx(workorder);
      self.stepCurrent = wfmService.getCurrentStep(workorder);
    });
  }

  self.back = function() {
    wfmService.previousStep(workorderId)
      .then(updateWorkflowState)
      .catch(console.error);
  };

  self.triggerCompleteStep = function(submission) {
    wfmService.completeStep(workorderId, submission)
      .then(updateWorkflowState)
      .catch(console.error);
  };

  self.triggerBackStep = function() {
    self.back();
  };

  wfmService.readWorkOrder(workorderId).then(updateWorkflowState);
}
985547
function() {
		var t = this;

		var time = document.createElement('div');
		time.className = 'zy_time';
		time.innerHTML = '<span class="zy_currenttime">' +
			timeFormat(0, t.options) +
			'</span>/' +
			'<span class="zy_duration">' +
			timeFormat(t.options.duration, t.options) +
			'</span>';
		t.controls.appendChild(time);

		t.currentTime = time.children[0];
		t.durationDuration = time.children[1];

		//4Hz ~ 66Hz, no longer than 250ms
		t.media.addEventListener('timeupdate', function() {
			t.updateTime()
		});
	}
180225
function FileListController($scope, mediator, $stateParams, $window, userClient, fileMediatorService, $timeout, mobileCamera, desktopCamera, FILE_CONFIG) {
  var self = this;
  self.files = null;
  var _files;
  self.uploadEnabled = FILE_CONFIG.uploadEnabled;
  userClient.getProfile().then(function(profileData){
    var userFilter;
    if(FILE_CONFIG.userMode){
      userFilter = profileData.id;
    }
    
    function refreshFiles(){
      fileMediatorService.listFiles(userFilter).then(function(files){
        $timeout(function(){
          _files = files;
          self.files = files;
        });
      });
    }
  
    refreshFiles();
  
    fileMediatorService.subscribeToFileCRUDDoneTopics($scope, refreshFiles);
  
    self.selectFile = function(event, file){
      self.selectedFileId = file.id;
      mediator.publish(fileMediatorService.fileUITopics.getTopic(CONSTANTS.TOPICS.SELECTED), file);
    };
  
    //TODO: Move to service
    self.applyFilter = function(term){
      term = term.toLowerCase();
      self.files = _files.filter(function(file){
        return String(file.name).toLowerCase().indexOf(term) !== -1
          || String(file.id).indexOf(term) !== -1;
      });
    };
  
    $scope.$parent.selected = {id: null};
    var captureThenUpload = function(){
      if($window.cordova){
        return mobileCamera.capture()
          .then(function(capture){
            var fileData = {
              userId: profileData.id,
              fileURI: capture.fileURI,
              options: {fileName: capture.fileName}
            };
            fileMediatorService.createFile(fileData);
          });
      }else{
        return desktopCamera.capture()
          .then(function(dataUrl){
            return fileMediatorService.createFile({userId: profileData.id, dataUrl: dataUrl});
          });
      }
    };
    self.capturePhoto = function(){
      captureThenUpload().then(function(){
      }, function(error){
        console.error(error);
      });
    };
  });
}
837123
function(scope, elm, attrs) {
                        var mergedConfig;

                        // Merges configuration set in directive with default one
                        mergedConfig = angular.extend({}, toasterConfig, scope.$eval(attrs.toasterOptions));

                        scope.config = {
                            toasterId: mergedConfig['toaster-id'],
                            position: mergedConfig['position-class'],
                            title: mergedConfig['title-class'],
                            message: mergedConfig['message-class'],
                            tap: mergedConfig['tap-to-dismiss'],
                            closeButton: mergedConfig['close-button'],
                            closeHtml: mergedConfig['close-html'],
                            animation: mergedConfig['animation-class'],
                            mouseoverTimer: mergedConfig['mouseover-timer-stop']
                        };

                        scope.$on(
                            "$destroy", function() {
                                toasterEventRegistry.unsubscribeToNewToastEvent(scope._onNewToast);
                                toasterEventRegistry.unsubscribeToClearToastsEvent(scope._onClearToasts);
                            }
                        );

                        function setTimeout(toast, time) {
                            toast.timeoutPromise = $interval(
                                function() {
                                    scope.removeToast(toast.toastId);
                                }, time, 1
                            );
                        }

                        scope.configureTimer = function(toast) {
                            var timeout = angular.isNumber(toast.timeout) ? toast.timeout : mergedConfig['time-out'];
                            if (typeof timeout === "object") timeout = timeout[toast.type];
                            if (timeout > 0) {
                                setTimeout(toast, timeout);
                            }
                        };

                        function addToast(toast, toastId) {
                            toast.type = mergedConfig['icon-classes'][toast.type];
                            if (!toast.type) {
                                toast.type = mergedConfig['icon-class'];
                            }

                            if (mergedConfig['prevent-duplicates'] === true && scope.toasters.length) {
                                if (scope.toasters[scope.toasters.length - 1].body === toast.body) {
                                    return;
                                } else {
                                    var i, len, dupFound = false;
                                    for (i = 0, len = scope.toasters.length; i < len; i++) {
                                        if (scope.toasters[i].toastId === toastId) {
                                            dupFound = true;
                                            break;
                                        }
                                    }
                                    
                                    if (dupFound) return;
                                }
                            }


                            // set the showCloseButton property on the toast so that
                            // each template can bind directly to the property to show/hide
                            // the close button
                            var closeButton = mergedConfig['close-button'];

                            // if toast.showCloseButton is a boolean value,
                            // it was specifically overriden in the pop arguments
                            if (typeof toast.showCloseButton === "boolean") {

                            } else if (typeof closeButton === "boolean") {
                                toast.showCloseButton = closeButton;
                            } else if (typeof closeButton === "object") {
                                var closeButtonForType = closeButton[toast.type];

                                if (typeof closeButtonForType !== "undefined" && closeButtonForType !== null) {
                                    toast.showCloseButton = closeButtonForType;
                                }
                            } else {
                                // if an option was not set, default to false.
                                toast.showCloseButton = false;
                            }

                            if (toast.showCloseButton) {
                                toast.closeHtml = $sce.trustAsHtml(toast.closeHtml || scope.config.closeHtml);
                            }

                            // Set the toast.bodyOutputType to the default if it isn't set
                            toast.bodyOutputType = toast.bodyOutputType || mergedConfig['body-output-type'];
                            switch (toast.bodyOutputType) {
                                case 'trustedHtml':
                                    toast.html = $sce.trustAsHtml(toast.body);
                                    break;
                                case 'template':
                                    toast.bodyTemplate = toast.body || mergedConfig['body-template'];
                                    break;
                                case 'templateWithData':
                                    var fcGet = $parse(toast.body || mergedConfig['body-template']);
                                    var templateWithData = fcGet(scope);
                                    toast.bodyTemplate = templateWithData.template;
                                    toast.data = templateWithData.data;
                                    break;
                                case 'directive':
                                    toast.html = toast.body;
                                    break;
                            }

                            scope.configureTimer(toast);

                            if (mergedConfig['newest-on-top'] === true) {
                                scope.toasters.unshift(toast);
                                if (mergedConfig['limit'] > 0 && scope.toasters.length > mergedConfig['limit']) {
                                    removeToast(scope.toasters.length - 1);
                                }
                            } else {
                                scope.toasters.push(toast);
                                if (mergedConfig['limit'] > 0 && scope.toasters.length > mergedConfig['limit']) {
                                    removeToast(0);
                                }
                            }

                            if (angular.isFunction(toast.onShowCallback)) {
                                toast.onShowCallback(toast);
                            }
                        }

                        scope.removeToast = function(toastId) {
                            var i, len;
                            for (i = 0, len = scope.toasters.length; i < len; i++) {
                                if (scope.toasters[i].toastId === toastId) {
                                    removeToast(i);
                                    break;
                                }
                            }
                        };

                        function removeToast(toastIndex) {
                            var toast = scope.toasters[toastIndex];

                            // toast is always defined since the index always has a match
                            if (toast.timeoutPromise) {
                                $interval.cancel(toast.timeoutPromise);
                            }
                            scope.toasters.splice(toastIndex, 1);

                            if (angular.isFunction(toast.onHideCallback)) {
                                toast.onHideCallback(toast);
                            }
                        }

                        function removeAllToasts(toastId) {
                            for (var i = scope.toasters.length - 1; i >= 0; i--) {
                                if (isUndefinedOrNull(toastId)) {
                                    removeToast(i);
                                } else {
                                    if (scope.toasters[i].toastId == toastId) {
                                        removeToast(i);
                                    }
                                }
                            }
                        }

                        scope.toasters = [];

                        function isUndefinedOrNull(val) {
                            return angular.isUndefined(val) || val === null;
                        }

                        scope._onNewToast = function(event, toasterId, toastId) {
                            // Compatibility: if toaster has no toasterId defined, and if call to display
                            // hasn't either, then the request is for us
                            if ((isUndefinedOrNull(scope.config.toasterId) && isUndefinedOrNull(toasterId)) || (!isUndefinedOrNull(scope.config.toasterId) && !isUndefinedOrNull(toasterId) && scope.config.toasterId == toasterId)) {
                                addToast(toaster.toast, toastId);
                            }
                        };
                        scope._onClearToasts = function(event, toasterId, toastId) {
                            // Compatibility: if toaster has no toasterId defined, and if call to display
                            // hasn't either, then the request is for us
                            if (toasterId == '*' || (isUndefinedOrNull(scope.config.toasterId) && isUndefinedOrNull(toasterId)) || (!isUndefinedOrNull(scope.config.toasterId) && !isUndefinedOrNull(toasterId) && scope.config.toasterId == toasterId)) {
                                removeAllToasts(toastId);
                            }
                        };

                        toasterEventRegistry.setup();

                        toasterEventRegistry.subscribeToNewToastEvent(scope._onNewToast);
                        toasterEventRegistry.subscribeToClearToastsEvent(scope._onClearToasts);
                    }
391710
function loadController(controllersDirectory, controller, development) {
    const filePath = path.resolve(controllersDirectory, controller);
    try {
        return require(filePath);
    } catch (e) {
        if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf("Cannot find module '" + filePath + "'") === 0 && development) {
            console.error('Cannot find controller: ' + filePath);
            return null;
        } else {
            throw e;
        }
    }
}
907118
function DatePickerCtrl($scope, $element, $attrs, $window, $mdConstant, $mdTheming, $mdUtil,
                          $mdDateLocale, $$mdDateUtil, $$rAF, $filter, $timeout) {

    /** @final */
    this.$window = $window;

    /** @final */
    this.dateUtil = $$mdDateUtil;

    /** @final */
    this.$mdConstant = $mdConstant;

    /** @final */
    this.$mdUtil = $mdUtil;

    /** @final */
    this.$$rAF = $$rAF;

    /** @final */
    this.$mdDateLocale = $mdDateLocale;

    /** @final */
    this.$timeout = $timeout;

    /**
     * The root document element. This is used for attaching a top-level click handler to
     * close the calendar panel when a click outside said panel occurs. We use `documentElement`
     * instead of body because, when scrolling is disabled, some browsers consider the body element
     * to be completely off the screen and propagate events directly to the html element.
     * @type {!angular.JQLite}
     */
    this.documentElement = angular.element(document.documentElement);

    /** @type {!angular.NgModelController} */
    this.ngModelCtrl = null;

    /** @type {HTMLInputElement} */
    this.inputElement = $element[0].querySelector('input');

    /** @final {!angular.JQLite} */
    this.ngInputElement = angular.element(this.inputElement);

    /** @type {HTMLElement} */
    this.inputContainer = $element[0].querySelector('.md-datepicker-input-container');

    /** @type {HTMLElement} Floating calendar pane. */
    this.calendarPane = $element[0].querySelector('.md-datepicker-calendar-pane');

    /** @type {HTMLElement} Calendar icon button. */
    this.calendarButton = $element[0].querySelector('.md-datepicker-button');

    /**
     * Element covering everything but the input in the top of the floating calendar pane.
     * @type {!angular.JQLite}
     */
    this.inputMask = angular.element($element[0].querySelector('.md-datepicker-input-mask-opaque'));

    /** @final {!angular.JQLite} */
    this.$element = $element;

    /** @final {!angular.Attributes} */
    this.$attrs = $attrs;

    /** @final {!angular.Scope} */
    this.$scope = $scope;

    /** @type {Date} */
    this.date = null;

    /** @type {boolean} */
    this.isFocused = false;

    /** @type {boolean} */
    this.isDisabled;
    this.setDisabled($element[0].disabled || angular.isString($attrs.disabled));

    /** @type {boolean} Whether the date-picker's calendar pane is open. */
    this.isCalendarOpen = false;

    /** @type {boolean} Whether the calendar should open when the input is focused. */
    this.openOnFocus = $attrs.hasOwnProperty('mdOpenOnFocus');

    /** @final */
    this.mdInputContainer = null;

    /**
     * Element from which the calendar pane was opened. Keep track of this so that we can return
     * focus to it when the pane is closed.
     * @type {HTMLElement}
     */
    this.calendarPaneOpenedFrom = null;

    /** @type {String} Unique id for the calendar pane. */
    this.calendarPaneId = 'md-date-pane-' + $mdUtil.nextUid();

    /** Pre-bound click handler is saved so that the event listener can be removed. */
    this.bodyClickHandler = angular.bind(this, this.handleBodyClick);

    /**
     * Name of the event that will trigger a close. Necessary to sniff the browser, because
     * the resize event doesn't make sense on mobile and can have a negative impact since it
     * triggers whenever the browser zooms in on a focused input.
     */
    this.windowEventName = IS_MOBILE_REGEX.test(
      navigator.userAgent || navigator.vendor || window.opera
    ) ? 'orientationchange' : 'resize';

    /** Pre-bound close handler so that the event listener can be removed. */
    this.windowEventHandler = $mdUtil.debounce(angular.bind(this, this.closeCalendarPane), 100);

    /** Pre-bound handler for the window blur event. Allows for it to be removed later. */
    this.windowBlurHandler = angular.bind(this, this.handleWindowBlur);

    /** The built-in AngularJS date filter. */
    this.ngDateFilter = $filter('date');

    /** @type {Number} Extra margin for the left side of the floating calendar pane. */
    this.leftMargin = 20;

    /** @type {Number} Extra margin for the top of the floating calendar. Gets determined on the first open. */
    this.topMargin = null;

    // Unless the user specifies so, the datepicker should not be a tab stop.
    // This is necessary because ngAria might add a tabindex to anything with an ng-model
    // (based on whether or not the user has turned that particular feature on/off).
    if ($attrs.tabindex) {
      this.ngInputElement.attr('tabindex', $attrs.tabindex);
      $attrs.$set('tabindex', null);
    } else {
      $attrs.$set('tabindex', '-1');
    }

    $attrs.$set('aria-owns', this.calendarPaneId);

    $mdTheming($element);
    $mdTheming(angular.element(this.calendarPane));

    var self = this;

    $scope.$on('$destroy', function() {
      self.detachCalendarPane();
    });

    if ($attrs.mdIsOpen) {
      $scope.$watch('ctrl.isOpen', function(shouldBeOpen) {
        if (shouldBeOpen) {
          self.openCalendarPane({
            target: self.inputElement
          });
        } else {
          self.closeCalendarPane();
        }
      });
    }

    // For AngularJS 1.4 and older, where there are no lifecycle hooks but bindings are pre-assigned,
    // manually call the $onInit hook.
    if (angular.version.major === 1 && angular.version.minor <= 4) {
      this.$onInit();
    }

  }
122503
function($animate, joyrideService, $compile, $templateRequest, $timeout, $window){
    return {
      restrict: 'E',
      scope: {},
      template: '<div class="jr_overlay"></div>',
      link: function(scope, element, attrs){
        scope.joyride = joyrideService;
        var joyrideContainer,
            // overlay = '<div class="jr_overlay"></div>',
            template;

        angular.element($window).bind('resize', function(){
          if (scope.joyride.start) {
            setPos();
          }
        });

        function appendJoyride(){
          var appendHtml = $compile(template)(scope),
              currentStep = scope.joyride.config.steps[scope.joyride.current],
              divElement = angular.element(document.querySelector('body')),
              hasSelectedElement = false;

          if (currentStep.type === 'element' && !currentStep.appendToBody) {
            var tempElement = angular.element(document.querySelector(currentStep.selector));
            if (tempElement.length) {
              hasSelectedElement = true;
              divElement = tempElement;
            }
            else {
              console.warn('Could not find element with selector:', currentStep.selector);
            }
          }

          divElement.append(appendHtml);
          joyrideContainer = document.querySelector('.jr_container');

          /********************************************
          When joyride is nested inside an element this
          prevents any functions or state changes that are
          binded to the parentfrom executing when
          clicking on the joyride
          ********************************************/
          if (hasSelectedElement) {
            angular.element(joyrideContainer).on('click', function(event) {
              event.preventDefault();
              event.stopPropagation();
            });
          }

          angular.element(joyrideContainer).append("<div class='triangle'></div>");
          if (scope.joyride.start) {
            if (!scope.joyride.transitionStep) {
              angular.element(joyrideContainer).addClass('jr_start').addClass('jr_transition');
            }
          }

        }

        function removeJoyride(){
          angular.element(joyrideContainer).remove();
        }

        //////// Watching for change in the start variable
          scope.$watch('joyride.start', function(show, oldShow) {
            if (show !== oldShow || show === true) {

              //////// Joyride was opened
              if (show) {
                template = scope.joyride.config.template || 'ngJoyrideDefault.html';
                $templateRequest(template,false).then(function (html) {
                  template=html;
                  angular.element(document.querySelector('body')).addClass('jr_active');
                  if (scope.joyride.config.overlay !== false) {
                    angular.element(document.querySelector('body')).addClass('jr_overlay_show');
                  }

                  if (typeof scope.joyride.config.steps[scope.joyride.current].beforeStep === "function") {
                    scope.joyride.config.steps[scope.joyride.current].beforeStep(start);
                  }

                  else{
                    start();
                  }
                });

                function start(){
                  appendJoyride();
                    $animate.addClass(joyrideContainer, 'jr_start').then(scope.joyride.config.onStart);
                    setPos();
                }
              }

              ////////// Joyride was closed
              if (!show) {
                $animate.removeClass(joyrideContainer, 'jr_start').then(joyrideEnded);
              }
          }
        });

        //////////// Watching for transition trigger
        scope.$watch('joyride.transitionStep', function(val, oldVal) {
          if (val !== oldVal && scope.joyride.start) {
            if (val) {

              if (val == 'next' && scope.joyride.current == scope.joyride.config.steps.length-1) {
                scope.joyride.start = false;
              }

              else if (val == 'prev' && scope.joyride.current == 0) {
                return;
              }

              else{
                $animate.addClass(joyrideContainer, 'jr_transition').then(beforeTransition);
              }

            }
            if (!val) {
              $animate.removeClass(joyrideContainer, 'jr_transition');
            }
          }
        });

        ////// check for afterStep function before going to next step
        function beforeTransition(){
          if (typeof scope.joyride.config.steps[scope.joyride.current].afterStep === "function") {
            scope.joyride.config.steps[scope.joyride.current].afterStep(afterTransition);
          }

          else{
            afterTransition();
          }
        }

        ////// Remove -> Append joyride and transition in
        scope.joyride.resumeJoyride = function(){
          if (!scope.joyride.start) {
            return;
          }
          scope.joyride.transitionStep = false;
          if (typeof scope.joyride.config.onStepChange === "function") {
            scope.joyride.config.onStepChange();
          }
          removeJoyride();
          appendJoyride();
          $timeout(function(){
            setPos();
          })
        }


        ////// Set position and current step after joyride transitions out
        function afterTransition(){

          ////// transitions in the next step
            if (scope.joyride.transitionStep == 'next') {
              scope.joyride.current++;
            }
            else{
              scope.joyride.current--;
            }

            /********************************************
            if step contains a beforeStep function
            execute it first before transitioning in
            else just transition in
            ********************************************/
              if (typeof scope.joyride.config.steps[scope.joyride.current].beforeStep === "function") {
                scope.joyride.config.steps[scope.joyride.current].beforeStep(scope.joyride.resumeJoyride);
              }

              else{
                scope.joyride.resumeJoyride();
              }

        }

        // Reset variables after joyride ends
        var joyrideEnded = function(){
          angular.element(document.querySelector('body')).removeClass('jr_active jr_overlay_show');
          removeJoyride();
          scope.joyride.current = 0;
          scope.joyride.transitionStep = true;
          if (typeof scope.joyride.config.onFinish === "function") {
            scope.joyride.config.onFinish();
          }
          if (document.querySelector(".jr_target")) {
            angular.element(document.querySelector(".jr_target")).removeClass('jr_target');
          }
        }

       // Handles joyride positioning
        function setPos(){
          var currentStep = scope.joyride.config.steps[scope.joyride.current];

          $timeout(function(){

            removeClassByPrefix(joyrideContainer, "jr_pos_");
            var step = scope.joyride.config.steps[scope.joyride.current];
            

          // If step type equals 'element' set position and styles
          if (step.type == 'element' && document.querySelector(step.selector)) {
            joyrideContainer.removeAttribute('style');
            angular.element(joyrideContainer).addClass('jr_element');
            

            if (document.querySelector(".jr_target")) {
              angular.element(document.querySelector(".jr_target")).removeClass('jr_target');  
            }
            
            var jrElement = angular.element(document.querySelector(step.selector));
            var position = getElementOffset(jrElement[0]);
            var window_width = window.innerWidth;

            var jrWidth = joyrideContainer.offsetWidth;
            var targetWidth = jrElement[0].offsetWidth;
            
            var jrHeight = joyrideContainer.clientHeight;
            var targetHeight = jrElement[0].clientHeight;
                
            jrElement.addClass('jr_target');

            /********************************************
            Check where the step should be positioned then 
            change the position property accordingly
            ********************************************/
            var placement = step.placement || 'bottom';
            if (step.responsive && window_width < step.responsive.breakpoint) {
              placement = step.responsive.placement || 'bottom';
            }

            angular.element(joyrideContainer).addClass('jr_pos_'+placement);

            if (currentStep.appendToBody){
              if (placement === 'top' || placement === 'bottom') {
                if (placement === 'top') {
                  position.top -= jrHeight + 20;
                }

                else {
                  position.top += targetHeight + 20;
                }
                

                position.left = ((position.left + targetWidth/2) - jrWidth/2 );
                
              }

              else{
                
                
                position.top = ((position.top + targetHeight/2) - jrHeight/2 );
                if (placement === 'left') {
                  position.left -= jrWidth + 20;

                }

                else {
                  position.left += targetWidth + 20;
                }

              }

              // Set joyride position
              joyrideContainer.style.left = position.left + 'px';
              joyrideContainer.style.top = position.top + 'px';
              joyrideContainer.style.right = 'auto';
              joyrideContainer.style.bottom = 'auto';
              joyrideContainer.style.transform = 'none';
              
            
            }

            /** 
            Check if Joyride is out of bounds and adjust position
            */
            
            var joyridePosition = getElementOffset(joyrideContainer);

            /**
            Handle top/bottom cases
            */
            if(placement !== "left" && placement !== "right"){

              if(joyridePosition.left < 0){
                var triangle = document.querySelector(".jr_container .triangle");
                triangle.style.left = (targetWidth/2 - triangle.offsetWidth/2)  + 'px';
                triangle.style.right = "auto";
                joyrideContainer.style.left = 0;
                joyrideContainer.style.right = "auto";
              }

              else if((joyridePosition.left + jrWidth) > window_width){
                var tempPos = joyridePosition.left + (jrWidth/2)
                var triangle = document.querySelector(".jr_container .triangle");
                triangle.style.right = (targetWidth/2 - triangle.offsetWidth/2)  + 'px';
                triangle.style.left = "auto";
                joyrideContainer.style.left = "auto";
                joyrideContainer.style.right = 0;
              }
            }
            

            /**
            Handle left/right cases
            */
            else{

              if(joyridePosition.top < 0){
                var triangle = document.querySelector(".jr_container .triangle");
                var trianglePos = targetHeight/2 - triangle.offsetHeight/2;
                triangle.style.top = trianglePos < 0 ? 0 + "px" : trianglePos + "px";

                triangle.style.bottom = "auto";
                joyrideContainer.style.top = 0;
                joyrideContainer.style.transform = "none";
              }

            }

            // Scroll to element if scroll is enabled
              if (step.scroll !== false) {
                if (placement === 'bottom') {
                  scroll_pos = position.top - targetHeight;
                }
                else if(placement === 'top'){
                  scroll_pos = position.top - jrHeight;
                }
                else{
                  if(targetHeight < jrHeight){
                    scroll_pos = position.top -  (jrHeight - targetHeight) /2;
                  }
                }
                
                scrollToElement(scroll_pos);
              }
          }


          // If step isn't an element
          else{
            angular.element(joyrideContainer).removeClass('jr_element');
            if (document.querySelector(".jr_target")) {
              angular.element(document.querySelector(".jr_target")).removeClass('jr_target');  
            }
            joyrideContainer.style.left = '';
            joyrideContainer.style.top = getScroll(placement, joyrideContainer) + 100 + 'px';
          }
      });

        }
      }

    }

  }
1124836
function Controller (gateway, svcopts, svc) {
    // Add DebugTool to log messages
    this.uid    = "Controller://" + svcopts.info + "/" + svcopts.adapter + ":" + svcopts.port;
    this.debug  = gateway.opts.services.debug || gateway.debug;
    this.svcopts= svcopts;
    this.gateway= gateway;
    this.svc    = svc;

    // take care or default adapter svcopts
    if (svcopts.mindist  === undefined) this.svcopts.mindist =200; // in m
    if (svcopts.maxtime  === undefined) this.svcopts.maxtime =3600;// in s == 1h
    if (svcopts.maxspeed === undefined) this.svcopts.maxspeed=100;  // in 100m/s=~400km/h
    if (svcopts.debug    === undefined) this.svcopts.debug   =this.debug;
    if (svcopts.debug    === undefined) this.svcopts.debug   =this.debug;
    if (svcopts.hostname === undefined) this.svcopts.hostname='localhost';
    if (svcopts.timeout  === undefined) this.svcopts.timeout=60;
    if (svcopts.maxerrors=== undefined) this.svcopts.maxerrors=2;
    // load device adapter as described within svcopts option from user application
    try {
        var  adapter  =  require(availableAdapters [svcopts.adapter]);  
    } catch (err) {
        this.Debug (0, 'Invalid adapter name : [%s] Error=%s', svcopts.adapter, err);
        console.log ("gateway aborted");
        process.exit();
    }
    this.adapter           =  new adapter (this);
    
    // Depending on adapter's control type logic for handling tcp socket change
    switch (this.adapter.control) {
    case 'tcpsock':
        // in tcpsock mode gateway uses tcp session to track a given device.
        // Each time a new client raises, it creates a new TcpConnect and attaches
        // a SockClient object to it. Device handler is then called from SockClient.
        this.tcpServer           = net.createServer(TcpConnect);
        this.tcpServer.uid       = "TcpServer://" + svcopts.adapter + ':' + svcopts.port;
        this.tcpServer.evtname   = 'data';
        this.tcpServer.controller= this;
        this.tcpServer.adapter   = this.adapter;
        this.tcpServer.count     = 0;   // number of active tcp clients 
        this.tcpServer.listen(svcopts.port, TcpSvrListenOk); 
        this.tcpServer.on('error', TcpSvrListenFx);
        break;
    case 'websock':
        // websocket start like an http connection and endup as a TcpConnect
        var adapter = this.adapter;
        var webSockOpts=
            {port         :svcopts.port
            ,verifyClient :function(info, callback){WebSockVerify(adapter, info, callback)}
        }
        this.wsServer=new webSocket (webSockOpts);
        this.wsServer.uid = "websock://" + svcopts.adapter + ':' + svcopts.port;
        this.wsServer.controller = this;
        this.wsServer.adapter   = this.adapter;
        this.wsServer.evtname   = 'message';
        this.wsServer.on('listening', TcpSvrListenOk);
        this.wsServer.on('connection',TcpConnect);
        break;
    case 'http':
        // in http mode, gateway cannot use tcp session to handle device, and deviceID
        // has to be present in each http/post. HttpRequest function calls
        // device adapter specific functions directly. The adapter creates
        // an HttpClient object based on devID present within each http/post request.
        this.tcpServer           = http.createServer(HttpRequest);
        this.tcpServer.uid       = "HttpServer://" + svcopts.adapter + ':' + svcopts.port;
        this.tcpServer.controller= this;
        this.tcpServer.adapter   = this.adapter;
        this.tcpServer.svcopts   = svcopts;
        this.tcpServer.listen(svcopts.port, TcpSvrListenOk); 
        this.tcpServer.on('error', TcpSvrListenFx);
        break;
    case 'tcpfeed':
        // in tcpfeed, gateway is a client of a remote server. And only one svcopts is
        // attached to a given instance of an adapter. Connected being unique it
        // is directly handled at adapter level.
        this.tcpClient           =  net.createConnection(svcopts.remport, svcopts.hostname);
        this.tcpClient.uid       = "TcpClient://" + svcopts.adapter + ':' + svcopts.remport;
        this.tcpClient.controller = this;
        this.tcpClient.adapter   = this.adapter;
        this.tcpClient.svcopts   = svcopts;
        this.tcpClient.on('connect', TcpClientConnect);
        this.tcpClient.on('data'   , TcpClientData); 
        this.tcpClient.on('end'    , TcpClientEnd);
        this.tcpClient.on('error'  , TcpClientError);
        break;
    default:
        this.Debug (0,"Hoops Invalid control class [%s] adapter [%s] class", adapter.control, availableAdapters [svcopts.adapter]);
    }
}
783960
function MdListController($scope, $element, $mdListInkRipple) {
  var ctrl = this;
  ctrl.attachRipple = attachRipple;

  function attachRipple (scope, element) {
    var options = {};
    $mdListInkRipple.attach(scope, element, options);
  }
}
261464
public <C extends Controller> AbstractModule controller(Class<C> klass) {
        String name = klass.getName();
        JSClosure constructor = JSClosure.create(new DefaultControllerConstructor<C>(name, klass));
        ControllerDependencyInspector inspector = GWT.create(ControllerDependencyInspector.class);
        JSArray<String> dependencies = JSArray.create(inspector.inspect(klass));
        dependencies.unshift("$scope");
        ngo.controller(name, dependencies, constructor);
        return this;
    }
200801
function () {
			var $dp = this.inst.dpDiv,
				o = this.inst.settings,
				tp_inst = this,
				litem = '',
				uitem = '',
				show = null,
				max = {},
				gridSize = {},
				size = null,
				i = 0,
				l = 0;

			// Prevent displaying twice
			if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
				var noDisplay = ' ui_tpicker_unit_hide',
					html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' +
								'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';

				// Create the markup
				for (i = 0, l = this.units.length; i < l; i++) {
					litem = this.units[i];
					uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
					show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];

					// Added by Peter Medeiros:
					// - Figure out what the hour/minute/second max should be based on the step values.
					// - Example: if stepMinute is 15, then minMax is 45.
					max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
					gridSize[litem] = 0;

					html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' +
								'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';

					if (show && o[litem + 'Grid'] > 0) {
						html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';

						if (litem === 'hour') {
							for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
								gridSize[litem]++;
								var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
								html += '<td data-for="' + litem + '">' + tmph + '</td>';
							}
						}
						else {
							for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
								gridSize[litem]++;
								html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
							}
						}

						html += '</tr></table></div>';
					}
					html += '</dd>';
				}
				
				// Timezone
				var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
				html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>';
				html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>';

				// Create the elements from string
				html += '</dl></div>';
				var $tp = $(html);

				// if we only want time picker...
				if (o.timeOnly === true) {
					$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
					$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
				}
				
				// add sliders, adjust grids, add events
				for (i = 0, l = tp_inst.units.length; i < l; i++) {
					litem = tp_inst.units[i];
					uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
					show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];

					// add the slider
					tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);

					// adjust the grid and add click event
					if (show && o[litem + 'Grid'] > 0) {
						size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
						$tp.find('.ui_tpicker_' + litem + ' table').css({
							width: size + "%",
							marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"),
							marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
							borderCollapse: 'collapse'
						}).find("td").click(function (e) {
								var $t = $(this),
									h = $t.html(),
									n = parseInt(h.replace(/[^0-9]/g), 10),
									ap = h.replace(/[^apm]/ig),
									f = $t.data('for'); // loses scope, so we use data-for

								if (f === 'hour') {
									if (ap.indexOf('p') !== -1 && n < 12) {
										n += 12;
									}
									else {
										if (ap.indexOf('a') !== -1 && n === 12) {
											n = 0;
										}
									}
								}
								
								tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);

								tp_inst._onTimeChange();
								tp_inst._onSelectHandler();
							}).css({
								cursor: 'pointer',
								width: (100 / gridSize[litem]) + '%',
								textAlign: 'center',
								overflow: 'hidden'
							});
					} // end if grid > 0
				} // end for loop

				// Add timezone options
				this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
				$.fn.append.apply(this.timezone_select,
				$.map(o.timezoneList, function (val, idx) {
					return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
				}));
				if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
					var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
					if (local_timezone === this.timezone) {
						selectLocalTimezone(tp_inst);
					} else {
						this.timezone_select.val(this.timezone);
					}
				} else {
					if (typeof(this.hour) !== "undefined" && this.hour !== null && this.hour !== "") {
						this.timezone_select.val(o.timezone);
					} else {
						selectLocalTimezone(tp_inst);
					}
				}
				this.timezone_select.change(function () {
					tp_inst._onTimeChange();
					tp_inst._onSelectHandler();
					tp_inst._afterInject();
				});
				// End timezone options
				
				// inject timepicker into datepicker
				var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
				if ($buttonPanel.length) {
					$buttonPanel.before($tp);
				} else {
					$dp.append($tp);
				}

				this.$timeObj = $tp.find('.ui_tpicker_time_input');
				this.$timeObj.change(function () {
					var timeFormat = tp_inst.inst.settings.timeFormat;
					var parsedTime = $.datepicker.parseTime(timeFormat, this.value);
					var update = new Date();
					if (parsedTime) {
						update.setHours(parsedTime.hour);
						update.setMinutes(parsedTime.minute);
						update.setSeconds(parsedTime.second);
						$.datepicker._setTime(tp_inst.inst, update);
					} else {
						this.value = tp_inst.formattedTime;
						this.blur();
					}
				});

				if (this.inst !== null) {
					var timeDefined = this.timeDefined;
					this._onTimeChange();
					this.timeDefined = timeDefined;
				}

				// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
				if (this._defaults.addSliderAccess) {
					var sliderAccessArgs = this._defaults.sliderAccessArgs,
						rtl = this._defaults.isRTL;
					sliderAccessArgs.isRTL = rtl;
						
					setTimeout(function () { // fix for inline mode
						if ($tp.find('.ui-slider-access').length === 0) {
							$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);

							// fix any grids since sliders are shorter
							var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
							if (sliderAccessWidth) {
								$tp.find('table:visible').each(function () {
									var $g = $(this),
										oldWidth = $g.outerWidth(),
										oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
										newWidth = oldWidth - sliderAccessWidth,
										newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
										css = { width: newWidth, marginRight: 0, marginLeft: 0 };
									css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
									$g.css(css);
								});
							}
						}
					}, 10);
				}
				// end slideAccess integration

				tp_inst._limitMinMaxDateTime(this.inst, true);
			}
		}
246278
function notifyController($scope, $rootScope) {

    /**
     * Default settings
     */
    var DEFAULT_STATUS = "info";
    var DEFAULT_HEADING = "Browsersync:";
    var DEFAULT_MESSAGE = "Welcome to Browsersync";
    var DEFAULT_TIMEOUT = 2000;

    /**
     * Default state
     * @type {{visible: boolean, status: string, heading: string, text: string}}
     */
    $scope.ui = {
        status: DEFAULT_STATUS,
        heading: DEFAULT_HEADING,
        message: DEFAULT_MESSAGE
    };

    /**
     * @param evt
     * @param data
     */
    $scope.show = function (evt, data) {

        data = data || {};

        /**
         *
         * Clear any previous timers
         *
         */
        if ($scope._timer) {
            clearTimeout($scope._timer);
        }

        /**
         *
         * Set a reset timer
         *
         */
        $scope._timer = window.setTimeout($scope.reset, data.timeout || DEFAULT_TIMEOUT);

        /**
         *
         * Set UI flags
         *
         */
        $scope.ui.visible = true;
        $scope.ui.status = data.status || DEFAULT_STATUS;
        $scope.ui.heading = data.heading || DEFAULT_HEADING;
        $scope.ui.message = data.message || DEFAULT_HEADING;
    };

    /**
     * Reset the UI
     */
    $scope.reset = function () {
        $scope.ui.visible = false;
        $scope.$digest();
    };

    /**
     * Listen to events on the $rootScope
     */
    $rootScope.$on("notify:flash", $scope.show);
}
598801
function () {
		// Create Layout
		this._el.attribution 				= TL.Dom.create('div', 'tl-attribution', this._el.container);
		this._el.line						= TL.Dom.create('div', 'tl-timenav-line', this._el.container);
		this._el.slider						= TL.Dom.create('div', 'tl-timenav-slider', this._el.container);
		this._el.slider_background			= TL.Dom.create('div', 'tl-timenav-slider-background', this._el.slider);
		this._el.marker_container_mask		= TL.Dom.create('div', 'tl-timenav-container-mask', this._el.slider);
		this._el.marker_container			= TL.Dom.create('div', 'tl-timenav-container', this._el.marker_container_mask);
		this._el.marker_item_container		= TL.Dom.create('div', 'tl-timenav-item-container', this._el.marker_container);
		this._el.timeaxis 					= TL.Dom.create('div', 'tl-timeaxis', this._el.slider);
		this._el.timeaxis_background 		= TL.Dom.create('div', 'tl-timeaxis-background', this._el.container);


		// Knight Lab Logo
		this._el.attribution.innerHTML = "<a href='http://timeline.knightlab.com' target='_blank'><span class='tl-knightlab-logo'></span>Timeline JS</a>"

		// Time Axis
		this.timeaxis = new TL.TimeAxis(this._el.timeaxis, this.options);

		// Swipable
		this._swipable = new TL.Swipable(this._el.slider_background, this._el.slider, {
			enable: {x:true, y:false},
			constraint: {top: false,bottom: false,left: (this.options.width/2),right: false},
			snap: 	false
		});
		this._swipable.enable();

	}