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EAAE5hB,KAAK,CAAE+2B,KAAM,SAAUC,KAAM,YAAa,SAAU55C,EAAQ65C,GAC5DrV,EAAE4Q,OAAOjnC,UAAU,IAAMnO,GAAU,SAAUxM,EAASkD,EAAS0H,GAK7D,IAAI07C,EAJmB,kBAAZpjD,IACTA,EAAU,CAAEqjD,OAAQrjD,IAItB,IAAIsjD,EAActjD,GAEF,IAAZA,GAAuC,kBAAZA,EAC3BmjD,EACAnjD,EAAQqjD,QAAUF,EAHlB75C,EAMmB,kBADvBtJ,EAAUA,GAAW,CAAC,KAEpBA,EAAU,CAAEyC,SAAUzC,IAGxBojD,GAActV,EAAEyV,cAAcvjD,GAC9BA,EAAQ6M,SAAWnF,EAEf1H,EAAQmE,OACVrH,EAAQqH,MAAMnE,EAAQmE,OAGpBi/C,GAActV,EAAE0V,SAAW1V,EAAE0V,QAAQH,OAAOC,GAC9CxmD,EAAQwM,GAAQtJ,GACPsjD,IAAeh6C,GAAUxM,EAAQwmD,GAC1CxmD,EAAQwmD,GAAYtjD,EAAQyC,SAAUzC,EAAQgO,OAAQtG,GAEtD5K,EAAQ6hB,OAAM,SAAU8kC,GACtB3V,EAAErnC,MAAM6C,KACJ5B,GACFA,EAASoT,KAAKhe,EAAQ,IAExB2mD,GACF,GAEJ,CACF,IAzuBc,IAAWzF,CA0uB3B,OAxxB8B,2DAQ7B,CAZD","sources":["webpack://typist6/../../app/.yarn/berry/cache/angular-animate-npm-1.5.5-bc6bc50806-10c0.zip/node_modules/angular-animate/angular-animate.js","webpack://typist6/../../app/.yarn/berry/cache/angular-animate-npm-1.5.5-bc6bc50806-10c0.zip/node_modules/angular-animate/index.js","webpack://typist6/../../app/.yarn/berry/cache/angular-spinner-npm-1.0.1-b3c4f309cb-10c0.zip/node_modules/angular-spinner/dist/angular-spinner.js","webpack://typist6/../../app/.yarn/berry/cache/chart.js-npm-1.0.2-e46d67b78d-10c0.zip/node_modules/chart.js/Chart.js","webpack://typist6/./.yarn/__virtual__/blueimp-file-upload-virtual-01aef51c15/3/app/.yarn/berry/cache/blueimp-file-upload-npm-10.32.0-61b944a244-10c0.zip/node_modules/blueimp-file-upload/js/jquery.fileupload.js","webpack://typist6/./.yarn/__virtual__/blueimp-file-upload-virtual-01aef51c15/3/app/.yarn/berry/cache/blueimp-file-upload-npm-10.32.0-61b944a244-10c0.zip/node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js"],"sourcesContent":["/**\n * @license AngularJS v1.5.5\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/* jshint ignore:start */\nvar noop = angular.noop;\nvar copy = angular.copy;\nvar extend = angular.extend;\nvar jqLite = angular.element;\nvar forEach = angular.forEach;\nvar isArray = angular.isArray;\nvar isString = angular.isString;\nvar isObject = angular.isObject;\nvar isUndefined = angular.isUndefined;\nvar isDefined = angular.isDefined;\nvar isFunction = angular.isFunction;\nvar isElement = angular.isElement;\n\nvar ELEMENT_NODE = 1;\nvar COMMENT_NODE = 8;\n\nvar ADD_CLASS_SUFFIX = '-add';\nvar REMOVE_CLASS_SUFFIX = '-remove';\nvar EVENT_CLASS_PREFIX = 'ng-';\nvar ACTIVE_CLASS_SUFFIX = '-active';\nvar PREPARE_CLASS_SUFFIX = '-prepare';\n\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\nvar NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';\n\n// Detect proper transitionend/animationend event names.\nvar CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n// If unprefixed events are not supported but webkit-prefixed are, use the latter.\n// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n// Register both events in case `window.onanimationend` is not supported because of that,\n// do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n// therefore there is no reason to test anymore for other vendor prefixes:\n// http://caniuse.com/#search=transition\nif (isUndefined(window.ontransitionend) && isDefined(window.onwebkittransitionend)) {\n CSS_PREFIX = '-webkit-';\n TRANSITION_PROP = 'WebkitTransition';\n TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n} else {\n TRANSITION_PROP = 'transition';\n TRANSITIONEND_EVENT = 'transitionend';\n}\n\nif (isUndefined(window.onanimationend) && isDefined(window.onwebkitanimationend)) {\n CSS_PREFIX = '-webkit-';\n ANIMATION_PROP = 'WebkitAnimation';\n ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n} else {\n ANIMATION_PROP = 'animation';\n ANIMATIONEND_EVENT = 'animationend';\n}\n\nvar DURATION_KEY = 'Duration';\nvar PROPERTY_KEY = 'Property';\nvar DELAY_KEY = 'Delay';\nvar TIMING_KEY = 'TimingFunction';\nvar ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\nvar ANIMATION_PLAYSTATE_KEY = 'PlayState';\nvar SAFE_FAST_FORWARD_DURATION_VALUE = 9999;\n\nvar ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;\nvar ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;\nvar TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;\nvar TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;\n\nvar isPromiseLike = function(p) {\n return p && p.then ? true : false;\n};\n\nvar ngMinErr = angular.$$minErr('ng');\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n }\n return arg;\n}\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction packageStyles(options) {\n var styles = {};\n if (options && (options.to || options.from)) {\n styles.to = options.to;\n styles.from = options.from;\n }\n return styles;\n}\n\nfunction pendClasses(classes, fix, isPrefix) {\n var className = '';\n classes = isArray(classes)\n ? classes\n : classes && isString(classes) && classes.length\n ? classes.split(/\\s+/)\n : [];\n forEach(classes, function(klass, i) {\n if (klass && klass.length > 0) {\n className += (i > 0) ? ' ' : '';\n className += isPrefix ? fix + klass\n : klass + fix;\n }\n });\n return className;\n}\n\nfunction removeFromArray(arr, val) {\n var index = arr.indexOf(val);\n if (val >= 0) {\n arr.splice(index, 1);\n }\n}\n\nfunction stripCommentsFromElement(element) {\n if (element instanceof jqLite) {\n switch (element.length) {\n case 0:\n return [];\n break;\n\n case 1:\n // there is no point of stripping anything if the element\n // is the only element within the jqLite wrapper.\n // (it's important that we retain the element instance.)\n if (element[0].nodeType === ELEMENT_NODE) {\n return element;\n }\n break;\n\n default:\n return jqLite(extractElementNode(element));\n break;\n }\n }\n\n if (element.nodeType === ELEMENT_NODE) {\n return jqLite(element);\n }\n}\n\nfunction extractElementNode(element) {\n if (!element[0]) return element;\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType == ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction $$addClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.addClass(elm, className);\n });\n}\n\nfunction $$removeClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.removeClass(elm, className);\n });\n}\n\nfunction applyAnimationClassesFactory($$jqLite) {\n return function(element, options) {\n if (options.addClass) {\n $$addClass($$jqLite, element, options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n $$removeClass($$jqLite, element, options.removeClass);\n options.removeClass = null;\n }\n }\n}\n\nfunction prepareAnimationOptions(options) {\n options = options || {};\n if (!options.$$prepared) {\n var domOperation = options.domOperation || noop;\n options.domOperation = function() {\n options.$$domOperationFired = true;\n domOperation();\n domOperation = noop;\n };\n options.$$prepared = true;\n }\n return options;\n}\n\nfunction applyAnimationStyles(element, options) {\n applyAnimationFromStyles(element, options);\n applyAnimationToStyles(element, options);\n}\n\nfunction applyAnimationFromStyles(element, options) {\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n}\n\nfunction applyAnimationToStyles(element, options) {\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n}\n\nfunction mergeAnimationDetails(element, oldAnimation, newAnimation) {\n var target = oldAnimation.options || {};\n var newOptions = newAnimation.options || {};\n\n var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');\n var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');\n var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);\n\n if (newOptions.preparationClasses) {\n target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);\n delete newOptions.preparationClasses;\n }\n\n // noop is basically when there is no callback; otherwise something has been set\n var realDomOperation = target.domOperation !== noop ? target.domOperation : null;\n\n extend(target, newOptions);\n\n // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.\n if (realDomOperation) {\n target.domOperation = realDomOperation;\n }\n\n if (classes.addClass) {\n target.addClass = classes.addClass;\n } else {\n target.addClass = null;\n }\n\n if (classes.removeClass) {\n target.removeClass = classes.removeClass;\n } else {\n target.removeClass = null;\n }\n\n oldAnimation.addClass = target.addClass;\n oldAnimation.removeClass = target.removeClass;\n\n return target;\n}\n\nfunction resolveElementClasses(existing, toAdd, toRemove) {\n var ADD_CLASS = 1;\n var REMOVE_CLASS = -1;\n\n var flags = {};\n existing = splitClassesToLookup(existing);\n\n toAdd = splitClassesToLookup(toAdd);\n forEach(toAdd, function(value, key) {\n flags[key] = ADD_CLASS;\n });\n\n toRemove = splitClassesToLookup(toRemove);\n forEach(toRemove, function(value, key) {\n flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;\n });\n\n var classes = {\n addClass: '',\n removeClass: ''\n };\n\n forEach(flags, function(val, klass) {\n var prop, allow;\n if (val === ADD_CLASS) {\n prop = 'addClass';\n allow = !existing[klass];\n } else if (val === REMOVE_CLASS) {\n prop = 'removeClass';\n allow = existing[klass];\n }\n if (allow) {\n if (classes[prop].length) {\n classes[prop] += ' ';\n }\n classes[prop] += klass;\n }\n });\n\n function splitClassesToLookup(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n var obj = {};\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n }\n\n return classes;\n}\n\nfunction getDomNode(element) {\n return (element instanceof angular.element) ? element[0] : element;\n}\n\nfunction applyGeneratedPreparationClasses(element, event, options) {\n var classes = '';\n if (event) {\n classes = pendClasses(event, EVENT_CLASS_PREFIX, true);\n }\n if (options.addClass) {\n classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));\n }\n if (options.removeClass) {\n classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));\n }\n if (classes.length) {\n options.preparationClasses = classes;\n element.addClass(classes);\n }\n}\n\nfunction clearGeneratedClasses(element, options) {\n if (options.preparationClasses) {\n element.removeClass(options.preparationClasses);\n options.preparationClasses = null;\n }\n if (options.activeClasses) {\n element.removeClass(options.activeClasses);\n options.activeClasses = null;\n }\n}\n\nfunction blockTransitions(node, duration) {\n // we use a negative delay value since it performs blocking\n // yet it doesn't kill any existing transitions running on the\n // same element which makes this safe for class-based animations\n var value = duration ? '-' + duration + 's' : '';\n applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);\n return [TRANSITION_DELAY_PROP, value];\n}\n\nfunction blockKeyframeAnimations(node, applyBlock) {\n var value = applyBlock ? 'paused' : '';\n var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;\n applyInlineStyle(node, [key, value]);\n return [key, value];\n}\n\nfunction applyInlineStyle(node, styleTuple) {\n var prop = styleTuple[0];\n var value = styleTuple[1];\n node.style[prop] = value;\n}\n\nfunction concatWithSpace(a,b) {\n if (!a) return b;\n if (!b) return a;\n return a + ' ' + b;\n}\n\nvar $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {\n var queue, cancelFn;\n\n function scheduler(tasks) {\n // we make a copy since RAFScheduler mutates the state\n // of the passed in array variable and this would be difficult\n // to track down on the outside code\n queue = queue.concat(tasks);\n nextTick();\n }\n\n queue = scheduler.queue = [];\n\n /* waitUntilQuiet does two things:\n * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through\n * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.\n *\n * The motivation here is that animation code can request more time from the scheduler\n * before the next wave runs. This allows for certain DOM properties such as classes to\n * be resolved in time for the next animation to run.\n */\n scheduler.waitUntilQuiet = function(fn) {\n if (cancelFn) cancelFn();\n\n cancelFn = $$rAF(function() {\n cancelFn = null;\n fn();\n nextTick();\n });\n };\n\n return scheduler;\n\n function nextTick() {\n if (!queue.length) return;\n\n var items = queue.shift();\n for (var i = 0; i < items.length; i++) {\n items[i]();\n }\n\n if (!cancelFn) {\n $$rAF(function() {\n if (!cancelFn) nextTick();\n });\n }\n }\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateChildren\n * @restrict AE\n * @element ANY\n *\n * @description\n *\n * ngAnimateChildren allows you to specify that children of this element should animate even if any\n * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`\n * (structural) animation, child elements that also have an active structural animation are not animated.\n *\n * Note that even if `ngAnimteChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).\n *\n *\n * @param {string} ngAnimateChildren If the value is empty, `true` or `on`,\n * then child animations are allowed. If the value is `false`, child animations are not allowed.\n *\n * @example\n * \n \n
\n \n \n
\n
\n
\n List of items:\n
Item {{item}}
\n
\n
\n
\n
\n \n\n .container.ng-enter,\n .container.ng-leave {\n transition: all ease 1.5s;\n }\n\n .container.ng-enter,\n .container.ng-leave-active {\n opacity: 0;\n }\n\n .container.ng-leave,\n .container.ng-enter-active {\n opacity: 1;\n }\n\n .item {\n background: firebrick;\n color: #FFF;\n margin-bottom: 10px;\n }\n\n .item.ng-enter,\n .item.ng-leave {\n transition: transform 1.5s ease;\n }\n\n .item.ng-enter {\n transform: translateX(50px);\n }\n\n .item.ng-enter-active {\n transform: translateX(0);\n }\n \n \n angular.module('ngAnimateChildren', ['ngAnimate'])\n .controller('mainController', function() {\n this.animateChildren = false;\n this.enterElement = false;\n });\n \n
\n */\nvar $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {\n return {\n link: function(scope, element, attrs) {\n var val = attrs.ngAnimateChildren;\n if (angular.isString(val) && val.length === 0) { //empty attribute\n element.data(NG_ANIMATE_CHILDREN_DATA, true);\n } else {\n // Interpolate and set the value, so that it is available to\n // animations that run right after compilation\n setData($interpolate(val)(scope));\n attrs.$observe('ngAnimateChildren', setData);\n }\n\n function setData(value) {\n value = value === 'on' || value === 'true';\n element.data(NG_ANIMATE_CHILDREN_DATA, value);\n }\n }\n };\n}];\n\nvar ANIMATE_TIMER_KEY = '$$animateCss';\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes\n * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT\n * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or\n * directives to create more complex animations that can be purely driven using CSS code.\n *\n * Note that only browsers that support CSS transitions and/or keyframe animations are capable of\n * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).\n *\n * ## Usage\n * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that\n * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,\n * any automatic control over cancelling animations and/or preventing animations from being run on\n * child elements will not be handled by Angular. For this to work as expected, please use `$animate` to\n * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger\n * the CSS animation.\n *\n * The example below shows how we can create a folding animation on an element using `ng-if`:\n *\n * ```html\n * \n *
\n * This element will go BOOM\n *
\n * \n * ```\n *\n * Now we create the **JavaScript animation** that will trigger the CSS transition:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * ## More Advanced Uses\n *\n * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks\n * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.\n *\n * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,\n * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with\n * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order\n * to provide a working animation that will run in CSS.\n *\n * The example below showcases a more advanced version of the `.fold-animation` from the example above:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * addClass: 'red large-text pulse-twice',\n * easing: 'ease-out',\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Since we're adding/removing CSS classes then the CSS transition will also pick those up:\n *\n * ```css\n * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code,\n * the CSS classes below will be transitioned despite them being defined as regular CSS classes */\n * .red { background:red; }\n * .large-text { font-size:20px; }\n *\n * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */\n * .pulse-twice {\n * animation: 0.5s pulse linear 2;\n * -webkit-animation: 0.5s pulse linear 2;\n * }\n *\n * @keyframes pulse {\n * from { transform: scale(0.5); }\n * to { transform: scale(1.5); }\n * }\n *\n * @-webkit-keyframes pulse {\n * from { -webkit-transform: scale(0.5); }\n * to { -webkit-transform: scale(1.5); }\n * }\n * ```\n *\n * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.\n *\n * ## How the Options are handled\n *\n * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation\n * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline\n * styles using the `from` and `to` properties.\n *\n * ```js\n * var animator = $animateCss(element, {\n * from: { background:'red' },\n * to: { background:'blue' }\n * });\n * animator.start();\n * ```\n *\n * ```css\n * .rotating-animation {\n * animation:0.5s rotate linear;\n * -webkit-animation:0.5s rotate linear;\n * }\n *\n * @keyframes rotate {\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * }\n *\n * @-webkit-keyframes rotate {\n * from { -webkit-transform: rotate(0deg); }\n * to { -webkit-transform: rotate(360deg); }\n * }\n * ```\n *\n * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is\n * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition\n * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition\n * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied\n * and spread across the transition and keyframe animation.\n *\n * ## What is returned\n *\n * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually\n * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are\n * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:\n *\n * ```js\n * var animator = $animateCss(element, { ... });\n * ```\n *\n * Now what do the contents of our `animator` variable look like:\n *\n * ```js\n * {\n * // starts the animation\n * start: Function,\n *\n * // ends (aborts) the animation\n * end: Function\n * }\n * ```\n *\n * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.\n * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been\n * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties\n * and that changing them will not reconfigure the parameters of the animation.\n *\n * ### runner.done() vs runner.then()\n * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the\n * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.\n * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`\n * unless you really need a digest to kick off afterwards.\n *\n * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss\n * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).\n * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.\n *\n * @param {DOMElement} element the element that will be animated\n * @param {object} options the animation-related options that will be applied during the animation\n *\n * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied\n * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)\n * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and\n * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted.\n * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).\n * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).\n * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).\n * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.\n * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.\n * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.\n * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.\n * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`\n * is provided then the animation will be skipped entirely.\n * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is\n * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value\n * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same\n * CSS delay value.\n * * `stagger` - A numeric time value representing the delay between successively animated elements\n * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})\n * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a\n * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)\n * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.)\n * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once\n * the animation is closed. This is useful for when the styles are used purely for the sake of\n * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation).\n * By default this value is set to `false`.\n *\n * @return {object} an object with start and end methods and details about the animation.\n *\n * * `start` - The method to start the animation. This will return a `Promise` when called.\n * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.\n */\nvar ONE_SECOND = 1000;\nvar BASE_TEN = 10;\n\nvar ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\nvar CLOSING_TIME_BUFFER = 1.5;\n\nvar DETECT_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n transitionProperty: TRANSITION_PROP + PROPERTY_KEY,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP,\n animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY\n};\n\nvar DETECT_STAGGER_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP\n};\n\nfunction getCssKeyframeDurationStyle(duration) {\n return [ANIMATION_DURATION_PROP, duration + 's'];\n}\n\nfunction getCssDelayStyle(delay, isKeyframeAnimation) {\n var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;\n return [prop, delay + 's'];\n}\n\nfunction computeCssStyles($window, element, properties) {\n var styles = Object.create(null);\n var detectedStyles = $window.getComputedStyle(element) || {};\n forEach(properties, function(formalStyleName, actualStyleName) {\n var val = detectedStyles[formalStyleName];\n if (val) {\n var c = val.charAt(0);\n\n // only numerical-based values have a negative sign or digit as the first value\n if (c === '-' || c === '+' || c >= 0) {\n val = parseMaxTime(val);\n }\n\n // by setting this to null in the event that the delay is not set or is set directly as 0\n // then we can still allow for negative values to be used later on and not mistake this\n // value for being greater than any other negative value.\n if (val === 0) {\n val = null;\n }\n styles[actualStyleName] = val;\n }\n });\n\n return styles;\n}\n\nfunction parseMaxTime(str) {\n var maxValue = 0;\n var values = str.split(/\\s*,\\s*/);\n forEach(values, function(value) {\n // it's always safe to consider only second values and omit `ms` values since\n // getComputedStyle will always handle the conversion for us\n if (value.charAt(value.length - 1) == 's') {\n value = value.substring(0, value.length - 1);\n }\n value = parseFloat(value) || 0;\n maxValue = maxValue ? Math.max(value, maxValue) : value;\n });\n return maxValue;\n}\n\nfunction truthyTimingValue(val) {\n return val === 0 || val != null;\n}\n\nfunction getCssTransitionDurationStyle(duration, applyOnlyDuration) {\n var style = TRANSITION_PROP;\n var value = duration + 's';\n if (applyOnlyDuration) {\n style += DURATION_KEY;\n } else {\n value += ' linear all';\n }\n return [style, value];\n}\n\nfunction createLocalCacheLookup() {\n var cache = Object.create(null);\n return {\n flush: function() {\n cache = Object.create(null);\n },\n\n count: function(key) {\n var entry = cache[key];\n return entry ? entry.total : 0;\n },\n\n get: function(key) {\n var entry = cache[key];\n return entry && entry.value;\n },\n\n put: function(key, value) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value };\n } else {\n cache[key].total++;\n }\n }\n };\n}\n\n// we do not reassign an already present style value since\n// if we detect the style property value again we may be\n// detecting styles that were added via the `from` styles.\n// We make use of `isDefined` here since an empty string\n// or null value (which is what getPropertyValue will return\n// for a non-existing style) will still be marked as a valid\n// value for the style (a falsy value implies that the style\n// is to be removed at the end of the animation). If we had a simple\n// \"OR\" statement then it would not be enough to catch that.\nfunction registerRestorableStyles(backup, node, properties) {\n forEach(properties, function(prop) {\n backup[prop] = isDefined(backup[prop])\n ? backup[prop]\n : node.style.getPropertyValue(prop);\n });\n}\n\nvar $AnimateCssProvider = ['$animateProvider', function($animateProvider) {\n var gcsLookup = createLocalCacheLookup();\n var gcsStaggerLookup = createLocalCacheLookup();\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n var parentCounter = 0;\n function gcsHashFn(node, extraClasses) {\n var KEY = \"$$ngAnimateParentKey\";\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;\n }\n\n function computeCachedCssStyles(node, className, cacheKey, properties) {\n var timings = gcsLookup.get(cacheKey);\n\n if (!timings) {\n timings = computeCssStyles($window, node, properties);\n if (timings.animationIterationCount === 'infinite') {\n timings.animationIterationCount = 1;\n }\n }\n\n // we keep putting this in multiple times even though the value and the cacheKey are the same\n // because we're keeping an internal tally of how many duplicate animations are detected.\n gcsLookup.put(cacheKey, timings);\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\n\n // if we have one or more existing matches of matching elements\n // containing the same parent + CSS styles (which is how cacheKey works)\n // then staggering is possible\n if (gcsLookup.count(cacheKey) > 0) {\n stagger = gcsStaggerLookup.get(cacheKey);\n\n if (!stagger) {\n var staggerClassName = pendClasses(className, '-stagger');\n\n $$jqLite.addClass(node, staggerClassName);\n\n stagger = computeCssStyles($window, node, properties);\n\n // force the conversion of a null value to zero incase not set\n stagger.animationDuration = Math.max(stagger.animationDuration, 0);\n stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);\n\n $$jqLite.removeClass(node, staggerClassName);\n\n gcsStaggerLookup.put(cacheKey, stagger);\n }\n }\n\n return stagger || {};\n }\n\n var cancelLastRAFRequest;\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n gcsLookup.flush();\n gcsStaggerLookup.flush();\n\n // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n var pageWidth = $$forceReflow();\n\n // we use a for loop to ensure that if the queue is changed\n // during this looping then it will consider new requests\n for (var i = 0; i < rafWaitQueue.length; i++) {\n rafWaitQueue[i](pageWidth);\n }\n rafWaitQueue.length = 0;\n });\n }\n\n function computeTimings(node, className, cacheKey) {\n var timings = computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES);\n var aD = timings.animationDelay;\n var tD = timings.transitionDelay;\n timings.maxDelay = aD && tD\n ? Math.max(aD, tD)\n : (aD || tD);\n timings.maxDuration = Math.max(\n timings.animationDuration * timings.animationIterationCount,\n timings.transitionDuration);\n\n return timings;\n }\n\n return function init(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = prepareAnimationOptions(copy(options));\n }\n\n var restoreStyles = {};\n var node = getDomNode(element);\n if (!node\n || !node.parentNode\n || !$$animateQueue.enabled()) {\n return closeAndReturnNoopAnimator();\n }\n\n var temporaryStyles = [];\n var classes = element.attr('class');\n var styles = packageStyles(options);\n var animationClosed;\n var animationPaused;\n var animationCompleted;\n var runner;\n var runnerHost;\n var maxDelay;\n var maxDelayTime;\n var maxDuration;\n var maxDurationTime;\n var startTime;\n var events = [];\n\n if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {\n return closeAndReturnNoopAnimator();\n }\n\n var method = options.event && isArray(options.event)\n ? options.event.join(' ')\n : options.event;\n\n var isStructural = method && options.structural;\n var structuralClassName = '';\n var addRemoveClassName = '';\n\n if (isStructural) {\n structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true);\n } else if (method) {\n structuralClassName = method;\n }\n\n if (options.addClass) {\n addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX);\n }\n\n if (options.removeClass) {\n if (addRemoveClassName.length) {\n addRemoveClassName += ' ';\n }\n addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);\n }\n\n // there may be a situation where a structural animation is combined together\n // with CSS classes that need to resolve before the animation is computed.\n // However this means that there is no explicit CSS code to block the animation\n // from happening (by setting 0s none in the class name). If this is the case\n // we need to apply the classes before the first rAF so we know to continue if\n // there actually is a detected transition or keyframe animation\n if (options.applyClassesEarly && addRemoveClassName.length) {\n applyAnimationClasses(element, options);\n }\n\n var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim();\n var fullClassName = classes + ' ' + preparationClasses;\n var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\n var hasToStyles = styles.to && Object.keys(styles.to).length > 0;\n var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0;\n\n // there is no way we can trigger an animation if no styles and\n // no classes are being applied which would then trigger a transition,\n // unless there a is raw keyframe value that is applied to the element.\n if (!containsKeyframeAnimation\n && !hasToStyles\n && !preparationClasses) {\n return closeAndReturnNoopAnimator();\n }\n\n var cacheKey, stagger;\n if (options.stagger > 0) {\n var staggerVal = parseFloat(options.stagger);\n stagger = {\n transitionDelay: staggerVal,\n animationDelay: staggerVal,\n transitionDuration: 0,\n animationDuration: 0\n };\n } else {\n cacheKey = gcsHashFn(node, fullClassName);\n stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);\n }\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.addClass(element, preparationClasses);\n }\n\n var applyOnlyDuration;\n\n if (options.transitionStyle) {\n var transitionStyle = [TRANSITION_PROP, options.transitionStyle];\n applyInlineStyle(node, transitionStyle);\n temporaryStyles.push(transitionStyle);\n }\n\n if (options.duration >= 0) {\n applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;\n var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);\n\n // we set the duration so that it will be picked up by getComputedStyle later\n applyInlineStyle(node, durationStyle);\n temporaryStyles.push(durationStyle);\n }\n\n if (options.keyframeStyle) {\n var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];\n applyInlineStyle(node, keyframeStyle);\n temporaryStyles.push(keyframeStyle);\n }\n\n var itemIndex = stagger\n ? options.staggerIndex >= 0\n ? options.staggerIndex\n : gcsLookup.count(cacheKey)\n : 0;\n\n var isFirst = itemIndex === 0;\n\n // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY\n // without causing any combination of transitions to kick in. By adding a negative delay value\n // it forces the setup class' transition to end immediately. We later then remove the negative\n // transition delay to allow for the transition to naturally do it's thing. The beauty here is\n // that if there is no transition defined then nothing will happen and this will also allow\n // other transitions to be stacked on top of each other without any chopping them out.\n if (isFirst && !options.skipBlocking) {\n blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey);\n var relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n var flags = {};\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all';\n flags.applyTransitionDuration = hasToStyles && (\n (flags.hasTransitions && !flags.hasTransitionAll)\n || (flags.hasAnimations && !flags.hasTransitions));\n flags.applyAnimationDuration = options.duration && flags.hasAnimations;\n flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);\n flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations;\n flags.recalculateTimingStyles = addRemoveClassName.length > 0;\n\n if (flags.applyTransitionDuration || flags.applyAnimationDuration) {\n maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;\n\n if (flags.applyTransitionDuration) {\n flags.hasTransitions = true;\n timings.transitionDuration = maxDuration;\n applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;\n temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));\n }\n\n if (flags.applyAnimationDuration) {\n flags.hasAnimations = true;\n timings.animationDuration = maxDuration;\n temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));\n }\n }\n\n if (maxDuration === 0 && !flags.recalculateTimingStyles) {\n return closeAndReturnNoopAnimator();\n }\n\n if (options.delay != null) {\n var delayStyle;\n if (typeof options.delay !== \"boolean\") {\n delayStyle = parseFloat(options.delay);\n // number in options.delay means we have to recalculate the delay for the closing timeout\n maxDelay = Math.max(delayStyle, 0);\n }\n\n if (flags.applyTransitionDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle));\n }\n\n if (flags.applyAnimationDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle, true));\n }\n }\n\n // we need to recalculate the delay value since we used a pre-emptive negative\n // delay value and the delay value is required for the final event checking. This\n // property will ensure that this will happen after the RAF phase has passed.\n if (options.duration == null && timings.transitionDuration > 0) {\n flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n if (!options.skipBlocking) {\n flags.blockTransition = timings.transitionDuration > 0;\n flags.blockKeyframeAnimation = timings.animationDuration > 0 &&\n stagger.animationDelay > 0 &&\n stagger.animationDuration === 0;\n }\n\n if (options.from) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.from));\n }\n applyAnimationFromStyles(element, options);\n }\n\n if (flags.blockTransition || flags.blockKeyframeAnimation) {\n applyBlocking(maxDuration);\n } else if (!options.skipBlocking) {\n blockTransitions(node, false);\n }\n\n // TODO(matsko): for 1.5 change this code to have an animator object for better debugging\n return {\n $$willAnimate: true,\n end: endFn,\n start: function() {\n if (animationClosed) return;\n\n runnerHost = {\n end: endFn,\n cancel: cancelFn,\n resume: null, //this will be set during the start() phase\n pause: null\n };\n\n runner = new $$AnimateRunner(runnerHost);\n\n waitUntilQuiet(start);\n\n // we don't have access to pause/resume the animation\n // since it hasn't run yet. AnimateRunner will therefore\n // set noop functions for resume and pause and they will\n // later be overridden once the animation is triggered\n return runner;\n }\n };\n\n function endFn() {\n close();\n }\n\n function cancelFn() {\n close(true);\n }\n\n function close(rejected) { // jshint ignore:line\n // if the promise has been called already then we shouldn't close\n // the animation again\n if (animationClosed || (animationCompleted && animationPaused)) return;\n animationClosed = true;\n animationPaused = false;\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n $$jqLite.removeClass(element, activeClasses);\n\n blockKeyframeAnimations(node, false);\n blockTransitions(node, false);\n\n forEach(temporaryStyles, function(entry) {\n // There is only one way to remove inline style properties entirely from elements.\n // By using `removeProperty` this works, but we need to convert camel-cased CSS\n // styles down to hyphenated values.\n node.style[entry[0]] = '';\n });\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n\n if (Object.keys(restoreStyles).length) {\n forEach(restoreStyles, function(value, prop) {\n value ? node.style.setProperty(prop, value)\n : node.style.removeProperty(prop);\n });\n }\n\n // the reason why we have this option is to allow a synchronous closing callback\n // that is fired as SOON as the animation ends (when the CSS is removed) or if\n // the animation never takes off at all. A good example is a leave animation since\n // the element must be removed just after the animation is over or else the element\n // will appear on screen for one animation frame causing an overbearing flicker.\n if (options.onDone) {\n options.onDone();\n }\n\n if (events && events.length) {\n // Remove the transitionend / animationend listener(s)\n element.off(events.join(' '), onAnimationProgress);\n }\n\n //Cancel the fallback closing timeout and remove the timer data\n var animationTimerData = element.data(ANIMATE_TIMER_KEY);\n if (animationTimerData) {\n $timeout.cancel(animationTimerData[0].timer);\n element.removeData(ANIMATE_TIMER_KEY);\n }\n\n // if the preparation function fails then the promise is not setup\n if (runner) {\n runner.complete(!rejected);\n }\n }\n\n function applyBlocking(duration) {\n if (flags.blockTransition) {\n blockTransitions(node, duration);\n }\n\n if (flags.blockKeyframeAnimation) {\n blockKeyframeAnimations(node, !!duration);\n }\n }\n\n function closeAndReturnNoopAnimator() {\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: cancelFn\n });\n\n // should flush the cache animation\n waitUntilQuiet(noop);\n close();\n\n return {\n $$willAnimate: false,\n start: function() {\n return runner;\n },\n end: endFn\n };\n }\n\n function onAnimationProgress(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n\n // we now always use `Date.now()` due to the recent changes with\n // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)\n var timeStamp = ev.$manualTimeStamp || Date.now();\n\n /* Firefox (or possibly just Gecko) likes to not round values up\n * when a ms measurement is used for the animation */\n var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n /* $manualTimeStamp is a mocked timeStamp value which is set\n * within browserTrigger(). This is only here so that tests can\n * mock animations properly. Real events fallback to event.timeStamp,\n * or, if they don't, then a timeStamp is automatically created for them.\n * We're checking to see if the timeStamp surpasses the expected delay,\n * but we're using elapsedTime instead of the timeStamp on the 2nd\n * pre-condition since animationPauseds sometimes close off early */\n if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n // we set this flag to ensure that if the transition is paused then, when resumed,\n // the animation will automatically close itself since transitions cannot be paused.\n animationCompleted = true;\n close();\n }\n }\n\n function start() {\n if (animationClosed) return;\n if (!node.parentNode) {\n close();\n return;\n }\n\n // even though we only pause keyframe animations here the pause flag\n // will still happen when transitions are used. Only the transition will\n // not be paused since that is not possible. If the animation ends when\n // paused then it will not complete until unpaused or cancelled.\n var playPause = function(playAnimation) {\n if (!animationCompleted) {\n animationPaused = !playAnimation;\n if (timings.animationDuration) {\n var value = blockKeyframeAnimations(node, animationPaused);\n animationPaused\n ? temporaryStyles.push(value)\n : removeFromArray(temporaryStyles, value);\n }\n } else if (animationPaused && playAnimation) {\n animationPaused = false;\n close();\n }\n };\n\n // checking the stagger duration prevents an accidentally cascade of the CSS delay style\n // being inherited from the parent. If the transition duration is zero then we can safely\n // rely that the delay value is an intentional stagger delay style.\n var maxStagger = itemIndex > 0\n && ((timings.transitionDuration && stagger.transitionDuration === 0) ||\n (timings.animationDuration && stagger.animationDuration === 0))\n && Math.max(stagger.animationDelay, stagger.transitionDelay);\n if (maxStagger) {\n $timeout(triggerAnimationStart,\n Math.floor(maxStagger * itemIndex * ONE_SECOND),\n false);\n } else {\n triggerAnimationStart();\n }\n\n // this will decorate the existing promise runner with pause/resume methods\n runnerHost.resume = function() {\n playPause(true);\n };\n\n runnerHost.pause = function() {\n playPause(false);\n };\n\n function triggerAnimationStart() {\n // just incase a stagger animation kicks in when the animation\n // itself was cancelled entirely\n if (animationClosed) return;\n\n applyBlocking(false);\n\n forEach(temporaryStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[key] = value;\n });\n\n applyAnimationClasses(element, options);\n $$jqLite.addClass(element, activeClasses);\n\n if (flags.recalculateTimingStyles) {\n fullClassName = node.className + ' ' + preparationClasses;\n cacheKey = gcsHashFn(node, fullClassName);\n\n timings = computeTimings(node, fullClassName, cacheKey);\n relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n if (maxDuration === 0) {\n close();\n return;\n }\n\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n }\n\n if (flags.applyAnimationDelay) {\n relativeDelay = typeof options.delay !== \"boolean\" && truthyTimingValue(options.delay)\n ? parseFloat(options.delay)\n : relativeDelay;\n\n maxDelay = Math.max(relativeDelay, 0);\n timings.animationDelay = relativeDelay;\n delayStyle = getCssDelayStyle(relativeDelay, true);\n temporaryStyles.push(delayStyle);\n node.style[delayStyle[0]] = delayStyle[1];\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n\n if (options.easing) {\n var easeProp, easeVal = options.easing;\n if (flags.hasTransitions) {\n easeProp = TRANSITION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n if (flags.hasAnimations) {\n easeProp = ANIMATION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n }\n\n if (timings.transitionDuration) {\n events.push(TRANSITIONEND_EVENT);\n }\n\n if (timings.animationDuration) {\n events.push(ANIMATIONEND_EVENT);\n }\n\n startTime = Date.now();\n var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;\n var endTime = startTime + timerTime;\n\n var animationsData = element.data(ANIMATE_TIMER_KEY) || [];\n var setupFallbackTimer = true;\n if (animationsData.length) {\n var currentTimerData = animationsData[0];\n setupFallbackTimer = endTime > currentTimerData.expectedEndTime;\n if (setupFallbackTimer) {\n $timeout.cancel(currentTimerData.timer);\n } else {\n animationsData.push(close);\n }\n }\n\n if (setupFallbackTimer) {\n var timer = $timeout(onAnimationExpired, timerTime, false);\n animationsData[0] = {\n timer: timer,\n expectedEndTime: endTime\n };\n animationsData.push(close);\n element.data(ANIMATE_TIMER_KEY, animationsData);\n }\n\n if (events.length) {\n element.on(events.join(' '), onAnimationProgress);\n }\n\n if (options.to) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.to));\n }\n applyAnimationToStyles(element, options);\n }\n }\n\n function onAnimationExpired() {\n var animationsData = element.data(ANIMATE_TIMER_KEY);\n\n // this will be false in the event that the element was\n // removed from the DOM (via a leave animation or something\n // similar)\n if (animationsData) {\n for (var i = 1; i < animationsData.length; i++) {\n animationsData[i]();\n }\n element.removeData(ANIMATE_TIMER_KEY);\n }\n }\n }\n };\n }];\n}];\n\nvar $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateCssDriver');\n\n var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';\n var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';\n\n var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';\n var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';\n\n function isDocumentFragment(node) {\n return node.parentNode && node.parentNode.nodeType === 11;\n }\n\n this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',\n function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) {\n\n // only browsers that support these properties can render animations\n if (!$sniffer.animations && !$sniffer.transitions) return noop;\n\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var rootBodyElement = jqLite(\n // this is to avoid using something that exists outside of the body\n // we also special case the doc fragment case because our unit test code\n // appends the $rootElement to the body after the app has been bootstrapped\n isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode\n );\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n return function initDriverFn(animationDetails) {\n return animationDetails.from && animationDetails.to\n ? prepareFromToAnchorAnimation(animationDetails.from,\n animationDetails.to,\n animationDetails.classes,\n animationDetails.anchors)\n : prepareRegularAnimation(animationDetails);\n };\n\n function filterCssClasses(classes) {\n //remove all the `ng-` stuff\n return classes.replace(/\\bng-\\S+\\b/g, '');\n }\n\n function getUniqueValues(a, b) {\n if (isString(a)) a = a.split(' ');\n if (isString(b)) b = b.split(' ');\n return a.filter(function(val) {\n return b.indexOf(val) === -1;\n }).join(' ');\n }\n\n function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {\n var clone = jqLite(getDomNode(outAnchor).cloneNode(true));\n var startingClasses = filterCssClasses(getClassVal(clone));\n\n outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n\n clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);\n\n rootBodyElement.append(clone);\n\n var animatorIn, animatorOut = prepareOutAnimation();\n\n // the user may not end up using the `out` animation and\n // only making use of the `in` animation or vice-versa.\n // In either case we should allow this and not assume the\n // animation is over unless both animations are not used.\n if (!animatorOut) {\n animatorIn = prepareInAnimation();\n if (!animatorIn) {\n return end();\n }\n }\n\n var startingAnimator = animatorOut || animatorIn;\n\n return {\n start: function() {\n var runner;\n\n var currentAnimation = startingAnimator.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n if (!animatorIn) {\n animatorIn = prepareInAnimation();\n if (animatorIn) {\n currentAnimation = animatorIn.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n end();\n runner.complete();\n });\n return currentAnimation;\n }\n }\n // in the event that there is no `in` animation\n end();\n runner.complete();\n });\n\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn\n });\n\n return runner;\n\n function endFn() {\n if (currentAnimation) {\n currentAnimation.end();\n }\n }\n }\n };\n\n function calculateAnchorStyles(anchor) {\n var styles = {};\n\n var coords = getDomNode(anchor).getBoundingClientRect();\n\n // we iterate directly since safari messes up and doesn't return\n // all the keys for the coords object when iterated\n forEach(['width','height','top','left'], function(key) {\n var value = coords[key];\n switch (key) {\n case 'top':\n value += bodyNode.scrollTop;\n break;\n case 'left':\n value += bodyNode.scrollLeft;\n break;\n }\n styles[key] = Math.floor(value) + 'px';\n });\n return styles;\n }\n\n function prepareOutAnimation() {\n var animator = $animateCss(clone, {\n addClass: NG_OUT_ANCHOR_CLASS_NAME,\n delay: true,\n from: calculateAnchorStyles(outAnchor)\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function getClassVal(element) {\n return element.attr('class') || '';\n }\n\n function prepareInAnimation() {\n var endingClasses = filterCssClasses(getClassVal(inAnchor));\n var toAdd = getUniqueValues(endingClasses, startingClasses);\n var toRemove = getUniqueValues(startingClasses, endingClasses);\n\n var animator = $animateCss(clone, {\n to: calculateAnchorStyles(inAnchor),\n addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,\n removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,\n delay: true\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function end() {\n clone.remove();\n outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n }\n }\n\n function prepareFromToAnchorAnimation(from, to, classes, anchors) {\n var fromAnimation = prepareRegularAnimation(from, noop);\n var toAnimation = prepareRegularAnimation(to, noop);\n\n var anchorAnimations = [];\n forEach(anchors, function(anchor) {\n var outElement = anchor['out'];\n var inElement = anchor['in'];\n var animator = prepareAnchoredAnimation(classes, outElement, inElement);\n if (animator) {\n anchorAnimations.push(animator);\n }\n });\n\n // no point in doing anything when there are no elements to animate\n if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n forEach(anchorAnimations, function(animation) {\n animationRunners.push(animation.start());\n });\n\n var runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn // CSS-driven animations cannot be cancelled, only ended\n });\n\n $$AnimateRunner.all(animationRunners, function(status) {\n runner.complete(status);\n });\n\n return runner;\n\n function endFn() {\n forEach(animationRunners, function(runner) {\n runner.end();\n });\n }\n }\n };\n }\n\n function prepareRegularAnimation(animationDetails) {\n var element = animationDetails.element;\n var options = animationDetails.options || {};\n\n if (animationDetails.structural) {\n options.event = animationDetails.event;\n options.structural = true;\n options.applyClassesEarly = true;\n\n // we special case the leave animation since we want to ensure that\n // the element is removed as soon as the animation is over. Otherwise\n // a flicker might appear or the element may not be removed at all\n if (animationDetails.event === 'leave') {\n options.onDone = options.domOperation;\n }\n }\n\n // We assign the preparationClasses as the actual animation event since\n // the internals of $animateCss will just suffix the event token values\n // with `-active` to trigger the animation.\n if (options.preparationClasses) {\n options.event = concatWithSpace(options.event, options.preparationClasses);\n }\n\n var animator = $animateCss(element, options);\n\n // the driver lookup code inside of $$animation attempts to spawn a\n // driver one by one until a driver returns a.$$willAnimate animator object.\n // $animateCss will always return an object, however, it will pass in\n // a flag as a hint as to whether an animation was detected or not\n return animator.$$willAnimate ? animator : null;\n }\n }];\n}];\n\n// TODO(matsko): use caching here to speed things up for detection\n// TODO(matsko): add documentation\n// by the time...\n\nvar $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {\n this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',\n function($injector, $$AnimateRunner, $$jqLite) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n // $animateJs(element, 'enter');\n return function(element, event, classes, options) {\n var animationClosed = false;\n\n // the `classes` argument is optional and if it is not used\n // then the classes will be resolved from the element's className\n // property as well as options.addClass/options.removeClass.\n if (arguments.length === 3 && isObject(classes)) {\n options = classes;\n classes = null;\n }\n\n options = prepareAnimationOptions(options);\n if (!classes) {\n classes = element.attr('class') || '';\n if (options.addClass) {\n classes += ' ' + options.addClass;\n }\n if (options.removeClass) {\n classes += ' ' + options.removeClass;\n }\n }\n\n var classesToAdd = options.addClass;\n var classesToRemove = options.removeClass;\n\n // the lookupAnimations function returns a series of animation objects that are\n // matched up with one or more of the CSS classes. These animation objects are\n // defined via the module.animation factory function. If nothing is detected then\n // we don't return anything which then makes $animation query the next driver.\n var animations = lookupAnimations(classes);\n var before, after;\n if (animations.length) {\n var afterFn, beforeFn;\n if (event == 'leave') {\n beforeFn = 'leave';\n afterFn = 'afterLeave'; // TODO(matsko): get rid of this\n } else {\n beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);\n afterFn = event;\n }\n\n if (event !== 'enter' && event !== 'move') {\n before = packageAnimations(element, event, options, animations, beforeFn);\n }\n after = packageAnimations(element, event, options, animations, afterFn);\n }\n\n // no matching animations\n if (!before && !after) return;\n\n function applyOptions() {\n options.domOperation();\n applyAnimationClasses(element, options);\n }\n\n function close() {\n animationClosed = true;\n applyOptions();\n applyAnimationStyles(element, options);\n }\n\n var runner;\n\n return {\n $$willAnimate: true,\n end: function() {\n if (runner) {\n runner.end();\n } else {\n close();\n runner = new $$AnimateRunner();\n runner.complete(true);\n }\n return runner;\n },\n start: function() {\n if (runner) {\n return runner;\n }\n\n runner = new $$AnimateRunner();\n var closeActiveAnimations;\n var chain = [];\n\n if (before) {\n chain.push(function(fn) {\n closeActiveAnimations = before(fn);\n });\n }\n\n if (chain.length) {\n chain.push(function(fn) {\n applyOptions();\n fn(true);\n });\n } else {\n applyOptions();\n }\n\n if (after) {\n chain.push(function(fn) {\n closeActiveAnimations = after(fn);\n });\n }\n\n runner.setHost({\n end: function() {\n endAnimations();\n },\n cancel: function() {\n endAnimations(true);\n }\n });\n\n $$AnimateRunner.chain(chain, onComplete);\n return runner;\n\n function onComplete(success) {\n close(success);\n runner.complete(success);\n }\n\n function endAnimations(cancelled) {\n if (!animationClosed) {\n (closeActiveAnimations || noop)(cancelled);\n onComplete(cancelled);\n }\n }\n }\n };\n\n function executeAnimationFn(fn, element, event, options, onDone) {\n var args;\n switch (event) {\n case 'animate':\n args = [element, options.from, options.to, onDone];\n break;\n\n case 'setClass':\n args = [element, classesToAdd, classesToRemove, onDone];\n break;\n\n case 'addClass':\n args = [element, classesToAdd, onDone];\n break;\n\n case 'removeClass':\n args = [element, classesToRemove, onDone];\n break;\n\n default:\n args = [element, onDone];\n break;\n }\n\n args.push(options);\n\n var value = fn.apply(fn, args);\n if (value) {\n if (isFunction(value.start)) {\n value = value.start();\n }\n\n if (value instanceof $$AnimateRunner) {\n value.done(onDone);\n } else if (isFunction(value)) {\n // optional onEnd / onCancel callback\n return value;\n }\n }\n\n return noop;\n }\n\n function groupEventedAnimations(element, event, options, animations, fnName) {\n var operations = [];\n forEach(animations, function(ani) {\n var animation = ani[fnName];\n if (!animation) return;\n\n // note that all of these animations will run in parallel\n operations.push(function() {\n var runner;\n var endProgressCb;\n\n var resolved = false;\n var onAnimationComplete = function(rejected) {\n if (!resolved) {\n resolved = true;\n (endProgressCb || noop)(rejected);\n runner.complete(!rejected);\n }\n };\n\n runner = new $$AnimateRunner({\n end: function() {\n onAnimationComplete();\n },\n cancel: function() {\n onAnimationComplete(true);\n }\n });\n\n endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {\n var cancelled = result === false;\n onAnimationComplete(cancelled);\n });\n\n return runner;\n });\n });\n\n return operations;\n }\n\n function packageAnimations(element, event, options, animations, fnName) {\n var operations = groupEventedAnimations(element, event, options, animations, fnName);\n if (operations.length === 0) {\n var a,b;\n if (fnName === 'beforeSetClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');\n } else if (fnName === 'setClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');\n }\n\n if (a) {\n operations = operations.concat(a);\n }\n if (b) {\n operations = operations.concat(b);\n }\n }\n\n if (operations.length === 0) return;\n\n // TODO(matsko): add documentation\n return function startAnimation(callback) {\n var runners = [];\n if (operations.length) {\n forEach(operations, function(animateFn) {\n runners.push(animateFn());\n });\n }\n\n runners.length ? $$AnimateRunner.all(runners, callback) : callback();\n\n return function endFn(reject) {\n forEach(runners, function(runner) {\n reject ? runner.cancel() : runner.end();\n });\n };\n };\n }\n };\n\n function lookupAnimations(classes) {\n classes = isArray(classes) ? classes : classes.split(' ');\n var matches = [], flagMap = {};\n for (var i=0; i < classes.length; i++) {\n var klass = classes[i],\n animationFactory = $animateProvider.$$registeredAnimations[klass];\n if (animationFactory && !flagMap[klass]) {\n matches.push($injector.get(animationFactory));\n flagMap[klass] = true;\n }\n }\n return matches;\n }\n }];\n}];\n\nvar $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateJsDriver');\n this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {\n return function initDriverFn(animationDetails) {\n if (animationDetails.from && animationDetails.to) {\n var fromAnimation = prepareAnimation(animationDetails.from);\n var toAnimation = prepareAnimation(animationDetails.to);\n if (!fromAnimation && !toAnimation) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n $$AnimateRunner.all(animationRunners, done);\n\n var runner = new $$AnimateRunner({\n end: endFnFactory(),\n cancel: endFnFactory()\n });\n\n return runner;\n\n function endFnFactory() {\n return function() {\n forEach(animationRunners, function(runner) {\n // at this point we cannot cancel animations for groups just yet. 1.5+\n runner.end();\n });\n };\n }\n\n function done(status) {\n runner.complete(status);\n }\n }\n };\n } else {\n return prepareAnimation(animationDetails);\n }\n };\n\n function prepareAnimation(animationDetails) {\n // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations\n var element = animationDetails.element;\n var event = animationDetails.event;\n var options = animationDetails.options;\n var classes = animationDetails.classes;\n return $$animateJs(element, event, classes, options);\n }\n }];\n}];\n\nvar NG_ANIMATE_ATTR_NAME = 'data-ng-animate';\nvar NG_ANIMATE_PIN_DATA = '$ngAnimatePin';\nvar $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {\n var PRE_DIGEST_STATE = 1;\n var RUNNING_STATE = 2;\n var ONE_SPACE = ' ';\n\n var rules = this.rules = {\n skip: [],\n cancel: [],\n join: []\n };\n\n function makeTruthyCssClassMap(classString) {\n if (!classString) {\n return null;\n }\n\n var keys = classString.split(ONE_SPACE);\n var map = Object.create(null);\n\n forEach(keys, function(key) {\n map[key] = true;\n });\n return map;\n }\n\n function hasMatchingClasses(newClassString, currentClassString) {\n if (newClassString && currentClassString) {\n var currentClassMap = makeTruthyCssClassMap(currentClassString);\n return newClassString.split(ONE_SPACE).some(function(className) {\n return currentClassMap[className];\n });\n }\n }\n\n function isAllowed(ruleType, element, currentAnimation, previousAnimation) {\n return rules[ruleType].some(function(fn) {\n return fn(element, currentAnimation, previousAnimation);\n });\n }\n\n function hasAnimationClasses(animation, and) {\n var a = (animation.addClass || '').length > 0;\n var b = (animation.removeClass || '').length > 0;\n return and ? a && b : a || b;\n }\n\n rules.join.push(function(element, newAnimation, currentAnimation) {\n // if the new animation is class-based then we can just tack that on\n return !newAnimation.structural && hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // there is no need to animate anything if no classes are being added and\n // there is no structural animation that will be triggered\n return !newAnimation.structural && !hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // why should we trigger a new structural animation if the element will\n // be removed from the DOM anyway?\n return currentAnimation.event == 'leave' && newAnimation.structural;\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // if there is an ongoing current animation then don't even bother running the class-based animation\n return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // there can never be two structural animations running at the same time\n return currentAnimation.structural && newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // if the previous animation is already running, but the new animation will\n // be triggered, but the new animation is structural\n return currentAnimation.state === RUNNING_STATE && newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // cancel the animation if classes added / removed in both animation cancel each other out,\n // but only if the current animation isn't structural\n\n if (currentAnimation.structural) return false;\n\n var nA = newAnimation.addClass;\n var nR = newAnimation.removeClass;\n var cA = currentAnimation.addClass;\n var cR = currentAnimation.removeClass;\n\n // early detection to save the global CPU shortage :)\n if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) {\n return false;\n }\n\n return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);\n });\n\n this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',\n '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',\n function($$rAF, $rootScope, $rootElement, $document, $$HashMap,\n $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow) {\n\n var activeAnimationsLookup = new $$HashMap();\n var disabledElementsLookup = new $$HashMap();\n var animationsEnabled = null;\n\n function postDigestTaskFactory() {\n var postDigestCalled = false;\n return function(fn) {\n // we only issue a call to postDigest before\n // it has first passed. This prevents any callbacks\n // from not firing once the animation has completed\n // since it will be out of the digest cycle.\n if (postDigestCalled) {\n fn();\n } else {\n $rootScope.$$postDigest(function() {\n postDigestCalled = true;\n fn();\n });\n }\n };\n }\n\n // Wait until all directive and route-related templates are downloaded and\n // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n // all of the remote templates being currently downloaded. If there are no\n // templates currently downloading then the watcher will still fire anyway.\n var deregisterWatch = $rootScope.$watch(\n function() { return $templateRequest.totalPendingRequests === 0; },\n function(isEmpty) {\n if (!isEmpty) return;\n deregisterWatch();\n\n // Now that all templates have been downloaded, $animate will wait until\n // the post digest queue is empty before enabling animations. By having two\n // calls to $postDigest calls we can ensure that the flag is enabled at the\n // very end of the post digest queue. Since all of the animations in $animate\n // use $postDigest, it's important that the code below executes at the end.\n // This basically means that the page is fully downloaded and compiled before\n // any animations are triggered.\n $rootScope.$$postDigest(function() {\n $rootScope.$$postDigest(function() {\n // we check for null directly in the event that the application already called\n // .enabled() with whatever arguments that it provided it with\n if (animationsEnabled === null) {\n animationsEnabled = true;\n }\n });\n });\n }\n );\n\n var callbackRegistry = {};\n\n // remember that the classNameFilter is set during the provider/config\n // stage therefore we can optimize here and setup a helper function\n var classNameFilter = $animateProvider.classNameFilter();\n var isAnimatableClassName = !classNameFilter\n ? function() { return true; }\n : function(className) {\n return classNameFilter.test(className);\n };\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function normalizeAnimationDetails(element, animation) {\n return mergeAnimationDetails(element, animation, {});\n }\n\n // IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\n var contains = window.Node.prototype.contains || function(arg) {\n // jshint bitwise: false\n return this === arg || !!(this.compareDocumentPosition(arg) & 16);\n // jshint bitwise: true\n };\n\n function findCallbacks(parent, element, event) {\n var targetNode = getDomNode(element);\n var targetParentNode = getDomNode(parent);\n\n var matches = [];\n var entries = callbackRegistry[event];\n if (entries) {\n forEach(entries, function(entry) {\n if (contains.call(entry.node, targetNode)) {\n matches.push(entry.callback);\n } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) {\n matches.push(entry.callback);\n }\n });\n }\n\n return matches;\n }\n\n function filterFromRegistry(list, matchContainer, matchCallback) {\n var containerNode = extractElementNode(matchContainer);\n return list.filter(function(entry) {\n var isMatch = entry.node === containerNode &&\n (!matchCallback || entry.callback === matchCallback);\n return !isMatch;\n });\n }\n\n function cleanupEventListeners(phase, element) {\n if (phase === 'close' && !element[0].parentNode) {\n // If the element is not attached to a parentNode, it has been removed by\n // the domOperation, and we can safely remove the event callbacks\n $animate.off(element);\n }\n }\n\n var $animate = {\n on: function(event, container, callback) {\n var node = extractElementNode(container);\n callbackRegistry[event] = callbackRegistry[event] || [];\n callbackRegistry[event].push({\n node: node,\n callback: callback\n });\n\n // Remove the callback when the element is removed from the DOM\n jqLite(container).on('$destroy', function() {\n var animationDetails = activeAnimationsLookup.get(node);\n\n if (!animationDetails) {\n // If there's an animation ongoing, the callback calling code will remove\n // the event listeners. If we'd remove here, the callbacks would be removed\n // before the animation ends\n $animate.off(event, container, callback);\n }\n });\n },\n\n off: function(event, container, callback) {\n if (arguments.length === 1 && !angular.isString(arguments[0])) {\n container = arguments[0];\n for (var eventType in callbackRegistry) {\n callbackRegistry[eventType] = filterFromRegistry(callbackRegistry[eventType], container);\n }\n\n return;\n }\n\n var entries = callbackRegistry[event];\n if (!entries) return;\n\n callbackRegistry[event] = arguments.length === 1\n ? null\n : filterFromRegistry(entries, container, callback);\n },\n\n pin: function(element, parentElement) {\n assertArg(isElement(element), 'element', 'not an element');\n assertArg(isElement(parentElement), 'parentElement', 'not an element');\n element.data(NG_ANIMATE_PIN_DATA, parentElement);\n },\n\n push: function(element, event, options, domOperation) {\n options = options || {};\n options.domOperation = domOperation;\n return queueAnimation(element, event, options);\n },\n\n // this method has four signatures:\n // () - global getter\n // (bool) - global setter\n // (element) - element getter\n // (element, bool) - element setter\n enabled: function(element, bool) {\n var argCount = arguments.length;\n\n if (argCount === 0) {\n // () - Global getter\n bool = !!animationsEnabled;\n } else {\n var hasElement = isElement(element);\n\n if (!hasElement) {\n // (bool) - Global setter\n bool = animationsEnabled = !!element;\n } else {\n var node = getDomNode(element);\n var recordExists = disabledElementsLookup.get(node);\n\n if (argCount === 1) {\n // (element) - Element getter\n bool = !recordExists;\n } else {\n // (element, bool) - Element setter\n disabledElementsLookup.put(node, !bool);\n }\n }\n }\n\n return bool;\n }\n };\n\n return $animate;\n\n function queueAnimation(element, event, initialOptions) {\n // we always make a copy of the options since\n // there should never be any side effects on\n // the input data when running `$animateCss`.\n var options = copy(initialOptions);\n\n var node, parent;\n element = stripCommentsFromElement(element);\n if (element) {\n node = getDomNode(element);\n parent = element.parent();\n }\n\n options = prepareAnimationOptions(options);\n\n // we create a fake runner with a working promise.\n // These methods will become available after the digest has passed\n var runner = new $$AnimateRunner();\n\n // this is used to trigger callbacks in postDigest mode\n var runInNextPostDigestOrNow = postDigestTaskFactory();\n\n if (isArray(options.addClass)) {\n options.addClass = options.addClass.join(' ');\n }\n\n if (options.addClass && !isString(options.addClass)) {\n options.addClass = null;\n }\n\n if (isArray(options.removeClass)) {\n options.removeClass = options.removeClass.join(' ');\n }\n\n if (options.removeClass && !isString(options.removeClass)) {\n options.removeClass = null;\n }\n\n if (options.from && !isObject(options.from)) {\n options.from = null;\n }\n\n if (options.to && !isObject(options.to)) {\n options.to = null;\n }\n\n // there are situations where a directive issues an animation for\n // a jqLite wrapper that contains only comment nodes... If this\n // happens then there is no way we can perform an animation\n if (!node) {\n close();\n return runner;\n }\n\n var className = [node.className, options.addClass, options.removeClass].join(' ');\n if (!isAnimatableClassName(className)) {\n close();\n return runner;\n }\n\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n var documentHidden = $document[0].hidden;\n\n // this is a hard disable of all animations for the application or on\n // the element itself, therefore there is no need to continue further\n // past this point if not enabled\n // Animations are also disabled if the document is currently hidden (page is not visible\n // to the user), because browsers slow down or do not flush calls to requestAnimationFrame\n var skipAnimations = !animationsEnabled || documentHidden || disabledElementsLookup.get(node);\n var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};\n var hasExistingAnimation = !!existingAnimation.state;\n\n // there is no point in traversing the same collection of parent ancestors if a followup\n // animation will be run on the same element that already did all that checking work\n if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {\n skipAnimations = !areAnimationsAllowed(element, parent, event);\n }\n\n if (skipAnimations) {\n // Callbacks should fire even if the document is hidden (regression fix for issue #14120)\n if (documentHidden) notifyProgress(runner, event, 'start');\n close();\n if (documentHidden) notifyProgress(runner, event, 'close');\n return runner;\n }\n\n if (isStructural) {\n closeChildAnimations(element);\n }\n\n var newAnimation = {\n structural: isStructural,\n element: element,\n event: event,\n addClass: options.addClass,\n removeClass: options.removeClass,\n close: close,\n options: options,\n runner: runner\n };\n\n if (hasExistingAnimation) {\n var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);\n if (skipAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n close();\n return runner;\n } else {\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n return existingAnimation.runner;\n }\n }\n var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);\n if (cancelAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n // this will end the animation right away and it is safe\n // to do so since the animation is already running and the\n // runner callback code will run in async\n existingAnimation.runner.end();\n } else if (existingAnimation.structural) {\n // this means that the animation is queued into a digest, but\n // hasn't started yet. Therefore it is safe to run the close\n // method which will call the runner methods in async.\n existingAnimation.close();\n } else {\n // this will merge the new animation options into existing animation options\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n return existingAnimation.runner;\n }\n } else {\n // a joined animation means that this animation will take over the existing one\n // so an example would involve a leave animation taking over an enter. Then when\n // the postDigest kicks in the enter will be ignored.\n var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);\n if (joinAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n normalizeAnimationDetails(element, newAnimation);\n } else {\n applyGeneratedPreparationClasses(element, isStructural ? event : null, options);\n\n event = newAnimation.event = existingAnimation.event;\n options = mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n //we return the same runner since only the option values of this animation will\n //be fed into the `existingAnimation`.\n return existingAnimation.runner;\n }\n }\n }\n } else {\n // normalization in this case means that it removes redundant CSS classes that\n // already exist (addClass) or do not exist (removeClass) on the element\n normalizeAnimationDetails(element, newAnimation);\n }\n\n // when the options are merged and cleaned up we may end up not having to do\n // an animation at all, therefore we should check this before issuing a post\n // digest callback. Structural animations will always run no matter what.\n var isValidAnimation = newAnimation.structural;\n if (!isValidAnimation) {\n // animate (from/to) can be quickly checked first, otherwise we check if any classes are present\n isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)\n || hasAnimationClasses(newAnimation);\n }\n\n if (!isValidAnimation) {\n close();\n clearElementAnimationState(element);\n return runner;\n }\n\n // the counter keeps track of cancelled animations\n var counter = (existingAnimation.counter || 0) + 1;\n newAnimation.counter = counter;\n\n markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation);\n\n $rootScope.$$postDigest(function() {\n var animationDetails = activeAnimationsLookup.get(node);\n var animationCancelled = !animationDetails;\n animationDetails = animationDetails || {};\n\n // if addClass/removeClass is called before something like enter then the\n // registered parent element may not be present. The code below will ensure\n // that a final value for parent element is obtained\n var parentElement = element.parent() || [];\n\n // animate/structural/class-based animations all have requirements. Otherwise there\n // is no point in performing an animation. The parent node must also be set.\n var isValidAnimation = parentElement.length > 0\n && (animationDetails.event === 'animate'\n || animationDetails.structural\n || hasAnimationClasses(animationDetails));\n\n // this means that the previous animation was cancelled\n // even if the follow-up animation is the same event\n if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {\n // if another animation did not take over then we need\n // to make sure that the domOperation and options are\n // handled accordingly\n if (animationCancelled) {\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n }\n\n // if the event changed from something like enter to leave then we do\n // it, otherwise if it's the same then the end result will be the same too\n if (animationCancelled || (isStructural && animationDetails.event !== event)) {\n options.domOperation();\n runner.end();\n }\n\n // in the event that the element animation was not cancelled or a follow-up animation\n // isn't allowed to animate from here then we need to clear the state of the element\n // so that any future animations won't read the expired animation data.\n if (!isValidAnimation) {\n clearElementAnimationState(element);\n }\n\n return;\n }\n\n // this combined multiple class to addClass / removeClass into a setClass event\n // so long as a structural event did not take over the animation\n event = !animationDetails.structural && hasAnimationClasses(animationDetails, true)\n ? 'setClass'\n : animationDetails.event;\n\n markElementAnimationState(element, RUNNING_STATE);\n var realRunner = $$animation(element, event, animationDetails.options);\n\n // this will update the runner's flow-control events based on\n // the `realRunner` object.\n runner.setHost(realRunner);\n notifyProgress(runner, event, 'start', {});\n\n realRunner.done(function(status) {\n close(!status);\n var animationDetails = activeAnimationsLookup.get(node);\n if (animationDetails && animationDetails.counter === counter) {\n clearElementAnimationState(getDomNode(element));\n }\n notifyProgress(runner, event, 'close', {});\n });\n });\n\n return runner;\n\n function notifyProgress(runner, event, phase, data) {\n runInNextPostDigestOrNow(function() {\n var callbacks = findCallbacks(parent, element, event);\n if (callbacks.length) {\n // do not optimize this call here to RAF because\n // we don't know how heavy the callback code here will\n // be and if this code is buffered then this can\n // lead to a performance regression.\n $$rAF(function() {\n forEach(callbacks, function(callback) {\n callback(element, phase, data);\n });\n cleanupEventListeners(phase, element);\n });\n } else {\n cleanupEventListeners(phase, element);\n }\n });\n runner.progress(event, phase, data);\n }\n\n function close(reject) { // jshint ignore:line\n clearGeneratedClasses(element, options);\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n runner.complete(!reject);\n }\n }\n\n function closeChildAnimations(element) {\n var node = getDomNode(element);\n var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');\n forEach(children, function(child) {\n var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));\n var animationDetails = activeAnimationsLookup.get(child);\n if (animationDetails) {\n switch (state) {\n case RUNNING_STATE:\n animationDetails.runner.end();\n /* falls through */\n case PRE_DIGEST_STATE:\n activeAnimationsLookup.remove(child);\n break;\n }\n }\n });\n }\n\n function clearElementAnimationState(element) {\n var node = getDomNode(element);\n node.removeAttribute(NG_ANIMATE_ATTR_NAME);\n activeAnimationsLookup.remove(node);\n }\n\n function isMatchingElement(nodeOrElmA, nodeOrElmB) {\n return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB);\n }\n\n /**\n * This fn returns false if any of the following is true:\n * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed\n * b) a parent element has an ongoing structural animation, and animateChildren is false\n * c) the element is not a child of the body\n * d) the element is not a child of the $rootElement\n */\n function areAnimationsAllowed(element, parentElement, event) {\n var bodyElement = jqLite($document[0].body);\n var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML';\n var rootElementDetected = isMatchingElement(element, $rootElement);\n var parentAnimationDetected = false;\n var animateChildren;\n var elementDisabled = disabledElementsLookup.get(getDomNode(element));\n\n var parentHost = jqLite.data(element[0], NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n parentElement = parentHost;\n }\n\n parentElement = getDomNode(parentElement);\n\n while (parentElement) {\n if (!rootElementDetected) {\n // angular doesn't want to attempt to animate elements outside of the application\n // therefore we need to ensure that the rootElement is an ancestor of the current element\n rootElementDetected = isMatchingElement(parentElement, $rootElement);\n }\n\n if (parentElement.nodeType !== ELEMENT_NODE) {\n // no point in inspecting the #document element\n break;\n }\n\n var details = activeAnimationsLookup.get(parentElement) || {};\n // either an enter, leave or move animation will commence\n // therefore we can't allow any animations to take place\n // but if a parent animation is class-based then that's ok\n if (!parentAnimationDetected) {\n var parentElementDisabled = disabledElementsLookup.get(parentElement);\n\n if (parentElementDisabled === true && elementDisabled !== false) {\n // disable animations if the user hasn't explicitly enabled animations on the\n // current element\n elementDisabled = true;\n // element is disabled via parent element, no need to check anything else\n break;\n } else if (parentElementDisabled === false) {\n elementDisabled = false;\n }\n parentAnimationDetected = details.structural;\n }\n\n if (isUndefined(animateChildren) || animateChildren === true) {\n var value = jqLite.data(parentElement, NG_ANIMATE_CHILDREN_DATA);\n if (isDefined(value)) {\n animateChildren = value;\n }\n }\n\n // there is no need to continue traversing at this point\n if (parentAnimationDetected && animateChildren === false) break;\n\n if (!bodyElementDetected) {\n // we also need to ensure that the element is or will be a part of the body element\n // otherwise it is pointless to even issue an animation to be rendered\n bodyElementDetected = isMatchingElement(parentElement, bodyElement);\n }\n\n if (bodyElementDetected && rootElementDetected) {\n // If both body and root have been found, any other checks are pointless,\n // as no animation data should live outside the application\n break;\n }\n\n if (!rootElementDetected) {\n // If no rootElement is detected, check if the parentElement is pinned to another element\n parentHost = jqLite.data(parentElement, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n // The pin target element becomes the next parent element\n parentElement = getDomNode(parentHost);\n continue;\n }\n }\n\n parentElement = parentElement.parentNode;\n }\n\n var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;\n return allowAnimation && rootElementDetected && bodyElementDetected;\n }\n\n function markElementAnimationState(element, state, details) {\n details = details || {};\n details.state = state;\n\n var node = getDomNode(element);\n node.setAttribute(NG_ANIMATE_ATTR_NAME, state);\n\n var oldValue = activeAnimationsLookup.get(node);\n var newValue = oldValue\n ? extend(oldValue, details)\n : details;\n activeAnimationsLookup.put(node, newValue);\n }\n }];\n}];\n\nvar $$AnimationProvider = ['$animateProvider', function($animateProvider) {\n var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';\n\n var drivers = this.drivers = [];\n\n var RUNNER_STORAGE_KEY = '$$animationRunner';\n\n function setRunner(element, runner) {\n element.data(RUNNER_STORAGE_KEY, runner);\n }\n\n function removeRunner(element) {\n element.removeData(RUNNER_STORAGE_KEY);\n }\n\n function getRunner(element) {\n return element.data(RUNNER_STORAGE_KEY);\n }\n\n this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$HashMap', '$$rAFScheduler',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$HashMap, $$rAFScheduler) {\n\n var animationQueue = [];\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function sortAnimations(animations) {\n var tree = { children: [] };\n var i, lookup = new $$HashMap();\n\n // this is done first beforehand so that the hashmap\n // is filled with a list of the elements that will be animated\n for (i = 0; i < animations.length; i++) {\n var animation = animations[i];\n lookup.put(animation.domNode, animations[i] = {\n domNode: animation.domNode,\n fn: animation.fn,\n children: []\n });\n }\n\n for (i = 0; i < animations.length; i++) {\n processNode(animations[i]);\n }\n\n return flatten(tree);\n\n function processNode(entry) {\n if (entry.processed) return entry;\n entry.processed = true;\n\n var elementNode = entry.domNode;\n var parentNode = elementNode.parentNode;\n lookup.put(elementNode, entry);\n\n var parentEntry;\n while (parentNode) {\n parentEntry = lookup.get(parentNode);\n if (parentEntry) {\n if (!parentEntry.processed) {\n parentEntry = processNode(parentEntry);\n }\n break;\n }\n parentNode = parentNode.parentNode;\n }\n\n (parentEntry || tree).children.push(entry);\n return entry;\n }\n\n function flatten(tree) {\n var result = [];\n var queue = [];\n var i;\n\n for (i = 0; i < tree.children.length; i++) {\n queue.push(tree.children[i]);\n }\n\n var remainingLevelEntries = queue.length;\n var nextLevelEntries = 0;\n var row = [];\n\n for (i = 0; i < queue.length; i++) {\n var entry = queue[i];\n if (remainingLevelEntries <= 0) {\n remainingLevelEntries = nextLevelEntries;\n nextLevelEntries = 0;\n result.push(row);\n row = [];\n }\n row.push(entry.fn);\n entry.children.forEach(function(childEntry) {\n nextLevelEntries++;\n queue.push(childEntry);\n });\n remainingLevelEntries--;\n }\n\n if (row.length) {\n result.push(row);\n }\n\n return result;\n }\n }\n\n // TODO(matsko): document the signature in a better way\n return function(element, event, options) {\n options = prepareAnimationOptions(options);\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n // there is no animation at the current moment, however\n // these runner methods will get later updated with the\n // methods leading into the driver's end/cancel methods\n // for now they just stop the animation from starting\n var runner = new $$AnimateRunner({\n end: function() { close(); },\n cancel: function() { close(true); }\n });\n\n if (!drivers.length) {\n close();\n return runner;\n }\n\n setRunner(element, runner);\n\n var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));\n var tempClasses = options.tempClasses;\n if (tempClasses) {\n classes += ' ' + tempClasses;\n options.tempClasses = null;\n }\n\n var prepareClassName;\n if (isStructural) {\n prepareClassName = 'ng-' + event + PREPARE_CLASS_SUFFIX;\n $$jqLite.addClass(element, prepareClassName);\n }\n\n animationQueue.push({\n // this data is used by the postDigest code and passed into\n // the driver step function\n element: element,\n classes: classes,\n event: event,\n structural: isStructural,\n options: options,\n beforeStart: beforeStart,\n close: close\n });\n\n element.on('$destroy', handleDestroyedElement);\n\n // we only want there to be one function called within the post digest\n // block. This way we can group animations for all the animations that\n // were apart of the same postDigest flush call.\n if (animationQueue.length > 1) return runner;\n\n $rootScope.$$postDigest(function() {\n var animations = [];\n forEach(animationQueue, function(entry) {\n // the element was destroyed early on which removed the runner\n // form its storage. This means we can't animate this element\n // at all and it already has been closed due to destruction.\n if (getRunner(entry.element)) {\n animations.push(entry);\n } else {\n entry.close();\n }\n });\n\n // now any future animations will be in another postDigest\n animationQueue.length = 0;\n\n var groupedAnimations = groupAnimations(animations);\n var toBeSortedAnimations = [];\n\n forEach(groupedAnimations, function(animationEntry) {\n toBeSortedAnimations.push({\n domNode: getDomNode(animationEntry.from ? animationEntry.from.element : animationEntry.element),\n fn: function triggerAnimationStart() {\n // it's important that we apply the `ng-animate` CSS class and the\n // temporary classes before we do any driver invoking since these\n // CSS classes may be required for proper CSS detection.\n animationEntry.beforeStart();\n\n var startAnimationFn, closeFn = animationEntry.close;\n\n // in the event that the element was removed before the digest runs or\n // during the RAF sequencing then we should not trigger the animation.\n var targetElement = animationEntry.anchors\n ? (animationEntry.from.element || animationEntry.to.element)\n : animationEntry.element;\n\n if (getRunner(targetElement)) {\n var operation = invokeFirstDriver(animationEntry);\n if (operation) {\n startAnimationFn = operation.start;\n }\n }\n\n if (!startAnimationFn) {\n closeFn();\n } else {\n var animationRunner = startAnimationFn();\n animationRunner.done(function(status) {\n closeFn(!status);\n });\n updateAnimationRunners(animationEntry, animationRunner);\n }\n }\n });\n });\n\n // we need to sort each of the animations in order of parent to child\n // relationships. This ensures that the child classes are applied at the\n // right time.\n $$rAFScheduler(sortAnimations(toBeSortedAnimations));\n });\n\n return runner;\n\n // TODO(matsko): change to reference nodes\n function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }\n\n function groupAnimations(animations) {\n var preparedAnimations = [];\n var refLookup = {};\n forEach(animations, function(animation, index) {\n var element = animation.element;\n var node = getDomNode(element);\n var event = animation.event;\n var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;\n var anchorNodes = animation.structural ? getAnchorNodes(node) : [];\n\n if (anchorNodes.length) {\n var direction = enterOrMove ? 'to' : 'from';\n\n forEach(anchorNodes, function(anchor) {\n var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);\n refLookup[key] = refLookup[key] || {};\n refLookup[key][direction] = {\n animationID: index,\n element: jqLite(anchor)\n };\n });\n } else {\n preparedAnimations.push(animation);\n }\n });\n\n var usedIndicesLookup = {};\n var anchorGroups = {};\n forEach(refLookup, function(operations, key) {\n var from = operations.from;\n var to = operations.to;\n\n if (!from || !to) {\n // only one of these is set therefore we can't have an\n // anchor animation since all three pieces are required\n var index = from ? from.animationID : to.animationID;\n var indexKey = index.toString();\n if (!usedIndicesLookup[indexKey]) {\n usedIndicesLookup[indexKey] = true;\n preparedAnimations.push(animations[index]);\n }\n return;\n }\n\n var fromAnimation = animations[from.animationID];\n var toAnimation = animations[to.animationID];\n var lookupKey = from.animationID.toString();\n if (!anchorGroups[lookupKey]) {\n var group = anchorGroups[lookupKey] = {\n structural: true,\n beforeStart: function() {\n fromAnimation.beforeStart();\n toAnimation.beforeStart();\n },\n close: function() {\n fromAnimation.close();\n toAnimation.close();\n },\n classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),\n from: fromAnimation,\n to: toAnimation,\n anchors: [] // TODO(matsko): change to reference nodes\n };\n\n // the anchor animations require that the from and to elements both have at least\n // one shared CSS class which effectively marries the two elements together to use\n // the same animation driver and to properly sequence the anchor animation.\n if (group.classes.length) {\n preparedAnimations.push(group);\n } else {\n preparedAnimations.push(fromAnimation);\n preparedAnimations.push(toAnimation);\n }\n }\n\n anchorGroups[lookupKey].anchors.push({\n 'out': from.element, 'in': to.element\n });\n });\n\n return preparedAnimations;\n }\n\n function cssClassesIntersection(a,b) {\n a = a.split(' ');\n b = b.split(' ');\n var matches = [];\n\n for (var i = 0; i < a.length; i++) {\n var aa = a[i];\n if (aa.substring(0,3) === 'ng-') continue;\n\n for (var j = 0; j < b.length; j++) {\n if (aa === b[j]) {\n matches.push(aa);\n break;\n }\n }\n }\n\n return matches.join(' ');\n }\n\n function invokeFirstDriver(animationDetails) {\n // we loop in reverse order since the more general drivers (like CSS and JS)\n // may attempt more elements, but custom drivers are more particular\n for (var i = drivers.length - 1; i >= 0; i--) {\n var driverName = drivers[i];\n if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check\n\n var factory = $injector.get(driverName);\n var driver = factory(animationDetails);\n if (driver) {\n return driver;\n }\n }\n }\n\n function beforeStart() {\n element.addClass(NG_ANIMATE_CLASSNAME);\n if (tempClasses) {\n $$jqLite.addClass(element, tempClasses);\n }\n if (prepareClassName) {\n $$jqLite.removeClass(element, prepareClassName);\n prepareClassName = null;\n }\n }\n\n function updateAnimationRunners(animation, newRunner) {\n if (animation.from && animation.to) {\n update(animation.from.element);\n update(animation.to.element);\n } else {\n update(animation.element);\n }\n\n function update(element) {\n getRunner(element).setHost(newRunner);\n }\n }\n\n function handleDestroyedElement() {\n var runner = getRunner(element);\n if (runner && (event !== 'leave' || !options.$$domOperationFired)) {\n runner.end();\n }\n }\n\n function close(rejected) { // jshint ignore:line\n element.off('$destroy', handleDestroyedElement);\n removeRunner(element);\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n\n if (tempClasses) {\n $$jqLite.removeClass(element, tempClasses);\n }\n\n element.removeClass(NG_ANIMATE_CLASSNAME);\n runner.complete(!rejected);\n }\n };\n }];\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateSwap\n * @restrict A\n * @scope\n *\n * @description\n *\n * ngAnimateSwap is a animation-oriented directive that allows for the container to\n * be removed and entered in whenever the associated expression changes. A\n * common usecase for this directive is a rotating banner or slider component which\n * contains one image being present at a time. When the active image changes\n * then the old image will perform a `leave` animation and the new element\n * will be inserted via an `enter` animation.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|--------------------------------------|\n * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |\n * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM |\n *\n * @example\n * \n * \n *
\n *
\n * {{ number }}\n *
\n *
\n *
\n * \n * angular.module('ngAnimateSwapExample', ['ngAnimate'])\n * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {\n * $scope.number = 0;\n * $interval(function() {\n * $scope.number++;\n * }, 1000);\n *\n * var colors = ['red','blue','green','yellow','orange'];\n * $scope.colorClass = function(number) {\n * return colors[number % colors.length];\n * };\n * }]);\n * \n * \n * .container {\n * height:250px;\n * width:250px;\n * position:relative;\n * overflow:hidden;\n * border:2px solid black;\n * }\n * .container .cell {\n * font-size:150px;\n * text-align:center;\n * line-height:250px;\n * position:absolute;\n * top:0;\n * left:0;\n * right:0;\n * border-bottom:2px solid black;\n * }\n * .swap-animation.ng-enter, .swap-animation.ng-leave {\n * transition:0.5s linear all;\n * }\n * .swap-animation.ng-enter {\n * top:-250px;\n * }\n * .swap-animation.ng-enter-active {\n * top:0px;\n * }\n * .swap-animation.ng-leave {\n * top:0px;\n * }\n * .swap-animation.ng-leave-active {\n * top:250px;\n * }\n * .red { background:red; }\n * .green { background:green; }\n * .blue { background:blue; }\n * .yellow { background:yellow; }\n * .orange { background:orange; }\n * \n *
\n */\nvar ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $rootScope) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 600, // we use 600 here to ensure that the directive is caught before others\n link: function(scope, $element, attrs, ctrl, $transclude) {\n var previousElement, previousScope;\n scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) {\n if (previousElement) {\n $animate.leave(previousElement);\n }\n if (previousScope) {\n previousScope.$destroy();\n previousScope = null;\n }\n if (value || value === 0) {\n previousScope = scope.$new();\n $transclude(previousScope, function(element) {\n previousElement = element;\n $animate.enter(element, null, $element);\n });\n }\n });\n }\n };\n}];\n\n/* global angularAnimateModule: true,\n\n ngAnimateSwapDirective,\n $$AnimateAsyncRunFactory,\n $$rAFSchedulerFactory,\n $$AnimateChildrenDirective,\n $$AnimateQueueProvider,\n $$AnimationProvider,\n $AnimateCssProvider,\n $$AnimateCssDriverProvider,\n $$AnimateJsProvider,\n $$AnimateJsDriverProvider,\n*/\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via\n * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app.\n *\n *
\n *\n * # Usage\n * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based\n * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For\n * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within\n * the HTML element that the animation will be triggered on.\n *\n * ## Directive Support\n * The following directives are \"animation aware\":\n *\n * | Directive | Supported Animations |\n * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |\n * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |\n * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |\n * | {@link module:ngMessages#animations ngMessage} | enter and leave |\n *\n * (More information can be found by visiting each the documentation associated with each directive.)\n *\n * ## CSS-based Animations\n *\n * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML\n * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.\n *\n * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:\n *\n * ```html\n *
\n * Fade me in out\n *
\n * \n * \n * ```\n *\n * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:\n *\n * ```css\n * /* The starting CSS styles for the enter animation */\n * .fade.ng-enter {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n *\n * /* The finishing CSS styles for the enter animation */\n * .fade.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * ```\n *\n * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two\n * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition\n * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.\n *\n * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:\n *\n * ```css\n * /* now the element will fade out before it is removed from the DOM */\n * .fade.ng-leave {\n * transition:0.5s linear all;\n * opacity:1;\n * }\n * .fade.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:\n *\n * ```css\n * /* there is no need to define anything inside of the destination\n * CSS class since the keyframe will take charge of the animation */\n * .fade.ng-leave {\n * animation: my_fade_animation 0.5s linear;\n * -webkit-animation: my_fade_animation 0.5s linear;\n * }\n *\n * @keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n *\n * @-webkit-keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n * ```\n *\n * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.\n *\n * ### CSS Class-based Animations\n *\n * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different\n * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added\n * and removed.\n *\n * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:\n *\n * ```html\n *
\n * Show and hide me\n *
\n * \n *\n * \n * ```\n *\n * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since\n * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.\n *\n * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation\n * with CSS styles.\n *\n * ```html\n *
\n * Highlight this box\n *
\n * \n *\n * \n * ```\n *\n * We can also make use of CSS keyframes by placing them within the CSS classes.\n *\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n * /* standard transition code */\n * transition: 1s linear all;\n * opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n * /* this will have a 100ms delay between each successive leave animation */\n * transition-delay: 0.1s;\n *\n * /* As of 1.4.4, this must always be set: it signals ngAnimate\n * to not accidentally inherit a delay property from another CSS class */\n * transition-duration: 0s;\n * }\n * .my-animation.ng-enter.ng-enter-active {\n * /* standard transition styles */\n * opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * window.requestAnimationFrame(function() {\n * //stagger has reset itself\n * $animate.leave(kids[5]); //stagger index=0\n * $animate.leave(kids[6]); //stagger index=1\n *\n * $scope.$digest();\n * });\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ### The `ng-animate` CSS class\n *\n * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.\n * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).\n *\n * Therefore, animations can be applied to an element using this temporary class directly via CSS.\n *\n * ```css\n * .zipper.ng-animate {\n * transition:0.5s linear all;\n * }\n * .zipper.ng-enter {\n * opacity:0;\n * }\n * .zipper.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * .zipper.ng-leave {\n * opacity:1;\n * }\n * .zipper.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove\n * the CSS class once an animation has completed.)\n *\n *\n * ### The `ng-[event]-prepare` class\n *\n * This is a special class that can be used to prevent unwanted flickering / flash of content before\n * the actual animation starts. The class is added as soon as an animation is initialized, but removed\n * before the actual animation starts (after waiting for a $digest).\n * It is also only added for *structural* animations (`enter`, `move`, and `leave`).\n *\n * In practice, flickering can appear when nesting elements with structural animations such as `ngIf`\n * into elements that have class-based animations such as `ngClass`.\n *\n * ```html\n *
\n *
\n *
\n *
\n *
\n * ```\n *\n * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.\n * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:\n *\n * ```css\n * .message.ng-enter-prepare {\n * opacity: 0;\n * }\n *\n * ```\n *\n * ## JavaScript-based Animations\n *\n * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared\n * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the\n * `module.animation()` module function we can register the animation.\n *\n * Let's see an example of a enter/leave animation using `ngRepeat`:\n *\n * ```html\n *
\n * {{ item }}\n *
\n * ```\n *\n * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * // make note that other events (like addClass/removeClass)\n * // have different function input parameters\n * enter: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n *\n * // remember to call doneFn so that angular\n * // knows that the animation has concluded\n * },\n *\n * move: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n * },\n *\n * leave: function(element, doneFn) {\n * jQuery(element).fadeOut(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as\n * greensock.js and velocity.js.\n *\n * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define\n * our animations inside of the same registered animation, however, the function input arguments are a bit different:\n *\n * ```html\n *
\n * this box is moody\n *
\n * \n * \n * \n * ```\n *\n * ```js\n * myModule.animation('.colorful', [function() {\n * return {\n * addClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * removeClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * setClass: function(element, addedClass, removedClass, doneFn) {\n * // do some cool animation and call the doneFn\n * }\n * }\n * }]);\n * ```\n *\n * ## CSS + JS Animations Together\n *\n * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular,\n * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking\n * charge of the animation**:\n *\n * ```html\n *
\n * Slide in and out\n *
\n * ```\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * enter: function(element, doneFn) {\n * jQuery(element).slideIn(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * ```css\n * .slide.ng-enter {\n * transition:0.5s linear all;\n * transform:translateY(-100px);\n * }\n * .slide.ng-enter.ng-enter-active {\n * transform:translateY(0);\n * }\n * ```\n *\n * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the\n * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from\n * our own JS-based animation code:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true\n * });\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.\n *\n * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or\n * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that\n * data into `$animateCss` directly:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true,\n * addClass: 'maroon-setting',\n * from: { height:0 },\n * to: { height: 200 }\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Now we can fill in the rest via our transition CSS code:\n *\n * ```css\n * /* the transition tells ngAnimate to make the animation happen */\n * .slide.ng-enter { transition:0.5s linear all; }\n *\n * /* this extra CSS class will be absorbed into the transition\n * since the $animateCss code is adding the class */\n * .maroon-setting { background:red; }\n * ```\n *\n * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.\n *\n * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.\n *\n * ## Animation Anchoring (via `ng-animate-ref`)\n *\n * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between\n * structural areas of an application (like views) by pairing up elements using an attribute\n * called `ng-animate-ref`.\n *\n * Let's say for example we have two views that are managed by `ng-view` and we want to show\n * that there is a relationship between two components situated in within these views. By using the\n * `ng-animate-ref` attribute we can identify that the two components are paired together and we\n * can then attach an animation, which is triggered when the view changes.\n *\n * Say for example we have the following template code:\n *\n * ```html\n * \n *
\n *
\n *\n * \n * \n * \n * \n *\n * \n * \n * ```\n *\n * Now, when the view changes (once the link is clicked), ngAnimate will examine the\n * HTML contents to see if there is a match reference between any components in the view\n * that is leaving and the view that is entering. It will scan both the view which is being\n * removed (leave) and inserted (enter) to see if there are any paired DOM elements that\n * contain a matching ref value.\n *\n * The two images match since they share the same ref value. ngAnimate will now create a\n * transport element (which is a clone of the first image element) and it will then attempt\n * to animate to the position of the second image element in the next view. For the animation to\n * work a special CSS class called `ng-anchor` will be added to the transported element.\n *\n * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then\n * ngAnimate will handle the entire transition for us as well as the addition and removal of\n * any changes of CSS classes between the elements:\n *\n * ```css\n * .banner.ng-anchor {\n * /* this animation will last for 1 second since there are\n * two phases to the animation (an `in` and an `out` phase) */\n * transition:0.5s linear all;\n * }\n * ```\n *\n * We also **must** include animations for the views that are being entered and removed\n * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).\n *\n * ```css\n * .view-animation.ng-enter, .view-animation.ng-leave {\n * transition:0.5s linear all;\n * position:fixed;\n * left:0;\n * top:0;\n * width:100%;\n * }\n * .view-animation.ng-enter {\n * transform:translateX(100%);\n * }\n * .view-animation.ng-leave,\n * .view-animation.ng-enter.ng-enter-active {\n * transform:translateX(0%);\n * }\n * .view-animation.ng-leave.ng-leave-active {\n * transform:translateX(-100%);\n * }\n * ```\n *\n * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:\n * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away\n * from its origin. Once that animation is over then the `in` stage occurs which animates the\n * element to its destination. The reason why there are two animations is to give enough time\n * for the enter animation on the new element to be ready.\n *\n * The example above sets up a transition for both the in and out phases, but we can also target the out or\n * in phases directly via `ng-anchor-out` and `ng-anchor-in`.\n *\n * ```css\n * .banner.ng-anchor-out {\n * transition: 0.5s linear all;\n *\n * /* the scale will be applied during the out animation,\n * but will be animated away when the in animation runs */\n * transform: scale(1.2);\n * }\n *\n * .banner.ng-anchor-in {\n * transition: 1s linear all;\n * }\n * ```\n *\n *\n *\n *\n * ### Anchoring Demo\n *\n \n \n Home\n
\n
\n
\n
\n
\n \n angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])\n .config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/', {\n templateUrl: 'home.html',\n controller: 'HomeController as home'\n });\n $routeProvider.when('/profile/:id', {\n templateUrl: 'profile.html',\n controller: 'ProfileController as profile'\n });\n }])\n .run(['$rootScope', function($rootScope) {\n $rootScope.records = [\n { id:1, title: \"Miss Beulah Roob\" },\n { id:2, title: \"Trent Morissette\" },\n { id:3, title: \"Miss Ava Pouros\" },\n { id:4, title: \"Rod Pouros\" },\n { id:5, title: \"Abdul Rice\" },\n { id:6, title: \"Laurie Rutherford Sr.\" },\n { id:7, title: \"Nakia McLaughlin\" },\n { id:8, title: \"Jordon Blanda DVM\" },\n { id:9, title: \"Rhoda Hand\" },\n { id:10, title: \"Alexandrea Sauer\" }\n ];\n }])\n .controller('HomeController', [function() {\n //empty\n }])\n .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) {\n var index = parseInt($routeParams.id, 10);\n var record = $rootScope.records[index - 1];\n\n this.title = record.title;\n this.id = record.id;\n }]);\n \n \n

Welcome to the home page

\n

Please click on an element

\n \n {{ record.title }}\n \n
\n \n
\n {{ profile.title }}\n
\n
\n \n .record {\n display:block;\n font-size:20px;\n }\n .profile {\n background:black;\n color:white;\n font-size:100px;\n }\n .view-container {\n position:relative;\n }\n .view-container > .view.ng-animate {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n min-height:500px;\n }\n .view.ng-enter, .view.ng-leave,\n .record.ng-anchor {\n transition:0.5s linear all;\n }\n .view.ng-enter {\n transform:translateX(100%);\n }\n .view.ng-enter.ng-enter-active, .view.ng-leave {\n transform:translateX(0%);\n }\n .view.ng-leave.ng-leave-active {\n transform:translateX(-100%);\n }\n .record.ng-anchor-out {\n background:red;\n }\n \n
\n *\n * ### How is the element transported?\n *\n * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting\n * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element\n * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The\n * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match\n * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied\n * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class\n * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element\n * will become visible since the shim class will be removed.\n *\n * ### How is the morphing handled?\n *\n * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out\n * what CSS classes differ between the starting element and the destination element. These different CSS classes\n * will be added/removed on the anchor element and a transition will be applied (the transition that is provided\n * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will\n * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that\n * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since\n * the cloned element is placed inside of root element which is likely close to the body element).\n *\n * Note that if the root element is on the `` element then the cloned node will be placed inside of body.\n *\n *\n * ## Using $animate in your directive code\n *\n * So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application?\n * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's\n * imagine we have a greeting box that shows and hides itself when the data changes\n *\n * ```html\n * Hi there\n * ```\n *\n * ```js\n * ngModule.directive('greetingBox', ['$animate', function($animate) {\n * return function(scope, element, attrs) {\n * attrs.$observe('active', function(value) {\n * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');\n * });\n * });\n * }]);\n * ```\n *\n * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element\n * in our HTML code then we can trigger a CSS or JS animation to happen.\n *\n * ```css\n * /* normally we would create a CSS class to reference on the element */\n * greeting-box.on { transition:0.5s linear all; background:green; color:white; }\n * ```\n *\n * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's\n * possible be sure to visit the {@link ng.$animate $animate service API page}.\n *\n *\n * ## Callbacks and Promises\n *\n * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger\n * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has\n * ended by chaining onto the returned promise that animation method returns.\n *\n * ```js\n * // somewhere within the depths of the directive\n * $animate.enter(element, parent).then(function() {\n * //the animation has completed\n * });\n * ```\n *\n * (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case\n * anymore.)\n *\n * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering\n * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view\n * routing controller to hook into that:\n *\n * ```js\n * ngModule.controller('HomePageController', ['$animate', function($animate) {\n * $animate.on('enter', ngViewElement, function(element) {\n * // the animation for this route has completed\n * }]);\n * }])\n * ```\n *\n * (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.)\n */\n\n/**\n * @ngdoc service\n * @name $animate\n * @kind object\n *\n * @description\n * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.\n *\n * Click here {@link ng.$animate to learn more about animations with `$animate`}.\n */\nangular.module('ngAnimate', [])\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\n .provider('$$animation', $$AnimationProvider)\n\n .provider('$animateCss', $AnimateCssProvider)\n .provider('$$animateCssDriver', $$AnimateCssDriverProvider)\n\n .provider('$$animateJs', $$AnimateJsProvider)\n .provider('$$animateJsDriver', $$AnimateJsDriverProvider);\n\n\n})(window, window.angular);\n","require('./angular-animate');\nmodule.exports = 'ngAnimate';\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"angular\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"angular\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"angular\")) : factory(root[\"angular\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_5__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/*!********************************!*\\\n !*** ./src/angular-spinner.ts ***!\n \\********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar SpinJSSpinner_1 = __webpack_require__(/*! ./Constants/SpinJSSpinner */ 1);\n\tvar UsSpinnerService_1 = __webpack_require__(/*! ./Services/UsSpinnerService */ 3);\n\tvar AngularSpinner_1 = __webpack_require__(/*! ./Directives/AngularSpinner */ 4);\n\tvar UsSpinnerConfig_1 = __webpack_require__(/*! ./Config/UsSpinnerConfig */ 6);\n\tvar angular = __webpack_require__(/*! angular */ 5);\n\texports.angularSpinner = angular\n\t .module('angularSpinner', [])\n\t .provider('usSpinnerConfig', UsSpinnerConfig_1.UsSpinnerConfig)\n\t .constant('SpinJSSpinner', SpinJSSpinner_1.SpinJSSpinner)\n\t .service('usSpinnerService', UsSpinnerService_1.UsSpinnerService)\n\t .directive('usSpinner', AngularSpinner_1.usSpinner);\n\n\n/***/ },\n/* 1 */\n/*!****************************************!*\\\n !*** ./src/Constants/SpinJSSpinner.ts ***!\n \\****************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar Spinner = __webpack_require__(/*! spin.js */ 2);\n\t/**\n\t * Exporting the Spinner prototype from spin.js library\n\t */\n\texports.SpinJSSpinner = Spinner;\n\n\n/***/ },\n/* 2 */\n/*!***************************!*\\\n !*** ./~/spin.js/spin.js ***!\n \\***************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n\t * Copyright (c) 2011-2014 Felix Gnass\n\t * Licensed under the MIT license\n\t * http://spin.js.org/\n\t *\n\t * Example:\n\t var opts = {\n\t lines: 12 // The number of lines to draw\n\t , length: 7 // The length of each line\n\t , width: 5 // The line thickness\n\t , radius: 10 // The radius of the inner circle\n\t , scale: 1.0 // Scales overall size of the spinner\n\t , corners: 1 // Roundness (0..1)\n\t , color: '#000' // #rgb or #rrggbb\n\t , opacity: 1/4 // Opacity of the lines\n\t , rotate: 0 // Rotation offset\n\t , direction: 1 // 1: clockwise, -1: counterclockwise\n\t , speed: 1 // Rounds per second\n\t , trail: 100 // Afterglow percentage\n\t , fps: 20 // Frames per second when using setTimeout()\n\t , zIndex: 2e9 // Use a high z-index by default\n\t , className: 'spinner' // CSS class to assign to the element\n\t , top: '50%' // center vertically\n\t , left: '50%' // center horizontally\n\t , shadow: false // Whether to render a shadow\n\t , hwaccel: false // Whether to use hardware acceleration (might be buggy)\n\t , position: 'absolute' // Element positioning\n\t }\n\t var target = document.getElementById('foo')\n\t var spinner = new Spinner(opts).spin(target)\n\t */\n\t;(function (root, factory) {\n\t\n\t /* CommonJS */\n\t if (typeof module == 'object' && module.exports) module.exports = factory()\n\t\n\t /* AMD module */\n\t else if (true) !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))\n\t\n\t /* Browser global */\n\t else root.Spinner = factory()\n\t}(this, function () {\n\t \"use strict\"\n\t\n\t var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */\n\t , animations = {} /* Animation rules keyed by their name */\n\t , useCssAnimations /* Whether to use CSS animations or setTimeout */\n\t , sheet /* A stylesheet to hold the @keyframe or VML rules. */\n\t\n\t /**\n\t * Utility function to create elements. If no tag name is given,\n\t * a DIV is created. Optionally properties can be passed.\n\t */\n\t function createEl (tag, prop) {\n\t var el = document.createElement(tag || 'div')\n\t , n\n\t\n\t for (n in prop) el[n] = prop[n]\n\t return el\n\t }\n\t\n\t /**\n\t * Appends children and returns the parent.\n\t */\n\t function ins (parent /* child1, child2, ...*/) {\n\t for (var i = 1, n = arguments.length; i < n; i++) {\n\t parent.appendChild(arguments[i])\n\t }\n\t\n\t return parent\n\t }\n\t\n\t /**\n\t * Creates an opacity keyframe animation rule and returns its name.\n\t * Since most mobile Webkits have timing issues with animation-delay,\n\t * we create separate rules for each line/segment.\n\t */\n\t function addAnimation (alpha, trail, i, lines) {\n\t var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')\n\t , start = 0.01 + i/lines * 100\n\t , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)\n\t , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()\n\t , pre = prefix && '-' + prefix + '-' || ''\n\t\n\t if (!animations[name]) {\n\t sheet.insertRule(\n\t '@' + pre + 'keyframes ' + name + '{' +\n\t '0%{opacity:' + z + '}' +\n\t start + '%{opacity:' + alpha + '}' +\n\t (start+0.01) + '%{opacity:1}' +\n\t (start+trail) % 100 + '%{opacity:' + alpha + '}' +\n\t '100%{opacity:' + z + '}' +\n\t '}', sheet.cssRules.length)\n\t\n\t animations[name] = 1\n\t }\n\t\n\t return name\n\t }\n\t\n\t /**\n\t * Tries various vendor prefixes and returns the first supported property.\n\t */\n\t function vendor (el, prop) {\n\t var s = el.style\n\t , pp\n\t , i\n\t\n\t prop = prop.charAt(0).toUpperCase() + prop.slice(1)\n\t if (s[prop] !== undefined) return prop\n\t for (i = 0; i < prefixes.length; i++) {\n\t pp = prefixes[i]+prop\n\t if (s[pp] !== undefined) return pp\n\t }\n\t }\n\t\n\t /**\n\t * Sets multiple style properties at once.\n\t */\n\t function css (el, prop) {\n\t for (var n in prop) {\n\t el.style[vendor(el, n) || n] = prop[n]\n\t }\n\t\n\t return el\n\t }\n\t\n\t /**\n\t * Fills in default values.\n\t */\n\t function merge (obj) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var def = arguments[i]\n\t for (var n in def) {\n\t if (obj[n] === undefined) obj[n] = def[n]\n\t }\n\t }\n\t return obj\n\t }\n\t\n\t /**\n\t * Returns the line color from the given string or array.\n\t */\n\t function getColor (color, idx) {\n\t return typeof color == 'string' ? color : color[idx % color.length]\n\t }\n\t\n\t // Built-in defaults\n\t\n\t var defaults = {\n\t lines: 12 // The number of lines to draw\n\t , length: 7 // The length of each line\n\t , width: 5 // The line thickness\n\t , radius: 10 // The radius of the inner circle\n\t , scale: 1.0 // Scales overall size of the spinner\n\t , corners: 1 // Roundness (0..1)\n\t , color: '#000' // #rgb or #rrggbb\n\t , opacity: 1/4 // Opacity of the lines\n\t , rotate: 0 // Rotation offset\n\t , direction: 1 // 1: clockwise, -1: counterclockwise\n\t , speed: 1 // Rounds per second\n\t , trail: 100 // Afterglow percentage\n\t , fps: 20 // Frames per second when using setTimeout()\n\t , zIndex: 2e9 // Use a high z-index by default\n\t , className: 'spinner' // CSS class to assign to the element\n\t , top: '50%' // center vertically\n\t , left: '50%' // center horizontally\n\t , shadow: false // Whether to render a shadow\n\t , hwaccel: false // Whether to use hardware acceleration (might be buggy)\n\t , position: 'absolute' // Element positioning\n\t }\n\t\n\t /** The constructor */\n\t function Spinner (o) {\n\t this.opts = merge(o || {}, Spinner.defaults, defaults)\n\t }\n\t\n\t // Global defaults that override the built-ins:\n\t Spinner.defaults = {}\n\t\n\t merge(Spinner.prototype, {\n\t /**\n\t * Adds the spinner to the given target element. If this instance is already\n\t * spinning, it is automatically removed from its previous target b calling\n\t * stop() internally.\n\t */\n\t spin: function (target) {\n\t this.stop()\n\t\n\t var self = this\n\t , o = self.opts\n\t , el = self.el = createEl(null, {className: o.className})\n\t\n\t css(el, {\n\t position: o.position\n\t , width: 0\n\t , zIndex: o.zIndex\n\t , left: o.left\n\t , top: o.top\n\t })\n\t\n\t if (target) {\n\t target.insertBefore(el, target.firstChild || null)\n\t }\n\t\n\t el.setAttribute('role', 'progressbar')\n\t self.lines(el, self.opts)\n\t\n\t if (!useCssAnimations) {\n\t // No CSS animation support, use setTimeout() instead\n\t var i = 0\n\t , start = (o.lines - 1) * (1 - o.direction) / 2\n\t , alpha\n\t , fps = o.fps\n\t , f = fps / o.speed\n\t , ostep = (1 - o.opacity) / (f * o.trail / 100)\n\t , astep = f / o.lines\n\t\n\t ;(function anim () {\n\t i++\n\t for (var j = 0; j < o.lines; j++) {\n\t alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)\n\t\n\t self.opacity(el, j * o.direction + start, alpha, o)\n\t }\n\t self.timeout = self.el && setTimeout(anim, ~~(1000 / fps))\n\t })()\n\t }\n\t return self\n\t }\n\t\n\t /**\n\t * Stops and removes the Spinner.\n\t */\n\t , stop: function () {\n\t var el = this.el\n\t if (el) {\n\t clearTimeout(this.timeout)\n\t if (el.parentNode) el.parentNode.removeChild(el)\n\t this.el = undefined\n\t }\n\t return this\n\t }\n\t\n\t /**\n\t * Internal method that draws the individual lines. Will be overwritten\n\t * in VML fallback mode below.\n\t */\n\t , lines: function (el, o) {\n\t var i = 0\n\t , start = (o.lines - 1) * (1 - o.direction) / 2\n\t , seg\n\t\n\t function fill (color, shadow) {\n\t return css(createEl(), {\n\t position: 'absolute'\n\t , width: o.scale * (o.length + o.width) + 'px'\n\t , height: o.scale * o.width + 'px'\n\t , background: color\n\t , boxShadow: shadow\n\t , transformOrigin: 'left'\n\t , transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'\n\t , borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'\n\t })\n\t }\n\t\n\t for (; i < o.lines; i++) {\n\t seg = css(createEl(), {\n\t position: 'absolute'\n\t , top: 1 + ~(o.scale * o.width / 2) + 'px'\n\t , transform: o.hwaccel ? 'translate3d(0,0,0)' : ''\n\t , opacity: o.opacity\n\t , animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'\n\t })\n\t\n\t if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}))\n\t ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))\n\t }\n\t return el\n\t }\n\t\n\t /**\n\t * Internal method that adjusts the opacity of a single line.\n\t * Will be overwritten in VML fallback mode below.\n\t */\n\t , opacity: function (el, i, val) {\n\t if (i < el.childNodes.length) el.childNodes[i].style.opacity = val\n\t }\n\t\n\t })\n\t\n\t\n\t function initVML () {\n\t\n\t /* Utility function to create a VML tag */\n\t function vml (tag, attr) {\n\t return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n\t }\n\t\n\t // No CSS transforms but VML support, add a CSS rule for VML elements:\n\t sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')\n\t\n\t Spinner.prototype.lines = function (el, o) {\n\t var r = o.scale * (o.length + o.width)\n\t , s = o.scale * 2 * r\n\t\n\t function grp () {\n\t return css(\n\t vml('group', {\n\t coordsize: s + ' ' + s\n\t , coordorigin: -r + ' ' + -r\n\t })\n\t , { width: s, height: s }\n\t )\n\t }\n\t\n\t var margin = -(o.width + o.length) * o.scale * 2 + 'px'\n\t , g = css(grp(), {position: 'absolute', top: margin, left: margin})\n\t , i\n\t\n\t function seg (i, dx, filter) {\n\t ins(\n\t g\n\t , ins(\n\t css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})\n\t , ins(\n\t css(\n\t vml('roundrect', {arcsize: o.corners})\n\t , { width: r\n\t , height: o.scale * o.width\n\t , left: o.scale * o.radius\n\t , top: -o.scale * o.width >> 1\n\t , filter: filter\n\t }\n\t )\n\t , vml('fill', {color: getColor(o.color, i), opacity: o.opacity})\n\t , vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change\n\t )\n\t )\n\t )\n\t }\n\t\n\t if (o.shadow)\n\t for (i = 1; i <= o.lines; i++) {\n\t seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')\n\t }\n\t\n\t for (i = 1; i <= o.lines; i++) seg(i)\n\t return ins(el, g)\n\t }\n\t\n\t Spinner.prototype.opacity = function (el, i, val, o) {\n\t var c = el.firstChild\n\t o = o.shadow && o.lines || 0\n\t if (c && i + o < c.childNodes.length) {\n\t c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild\n\t if (c) c.opacity = val\n\t }\n\t }\n\t }\n\t\n\t if (typeof document !== 'undefined') {\n\t sheet = (function () {\n\t var el = createEl('style', {type : 'text/css'})\n\t ins(document.getElementsByTagName('head')[0], el)\n\t return el.sheet || el.styleSheet\n\t }())\n\t\n\t var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})\n\t\n\t if (!vendor(probe, 'transform') && probe.adj) initVML()\n\t else useCssAnimations = vendor(probe, 'animation')\n\t }\n\t\n\t return Spinner\n\t\n\t}));\n\n\n/***/ },\n/* 3 */\n/*!******************************************!*\\\n !*** ./src/Services/UsSpinnerService.ts ***!\n \\******************************************/\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t/**\n\t * UsSpinnerService\n\t * This service let you control spin, start and stop\n\t */\n\tvar UsSpinnerService = (function () {\n\t function UsSpinnerService($rootScope) {\n\t this.$rootScope = $rootScope;\n\t }\n\t UsSpinnerService.prototype.spin = function (key) {\n\t this.$rootScope.$broadcast('us-spinner:spin', key);\n\t };\n\t UsSpinnerService.prototype.stop = function (key) {\n\t this.$rootScope.$broadcast('us-spinner:stop', key);\n\t };\n\t return UsSpinnerService;\n\t}());\n\tUsSpinnerService.$inject = ['$rootScope'];\n\texports.UsSpinnerService = UsSpinnerService;\n\n\n/***/ },\n/* 4 */\n/*!******************************************!*\\\n !*** ./src/Directives/AngularSpinner.ts ***!\n \\******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar angular = __webpack_require__(/*! angular */ 5);\n\texports.usSpinner = function (SpinJSSpinner, usSpinnerConfig) {\n\t return {\n\t scope: true,\n\t link: function (scope, element, attr) {\n\t scope.spinner = null;\n\t scope.key = angular.isDefined(attr.spinnerKey) ? attr.spinnerKey : false;\n\t scope.startActive = (attr.spinnerStartActive) ?\n\t scope.$eval(attr.spinnerStartActive) : scope.key ?\n\t false : true;\n\t function stopSpinner() {\n\t if (scope.spinner) {\n\t scope.spinner.stop();\n\t }\n\t }\n\t scope.spin = function () {\n\t if (scope.spinner) {\n\t scope.spinner.spin(element[0]);\n\t }\n\t };\n\t scope.stop = function () {\n\t scope.startActive = false;\n\t stopSpinner();\n\t };\n\t scope.$watch(attr.usSpinner, function (options) {\n\t stopSpinner();\n\t // order of precedence: element options, theme, defaults.\n\t options = angular.extend({}, usSpinnerConfig.config, attr.spinnerTheme ? usSpinnerConfig.themes[attr.spinnerTheme] : undefined, options);\n\t scope.spinner = new SpinJSSpinner(options);\n\t if ((!scope.key || scope.startActive) && !attr.spinnerOn) {\n\t scope.spinner.spin(element[0]);\n\t }\n\t }, true);\n\t if (attr.spinnerOn) {\n\t scope.$watch(attr.spinnerOn, function (spin) {\n\t if (spin) {\n\t scope.spin();\n\t }\n\t else {\n\t scope.stop();\n\t }\n\t });\n\t }\n\t scope.$on('us-spinner:spin', function (event, key) {\n\t if (!key || key === scope.key) {\n\t scope.spin();\n\t }\n\t });\n\t scope.$on('us-spinner:stop', function (event, key) {\n\t if (!key || key === scope.key) {\n\t scope.stop();\n\t }\n\t });\n\t scope.$on('$destroy', function () {\n\t scope.stop();\n\t scope.spinner = null;\n\t });\n\t }\n\t };\n\t};\n\texports.usSpinner.$inject = ['SpinJSSpinner', 'usSpinnerConfig'];\n\n\n/***/ },\n/* 5 */\n/*!**************************!*\\\n !*** external \"angular\" ***!\n \\**************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n/***/ },\n/* 6 */\n/*!***************************************!*\\\n !*** ./src/Config/UsSpinnerConfig.ts ***!\n \\***************************************/\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t/**\n\t * UsSpinnerConfig\n\t */\n\tvar UsSpinnerConfig = (function () {\n\t function UsSpinnerConfig() {\n\t this.config = {};\n\t this.themes = {};\n\t }\n\t UsSpinnerConfig.prototype.setDefaults = function (config) {\n\t this.config = config || this.config;\n\t };\n\t UsSpinnerConfig.prototype.setTheme = function (name, config) {\n\t this.themes[name] = config;\n\t };\n\t UsSpinnerConfig.prototype.$get = function () {\n\t var _a = this, config = _a.config, themes = _a.themes;\n\t return {\n\t config: config,\n\t themes: themes\n\t };\n\t };\n\t return UsSpinnerConfig;\n\t}());\n\texports.UsSpinnerConfig = UsSpinnerConfig;\n\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=angular-spinner.js.map","/*!\n * Chart.js\n * http://chartjs.org/\n * Version: 1.0.2\n *\n * Copyright 2015 Nick Downie\n * Released under the MIT license\n * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md\n */\n\n\n(function(){\n\n\t\"use strict\";\n\n\t//Declare root variable - window in the browser, global on the server\n\tvar root = this,\n\t\tprevious = root.Chart;\n\n\t//Occupy the global variable of Chart, and create a simple base class\n\tvar Chart = function(context){\n\t\tvar chart = this;\n\t\tthis.canvas = context.canvas;\n\n\t\tthis.ctx = context;\n\n\t\t//Variables global to the chart\n\t\tvar computeDimension = function(element,dimension)\n\t\t{\n\t\t\tif (element['offset'+dimension])\n\t\t\t{\n\t\t\t\treturn element['offset'+dimension];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn document.defaultView.getComputedStyle(element).getPropertyValue(dimension);\n\t\t\t}\n\t\t}\n\n\t\tvar width = this.width = computeDimension(context.canvas,'Width');\n\t\tvar height = this.height = computeDimension(context.canvas,'Height');\n\n\t\t// Firefox requires this to work correctly\n\t\tcontext.canvas.width = width;\n\t\tcontext.canvas.height = height;\n\n\t\tvar width = this.width = context.canvas.width;\n\t\tvar height = this.height = context.canvas.height;\n\t\tthis.aspectRatio = this.width / this.height;\n\t\t//High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.\n\t\thelpers.retinaScale(this);\n\n\t\treturn this;\n\t};\n\t//Globally expose the defaults to allow for user updating/changing\n\tChart.defaults = {\n\t\tglobal: {\n\t\t\t// Boolean - Whether to animate the chart\n\t\t\tanimation: true,\n\n\t\t\t// Number - Number of animation steps\n\t\t\tanimationSteps: 60,\n\n\t\t\t// String - Animation easing effect\n\t\t\tanimationEasing: \"easeOutQuart\",\n\n\t\t\t// Boolean - If we should show the scale at all\n\t\t\tshowScale: true,\n\n\t\t\t// Boolean - If we want to override with a hard coded scale\n\t\t\tscaleOverride: false,\n\n\t\t\t// ** Required if scaleOverride is true **\n\t\t\t// Number - The number of steps in a hard coded scale\n\t\t\tscaleSteps: null,\n\t\t\t// Number - The value jump in the hard coded scale\n\t\t\tscaleStepWidth: null,\n\t\t\t// Number - The scale starting value\n\t\t\tscaleStartValue: null,\n\n\t\t\t// String - Colour of the scale line\n\t\t\tscaleLineColor: \"rgba(0,0,0,.1)\",\n\n\t\t\t// Number - Pixel width of the scale line\n\t\t\tscaleLineWidth: 1,\n\n\t\t\t// Boolean - Whether to show labels on the scale\n\t\t\tscaleShowLabels: true,\n\n\t\t\t// Interpolated JS string - can access value\n\t\t\tscaleLabel: \"<%=value%>\",\n\n\t\t\t// Boolean - Whether the scale should stick to integers, and not show any floats even if drawing space is there\n\t\t\tscaleIntegersOnly: true,\n\n\t\t\t// Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n\t\t\tscaleBeginAtZero: false,\n\n\t\t\t// String - Scale label font declaration for the scale label\n\t\t\tscaleFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n\n\t\t\t// Number - Scale label font size in pixels\n\t\t\tscaleFontSize: 12,\n\n\t\t\t// String - Scale label font weight style\n\t\t\tscaleFontStyle: \"normal\",\n\n\t\t\t// String - Scale label font colour\n\t\t\tscaleFontColor: \"#666\",\n\n\t\t\t// Boolean - whether or not the chart should be responsive and resize when the browser does.\n\t\t\tresponsive: false,\n\n\t\t\t// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container\n\t\t\tmaintainAspectRatio: true,\n\n\t\t\t// Boolean - Determines whether to draw tooltips on the canvas or not - attaches events to touchmove & mousemove\n\t\t\tshowTooltips: true,\n\n\t\t\t// Boolean - Determines whether to draw built-in tooltip or call custom tooltip function\n\t\t\tcustomTooltips: false,\n\n\t\t\t// Array - Array of string names to attach tooltip events\n\t\t\ttooltipEvents: [\"mousemove\", \"touchstart\", \"touchmove\", \"mouseout\"],\n\n\t\t\t// String - Tooltip background colour\n\t\t\ttooltipFillColor: \"rgba(0,0,0,0.8)\",\n\n\t\t\t// String - Tooltip label font declaration for the scale label\n\t\t\ttooltipFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n\n\t\t\t// Number - Tooltip label font size in pixels\n\t\t\ttooltipFontSize: 14,\n\n\t\t\t// String - Tooltip font weight style\n\t\t\ttooltipFontStyle: \"normal\",\n\n\t\t\t// String - Tooltip label font colour\n\t\t\ttooltipFontColor: \"#fff\",\n\n\t\t\t// String - Tooltip title font declaration for the scale label\n\t\t\ttooltipTitleFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n\n\t\t\t// Number - Tooltip title font size in pixels\n\t\t\ttooltipTitleFontSize: 14,\n\n\t\t\t// String - Tooltip title font weight style\n\t\t\ttooltipTitleFontStyle: \"bold\",\n\n\t\t\t// String - Tooltip title font colour\n\t\t\ttooltipTitleFontColor: \"#fff\",\n\n\t\t\t// Number - pixel width of padding around tooltip text\n\t\t\ttooltipYPadding: 6,\n\n\t\t\t// Number - pixel width of padding around tooltip text\n\t\t\ttooltipXPadding: 6,\n\n\t\t\t// Number - Size of the caret on the tooltip\n\t\t\ttooltipCaretSize: 8,\n\n\t\t\t// Number - Pixel radius of the tooltip border\n\t\t\ttooltipCornerRadius: 6,\n\n\t\t\t// Number - Pixel offset from point x to tooltip edge\n\t\t\ttooltipXOffset: 10,\n\n\t\t\t// String - Template string for single tooltips\n\t\t\ttooltipTemplate: \"<%if (label){%><%=label%>: <%}%><%= value %>\",\n\n\t\t\t// String - Template string for single tooltips\n\t\t\tmultiTooltipTemplate: \"<%= value %>\",\n\n\t\t\t// String - Colour behind the legend colour block\n\t\t\tmultiTooltipKeyBackground: '#fff',\n\n\t\t\t// Function - Will fire on animation progression.\n\t\t\tonAnimationProgress: function(){},\n\n\t\t\t// Function - Will fire on animation completion.\n\t\t\tonAnimationComplete: function(){}\n\n\t\t}\n\t};\n\n\t//Create a dictionary of chart types, to allow for extension of existing types\n\tChart.types = {};\n\n\t//Global Chart helpers object for utility methods and classes\n\tvar helpers = Chart.helpers = {};\n\n\t\t//-- Basic js utility methods\n\tvar each = helpers.each = function(loopable,callback,self){\n\t\t\tvar additionalArgs = Array.prototype.slice.call(arguments, 3);\n\t\t\t// Check to see if null or undefined firstly.\n\t\t\tif (loopable){\n\t\t\t\tif (loopable.length === +loopable.length){\n\t\t\t\t\tvar i;\n\t\t\t\t\tfor (i=0; i= 0; i--) {\n\t\t\t\tvar currentItem = arrayToSearch[i];\n\t\t\t\tif (filterCallback(currentItem)){\n\t\t\t\t\treturn currentItem;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tinherits = helpers.inherits = function(extensions){\n\t\t\t//Basic javascript inheritance based on the model created in Backbone.js\n\t\t\tvar parent = this;\n\t\t\tvar ChartElement = (extensions && extensions.hasOwnProperty(\"constructor\")) ? extensions.constructor : function(){ return parent.apply(this, arguments); };\n\n\t\t\tvar Surrogate = function(){ this.constructor = ChartElement;};\n\t\t\tSurrogate.prototype = parent.prototype;\n\t\t\tChartElement.prototype = new Surrogate();\n\n\t\t\tChartElement.extend = inherits;\n\n\t\t\tif (extensions) extend(ChartElement.prototype, extensions);\n\n\t\t\tChartElement.__super__ = parent.prototype;\n\n\t\t\treturn ChartElement;\n\t\t},\n\t\tnoop = helpers.noop = function(){},\n\t\tuid = helpers.uid = (function(){\n\t\t\tvar id=0;\n\t\t\treturn function(){\n\t\t\t\treturn \"chart-\" + id++;\n\t\t\t};\n\t\t})(),\n\t\twarn = helpers.warn = function(str){\n\t\t\t//Method for warning of errors\n\t\t\tif (window.console && typeof window.console.warn == \"function\") console.warn(str);\n\t\t},\n\t\tamd = helpers.amd = (typeof define == 'function' && define.amd),\n\t\t//-- Math methods\n\t\tisNumber = helpers.isNumber = function(n){\n\t\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\n\t\t},\n\t\tmax = helpers.max = function(array){\n\t\t\treturn Math.max.apply( Math, array );\n\t\t},\n\t\tmin = helpers.min = function(array){\n\t\t\treturn Math.min.apply( Math, array );\n\t\t},\n\t\tcap = helpers.cap = function(valueToCap,maxValue,minValue){\n\t\t\tif(isNumber(maxValue)) {\n\t\t\t\tif( valueToCap > maxValue ) {\n\t\t\t\t\treturn maxValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(isNumber(minValue)){\n\t\t\t\tif ( valueToCap < minValue ){\n\t\t\t\t\treturn minValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn valueToCap;\n\t\t},\n\t\tgetDecimalPlaces = helpers.getDecimalPlaces = function(num){\n\t\t\tif (num%1!==0 && isNumber(num)){\n\t\t\t\treturn num.toString().split(\".\")[1].length;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t},\n\t\ttoRadians = helpers.radians = function(degrees){\n\t\t\treturn degrees * (Math.PI/180);\n\t\t},\n\t\t// Gets the angle from vertical upright to the point about a centre.\n\t\tgetAngleFromPoint = helpers.getAngleFromPoint = function(centrePoint, anglePoint){\n\t\t\tvar distanceFromXCenter = anglePoint.x - centrePoint.x,\n\t\t\t\tdistanceFromYCenter = anglePoint.y - centrePoint.y,\n\t\t\t\tradialDistanceFromCenter = Math.sqrt( distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n\n\t\t\tvar angle = Math.PI * 2 + Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n\t\t\t//If the segment is in the top left quadrant, we need to add another rotation to the angle\n\t\t\tif (distanceFromXCenter < 0 && distanceFromYCenter < 0){\n\t\t\t\tangle += Math.PI*2;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tangle: angle,\n\t\t\t\tdistance: radialDistanceFromCenter\n\t\t\t};\n\t\t},\n\t\taliasPixel = helpers.aliasPixel = function(pixelWidth){\n\t\t\treturn (pixelWidth % 2 === 0) ? 0 : 0.5;\n\t\t},\n\t\tsplineCurve = helpers.splineCurve = function(FirstPoint,MiddlePoint,AfterPoint,t){\n\t\t\t//Props to Rob Spencer at scaled innovation for his post on splining between points\n\t\t\t//http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\t\t\tvar d01=Math.sqrt(Math.pow(MiddlePoint.x-FirstPoint.x,2)+Math.pow(MiddlePoint.y-FirstPoint.y,2)),\n\t\t\t\td12=Math.sqrt(Math.pow(AfterPoint.x-MiddlePoint.x,2)+Math.pow(AfterPoint.y-MiddlePoint.y,2)),\n\t\t\t\tfa=t*d01/(d01+d12),// scaling factor for triangle Ta\n\t\t\t\tfb=t*d12/(d01+d12);\n\t\t\treturn {\n\t\t\t\tinner : {\n\t\t\t\t\tx : MiddlePoint.x-fa*(AfterPoint.x-FirstPoint.x),\n\t\t\t\t\ty : MiddlePoint.y-fa*(AfterPoint.y-FirstPoint.y)\n\t\t\t\t},\n\t\t\t\touter : {\n\t\t\t\t\tx: MiddlePoint.x+fb*(AfterPoint.x-FirstPoint.x),\n\t\t\t\t\ty : MiddlePoint.y+fb*(AfterPoint.y-FirstPoint.y)\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tcalculateOrderOfMagnitude = helpers.calculateOrderOfMagnitude = function(val){\n\t\t\treturn Math.floor(Math.log(val) / Math.LN10);\n\t\t},\n\t\tcalculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){\n\n\t\t\t//Set a minimum step of two - a point at the top of the graph, and a point at the base\n\t\t\tvar minSteps = 2,\n\t\t\t\tmaxSteps = Math.floor(drawingSize/(textSize * 1.5)),\n\t\t\t\tskipFitting = (minSteps >= maxSteps);\n\n\t\t\tvar maxValue = max(valuesArray),\n\t\t\t\tminValue = min(valuesArray);\n\n\t\t\t// We need some degree of seperation here to calculate the scales if all the values are the same\n\t\t\t// Adding/minusing 0.5 will give us a range of 1.\n\t\t\tif (maxValue === minValue){\n\t\t\t\tmaxValue += 0.5;\n\t\t\t\t// So we don't end up with a graph with a negative start value if we've said always start from zero\n\t\t\t\tif (minValue >= 0.5 && !startFromZero){\n\t\t\t\t\tminValue -= 0.5;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// Make up a whole number above the values\n\t\t\t\t\tmaxValue += 0.5;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar\tvalueRange = Math.abs(maxValue - minValue),\n\t\t\t\trangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange),\n\t\t\t\tgraphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),\n\t\t\t\tgraphMin = (startFromZero) ? 0 : Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),\n\t\t\t\tgraphRange = graphMax - graphMin,\n\t\t\t\tstepValue = Math.pow(10, rangeOrderOfMagnitude),\n\t\t\t\tnumberOfSteps = Math.round(graphRange / stepValue);\n\n\t\t\t//If we have more space on the graph we'll use it to give more definition to the data\n\t\t\twhile((numberOfSteps > maxSteps || (numberOfSteps * 2) < maxSteps) && !skipFitting) {\n\t\t\t\tif(numberOfSteps > maxSteps){\n\t\t\t\t\tstepValue *=2;\n\t\t\t\t\tnumberOfSteps = Math.round(graphRange/stepValue);\n\t\t\t\t\t// Don't ever deal with a decimal number of steps - cancel fitting and just use the minimum number of steps.\n\t\t\t\t\tif (numberOfSteps % 1 !== 0){\n\t\t\t\t\t\tskipFitting = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//We can fit in double the amount of scale points on the scale\n\t\t\t\telse{\n\t\t\t\t\t//If user has declared ints only, and the step value isn't a decimal\n\t\t\t\t\tif (integersOnly && rangeOrderOfMagnitude >= 0){\n\t\t\t\t\t\t//If the user has said integers only, we need to check that making the scale more granular wouldn't make it a float\n\t\t\t\t\t\tif(stepValue/2 % 1 === 0){\n\t\t\t\t\t\t\tstepValue /=2;\n\t\t\t\t\t\t\tnumberOfSteps = Math.round(graphRange/stepValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//If it would make it a float break out of the loop\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//If the scale doesn't have to be an int, make the scale more granular anyway.\n\t\t\t\t\telse{\n\t\t\t\t\t\tstepValue /=2;\n\t\t\t\t\t\tnumberOfSteps = Math.round(graphRange/stepValue);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (skipFitting){\n\t\t\t\tnumberOfSteps = minSteps;\n\t\t\t\tstepValue = graphRange / numberOfSteps;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsteps : numberOfSteps,\n\t\t\t\tstepValue : stepValue,\n\t\t\t\tmin : graphMin,\n\t\t\t\tmax\t: graphMin + (numberOfSteps * stepValue)\n\t\t\t};\n\n\t\t},\n\t\t/* jshint ignore:start */\n\t\t// Blows up jshint errors based on the new Function constructor\n\t\t//Templating methods\n\t\t//Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/\n\t\ttemplate = helpers.template = function(templateString, valuesObject){\n\n\t\t\t// If templateString is function rather than string-template - call the function for valuesObject\n\n\t\t\tif(templateString instanceof Function){\n\t\t\t \treturn templateString(valuesObject);\n\t\t \t}\n\n\t\t\tvar cache = {};\n\t\t\tfunction tmpl(str, data){\n\t\t\t\t// Figure out if we're getting a template, or if we need to\n\t\t\t\t// load the template - and be sure to cache the result.\n\t\t\t\tvar fn = !/\\W/.test(str) ?\n\t\t\t\tcache[str] = cache[str] :\n\n\t\t\t\t// Generate a reusable function that will serve as a template\n\t\t\t\t// generator (and which will be cached).\n\t\t\t\tnew Function(\"obj\",\n\t\t\t\t\t\"var p=[],print=function(){p.push.apply(p,arguments);};\" +\n\n\t\t\t\t\t// Introduce the data as local variables using with(){}\n\t\t\t\t\t\"with(obj){p.push('\" +\n\n\t\t\t\t\t// Convert the template into pure JavaScript\n\t\t\t\t\tstr\n\t\t\t\t\t\t.replace(/[\\r\\t\\n]/g, \" \")\n\t\t\t\t\t\t.split(\"<%\").join(\"\\t\")\n\t\t\t\t\t\t.replace(/((^|%>)[^\\t]*)'/g, \"$1\\r\")\n\t\t\t\t\t\t.replace(/\\t=(.*?)%>/g, \"',$1,'\")\n\t\t\t\t\t\t.split(\"\\t\").join(\"');\")\n\t\t\t\t\t\t.split(\"%>\").join(\"p.push('\")\n\t\t\t\t\t\t.split(\"\\r\").join(\"\\\\'\") +\n\t\t\t\t\t\"');}return p.join('');\"\n\t\t\t\t);\n\n\t\t\t\t// Provide some basic currying to the user\n\t\t\t\treturn data ? fn( data ) : fn;\n\t\t\t}\n\t\t\treturn tmpl(templateString,valuesObject);\n\t\t},\n\t\t/* jshint ignore:end */\n\t\tgenerateLabels = helpers.generateLabels = function(templateString,numberOfSteps,graphMin,stepValue){\n\t\t\tvar labelsArray = new Array(numberOfSteps);\n\t\t\tif (labelTemplateString){\n\t\t\t\teach(labelsArray,function(val,index){\n\t\t\t\t\tlabelsArray[index] = template(templateString,{value: (graphMin + (stepValue*(index+1)))});\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn labelsArray;\n\t\t},\n\t\t//--Animation methods\n\t\t//Easing functions adapted from Robert Penner's easing equations\n\t\t//http://www.robertpenner.com/easing/\n\t\teasingEffects = helpers.easingEffects = {\n\t\t\tlinear: function (t) {\n\t\t\t\treturn t;\n\t\t\t},\n\t\t\teaseInQuad: function (t) {\n\t\t\t\treturn t * t;\n\t\t\t},\n\t\t\teaseOutQuad: function (t) {\n\t\t\t\treturn -1 * t * (t - 2);\n\t\t\t},\n\t\t\teaseInOutQuad: function (t) {\n\t\t\t\tif ((t /= 1 / 2) < 1) return 1 / 2 * t * t;\n\t\t\t\treturn -1 / 2 * ((--t) * (t - 2) - 1);\n\t\t\t},\n\t\t\teaseInCubic: function (t) {\n\t\t\t\treturn t * t * t;\n\t\t\t},\n\t\t\teaseOutCubic: function (t) {\n\t\t\t\treturn 1 * ((t = t / 1 - 1) * t * t + 1);\n\t\t\t},\n\t\t\teaseInOutCubic: function (t) {\n\t\t\t\tif ((t /= 1 / 2) < 1) return 1 / 2 * t * t * t;\n\t\t\t\treturn 1 / 2 * ((t -= 2) * t * t + 2);\n\t\t\t},\n\t\t\teaseInQuart: function (t) {\n\t\t\t\treturn t * t * t * t;\n\t\t\t},\n\t\t\teaseOutQuart: function (t) {\n\t\t\t\treturn -1 * ((t = t / 1 - 1) * t * t * t - 1);\n\t\t\t},\n\t\t\teaseInOutQuart: function (t) {\n\t\t\t\tif ((t /= 1 / 2) < 1) return 1 / 2 * t * t * t * t;\n\t\t\t\treturn -1 / 2 * ((t -= 2) * t * t * t - 2);\n\t\t\t},\n\t\t\teaseInQuint: function (t) {\n\t\t\t\treturn 1 * (t /= 1) * t * t * t * t;\n\t\t\t},\n\t\t\teaseOutQuint: function (t) {\n\t\t\t\treturn 1 * ((t = t / 1 - 1) * t * t * t * t + 1);\n\t\t\t},\n\t\t\teaseInOutQuint: function (t) {\n\t\t\t\tif ((t /= 1 / 2) < 1) return 1 / 2 * t * t * t * t * t;\n\t\t\t\treturn 1 / 2 * ((t -= 2) * t * t * t * t + 2);\n\t\t\t},\n\t\t\teaseInSine: function (t) {\n\t\t\t\treturn -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;\n\t\t\t},\n\t\t\teaseOutSine: function (t) {\n\t\t\t\treturn 1 * Math.sin(t / 1 * (Math.PI / 2));\n\t\t\t},\n\t\t\teaseInOutSine: function (t) {\n\t\t\t\treturn -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);\n\t\t\t},\n\t\t\teaseInExpo: function (t) {\n\t\t\t\treturn (t === 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));\n\t\t\t},\n\t\t\teaseOutExpo: function (t) {\n\t\t\t\treturn (t === 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);\n\t\t\t},\n\t\t\teaseInOutExpo: function (t) {\n\t\t\t\tif (t === 0) return 0;\n\t\t\t\tif (t === 1) return 1;\n\t\t\t\tif ((t /= 1 / 2) < 1) return 1 / 2 * Math.pow(2, 10 * (t - 1));\n\t\t\t\treturn 1 / 2 * (-Math.pow(2, -10 * --t) + 2);\n\t\t\t},\n\t\t\teaseInCirc: function (t) {\n\t\t\t\tif (t >= 1) return t;\n\t\t\t\treturn -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);\n\t\t\t},\n\t\t\teaseOutCirc: function (t) {\n\t\t\t\treturn 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);\n\t\t\t},\n\t\t\teaseInOutCirc: function (t) {\n\t\t\t\tif ((t /= 1 / 2) < 1) return -1 / 2 * (Math.sqrt(1 - t * t) - 1);\n\t\t\t\treturn 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n\t\t\t},\n\t\t\teaseInElastic: function (t) {\n\t\t\t\tvar s = 1.70158;\n\t\t\t\tvar p = 0;\n\t\t\t\tvar a = 1;\n\t\t\t\tif (t === 0) return 0;\n\t\t\t\tif ((t /= 1) == 1) return 1;\n\t\t\t\tif (!p) p = 1 * 0.3;\n\t\t\t\tif (a < Math.abs(1)) {\n\t\t\t\t\ta = 1;\n\t\t\t\t\ts = p / 4;\n\t\t\t\t} else s = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));\n\t\t\t},\n\t\t\teaseOutElastic: function (t) {\n\t\t\t\tvar s = 1.70158;\n\t\t\t\tvar p = 0;\n\t\t\t\tvar a = 1;\n\t\t\t\tif (t === 0) return 0;\n\t\t\t\tif ((t /= 1) == 1) return 1;\n\t\t\t\tif (!p) p = 1 * 0.3;\n\t\t\t\tif (a < Math.abs(1)) {\n\t\t\t\t\ta = 1;\n\t\t\t\t\ts = p / 4;\n\t\t\t\t} else s = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;\n\t\t\t},\n\t\t\teaseInOutElastic: function (t) {\n\t\t\t\tvar s = 1.70158;\n\t\t\t\tvar p = 0;\n\t\t\t\tvar a = 1;\n\t\t\t\tif (t === 0) return 0;\n\t\t\t\tif ((t /= 1 / 2) == 2) return 1;\n\t\t\t\tif (!p) p = 1 * (0.3 * 1.5);\n\t\t\t\tif (a < Math.abs(1)) {\n\t\t\t\t\ta = 1;\n\t\t\t\t\ts = p / 4;\n\t\t\t\t} else s = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t\t\tif (t < 1) return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));\n\t\t\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;\n\t\t\t},\n\t\t\teaseInBack: function (t) {\n\t\t\t\tvar s = 1.70158;\n\t\t\t\treturn 1 * (t /= 1) * t * ((s + 1) * t - s);\n\t\t\t},\n\t\t\teaseOutBack: function (t) {\n\t\t\t\tvar s = 1.70158;\n\t\t\t\treturn 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);\n\t\t\t},\n\t\t\teaseInOutBack: function (t) {\n\t\t\t\tvar s = 1.70158;\n\t\t\t\tif ((t /= 1 / 2) < 1) return 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s));\n\t\t\t\treturn 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n\t\t\t},\n\t\t\teaseInBounce: function (t) {\n\t\t\t\treturn 1 - easingEffects.easeOutBounce(1 - t);\n\t\t\t},\n\t\t\teaseOutBounce: function (t) {\n\t\t\t\tif ((t /= 1) < (1 / 2.75)) {\n\t\t\t\t\treturn 1 * (7.5625 * t * t);\n\t\t\t\t} else if (t < (2 / 2.75)) {\n\t\t\t\t\treturn 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75);\n\t\t\t\t} else if (t < (2.5 / 2.75)) {\n\t\t\t\t\treturn 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375);\n\t\t\t\t} else {\n\t\t\t\t\treturn 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375);\n\t\t\t\t}\n\t\t\t},\n\t\t\teaseInOutBounce: function (t) {\n\t\t\t\tif (t < 1 / 2) return easingEffects.easeInBounce(t * 2) * 0.5;\n\t\t\t\treturn easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;\n\t\t\t}\n\t\t},\n\t\t//Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n\t\trequestAnimFrame = helpers.requestAnimFrame = (function(){\n\t\t\treturn window.requestAnimationFrame ||\n\t\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\t\twindow.oRequestAnimationFrame ||\n\t\t\t\twindow.msRequestAnimationFrame ||\n\t\t\t\tfunction(callback) {\n\t\t\t\t\treturn window.setTimeout(callback, 1000 / 60);\n\t\t\t\t};\n\t\t})(),\n\t\tcancelAnimFrame = helpers.cancelAnimFrame = (function(){\n\t\t\treturn window.cancelAnimationFrame ||\n\t\t\t\twindow.webkitCancelAnimationFrame ||\n\t\t\t\twindow.mozCancelAnimationFrame ||\n\t\t\t\twindow.oCancelAnimationFrame ||\n\t\t\t\twindow.msCancelAnimationFrame ||\n\t\t\t\tfunction(callback) {\n\t\t\t\t\treturn window.clearTimeout(callback, 1000 / 60);\n\t\t\t\t};\n\t\t})(),\n\t\tanimationLoop = helpers.animationLoop = function(callback,totalSteps,easingString,onProgress,onComplete,chartInstance){\n\n\t\t\tvar currentStep = 0,\n\t\t\t\teasingFunction = easingEffects[easingString] || easingEffects.linear;\n\n\t\t\tvar animationFrame = function(){\n\t\t\t\tcurrentStep++;\n\t\t\t\tvar stepDecimal = currentStep/totalSteps;\n\t\t\t\tvar easeDecimal = easingFunction(stepDecimal);\n\n\t\t\t\tcallback.call(chartInstance,easeDecimal,stepDecimal, currentStep);\n\t\t\t\tonProgress.call(chartInstance,easeDecimal,stepDecimal);\n\t\t\t\tif (currentStep < totalSteps){\n\t\t\t\t\tchartInstance.animationFrame = requestAnimFrame(animationFrame);\n\t\t\t\t} else{\n\t\t\t\t\tonComplete.apply(chartInstance);\n\t\t\t\t}\n\t\t\t};\n\t\t\trequestAnimFrame(animationFrame);\n\t\t},\n\t\t//-- DOM methods\n\t\tgetRelativePosition = helpers.getRelativePosition = function(evt){\n\t\t\tvar mouseX, mouseY;\n\t\t\tvar e = evt.originalEvent || evt,\n\t\t\t\tcanvas = evt.currentTarget || evt.srcElement,\n\t\t\t\tboundingRect = canvas.getBoundingClientRect();\n\n\t\t\tif (e.touches){\n\t\t\t\tmouseX = e.touches[0].clientX - boundingRect.left;\n\t\t\t\tmouseY = e.touches[0].clientY - boundingRect.top;\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmouseX = e.clientX - boundingRect.left;\n\t\t\t\tmouseY = e.clientY - boundingRect.top;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tx : mouseX,\n\t\t\t\ty : mouseY\n\t\t\t};\n\n\t\t},\n\t\taddEvent = helpers.addEvent = function(node,eventType,method){\n\t\t\tif (node.addEventListener){\n\t\t\t\tnode.addEventListener(eventType,method);\n\t\t\t} else if (node.attachEvent){\n\t\t\t\tnode.attachEvent(\"on\"+eventType, method);\n\t\t\t} else {\n\t\t\t\tnode[\"on\"+eventType] = method;\n\t\t\t}\n\t\t},\n\t\tremoveEvent = helpers.removeEvent = function(node, eventType, handler){\n\t\t\tif (node.removeEventListener){\n\t\t\t\tnode.removeEventListener(eventType, handler, false);\n\t\t\t} else if (node.detachEvent){\n\t\t\t\tnode.detachEvent(\"on\"+eventType,handler);\n\t\t\t} else{\n\t\t\t\tnode[\"on\" + eventType] = noop;\n\t\t\t}\n\t\t},\n\t\tbindEvents = helpers.bindEvents = function(chartInstance, arrayOfEvents, handler){\n\t\t\t// Create the events object if it's not already present\n\t\t\tif (!chartInstance.events) chartInstance.events = {};\n\n\t\t\teach(arrayOfEvents,function(eventName){\n\t\t\t\tchartInstance.events[eventName] = function(){\n\t\t\t\t\thandler.apply(chartInstance, arguments);\n\t\t\t\t};\n\t\t\t\taddEvent(chartInstance.chart.canvas,eventName,chartInstance.events[eventName]);\n\t\t\t});\n\t\t},\n\t\tunbindEvents = helpers.unbindEvents = function (chartInstance, arrayOfEvents) {\n\t\t\teach(arrayOfEvents, function(handler,eventName){\n\t\t\t\tremoveEvent(chartInstance.chart.canvas, eventName, handler);\n\t\t\t});\n\t\t},\n\t\tgetMaximumWidth = helpers.getMaximumWidth = function(domNode){\n\t\t\tvar container = domNode.parentNode;\n\t\t\t// TODO = check cross browser stuff with this.\n\t\t\treturn container.clientWidth;\n\t\t},\n\t\tgetMaximumHeight = helpers.getMaximumHeight = function(domNode){\n\t\t\tvar container = domNode.parentNode;\n\t\t\t// TODO = check cross browser stuff with this.\n\t\t\treturn container.clientHeight;\n\t\t},\n\t\tgetMaximumSize = helpers.getMaximumSize = helpers.getMaximumWidth, // legacy support\n\t\tretinaScale = helpers.retinaScale = function(chart){\n\t\t\tvar ctx = chart.ctx,\n\t\t\t\twidth = chart.canvas.width,\n\t\t\t\theight = chart.canvas.height;\n\n\t\t\tif (window.devicePixelRatio) {\n\t\t\t\tctx.canvas.style.width = width + \"px\";\n\t\t\t\tctx.canvas.style.height = height + \"px\";\n\t\t\t\tctx.canvas.height = height * window.devicePixelRatio;\n\t\t\t\tctx.canvas.width = width * window.devicePixelRatio;\n\t\t\t\tctx.scale(window.devicePixelRatio, window.devicePixelRatio);\n\t\t\t}\n\t\t},\n\t\t//-- Canvas methods\n\t\tclear = helpers.clear = function(chart){\n\t\t\tchart.ctx.clearRect(0,0,chart.width,chart.height);\n\t\t},\n\t\tfontString = helpers.fontString = function(pixelSize,fontStyle,fontFamily){\n\t\t\treturn fontStyle + \" \" + pixelSize+\"px \" + fontFamily;\n\t\t},\n\t\tlongestText = helpers.longestText = function(ctx,font,arrayOfStrings){\n\t\t\tctx.font = font;\n\t\t\tvar longest = 0;\n\t\t\teach(arrayOfStrings,function(string){\n\t\t\t\tvar textWidth = ctx.measureText(string).width;\n\t\t\t\tlongest = (textWidth > longest) ? textWidth : longest;\n\t\t\t});\n\t\t\treturn longest;\n\t\t},\n\t\tdrawRoundedRectangle = helpers.drawRoundedRectangle = function(ctx,x,y,width,height,radius){\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x + radius, y);\n\t\t\tctx.lineTo(x + width - radius, y);\n\t\t\tctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n\t\t\tctx.lineTo(x + width, y + height - radius);\n\t\t\tctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n\t\t\tctx.lineTo(x + radius, y + height);\n\t\t\tctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n\t\t\tctx.lineTo(x, y + radius);\n\t\t\tctx.quadraticCurveTo(x, y, x + radius, y);\n\t\t\tctx.closePath();\n\t\t};\n\n\n\t//Store a reference to each instance - allowing us to globally resize chart instances on window resize.\n\t//Destroy method on the chart will remove the instance of the chart from this reference.\n\tChart.instances = {};\n\n\tChart.Type = function(data,options,chart){\n\t\tthis.options = options;\n\t\tthis.chart = chart;\n\t\tthis.id = uid();\n\t\t//Add the chart instance to the global namespace\n\t\tChart.instances[this.id] = this;\n\n\t\t// Initialize is always called when a chart type is created\n\t\t// By default it is a no op, but it should be extended\n\t\tif (options.responsive){\n\t\t\tthis.resize();\n\t\t}\n\t\tthis.initialize.call(this,data);\n\t};\n\n\t//Core methods that'll be a part of every chart type\n\textend(Chart.Type.prototype,{\n\t\tinitialize : function(){return this;},\n\t\tclear : function(){\n\t\t\tclear(this.chart);\n\t\t\treturn this;\n\t\t},\n\t\tstop : function(){\n\t\t\t// Stops any current animation loop occuring\n\t\t\tcancelAnimFrame(this.animationFrame);\n\t\t\treturn this;\n\t\t},\n\t\tresize : function(callback){\n\t\t\tthis.stop();\n\t\t\tvar canvas = this.chart.canvas,\n\t\t\t\tnewWidth = getMaximumWidth(this.chart.canvas),\n\t\t\t\tnewHeight = this.options.maintainAspectRatio ? newWidth / this.chart.aspectRatio : getMaximumHeight(this.chart.canvas);\n\n\t\t\tcanvas.width = this.chart.width = newWidth;\n\t\t\tcanvas.height = this.chart.height = newHeight;\n\n\t\t\tretinaScale(this.chart);\n\n\t\t\tif (typeof callback === \"function\"){\n\t\t\t\tcallback.apply(this, Array.prototype.slice.call(arguments, 1));\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\treflow : noop,\n\t\trender : function(reflow){\n\t\t\tif (reflow){\n\t\t\t\tthis.reflow();\n\t\t\t}\n\t\t\tif (this.options.animation && !reflow){\n\t\t\t\thelpers.animationLoop(\n\t\t\t\t\tthis.draw,\n\t\t\t\t\tthis.options.animationSteps,\n\t\t\t\t\tthis.options.animationEasing,\n\t\t\t\t\tthis.options.onAnimationProgress,\n\t\t\t\t\tthis.options.onAnimationComplete,\n\t\t\t\t\tthis\n\t\t\t\t);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.draw();\n\t\t\t\tthis.options.onAnimationComplete.call(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tgenerateLegend : function(){\n\t\t\treturn template(this.options.legendTemplate,this);\n\t\t},\n\t\tdestroy : function(){\n\t\t\tthis.clear();\n\t\t\tunbindEvents(this, this.events);\n\t\t\tvar canvas = this.chart.canvas;\n\n\t\t\t// Reset canvas height/width attributes starts a fresh with the canvas context\n\t\t\tcanvas.width = this.chart.width;\n\t\t\tcanvas.height = this.chart.height;\n\n\t\t\t// < IE9 doesn't support removeProperty\n\t\t\tif (canvas.style.removeProperty) {\n\t\t\t\tcanvas.style.removeProperty('width');\n\t\t\t\tcanvas.style.removeProperty('height');\n\t\t\t} else {\n\t\t\t\tcanvas.style.removeAttribute('width');\n\t\t\t\tcanvas.style.removeAttribute('height');\n\t\t\t}\n\n\t\t\tdelete Chart.instances[this.id];\n\t\t},\n\t\tshowTooltip : function(ChartElements, forceRedraw){\n\t\t\t// Only redraw the chart if we've actually changed what we're hovering on.\n\t\t\tif (typeof this.activeElements === 'undefined') this.activeElements = [];\n\n\t\t\tvar isChanged = (function(Elements){\n\t\t\t\tvar changed = false;\n\n\t\t\t\tif (Elements.length !== this.activeElements.length){\n\t\t\t\t\tchanged = true;\n\t\t\t\t\treturn changed;\n\t\t\t\t}\n\n\t\t\t\teach(Elements, function(element, index){\n\t\t\t\t\tif (element !== this.activeElements[index]){\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\t\t\t\treturn changed;\n\t\t\t}).call(this, ChartElements);\n\n\t\t\tif (!isChanged && !forceRedraw){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.activeElements = ChartElements;\n\t\t\t}\n\t\t\tthis.draw();\n\t\t\tif(this.options.customTooltips){\n\t\t\t\tthis.options.customTooltips(false);\n\t\t\t}\n\t\t\tif (ChartElements.length > 0){\n\t\t\t\t// If we have multiple datasets, show a MultiTooltip for all of the data points at that index\n\t\t\t\tif (this.datasets && this.datasets.length > 1) {\n\t\t\t\t\tvar dataArray,\n\t\t\t\t\t\tdataIndex;\n\n\t\t\t\t\tfor (var i = this.datasets.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tdataArray = this.datasets[i].points || this.datasets[i].bars || this.datasets[i].segments;\n\t\t\t\t\t\tdataIndex = indexOf(dataArray, ChartElements[0]);\n\t\t\t\t\t\tif (dataIndex !== -1){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar tooltipLabels = [],\n\t\t\t\t\t\ttooltipColors = [],\n\t\t\t\t\t\tmedianPosition = (function(index) {\n\n\t\t\t\t\t\t\t// Get all the points at that particular index\n\t\t\t\t\t\t\tvar Elements = [],\n\t\t\t\t\t\t\t\tdataCollection,\n\t\t\t\t\t\t\t\txPositions = [],\n\t\t\t\t\t\t\t\tyPositions = [],\n\t\t\t\t\t\t\t\txMax,\n\t\t\t\t\t\t\t\tyMax,\n\t\t\t\t\t\t\t\txMin,\n\t\t\t\t\t\t\t\tyMin;\n\t\t\t\t\t\t\thelpers.each(this.datasets, function(dataset){\n\t\t\t\t\t\t\t\tdataCollection = dataset.points || dataset.bars || dataset.segments;\n\t\t\t\t\t\t\t\tif (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()){\n\t\t\t\t\t\t\t\t\tElements.push(dataCollection[dataIndex]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\thelpers.each(Elements, function(element) {\n\t\t\t\t\t\t\t\txPositions.push(element.x);\n\t\t\t\t\t\t\t\tyPositions.push(element.y);\n\n\n\t\t\t\t\t\t\t\t//Include any colour information about the element\n\t\t\t\t\t\t\t\ttooltipLabels.push(helpers.template(this.options.multiTooltipTemplate, element));\n\t\t\t\t\t\t\t\ttooltipColors.push({\n\t\t\t\t\t\t\t\t\tfill: element._saved.fillColor || element.fillColor,\n\t\t\t\t\t\t\t\t\tstroke: element._saved.strokeColor || element.strokeColor\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t}, this);\n\n\t\t\t\t\t\t\tyMin = min(yPositions);\n\t\t\t\t\t\t\tyMax = max(yPositions);\n\n\t\t\t\t\t\t\txMin = min(xPositions);\n\t\t\t\t\t\t\txMax = max(xPositions);\n\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tx: (xMin > this.chart.width/2) ? xMin : xMax,\n\t\t\t\t\t\t\t\ty: (yMin + yMax)/2\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}).call(this, dataIndex);\n\n\t\t\t\t\tnew Chart.MultiTooltip({\n\t\t\t\t\t\tx: medianPosition.x,\n\t\t\t\t\t\ty: medianPosition.y,\n\t\t\t\t\t\txPadding: this.options.tooltipXPadding,\n\t\t\t\t\t\tyPadding: this.options.tooltipYPadding,\n\t\t\t\t\t\txOffset: this.options.tooltipXOffset,\n\t\t\t\t\t\tfillColor: this.options.tooltipFillColor,\n\t\t\t\t\t\ttextColor: this.options.tooltipFontColor,\n\t\t\t\t\t\tfontFamily: this.options.tooltipFontFamily,\n\t\t\t\t\t\tfontStyle: this.options.tooltipFontStyle,\n\t\t\t\t\t\tfontSize: this.options.tooltipFontSize,\n\t\t\t\t\t\ttitleTextColor: this.options.tooltipTitleFontColor,\n\t\t\t\t\t\ttitleFontFamily: this.options.tooltipTitleFontFamily,\n\t\t\t\t\t\ttitleFontStyle: this.options.tooltipTitleFontStyle,\n\t\t\t\t\t\ttitleFontSize: this.options.tooltipTitleFontSize,\n\t\t\t\t\t\tcornerRadius: this.options.tooltipCornerRadius,\n\t\t\t\t\t\tlabels: tooltipLabels,\n\t\t\t\t\t\tlegendColors: tooltipColors,\n\t\t\t\t\t\tlegendColorBackground : this.options.multiTooltipKeyBackground,\n\t\t\t\t\t\ttitle: ChartElements[0].label,\n\t\t\t\t\t\tchart: this.chart,\n\t\t\t\t\t\tctx: this.chart.ctx,\n\t\t\t\t\t\tcustom: this.options.customTooltips\n\t\t\t\t\t}).draw();\n\n\t\t\t\t} else {\n\t\t\t\t\teach(ChartElements, function(Element) {\n\t\t\t\t\t\tvar tooltipPosition = Element.tooltipPosition();\n\t\t\t\t\t\tnew Chart.Tooltip({\n\t\t\t\t\t\t\tx: Math.round(tooltipPosition.x),\n\t\t\t\t\t\t\ty: Math.round(tooltipPosition.y),\n\t\t\t\t\t\t\txPadding: this.options.tooltipXPadding,\n\t\t\t\t\t\t\tyPadding: this.options.tooltipYPadding,\n\t\t\t\t\t\t\tfillColor: this.options.tooltipFillColor,\n\t\t\t\t\t\t\ttextColor: this.options.tooltipFontColor,\n\t\t\t\t\t\t\tfontFamily: this.options.tooltipFontFamily,\n\t\t\t\t\t\t\tfontStyle: this.options.tooltipFontStyle,\n\t\t\t\t\t\t\tfontSize: this.options.tooltipFontSize,\n\t\t\t\t\t\t\tcaretHeight: this.options.tooltipCaretSize,\n\t\t\t\t\t\t\tcornerRadius: this.options.tooltipCornerRadius,\n\t\t\t\t\t\t\ttext: template(this.options.tooltipTemplate, Element),\n\t\t\t\t\t\t\tchart: this.chart,\n\t\t\t\t\t\t\tcustom: this.options.customTooltips\n\t\t\t\t\t\t}).draw();\n\t\t\t\t\t}, this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\ttoBase64Image : function(){\n\t\t\treturn this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);\n\t\t}\n\t});\n\n\tChart.Type.extend = function(extensions){\n\n\t\tvar parent = this;\n\n\t\tvar ChartType = function(){\n\t\t\treturn parent.apply(this,arguments);\n\t\t};\n\n\t\t//Copy the prototype object of the this class\n\t\tChartType.prototype = clone(parent.prototype);\n\t\t//Now overwrite some of the properties in the base class with the new extensions\n\t\textend(ChartType.prototype, extensions);\n\n\t\tChartType.extend = Chart.Type.extend;\n\n\t\tif (extensions.name || parent.prototype.name){\n\n\t\t\tvar chartName = extensions.name || parent.prototype.name;\n\t\t\t//Assign any potential default values of the new chart type\n\n\t\t\t//If none are defined, we'll use a clone of the chart type this is being extended from.\n\t\t\t//I.e. if we extend a line chart, we'll use the defaults from the line chart if our new chart\n\t\t\t//doesn't define some defaults of their own.\n\n\t\t\tvar baseDefaults = (Chart.defaults[parent.prototype.name]) ? clone(Chart.defaults[parent.prototype.name]) : {};\n\n\t\t\tChart.defaults[chartName] = extend(baseDefaults,extensions.defaults);\n\n\t\t\tChart.types[chartName] = ChartType;\n\n\t\t\t//Register this new chart type in the Chart prototype\n\t\t\tChart.prototype[chartName] = function(data,options){\n\t\t\t\tvar config = merge(Chart.defaults.global, Chart.defaults[chartName], options || {});\n\t\t\t\treturn new ChartType(data,config,this);\n\t\t\t};\n\t\t} else{\n\t\t\twarn(\"Name not provided for this chart, so it hasn't been registered\");\n\t\t}\n\t\treturn parent;\n\t};\n\n\tChart.Element = function(configuration){\n\t\textend(this,configuration);\n\t\tthis.initialize.apply(this,arguments);\n\t\tthis.save();\n\t};\n\textend(Chart.Element.prototype,{\n\t\tinitialize : function(){},\n\t\trestore : function(props){\n\t\t\tif (!props){\n\t\t\t\textend(this,this._saved);\n\t\t\t} else {\n\t\t\t\teach(props,function(key){\n\t\t\t\t\tthis[key] = this._saved[key];\n\t\t\t\t},this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tsave : function(){\n\t\t\tthis._saved = clone(this);\n\t\t\tdelete this._saved._saved;\n\t\t\treturn this;\n\t\t},\n\t\tupdate : function(newProps){\n\t\t\teach(newProps,function(value,key){\n\t\t\t\tthis._saved[key] = this[key];\n\t\t\t\tthis[key] = value;\n\t\t\t},this);\n\t\t\treturn this;\n\t\t},\n\t\ttransition : function(props,ease){\n\t\t\teach(props,function(value,key){\n\t\t\t\tthis[key] = ((value - this._saved[key]) * ease) + this._saved[key];\n\t\t\t},this);\n\t\t\treturn this;\n\t\t},\n\t\ttooltipPosition : function(){\n\t\t\treturn {\n\t\t\t\tx : this.x,\n\t\t\t\ty : this.y\n\t\t\t};\n\t\t},\n\t\thasValue: function(){\n\t\t\treturn isNumber(this.value);\n\t\t}\n\t});\n\n\tChart.Element.extend = inherits;\n\n\n\tChart.Point = Chart.Element.extend({\n\t\tdisplay: true,\n\t\tinRange: function(chartX,chartY){\n\t\t\tvar hitDetectionRange = this.hitDetectionRadius + this.radius;\n\t\t\treturn ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));\n\t\t},\n\t\tdraw : function(){\n\t\t\tif (this.display){\n\t\t\t\tvar ctx = this.ctx;\n\t\t\t\tctx.beginPath();\n\n\t\t\t\tctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);\n\t\t\t\tctx.closePath();\n\n\t\t\t\tctx.strokeStyle = this.strokeColor;\n\t\t\t\tctx.lineWidth = this.strokeWidth;\n\n\t\t\t\tctx.fillStyle = this.fillColor;\n\n\t\t\t\tctx.fill();\n\t\t\t\tctx.stroke();\n\t\t\t}\n\n\n\t\t\t//Quick debug for bezier curve splining\n\t\t\t//Highlights control points and the line between them.\n\t\t\t//Handy for dev - stripped in the min version.\n\n\t\t\t// ctx.save();\n\t\t\t// ctx.fillStyle = \"black\";\n\t\t\t// ctx.strokeStyle = \"black\"\n\t\t\t// ctx.beginPath();\n\t\t\t// ctx.arc(this.controlPoints.inner.x,this.controlPoints.inner.y, 2, 0, Math.PI*2);\n\t\t\t// ctx.fill();\n\n\t\t\t// ctx.beginPath();\n\t\t\t// ctx.arc(this.controlPoints.outer.x,this.controlPoints.outer.y, 2, 0, Math.PI*2);\n\t\t\t// ctx.fill();\n\n\t\t\t// ctx.moveTo(this.controlPoints.inner.x,this.controlPoints.inner.y);\n\t\t\t// ctx.lineTo(this.x, this.y);\n\t\t\t// ctx.lineTo(this.controlPoints.outer.x,this.controlPoints.outer.y);\n\t\t\t// ctx.stroke();\n\n\t\t\t// ctx.restore();\n\n\n\n\t\t}\n\t});\n\n\tChart.Arc = Chart.Element.extend({\n\t\tinRange : function(chartX,chartY){\n\n\t\t\tvar pointRelativePosition = helpers.getAngleFromPoint(this, {\n\t\t\t\tx: chartX,\n\t\t\t\ty: chartY\n\t\t\t});\n\n\t\t\t//Check if within the range of the open/close angle\n\t\t\tvar betweenAngles = (pointRelativePosition.angle >= this.startAngle && pointRelativePosition.angle <= this.endAngle),\n\t\t\t\twithinRadius = (pointRelativePosition.distance >= this.innerRadius && pointRelativePosition.distance <= this.outerRadius);\n\n\t\t\treturn (betweenAngles && withinRadius);\n\t\t\t//Ensure within the outside of the arc centre, but inside arc outer\n\t\t},\n\t\ttooltipPosition : function(){\n\t\t\tvar centreAngle = this.startAngle + ((this.endAngle - this.startAngle) / 2),\n\t\t\t\trangeFromCentre = (this.outerRadius - this.innerRadius) / 2 + this.innerRadius;\n\t\t\treturn {\n\t\t\t\tx : this.x + (Math.cos(centreAngle) * rangeFromCentre),\n\t\t\t\ty : this.y + (Math.sin(centreAngle) * rangeFromCentre)\n\t\t\t};\n\t\t},\n\t\tdraw : function(animationPercent){\n\n\t\t\tvar easingDecimal = animationPercent || 1;\n\n\t\t\tvar ctx = this.ctx;\n\n\t\t\tctx.beginPath();\n\n\t\t\tctx.arc(this.x, this.y, this.outerRadius, this.startAngle, this.endAngle);\n\n\t\t\tctx.arc(this.x, this.y, this.innerRadius, this.endAngle, this.startAngle, true);\n\n\t\t\tctx.closePath();\n\t\t\tctx.strokeStyle = this.strokeColor;\n\t\t\tctx.lineWidth = this.strokeWidth;\n\n\t\t\tctx.fillStyle = this.fillColor;\n\n\t\t\tctx.fill();\n\t\t\tctx.lineJoin = 'bevel';\n\n\t\t\tif (this.showStroke){\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t}\n\t});\n\n\tChart.Rectangle = Chart.Element.extend({\n\t\tdraw : function(){\n\t\t\tvar ctx = this.ctx,\n\t\t\t\thalfWidth = this.width/2,\n\t\t\t\tleftX = this.x - halfWidth,\n\t\t\t\trightX = this.x + halfWidth,\n\t\t\t\ttop = this.base - (this.base - this.y),\n\t\t\t\thalfStroke = this.strokeWidth / 2;\n\n\t\t\t// Canvas doesn't allow us to stroke inside the width so we can\n\t\t\t// adjust the sizes to fit if we're setting a stroke on the line\n\t\t\tif (this.showStroke){\n\t\t\t\tleftX += halfStroke;\n\t\t\t\trightX -= halfStroke;\n\t\t\t\ttop += halfStroke;\n\t\t\t}\n\n\t\t\tctx.beginPath();\n\n\t\t\tctx.fillStyle = this.fillColor;\n\t\t\tctx.strokeStyle = this.strokeColor;\n\t\t\tctx.lineWidth = this.strokeWidth;\n\n\t\t\t// It'd be nice to keep this class totally generic to any rectangle\n\t\t\t// and simply specify which border to miss out.\n\t\t\tctx.moveTo(leftX, this.base);\n\t\t\tctx.lineTo(leftX, top);\n\t\t\tctx.lineTo(rightX, top);\n\t\t\tctx.lineTo(rightX, this.base);\n\t\t\tctx.fill();\n\t\t\tif (this.showStroke){\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t},\n\t\theight : function(){\n\t\t\treturn this.base - this.y;\n\t\t},\n\t\tinRange : function(chartX,chartY){\n\t\t\treturn (chartX >= this.x - this.width/2 && chartX <= this.x + this.width/2) && (chartY >= this.y && chartY <= this.base);\n\t\t}\n\t});\n\n\tChart.Tooltip = Chart.Element.extend({\n\t\tdraw : function(){\n\n\t\t\tvar ctx = this.chart.ctx;\n\n\t\t\tctx.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);\n\n\t\t\tthis.xAlign = \"center\";\n\t\t\tthis.yAlign = \"above\";\n\n\t\t\t//Distance between the actual element.y position and the start of the tooltip caret\n\t\t\tvar caretPadding = this.caretPadding = 2;\n\n\t\t\tvar tooltipWidth = ctx.measureText(this.text).width + 2*this.xPadding,\n\t\t\t\ttooltipRectHeight = this.fontSize + 2*this.yPadding,\n\t\t\t\ttooltipHeight = tooltipRectHeight + this.caretHeight + caretPadding;\n\n\t\t\tif (this.x + tooltipWidth/2 >this.chart.width){\n\t\t\t\tthis.xAlign = \"left\";\n\t\t\t} else if (this.x - tooltipWidth/2 < 0){\n\t\t\t\tthis.xAlign = \"right\";\n\t\t\t}\n\n\t\t\tif (this.y - tooltipHeight < 0){\n\t\t\t\tthis.yAlign = \"below\";\n\t\t\t}\n\n\n\t\t\tvar tooltipX = this.x - tooltipWidth/2,\n\t\t\t\ttooltipY = this.y - tooltipHeight;\n\n\t\t\tctx.fillStyle = this.fillColor;\n\n\t\t\t// Custom Tooltips\n\t\t\tif(this.custom){\n\t\t\t\tthis.custom(this);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tswitch(this.yAlign)\n\t\t\t\t{\n\t\t\t\tcase \"above\":\n\t\t\t\t\t//Draw a caret above the x/y\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(this.x,this.y - caretPadding);\n\t\t\t\t\tctx.lineTo(this.x + this.caretHeight, this.y - (caretPadding + this.caretHeight));\n\t\t\t\t\tctx.lineTo(this.x - this.caretHeight, this.y - (caretPadding + this.caretHeight));\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"below\":\n\t\t\t\t\ttooltipY = this.y + caretPadding + this.caretHeight;\n\t\t\t\t\t//Draw a caret below the x/y\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(this.x, this.y + caretPadding);\n\t\t\t\t\tctx.lineTo(this.x + this.caretHeight, this.y + caretPadding + this.caretHeight);\n\t\t\t\t\tctx.lineTo(this.x - this.caretHeight, this.y + caretPadding + this.caretHeight);\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tswitch(this.xAlign)\n\t\t\t\t{\n\t\t\t\tcase \"left\":\n\t\t\t\t\ttooltipX = this.x - tooltipWidth + (this.cornerRadius + this.caretHeight);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\t\ttooltipX = this.x - (this.cornerRadius + this.caretHeight);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdrawRoundedRectangle(ctx,tooltipX,tooltipY,tooltipWidth,tooltipRectHeight,this.cornerRadius);\n\n\t\t\t\tctx.fill();\n\n\t\t\t\tctx.fillStyle = this.textColor;\n\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\tctx.textBaseline = \"middle\";\n\t\t\t\tctx.fillText(this.text, tooltipX + tooltipWidth/2, tooltipY + tooltipRectHeight/2);\n\t\t\t}\n\t\t}\n\t});\n\n\tChart.MultiTooltip = Chart.Element.extend({\n\t\tinitialize : function(){\n\t\t\tthis.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);\n\n\t\t\tthis.titleFont = fontString(this.titleFontSize,this.titleFontStyle,this.titleFontFamily);\n\n\t\t\tthis.height = (this.labels.length * this.fontSize) + ((this.labels.length-1) * (this.fontSize/2)) + (this.yPadding*2) + this.titleFontSize *1.5;\n\n\t\t\tthis.ctx.font = this.titleFont;\n\n\t\t\tvar titleWidth = this.ctx.measureText(this.title).width,\n\t\t\t\t//Label has a legend square as well so account for this.\n\t\t\t\tlabelWidth = longestText(this.ctx,this.font,this.labels) + this.fontSize + 3,\n\t\t\t\tlongestTextWidth = max([labelWidth,titleWidth]);\n\n\t\t\tthis.width = longestTextWidth + (this.xPadding*2);\n\n\n\t\t\tvar halfHeight = this.height/2;\n\n\t\t\t//Check to ensure the height will fit on the canvas\n\t\t\tif (this.y - halfHeight < 0 ){\n\t\t\t\tthis.y = halfHeight;\n\t\t\t} else if (this.y + halfHeight > this.chart.height){\n\t\t\t\tthis.y = this.chart.height - halfHeight;\n\t\t\t}\n\n\t\t\t//Decide whether to align left or right based on position on canvas\n\t\t\tif (this.x > this.chart.width/2){\n\t\t\t\tthis.x -= this.xOffset + this.width;\n\t\t\t} else {\n\t\t\t\tthis.x += this.xOffset;\n\t\t\t}\n\n\n\t\t},\n\t\tgetLineHeight : function(index){\n\t\t\tvar baseLineHeight = this.y - (this.height/2) + this.yPadding,\n\t\t\t\tafterTitleIndex = index-1;\n\n\t\t\t//If the index is zero, we're getting the title\n\t\t\tif (index === 0){\n\t\t\t\treturn baseLineHeight + this.titleFontSize/2;\n\t\t\t} else{\n\t\t\t\treturn baseLineHeight + ((this.fontSize*1.5*afterTitleIndex) + this.fontSize/2) + this.titleFontSize * 1.5;\n\t\t\t}\n\n\t\t},\n\t\tdraw : function(){\n\t\t\t// Custom Tooltips\n\t\t\tif(this.custom){\n\t\t\t\tthis.custom(this);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdrawRoundedRectangle(this.ctx,this.x,this.y - this.height/2,this.width,this.height,this.cornerRadius);\n\t\t\t\tvar ctx = this.ctx;\n\t\t\t\tctx.fillStyle = this.fillColor;\n\t\t\t\tctx.fill();\n\t\t\t\tctx.closePath();\n\n\t\t\t\tctx.textAlign = \"left\";\n\t\t\t\tctx.textBaseline = \"middle\";\n\t\t\t\tctx.fillStyle = this.titleTextColor;\n\t\t\t\tctx.font = this.titleFont;\n\n\t\t\t\tctx.fillText(this.title,this.x + this.xPadding, this.getLineHeight(0));\n\n\t\t\t\tctx.font = this.font;\n\t\t\t\thelpers.each(this.labels,function(label,index){\n\t\t\t\t\tctx.fillStyle = this.textColor;\n\t\t\t\t\tctx.fillText(label,this.x + this.xPadding + this.fontSize + 3, this.getLineHeight(index + 1));\n\n\t\t\t\t\t//A bit gnarly, but clearing this rectangle breaks when using explorercanvas (clears whole canvas)\n\t\t\t\t\t//ctx.clearRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n\t\t\t\t\t//Instead we'll make a white filled block to put the legendColour palette over.\n\n\t\t\t\t\tctx.fillStyle = this.legendColorBackground;\n\t\t\t\t\tctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n\n\t\t\t\t\tctx.fillStyle = this.legendColors[index].fill;\n\t\t\t\t\tctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n\n\n\t\t\t\t},this);\n\t\t\t}\n\t\t}\n\t});\n\n\tChart.Scale = Chart.Element.extend({\n\t\tinitialize : function(){\n\t\t\tthis.fit();\n\t\t},\n\t\tbuildYLabels : function(){\n\t\t\tthis.yLabels = [];\n\n\t\t\tvar stepDecimalPlaces = getDecimalPlaces(this.stepValue);\n\n\t\t\tfor (var i=0; i<=this.steps; i++){\n\t\t\t\tthis.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));\n\t\t\t}\n\t\t\tthis.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) : 0;\n\t\t},\n\t\taddXLabel : function(label){\n\t\t\tthis.xLabels.push(label);\n\t\t\tthis.valuesCount++;\n\t\t\tthis.fit();\n\t\t},\n\t\tremoveXLabel : function(){\n\t\t\tthis.xLabels.shift();\n\t\t\tthis.valuesCount--;\n\t\t\tthis.fit();\n\t\t},\n\t\t// Fitting loop to rotate x Labels and figure out what fits there, and also calculate how many Y steps to use\n\t\tfit: function(){\n\t\t\t// First we need the width of the yLabels, assuming the xLabels aren't rotated\n\n\t\t\t// To do that we need the base line at the top and base of the chart, assuming there is no x label rotation\n\t\t\tthis.startPoint = (this.display) ? this.fontSize : 0;\n\t\t\tthis.endPoint = (this.display) ? this.height - (this.fontSize * 1.5) - 5 : this.height; // -5 to pad labels\n\n\t\t\t// Apply padding settings to the start and end point.\n\t\t\tthis.startPoint += this.padding;\n\t\t\tthis.endPoint -= this.padding;\n\n\t\t\t// Cache the starting height, so can determine if we need to recalculate the scale yAxis\n\t\t\tvar cachedHeight = this.endPoint - this.startPoint,\n\t\t\t\tcachedYLabelWidth;\n\n\t\t\t// Build the current yLabels so we have an idea of what size they'll be to start\n\t\t\t/*\n\t\t\t *\tThis sets what is returned from calculateScaleRange as static properties of this class:\n\t\t\t *\n\t\t\t\tthis.steps;\n\t\t\t\tthis.stepValue;\n\t\t\t\tthis.min;\n\t\t\t\tthis.max;\n\t\t\t *\n\t\t\t */\n\t\t\tthis.calculateYRange(cachedHeight);\n\n\t\t\t// With these properties set we can now build the array of yLabels\n\t\t\t// and also the width of the largest yLabel\n\t\t\tthis.buildYLabels();\n\n\t\t\tthis.calculateXLabelRotation();\n\n\t\t\twhile((cachedHeight > this.endPoint - this.startPoint)){\n\t\t\t\tcachedHeight = this.endPoint - this.startPoint;\n\t\t\t\tcachedYLabelWidth = this.yLabelWidth;\n\n\t\t\t\tthis.calculateYRange(cachedHeight);\n\t\t\t\tthis.buildYLabels();\n\n\t\t\t\t// Only go through the xLabel loop again if the yLabel width has changed\n\t\t\t\tif (cachedYLabelWidth < this.yLabelWidth){\n\t\t\t\t\tthis.calculateXLabelRotation();\n\t\t\t\t}\n\t\t\t}\n\n\t\t},\n\t\tcalculateXLabelRotation : function(){\n\t\t\t//Get the width of each grid by calculating the difference\n\t\t\t//between x offsets between 0 and 1.\n\n\t\t\tthis.ctx.font = this.font;\n\n\t\t\tvar firstWidth = this.ctx.measureText(this.xLabels[0]).width,\n\t\t\t\tlastWidth = this.ctx.measureText(this.xLabels[this.xLabels.length - 1]).width,\n\t\t\t\tfirstRotated,\n\t\t\t\tlastRotated;\n\n\n\t\t\tthis.xScalePaddingRight = lastWidth/2 + 3;\n\t\t\tthis.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth + 10) ? firstWidth/2 : this.yLabelWidth + 10;\n\n\t\t\tthis.xLabelRotation = 0;\n\t\t\tif (this.display){\n\t\t\t\tvar originalLabelWidth = longestText(this.ctx,this.font,this.xLabels),\n\t\t\t\t\tcosRotation,\n\t\t\t\t\tfirstRotatedWidth;\n\t\t\t\tthis.xLabelWidth = originalLabelWidth;\n\t\t\t\t//Allow 3 pixels x2 padding either side for label readability\n\t\t\t\tvar xGridWidth = Math.floor(this.calculateX(1) - this.calculateX(0)) - 6;\n\n\t\t\t\t//Max label rotate should be 90 - also act as a loop counter\n\t\t\t\twhile ((this.xLabelWidth > xGridWidth && this.xLabelRotation === 0) || (this.xLabelWidth > xGridWidth && this.xLabelRotation <= 90 && this.xLabelRotation > 0)){\n\t\t\t\t\tcosRotation = Math.cos(toRadians(this.xLabelRotation));\n\n\t\t\t\t\tfirstRotated = cosRotation * firstWidth;\n\t\t\t\t\tlastRotated = cosRotation * lastWidth;\n\n\t\t\t\t\t// We're right aligning the text now.\n\t\t\t\t\tif (firstRotated + this.fontSize / 2 > this.yLabelWidth + 8){\n\t\t\t\t\t\tthis.xScalePaddingLeft = firstRotated + this.fontSize / 2;\n\t\t\t\t\t}\n\t\t\t\t\tthis.xScalePaddingRight = this.fontSize/2;\n\n\n\t\t\t\t\tthis.xLabelRotation++;\n\t\t\t\t\tthis.xLabelWidth = cosRotation * originalLabelWidth;\n\n\t\t\t\t}\n\t\t\t\tif (this.xLabelRotation > 0){\n\t\t\t\t\tthis.endPoint -= Math.sin(toRadians(this.xLabelRotation))*originalLabelWidth + 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.xLabelWidth = 0;\n\t\t\t\tthis.xScalePaddingRight = this.padding;\n\t\t\t\tthis.xScalePaddingLeft = this.padding;\n\t\t\t}\n\n\t\t},\n\t\t// Needs to be overidden in each Chart type\n\t\t// Otherwise we need to pass all the data into the scale class\n\t\tcalculateYRange: noop,\n\t\tdrawingArea: function(){\n\t\t\treturn this.startPoint - this.endPoint;\n\t\t},\n\t\tcalculateY : function(value){\n\t\t\tvar scalingFactor = this.drawingArea() / (this.min - this.max);\n\t\t\treturn this.endPoint - (scalingFactor * (value - this.min));\n\t\t},\n\t\tcalculateX : function(index){\n\t\t\tvar isRotated = (this.xLabelRotation > 0),\n\t\t\t\t// innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding,\n\t\t\t\tinnerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight),\n\t\t\t\tvalueWidth = innerWidth/Math.max((this.valuesCount - ((this.offsetGridLines) ? 0 : 1)), 1),\n\t\t\t\tvalueOffset = (valueWidth * index) + this.xScalePaddingLeft;\n\n\t\t\tif (this.offsetGridLines){\n\t\t\t\tvalueOffset += (valueWidth/2);\n\t\t\t}\n\n\t\t\treturn Math.round(valueOffset);\n\t\t},\n\t\tupdate : function(newProps){\n\t\t\thelpers.extend(this, newProps);\n\t\t\tthis.fit();\n\t\t},\n\t\tdraw : function(){\n\t\t\tvar ctx = this.ctx,\n\t\t\t\tyLabelGap = (this.endPoint - this.startPoint) / this.steps,\n\t\t\t\txStart = Math.round(this.xScalePaddingLeft);\n\t\t\tif (this.display){\n\t\t\t\tctx.fillStyle = this.textColor;\n\t\t\t\tctx.font = this.font;\n\t\t\t\teach(this.yLabels,function(labelString,index){\n\t\t\t\t\tvar yLabelCenter = this.endPoint - (yLabelGap * index),\n\t\t\t\t\t\tlinePositionY = Math.round(yLabelCenter),\n\t\t\t\t\t\tdrawHorizontalLine = this.showHorizontalLines;\n\n\t\t\t\t\tctx.textAlign = \"right\";\n\t\t\t\t\tctx.textBaseline = \"middle\";\n\t\t\t\t\tif (this.showLabels){\n\t\t\t\t\t\tctx.fillText(labelString,xStart - 10,yLabelCenter);\n\t\t\t\t\t}\n\n\t\t\t\t\t// This is X axis, so draw it\n\t\t\t\t\tif (index === 0 && !drawHorizontalLine){\n\t\t\t\t\t\tdrawHorizontalLine = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (drawHorizontalLine){\n\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index > 0){\n\t\t\t\t\t\t// This is a grid line in the centre, so drop that\n\t\t\t\t\t\tctx.lineWidth = this.gridLineWidth;\n\t\t\t\t\t\tctx.strokeStyle = this.gridLineColor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is the first line on the scale\n\t\t\t\t\t\tctx.lineWidth = this.lineWidth;\n\t\t\t\t\t\tctx.strokeStyle = this.lineColor;\n\t\t\t\t\t}\n\n\t\t\t\t\tlinePositionY += helpers.aliasPixel(ctx.lineWidth);\n\n\t\t\t\t\tif(drawHorizontalLine){\n\t\t\t\t\t\tctx.moveTo(xStart, linePositionY);\n\t\t\t\t\t\tctx.lineTo(this.width, linePositionY);\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\tctx.closePath();\n\t\t\t\t\t}\n\n\t\t\t\t\tctx.lineWidth = this.lineWidth;\n\t\t\t\t\tctx.strokeStyle = this.lineColor;\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(xStart - 5, linePositionY);\n\t\t\t\t\tctx.lineTo(xStart, linePositionY);\n\t\t\t\t\tctx.stroke();\n\t\t\t\t\tctx.closePath();\n\n\t\t\t\t},this);\n\n\t\t\t\teach(this.xLabels,function(label,index){\n\t\t\t\t\tvar xPos = this.calculateX(index) + aliasPixel(this.lineWidth),\n\t\t\t\t\t\t// Check to see if line/bar here and decide where to place the line\n\t\t\t\t\t\tlinePos = this.calculateX(index - (this.offsetGridLines ? 0.5 : 0)) + aliasPixel(this.lineWidth),\n\t\t\t\t\t\tisRotated = (this.xLabelRotation > 0),\n\t\t\t\t\t\tdrawVerticalLine = this.showVerticalLines;\n\n\t\t\t\t\t// This is Y axis, so draw it\n\t\t\t\t\tif (index === 0 && !drawVerticalLine){\n\t\t\t\t\t\tdrawVerticalLine = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (drawVerticalLine){\n\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index > 0){\n\t\t\t\t\t\t// This is a grid line in the centre, so drop that\n\t\t\t\t\t\tctx.lineWidth = this.gridLineWidth;\n\t\t\t\t\t\tctx.strokeStyle = this.gridLineColor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is the first line on the scale\n\t\t\t\t\t\tctx.lineWidth = this.lineWidth;\n\t\t\t\t\t\tctx.strokeStyle = this.lineColor;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (drawVerticalLine){\n\t\t\t\t\t\tctx.moveTo(linePos,this.endPoint);\n\t\t\t\t\t\tctx.lineTo(linePos,this.startPoint - 3);\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\tctx.closePath();\n\t\t\t\t\t}\n\n\n\t\t\t\t\tctx.lineWidth = this.lineWidth;\n\t\t\t\t\tctx.strokeStyle = this.lineColor;\n\n\n\t\t\t\t\t// Small lines at the bottom of the base grid line\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(linePos,this.endPoint);\n\t\t\t\t\tctx.lineTo(linePos,this.endPoint + 5);\n\t\t\t\t\tctx.stroke();\n\t\t\t\t\tctx.closePath();\n\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.translate(xPos,(isRotated) ? this.endPoint + 12 : this.endPoint + 8);\n\t\t\t\t\tctx.rotate(toRadians(this.xLabelRotation)*-1);\n\t\t\t\t\tctx.font = this.font;\n\t\t\t\t\tctx.textAlign = (isRotated) ? \"right\" : \"center\";\n\t\t\t\t\tctx.textBaseline = (isRotated) ? \"middle\" : \"top\";\n\t\t\t\t\tctx.fillText(label, 0, 0);\n\t\t\t\t\tctx.restore();\n\t\t\t\t},this);\n\n\t\t\t}\n\t\t}\n\n\t});\n\n\tChart.RadialScale = Chart.Element.extend({\n\t\tinitialize: function(){\n\t\t\tthis.size = min([this.height, this.width]);\n\t\t\tthis.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);\n\t\t},\n\t\tcalculateCenterOffset: function(value){\n\t\t\t// Take into account half font size + the yPadding of the top value\n\t\t\tvar scalingFactor = this.drawingArea / (this.max - this.min);\n\n\t\t\treturn (value - this.min) * scalingFactor;\n\t\t},\n\t\tupdate : function(){\n\t\t\tif (!this.lineArc){\n\t\t\t\tthis.setScaleSize();\n\t\t\t} else {\n\t\t\t\tthis.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);\n\t\t\t}\n\t\t\tthis.buildYLabels();\n\t\t},\n\t\tbuildYLabels: function(){\n\t\t\tthis.yLabels = [];\n\n\t\t\tvar stepDecimalPlaces = getDecimalPlaces(this.stepValue);\n\n\t\t\tfor (var i=0; i<=this.steps; i++){\n\t\t\t\tthis.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));\n\t\t\t}\n\t\t},\n\t\tgetCircumference : function(){\n\t\t\treturn ((Math.PI*2) / this.valuesCount);\n\t\t},\n\t\tsetScaleSize: function(){\n\t\t\t/*\n\t\t\t * Right, this is really confusing and there is a lot of maths going on here\n\t\t\t * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n\t\t\t *\n\t\t\t * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n\t\t\t *\n\t\t\t * Solution:\n\t\t\t *\n\t\t\t * We assume the radius of the polygon is half the size of the canvas at first\n\t\t\t * at each index we check if the text overlaps.\n\t\t\t *\n\t\t\t * Where it does, we store that angle and that index.\n\t\t\t *\n\t\t\t * After finding the largest index and angle we calculate how much we need to remove\n\t\t\t * from the shape radius to move the point inwards by that x.\n\t\t\t *\n\t\t\t * We average the left and right distances to get the maximum shape radius that can fit in the box\n\t\t\t * along with labels.\n\t\t\t *\n\t\t\t * Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n\t\t\t * on each side, removing that from the size, halving it and adding the left x protrusion width.\n\t\t\t *\n\t\t\t * This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n\t\t\t * and position it in the most space efficient manner\n\t\t\t *\n\t\t\t * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\t\t\t */\n\n\n\t\t\t// Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n\t\t\t// Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n\t\t\tvar largestPossibleRadius = min([(this.height/2 - this.pointLabelFontSize - 5), this.width/2]),\n\t\t\t\tpointPosition,\n\t\t\t\ti,\n\t\t\t\ttextWidth,\n\t\t\t\thalfTextWidth,\n\t\t\t\tfurthestRight = this.width,\n\t\t\t\tfurthestRightIndex,\n\t\t\t\tfurthestRightAngle,\n\t\t\t\tfurthestLeft = 0,\n\t\t\t\tfurthestLeftIndex,\n\t\t\t\tfurthestLeftAngle,\n\t\t\t\txProtrusionLeft,\n\t\t\t\txProtrusionRight,\n\t\t\t\tradiusReductionRight,\n\t\t\t\tradiusReductionLeft,\n\t\t\t\tmaxWidthRadius;\n\t\t\tthis.ctx.font = fontString(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);\n\t\t\tfor (i=0;i furthestRight) {\n\t\t\t\t\t\tfurthestRight = pointPosition.x + halfTextWidth;\n\t\t\t\t\t\tfurthestRightIndex = i;\n\t\t\t\t\t}\n\t\t\t\t\tif (pointPosition.x - halfTextWidth < furthestLeft) {\n\t\t\t\t\t\tfurthestLeft = pointPosition.x - halfTextWidth;\n\t\t\t\t\t\tfurthestLeftIndex = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (i < this.valuesCount/2) {\n\t\t\t\t\t// Less than half the values means we'll left align the text\n\t\t\t\t\tif (pointPosition.x + textWidth > furthestRight) {\n\t\t\t\t\t\tfurthestRight = pointPosition.x + textWidth;\n\t\t\t\t\t\tfurthestRightIndex = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (i > this.valuesCount/2){\n\t\t\t\t\t// More than half the values means we'll right align the text\n\t\t\t\t\tif (pointPosition.x - textWidth < furthestLeft) {\n\t\t\t\t\t\tfurthestLeft = pointPosition.x - textWidth;\n\t\t\t\t\t\tfurthestLeftIndex = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txProtrusionLeft = furthestLeft;\n\n\t\t\txProtrusionRight = Math.ceil(furthestRight - this.width);\n\n\t\t\tfurthestRightAngle = this.getIndexAngle(furthestRightIndex);\n\n\t\t\tfurthestLeftAngle = this.getIndexAngle(furthestLeftIndex);\n\n\t\t\tradiusReductionRight = xProtrusionRight / Math.sin(furthestRightAngle + Math.PI/2);\n\n\t\t\tradiusReductionLeft = xProtrusionLeft / Math.sin(furthestLeftAngle + Math.PI/2);\n\n\t\t\t// Ensure we actually need to reduce the size of the chart\n\t\t\tradiusReductionRight = (isNumber(radiusReductionRight)) ? radiusReductionRight : 0;\n\t\t\tradiusReductionLeft = (isNumber(radiusReductionLeft)) ? radiusReductionLeft : 0;\n\n\t\t\tthis.drawingArea = largestPossibleRadius - (radiusReductionLeft + radiusReductionRight)/2;\n\n\t\t\t//this.drawingArea = min([maxWidthRadius, (this.height - (2 * (this.pointLabelFontSize + 5)))/2])\n\t\t\tthis.setCenterPoint(radiusReductionLeft, radiusReductionRight);\n\n\t\t},\n\t\tsetCenterPoint: function(leftMovement, rightMovement){\n\n\t\t\tvar maxRight = this.width - rightMovement - this.drawingArea,\n\t\t\t\tmaxLeft = leftMovement + this.drawingArea;\n\n\t\t\tthis.xCenter = (maxLeft + maxRight)/2;\n\t\t\t// Always vertically in the centre as the text height doesn't change\n\t\t\tthis.yCenter = (this.height/2);\n\t\t},\n\n\t\tgetIndexAngle : function(index){\n\t\t\tvar angleMultiplier = (Math.PI * 2) / this.valuesCount;\n\t\t\t// Start from the top instead of right, so remove a quarter of the circle\n\n\t\t\treturn index * angleMultiplier - (Math.PI/2);\n\t\t},\n\t\tgetPointPosition : function(index, distanceFromCenter){\n\t\t\tvar thisAngle = this.getIndexAngle(index);\n\t\t\treturn {\n\t\t\t\tx : (Math.cos(thisAngle) * distanceFromCenter) + this.xCenter,\n\t\t\t\ty : (Math.sin(thisAngle) * distanceFromCenter) + this.yCenter\n\t\t\t};\n\t\t},\n\t\tdraw: function(){\n\t\t\tif (this.display){\n\t\t\t\tvar ctx = this.ctx;\n\t\t\t\teach(this.yLabels, function(label, index){\n\t\t\t\t\t// Don't draw a centre value\n\t\t\t\t\tif (index > 0){\n\t\t\t\t\t\tvar yCenterOffset = index * (this.drawingArea/this.steps),\n\t\t\t\t\t\t\tyHeight = this.yCenter - yCenterOffset,\n\t\t\t\t\t\t\tpointPosition;\n\n\t\t\t\t\t\t// Draw circular lines around the scale\n\t\t\t\t\t\tif (this.lineWidth > 0){\n\t\t\t\t\t\t\tctx.strokeStyle = this.lineColor;\n\t\t\t\t\t\t\tctx.lineWidth = this.lineWidth;\n\n\t\t\t\t\t\t\tif(this.lineArc){\n\t\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\t\tctx.arc(this.xCenter, this.yCenter, yCenterOffset, 0, Math.PI*2);\n\t\t\t\t\t\t\t\tctx.closePath();\n\t\t\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\t\tfor (var i=0;i= 0; i--) {\n\t\t\t\t\t\tif (this.angleLineWidth > 0){\n\t\t\t\t\t\t\tvar outerPosition = this.getPointPosition(i, this.calculateCenterOffset(this.max));\n\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\tctx.moveTo(this.xCenter, this.yCenter);\n\t\t\t\t\t\t\tctx.lineTo(outerPosition.x, outerPosition.y);\n\t\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\t\tctx.closePath();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Extra 3px out for some label spacing\n\t\t\t\t\t\tvar pointLabelPosition = this.getPointPosition(i, this.calculateCenterOffset(this.max) + 5);\n\t\t\t\t\t\tctx.font = fontString(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);\n\t\t\t\t\t\tctx.fillStyle = this.pointLabelFontColor;\n\n\t\t\t\t\t\tvar labelsCount = this.labels.length,\n\t\t\t\t\t\t\thalfLabelsCount = this.labels.length/2,\n\t\t\t\t\t\t\tquarterLabelsCount = halfLabelsCount/2,\n\t\t\t\t\t\t\tupperHalf = (i < quarterLabelsCount || i > labelsCount - quarterLabelsCount),\n\t\t\t\t\t\t\texactQuarter = (i === quarterLabelsCount || i === labelsCount - quarterLabelsCount);\n\t\t\t\t\t\tif (i === 0){\n\t\t\t\t\t\t\tctx.textAlign = 'center';\n\t\t\t\t\t\t} else if(i === halfLabelsCount){\n\t\t\t\t\t\t\tctx.textAlign = 'center';\n\t\t\t\t\t\t} else if (i < halfLabelsCount){\n\t\t\t\t\t\t\tctx.textAlign = 'left';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.textAlign = 'right';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set the correct text baseline based on outer positioning\n\t\t\t\t\t\tif (exactQuarter){\n\t\t\t\t\t\t\tctx.textBaseline = 'middle';\n\t\t\t\t\t\t} else if (upperHalf){\n\t\t\t\t\t\t\tctx.textBaseline = 'bottom';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.textBaseline = 'top';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tctx.fillText(this.labels[i], pointLabelPosition.x, pointLabelPosition.y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t// Attach global event to resize each chart instance when the browser resizes\n\thelpers.addEvent(window, \"resize\", (function(){\n\t\t// Basic debounce of resize function so it doesn't hurt performance when resizing browser.\n\t\tvar timeout;\n\t\treturn function(){\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = setTimeout(function(){\n\t\t\t\teach(Chart.instances,function(instance){\n\t\t\t\t\t// If the responsive flag is set in the chart instance config\n\t\t\t\t\t// Cascade the resize event down to the chart.\n\t\t\t\t\tif (instance.options.responsive){\n\t\t\t\t\t\tinstance.resize(instance.render, true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, 50);\n\t\t};\n\t})());\n\n\n\tif (amd) {\n\t\tdefine(function(){\n\t\t\treturn Chart;\n\t\t});\n\t} else if (typeof module === 'object' && module.exports) {\n\t\tmodule.exports = Chart;\n\t}\n\n\troot.Chart = Chart;\n\n\tChart.noConflict = function(){\n\t\troot.Chart = previous;\n\t\treturn Chart;\n\t};\n\n}).call(this);\n\n(function(){\n\t\"use strict\";\n\n\tvar root = this,\n\t\tChart = root.Chart,\n\t\thelpers = Chart.helpers;\n\n\n\tvar defaultConfig = {\n\t\t//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n\t\tscaleBeginAtZero : true,\n\n\t\t//Boolean - Whether grid lines are shown across the chart\n\t\tscaleShowGridLines : true,\n\n\t\t//String - Colour of the grid lines\n\t\tscaleGridLineColor : \"rgba(0,0,0,.05)\",\n\n\t\t//Number - Width of the grid lines\n\t\tscaleGridLineWidth : 1,\n\n\t\t//Boolean - Whether to show horizontal lines (except X axis)\n\t\tscaleShowHorizontalLines: true,\n\n\t\t//Boolean - Whether to show vertical lines (except Y axis)\n\t\tscaleShowVerticalLines: true,\n\n\t\t//Boolean - If there is a stroke on each bar\n\t\tbarShowStroke : true,\n\n\t\t//Number - Pixel width of the bar stroke\n\t\tbarStrokeWidth : 2,\n\n\t\t//Number - Spacing between each of the X value sets\n\t\tbarValueSpacing : 5,\n\n\t\t//Number - Spacing between data sets within X values\n\t\tbarDatasetSpacing : 1,\n\n\t\t//String - A legend template\n\t\tlegendTemplate : \"
    -legend\\\"><% for (var i=0; i
  • \\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
\"\n\n\t};\n\n\n\tChart.Type.extend({\n\t\tname: \"Bar\",\n\t\tdefaults : defaultConfig,\n\t\tinitialize: function(data){\n\n\t\t\t//Expose options as a scope variable here so we can access it in the ScaleClass\n\t\t\tvar options = this.options;\n\n\t\t\tthis.ScaleClass = Chart.Scale.extend({\n\t\t\t\toffsetGridLines : true,\n\t\t\t\tcalculateBarX : function(datasetCount, datasetIndex, barIndex){\n\t\t\t\t\t//Reusable method for calculating the xPosition of a given bar based on datasetIndex & width of the bar\n\t\t\t\t\tvar xWidth = this.calculateBaseWidth(),\n\t\t\t\t\t\txAbsolute = this.calculateX(barIndex) - (xWidth/2),\n\t\t\t\t\t\tbarWidth = this.calculateBarWidth(datasetCount);\n\n\t\t\t\t\treturn xAbsolute + (barWidth * datasetIndex) + (datasetIndex * options.barDatasetSpacing) + barWidth/2;\n\t\t\t\t},\n\t\t\t\tcalculateBaseWidth : function(){\n\t\t\t\t\treturn (this.calculateX(1) - this.calculateX(0)) - (2*options.barValueSpacing);\n\t\t\t\t},\n\t\t\t\tcalculateBarWidth : function(datasetCount){\n\t\t\t\t\t//The padding between datasets is to the right of each bar, providing that there are more than 1 dataset\n\t\t\t\t\tvar baseWidth = this.calculateBaseWidth() - ((datasetCount - 1) * options.barDatasetSpacing);\n\n\t\t\t\t\treturn (baseWidth / datasetCount);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.datasets = [];\n\n\t\t\t//Set up tooltip events on the chart\n\t\t\tif (this.options.showTooltips){\n\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n\t\t\t\t\tvar activeBars = (evt.type !== 'mouseout') ? this.getBarsAtEvent(evt) : [];\n\n\t\t\t\t\tthis.eachBars(function(bar){\n\t\t\t\t\t\tbar.restore(['fillColor', 'strokeColor']);\n\t\t\t\t\t});\n\t\t\t\t\thelpers.each(activeBars, function(activeBar){\n\t\t\t\t\t\tactiveBar.fillColor = activeBar.highlightFill;\n\t\t\t\t\t\tactiveBar.strokeColor = activeBar.highlightStroke;\n\t\t\t\t\t});\n\t\t\t\t\tthis.showTooltip(activeBars);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//Declare the extension of the default point, to cater for the options passed in to the constructor\n\t\t\tthis.BarClass = Chart.Rectangle.extend({\n\t\t\t\tstrokeWidth : this.options.barStrokeWidth,\n\t\t\t\tshowStroke : this.options.barShowStroke,\n\t\t\t\tctx : this.chart.ctx\n\t\t\t});\n\n\t\t\t//Iterate through each of the datasets, and build this into a property of the chart\n\t\t\thelpers.each(data.datasets,function(dataset,datasetIndex){\n\n\t\t\t\tvar datasetObject = {\n\t\t\t\t\tlabel : dataset.label || null,\n\t\t\t\t\tfillColor : dataset.fillColor,\n\t\t\t\t\tstrokeColor : dataset.strokeColor,\n\t\t\t\t\tbars : []\n\t\t\t\t};\n\n\t\t\t\tthis.datasets.push(datasetObject);\n\n\t\t\t\thelpers.each(dataset.data,function(dataPoint,index){\n\t\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n\t\t\t\t\tdatasetObject.bars.push(new this.BarClass({\n\t\t\t\t\t\tvalue : dataPoint,\n\t\t\t\t\t\tlabel : data.labels[index],\n\t\t\t\t\t\tdatasetLabel: dataset.label,\n\t\t\t\t\t\tstrokeColor : dataset.strokeColor,\n\t\t\t\t\t\tfillColor : dataset.fillColor,\n\t\t\t\t\t\thighlightFill : dataset.highlightFill || dataset.fillColor,\n\t\t\t\t\t\thighlightStroke : dataset.highlightStroke || dataset.strokeColor\n\t\t\t\t\t}));\n\t\t\t\t},this);\n\n\t\t\t},this);\n\n\t\t\tthis.buildScale(data.labels);\n\n\t\t\tthis.BarClass.prototype.base = this.scale.endPoint;\n\n\t\t\tthis.eachBars(function(bar, index, datasetIndex){\n\t\t\t\thelpers.extend(bar, {\n\t\t\t\t\twidth : this.scale.calculateBarWidth(this.datasets.length),\n\t\t\t\t\tx: this.scale.calculateBarX(this.datasets.length, datasetIndex, index),\n\t\t\t\t\ty: this.scale.endPoint\n\t\t\t\t});\n\t\t\t\tbar.save();\n\t\t\t}, this);\n\n\t\t\tthis.render();\n\t\t},\n\t\tupdate : function(){\n\t\t\tthis.scale.update();\n\t\t\t// Reset any highlight colours before updating.\n\t\t\thelpers.each(this.activeElements, function(activeElement){\n\t\t\t\tactiveElement.restore(['fillColor', 'strokeColor']);\n\t\t\t});\n\n\t\t\tthis.eachBars(function(bar){\n\t\t\t\tbar.save();\n\t\t\t});\n\t\t\tthis.render();\n\t\t},\n\t\teachBars : function(callback){\n\t\t\thelpers.each(this.datasets,function(dataset, datasetIndex){\n\t\t\t\thelpers.each(dataset.bars, callback, this, datasetIndex);\n\t\t\t},this);\n\t\t},\n\t\tgetBarsAtEvent : function(e){\n\t\t\tvar barsArray = [],\n\t\t\t\teventPosition = helpers.getRelativePosition(e),\n\t\t\t\tdatasetIterator = function(dataset){\n\t\t\t\t\tbarsArray.push(dataset.bars[barIndex]);\n\t\t\t\t},\n\t\t\t\tbarIndex;\n\n\t\t\tfor (var datasetIndex = 0; datasetIndex < this.datasets.length; datasetIndex++) {\n\t\t\t\tfor (barIndex = 0; barIndex < this.datasets[datasetIndex].bars.length; barIndex++) {\n\t\t\t\t\tif (this.datasets[datasetIndex].bars[barIndex].inRange(eventPosition.x,eventPosition.y)){\n\t\t\t\t\t\thelpers.each(this.datasets, datasetIterator);\n\t\t\t\t\t\treturn barsArray;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn barsArray;\n\t\t},\n\t\tbuildScale : function(labels){\n\t\t\tvar self = this;\n\n\t\t\tvar dataTotal = function(){\n\t\t\t\tvar values = [];\n\t\t\t\tself.eachBars(function(bar){\n\t\t\t\t\tvalues.push(bar.value);\n\t\t\t\t});\n\t\t\t\treturn values;\n\t\t\t};\n\n\t\t\tvar scaleOptions = {\n\t\t\t\ttemplateString : this.options.scaleLabel,\n\t\t\t\theight : this.chart.height,\n\t\t\t\twidth : this.chart.width,\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\ttextColor : this.options.scaleFontColor,\n\t\t\t\tfontSize : this.options.scaleFontSize,\n\t\t\t\tfontStyle : this.options.scaleFontStyle,\n\t\t\t\tfontFamily : this.options.scaleFontFamily,\n\t\t\t\tvaluesCount : labels.length,\n\t\t\t\tbeginAtZero : this.options.scaleBeginAtZero,\n\t\t\t\tintegersOnly : this.options.scaleIntegersOnly,\n\t\t\t\tcalculateYRange: function(currentHeight){\n\t\t\t\t\tvar updatedRanges = helpers.calculateScaleRange(\n\t\t\t\t\t\tdataTotal(),\n\t\t\t\t\t\tcurrentHeight,\n\t\t\t\t\t\tthis.fontSize,\n\t\t\t\t\t\tthis.beginAtZero,\n\t\t\t\t\t\tthis.integersOnly\n\t\t\t\t\t);\n\t\t\t\t\thelpers.extend(this, updatedRanges);\n\t\t\t\t},\n\t\t\t\txLabels : labels,\n\t\t\t\tfont : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),\n\t\t\t\tlineWidth : this.options.scaleLineWidth,\n\t\t\t\tlineColor : this.options.scaleLineColor,\n\t\t\t\tshowHorizontalLines : this.options.scaleShowHorizontalLines,\n\t\t\t\tshowVerticalLines : this.options.scaleShowVerticalLines,\n\t\t\t\tgridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0,\n\t\t\t\tgridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : \"rgba(0,0,0,0)\",\n\t\t\t\tpadding : (this.options.showScale) ? 0 : (this.options.barShowStroke) ? this.options.barStrokeWidth : 0,\n\t\t\t\tshowLabels : this.options.scaleShowLabels,\n\t\t\t\tdisplay : this.options.showScale\n\t\t\t};\n\n\t\t\tif (this.options.scaleOverride){\n\t\t\t\thelpers.extend(scaleOptions, {\n\t\t\t\t\tcalculateYRange: helpers.noop,\n\t\t\t\t\tsteps: this.options.scaleSteps,\n\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n\t\t\t\t\tmin: this.options.scaleStartValue,\n\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.scale = new this.ScaleClass(scaleOptions);\n\t\t},\n\t\taddData : function(valuesArray,label){\n\t\t\t//Map the values array for each of the datasets\n\t\t\thelpers.each(valuesArray,function(value,datasetIndex){\n\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n\t\t\t\tthis.datasets[datasetIndex].bars.push(new this.BarClass({\n\t\t\t\t\tvalue : value,\n\t\t\t\t\tlabel : label,\n\t\t\t\t\tx: this.scale.calculateBarX(this.datasets.length, datasetIndex, this.scale.valuesCount+1),\n\t\t\t\t\ty: this.scale.endPoint,\n\t\t\t\t\twidth : this.scale.calculateBarWidth(this.datasets.length),\n\t\t\t\t\tbase : this.scale.endPoint,\n\t\t\t\t\tstrokeColor : this.datasets[datasetIndex].strokeColor,\n\t\t\t\t\tfillColor : this.datasets[datasetIndex].fillColor\n\t\t\t\t}));\n\t\t\t},this);\n\n\t\t\tthis.scale.addXLabel(label);\n\t\t\t//Then re-render the chart.\n\t\t\tthis.update();\n\t\t},\n\t\tremoveData : function(){\n\t\t\tthis.scale.removeXLabel();\n\t\t\t//Then re-render the chart.\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\tdataset.bars.shift();\n\t\t\t},this);\n\t\t\tthis.update();\n\t\t},\n\t\treflow : function(){\n\t\t\thelpers.extend(this.BarClass.prototype,{\n\t\t\t\ty: this.scale.endPoint,\n\t\t\t\tbase : this.scale.endPoint\n\t\t\t});\n\t\t\tvar newScaleProps = helpers.extend({\n\t\t\t\theight : this.chart.height,\n\t\t\t\twidth : this.chart.width\n\t\t\t});\n\t\t\tthis.scale.update(newScaleProps);\n\t\t},\n\t\tdraw : function(ease){\n\t\t\tvar easingDecimal = ease || 1;\n\t\t\tthis.clear();\n\n\t\t\tvar ctx = this.chart.ctx;\n\n\t\t\tthis.scale.draw(easingDecimal);\n\n\t\t\t//Draw all the bars for each dataset\n\t\t\thelpers.each(this.datasets,function(dataset,datasetIndex){\n\t\t\t\thelpers.each(dataset.bars,function(bar,index){\n\t\t\t\t\tif (bar.hasValue()){\n\t\t\t\t\t\tbar.base = this.scale.endPoint;\n\t\t\t\t\t\t//Transition then draw\n\t\t\t\t\t\tbar.transition({\n\t\t\t\t\t\t\tx : this.scale.calculateBarX(this.datasets.length, datasetIndex, index),\n\t\t\t\t\t\t\ty : this.scale.calculateY(bar.value),\n\t\t\t\t\t\t\twidth : this.scale.calculateBarWidth(this.datasets.length)\n\t\t\t\t\t\t}, easingDecimal).draw();\n\t\t\t\t\t}\n\t\t\t\t},this);\n\n\t\t\t},this);\n\t\t}\n\t});\n\n\n}).call(this);\n\n(function(){\n\t\"use strict\";\n\n\tvar root = this,\n\t\tChart = root.Chart,\n\t\t//Cache a local reference to Chart.helpers\n\t\thelpers = Chart.helpers;\n\n\tvar defaultConfig = {\n\t\t//Boolean - Whether we should show a stroke on each segment\n\t\tsegmentShowStroke : true,\n\n\t\t//String - The colour of each segment stroke\n\t\tsegmentStrokeColor : \"#fff\",\n\n\t\t//Number - The width of each segment stroke\n\t\tsegmentStrokeWidth : 2,\n\n\t\t//The percentage of the chart that we cut out of the middle.\n\t\tpercentageInnerCutout : 50,\n\n\t\t//Number - Amount of animation steps\n\t\tanimationSteps : 100,\n\n\t\t//String - Animation easing effect\n\t\tanimationEasing : \"easeOutBounce\",\n\n\t\t//Boolean - Whether we animate the rotation of the Doughnut\n\t\tanimateRotate : true,\n\n\t\t//Boolean - Whether we animate scaling the Doughnut from the centre\n\t\tanimateScale : false,\n\n\t\t//String - A legend template\n\t\tlegendTemplate : \"
    -legend\\\"><% for (var i=0; i
  • \\\"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
\"\n\n\t};\n\n\n\tChart.Type.extend({\n\t\t//Passing in a name registers this chart in the Chart namespace\n\t\tname: \"Doughnut\",\n\t\t//Providing a defaults will also register the deafults in the chart namespace\n\t\tdefaults : defaultConfig,\n\t\t//Initialize is fired when the chart is initialized - Data is passed in as a parameter\n\t\t//Config is automatically merged by the core of Chart.js, and is available at this.options\n\t\tinitialize: function(data){\n\n\t\t\t//Declare segments as a static property to prevent inheriting across the Chart type prototype\n\t\t\tthis.segments = [];\n\t\t\tthis.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -\tthis.options.segmentStrokeWidth/2)/2;\n\n\t\t\tthis.SegmentArc = Chart.Arc.extend({\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\tx : this.chart.width/2,\n\t\t\t\ty : this.chart.height/2\n\t\t\t});\n\n\t\t\t//Set up tooltip events on the chart\n\t\t\tif (this.options.showTooltips){\n\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n\t\t\t\t\tvar activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];\n\n\t\t\t\t\thelpers.each(this.segments,function(segment){\n\t\t\t\t\t\tsegment.restore([\"fillColor\"]);\n\t\t\t\t\t});\n\t\t\t\t\thelpers.each(activeSegments,function(activeSegment){\n\t\t\t\t\t\tactiveSegment.fillColor = activeSegment.highlightColor;\n\t\t\t\t\t});\n\t\t\t\t\tthis.showTooltip(activeSegments);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.calculateTotal(data);\n\n\t\t\thelpers.each(data,function(datapoint, index){\n\t\t\t\tthis.addData(datapoint, index, true);\n\t\t\t},this);\n\n\t\t\tthis.render();\n\t\t},\n\t\tgetSegmentsAtEvent : function(e){\n\t\t\tvar segmentsArray = [];\n\n\t\t\tvar location = helpers.getRelativePosition(e);\n\n\t\t\thelpers.each(this.segments,function(segment){\n\t\t\t\tif (segment.inRange(location.x,location.y)) segmentsArray.push(segment);\n\t\t\t},this);\n\t\t\treturn segmentsArray;\n\t\t},\n\t\taddData : function(segment, atIndex, silent){\n\t\t\tvar index = atIndex || this.segments.length;\n\t\t\tthis.segments.splice(index, 0, new this.SegmentArc({\n\t\t\t\tvalue : segment.value,\n\t\t\t\touterRadius : (this.options.animateScale) ? 0 : this.outerRadius,\n\t\t\t\tinnerRadius : (this.options.animateScale) ? 0 : (this.outerRadius/100) * this.options.percentageInnerCutout,\n\t\t\t\tfillColor : segment.color,\n\t\t\t\thighlightColor : segment.highlight || segment.color,\n\t\t\t\tshowStroke : this.options.segmentShowStroke,\n\t\t\t\tstrokeWidth : this.options.segmentStrokeWidth,\n\t\t\t\tstrokeColor : this.options.segmentStrokeColor,\n\t\t\t\tstartAngle : Math.PI * 1.5,\n\t\t\t\tcircumference : (this.options.animateRotate) ? 0 : this.calculateCircumference(segment.value),\n\t\t\t\tlabel : segment.label\n\t\t\t}));\n\t\t\tif (!silent){\n\t\t\t\tthis.reflow();\n\t\t\t\tthis.update();\n\t\t\t}\n\t\t},\n\t\tcalculateCircumference : function(value){\n\t\t\treturn (Math.PI*2)*(Math.abs(value) / this.total);\n\t\t},\n\t\tcalculateTotal : function(data){\n\t\t\tthis.total = 0;\n\t\t\thelpers.each(data,function(segment){\n\t\t\t\tthis.total += Math.abs(segment.value);\n\t\t\t},this);\n\t\t},\n\t\tupdate : function(){\n\t\t\tthis.calculateTotal(this.segments);\n\n\t\t\t// Reset any highlight colours before updating.\n\t\t\thelpers.each(this.activeElements, function(activeElement){\n\t\t\t\tactiveElement.restore(['fillColor']);\n\t\t\t});\n\n\t\t\thelpers.each(this.segments,function(segment){\n\t\t\t\tsegment.save();\n\t\t\t});\n\t\t\tthis.render();\n\t\t},\n\n\t\tremoveData: function(atIndex){\n\t\t\tvar indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;\n\t\t\tthis.segments.splice(indexToDelete, 1);\n\t\t\tthis.reflow();\n\t\t\tthis.update();\n\t\t},\n\n\t\treflow : function(){\n\t\t\thelpers.extend(this.SegmentArc.prototype,{\n\t\t\t\tx : this.chart.width/2,\n\t\t\t\ty : this.chart.height/2\n\t\t\t});\n\t\t\tthis.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -\tthis.options.segmentStrokeWidth/2)/2;\n\t\t\thelpers.each(this.segments, function(segment){\n\t\t\t\tsegment.update({\n\t\t\t\t\touterRadius : this.outerRadius,\n\t\t\t\t\tinnerRadius : (this.outerRadius/100) * this.options.percentageInnerCutout\n\t\t\t\t});\n\t\t\t}, this);\n\t\t},\n\t\tdraw : function(easeDecimal){\n\t\t\tvar animDecimal = (easeDecimal) ? easeDecimal : 1;\n\t\t\tthis.clear();\n\t\t\thelpers.each(this.segments,function(segment,index){\n\t\t\t\tsegment.transition({\n\t\t\t\t\tcircumference : this.calculateCircumference(segment.value),\n\t\t\t\t\touterRadius : this.outerRadius,\n\t\t\t\t\tinnerRadius : (this.outerRadius/100) * this.options.percentageInnerCutout\n\t\t\t\t},animDecimal);\n\n\t\t\t\tsegment.endAngle = segment.startAngle + segment.circumference;\n\n\t\t\t\tsegment.draw();\n\t\t\t\tif (index === 0){\n\t\t\t\t\tsegment.startAngle = Math.PI * 1.5;\n\t\t\t\t}\n\t\t\t\t//Check to see if it's the last segment, if not get the next and update the start angle\n\t\t\t\tif (index < this.segments.length-1){\n\t\t\t\t\tthis.segments[index+1].startAngle = segment.endAngle;\n\t\t\t\t}\n\t\t\t},this);\n\n\t\t}\n\t});\n\n\tChart.types.Doughnut.extend({\n\t\tname : \"Pie\",\n\t\tdefaults : helpers.merge(defaultConfig,{percentageInnerCutout : 0})\n\t});\n\n}).call(this);\n(function(){\n\t\"use strict\";\n\n\tvar root = this,\n\t\tChart = root.Chart,\n\t\thelpers = Chart.helpers;\n\n\tvar defaultConfig = {\n\n\t\t///Boolean - Whether grid lines are shown across the chart\n\t\tscaleShowGridLines : true,\n\n\t\t//String - Colour of the grid lines\n\t\tscaleGridLineColor : \"rgba(0,0,0,.05)\",\n\n\t\t//Number - Width of the grid lines\n\t\tscaleGridLineWidth : 1,\n\n\t\t//Boolean - Whether to show horizontal lines (except X axis)\n\t\tscaleShowHorizontalLines: true,\n\n\t\t//Boolean - Whether to show vertical lines (except Y axis)\n\t\tscaleShowVerticalLines: true,\n\n\t\t//Boolean - Whether the line is curved between points\n\t\tbezierCurve : true,\n\n\t\t//Number - Tension of the bezier curve between points\n\t\tbezierCurveTension : 0.4,\n\n\t\t//Boolean - Whether to show a dot for each point\n\t\tpointDot : true,\n\n\t\t//Number - Radius of each point dot in pixels\n\t\tpointDotRadius : 4,\n\n\t\t//Number - Pixel width of point dot stroke\n\t\tpointDotStrokeWidth : 1,\n\n\t\t//Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n\t\tpointHitDetectionRadius : 20,\n\n\t\t//Boolean - Whether to show a stroke for datasets\n\t\tdatasetStroke : true,\n\n\t\t//Number - Pixel width of dataset stroke\n\t\tdatasetStrokeWidth : 2,\n\n\t\t//Boolean - Whether to fill the dataset with a colour\n\t\tdatasetFill : true,\n\n\t\t//String - A legend template\n\t\tlegendTemplate : \"
    -legend\\\"><% for (var i=0; i
  • \\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
\"\n\n\t};\n\n\n\tChart.Type.extend({\n\t\tname: \"Line\",\n\t\tdefaults : defaultConfig,\n\t\tinitialize: function(data){\n\t\t\t//Declare the extension of the default point, to cater for the options passed in to the constructor\n\t\t\tthis.PointClass = Chart.Point.extend({\n\t\t\t\tstrokeWidth : this.options.pointDotStrokeWidth,\n\t\t\t\tradius : this.options.pointDotRadius,\n\t\t\t\tdisplay: this.options.pointDot,\n\t\t\t\thitDetectionRadius : this.options.pointHitDetectionRadius,\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\tinRange : function(mouseX){\n\t\t\t\t\treturn (Math.pow(mouseX-this.x, 2) < Math.pow(this.radius + this.hitDetectionRadius,2));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.datasets = [];\n\n\t\t\t//Set up tooltip events on the chart\n\t\t\tif (this.options.showTooltips){\n\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n\t\t\t\t\tvar activePoints = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];\n\t\t\t\t\tthis.eachPoints(function(point){\n\t\t\t\t\t\tpoint.restore(['fillColor', 'strokeColor']);\n\t\t\t\t\t});\n\t\t\t\t\thelpers.each(activePoints, function(activePoint){\n\t\t\t\t\t\tactivePoint.fillColor = activePoint.highlightFill;\n\t\t\t\t\t\tactivePoint.strokeColor = activePoint.highlightStroke;\n\t\t\t\t\t});\n\t\t\t\t\tthis.showTooltip(activePoints);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//Iterate through each of the datasets, and build this into a property of the chart\n\t\t\thelpers.each(data.datasets,function(dataset){\n\n\t\t\t\tvar datasetObject = {\n\t\t\t\t\tlabel : dataset.label || null,\n\t\t\t\t\tfillColor : dataset.fillColor,\n\t\t\t\t\tstrokeColor : dataset.strokeColor,\n\t\t\t\t\tpointColor : dataset.pointColor,\n\t\t\t\t\tpointStrokeColor : dataset.pointStrokeColor,\n\t\t\t\t\tpoints : []\n\t\t\t\t};\n\n\t\t\t\tthis.datasets.push(datasetObject);\n\n\n\t\t\t\thelpers.each(dataset.data,function(dataPoint,index){\n\t\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n\t\t\t\t\tdatasetObject.points.push(new this.PointClass({\n\t\t\t\t\t\tvalue : dataPoint,\n\t\t\t\t\t\tlabel : data.labels[index],\n\t\t\t\t\t\tdatasetLabel: dataset.label,\n\t\t\t\t\t\tstrokeColor : dataset.pointStrokeColor,\n\t\t\t\t\t\tfillColor : dataset.pointColor,\n\t\t\t\t\t\thighlightFill : dataset.pointHighlightFill || dataset.pointColor,\n\t\t\t\t\t\thighlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor\n\t\t\t\t\t}));\n\t\t\t\t},this);\n\n\t\t\t\tthis.buildScale(data.labels);\n\n\n\t\t\t\tthis.eachPoints(function(point, index){\n\t\t\t\t\thelpers.extend(point, {\n\t\t\t\t\t\tx: this.scale.calculateX(index),\n\t\t\t\t\t\ty: this.scale.endPoint\n\t\t\t\t\t});\n\t\t\t\t\tpoint.save();\n\t\t\t\t}, this);\n\n\t\t\t},this);\n\n\n\t\t\tthis.render();\n\t\t},\n\t\tupdate : function(){\n\t\t\tthis.scale.update();\n\t\t\t// Reset any highlight colours before updating.\n\t\t\thelpers.each(this.activeElements, function(activeElement){\n\t\t\t\tactiveElement.restore(['fillColor', 'strokeColor']);\n\t\t\t});\n\t\t\tthis.eachPoints(function(point){\n\t\t\t\tpoint.save();\n\t\t\t});\n\t\t\tthis.render();\n\t\t},\n\t\teachPoints : function(callback){\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\thelpers.each(dataset.points,callback,this);\n\t\t\t},this);\n\t\t},\n\t\tgetPointsAtEvent : function(e){\n\t\t\tvar pointsArray = [],\n\t\t\t\teventPosition = helpers.getRelativePosition(e);\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\thelpers.each(dataset.points,function(point){\n\t\t\t\t\tif (point.inRange(eventPosition.x,eventPosition.y)) pointsArray.push(point);\n\t\t\t\t});\n\t\t\t},this);\n\t\t\treturn pointsArray;\n\t\t},\n\t\tbuildScale : function(labels){\n\t\t\tvar self = this;\n\n\t\t\tvar dataTotal = function(){\n\t\t\t\tvar values = [];\n\t\t\t\tself.eachPoints(function(point){\n\t\t\t\t\tvalues.push(point.value);\n\t\t\t\t});\n\n\t\t\t\treturn values;\n\t\t\t};\n\n\t\t\tvar scaleOptions = {\n\t\t\t\ttemplateString : this.options.scaleLabel,\n\t\t\t\theight : this.chart.height,\n\t\t\t\twidth : this.chart.width,\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\ttextColor : this.options.scaleFontColor,\n\t\t\t\tfontSize : this.options.scaleFontSize,\n\t\t\t\tfontStyle : this.options.scaleFontStyle,\n\t\t\t\tfontFamily : this.options.scaleFontFamily,\n\t\t\t\tvaluesCount : labels.length,\n\t\t\t\tbeginAtZero : this.options.scaleBeginAtZero,\n\t\t\t\tintegersOnly : this.options.scaleIntegersOnly,\n\t\t\t\tcalculateYRange : function(currentHeight){\n\t\t\t\t\tvar updatedRanges = helpers.calculateScaleRange(\n\t\t\t\t\t\tdataTotal(),\n\t\t\t\t\t\tcurrentHeight,\n\t\t\t\t\t\tthis.fontSize,\n\t\t\t\t\t\tthis.beginAtZero,\n\t\t\t\t\t\tthis.integersOnly\n\t\t\t\t\t);\n\t\t\t\t\thelpers.extend(this, updatedRanges);\n\t\t\t\t},\n\t\t\t\txLabels : labels,\n\t\t\t\tfont : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),\n\t\t\t\tlineWidth : this.options.scaleLineWidth,\n\t\t\t\tlineColor : this.options.scaleLineColor,\n\t\t\t\tshowHorizontalLines : this.options.scaleShowHorizontalLines,\n\t\t\t\tshowVerticalLines : this.options.scaleShowVerticalLines,\n\t\t\t\tgridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0,\n\t\t\t\tgridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : \"rgba(0,0,0,0)\",\n\t\t\t\tpadding: (this.options.showScale) ? 0 : this.options.pointDotRadius + this.options.pointDotStrokeWidth,\n\t\t\t\tshowLabels : this.options.scaleShowLabels,\n\t\t\t\tdisplay : this.options.showScale\n\t\t\t};\n\n\t\t\tif (this.options.scaleOverride){\n\t\t\t\thelpers.extend(scaleOptions, {\n\t\t\t\t\tcalculateYRange: helpers.noop,\n\t\t\t\t\tsteps: this.options.scaleSteps,\n\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n\t\t\t\t\tmin: this.options.scaleStartValue,\n\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n\t\t\t\t});\n\t\t\t}\n\n\n\t\t\tthis.scale = new Chart.Scale(scaleOptions);\n\t\t},\n\t\taddData : function(valuesArray,label){\n\t\t\t//Map the values array for each of the datasets\n\n\t\t\thelpers.each(valuesArray,function(value,datasetIndex){\n\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n\t\t\t\tthis.datasets[datasetIndex].points.push(new this.PointClass({\n\t\t\t\t\tvalue : value,\n\t\t\t\t\tlabel : label,\n\t\t\t\t\tx: this.scale.calculateX(this.scale.valuesCount+1),\n\t\t\t\t\ty: this.scale.endPoint,\n\t\t\t\t\tstrokeColor : this.datasets[datasetIndex].pointStrokeColor,\n\t\t\t\t\tfillColor : this.datasets[datasetIndex].pointColor\n\t\t\t\t}));\n\t\t\t},this);\n\n\t\t\tthis.scale.addXLabel(label);\n\t\t\t//Then re-render the chart.\n\t\t\tthis.update();\n\t\t},\n\t\tremoveData : function(){\n\t\t\tthis.scale.removeXLabel();\n\t\t\t//Then re-render the chart.\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\tdataset.points.shift();\n\t\t\t},this);\n\t\t\tthis.update();\n\t\t},\n\t\treflow : function(){\n\t\t\tvar newScaleProps = helpers.extend({\n\t\t\t\theight : this.chart.height,\n\t\t\t\twidth : this.chart.width\n\t\t\t});\n\t\t\tthis.scale.update(newScaleProps);\n\t\t},\n\t\tdraw : function(ease){\n\t\t\tvar easingDecimal = ease || 1;\n\t\t\tthis.clear();\n\n\t\t\tvar ctx = this.chart.ctx;\n\n\t\t\t// Some helper methods for getting the next/prev points\n\t\t\tvar hasValue = function(item){\n\t\t\t\treturn item.value !== null;\n\t\t\t},\n\t\t\tnextPoint = function(point, collection, index){\n\t\t\t\treturn helpers.findNextWhere(collection, hasValue, index) || point;\n\t\t\t},\n\t\t\tpreviousPoint = function(point, collection, index){\n\t\t\t\treturn helpers.findPreviousWhere(collection, hasValue, index) || point;\n\t\t\t};\n\n\t\t\tthis.scale.draw(easingDecimal);\n\n\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\tvar pointsWithValues = helpers.where(dataset.points, hasValue);\n\n\t\t\t\t//Transition each point first so that the line and point drawing isn't out of sync\n\t\t\t\t//We can use this extra loop to calculate the control points of this dataset also in this loop\n\n\t\t\t\thelpers.each(dataset.points, function(point, index){\n\t\t\t\t\tif (point.hasValue()){\n\t\t\t\t\t\tpoint.transition({\n\t\t\t\t\t\t\ty : this.scale.calculateY(point.value),\n\t\t\t\t\t\t\tx : this.scale.calculateX(index)\n\t\t\t\t\t\t}, easingDecimal);\n\t\t\t\t\t}\n\t\t\t\t},this);\n\n\n\t\t\t\t// Control points need to be calculated in a seperate loop, because we need to know the current x/y of the point\n\t\t\t\t// This would cause issues when there is no animation, because the y of the next point would be 0, so beziers would be skewed\n\t\t\t\tif (this.options.bezierCurve){\n\t\t\t\t\thelpers.each(pointsWithValues, function(point, index){\n\t\t\t\t\t\tvar tension = (index > 0 && index < pointsWithValues.length - 1) ? this.options.bezierCurveTension : 0;\n\t\t\t\t\t\tpoint.controlPoints = helpers.splineCurve(\n\t\t\t\t\t\t\tpreviousPoint(point, pointsWithValues, index),\n\t\t\t\t\t\t\tpoint,\n\t\t\t\t\t\t\tnextPoint(point, pointsWithValues, index),\n\t\t\t\t\t\t\ttension\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Prevent the bezier going outside of the bounds of the graph\n\n\t\t\t\t\t\t// Cap puter bezier handles to the upper/lower scale bounds\n\t\t\t\t\t\tif (point.controlPoints.outer.y > this.scale.endPoint){\n\t\t\t\t\t\t\tpoint.controlPoints.outer.y = this.scale.endPoint;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (point.controlPoints.outer.y < this.scale.startPoint){\n\t\t\t\t\t\t\tpoint.controlPoints.outer.y = this.scale.startPoint;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Cap inner bezier handles to the upper/lower scale bounds\n\t\t\t\t\t\tif (point.controlPoints.inner.y > this.scale.endPoint){\n\t\t\t\t\t\t\tpoint.controlPoints.inner.y = this.scale.endPoint;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (point.controlPoints.inner.y < this.scale.startPoint){\n\t\t\t\t\t\t\tpoint.controlPoints.inner.y = this.scale.startPoint;\n\t\t\t\t\t\t}\n\t\t\t\t\t},this);\n\t\t\t\t}\n\n\n\t\t\t\t//Draw the line between all the points\n\t\t\t\tctx.lineWidth = this.options.datasetStrokeWidth;\n\t\t\t\tctx.strokeStyle = dataset.strokeColor;\n\t\t\t\tctx.beginPath();\n\n\t\t\t\thelpers.each(pointsWithValues, function(point, index){\n\t\t\t\t\tif (index === 0){\n\t\t\t\t\t\tctx.moveTo(point.x, point.y);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(this.options.bezierCurve){\n\t\t\t\t\t\t\tvar previous = previousPoint(point, pointsWithValues, index);\n\n\t\t\t\t\t\t\tctx.bezierCurveTo(\n\t\t\t\t\t\t\t\tprevious.controlPoints.outer.x,\n\t\t\t\t\t\t\t\tprevious.controlPoints.outer.y,\n\t\t\t\t\t\t\t\tpoint.controlPoints.inner.x,\n\t\t\t\t\t\t\t\tpoint.controlPoints.inner.y,\n\t\t\t\t\t\t\t\tpoint.x,\n\t\t\t\t\t\t\t\tpoint.y\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tctx.lineTo(point.x,point.y);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\n\t\t\t\tctx.stroke();\n\n\t\t\t\tif (this.options.datasetFill && pointsWithValues.length > 0){\n\t\t\t\t\t//Round off the line by going to the base of the chart, back to the start, then fill.\n\t\t\t\t\tctx.lineTo(pointsWithValues[pointsWithValues.length - 1].x, this.scale.endPoint);\n\t\t\t\t\tctx.lineTo(pointsWithValues[0].x, this.scale.endPoint);\n\t\t\t\t\tctx.fillStyle = dataset.fillColor;\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tctx.fill();\n\t\t\t\t}\n\n\t\t\t\t//Now draw the points over the line\n\t\t\t\t//A little inefficient double looping, but better than the line\n\t\t\t\t//lagging behind the point positions\n\t\t\t\thelpers.each(pointsWithValues,function(point){\n\t\t\t\t\tpoint.draw();\n\t\t\t\t});\n\t\t\t},this);\n\t\t}\n\t});\n\n\n}).call(this);\n\n(function(){\n\t\"use strict\";\n\n\tvar root = this,\n\t\tChart = root.Chart,\n\t\t//Cache a local reference to Chart.helpers\n\t\thelpers = Chart.helpers;\n\n\tvar defaultConfig = {\n\t\t//Boolean - Show a backdrop to the scale label\n\t\tscaleShowLabelBackdrop : true,\n\n\t\t//String - The colour of the label backdrop\n\t\tscaleBackdropColor : \"rgba(255,255,255,0.75)\",\n\n\t\t// Boolean - Whether the scale should begin at zero\n\t\tscaleBeginAtZero : true,\n\n\t\t//Number - The backdrop padding above & below the label in pixels\n\t\tscaleBackdropPaddingY : 2,\n\n\t\t//Number - The backdrop padding to the side of the label in pixels\n\t\tscaleBackdropPaddingX : 2,\n\n\t\t//Boolean - Show line for each value in the scale\n\t\tscaleShowLine : true,\n\n\t\t//Boolean - Stroke a line around each segment in the chart\n\t\tsegmentShowStroke : true,\n\n\t\t//String - The colour of the stroke on each segement.\n\t\tsegmentStrokeColor : \"#fff\",\n\n\t\t//Number - The width of the stroke value in pixels\n\t\tsegmentStrokeWidth : 2,\n\n\t\t//Number - Amount of animation steps\n\t\tanimationSteps : 100,\n\n\t\t//String - Animation easing effect.\n\t\tanimationEasing : \"easeOutBounce\",\n\n\t\t//Boolean - Whether to animate the rotation of the chart\n\t\tanimateRotate : true,\n\n\t\t//Boolean - Whether to animate scaling the chart from the centre\n\t\tanimateScale : false,\n\n\t\t//String - A legend template\n\t\tlegendTemplate : \"
    -legend\\\"><% for (var i=0; i
  • \\\"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
\"\n\t};\n\n\n\tChart.Type.extend({\n\t\t//Passing in a name registers this chart in the Chart namespace\n\t\tname: \"PolarArea\",\n\t\t//Providing a defaults will also register the deafults in the chart namespace\n\t\tdefaults : defaultConfig,\n\t\t//Initialize is fired when the chart is initialized - Data is passed in as a parameter\n\t\t//Config is automatically merged by the core of Chart.js, and is available at this.options\n\t\tinitialize: function(data){\n\t\t\tthis.segments = [];\n\t\t\t//Declare segment class as a chart instance specific class, so it can share props for this instance\n\t\t\tthis.SegmentArc = Chart.Arc.extend({\n\t\t\t\tshowStroke : this.options.segmentShowStroke,\n\t\t\t\tstrokeWidth : this.options.segmentStrokeWidth,\n\t\t\t\tstrokeColor : this.options.segmentStrokeColor,\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\tinnerRadius : 0,\n\t\t\t\tx : this.chart.width/2,\n\t\t\t\ty : this.chart.height/2\n\t\t\t});\n\t\t\tthis.scale = new Chart.RadialScale({\n\t\t\t\tdisplay: this.options.showScale,\n\t\t\t\tfontStyle: this.options.scaleFontStyle,\n\t\t\t\tfontSize: this.options.scaleFontSize,\n\t\t\t\tfontFamily: this.options.scaleFontFamily,\n\t\t\t\tfontColor: this.options.scaleFontColor,\n\t\t\t\tshowLabels: this.options.scaleShowLabels,\n\t\t\t\tshowLabelBackdrop: this.options.scaleShowLabelBackdrop,\n\t\t\t\tbackdropColor: this.options.scaleBackdropColor,\n\t\t\t\tbackdropPaddingY : this.options.scaleBackdropPaddingY,\n\t\t\t\tbackdropPaddingX: this.options.scaleBackdropPaddingX,\n\t\t\t\tlineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,\n\t\t\t\tlineColor: this.options.scaleLineColor,\n\t\t\t\tlineArc: true,\n\t\t\t\twidth: this.chart.width,\n\t\t\t\theight: this.chart.height,\n\t\t\t\txCenter: this.chart.width/2,\n\t\t\t\tyCenter: this.chart.height/2,\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\ttemplateString: this.options.scaleLabel,\n\t\t\t\tvaluesCount: data.length\n\t\t\t});\n\n\t\t\tthis.updateScaleRange(data);\n\n\t\t\tthis.scale.update();\n\n\t\t\thelpers.each(data,function(segment,index){\n\t\t\t\tthis.addData(segment,index,true);\n\t\t\t},this);\n\n\t\t\t//Set up tooltip events on the chart\n\t\t\tif (this.options.showTooltips){\n\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n\t\t\t\t\tvar activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];\n\t\t\t\t\thelpers.each(this.segments,function(segment){\n\t\t\t\t\t\tsegment.restore([\"fillColor\"]);\n\t\t\t\t\t});\n\t\t\t\t\thelpers.each(activeSegments,function(activeSegment){\n\t\t\t\t\t\tactiveSegment.fillColor = activeSegment.highlightColor;\n\t\t\t\t\t});\n\t\t\t\t\tthis.showTooltip(activeSegments);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.render();\n\t\t},\n\t\tgetSegmentsAtEvent : function(e){\n\t\t\tvar segmentsArray = [];\n\n\t\t\tvar location = helpers.getRelativePosition(e);\n\n\t\t\thelpers.each(this.segments,function(segment){\n\t\t\t\tif (segment.inRange(location.x,location.y)) segmentsArray.push(segment);\n\t\t\t},this);\n\t\t\treturn segmentsArray;\n\t\t},\n\t\taddData : function(segment, atIndex, silent){\n\t\t\tvar index = atIndex || this.segments.length;\n\n\t\t\tthis.segments.splice(index, 0, new this.SegmentArc({\n\t\t\t\tfillColor: segment.color,\n\t\t\t\thighlightColor: segment.highlight || segment.color,\n\t\t\t\tlabel: segment.label,\n\t\t\t\tvalue: segment.value,\n\t\t\t\touterRadius: (this.options.animateScale) ? 0 : this.scale.calculateCenterOffset(segment.value),\n\t\t\t\tcircumference: (this.options.animateRotate) ? 0 : this.scale.getCircumference(),\n\t\t\t\tstartAngle: Math.PI * 1.5\n\t\t\t}));\n\t\t\tif (!silent){\n\t\t\t\tthis.reflow();\n\t\t\t\tthis.update();\n\t\t\t}\n\t\t},\n\t\tremoveData: function(atIndex){\n\t\t\tvar indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;\n\t\t\tthis.segments.splice(indexToDelete, 1);\n\t\t\tthis.reflow();\n\t\t\tthis.update();\n\t\t},\n\t\tcalculateTotal: function(data){\n\t\t\tthis.total = 0;\n\t\t\thelpers.each(data,function(segment){\n\t\t\t\tthis.total += segment.value;\n\t\t\t},this);\n\t\t\tthis.scale.valuesCount = this.segments.length;\n\t\t},\n\t\tupdateScaleRange: function(datapoints){\n\t\t\tvar valuesArray = [];\n\t\t\thelpers.each(datapoints,function(segment){\n\t\t\t\tvaluesArray.push(segment.value);\n\t\t\t});\n\n\t\t\tvar scaleSizes = (this.options.scaleOverride) ?\n\t\t\t\t{\n\t\t\t\t\tsteps: this.options.scaleSteps,\n\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n\t\t\t\t\tmin: this.options.scaleStartValue,\n\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n\t\t\t\t} :\n\t\t\t\thelpers.calculateScaleRange(\n\t\t\t\t\tvaluesArray,\n\t\t\t\t\thelpers.min([this.chart.width, this.chart.height])/2,\n\t\t\t\t\tthis.options.scaleFontSize,\n\t\t\t\t\tthis.options.scaleBeginAtZero,\n\t\t\t\t\tthis.options.scaleIntegersOnly\n\t\t\t\t);\n\n\t\t\thelpers.extend(\n\t\t\t\tthis.scale,\n\t\t\t\tscaleSizes,\n\t\t\t\t{\n\t\t\t\t\tsize: helpers.min([this.chart.width, this.chart.height]),\n\t\t\t\t\txCenter: this.chart.width/2,\n\t\t\t\t\tyCenter: this.chart.height/2\n\t\t\t\t}\n\t\t\t);\n\n\t\t},\n\t\tupdate : function(){\n\t\t\tthis.calculateTotal(this.segments);\n\n\t\t\thelpers.each(this.segments,function(segment){\n\t\t\t\tsegment.save();\n\t\t\t});\n\t\t\t\n\t\t\tthis.reflow();\n\t\t\tthis.render();\n\t\t},\n\t\treflow : function(){\n\t\t\thelpers.extend(this.SegmentArc.prototype,{\n\t\t\t\tx : this.chart.width/2,\n\t\t\t\ty : this.chart.height/2\n\t\t\t});\n\t\t\tthis.updateScaleRange(this.segments);\n\t\t\tthis.scale.update();\n\n\t\t\thelpers.extend(this.scale,{\n\t\t\t\txCenter: this.chart.width/2,\n\t\t\t\tyCenter: this.chart.height/2\n\t\t\t});\n\n\t\t\thelpers.each(this.segments, function(segment){\n\t\t\t\tsegment.update({\n\t\t\t\t\touterRadius : this.scale.calculateCenterOffset(segment.value)\n\t\t\t\t});\n\t\t\t}, this);\n\n\t\t},\n\t\tdraw : function(ease){\n\t\t\tvar easingDecimal = ease || 1;\n\t\t\t//Clear & draw the canvas\n\t\t\tthis.clear();\n\t\t\thelpers.each(this.segments,function(segment, index){\n\t\t\t\tsegment.transition({\n\t\t\t\t\tcircumference : this.scale.getCircumference(),\n\t\t\t\t\touterRadius : this.scale.calculateCenterOffset(segment.value)\n\t\t\t\t},easingDecimal);\n\n\t\t\t\tsegment.endAngle = segment.startAngle + segment.circumference;\n\n\t\t\t\t// If we've removed the first segment we need to set the first one to\n\t\t\t\t// start at the top.\n\t\t\t\tif (index === 0){\n\t\t\t\t\tsegment.startAngle = Math.PI * 1.5;\n\t\t\t\t}\n\n\t\t\t\t//Check to see if it's the last segment, if not get the next and update the start angle\n\t\t\t\tif (index < this.segments.length - 1){\n\t\t\t\t\tthis.segments[index+1].startAngle = segment.endAngle;\n\t\t\t\t}\n\t\t\t\tsegment.draw();\n\t\t\t}, this);\n\t\t\tthis.scale.draw();\n\t\t}\n\t});\n\n}).call(this);\n(function(){\n\t\"use strict\";\n\n\tvar root = this,\n\t\tChart = root.Chart,\n\t\thelpers = Chart.helpers;\n\n\n\n\tChart.Type.extend({\n\t\tname: \"Radar\",\n\t\tdefaults:{\n\t\t\t//Boolean - Whether to show lines for each scale point\n\t\t\tscaleShowLine : true,\n\n\t\t\t//Boolean - Whether we show the angle lines out of the radar\n\t\t\tangleShowLineOut : true,\n\n\t\t\t//Boolean - Whether to show labels on the scale\n\t\t\tscaleShowLabels : false,\n\n\t\t\t// Boolean - Whether the scale should begin at zero\n\t\t\tscaleBeginAtZero : true,\n\n\t\t\t//String - Colour of the angle line\n\t\t\tangleLineColor : \"rgba(0,0,0,.1)\",\n\n\t\t\t//Number - Pixel width of the angle line\n\t\t\tangleLineWidth : 1,\n\n\t\t\t//String - Point label font declaration\n\t\t\tpointLabelFontFamily : \"'Arial'\",\n\n\t\t\t//String - Point label font weight\n\t\t\tpointLabelFontStyle : \"normal\",\n\n\t\t\t//Number - Point label font size in pixels\n\t\t\tpointLabelFontSize : 10,\n\n\t\t\t//String - Point label font colour\n\t\t\tpointLabelFontColor : \"#666\",\n\n\t\t\t//Boolean - Whether to show a dot for each point\n\t\t\tpointDot : true,\n\n\t\t\t//Number - Radius of each point dot in pixels\n\t\t\tpointDotRadius : 3,\n\n\t\t\t//Number - Pixel width of point dot stroke\n\t\t\tpointDotStrokeWidth : 1,\n\n\t\t\t//Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n\t\t\tpointHitDetectionRadius : 20,\n\n\t\t\t//Boolean - Whether to show a stroke for datasets\n\t\t\tdatasetStroke : true,\n\n\t\t\t//Number - Pixel width of dataset stroke\n\t\t\tdatasetStrokeWidth : 2,\n\n\t\t\t//Boolean - Whether to fill the dataset with a colour\n\t\t\tdatasetFill : true,\n\n\t\t\t//String - A legend template\n\t\t\tlegendTemplate : \"
    -legend\\\"><% for (var i=0; i
  • \\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
\"\n\n\t\t},\n\n\t\tinitialize: function(data){\n\t\t\tthis.PointClass = Chart.Point.extend({\n\t\t\t\tstrokeWidth : this.options.pointDotStrokeWidth,\n\t\t\t\tradius : this.options.pointDotRadius,\n\t\t\t\tdisplay: this.options.pointDot,\n\t\t\t\thitDetectionRadius : this.options.pointHitDetectionRadius,\n\t\t\t\tctx : this.chart.ctx\n\t\t\t});\n\n\t\t\tthis.datasets = [];\n\n\t\t\tthis.buildScale(data);\n\n\t\t\t//Set up tooltip events on the chart\n\t\t\tif (this.options.showTooltips){\n\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n\t\t\t\t\tvar activePointsCollection = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];\n\n\t\t\t\t\tthis.eachPoints(function(point){\n\t\t\t\t\t\tpoint.restore(['fillColor', 'strokeColor']);\n\t\t\t\t\t});\n\t\t\t\t\thelpers.each(activePointsCollection, function(activePoint){\n\t\t\t\t\t\tactivePoint.fillColor = activePoint.highlightFill;\n\t\t\t\t\t\tactivePoint.strokeColor = activePoint.highlightStroke;\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.showTooltip(activePointsCollection);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//Iterate through each of the datasets, and build this into a property of the chart\n\t\t\thelpers.each(data.datasets,function(dataset){\n\n\t\t\t\tvar datasetObject = {\n\t\t\t\t\tlabel: dataset.label || null,\n\t\t\t\t\tfillColor : dataset.fillColor,\n\t\t\t\t\tstrokeColor : dataset.strokeColor,\n\t\t\t\t\tpointColor : dataset.pointColor,\n\t\t\t\t\tpointStrokeColor : dataset.pointStrokeColor,\n\t\t\t\t\tpoints : []\n\t\t\t\t};\n\n\t\t\t\tthis.datasets.push(datasetObject);\n\n\t\t\t\thelpers.each(dataset.data,function(dataPoint,index){\n\t\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n\t\t\t\t\tvar pointPosition;\n\t\t\t\t\tif (!this.scale.animation){\n\t\t\t\t\t\tpointPosition = this.scale.getPointPosition(index, this.scale.calculateCenterOffset(dataPoint));\n\t\t\t\t\t}\n\t\t\t\t\tdatasetObject.points.push(new this.PointClass({\n\t\t\t\t\t\tvalue : dataPoint,\n\t\t\t\t\t\tlabel : data.labels[index],\n\t\t\t\t\t\tdatasetLabel: dataset.label,\n\t\t\t\t\t\tx: (this.options.animation) ? this.scale.xCenter : pointPosition.x,\n\t\t\t\t\t\ty: (this.options.animation) ? this.scale.yCenter : pointPosition.y,\n\t\t\t\t\t\tstrokeColor : dataset.pointStrokeColor,\n\t\t\t\t\t\tfillColor : dataset.pointColor,\n\t\t\t\t\t\thighlightFill : dataset.pointHighlightFill || dataset.pointColor,\n\t\t\t\t\t\thighlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor\n\t\t\t\t\t}));\n\t\t\t\t},this);\n\n\t\t\t},this);\n\n\t\t\tthis.render();\n\t\t},\n\t\teachPoints : function(callback){\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\thelpers.each(dataset.points,callback,this);\n\t\t\t},this);\n\t\t},\n\n\t\tgetPointsAtEvent : function(evt){\n\t\t\tvar mousePosition = helpers.getRelativePosition(evt),\n\t\t\t\tfromCenter = helpers.getAngleFromPoint({\n\t\t\t\t\tx: this.scale.xCenter,\n\t\t\t\t\ty: this.scale.yCenter\n\t\t\t\t}, mousePosition);\n\n\t\t\tvar anglePerIndex = (Math.PI * 2) /this.scale.valuesCount,\n\t\t\t\tpointIndex = Math.round((fromCenter.angle - Math.PI * 1.5) / anglePerIndex),\n\t\t\t\tactivePointsCollection = [];\n\n\t\t\t// If we're at the top, make the pointIndex 0 to get the first of the array.\n\t\t\tif (pointIndex >= this.scale.valuesCount || pointIndex < 0){\n\t\t\t\tpointIndex = 0;\n\t\t\t}\n\n\t\t\tif (fromCenter.distance <= this.scale.drawingArea){\n\t\t\t\thelpers.each(this.datasets, function(dataset){\n\t\t\t\t\tactivePointsCollection.push(dataset.points[pointIndex]);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn activePointsCollection;\n\t\t},\n\n\t\tbuildScale : function(data){\n\t\t\tthis.scale = new Chart.RadialScale({\n\t\t\t\tdisplay: this.options.showScale,\n\t\t\t\tfontStyle: this.options.scaleFontStyle,\n\t\t\t\tfontSize: this.options.scaleFontSize,\n\t\t\t\tfontFamily: this.options.scaleFontFamily,\n\t\t\t\tfontColor: this.options.scaleFontColor,\n\t\t\t\tshowLabels: this.options.scaleShowLabels,\n\t\t\t\tshowLabelBackdrop: this.options.scaleShowLabelBackdrop,\n\t\t\t\tbackdropColor: this.options.scaleBackdropColor,\n\t\t\t\tbackdropPaddingY : this.options.scaleBackdropPaddingY,\n\t\t\t\tbackdropPaddingX: this.options.scaleBackdropPaddingX,\n\t\t\t\tlineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,\n\t\t\t\tlineColor: this.options.scaleLineColor,\n\t\t\t\tangleLineColor : this.options.angleLineColor,\n\t\t\t\tangleLineWidth : (this.options.angleShowLineOut) ? this.options.angleLineWidth : 0,\n\t\t\t\t// Point labels at the edge of each line\n\t\t\t\tpointLabelFontColor : this.options.pointLabelFontColor,\n\t\t\t\tpointLabelFontSize : this.options.pointLabelFontSize,\n\t\t\t\tpointLabelFontFamily : this.options.pointLabelFontFamily,\n\t\t\t\tpointLabelFontStyle : this.options.pointLabelFontStyle,\n\t\t\t\theight : this.chart.height,\n\t\t\t\twidth: this.chart.width,\n\t\t\t\txCenter: this.chart.width/2,\n\t\t\t\tyCenter: this.chart.height/2,\n\t\t\t\tctx : this.chart.ctx,\n\t\t\t\ttemplateString: this.options.scaleLabel,\n\t\t\t\tlabels: data.labels,\n\t\t\t\tvaluesCount: data.datasets[0].data.length\n\t\t\t});\n\n\t\t\tthis.scale.setScaleSize();\n\t\t\tthis.updateScaleRange(data.datasets);\n\t\t\tthis.scale.buildYLabels();\n\t\t},\n\t\tupdateScaleRange: function(datasets){\n\t\t\tvar valuesArray = (function(){\n\t\t\t\tvar totalDataArray = [];\n\t\t\t\thelpers.each(datasets,function(dataset){\n\t\t\t\t\tif (dataset.data){\n\t\t\t\t\t\ttotalDataArray = totalDataArray.concat(dataset.data);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\thelpers.each(dataset.points, function(point){\n\t\t\t\t\t\t\ttotalDataArray.push(point.value);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn totalDataArray;\n\t\t\t})();\n\n\n\t\t\tvar scaleSizes = (this.options.scaleOverride) ?\n\t\t\t\t{\n\t\t\t\t\tsteps: this.options.scaleSteps,\n\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n\t\t\t\t\tmin: this.options.scaleStartValue,\n\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n\t\t\t\t} :\n\t\t\t\thelpers.calculateScaleRange(\n\t\t\t\t\tvaluesArray,\n\t\t\t\t\thelpers.min([this.chart.width, this.chart.height])/2,\n\t\t\t\t\tthis.options.scaleFontSize,\n\t\t\t\t\tthis.options.scaleBeginAtZero,\n\t\t\t\t\tthis.options.scaleIntegersOnly\n\t\t\t\t);\n\n\t\t\thelpers.extend(\n\t\t\t\tthis.scale,\n\t\t\t\tscaleSizes\n\t\t\t);\n\n\t\t},\n\t\taddData : function(valuesArray,label){\n\t\t\t//Map the values array for each of the datasets\n\t\t\tthis.scale.valuesCount++;\n\t\t\thelpers.each(valuesArray,function(value,datasetIndex){\n\t\t\t\tvar pointPosition = this.scale.getPointPosition(this.scale.valuesCount, this.scale.calculateCenterOffset(value));\n\t\t\t\tthis.datasets[datasetIndex].points.push(new this.PointClass({\n\t\t\t\t\tvalue : value,\n\t\t\t\t\tlabel : label,\n\t\t\t\t\tx: pointPosition.x,\n\t\t\t\t\ty: pointPosition.y,\n\t\t\t\t\tstrokeColor : this.datasets[datasetIndex].pointStrokeColor,\n\t\t\t\t\tfillColor : this.datasets[datasetIndex].pointColor\n\t\t\t\t}));\n\t\t\t},this);\n\n\t\t\tthis.scale.labels.push(label);\n\n\t\t\tthis.reflow();\n\n\t\t\tthis.update();\n\t\t},\n\t\tremoveData : function(){\n\t\t\tthis.scale.valuesCount--;\n\t\t\tthis.scale.labels.shift();\n\t\t\thelpers.each(this.datasets,function(dataset){\n\t\t\t\tdataset.points.shift();\n\t\t\t},this);\n\t\t\tthis.reflow();\n\t\t\tthis.update();\n\t\t},\n\t\tupdate : function(){\n\t\t\tthis.eachPoints(function(point){\n\t\t\t\tpoint.save();\n\t\t\t});\n\t\t\tthis.reflow();\n\t\t\tthis.render();\n\t\t},\n\t\treflow: function(){\n\t\t\thelpers.extend(this.scale, {\n\t\t\t\twidth : this.chart.width,\n\t\t\t\theight: this.chart.height,\n\t\t\t\tsize : helpers.min([this.chart.width, this.chart.height]),\n\t\t\t\txCenter: this.chart.width/2,\n\t\t\t\tyCenter: this.chart.height/2\n\t\t\t});\n\t\t\tthis.updateScaleRange(this.datasets);\n\t\t\tthis.scale.setScaleSize();\n\t\t\tthis.scale.buildYLabels();\n\t\t},\n\t\tdraw : function(ease){\n\t\t\tvar easeDecimal = ease || 1,\n\t\t\t\tctx = this.chart.ctx;\n\t\t\tthis.clear();\n\t\t\tthis.scale.draw();\n\n\t\t\thelpers.each(this.datasets,function(dataset){\n\n\t\t\t\t//Transition each point first so that the line and point drawing isn't out of sync\n\t\t\t\thelpers.each(dataset.points,function(point,index){\n\t\t\t\t\tif (point.hasValue()){\n\t\t\t\t\t\tpoint.transition(this.scale.getPointPosition(index, this.scale.calculateCenterOffset(point.value)), easeDecimal);\n\t\t\t\t\t}\n\t\t\t\t},this);\n\n\n\n\t\t\t\t//Draw the line between all the points\n\t\t\t\tctx.lineWidth = this.options.datasetStrokeWidth;\n\t\t\t\tctx.strokeStyle = dataset.strokeColor;\n\t\t\t\tctx.beginPath();\n\t\t\t\thelpers.each(dataset.points,function(point,index){\n\t\t\t\t\tif (index === 0){\n\t\t\t\t\t\tctx.moveTo(point.x,point.y);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tctx.lineTo(point.x,point.y);\n\t\t\t\t\t}\n\t\t\t\t},this);\n\t\t\t\tctx.closePath();\n\t\t\t\tctx.stroke();\n\n\t\t\t\tctx.fillStyle = dataset.fillColor;\n\t\t\t\tctx.fill();\n\n\t\t\t\t//Now draw the points over the line\n\t\t\t\t//A little inefficient double looping, but better than the line\n\t\t\t\t//lagging behind the point positions\n\t\t\t\thelpers.each(dataset.points,function(point){\n\t\t\t\t\tif (point.hasValue()){\n\t\t\t\t\t\tpoint.draw();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t},this);\n\n\t\t}\n\n\t});\n\n\n\n\n\n}).call(this);","/*\n * jQuery File Upload Plugin\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2010, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n */\n\n/* global define, require */\n/* eslint-disable new-cap */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // Register as an anonymous AMD module:\n define(['jquery', 'jquery-ui/ui/widget'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS:\n factory(require('jquery'), require('./vendor/jquery.ui.widget'));\n } else {\n // Browser globals:\n factory(window.jQuery);\n }\n})(function ($) {\n 'use strict';\n\n // Detect file input support, based on\n // https://viljamis.com/2012/file-upload-support-on-mobile/\n $.support.fileInput = !(\n new RegExp(\n // Handle devices which give false positives for the feature detection:\n '(Android (1\\\\.[0156]|2\\\\.[01]))' +\n '|(Windows Phone (OS 7|8\\\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +\n '|(w(eb)?OSBrowser)|(webOS)' +\n '|(Kindle/(1\\\\.0|2\\\\.[05]|3\\\\.0))'\n ).test(window.navigator.userAgent) ||\n // Feature detection for all other devices:\n $('').prop('disabled')\n );\n\n // The FileReader API is not actually used, but works as feature detection,\n // as some Safari versions (5?) support XHR file uploads via the FormData API,\n // but not non-multipart XHR file uploads.\n // window.XMLHttpRequestUpload is not available on IE10, so we check for\n // window.ProgressEvent instead to detect XHR2 file upload capability:\n $.support.xhrFileUpload = !!(window.ProgressEvent && window.FileReader);\n $.support.xhrFormDataFileUpload = !!window.FormData;\n\n // Detect support for Blob slicing (required for chunked uploads):\n $.support.blobSlice =\n window.Blob &&\n (Blob.prototype.slice ||\n Blob.prototype.webkitSlice ||\n Blob.prototype.mozSlice);\n\n /**\n * Helper function to create drag handlers for dragover/dragenter/dragleave\n *\n * @param {string} type Event type\n * @returns {Function} Drag handler\n */\n function getDragHandler(type) {\n var isDragOver = type === 'dragover';\n return function (e) {\n e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;\n var dataTransfer = e.dataTransfer;\n if (\n dataTransfer &&\n $.inArray('Files', dataTransfer.types) !== -1 &&\n this._trigger(type, $.Event(type, { delegatedEvent: e })) !== false\n ) {\n e.preventDefault();\n if (isDragOver) {\n dataTransfer.dropEffect = 'copy';\n }\n }\n };\n }\n\n // The fileupload widget listens for change events on file input fields defined\n // via fileInput setting and paste or drop events of the given dropZone.\n // In addition to the default jQuery Widget methods, the fileupload widget\n // exposes the \"add\" and \"send\" methods, to add or directly send files using\n // the fileupload API.\n // By default, files added via file input selection, paste, drag & drop or\n // \"add\" method are uploaded immediately, but it is possible to override\n // the \"add\" callback option to queue file uploads.\n $.widget('blueimp.fileupload', {\n options: {\n // The drop target element(s), by the default the complete document.\n // Set to null to disable drag & drop support:\n dropZone: $(document),\n // The paste target element(s), by the default undefined.\n // Set to a DOM node or jQuery object to enable file pasting:\n pasteZone: undefined,\n // The file input field(s), that are listened to for change events.\n // If undefined, it is set to the file input fields inside\n // of the widget element on plugin initialization.\n // Set to null to disable the change listener.\n fileInput: undefined,\n // By default, the file input field is replaced with a clone after\n // each input field change event. This is required for iframe transport\n // queues and allows change events to be fired for the same file\n // selection, but can be disabled by setting the following option to false:\n replaceFileInput: true,\n // The parameter name for the file form data (the request argument name).\n // If undefined or empty, the name property of the file input field is\n // used, or \"files[]\" if the file input name property is also empty,\n // can be a string or an array of strings:\n paramName: undefined,\n // By default, each file of a selection is uploaded using an individual\n // request for XHR type uploads. Set to false to upload file\n // selections in one request each:\n singleFileUploads: true,\n // To limit the number of files uploaded with one XHR request,\n // set the following option to an integer greater than 0:\n limitMultiFileUploads: undefined,\n // The following option limits the number of files uploaded with one\n // XHR request to keep the request size under or equal to the defined\n // limit in bytes:\n limitMultiFileUploadSize: undefined,\n // Multipart file uploads add a number of bytes to each uploaded file,\n // therefore the following option adds an overhead for each file used\n // in the limitMultiFileUploadSize configuration:\n limitMultiFileUploadSizeOverhead: 512,\n // Set the following option to true to issue all file upload requests\n // in a sequential order:\n sequentialUploads: false,\n // To limit the number of concurrent uploads,\n // set the following option to an integer greater than 0:\n limitConcurrentUploads: undefined,\n // Set the following option to true to force iframe transport uploads:\n forceIframeTransport: false,\n // Set the following option to the location of a redirect url on the\n // origin server, for cross-domain iframe transport uploads:\n redirect: undefined,\n // The parameter name for the redirect url, sent as part of the form\n // data and set to 'redirect' if this option is empty:\n redirectParamName: undefined,\n // Set the following option to the location of a postMessage window,\n // to enable postMessage transport uploads:\n postMessage: undefined,\n // By default, XHR file uploads are sent as multipart/form-data.\n // The iframe transport is always using multipart/form-data.\n // Set to false to enable non-multipart XHR uploads:\n multipart: true,\n // To upload large files in smaller chunks, set the following option\n // to a preferred maximum chunk size. If set to 0, null or undefined,\n // or the browser does not support the required Blob API, files will\n // be uploaded as a whole.\n maxChunkSize: undefined,\n // When a non-multipart upload or a chunked multipart upload has been\n // aborted, this option can be used to resume the upload by setting\n // it to the size of the already uploaded bytes. This option is most\n // useful when modifying the options object inside of the \"add\" or\n // \"send\" callbacks, as the options are cloned for each file upload.\n uploadedBytes: undefined,\n // By default, failed (abort or error) file uploads are removed from the\n // global progress calculation. Set the following option to false to\n // prevent recalculating the global progress data:\n recalculateProgress: true,\n // Interval in milliseconds to calculate and trigger progress events:\n progressInterval: 100,\n // Interval in milliseconds to calculate progress bitrate:\n bitrateInterval: 500,\n // By default, uploads are started automatically when adding files:\n autoUpload: true,\n // By default, duplicate file names are expected to be handled on\n // the server-side. If this is not possible (e.g. when uploading\n // files directly to Amazon S3), the following option can be set to\n // an empty object or an object mapping existing filenames, e.g.:\n // { \"image.jpg\": true, \"image (1).jpg\": true }\n // If it is set, all files will be uploaded with unique filenames,\n // adding increasing number suffixes if necessary, e.g.:\n // \"image (2).jpg\"\n uniqueFilenames: undefined,\n\n // Error and info messages:\n messages: {\n uploadedBytes: 'Uploaded bytes exceed file size'\n },\n\n // Translation function, gets the message key to be translated\n // and an object with context specific data as arguments:\n i18n: function (message, context) {\n // eslint-disable-next-line no-param-reassign\n message = this.messages[message] || message.toString();\n if (context) {\n $.each(context, function (key, value) {\n // eslint-disable-next-line no-param-reassign\n message = message.replace('{' + key + '}', value);\n });\n }\n return message;\n },\n\n // Additional form data to be sent along with the file uploads can be set\n // using this option, which accepts an array of objects with name and\n // value properties, a function returning such an array, a FormData\n // object (for XHR file uploads), or a simple object.\n // The form of the first fileInput is given as parameter to the function:\n formData: function (form) {\n return form.serializeArray();\n },\n\n // The add callback is invoked as soon as files are added to the fileupload\n // widget (via file input selection, drag & drop, paste or add API call).\n // If the singleFileUploads option is enabled, this callback will be\n // called once for each file in the selection for XHR file uploads, else\n // once for each file selection.\n //\n // The upload starts when the submit method is invoked on the data parameter.\n // The data object contains a files property holding the added files\n // and allows you to override plugin options as well as define ajax settings.\n //\n // Listeners for this callback can also be bound the following way:\n // .on('fileuploadadd', func);\n //\n // data.submit() returns a Promise object and allows to attach additional\n // handlers using jQuery's Deferred callbacks:\n // data.submit().done(func).fail(func).always(func);\n add: function (e, data) {\n if (e.isDefaultPrevented()) {\n return false;\n }\n if (\n data.autoUpload ||\n (data.autoUpload !== false &&\n $(this).fileupload('option', 'autoUpload'))\n ) {\n data.process().done(function () {\n data.submit();\n });\n }\n },\n\n // Other callbacks:\n\n // Callback for the submit event of each file upload:\n // submit: function (e, data) {}, // .on('fileuploadsubmit', func);\n\n // Callback for the start of each file upload request:\n // send: function (e, data) {}, // .on('fileuploadsend', func);\n\n // Callback for successful uploads:\n // done: function (e, data) {}, // .on('fileuploaddone', func);\n\n // Callback for failed (abort or error) uploads:\n // fail: function (e, data) {}, // .on('fileuploadfail', func);\n\n // Callback for completed (success, abort or error) requests:\n // always: function (e, data) {}, // .on('fileuploadalways', func);\n\n // Callback for upload progress events:\n // progress: function (e, data) {}, // .on('fileuploadprogress', func);\n\n // Callback for global upload progress events:\n // progressall: function (e, data) {}, // .on('fileuploadprogressall', func);\n\n // Callback for uploads start, equivalent to the global ajaxStart event:\n // start: function (e) {}, // .on('fileuploadstart', func);\n\n // Callback for uploads stop, equivalent to the global ajaxStop event:\n // stop: function (e) {}, // .on('fileuploadstop', func);\n\n // Callback for change events of the fileInput(s):\n // change: function (e, data) {}, // .on('fileuploadchange', func);\n\n // Callback for paste events to the pasteZone(s):\n // paste: function (e, data) {}, // .on('fileuploadpaste', func);\n\n // Callback for drop events of the dropZone(s):\n // drop: function (e, data) {}, // .on('fileuploaddrop', func);\n\n // Callback for dragover events of the dropZone(s):\n // dragover: function (e) {}, // .on('fileuploaddragover', func);\n\n // Callback before the start of each chunk upload request (before form data initialization):\n // chunkbeforesend: function (e, data) {}, // .on('fileuploadchunkbeforesend', func);\n\n // Callback for the start of each chunk upload request:\n // chunksend: function (e, data) {}, // .on('fileuploadchunksend', func);\n\n // Callback for successful chunk uploads:\n // chunkdone: function (e, data) {}, // .on('fileuploadchunkdone', func);\n\n // Callback for failed (abort or error) chunk uploads:\n // chunkfail: function (e, data) {}, // .on('fileuploadchunkfail', func);\n\n // Callback for completed (success, abort or error) chunk upload requests:\n // chunkalways: function (e, data) {}, // .on('fileuploadchunkalways', func);\n\n // The plugin options are used as settings object for the ajax calls.\n // The following are jQuery ajax settings required for the file uploads:\n processData: false,\n contentType: false,\n cache: false,\n timeout: 0\n },\n\n // jQuery versions before 1.8 require promise.pipe if the return value is\n // used, as promise.then in older versions has a different behavior, see:\n // https://blog.jquery.com/2012/08/09/jquery-1-8-released/\n // https://bugs.jquery.com/ticket/11010\n // https://github.com/blueimp/jQuery-File-Upload/pull/3435\n _promisePipe: (function () {\n var parts = $.fn.jquery.split('.');\n return Number(parts[0]) > 1 || Number(parts[1]) > 7 ? 'then' : 'pipe';\n })(),\n\n // A list of options that require reinitializing event listeners and/or\n // special initialization code:\n _specialOptions: [\n 'fileInput',\n 'dropZone',\n 'pasteZone',\n 'multipart',\n 'forceIframeTransport'\n ],\n\n _blobSlice:\n $.support.blobSlice &&\n function () {\n var slice = this.slice || this.webkitSlice || this.mozSlice;\n return slice.apply(this, arguments);\n },\n\n _BitrateTimer: function () {\n this.timestamp = Date.now ? Date.now() : new Date().getTime();\n this.loaded = 0;\n this.bitrate = 0;\n this.getBitrate = function (now, loaded, interval) {\n var timeDiff = now - this.timestamp;\n if (!this.bitrate || !interval || timeDiff > interval) {\n this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8;\n this.loaded = loaded;\n this.timestamp = now;\n }\n return this.bitrate;\n };\n },\n\n _isXHRUpload: function (options) {\n return (\n !options.forceIframeTransport &&\n ((!options.multipart && $.support.xhrFileUpload) ||\n $.support.xhrFormDataFileUpload)\n );\n },\n\n _getFormData: function (options) {\n var formData;\n if ($.type(options.formData) === 'function') {\n return options.formData(options.form);\n }\n if ($.isArray(options.formData)) {\n return options.formData;\n }\n if ($.type(options.formData) === 'object') {\n formData = [];\n $.each(options.formData, function (name, value) {\n formData.push({ name: name, value: value });\n });\n return formData;\n }\n return [];\n },\n\n _getTotal: function (files) {\n var total = 0;\n $.each(files, function (index, file) {\n total += file.size || 1;\n });\n return total;\n },\n\n _initProgressObject: function (obj) {\n var progress = {\n loaded: 0,\n total: 0,\n bitrate: 0\n };\n if (obj._progress) {\n $.extend(obj._progress, progress);\n } else {\n obj._progress = progress;\n }\n },\n\n _initResponseObject: function (obj) {\n var prop;\n if (obj._response) {\n for (prop in obj._response) {\n if (Object.prototype.hasOwnProperty.call(obj._response, prop)) {\n delete obj._response[prop];\n }\n }\n } else {\n obj._response = {};\n }\n },\n\n _onProgress: function (e, data) {\n if (e.lengthComputable) {\n var now = Date.now ? Date.now() : new Date().getTime(),\n loaded;\n if (\n data._time &&\n data.progressInterval &&\n now - data._time < data.progressInterval &&\n e.loaded !== e.total\n ) {\n return;\n }\n data._time = now;\n loaded =\n Math.floor(\n (e.loaded / e.total) * (data.chunkSize || data._progress.total)\n ) + (data.uploadedBytes || 0);\n // Add the difference from the previously loaded state\n // to the global loaded counter:\n this._progress.loaded += loaded - data._progress.loaded;\n this._progress.bitrate = this._bitrateTimer.getBitrate(\n now,\n this._progress.loaded,\n data.bitrateInterval\n );\n data._progress.loaded = data.loaded = loaded;\n data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(\n now,\n loaded,\n data.bitrateInterval\n );\n // Trigger a custom progress event with a total data property set\n // to the file size(s) of the current upload and a loaded data\n // property calculated accordingly:\n this._trigger(\n 'progress',\n $.Event('progress', { delegatedEvent: e }),\n data\n );\n // Trigger a global progress event for all current file uploads,\n // including ajax calls queued for sequential file uploads:\n this._trigger(\n 'progressall',\n $.Event('progressall', { delegatedEvent: e }),\n this._progress\n );\n }\n },\n\n _initProgressListener: function (options) {\n var that = this,\n xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();\n // Access to the native XHR object is required to add event listeners\n // for the upload progress event:\n if (xhr.upload) {\n $(xhr.upload).on('progress', function (e) {\n var oe = e.originalEvent;\n // Make sure the progress event properties get copied over:\n e.lengthComputable = oe.lengthComputable;\n e.loaded = oe.loaded;\n e.total = oe.total;\n that._onProgress(e, options);\n });\n options.xhr = function () {\n return xhr;\n };\n }\n },\n\n _deinitProgressListener: function (options) {\n var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();\n if (xhr.upload) {\n $(xhr.upload).off('progress');\n }\n },\n\n _isInstanceOf: function (type, obj) {\n // Cross-frame instanceof check\n return Object.prototype.toString.call(obj) === '[object ' + type + ']';\n },\n\n _getUniqueFilename: function (name, map) {\n // eslint-disable-next-line no-param-reassign\n name = String(name);\n if (map[name]) {\n // eslint-disable-next-line no-param-reassign\n name = name.replace(\n /(?: \\(([\\d]+)\\))?(\\.[^.]+)?$/,\n function (_, p1, p2) {\n var index = p1 ? Number(p1) + 1 : 1;\n var ext = p2 || '';\n return ' (' + index + ')' + ext;\n }\n );\n return this._getUniqueFilename(name, map);\n }\n map[name] = true;\n return name;\n },\n\n _initXHRData: function (options) {\n var that = this,\n formData,\n file = options.files[0],\n // Ignore non-multipart setting if not supported:\n multipart = options.multipart || !$.support.xhrFileUpload,\n paramName =\n $.type(options.paramName) === 'array'\n ? options.paramName[0]\n : options.paramName;\n options.headers = $.extend({}, options.headers);\n if (options.contentRange) {\n options.headers['Content-Range'] = options.contentRange;\n }\n if (!multipart || options.blob || !this._isInstanceOf('File', file)) {\n options.headers['Content-Disposition'] =\n 'attachment; filename=\"' +\n encodeURI(file.uploadName || file.name) +\n '\"';\n }\n if (!multipart) {\n options.contentType = file.type || 'application/octet-stream';\n options.data = options.blob || file;\n } else if ($.support.xhrFormDataFileUpload) {\n if (options.postMessage) {\n // window.postMessage does not allow sending FormData\n // objects, so we just add the File/Blob objects to\n // the formData array and let the postMessage window\n // create the FormData object out of this array:\n formData = this._getFormData(options);\n if (options.blob) {\n formData.push({\n name: paramName,\n value: options.blob\n });\n } else {\n $.each(options.files, function (index, file) {\n formData.push({\n name:\n ($.type(options.paramName) === 'array' &&\n options.paramName[index]) ||\n paramName,\n value: file\n });\n });\n }\n } else {\n if (that._isInstanceOf('FormData', options.formData)) {\n formData = options.formData;\n } else {\n formData = new FormData();\n $.each(this._getFormData(options), function (index, field) {\n formData.append(field.name, field.value);\n });\n }\n if (options.blob) {\n formData.append(\n paramName,\n options.blob,\n file.uploadName || file.name\n );\n } else {\n $.each(options.files, function (index, file) {\n // This check allows the tests to run with\n // dummy objects:\n if (\n that._isInstanceOf('File', file) ||\n that._isInstanceOf('Blob', file)\n ) {\n var fileName = file.uploadName || file.name;\n if (options.uniqueFilenames) {\n fileName = that._getUniqueFilename(\n fileName,\n options.uniqueFilenames\n );\n }\n formData.append(\n ($.type(options.paramName) === 'array' &&\n options.paramName[index]) ||\n paramName,\n file,\n fileName\n );\n }\n });\n }\n }\n options.data = formData;\n }\n // Blob reference is not needed anymore, free memory:\n options.blob = null;\n },\n\n _initIframeSettings: function (options) {\n var targetHost = $('').prop('href', options.url).prop('host');\n // Setting the dataType to iframe enables the iframe transport:\n options.dataType = 'iframe ' + (options.dataType || '');\n // The iframe transport accepts a serialized array as form data:\n options.formData = this._getFormData(options);\n // Add redirect url to form data on cross-domain uploads:\n if (options.redirect && targetHost && targetHost !== location.host) {\n options.formData.push({\n name: options.redirectParamName || 'redirect',\n value: options.redirect\n });\n }\n },\n\n _initDataSettings: function (options) {\n if (this._isXHRUpload(options)) {\n if (!this._chunkedUpload(options, true)) {\n if (!options.data) {\n this._initXHRData(options);\n }\n this._initProgressListener(options);\n }\n if (options.postMessage) {\n // Setting the dataType to postmessage enables the\n // postMessage transport:\n options.dataType = 'postmessage ' + (options.dataType || '');\n }\n } else {\n this._initIframeSettings(options);\n }\n },\n\n _getParamName: function (options) {\n var fileInput = $(options.fileInput),\n paramName = options.paramName;\n if (!paramName) {\n paramName = [];\n fileInput.each(function () {\n var input = $(this),\n name = input.prop('name') || 'files[]',\n i = (input.prop('files') || [1]).length;\n while (i) {\n paramName.push(name);\n i -= 1;\n }\n });\n if (!paramName.length) {\n paramName = [fileInput.prop('name') || 'files[]'];\n }\n } else if (!$.isArray(paramName)) {\n paramName = [paramName];\n }\n return paramName;\n },\n\n _initFormSettings: function (options) {\n // Retrieve missing options from the input field and the\n // associated form, if available:\n if (!options.form || !options.form.length) {\n options.form = $(options.fileInput.prop('form'));\n // If the given file input doesn't have an associated form,\n // use the default widget file input's form:\n if (!options.form.length) {\n options.form = $(this.options.fileInput.prop('form'));\n }\n }\n options.paramName = this._getParamName(options);\n if (!options.url) {\n options.url = options.form.prop('action') || location.href;\n }\n // The HTTP request method must be \"POST\" or \"PUT\":\n options.type = (\n options.type ||\n ($.type(options.form.prop('method')) === 'string' &&\n options.form.prop('method')) ||\n ''\n ).toUpperCase();\n if (\n options.type !== 'POST' &&\n options.type !== 'PUT' &&\n options.type !== 'PATCH'\n ) {\n options.type = 'POST';\n }\n if (!options.formAcceptCharset) {\n options.formAcceptCharset = options.form.attr('accept-charset');\n }\n },\n\n _getAJAXSettings: function (data) {\n var options = $.extend({}, this.options, data);\n this._initFormSettings(options);\n this._initDataSettings(options);\n return options;\n },\n\n // jQuery 1.6 doesn't provide .state(),\n // while jQuery 1.8+ removed .isRejected() and .isResolved():\n _getDeferredState: function (deferred) {\n if (deferred.state) {\n return deferred.state();\n }\n if (deferred.isResolved()) {\n return 'resolved';\n }\n if (deferred.isRejected()) {\n return 'rejected';\n }\n return 'pending';\n },\n\n // Maps jqXHR callbacks to the equivalent\n // methods of the given Promise object:\n _enhancePromise: function (promise) {\n promise.success = promise.done;\n promise.error = promise.fail;\n promise.complete = promise.always;\n return promise;\n },\n\n // Creates and returns a Promise object enhanced with\n // the jqXHR methods abort, success, error and complete:\n _getXHRPromise: function (resolveOrReject, context, args) {\n var dfd = $.Deferred(),\n promise = dfd.promise();\n // eslint-disable-next-line no-param-reassign\n context = context || this.options.context || promise;\n if (resolveOrReject === true) {\n dfd.resolveWith(context, args);\n } else if (resolveOrReject === false) {\n dfd.rejectWith(context, args);\n }\n promise.abort = dfd.promise;\n return this._enhancePromise(promise);\n },\n\n // Adds convenience methods to the data callback argument:\n _addConvenienceMethods: function (e, data) {\n var that = this,\n getPromise = function (args) {\n return $.Deferred().resolveWith(that, args).promise();\n };\n data.process = function (resolveFunc, rejectFunc) {\n if (resolveFunc || rejectFunc) {\n data._processQueue = this._processQueue = (this._processQueue ||\n getPromise([this]))\n [that._promisePipe](function () {\n if (data.errorThrown) {\n return $.Deferred().rejectWith(that, [data]).promise();\n }\n return getPromise(arguments);\n })\n [that._promisePipe](resolveFunc, rejectFunc);\n }\n return this._processQueue || getPromise([this]);\n };\n data.submit = function () {\n if (this.state() !== 'pending') {\n data.jqXHR = this.jqXHR =\n that._trigger(\n 'submit',\n $.Event('submit', { delegatedEvent: e }),\n this\n ) !== false && that._onSend(e, this);\n }\n return this.jqXHR || that._getXHRPromise();\n };\n data.abort = function () {\n if (this.jqXHR) {\n return this.jqXHR.abort();\n }\n this.errorThrown = 'abort';\n that._trigger('fail', null, this);\n return that._getXHRPromise(false);\n };\n data.state = function () {\n if (this.jqXHR) {\n return that._getDeferredState(this.jqXHR);\n }\n if (this._processQueue) {\n return that._getDeferredState(this._processQueue);\n }\n };\n data.processing = function () {\n return (\n !this.jqXHR &&\n this._processQueue &&\n that._getDeferredState(this._processQueue) === 'pending'\n );\n };\n data.progress = function () {\n return this._progress;\n };\n data.response = function () {\n return this._response;\n };\n },\n\n // Parses the Range header from the server response\n // and returns the uploaded bytes:\n _getUploadedBytes: function (jqXHR) {\n var range = jqXHR.getResponseHeader('Range'),\n parts = range && range.split('-'),\n upperBytesPos = parts && parts.length > 1 && parseInt(parts[1], 10);\n return upperBytesPos && upperBytesPos + 1;\n },\n\n // Uploads a file in multiple, sequential requests\n // by splitting the file up in multiple blob chunks.\n // If the second parameter is true, only tests if the file\n // should be uploaded in chunks, but does not invoke any\n // upload requests:\n _chunkedUpload: function (options, testOnly) {\n options.uploadedBytes = options.uploadedBytes || 0;\n var that = this,\n file = options.files[0],\n fs = file.size,\n ub = options.uploadedBytes,\n mcs = options.maxChunkSize || fs,\n slice = this._blobSlice,\n dfd = $.Deferred(),\n promise = dfd.promise(),\n jqXHR,\n upload;\n if (\n !(\n this._isXHRUpload(options) &&\n slice &&\n (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)\n ) ||\n options.data\n ) {\n return false;\n }\n if (testOnly) {\n return true;\n }\n if (ub >= fs) {\n file.error = options.i18n('uploadedBytes');\n return this._getXHRPromise(false, options.context, [\n null,\n 'error',\n file.error\n ]);\n }\n // The chunk upload method:\n upload = function () {\n // Clone the options object for each chunk upload:\n var o = $.extend({}, options),\n currentLoaded = o._progress.loaded;\n o.blob = slice.call(\n file,\n ub,\n ub + ($.type(mcs) === 'function' ? mcs(o) : mcs),\n file.type\n );\n // Store the current chunk size, as the blob itself\n // will be dereferenced after data processing:\n o.chunkSize = o.blob.size;\n // Expose the chunk bytes position range:\n o.contentRange =\n 'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs;\n // Trigger chunkbeforesend to allow form data to be updated for this chunk\n that._trigger('chunkbeforesend', null, o);\n // Process the upload data (the blob and potential form data):\n that._initXHRData(o);\n // Add progress listeners for this chunk upload:\n that._initProgressListener(o);\n jqXHR = (\n (that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||\n that._getXHRPromise(false, o.context)\n )\n .done(function (result, textStatus, jqXHR) {\n ub = that._getUploadedBytes(jqXHR) || ub + o.chunkSize;\n // Create a progress event if no final progress event\n // with loaded equaling total has been triggered\n // for this chunk:\n if (currentLoaded + o.chunkSize - o._progress.loaded) {\n that._onProgress(\n $.Event('progress', {\n lengthComputable: true,\n loaded: ub - o.uploadedBytes,\n total: ub - o.uploadedBytes\n }),\n o\n );\n }\n options.uploadedBytes = o.uploadedBytes = ub;\n o.result = result;\n o.textStatus = textStatus;\n o.jqXHR = jqXHR;\n that._trigger('chunkdone', null, o);\n that._trigger('chunkalways', null, o);\n if (ub < fs) {\n // File upload not yet complete,\n // continue with the next chunk:\n upload();\n } else {\n dfd.resolveWith(o.context, [result, textStatus, jqXHR]);\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n o.jqXHR = jqXHR;\n o.textStatus = textStatus;\n o.errorThrown = errorThrown;\n that._trigger('chunkfail', null, o);\n that._trigger('chunkalways', null, o);\n dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]);\n })\n .always(function () {\n that._deinitProgressListener(o);\n });\n };\n this._enhancePromise(promise);\n promise.abort = function () {\n return jqXHR.abort();\n };\n upload();\n return promise;\n },\n\n _beforeSend: function (e, data) {\n if (this._active === 0) {\n // the start callback is triggered when an upload starts\n // and no other uploads are currently running,\n // equivalent to the global ajaxStart event:\n this._trigger('start');\n // Set timer for global bitrate progress calculation:\n this._bitrateTimer = new this._BitrateTimer();\n // Reset the global progress values:\n this._progress.loaded = this._progress.total = 0;\n this._progress.bitrate = 0;\n }\n // Make sure the container objects for the .response() and\n // .progress() methods on the data object are available\n // and reset to their initial state:\n this._initResponseObject(data);\n this._initProgressObject(data);\n data._progress.loaded = data.loaded = data.uploadedBytes || 0;\n data._progress.total = data.total = this._getTotal(data.files) || 1;\n data._progress.bitrate = data.bitrate = 0;\n this._active += 1;\n // Initialize the global progress values:\n this._progress.loaded += data.loaded;\n this._progress.total += data.total;\n },\n\n _onDone: function (result, textStatus, jqXHR, options) {\n var total = options._progress.total,\n response = options._response;\n if (options._progress.loaded < total) {\n // Create a progress event if no final progress event\n // with loaded equaling total has been triggered:\n this._onProgress(\n $.Event('progress', {\n lengthComputable: true,\n loaded: total,\n total: total\n }),\n options\n );\n }\n response.result = options.result = result;\n response.textStatus = options.textStatus = textStatus;\n response.jqXHR = options.jqXHR = jqXHR;\n this._trigger('done', null, options);\n },\n\n _onFail: function (jqXHR, textStatus, errorThrown, options) {\n var response = options._response;\n if (options.recalculateProgress) {\n // Remove the failed (error or abort) file upload from\n // the global progress calculation:\n this._progress.loaded -= options._progress.loaded;\n this._progress.total -= options._progress.total;\n }\n response.jqXHR = options.jqXHR = jqXHR;\n response.textStatus = options.textStatus = textStatus;\n response.errorThrown = options.errorThrown = errorThrown;\n this._trigger('fail', null, options);\n },\n\n _onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {\n // jqXHRorResult, textStatus and jqXHRorError are added to the\n // options object via done and fail callbacks\n this._trigger('always', null, options);\n },\n\n _onSend: function (e, data) {\n if (!data.submit) {\n this._addConvenienceMethods(e, data);\n }\n var that = this,\n jqXHR,\n aborted,\n slot,\n pipe,\n options = that._getAJAXSettings(data),\n send = function () {\n that._sending += 1;\n // Set timer for bitrate progress calculation:\n options._bitrateTimer = new that._BitrateTimer();\n jqXHR =\n jqXHR ||\n (\n ((aborted ||\n that._trigger(\n 'send',\n $.Event('send', { delegatedEvent: e }),\n options\n ) === false) &&\n that._getXHRPromise(false, options.context, aborted)) ||\n that._chunkedUpload(options) ||\n $.ajax(options)\n )\n .done(function (result, textStatus, jqXHR) {\n that._onDone(result, textStatus, jqXHR, options);\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n that._onFail(jqXHR, textStatus, errorThrown, options);\n })\n .always(function (jqXHRorResult, textStatus, jqXHRorError) {\n that._deinitProgressListener(options);\n that._onAlways(\n jqXHRorResult,\n textStatus,\n jqXHRorError,\n options\n );\n that._sending -= 1;\n that._active -= 1;\n if (\n options.limitConcurrentUploads &&\n options.limitConcurrentUploads > that._sending\n ) {\n // Start the next queued upload,\n // that has not been aborted:\n var nextSlot = that._slots.shift();\n while (nextSlot) {\n if (that._getDeferredState(nextSlot) === 'pending') {\n nextSlot.resolve();\n break;\n }\n nextSlot = that._slots.shift();\n }\n }\n if (that._active === 0) {\n // The stop callback is triggered when all uploads have\n // been completed, equivalent to the global ajaxStop event:\n that._trigger('stop');\n }\n });\n return jqXHR;\n };\n this._beforeSend(e, options);\n if (\n this.options.sequentialUploads ||\n (this.options.limitConcurrentUploads &&\n this.options.limitConcurrentUploads <= this._sending)\n ) {\n if (this.options.limitConcurrentUploads > 1) {\n slot = $.Deferred();\n this._slots.push(slot);\n pipe = slot[that._promisePipe](send);\n } else {\n this._sequence = this._sequence[that._promisePipe](send, send);\n pipe = this._sequence;\n }\n // Return the piped Promise object, enhanced with an abort method,\n // which is delegated to the jqXHR object of the current upload,\n // and jqXHR callbacks mapped to the equivalent Promise methods:\n pipe.abort = function () {\n aborted = [undefined, 'abort', 'abort'];\n if (!jqXHR) {\n if (slot) {\n slot.rejectWith(options.context, aborted);\n }\n return send();\n }\n return jqXHR.abort();\n };\n return this._enhancePromise(pipe);\n }\n return send();\n },\n\n _onAdd: function (e, data) {\n var that = this,\n result = true,\n options = $.extend({}, this.options, data),\n files = data.files,\n filesLength = files.length,\n limit = options.limitMultiFileUploads,\n limitSize = options.limitMultiFileUploadSize,\n overhead = options.limitMultiFileUploadSizeOverhead,\n batchSize = 0,\n paramName = this._getParamName(options),\n paramNameSet,\n paramNameSlice,\n fileSet,\n i,\n j = 0;\n if (!filesLength) {\n return false;\n }\n if (limitSize && files[0].size === undefined) {\n limitSize = undefined;\n }\n if (\n !(options.singleFileUploads || limit || limitSize) ||\n !this._isXHRUpload(options)\n ) {\n fileSet = [files];\n paramNameSet = [paramName];\n } else if (!(options.singleFileUploads || limitSize) && limit) {\n fileSet = [];\n paramNameSet = [];\n for (i = 0; i < filesLength; i += limit) {\n fileSet.push(files.slice(i, i + limit));\n paramNameSlice = paramName.slice(i, i + limit);\n if (!paramNameSlice.length) {\n paramNameSlice = paramName;\n }\n paramNameSet.push(paramNameSlice);\n }\n } else if (!options.singleFileUploads && limitSize) {\n fileSet = [];\n paramNameSet = [];\n for (i = 0; i < filesLength; i = i + 1) {\n batchSize += files[i].size + overhead;\n if (\n i + 1 === filesLength ||\n batchSize + files[i + 1].size + overhead > limitSize ||\n (limit && i + 1 - j >= limit)\n ) {\n fileSet.push(files.slice(j, i + 1));\n paramNameSlice = paramName.slice(j, i + 1);\n if (!paramNameSlice.length) {\n paramNameSlice = paramName;\n }\n paramNameSet.push(paramNameSlice);\n j = i + 1;\n batchSize = 0;\n }\n }\n } else {\n paramNameSet = paramName;\n }\n data.originalFiles = files;\n $.each(fileSet || files, function (index, element) {\n var newData = $.extend({}, data);\n newData.files = fileSet ? element : [element];\n newData.paramName = paramNameSet[index];\n that._initResponseObject(newData);\n that._initProgressObject(newData);\n that._addConvenienceMethods(e, newData);\n result = that._trigger(\n 'add',\n $.Event('add', { delegatedEvent: e }),\n newData\n );\n return result;\n });\n return result;\n },\n\n _replaceFileInput: function (data) {\n var input = data.fileInput,\n inputClone = input.clone(true),\n restoreFocus = input.is(document.activeElement);\n // Add a reference for the new cloned file input to the data argument:\n data.fileInputClone = inputClone;\n $('
').append(inputClone)[0].reset();\n // Detaching allows to insert the fileInput on another form\n // without losing the file input value:\n input.after(inputClone).detach();\n // If the fileInput had focus before it was detached,\n // restore focus to the inputClone.\n if (restoreFocus) {\n inputClone.trigger('focus');\n }\n // Avoid memory leaks with the detached file input:\n $.cleanData(input.off('remove'));\n // Replace the original file input element in the fileInput\n // elements set with the clone, which has been copied including\n // event handlers:\n this.options.fileInput = this.options.fileInput.map(function (i, el) {\n if (el === input[0]) {\n return inputClone[0];\n }\n return el;\n });\n // If the widget has been initialized on the file input itself,\n // override this.element with the file input clone:\n if (input[0] === this.element[0]) {\n this.element = inputClone;\n }\n },\n\n _handleFileTreeEntry: function (entry, path) {\n var that = this,\n dfd = $.Deferred(),\n entries = [],\n dirReader,\n errorHandler = function (e) {\n if (e && !e.entry) {\n e.entry = entry;\n }\n // Since $.when returns immediately if one\n // Deferred is rejected, we use resolve instead.\n // This allows valid files and invalid items\n // to be returned together in one set:\n dfd.resolve([e]);\n },\n successHandler = function (entries) {\n that\n ._handleFileTreeEntries(entries, path + entry.name + '/')\n .done(function (files) {\n dfd.resolve(files);\n })\n .fail(errorHandler);\n },\n readEntries = function () {\n dirReader.readEntries(function (results) {\n if (!results.length) {\n successHandler(entries);\n } else {\n entries = entries.concat(results);\n readEntries();\n }\n }, errorHandler);\n };\n // eslint-disable-next-line no-param-reassign\n path = path || '';\n if (entry.isFile) {\n if (entry._file) {\n // Workaround for Chrome bug #149735\n entry._file.relativePath = path;\n dfd.resolve(entry._file);\n } else {\n entry.file(function (file) {\n file.relativePath = path;\n dfd.resolve(file);\n }, errorHandler);\n }\n } else if (entry.isDirectory) {\n dirReader = entry.createReader();\n readEntries();\n } else {\n // Return an empty list for file system items\n // other than files or directories:\n dfd.resolve([]);\n }\n return dfd.promise();\n },\n\n _handleFileTreeEntries: function (entries, path) {\n var that = this;\n return $.when\n .apply(\n $,\n $.map(entries, function (entry) {\n return that._handleFileTreeEntry(entry, path);\n })\n )\n [this._promisePipe](function () {\n return Array.prototype.concat.apply([], arguments);\n });\n },\n\n _getDroppedFiles: function (dataTransfer) {\n // eslint-disable-next-line no-param-reassign\n dataTransfer = dataTransfer || {};\n var items = dataTransfer.items;\n if (\n items &&\n items.length &&\n (items[0].webkitGetAsEntry || items[0].getAsEntry)\n ) {\n return this._handleFileTreeEntries(\n $.map(items, function (item) {\n var entry;\n if (item.webkitGetAsEntry) {\n entry = item.webkitGetAsEntry();\n if (entry) {\n // Workaround for Chrome bug #149735:\n entry._file = item.getAsFile();\n }\n return entry;\n }\n return item.getAsEntry();\n })\n );\n }\n return $.Deferred().resolve($.makeArray(dataTransfer.files)).promise();\n },\n\n _getSingleFileInputFiles: function (fileInput) {\n // eslint-disable-next-line no-param-reassign\n fileInput = $(fileInput);\n var entries = fileInput.prop('entries'),\n files,\n value;\n if (entries && entries.length) {\n return this._handleFileTreeEntries(entries);\n }\n files = $.makeArray(fileInput.prop('files'));\n if (!files.length) {\n value = fileInput.prop('value');\n if (!value) {\n return $.Deferred().resolve([]).promise();\n }\n // If the files property is not available, the browser does not\n // support the File API and we add a pseudo File object with\n // the input value as name with path information removed:\n files = [{ name: value.replace(/^.*\\\\/, '') }];\n } else if (files[0].name === undefined && files[0].fileName) {\n // File normalization for Safari 4 and Firefox 3:\n $.each(files, function (index, file) {\n file.name = file.fileName;\n file.size = file.fileSize;\n });\n }\n return $.Deferred().resolve(files).promise();\n },\n\n _getFileInputFiles: function (fileInput) {\n if (!(fileInput instanceof $) || fileInput.length === 1) {\n return this._getSingleFileInputFiles(fileInput);\n }\n return $.when\n .apply($, $.map(fileInput, this._getSingleFileInputFiles))\n [this._promisePipe](function () {\n return Array.prototype.concat.apply([], arguments);\n });\n },\n\n _onChange: function (e) {\n var that = this,\n data = {\n fileInput: $(e.target),\n form: $(e.target.form)\n };\n this._getFileInputFiles(data.fileInput).always(function (files) {\n data.files = files;\n if (that.options.replaceFileInput) {\n that._replaceFileInput(data);\n }\n if (\n that._trigger(\n 'change',\n $.Event('change', { delegatedEvent: e }),\n data\n ) !== false\n ) {\n that._onAdd(e, data);\n }\n });\n },\n\n _onPaste: function (e) {\n var items =\n e.originalEvent &&\n e.originalEvent.clipboardData &&\n e.originalEvent.clipboardData.items,\n data = { files: [] };\n if (items && items.length) {\n $.each(items, function (index, item) {\n var file = item.getAsFile && item.getAsFile();\n if (file) {\n data.files.push(file);\n }\n });\n if (\n this._trigger(\n 'paste',\n $.Event('paste', { delegatedEvent: e }),\n data\n ) !== false\n ) {\n this._onAdd(e, data);\n }\n }\n },\n\n _onDrop: function (e) {\n e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;\n var that = this,\n dataTransfer = e.dataTransfer,\n data = {};\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n e.preventDefault();\n this._getDroppedFiles(dataTransfer).always(function (files) {\n data.files = files;\n if (\n that._trigger(\n 'drop',\n $.Event('drop', { delegatedEvent: e }),\n data\n ) !== false\n ) {\n that._onAdd(e, data);\n }\n });\n }\n },\n\n _onDragOver: getDragHandler('dragover'),\n\n _onDragEnter: getDragHandler('dragenter'),\n\n _onDragLeave: getDragHandler('dragleave'),\n\n _initEventHandlers: function () {\n if (this._isXHRUpload(this.options)) {\n this._on(this.options.dropZone, {\n dragover: this._onDragOver,\n drop: this._onDrop,\n // event.preventDefault() on dragenter is required for IE10+:\n dragenter: this._onDragEnter,\n // dragleave is not required, but added for completeness:\n dragleave: this._onDragLeave\n });\n this._on(this.options.pasteZone, {\n paste: this._onPaste\n });\n }\n if ($.support.fileInput) {\n this._on(this.options.fileInput, {\n change: this._onChange\n });\n }\n },\n\n _destroyEventHandlers: function () {\n this._off(this.options.dropZone, 'dragenter dragleave dragover drop');\n this._off(this.options.pasteZone, 'paste');\n this._off(this.options.fileInput, 'change');\n },\n\n _destroy: function () {\n this._destroyEventHandlers();\n },\n\n _setOption: function (key, value) {\n var reinit = $.inArray(key, this._specialOptions) !== -1;\n if (reinit) {\n this._destroyEventHandlers();\n }\n this._super(key, value);\n if (reinit) {\n this._initSpecialOptions();\n this._initEventHandlers();\n }\n },\n\n _initSpecialOptions: function () {\n var options = this.options;\n if (options.fileInput === undefined) {\n options.fileInput = this.element.is('input[type=\"file\"]')\n ? this.element\n : this.element.find('input[type=\"file\"]');\n } else if (!(options.fileInput instanceof $)) {\n options.fileInput = $(options.fileInput);\n }\n if (!(options.dropZone instanceof $)) {\n options.dropZone = $(options.dropZone);\n }\n if (!(options.pasteZone instanceof $)) {\n options.pasteZone = $(options.pasteZone);\n }\n },\n\n _getRegExp: function (str) {\n var parts = str.split('/'),\n modifiers = parts.pop();\n parts.shift();\n return new RegExp(parts.join('/'), modifiers);\n },\n\n _isRegExpOption: function (key, value) {\n return (\n key !== 'url' &&\n $.type(value) === 'string' &&\n /^\\/.*\\/[igm]{0,3}$/.test(value)\n );\n },\n\n _initDataAttributes: function () {\n var that = this,\n options = this.options,\n data = this.element.data();\n // Initialize options set via HTML5 data-attributes:\n $.each(this.element[0].attributes, function (index, attr) {\n var key = attr.name.toLowerCase(),\n value;\n if (/^data-/.test(key)) {\n // Convert hyphen-ated key to camelCase:\n key = key.slice(5).replace(/-[a-z]/g, function (str) {\n return str.charAt(1).toUpperCase();\n });\n value = data[key];\n if (that._isRegExpOption(key, value)) {\n value = that._getRegExp(value);\n }\n options[key] = value;\n }\n });\n },\n\n _create: function () {\n this._initDataAttributes();\n this._initSpecialOptions();\n this._slots = [];\n this._sequence = this._getXHRPromise(true);\n this._sending = this._active = 0;\n this._initProgressObject(this);\n this._initEventHandlers();\n },\n\n // This method is exposed to the widget API and allows to query\n // the number of active uploads:\n active: function () {\n return this._active;\n },\n\n // This method is exposed to the widget API and allows to query\n // the widget upload progress.\n // It returns an object with loaded, total and bitrate properties\n // for the running uploads:\n progress: function () {\n return this._progress;\n },\n\n // This method is exposed to the widget API and allows adding files\n // using the fileupload API. The data parameter accepts an object which\n // must have a files property and can contain additional options:\n // .fileupload('add', {files: filesList});\n add: function (data) {\n var that = this;\n if (!data || this.options.disabled) {\n return;\n }\n if (data.fileInput && !data.files) {\n this._getFileInputFiles(data.fileInput).always(function (files) {\n data.files = files;\n that._onAdd(null, data);\n });\n } else {\n data.files = $.makeArray(data.files);\n this._onAdd(null, data);\n }\n },\n\n // This method is exposed to the widget API and allows sending files\n // using the fileupload API. The data parameter accepts an object which\n // must have a files or fileInput property and can contain additional options:\n // .fileupload('send', {files: filesList});\n // The method returns a Promise object for the file upload call.\n send: function (data) {\n if (data && !this.options.disabled) {\n if (data.fileInput && !data.files) {\n var that = this,\n dfd = $.Deferred(),\n promise = dfd.promise(),\n jqXHR,\n aborted;\n promise.abort = function () {\n aborted = true;\n if (jqXHR) {\n return jqXHR.abort();\n }\n dfd.reject(null, 'abort', 'abort');\n return promise;\n };\n this._getFileInputFiles(data.fileInput).always(function (files) {\n if (aborted) {\n return;\n }\n if (!files.length) {\n dfd.reject();\n return;\n }\n data.files = files;\n jqXHR = that._onSend(null, data);\n jqXHR.then(\n function (result, textStatus, jqXHR) {\n dfd.resolve(result, textStatus, jqXHR);\n },\n function (jqXHR, textStatus, errorThrown) {\n dfd.reject(jqXHR, textStatus, errorThrown);\n }\n );\n });\n return this._enhancePromise(promise);\n }\n data.files = $.makeArray(data.files);\n if (data.files.length) {\n return this._onSend(null, data);\n }\n }\n return this._getXHRPromise(false, data && data.context);\n }\n });\n});\n","/*! jQuery UI - v1.12.1+0b7246b6eeadfa9e2696e22f3230f6452f8129dc - 2020-02-20\n * http://jqueryui.com\n * Includes: widget.js\n * Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n/* global define, require */\n/* eslint-disable no-param-reassign, new-cap, jsdoc/require-jsdoc */\n\n(function (factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS\n factory(require('jquery'));\n } else {\n // Browser globals\n factory(window.jQuery);\n }\n})(function ($) {\n ('use strict');\n\n $.ui = $.ui || {};\n\n $.ui.version = '1.12.1';\n\n /*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n //>>label: Widget\n //>>group: Core\n //>>description: Provides a factory for creating stateful widgets with a common API.\n //>>docs: http://api.jqueryui.com/jQuery.widget/\n //>>demos: http://jqueryui.com/widget/\n\n // Support: jQuery 1.9.x or older\n // $.expr[ \":\" ] is deprecated.\n if (!$.expr.pseudos) {\n $.expr.pseudos = $.expr[':'];\n }\n\n // Support: jQuery 1.11.x or older\n // $.unique has been renamed to $.uniqueSort\n if (!$.uniqueSort) {\n $.uniqueSort = $.unique;\n }\n\n var widgetUuid = 0;\n var widgetHasOwnProperty = Array.prototype.hasOwnProperty;\n var widgetSlice = Array.prototype.slice;\n\n $.cleanData = (function (orig) {\n return function (elems) {\n var events, elem, i;\n // eslint-disable-next-line eqeqeq\n for (i = 0; (elem = elems[i]) != null; i++) {\n // Only trigger remove when necessary to save time\n events = $._data(elem, 'events');\n if (events && events.remove) {\n $(elem).triggerHandler('remove');\n }\n }\n orig(elems);\n };\n })($.cleanData);\n\n $.widget = function (name, base, prototype) {\n var existingConstructor, constructor, basePrototype;\n\n // ProxiedPrototype allows the provided prototype to remain unmodified\n // so that it can be used as a mixin for multiple widgets (#8876)\n var proxiedPrototype = {};\n\n var namespace = name.split('.')[0];\n name = name.split('.')[1];\n var fullName = namespace + '-' + name;\n\n if (!prototype) {\n prototype = base;\n base = $.Widget;\n }\n\n if ($.isArray(prototype)) {\n prototype = $.extend.apply(null, [{}].concat(prototype));\n }\n\n // Create selector for plugin\n $.expr.pseudos[fullName.toLowerCase()] = function (elem) {\n return !!$.data(elem, fullName);\n };\n\n $[namespace] = $[namespace] || {};\n existingConstructor = $[namespace][name];\n constructor = $[namespace][name] = function (options, element) {\n // Allow instantiation without \"new\" keyword\n if (!this._createWidget) {\n return new constructor(options, element);\n }\n\n // Allow instantiation without initializing for simple inheritance\n // must use \"new\" keyword (the code above always passes args)\n if (arguments.length) {\n this._createWidget(options, element);\n }\n };\n\n // Extend with the existing constructor to carry over any static properties\n $.extend(constructor, existingConstructor, {\n version: prototype.version,\n\n // Copy the object used to create the prototype in case we need to\n // redefine the widget later\n _proto: $.extend({}, prototype),\n\n // Track widgets that inherit from this widget in case this widget is\n // redefined after a widget inherits from it\n _childConstructors: []\n });\n\n basePrototype = new base();\n\n // We need to make the options hash a property directly on the new instance\n // otherwise we'll modify the options hash on the prototype that we're\n // inheriting from\n basePrototype.options = $.widget.extend({}, basePrototype.options);\n $.each(prototype, function (prop, value) {\n if (!$.isFunction(value)) {\n proxiedPrototype[prop] = value;\n return;\n }\n proxiedPrototype[prop] = (function () {\n function _super() {\n return base.prototype[prop].apply(this, arguments);\n }\n\n function _superApply(args) {\n return base.prototype[prop].apply(this, args);\n }\n\n return function () {\n var __super = this._super;\n var __superApply = this._superApply;\n var returnValue;\n\n this._super = _super;\n this._superApply = _superApply;\n\n returnValue = value.apply(this, arguments);\n\n this._super = __super;\n this._superApply = __superApply;\n\n return returnValue;\n };\n })();\n });\n constructor.prototype = $.widget.extend(\n basePrototype,\n {\n // TODO: remove support for widgetEventPrefix\n // always use the name + a colon as the prefix, e.g., draggable:start\n // don't prefix for widgets that aren't DOM-based\n widgetEventPrefix: existingConstructor\n ? basePrototype.widgetEventPrefix || name\n : name\n },\n proxiedPrototype,\n {\n constructor: constructor,\n namespace: namespace,\n widgetName: name,\n widgetFullName: fullName\n }\n );\n\n // If this widget is being redefined then we need to find all widgets that\n // are inheriting from it and redefine all of them so that they inherit from\n // the new version of this widget. We're essentially trying to replace one\n // level in the prototype chain.\n if (existingConstructor) {\n $.each(existingConstructor._childConstructors, function (i, child) {\n var childPrototype = child.prototype;\n\n // Redefine the child widget using the same prototype that was\n // originally used, but inherit from the new version of the base\n $.widget(\n childPrototype.namespace + '.' + childPrototype.widgetName,\n constructor,\n child._proto\n );\n });\n\n // Remove the list of existing child constructors from the old constructor\n // so the old child constructors can be garbage collected\n delete existingConstructor._childConstructors;\n } else {\n base._childConstructors.push(constructor);\n }\n\n $.widget.bridge(name, constructor);\n\n return constructor;\n };\n\n $.widget.extend = function (target) {\n var input = widgetSlice.call(arguments, 1);\n var inputIndex = 0;\n var inputLength = input.length;\n var key;\n var value;\n\n for (; inputIndex < inputLength; inputIndex++) {\n for (key in input[inputIndex]) {\n value = input[inputIndex][key];\n if (\n widgetHasOwnProperty.call(input[inputIndex], key) &&\n value !== undefined\n ) {\n // Clone objects\n if ($.isPlainObject(value)) {\n target[key] = $.isPlainObject(target[key])\n ? $.widget.extend({}, target[key], value)\n : // Don't extend strings, arrays, etc. with objects\n $.widget.extend({}, value);\n\n // Copy everything else by reference\n } else {\n target[key] = value;\n }\n }\n }\n }\n return target;\n };\n\n $.widget.bridge = function (name, object) {\n var fullName = object.prototype.widgetFullName || name;\n $.fn[name] = function (options) {\n var isMethodCall = typeof options === 'string';\n var args = widgetSlice.call(arguments, 1);\n var returnValue = this;\n\n if (isMethodCall) {\n // If this is an empty collection, we need to have the instance method\n // return undefined instead of the jQuery instance\n if (!this.length && options === 'instance') {\n returnValue = undefined;\n } else {\n this.each(function () {\n var methodValue;\n var instance = $.data(this, fullName);\n\n if (options === 'instance') {\n returnValue = instance;\n return false;\n }\n\n if (!instance) {\n return $.error(\n 'cannot call methods on ' +\n name +\n ' prior to initialization; ' +\n \"attempted to call method '\" +\n options +\n \"'\"\n );\n }\n\n if (!$.isFunction(instance[options]) || options.charAt(0) === '_') {\n return $.error(\n \"no such method '\" +\n options +\n \"' for \" +\n name +\n ' widget instance'\n );\n }\n\n methodValue = instance[options].apply(instance, args);\n\n if (methodValue !== instance && methodValue !== undefined) {\n returnValue =\n methodValue && methodValue.jquery\n ? returnValue.pushStack(methodValue.get())\n : methodValue;\n return false;\n }\n });\n }\n } else {\n // Allow multiple hashes to be passed on init\n if (args.length) {\n options = $.widget.extend.apply(null, [options].concat(args));\n }\n\n this.each(function () {\n var instance = $.data(this, fullName);\n if (instance) {\n instance.option(options || {});\n if (instance._init) {\n instance._init();\n }\n } else {\n $.data(this, fullName, new object(options, this));\n }\n });\n }\n\n return returnValue;\n };\n };\n\n $.Widget = function (/* options, element */) {};\n $.Widget._childConstructors = [];\n\n $.Widget.prototype = {\n widgetName: 'widget',\n widgetEventPrefix: '',\n defaultElement: '
',\n\n options: {\n classes: {},\n disabled: false,\n\n // Callbacks\n create: null\n },\n\n _createWidget: function (options, element) {\n element = $(element || this.defaultElement || this)[0];\n this.element = $(element);\n this.uuid = widgetUuid++;\n this.eventNamespace = '.' + this.widgetName + this.uuid;\n\n this.bindings = $();\n this.hoverable = $();\n this.focusable = $();\n this.classesElementLookup = {};\n\n if (element !== this) {\n $.data(element, this.widgetFullName, this);\n this._on(true, this.element, {\n remove: function (event) {\n if (event.target === element) {\n this.destroy();\n }\n }\n });\n this.document = $(\n element.style\n ? // Element within the document\n element.ownerDocument\n : // Element is window or document\n element.document || element\n );\n this.window = $(\n this.document[0].defaultView || this.document[0].parentWindow\n );\n }\n\n this.options = $.widget.extend(\n {},\n this.options,\n this._getCreateOptions(),\n options\n );\n\n this._create();\n\n if (this.options.disabled) {\n this._setOptionDisabled(this.options.disabled);\n }\n\n this._trigger('create', null, this._getCreateEventData());\n this._init();\n },\n\n _getCreateOptions: function () {\n return {};\n },\n\n _getCreateEventData: $.noop,\n\n _create: $.noop,\n\n _init: $.noop,\n\n destroy: function () {\n var that = this;\n\n this._destroy();\n $.each(this.classesElementLookup, function (key, value) {\n that._removeClass(value, key);\n });\n\n // We can probably remove the unbind calls in 2.0\n // all event bindings should go through this._on()\n this.element.off(this.eventNamespace).removeData(this.widgetFullName);\n this.widget().off(this.eventNamespace).removeAttr('aria-disabled');\n\n // Clean up events and states\n this.bindings.off(this.eventNamespace);\n },\n\n _destroy: $.noop,\n\n widget: function () {\n return this.element;\n },\n\n option: function (key, value) {\n var options = key;\n var parts;\n var curOption;\n var i;\n\n if (arguments.length === 0) {\n // Don't return a reference to the internal hash\n return $.widget.extend({}, this.options);\n }\n\n if (typeof key === 'string') {\n // Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n options = {};\n parts = key.split('.');\n key = parts.shift();\n if (parts.length) {\n curOption = options[key] = $.widget.extend({}, this.options[key]);\n for (i = 0; i < parts.length - 1; i++) {\n curOption[parts[i]] = curOption[parts[i]] || {};\n curOption = curOption[parts[i]];\n }\n key = parts.pop();\n if (arguments.length === 1) {\n return curOption[key] === undefined ? null : curOption[key];\n }\n curOption[key] = value;\n } else {\n if (arguments.length === 1) {\n return this.options[key] === undefined ? null : this.options[key];\n }\n options[key] = value;\n }\n }\n\n this._setOptions(options);\n\n return this;\n },\n\n _setOptions: function (options) {\n var key;\n\n for (key in options) {\n this._setOption(key, options[key]);\n }\n\n return this;\n },\n\n _setOption: function (key, value) {\n if (key === 'classes') {\n this._setOptionClasses(value);\n }\n\n this.options[key] = value;\n\n if (key === 'disabled') {\n this._setOptionDisabled(value);\n }\n\n return this;\n },\n\n _setOptionClasses: function (value) {\n var classKey, elements, currentElements;\n\n for (classKey in value) {\n currentElements = this.classesElementLookup[classKey];\n if (\n value[classKey] === this.options.classes[classKey] ||\n !currentElements ||\n !currentElements.length\n ) {\n continue;\n }\n\n // We are doing this to create a new jQuery object because the _removeClass() call\n // on the next line is going to destroy the reference to the current elements being\n // tracked. We need to save a copy of this collection so that we can add the new classes\n // below.\n elements = $(currentElements.get());\n this._removeClass(currentElements, classKey);\n\n // We don't use _addClass() here, because that uses this.options.classes\n // for generating the string of classes. We want to use the value passed in from\n // _setOption(), this is the new value of the classes option which was passed to\n // _setOption(). We pass this value directly to _classes().\n elements.addClass(\n this._classes({\n element: elements,\n keys: classKey,\n classes: value,\n add: true\n })\n );\n }\n },\n\n _setOptionDisabled: function (value) {\n this._toggleClass(\n this.widget(),\n this.widgetFullName + '-disabled',\n null,\n !!value\n );\n\n // If the widget is becoming disabled, then nothing is interactive\n if (value) {\n this._removeClass(this.hoverable, null, 'ui-state-hover');\n this._removeClass(this.focusable, null, 'ui-state-focus');\n }\n },\n\n enable: function () {\n return this._setOptions({ disabled: false });\n },\n\n disable: function () {\n return this._setOptions({ disabled: true });\n },\n\n _classes: function (options) {\n var full = [];\n var that = this;\n\n options = $.extend(\n {\n element: this.element,\n classes: this.options.classes || {}\n },\n options\n );\n\n function bindRemoveEvent() {\n options.element.each(function (_, element) {\n var isTracked = $.map(that.classesElementLookup, function (elements) {\n return elements;\n }).some(function (elements) {\n return elements.is(element);\n });\n\n if (!isTracked) {\n that._on($(element), {\n remove: '_untrackClassesElement'\n });\n }\n });\n }\n\n function processClassString(classes, checkOption) {\n var current, i;\n for (i = 0; i < classes.length; i++) {\n current = that.classesElementLookup[classes[i]] || $();\n if (options.add) {\n bindRemoveEvent();\n current = $(\n $.uniqueSort(current.get().concat(options.element.get()))\n );\n } else {\n current = $(current.not(options.element).get());\n }\n that.classesElementLookup[classes[i]] = current;\n full.push(classes[i]);\n if (checkOption && options.classes[classes[i]]) {\n full.push(options.classes[classes[i]]);\n }\n }\n }\n\n if (options.keys) {\n processClassString(options.keys.match(/\\S+/g) || [], true);\n }\n if (options.extra) {\n processClassString(options.extra.match(/\\S+/g) || []);\n }\n\n return full.join(' ');\n },\n\n _untrackClassesElement: function (event) {\n var that = this;\n $.each(that.classesElementLookup, function (key, value) {\n if ($.inArray(event.target, value) !== -1) {\n that.classesElementLookup[key] = $(value.not(event.target).get());\n }\n });\n\n this._off($(event.target));\n },\n\n _removeClass: function (element, keys, extra) {\n return this._toggleClass(element, keys, extra, false);\n },\n\n _addClass: function (element, keys, extra) {\n return this._toggleClass(element, keys, extra, true);\n },\n\n _toggleClass: function (element, keys, extra, add) {\n add = typeof add === 'boolean' ? add : extra;\n var shift = typeof element === 'string' || element === null,\n options = {\n extra: shift ? keys : extra,\n keys: shift ? element : keys,\n element: shift ? this.element : element,\n add: add\n };\n options.element.toggleClass(this._classes(options), add);\n return this;\n },\n\n _on: function (suppressDisabledCheck, element, handlers) {\n var delegateElement;\n var instance = this;\n\n // No suppressDisabledCheck flag, shuffle arguments\n if (typeof suppressDisabledCheck !== 'boolean') {\n handlers = element;\n element = suppressDisabledCheck;\n suppressDisabledCheck = false;\n }\n\n // No element argument, shuffle and use this.element\n if (!handlers) {\n handlers = element;\n element = this.element;\n delegateElement = this.widget();\n } else {\n element = delegateElement = $(element);\n this.bindings = this.bindings.add(element);\n }\n\n $.each(handlers, function (event, handler) {\n function handlerProxy() {\n // Allow widgets to customize the disabled handling\n // - disabled as an array instead of boolean\n // - disabled class as method for disabling individual parts\n if (\n !suppressDisabledCheck &&\n (instance.options.disabled === true ||\n $(this).hasClass('ui-state-disabled'))\n ) {\n return;\n }\n return (\n typeof handler === 'string' ? instance[handler] : handler\n ).apply(instance, arguments);\n }\n\n // Copy the guid so direct unbinding works\n if (typeof handler !== 'string') {\n handlerProxy.guid = handler.guid =\n handler.guid || handlerProxy.guid || $.guid++;\n }\n\n var match = event.match(/^([\\w:-]*)\\s*(.*)$/);\n var eventName = match[1] + instance.eventNamespace;\n var selector = match[2];\n\n if (selector) {\n delegateElement.on(eventName, selector, handlerProxy);\n } else {\n element.on(eventName, handlerProxy);\n }\n });\n },\n\n _off: function (element, eventName) {\n eventName =\n (eventName || '').split(' ').join(this.eventNamespace + ' ') +\n this.eventNamespace;\n element.off(eventName);\n\n // Clear the stack to avoid memory leaks (#10056)\n this.bindings = $(this.bindings.not(element).get());\n this.focusable = $(this.focusable.not(element).get());\n this.hoverable = $(this.hoverable.not(element).get());\n },\n\n _delay: function (handler, delay) {\n var instance = this;\n function handlerProxy() {\n return (\n typeof handler === 'string' ? instance[handler] : handler\n ).apply(instance, arguments);\n }\n return setTimeout(handlerProxy, delay || 0);\n },\n\n _hoverable: function (element) {\n this.hoverable = this.hoverable.add(element);\n this._on(element, {\n mouseenter: function (event) {\n this._addClass($(event.currentTarget), null, 'ui-state-hover');\n },\n mouseleave: function (event) {\n this._removeClass($(event.currentTarget), null, 'ui-state-hover');\n }\n });\n },\n\n _focusable: function (element) {\n this.focusable = this.focusable.add(element);\n this._on(element, {\n focusin: function (event) {\n this._addClass($(event.currentTarget), null, 'ui-state-focus');\n },\n focusout: function (event) {\n this._removeClass($(event.currentTarget), null, 'ui-state-focus');\n }\n });\n },\n\n _trigger: function (type, event, data) {\n var prop, orig;\n var callback = this.options[type];\n\n data = data || {};\n event = $.Event(event);\n event.type = (\n type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type\n ).toLowerCase();\n\n // The original event may come from any element\n // so we need to reset the target on the new event\n event.target = this.element[0];\n\n // Copy original event properties over to the new event\n orig = event.originalEvent;\n if (orig) {\n for (prop in orig) {\n if (!(prop in event)) {\n event[prop] = orig[prop];\n }\n }\n }\n\n this.element.trigger(event, data);\n return !(\n ($.isFunction(callback) &&\n callback.apply(this.element[0], [event].concat(data)) === false) ||\n event.isDefaultPrevented()\n );\n }\n };\n\n $.each({ show: 'fadeIn', hide: 'fadeOut' }, function (method, defaultEffect) {\n $.Widget.prototype['_' + method] = function (element, options, callback) {\n if (typeof options === 'string') {\n options = { effect: options };\n }\n\n var hasOptions;\n var effectName = !options\n ? method\n : options === true || typeof options === 'number'\n ? defaultEffect\n : options.effect || defaultEffect;\n\n options = options || {};\n if (typeof options === 'number') {\n options = { duration: options };\n }\n\n hasOptions = !$.isEmptyObject(options);\n options.complete = callback;\n\n if (options.delay) {\n element.delay(options.delay);\n }\n\n if (hasOptions && $.effects && $.effects.effect[effectName]) {\n element[method](options);\n } else if (effectName !== method && element[effectName]) {\n element[effectName](options.duration, options.easing, callback);\n } else {\n element.queue(function (next) {\n $(this)[method]();\n if (callback) {\n callback.call(element[0]);\n }\n next();\n });\n }\n };\n });\n});\n"],"names":["window","angular","TRANSITION_PROP","TRANSITIONEND_EVENT","ANIMATION_PROP","ANIMATIONEND_EVENT","noop","copy","extend","jqLite","element","forEach","isArray","isString","isObject","isUndefined","isDefined","isFunction","isElement","ELEMENT_NODE","ADD_CLASS_SUFFIX","REMOVE_CLASS_SUFFIX","NG_ANIMATE_CLASSNAME","NG_ANIMATE_CHILDREN_DATA","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","DURATION_KEY","PROPERTY_KEY","DELAY_KEY","TIMING_KEY","ANIMATION_DELAY_PROP","ANIMATION_DURATION_PROP","TRANSITION_DELAY_PROP","TRANSITION_DURATION_PROP","ngMinErr","$$minErr","assertArg","arg","name","reason","mergeClasses","a","b","join","pendClasses","classes","fix","isPrefix","className","length","split","klass","i","extractElementNode","elm","nodeType","applyAnimationClassesFactory","$$jqLite","options","addClass","$$addClass","removeClass","$$removeClass","prepareAnimationOptions","$$prepared","domOperation","$$domOperationFired","applyAnimationStyles","applyAnimationFromStyles","applyAnimationToStyles","from","css","to","mergeAnimationDetails","oldAnimation","newAnimation","target","newOptions","toAdd","toRemove","existing","ADD_CLASS","REMOVE_CLASS","flags","splitClassesToLookup","value","key","obj","val","prop","allow","resolveElementClasses","attr","preparationClasses","concatWithSpace","realDomOperation","getDomNode","blockTransitions","node","duration","applyInlineStyle","blockKeyframeAnimations","applyBlock","styleTuple","style","$$AnimateChildrenDirective","$interpolate","link","scope","attrs","ngAnimateChildren","setData","data","$observe","ANIMATE_TIMER_KEY","ONE_SECOND","DETECT_CSS_PROPERTIES","transitionDuration","transitionDelay","transitionProperty","animationDuration","animationDelay","animationIterationCount","DETECT_STAGGER_CSS_PROPERTIES","getCssDelayStyle","delay","isKeyframeAnimation","computeCssStyles","$window","properties","styles","Object","create","detectedStyles","getComputedStyle","formalStyleName","actualStyleName","maxValue","values","c","charAt","substring","parseFloat","Math","max","truthyTimingValue","getCssTransitionDurationStyle","applyOnlyDuration","createLocalCacheLookup","cache","flush","count","entry","total","get","put","registerRestorableStyles","backup","getPropertyValue","$AnimateCssProvider","$animateProvider","gcsLookup","gcsStaggerLookup","this","$get","$$AnimateRunner","$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue","applyAnimationClasses","parentCounter","gcsHashFn","extraClasses","KEY","parentNode","getAttribute","rafWaitQueue","waitUntilQuiet","callback","push","pageWidth","computeTimings","cacheKey","timings","computeCachedCssStyles","aD","tD","maxDelay","maxDuration","initialOptions","restoreStyles","enabled","closeAndReturnNoopAnimator","animationClosed","animationPaused","animationCompleted","runner","runnerHost","maxDelayTime","maxDurationTime","startTime","temporaryStyles","packageStyles","events","animations","transitions","method","event","structuralClassName","addRemoveClassName","structural","applyClassesEarly","stagger","trim","fullClassName","activeClasses","hasToStyles","keys","keyframeStyle","staggerVal","staggerClassName","computeCachedCssStaggerStyles","$$skipPreparationClasses","transitionStyle","durationStyle","itemIndex","staggerIndex","isFirst","skipBlocking","relativeDelay","delayStyle","hasTransitions","hasAnimations","hasTransitionAll","applyTransitionDuration","applyAnimationDuration","applyTransitionDelay","applyAnimationDelay","recalculateTimingStyles","blockTransition","blockKeyframeAnimation","cleanupStyles","applyBlocking","$$willAnimate","end","endFn","start","cancel","cancelFn","resume","pause","close","rejected","setProperty","removeProperty","onDone","off","onAnimationProgress","animationTimerData","timer","removeData","complete","stopPropagation","ev","originalEvent","timeStamp","$manualTimeStamp","Date","now","elapsedTime","toFixed","playPause","playAnimation","index","arr","indexOf","splice","maxStagger","triggerAnimationStart","floor","easing","easeProp","easeVal","timerTime","endTime","animationsData","setupFallbackTimer","currentTimerData","expectedEndTime","onAnimationExpired","on","$$AnimateCssDriverProvider","$$animationProvider","drivers","NG_ANIMATE_SHIM_CLASS_NAME","NG_ANIMATE_ANCHOR_CLASS_NAME","NG_OUT_ANCHOR_CLASS_NAME","NG_IN_ANCHOR_CLASS_NAME","$animateCss","$rootScope","$rootElement","$document","bodyNode","body","rootNode","rootBodyElement","contains","animationDetails","anchors","fromAnimation","prepareRegularAnimation","toAnimation","anchorAnimations","anchor","animator","outAnchor","inAnchor","clone","cloneNode","startingClasses","filterCssClasses","getClassVal","append","animatorIn","animatorOut","prepareOutAnimation","prepareInAnimation","startingAnimator","currentAnimation","done","calculateAnchorStyles","coords","getBoundingClientRect","scrollTop","scrollLeft","endingClasses","getUniqueValues","remove","prepareAnchoredAnimation","animationRunners","animation","all","status","prepareFromToAnchorAnimation","replace","filter","$$AnimateJsProvider","$injector","arguments","before","after","afterFn","beforeFn","classesToAdd","classesToRemove","matches","flagMap","animationFactory","$$registeredAnimations","lookupAnimations","toUpperCase","substr","packageAnimations","closeActiveAnimations","chain","fn","applyOptions","setHost","endAnimations","onComplete","success","cancelled","groupEventedAnimations","fnName","operations","ani","endProgressCb","resolved","onAnimationComplete","args","apply","executeAnimationFn","result","concat","runners","animateFn","reject","$$AnimateJsDriverProvider","$$animateJs","prepareAnimation","endFnFactory","NG_ANIMATE_ATTR_NAME","NG_ANIMATE_PIN_DATA","$$AnimateQueueProvider","ONE_SPACE","rules","skip","hasMatchingClasses","newClassString","currentClassString","currentClassMap","classString","map","makeTruthyCssClassMap","some","isAllowed","ruleType","previousAnimation","hasAnimationClasses","and","state","nA","nR","cA","cR","$$rAF","$$HashMap","$$animation","$templateRequest","activeAnimationsLookup","disabledElementsLookup","animationsEnabled","deregisterWatch","$watch","totalPendingRequests","isEmpty","$$postDigest","callbackRegistry","classNameFilter","isAnimatableClassName","test","normalizeAnimationDetails","Node","prototype","compareDocumentPosition","filterFromRegistry","list","matchContainer","matchCallback","containerNode","cleanupEventListeners","phase","$animate","container","entries","eventType","pin","parentElement","parent","stripCommentsFromElement","runInNextPostDigestOrNow","postDigestCalled","isStructural","documentHidden","hidden","skipAnimations","existingAnimation","hasExistingAnimation","animateChildren","bodyElement","bodyElementDetected","isMatchingElement","nodeName","rootElementDetected","parentAnimationDetected","elementDisabled","parentHost","details","parentElementDisabled","areAnimationsAllowed","notifyProgress","children","querySelectorAll","child","parseInt","closeChildAnimations","applyGeneratedPreparationClasses","isValidAnimation","clearElementAnimationState","counter","markElementAnimationState","animationCancelled","realRunner","callbacks","targetNode","targetParentNode","call","findCallbacks","progress","clearGeneratedClasses","queueAnimation","bool","argCount","recordExists","removeAttribute","nodeOrElmA","nodeOrElmB","setAttribute","oldValue","newValue","$$AnimationProvider","NG_ANIMATE_REF_ATTR","RUNNER_STORAGE_KEY","getRunner","animationQueue","setRunner","prepareClassName","tempClasses","beforeStart","handleDestroyedElement","groupedAnimations","preparedAnimations","refLookup","enterOrMove","anchorNodes","SELECTOR","items","hasAttribute","getAnchorNodes","direction","animationID","usedIndicesLookup","anchorGroups","lookupKey","toString","group","cssClassesIntersection","indexKey","groupAnimations","toBeSortedAnimations","animationEntry","domNode","startAnimationFn","closeFn","operation","driverName","has","driver","factory","invokeFirstDriver","animationRunner","newRunner","update","updateAnimationRunners","tree","lookup","processNode","queue","remainingLevelEntries","nextLevelEntries","row","childEntry","flatten","processed","parentEntry","elementNode","sortAnimations","aa","j","removeRunner","module","directive","restrict","transclude","terminal","priority","$element","ctrl","$transclude","previousElement","previousScope","$watchCollection","ngAnimateSwap","leave","$destroy","$new","enter","scheduler","tasks","nextTick","shift","provider","exports","__WEBPACK_EXTERNAL_MODULE_5__","modules","installedModules","moduleId","id","loaded","m","p","SpinJSSpinner_1","UsSpinnerService_1","AngularSpinner_1","UsSpinnerConfig_1","angularSpinner","UsSpinnerConfig","constant","SpinJSSpinner","service","UsSpinnerService","usSpinner","Spinner","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","useCssAnimations","sheet","prefixes","createEl","tag","n","el","document","createElement","ins","appendChild","addAnimation","alpha","trail","lines","z","prefix","toLowerCase","pre","insertRule","cssRules","vendor","pp","s","undefined","slice","merge","def","getColor","color","idx","defaults","width","radius","scale","corners","opacity","rotate","speed","fps","zIndex","top","left","shadow","hwaccel","position","o","opts","spin","stop","self","insertBefore","firstChild","f","ostep","astep","anim","timeout","setTimeout","clearTimeout","removeChild","seg","fill","height","background","boxShadow","transformOrigin","transform","borderRadius","childNodes","type","getElementsByTagName","styleSheet","probe","behavior","adj","vml","addRule","r","grp","coordsize","coordorigin","margin","g","dx","rotation","arcsize","initVML","$broadcast","$inject","usSpinnerConfig","stopSpinner","spinner","spinnerKey","startActive","$eval","spinnerStartActive","config","spinnerTheme","themes","spinnerOn","$on","setDefaults","setTheme","root","previous","Chart","context","canvas","ctx","computeDimension","dimension","defaultView","aspectRatio","helpers","retinaScale","global","animationSteps","animationEasing","showScale","scaleOverride","scaleSteps","scaleStepWidth","scaleStartValue","scaleLineColor","scaleLineWidth","scaleShowLabels","scaleLabel","scaleIntegersOnly","scaleBeginAtZero","scaleFontFamily","scaleFontSize","scaleFontStyle","scaleFontColor","responsive","maintainAspectRatio","showTooltips","customTooltips","tooltipEvents","tooltipFillColor","tooltipFontFamily","tooltipFontSize","tooltipFontStyle","tooltipFontColor","tooltipTitleFontFamily","tooltipTitleFontSize","tooltipTitleFontStyle","tooltipTitleFontColor","tooltipYPadding","tooltipXPadding","tooltipCaretSize","tooltipCornerRadius","tooltipXOffset","tooltipTemplate","multiTooltipTemplate","multiTooltipKeyBackground","types","each","loopable","additionalArgs","Array","item","objClone","hasOwnProperty","base","extensionObject","master","unshift","arrayToSearch","inherits","where","collection","filterCallback","filtered","findNextWhere","startIndex","currentItem","findPreviousWhere","extensions","ChartElement","constructor","Surrogate","__super__","uid","warn","str","console","amd","isNumber","isNaN","isFinite","array","min","getDecimalPlaces","cap","valueToCap","minValue","num","toRadians","radians","degrees","PI","aliasPixel","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","x","distanceFromYCenter","y","radialDistanceFromCenter","sqrt","angle","atan2","distance","pixelWidth","calculateOrderOfMagnitude","splineCurve","FirstPoint","MiddlePoint","AfterPoint","t","d01","pow","d12","fa","fb","inner","outer","log","LN10","template","calculateScaleRange","valuesArray","drawingSize","textSize","startFromZero","integersOnly","maxSteps","skipFitting","valueRange","abs","rangeOrderOfMagnitude","graphMax","ceil","graphMin","graphRange","stepValue","numberOfSteps","round","steps","templateString","valuesObject","Function","easingEffects","generateLabels","labelsArray","labelTemplateString","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","sin","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","asin","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","requestAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","cancelAnimFrame","cancelAnimationFrame","webkitCancelAnimationFrame","mozCancelAnimationFrame","oCancelAnimationFrame","msCancelAnimationFrame","addEvent","animationLoop","totalSteps","easingString","onProgress","chartInstance","currentStep","easingFunction","animationFrame","stepDecimal","easeDecimal","getRelativePosition","evt","mouseX","mouseY","e","boundingRect","currentTarget","srcElement","touches","clientX","clientY","addEventListener","attachEvent","removeEvent","handler","removeEventListener","detachEvent","unbindEvents","bindEvents","arrayOfEvents","eventName","chart","getMaximumWidth","clientWidth","getMaximumHeight","clientHeight","getMaximumSize","devicePixelRatio","clear","clearRect","fontString","pixelSize","fontStyle","fontFamily","longestText","font","arrayOfStrings","longest","string","textWidth","measureText","drawRoundedRectangle","beginPath","moveTo","lineTo","quadraticCurveTo","closePath","instances","Type","resize","initialize","newWidth","newHeight","reflow","render","draw","generateLegend","legendTemplate","destroy","showTooltip","ChartElements","forceRedraw","activeElements","Elements","changed","datasets","dataArray","dataIndex","points","bars","segments","tooltipLabels","tooltipColors","medianPosition","dataCollection","xMax","yMax","xMin","yMin","xPositions","yPositions","dataset","hasValue","_saved","fillColor","stroke","strokeColor","MultiTooltip","xPadding","yPadding","xOffset","textColor","fontSize","titleTextColor","titleFontFamily","titleFontStyle","titleFontSize","cornerRadius","labels","legendColors","legendColorBackground","title","label","custom","Element","tooltipPosition","Tooltip","caretHeight","text","toBase64Image","toDataURL","ChartType","chartName","baseDefaults","configuration","save","restore","props","newProps","transition","ease","Point","display","inRange","chartX","chartY","hitDetectionRange","hitDetectionRadius","arc","strokeStyle","lineWidth","strokeWidth","fillStyle","Arc","pointRelativePosition","betweenAngles","startAngle","endAngle","withinRadius","innerRadius","outerRadius","centreAngle","rangeFromCentre","animationPercent","lineJoin","showStroke","Rectangle","halfWidth","leftX","rightX","halfStroke","xAlign","yAlign","caretPadding","tooltipWidth","tooltipRectHeight","tooltipHeight","tooltipX","tooltipY","textAlign","textBaseline","fillText","titleFont","titleWidth","labelWidth","longestTextWidth","halfHeight","getLineHeight","baseLineHeight","afterTitleIndex","fillRect","Scale","fit","buildYLabels","yLabels","stepDecimalPlaces","yLabelWidth","showLabels","addXLabel","xLabels","valuesCount","removeXLabel","startPoint","endPoint","padding","cachedYLabelWidth","cachedHeight","calculateYRange","calculateXLabelRotation","firstRotated","firstWidth","lastWidth","xScalePaddingRight","xScalePaddingLeft","xLabelRotation","cosRotation","originalLabelWidth","xLabelWidth","xGridWidth","calculateX","drawingArea","calculateY","scalingFactor","valueWidth","valueOffset","offsetGridLines","yLabelGap","xStart","labelString","yLabelCenter","linePositionY","drawHorizontalLine","showHorizontalLines","gridLineWidth","gridLineColor","lineColor","xPos","linePos","isRotated","drawVerticalLine","showVerticalLines","translate","RadialScale","size","backdropPaddingY","calculateCenterOffset","lineArc","setScaleSize","getCircumference","pointPosition","halfTextWidth","furthestRightIndex","furthestRightAngle","furthestLeftIndex","furthestLeftAngle","xProtrusionLeft","xProtrusionRight","radiusReductionRight","radiusReductionLeft","largestPossibleRadius","pointLabelFontSize","furthestRight","furthestLeft","pointLabelFontStyle","pointLabelFontFamily","getPointPosition","getIndexAngle","setCenterPoint","leftMovement","rightMovement","maxRight","maxLeft","xCenter","yCenter","distanceFromCenter","thisAngle","yCenterOffset","yHeight","showLabelBackdrop","backdropColor","backdropPaddingX","fontColor","angleLineWidth","angleLineColor","outerPosition","pointLabelPosition","pointLabelFontColor","labelsCount","halfLabelsCount","quarterLabelsCount","upperHalf","exactQuarter","instance","noConflict","scaleShowGridLines","scaleGridLineColor","scaleGridLineWidth","scaleShowHorizontalLines","scaleShowVerticalLines","barShowStroke","barStrokeWidth","barValueSpacing","barDatasetSpacing","ScaleClass","calculateBarX","datasetCount","datasetIndex","barIndex","xWidth","calculateBaseWidth","xAbsolute","barWidth","calculateBarWidth","activeBars","getBarsAtEvent","eachBars","bar","activeBar","highlightFill","highlightStroke","BarClass","datasetObject","dataPoint","datasetLabel","buildScale","activeElement","barsArray","eventPosition","datasetIterator","scaleOptions","beginAtZero","currentHeight","updatedRanges","addData","newScaleProps","easingDecimal","defaultConfig","segmentShowStroke","segmentStrokeColor","segmentStrokeWidth","percentageInnerCutout","animateRotate","animateScale","SegmentArc","activeSegments","getSegmentsAtEvent","segment","activeSegment","highlightColor","calculateTotal","datapoint","segmentsArray","location","atIndex","silent","highlight","circumference","calculateCircumference","indexToDelete","animDecimal","Doughnut","bezierCurve","bezierCurveTension","pointDot","pointDotRadius","pointDotStrokeWidth","pointHitDetectionRadius","datasetStroke","datasetStrokeWidth","datasetFill","PointClass","activePoints","getPointsAtEvent","eachPoints","point","activePoint","pointColor","pointStrokeColor","pointHighlightFill","pointHighlightStroke","pointsArray","previousPoint","pointsWithValues","tension","controlPoints","nextPoint","bezierCurveTo","scaleShowLabelBackdrop","scaleBackdropColor","scaleBackdropPaddingY","scaleBackdropPaddingX","scaleShowLine","updateScaleRange","datapoints","scaleSizes","angleShowLineOut","activePointsCollection","mousePosition","fromCenter","anglePerIndex","pointIndex","totalDataArray","$","getDragHandler","isDragOver","dataTransfer","inArray","_trigger","Event","delegatedEvent","preventDefault","dropEffect","support","fileInput","RegExp","navigator","userAgent","xhrFileUpload","ProgressEvent","FileReader","xhrFormDataFileUpload","FormData","blobSlice","Blob","webkitSlice","mozSlice","widget","dropZone","pasteZone","replaceFileInput","paramName","singleFileUploads","limitMultiFileUploads","limitMultiFileUploadSize","limitMultiFileUploadSizeOverhead","sequentialUploads","limitConcurrentUploads","forceIframeTransport","redirect","redirectParamName","postMessage","multipart","maxChunkSize","uploadedBytes","recalculateProgress","progressInterval","bitrateInterval","autoUpload","uniqueFilenames","messages","i18n","message","formData","form","serializeArray","add","isDefaultPrevented","fileupload","process","submit","processData","contentType","_promisePipe","parts","jquery","Number","_specialOptions","_blobSlice","_BitrateTimer","timestamp","getTime","bitrate","getBitrate","interval","timeDiff","_isXHRUpload","_getFormData","_getTotal","files","file","_initProgressObject","_progress","_initResponseObject","_response","_onProgress","lengthComputable","_time","chunkSize","_bitrateTimer","_initProgressListener","that","xhr","ajaxSettings","upload","oe","_deinitProgressListener","_isInstanceOf","_getUniqueFilename","String","_","p1","p2","_initXHRData","headers","contentRange","blob","encodeURI","uploadName","field","fileName","_initIframeSettings","targetHost","url","dataType","host","_initDataSettings","_chunkedUpload","_getParamName","input","_initFormSettings","href","formAcceptCharset","_getAJAXSettings","_getDeferredState","deferred","isResolved","isRejected","_enhancePromise","promise","error","fail","always","_getXHRPromise","resolveOrReject","dfd","Deferred","resolveWith","rejectWith","abort","_addConvenienceMethods","getPromise","resolveFunc","rejectFunc","_processQueue","errorThrown","jqXHR","_onSend","processing","response","_getUploadedBytes","range","getResponseHeader","upperBytesPos","testOnly","fs","ub","mcs","currentLoaded","ajax","textStatus","_beforeSend","_active","_onDone","_onFail","_onAlways","jqXHRorResult","jqXHRorError","aborted","slot","pipe","send","_sending","nextSlot","_slots","resolve","_sequence","_onAdd","paramNameSet","paramNameSlice","fileSet","filesLength","limit","limitSize","overhead","batchSize","originalFiles","newData","_replaceFileInput","inputClone","restoreFocus","is","fileInputClone","reset","detach","trigger","cleanData","_handleFileTreeEntry","path","dirReader","errorHandler","successHandler","_handleFileTreeEntries","readEntries","results","isFile","_file","relativePath","isDirectory","createReader","when","_getDroppedFiles","webkitGetAsEntry","getAsEntry","getAsFile","makeArray","_getSingleFileInputFiles","fileSize","_getFileInputFiles","_onChange","_onPaste","clipboardData","_onDrop","_onDragOver","_onDragEnter","_onDragLeave","_initEventHandlers","_on","dragover","drop","dragenter","dragleave","paste","change","_destroyEventHandlers","_off","_destroy","_setOption","reinit","_super","_initSpecialOptions","find","_getRegExp","modifiers","pop","_isRegExpOption","_initDataAttributes","attributes","_create","active","disabled","then","ui","version","expr","pseudos","uniqueSort","unique","widgetUuid","widgetHasOwnProperty","widgetSlice","orig","elems","elem","_data","triggerHandler","existingConstructor","basePrototype","proxiedPrototype","namespace","fullName","Widget","_createWidget","_proto","_childConstructors","_superApply","returnValue","__super","__superApply","widgetEventPrefix","widgetName","widgetFullName","childPrototype","bridge","inputIndex","inputLength","isPlainObject","object","isMethodCall","methodValue","pushStack","option","_init","defaultElement","uuid","eventNamespace","bindings","hoverable","focusable","classesElementLookup","ownerDocument","parentWindow","_getCreateOptions","_setOptionDisabled","_getCreateEventData","_removeClass","removeAttr","curOption","_setOptions","_setOptionClasses","classKey","elements","currentElements","_classes","_toggleClass","enable","disable","full","bindRemoveEvent","processClassString","checkOption","current","not","match","extra","_untrackClassesElement","_addClass","toggleClass","suppressDisabledCheck","handlers","delegateElement","handlerProxy","hasClass","guid","selector","_delay","_hoverable","mouseenter","mouseleave","_focusable","focusin","focusout","show","hide","defaultEffect","hasOptions","effect","effectName","isEmptyObject","effects","next"],"sourceRoot":""}