/* Minification failed. Returning unminified contents.
(5793,8-9): run-time error JS1010: Expected identifier: .
(5793,8-9): run-time error JS1195: Expected expression: .
(5991,8-9): run-time error JS1010: Expected identifier: .
(5991,8-9): run-time error JS1195: Expected expression: .
(6629,8-9): run-time error JS1010: Expected identifier: .
(6629,8-9): run-time error JS1195: Expected expression: .
(11413,15-16): run-time error JS1010: Expected identifier: .
(11413,15-16): run-time error JS1195: Expected expression: .
(12490,11-12): run-time error JS1010: Expected identifier: .
(12490,11-12): run-time error JS1195: Expected expression: .
(12704,11-12): run-time error JS1010: Expected identifier: .
(12704,11-12): run-time error JS1195: Expected expression: .
(12844,11-12): run-time error JS1010: Expected identifier: .
(12844,11-12): run-time error JS1195: Expected expression: .
(13103,11-12): run-time error JS1010: Expected identifier: .
(13103,11-12): run-time error JS1195: Expected expression: .
(13220,11-12): run-time error JS1010: Expected identifier: .
(13220,11-12): run-time error JS1195: Expected expression: .
(13248,11-12): run-time error JS1010: Expected identifier: .
(13248,11-12): run-time error JS1195: Expected expression: .
(13278,11-12): run-time error JS1010: Expected identifier: .
(13278,11-12): run-time error JS1195: Expected expression: .
(13305,11-12): run-time error JS1010: Expected identifier: .
(13305,11-12): run-time error JS1195: Expected expression: .
(13319,10-11): run-time error JS1010: Expected identifier: .
(13319,10-11): run-time error JS1195: Expected expression: .
(13369,11-12): run-time error JS1010: Expected identifier: .
(13369,11-12): run-time error JS1195: Expected expression: .
(13405,11-12): run-time error JS1010: Expected identifier: .
(13405,11-12): run-time error JS1195: Expected expression: .
(13498,11-12): run-time error JS1010: Expected identifier: .
(13498,11-12): run-time error JS1195: Expected expression: .
(13511,11-12): run-time error JS1010: Expected identifier: .
(13511,11-12): run-time error JS1195: Expected expression: .
(13533,11-12): run-time error JS1010: Expected identifier: .
(13533,11-12): run-time error JS1195: Expected expression: .
(13633,11-12): run-time error JS1010: Expected identifier: .
(13633,11-12): run-time error JS1195: Expected expression: .
(13684,11-12): run-time error JS1010: Expected identifier: .
(13684,11-12): run-time error JS1195: Expected expression: .
(13713,11-12): run-time error JS1010: Expected identifier: .
(13713,11-12): run-time error JS1195: Expected expression: .
(13943,11-12): run-time error JS1010: Expected identifier: .
(13943,11-12): run-time error JS1195: Expected expression: .
(13977,10-11): run-time error JS1010: Expected identifier: .
(13977,10-11): run-time error JS1195: Expected expression: .
(14038,11-12): run-time error JS1010: Expected identifier: .
(14038,11-12): run-time error JS1195: Expected expression: .
(14082,11-12): run-time error JS1010: Expected identifier: .
(14082,11-12): run-time error JS1195: Expected expression: .
(14139,9-10): run-time error JS1010: Expected identifier: .
(14139,9-10): run-time error JS1195: Expected expression: .
(14252,11-12): run-time error JS1010: Expected identifier: .
(14252,11-12): run-time error JS1195: Expected expression: .
(14266,12-13): run-time error JS1010: Expected identifier: .
(14266,12-13): run-time error JS1195: Expected expression: .
(14288,11-12): run-time error JS1010: Expected identifier: .
(14288,11-12): run-time error JS1195: Expected expression: .
(14349,11-12): run-time error JS1010: Expected identifier: .
(14349,11-12): run-time error JS1195: Expected expression: .
(14365,11-12): run-time error JS1010: Expected identifier: .
(14365,11-12): run-time error JS1195: Expected expression: .
(3403,501-508): run-time error JS1019: Can't have 'break' outside of loop: break a
 */
/*!
 * modernizr v3.12.0
 * Build https://modernizr.com/download?-applicationcache-audio-backgroundsize-borderimage-borderradius-boxshadow-canvas-canvastext-cssanimations-csscolumns-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-flexbox-flexboxlegacy-fontface-forcetouch-generatedcontent-geolocation-hashchange-history-hsla-indexeddb-inlinesvg-localstorage-multiplebgs-opacity-postmessage-rgba-sessionstorage-smil-svg-svgclippaths-textshadow-video-webgl-websockets-websqldatabase-webworkers-addtest-atrule-domprefixes-hasevent-load-mq-prefixed-prefixedcss-prefixes-printshiv-setclasses-testallprops-testprop-teststyles-dontmin
 *
 * Copyright (c)
 *  Faruk Ates
 *  Paul Irish
 *  Alex Sexton
 *  Ryan Seddon
 *  Patrick Kettner
 *  Stu Cox
 *  Richard Herrera
 *  Veeck

 * MIT License
 */

/*
 * Modernizr tests which native CSS3 and HTML5 features are available in the
 * current UA and makes the results available to you in two ways: as properties on
 * a global `Modernizr` object, and as classes on the `<html>` element. This
 * information allows you to progressively enhance your pages with a granular level
 * of control over the experience.
*/

;(function(scriptGlobalObject, window, document, undefined){

  var tests = [];
  

  /**
   * ModernizrProto is the constructor for Modernizr
   *
   * @class
   * @access public
   */
  var ModernizrProto = {
    _version: '3.12.0',

    // Any settings that don't work as separate modules
    // can go in here as configuration.
    _config: {
      'classPrefix': '',
      'enableClasses': true,
      'enableJSClass': true,
      'usePrefixes': true
    },

    // Queue of tests
    _q: [],

    // Stub these for people who are listening
    on: function(test, cb) {
      // I don't really think people should do this, but we can
      // safe guard it a bit.
      // -- NOTE:: this gets WAY overridden in src/addTest for actual async tests.
      // This is in case people listen to synchronous tests. I would leave it out,
      // but the code to *disallow* sync tests in the real version of this
      // function is actually larger than this.
      var self = this;
      setTimeout(function() {
        cb(self[test]);
      }, 0);
    },

    addTest: function(name, fn, options) {
      tests.push({name: name, fn: fn, options: options});
    },

    addAsyncTest: function(fn) {
      tests.push({name: null, fn: fn});
    }
  };

  

  // Fake some of Object.create so we can force non test results to be non "own" properties.
  var Modernizr = function() {};
  Modernizr.prototype = ModernizrProto;

  // Leak modernizr globally when you `require` it rather than force it here.
  // Overwrite name so constructor name is nicer :D
  Modernizr = new Modernizr();

  

  var classes = [];
  

  /**
   * is returns a boolean if the typeof an obj is exactly type.
   *
   * @access private
   * @function is
   * @param {*} obj - A thing we want to check the type of
   * @param {string} type - A string to compare the typeof against
   * @returns {boolean} true if the typeof the first parameter is exactly the specified type, false otherwise
   */
  function is(obj, type) {
    return typeof obj === type;
  }

  ;

  /**
   * Run through all tests and detect their support in the current UA.
   *
   * @access private
   * @returns {void}
   */
  function testRunner() {
    var featureNames;
    var feature;
    var aliasIdx;
    var result;
    var nameIdx;
    var featureName;
    var featureNameSplit;

    for (var featureIdx in tests) {
      if (tests.hasOwnProperty(featureIdx)) {
        featureNames = [];
        feature = tests[featureIdx];
        // run the test, throw the return value into the Modernizr,
        // then based on that boolean, define an appropriate className
        // and push it into an array of classes we'll join later.
        //
        // If there is no name, it's an 'async' test that is run,
        // but not directly added to the object. That should
        // be done with a post-run addTest call.
        if (feature.name) {
          featureNames.push(feature.name.toLowerCase());

          if (feature.options && feature.options.aliases && feature.options.aliases.length) {
            // Add all the aliases into the names list
            for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {
              featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
            }
          }
        }

        // Run the test, or use the raw value if it's not a function
        result = is(feature.fn, 'function') ? feature.fn() : feature.fn;

        // Set each of the names on the Modernizr object
        for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {
          featureName = featureNames[nameIdx];
          // Support dot properties as sub tests. We don't do checking to make sure
          // that the implied parent tests have been added. You must call them in
          // order (either in the test, or make the parent test a dependency).
          //
          // Cap it to TWO to make the logic simple and because who needs that kind of subtesting
          // hashtag famous last words
          featureNameSplit = featureName.split('.');

          if (featureNameSplit.length === 1) {
            Modernizr[featureNameSplit[0]] = result;
          } else {
            // cast to a Boolean, if not one already or if it doesnt exist yet (like inputtypes)
            if (!Modernizr[featureNameSplit[0]] || Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
              Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
            }

            Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;
          }

          classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));
        }
      }
    }
  }
  ;

  /**
   * docElement is a convenience wrapper to grab the root element of the document
   *
   * @access private
   * @returns {HTMLElement|SVGElement} The root element of the document
   */
  var docElement = document.documentElement;
  

  /**
   * A convenience helper to check if the document we are running in is an SVG document
   *
   * @access private
   * @returns {boolean}
   */
  var isSVG = docElement.nodeName.toLowerCase() === 'svg';

  

  /**
   * setClasses takes an array of class names and adds them to the root element
   *
   * @access private
   * @function setClasses
   * @param {string[]} classes - Array of class names
   */
  // Pass in an and array of class names, e.g.:
  //  ['no-webp', 'borderradius', ...]
  function setClasses(classes) {
    var className = docElement.className;
    var classPrefix = Modernizr._config.classPrefix || '';

    if (isSVG) {
      className = className.baseVal;
    }

    // Change `no-js` to `js` (independently of the `enableClasses` option)
    // Handle classPrefix on this too
    if (Modernizr._config.enableJSClass) {
      var reJS = new RegExp('(^|\\s)' + classPrefix + 'no-js(\\s|$)');
      className = className.replace(reJS, '$1' + classPrefix + 'js$2');
    }

    if (Modernizr._config.enableClasses) {
      // Add the new classes
      if (classes.length > 0) {
        className += ' ' + classPrefix + classes.join(' ' + classPrefix);
      }
      if (isSVG) {
        docElement.className.baseVal = className;
      } else {
        docElement.className = className;
      }
    }
  }

  ;

  /**
   * hasOwnProp is a shim for hasOwnProperty that is needed for Safari 2.0 support
   *
   * @author kangax
   * @access private
   * @function hasOwnProp
   * @param {object} object - The object to check for a property
   * @param {string} property - The property to check for
   * @returns {boolean}
   */

  // hasOwnProperty shim by kangax needed for Safari 2.0 support
  var hasOwnProp;

  (function() {
    var _hasOwnProperty = ({}).hasOwnProperty;
    /* istanbul ignore else */
    /* we have no way of testing IE 5.5 or safari 2,
     * so just assume the else gets hit */
    if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) {
      hasOwnProp = function(object, property) {
        return _hasOwnProperty.call(object, property);
      };
    }
    else {
      hasOwnProp = function(object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
        return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
      };
    }
  })();

  


  // _l tracks listeners for async tests, as well as tests that execute after the initial run
  ModernizrProto._l = {};

  /**
   * Modernizr.on is a way to listen for the completion of async tests. Being
   * asynchronous, they may not finish before your scripts run. As a result you
   * will get a possibly false negative `undefined` value.
   *
   * @memberOf Modernizr
   * @name Modernizr.on
   * @access public
   * @function on
   * @param {string} feature - String name of the feature detect
   * @param {Function} cb - Callback function returning a Boolean - true if feature is supported, false if not
   * @returns {void}
   * @example
   *
   * ```js
   * Modernizr.on('flash', function( result ) {
   *   if (result) {
   *    // the browser has flash
   *   } else {
   *     // the browser does not have flash
   *   }
   * });
   * ```
   */
  ModernizrProto.on = function(feature, cb) {
    // Create the list of listeners if it doesn't exist
    if (!this._l[feature]) {
      this._l[feature] = [];
    }

    // Push this test on to the listener list
    this._l[feature].push(cb);

    // If it's already been resolved, trigger it on next tick
    if (Modernizr.hasOwnProperty(feature)) {
      // Next Tick
      setTimeout(function() {
        Modernizr._trigger(feature, Modernizr[feature]);
      }, 0);
    }
  };

  /**
   * _trigger is the private function used to signal test completion and run any
   * callbacks registered through [Modernizr.on](#modernizr-on)
   *
   * @memberOf Modernizr
   * @name Modernizr._trigger
   * @access private
   * @function _trigger
   * @param {string} feature - string name of the feature detect
   * @param {Function|boolean} [res] - A feature detection function, or the boolean =
   * result of a feature detection function
   * @returns {void}
   */
  ModernizrProto._trigger = function(feature, res) {
    if (!this._l[feature]) {
      return;
    }

    var cbs = this._l[feature];

    // Force async
    setTimeout(function() {
      var i, cb;
      for (i = 0; i < cbs.length; i++) {
        cb = cbs[i];
        cb(res);
      }
    }, 0);

    // Don't trigger these again
    delete this._l[feature];
  };

  /**
   * addTest allows you to define your own feature detects that are not currently
   * included in Modernizr (under the covers it's the exact same code Modernizr
   * uses for its own [feature detections](https://github.com/Modernizr/Modernizr/tree/master/feature-detects)).
   * Just like the official detects, the result
   * will be added onto the Modernizr object, as well as an appropriate className set on
   * the html element when configured to do so
   *
   * @memberOf Modernizr
   * @name Modernizr.addTest
   * @optionName Modernizr.addTest()
   * @optionProp addTest
   * @access public
   * @function addTest
   * @param {string|object} feature - The string name of the feature detect, or an
   * object of feature detect names and test
   * @param {Function|boolean} test - Function returning true if feature is supported,
   * false if not. Otherwise a boolean representing the results of a feature detection
   * @returns {object} the Modernizr object to allow chaining
   * @example
   *
   * The most common way of creating your own feature detects is by calling
   * `Modernizr.addTest` with a string (preferably just lowercase, without any
   * punctuation), and a function you want executed that will return a boolean result
   *
   * ```js
   * Modernizr.addTest('itsTuesday', function() {
   *  var d = new Date();
   *  return d.getDay() === 2;
   * });
   * ```
   *
   * When the above is run, it will set Modernizr.itstuesday to `true` when it is tuesday,
   * and to `false` every other day of the week. One thing to notice is that the names of
   * feature detect functions are always lowercased when added to the Modernizr object. That
   * means that `Modernizr.itsTuesday` will not exist, but `Modernizr.itstuesday` will.
   *
   *
   *  Since we only look at the returned value from any feature detection function,
   *  you do not need to actually use a function. For simple detections, just passing
   *  in a statement that will return a boolean value works just fine.
   *
   * ```js
   * Modernizr.addTest('hasjquery', 'jQuery' in window);
   * ```
   *
   * Just like before, when the above runs `Modernizr.hasjquery` will be true if
   * jQuery has been included on the page. Not using a function saves a small amount
   * of overhead for the browser, as well as making your code much more readable.
   *
   * Finally, you also have the ability to pass in an object of feature names and
   * their tests. This is handy if you want to add multiple detections in one go.
   * The keys should always be a string, and the value can be either a boolean or
   * function that returns a boolean.
   *
   * ```js
   * var detects = {
   *  'hasjquery': 'jQuery' in window,
   *  'itstuesday': function() {
   *    var d = new Date();
   *    return d.getDay() === 2;
   *  }
   * }
   *
   * Modernizr.addTest(detects);
   * ```
   *
   * There is really no difference between the first methods and this one, it is
   * just a convenience to let you write more readable code.
   */
  function addTest(feature, test) {

    if (typeof feature === 'object') {
      for (var key in feature) {
        if (hasOwnProp(feature, key)) {
          addTest(key, feature[ key ]);
        }
      }
    } else {

      feature = feature.toLowerCase();
      var featureNameSplit = feature.split('.');
      var last = Modernizr[featureNameSplit[0]];

      // Again, we don't check for parent test existence. Get that right, though.
      if (featureNameSplit.length === 2) {
        last = last[featureNameSplit[1]];
      }

      if (typeof last !== 'undefined') {
        // we're going to quit if you're trying to overwrite an existing test
        // if we were to allow it, we'd do this:
        //   var re = new RegExp("\\b(no-)?" + feature + "\\b");
        //   docElement.className = docElement.className.replace( re, '' );
        // but, no rly, stuff 'em.
        return Modernizr;
      }

      test = typeof test === 'function' ? test() : test;

      // Set the value (this is the magic, right here).
      if (featureNameSplit.length === 1) {
        Modernizr[featureNameSplit[0]] = test;
      } else {
        // cast to a Boolean, if not one already
        if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
          Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
        }

        Modernizr[featureNameSplit[0]][featureNameSplit[1]] = test;
      }

      // Set a single class (either `feature` or `no-feature`)
      setClasses([(!!test && test !== false ? '' : 'no-') + featureNameSplit.join('-')]);

      // Trigger the event
      Modernizr._trigger(feature, test);
    }

    return Modernizr; // allow chaining.
  }

  // After all the tests are run, add self to the Modernizr prototype
  Modernizr._q.push(function() {
    ModernizrProto.addTest = addTest;
  });

  


  /**
   * If the browsers follow the spec, then they would expose vendor-specific styles as:
   *   elem.style.WebkitBorderRadius
   * instead of something like the following (which is technically incorrect):
   *   elem.style.webkitBorderRadius
   *
   * WebKit ghosts their properties in lowercase but Opera & Moz do not.
   * Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
   *   erik.eae.net/archives/2008/03/10/21.48.10/
   *
   * More here: github.com/Modernizr/Modernizr/issues/issue/21
   *
   * @access private
   * @returns {string} The string representing the vendor-specific style properties
   */
  var omPrefixes = 'Moz O ms Webkit';
  

  var cssomPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.split(' ') : []);
  ModernizrProto._cssomPrefixes = cssomPrefixes;
  

  /**
   * atRule returns a given CSS property at-rule (eg @keyframes), possibly in
   * some prefixed form, or false, in the case of an unsupported rule
   *
   * @memberOf Modernizr
   * @name Modernizr.atRule
   * @optionName Modernizr.atRule()
   * @optionProp atRule
   * @access public
   * @function atRule
   * @param {string} prop - String name of the @-rule to test for
   * @returns {string|boolean} The string representing the (possibly prefixed)
   * valid version of the @-rule, or `false` when it is unsupported.
   * @example
   * ```js
   *  var keyframes = Modernizr.atRule('@keyframes');
   *
   *  if (keyframes) {
   *    // keyframes are supported
   *    // could be `@-webkit-keyframes` or `@keyframes`
   *  } else {
   *    // keyframes === `false`
   *  }
   * ```
   */
  var atRule = function(prop) {
    var length = prefixes.length;
    var cssrule = window.CSSRule;
    var rule;

    if (typeof cssrule === 'undefined') {
      return undefined;
    }

    if (!prop) {
      return false;
    }

    // remove literal @ from beginning of provided property
    prop = prop.replace(/^@/, '');

    // CSSRules use underscores instead of dashes
    rule = prop.replace(/-/g, '_').toUpperCase() + '_RULE';

    if (rule in cssrule) {
      return '@' + prop;
    }

    for (var i = 0; i < length; i++) {
      // prefixes gives us something like -o-, and we want O_
      var prefix = prefixes[i];
      var thisRule = prefix.toUpperCase() + '_' + rule;

      if (thisRule in cssrule) {
        return '@-' + prefix.toLowerCase() + '-' + prop;
      }
    }

    return false;
  };

  ModernizrProto.atRule = atRule;

  

  /**
   * List of JavaScript DOM values used for tests
   *
   * @memberOf Modernizr
   * @name Modernizr._domPrefixes
   * @optionName Modernizr._domPrefixes
   * @optionProp domPrefixes
   * @access public
   * @example
   *
   * Modernizr._domPrefixes is exactly the same as [_prefixes](#modernizr-_prefixes), but rather
   * than hyphen-case properties, all properties are their Capitalized variant
   *
   * ```js
   * Modernizr._domPrefixes === [ "Moz", "O", "ms", "Webkit" ];
   * ```
   */
  var domPrefixes = (ModernizrProto._config.usePrefixes ? omPrefixes.toLowerCase().split(' ') : []);
  ModernizrProto._domPrefixes = domPrefixes;
  

  /**
   * createElement is a convenience wrapper around document.createElement. Since we
   * use createElement all over the place, this allows for (slightly) smaller code
   * as well as abstracting away issues with creating elements in contexts other than
   * HTML documents (e.g. SVG documents).
   *
   * @access private
   * @function createElement
   * @returns {HTMLElement|SVGElement} An HTML or SVG element
   */
  function createElement() {
    if (typeof document.createElement !== 'function') {
      // This is the case in IE7, where the type of createElement is "object".
      // For this reason, we cannot call apply() as Object is not a Function.
      return document.createElement(arguments[0]);
    } else if (isSVG) {
      return document.createElementNS.call(document, 'http://www.w3.org/2000/svg', arguments[0]);
    } else {
      return document.createElement.apply(document, arguments);
    }
  }

  ;

  /**
   * Modernizr.hasEvent() detects support for a given event
   *
   * @memberOf Modernizr
   * @name Modernizr.hasEvent
   * @optionName Modernizr.hasEvent()
   * @optionProp hasEvent
   * @access public
   * @function hasEvent
   * @param {string|*} eventName - the name of an event to test for (e.g. "resize")
   * @param {Element|string} [element=HTMLDivElement] - is the element|document|window|tagName to test on
   * @returns {boolean}
   * @example
   *  `Modernizr.hasEvent` lets you determine if the browser supports a supplied event.
   *  By default, it does this detection on a div element
   *
   * ```js
   *  hasEvent('blur') // true;
   * ```
   *
   * However, you are able to give an object as a second argument to hasEvent to
   * detect an event on something other than a div.
   *
   * ```js
   *  hasEvent('devicelight', window) // true;
   * ```
   */
  var hasEvent = (function() {

    // Detect whether event support can be detected via `in`. Test on a DOM element
    // using the "blur" event b/c it should always exist. bit.ly/event-detection
    var needsFallback = !('onblur' in docElement);

    function inner(eventName, element) {

      var isSupported;
      if (!eventName) { return false; }
      if (!element || typeof element === 'string') {
        element = createElement(element || 'div');
      }

      // Testing via the `in` operator is sufficient for modern browsers and IE.
      // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and
      // "resize", whereas `in` "catches" those.
      eventName = 'on' + eventName;
      isSupported = eventName in element;

      // Fallback technique for old Firefox - bit.ly/event-detection
      if (!isSupported && needsFallback) {
        if (!element.setAttribute) {
          // Switch to generic element if it lacks `setAttribute`.
          // It could be the `document`, `window`, or something else.
          element = createElement('div');
        }

        element.setAttribute(eventName, '');
        isSupported = typeof element[eventName] === 'function';

        if (element[eventName] !== undefined) {
          // If property was created, "remove it" by setting value to `undefined`.
          element[eventName] = undefined;
        }
        element.removeAttribute(eventName);
      }

      return isSupported;
    }
    return inner;
  })();

  ModernizrProto.hasEvent = hasEvent;
  

  /**
   * @optionName html5printshiv
   * @optionProp html5printshiv
   */

  // Take the html5 variable out of the html5shiv scope so we can return it.
  var html5;
  if (!isSVG) {
    /**
     * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
     */
    ;(function(window, document) {
      /*jshint evil:true */
      /** version */
      var version = '3.7.3';

      /** Preset options */
      var options = window.html5 || {};

      /** Used to skip problem elements */
      var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;

      /** Not all elements can be cloned in IE **/
      var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;

      /** Detect whether the browser supports default html5 styles */
      var supportsHtml5Styles;

      /** Name of the expando, to work with multiple documents or to re-shiv one document */
      var expando = '_html5shiv';

      /** The id for the the documents expando */
      var expanID = 0;

      /** Cached data for each document */
      var expandoData = {};

      /** Detect whether the browser supports unknown elements */
      var supportsUnknownElements;

      (function() {
        try {
          var a = document.createElement('a');
          a.innerHTML = '<xyz></xyz>';
          //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
          supportsHtml5Styles = ('hidden' in a);

          supportsUnknownElements = a.childNodes.length == 1 || (function() {
            // assign a false positive if unable to shiv
            (document.createElement)('a');
            var frag = document.createDocumentFragment();
            return (
              typeof frag.cloneNode == 'undefined' ||
              typeof frag.createDocumentFragment == 'undefined' ||
              typeof frag.createElement == 'undefined'
            );
          }());
        } catch(e) {
          // assign a false positive if detection fails => unable to shiv
          supportsHtml5Styles = true;
          supportsUnknownElements = true;
        }

      }());

      /*--------------------------------------------------------------------------*/

      /**
       * Creates a style sheet with the given CSS text and adds it to the document.
       * @private
       * @param {Document} ownerDocument The document.
       * @param {String} cssText The CSS text.
       * @returns {StyleSheet} The style element.
       */
      function addStyleSheet(ownerDocument, cssText) {
        var p = ownerDocument.createElement('p'),
          parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;

        p.innerHTML = 'x<style>' + cssText + '</style>';
        return parent.insertBefore(p.lastChild, parent.firstChild);
      }

      /**
       * Returns the value of `html5.elements` as an array.
       * @private
       * @returns {Array} An array of shived element node names.
       */
      function getElements() {
        var elements = html5.elements;
        return typeof elements == 'string' ? elements.split(' ') : elements;
      }

      /**
       * Extends the built-in list of html5 elements
       * @memberOf html5
       * @param {String|Array} newElements whitespace separated list or array of new element names to shiv
       * @param {Document} ownerDocument The context document.
       */
      function addElements(newElements, ownerDocument) {
        var elements = html5.elements;
        if(typeof elements != 'string'){
          elements = elements.join(' ');
        }
        if(typeof newElements != 'string'){
          newElements = newElements.join(' ');
        }
        html5.elements = elements +' '+ newElements;
        shivDocument(ownerDocument);
      }

      /**
       * Returns the data associated to the given document
       * @private
       * @param {Document} ownerDocument The document.
       * @returns {Object} An object of data.
       */
      function getExpandoData(ownerDocument) {
        var data = expandoData[ownerDocument[expando]];
        if (!data) {
          data = {};
          expanID++;
          ownerDocument[expando] = expanID;
          expandoData[expanID] = data;
        }
        return data;
      }

      /**
       * returns a shived element for the given nodeName and document
       * @memberOf html5
       * @param {String} nodeName name of the element
       * @param {Document} ownerDocument The context document.
       * @returns {Object} The shived element.
       */
      function createElement(nodeName, ownerDocument, data){
        if (!ownerDocument) {
          ownerDocument = document;
        }
        if(supportsUnknownElements){
          return ownerDocument.createElement(nodeName);
        }
        if (!data) {
          data = getExpandoData(ownerDocument);
        }
        var node;

        if (data.cache[nodeName]) {
          node = data.cache[nodeName].cloneNode();
        } else if (saveClones.test(nodeName)) {
          node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
        } else {
          node = data.createElem(nodeName);
        }

        // Avoid adding some elements to fragments in IE < 9 because
        // * Attributes like `name` or `type` cannot be set/changed once an element
        //   is inserted into a document/fragment
        // * Link elements with `src` attributes that are inaccessible, as with
        //   a 403 response, will cause the tab/window to crash
        // * Script elements appended to fragments will execute when their `src`
        //   or `text` property is set
        return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
      }

      /**
       * returns a shived DocumentFragment for the given document
       * @memberOf html5
       * @param {Document} ownerDocument The context document.
       * @returns {Object} The shived DocumentFragment.
       */
      function createDocumentFragment(ownerDocument, data){
        if (!ownerDocument) {
          ownerDocument = document;
        }
        if(supportsUnknownElements){
          return ownerDocument.createDocumentFragment();
        }
        data = data || getExpandoData(ownerDocument);
        var clone = data.frag.cloneNode(),
          i = 0,
          elems = getElements(),
          l = elems.length;
        for(;i<l;i++){
          clone.createElement(elems[i]);
        }
        return clone;
      }

      /**
       * Shivs the `createElement` and `createDocumentFragment` methods of the document.
       * @private
       * @param {Document|DocumentFragment} ownerDocument The document.
       * @param {Object} data of the document.
       */
      function shivMethods(ownerDocument, data) {
        if (!data.cache) {
          data.cache = {};
          data.createElem = ownerDocument.createElement;
          data.createFrag = ownerDocument.createDocumentFragment;
          data.frag = data.createFrag();
        }


        ownerDocument.createElement = function(nodeName) {
          //abort shiv
          if (!html5.shivMethods) {
            return data.createElem(nodeName);
          }
          return createElement(nodeName, ownerDocument, data);
        };

        ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
          'var n=f.cloneNode(),c=n.createElement;' +
          'h.shivMethods&&(' +
          // unroll the `createElement` calls
          getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
            data.createElem(nodeName);
            data.frag.createElement(nodeName);
            return 'c("' + nodeName + '")';
          }) +
          ');return n}'
        )(html5, data.frag);
      }

      /*--------------------------------------------------------------------------*/

      /**
       * Shivs the given document.
       * @memberOf html5
       * @param {Document} ownerDocument The document to shiv.
       * @returns {Document} The shived document.
       */
      function shivDocument(ownerDocument) {
        if (!ownerDocument) {
          ownerDocument = document;
        }
        var data = getExpandoData(ownerDocument);

        if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
          data.hasCSS = !!addStyleSheet(ownerDocument,
            // corrects block display not defined in IE6/7/8/9
            'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
            // adds styling not present in IE6/7/8/9
            'mark{background:#FF0;color:#000}' +
            // hides non-rendered elements
            'template{display:none}'
          );
        }
        if (!supportsUnknownElements) {
          shivMethods(ownerDocument, data);
        }
        return ownerDocument;
      }

      /*--------------------------------------------------------------------------*/

      /**
       * The `html5` object is exposed so that more elements can be shived and
       * existing shiving can be detected on iframes.
       * @type Object
       * @example
       *
       * // options can be changed before the script is included
       * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
       */
      var html5 = {

        /**
         * An array or space separated string of node names of the elements to shiv.
         * @memberOf html5
         * @type Array|String
         */
        'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',

        /**
         * current version of html5shiv
         */
        'version': version,

        /**
         * A flag to indicate that the HTML5 style sheet should be inserted.
         * @memberOf html5
         * @type Boolean
         */
        'shivCSS': (options.shivCSS !== false),

        /**
         * Is equal to true if a browser supports creating unknown/HTML5 elements
         * @memberOf html5
         * @type boolean
         */
        'supportsUnknownElements': supportsUnknownElements,

        /**
         * A flag to indicate that the document's `createElement` and `createDocumentFragment`
         * methods should be overwritten.
         * @memberOf html5
         * @type Boolean
         */
        'shivMethods': (options.shivMethods !== false),

        /**
         * A string to describe the type of `html5` object ("default" or "default print").
         * @memberOf html5
         * @type String
         */
        'type': 'default',

        // shivs the document according to the specified `html5` object options
        'shivDocument': shivDocument,

        //creates a shived element
        createElement: createElement,

        //creates a shived documentFragment
        createDocumentFragment: createDocumentFragment,

        //extends list of elements
        addElements: addElements
      };

      /*--------------------------------------------------------------------------*/

      // expose html5
      window.html5 = html5;

      // shiv the document
      shivDocument(document);

      /*------------------------------- Print Shiv -------------------------------*/

      /** Used to filter media types */
      var reMedia = /^$|\b(?:all|print)\b/;

      /** Used to namespace printable elements */
      var shivNamespace = 'html5shiv';

      /** Detect whether the browser supports shivable style sheets */
      var supportsShivableSheets = !supportsUnknownElements && (function() {
        // assign a false negative if unable to shiv
        var docEl = document.documentElement;
        return !(
          typeof document.namespaces == 'undefined' ||
          typeof document.parentWindow == 'undefined' ||
          typeof docEl.applyElement == 'undefined' ||
          typeof docEl.removeNode == 'undefined' ||
          typeof window.attachEvent == 'undefined'
        );
      }());

      /*--------------------------------------------------------------------------*/

      /**
       * Wraps all HTML5 elements in the given document with printable elements.
       * (eg. the "header" element is wrapped with the "html5shiv:header" element)
       * @private
       * @param {Document} ownerDocument The document.
       * @returns {Array} An array wrappers added.
       */
      function addWrappers(ownerDocument) {
        var node,
          nodes = ownerDocument.getElementsByTagName('*'),
          index = nodes.length,
          reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
          result = [];

        while (index--) {
          node = nodes[index];
          if (reElements.test(node.nodeName)) {
            result.push(node.applyElement(createWrapper(node)));
          }
        }
        return result;
      }

      /**
       * Creates a printable wrapper for the given element.
       * @private
       * @param {Element} element The element.
       * @returns {Element} The wrapper.
       */
      function createWrapper(element) {
        var node,
          nodes = element.attributes,
          index = nodes.length,
          wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);

        // copy element attributes to the wrapper
        while (index--) {
          node = nodes[index];
          node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
        }
        // copy element styles to the wrapper
        wrapper.style.cssText = element.style.cssText;
        return wrapper;
      }

      /**
       * Shivs the given CSS text.
       * (eg. header{} becomes html5shiv\:header{})
       * @private
       * @param {String} cssText The CSS text to shiv.
       * @returns {String} The shived CSS text.
       */
      function shivCssText(cssText) {
        var pair,
          parts = cssText.split('{'),
          index = parts.length,
          reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
          replacement = '$1' + shivNamespace + '\\:$2';

        while (index--) {
          pair = parts[index] = parts[index].split('}');
          pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
          parts[index] = pair.join('}');
        }
        return parts.join('{');
      }

      /**
       * Removes the given wrappers, leaving the original elements.
       * @private
       * @params {Array} wrappers An array of printable wrappers.
       */
      function removeWrappers(wrappers) {
        var index = wrappers.length;
        while (index--) {
          wrappers[index].removeNode();
        }
      }

      /*--------------------------------------------------------------------------*/

      /**
       * Shivs the given document for print.
       * @memberOf html5
       * @param {Document} ownerDocument The document to shiv.
       * @returns {Document} The shived document.
       */
      function shivPrint(ownerDocument) {
        var shivedSheet,
          wrappers,
          data = getExpandoData(ownerDocument),
          namespaces = ownerDocument.namespaces,
          ownerWindow = ownerDocument.parentWindow;

        if (!supportsShivableSheets || ownerDocument.printShived) {
          return ownerDocument;
        }
        if (typeof namespaces[shivNamespace] == 'undefined') {
          namespaces.add(shivNamespace);
        }

        function removeSheet() {
          clearTimeout(data._removeSheetTimer);
          if (shivedSheet) {
            shivedSheet.removeNode(true);
          }
          shivedSheet= null;
        }

        ownerWindow.attachEvent('onbeforeprint', function() {

          removeSheet();

          var imports,
            length,
            sheet,
            collection = ownerDocument.styleSheets,
            cssText = [],
            index = collection.length,
            sheets = Array(index);

          // convert styleSheets collection to an array
          while (index--) {
            sheets[index] = collection[index];
          }
          // concat all style sheet CSS text
          while ((sheet = sheets.pop())) {
            // IE does not enforce a same origin policy for external style sheets...
            // but has trouble with some dynamically created stylesheets
            if (!sheet.disabled && reMedia.test(sheet.media)) {

              try {
                imports = sheet.imports;
                length = imports.length;
              } catch(er){
                length = 0;
              }

              for (index = 0; index < length; index++) {
                sheets.push(imports[index]);
              }

              try {
                cssText.push(sheet.cssText);
              } catch(er){}
            }
          }

          // wrap all HTML5 elements with printable elements and add the shived style sheet
          cssText = shivCssText(cssText.reverse().join(''));
          wrappers = addWrappers(ownerDocument);
          shivedSheet = addStyleSheet(ownerDocument, cssText);

        });

        ownerWindow.attachEvent('onafterprint', function() {
          // remove wrappers, leaving the original elements, and remove the shived style sheet
          removeWrappers(wrappers);
          clearTimeout(data._removeSheetTimer);
          data._removeSheetTimer = setTimeout(removeSheet, 500);
        });

        ownerDocument.printShived = true;
        return ownerDocument;
      }

      /*--------------------------------------------------------------------------*/

      // expose API
      html5.type += ' print';
      html5.shivPrint = shivPrint;

      // shiv for print
      shivPrint(document);

      if(typeof module == 'object' && module.exports){
        module.exports = html5;
      }

    }(typeof window !== "undefined" ? window : this, document));
  }

  ;

  var err = function() {};
  var warn = function() {};

  if (window.console) {
    err = function() {
      var method = console.error ? 'error' : 'log';
      window.console[method].apply(window.console, Array.prototype.slice.call(arguments));
    };

    warn = function() {
      var method = console.warn ? 'warn' : 'log';
      window.console[method].apply(window.console, Array.prototype.slice.call(arguments));
    };
  }

  /**
   * Previously, Modernizr.load was an alias for yepnope. Since yepnope was
   * deprecated, we removed it as well. It is not available on the website builder,
   * this is only included as an improved warning to those who build a custom
   * version locally.
   *
   * @memberOf Modernizr
   * @name Modernizr.load
   * @function load
   * @returns {void}
   */
  ModernizrProto.load = function() {
    if ('yepnope' in window) {
      warn('yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. yepnope appears to be available on the page, so we’ll use it to handle this call to Modernizr.load, but please update your code to use yepnope directly.\n See http://github.com/Modernizr/Modernizr/issues/1182 for more information.');
      window.yepnope.apply(window, [].slice.call(arguments, 0));
    } else {
      err('yepnope.js (aka Modernizr.load) is no longer included as part of Modernizr. Get it from http://yepnopejs.com. See http://github.com/Modernizr/Modernizr/issues/1182 for more information.');
    }
  };


  /**
   * getBody returns the body of a document, or an element that can stand in for
   * the body if a real body does not exist
   *
   * @access private
   * @function getBody
   * @returns {HTMLElement|SVGElement} Returns the real body of a document, or an
   * artificially created element that stands in for the body
   */
  function getBody() {
    // After page load injecting a fake body doesn't work so check if body exists
    var body = document.body;

    if (!body) {
      // Can't use the real body create a fake one.
      body = createElement(isSVG ? 'svg' : 'body');
      body.fake = true;
    }

    return body;
  }

  ;

  /**
   * injectElementWithStyles injects an element with style element and some CSS rules
   *
   * @access private
   * @function injectElementWithStyles
   * @param {string} rule - String representing a css rule
   * @param {Function} callback - A function that is used to test the injected element
   * @param {number} [nodes] - An integer representing the number of additional nodes you want injected
   * @param {string[]} [testnames] - An array of strings that are used as ids for the additional nodes
   * @returns {boolean} the result of the specified callback test
   */
  function injectElementWithStyles(rule, callback, nodes, testnames) {
    var mod = 'modernizr';
    var style;
    var ret;
    var node;
    var docOverflow;
    var div = createElement('div');
    var body = getBody();

    if (parseInt(nodes, 10)) {
      // In order not to give false positives we create a node for each test
      // This also allows the method to scale for unspecified uses
      while (nodes--) {
        node = createElement('div');
        node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
        div.appendChild(node);
      }
    }

    style = createElement('style');
    style.type = 'text/css';
    style.id = 's' + mod;

    // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
    // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
    (!body.fake ? div : body).appendChild(style);
    body.appendChild(div);

    if (style.styleSheet) {
      style.styleSheet.cssText = rule;
    } else {
      style.appendChild(document.createTextNode(rule));
    }
    div.id = mod;

    if (body.fake) {
      //avoid crashing IE8, if background image is used
      body.style.background = '';
      //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
      body.style.overflow = 'hidden';
      docOverflow = docElement.style.overflow;
      docElement.style.overflow = 'hidden';
      docElement.appendChild(body);
    }

    ret = callback(div, rule);
    // If this is done after page load we don't want to remove the body so check if body exists
    if (body.fake && body.parentNode) {
      body.parentNode.removeChild(body);
      docElement.style.overflow = docOverflow;
      // Trigger layout so kinetic scrolling isn't disabled in iOS6+
      // eslint-disable-next-line
      docElement.offsetHeight;
    } else {
      div.parentNode.removeChild(div);
    }

    return !!ret;
  }

  ;


  /**
   * wrapper around getComputedStyle, to fix issues with Firefox returning null when
   * called inside of a hidden iframe
   *
   * @access private
   * @function computedStyle
   * @param {HTMLElement|SVGElement} elem - The element we want to find the computed styles of
   * @param {string|null} [pseudo] - An optional pseudo element selector (e.g. :before), of null if none
   * @param {string} prop - A CSS property
   * @returns {CSSStyleDeclaration} the value of the specified CSS property
   */
  function computedStyle(elem, pseudo, prop) {
    var result;

    if ('getComputedStyle' in window) {
      result = getComputedStyle.call(window, elem, pseudo);
      var console = window.console;

      if (result !== null) {
        if (prop) {
          result = result.getPropertyValue(prop);
        }
      } else {
        if (console) {
          var method = console.error ? 'error' : 'log';
          console[method].call(console, 'getComputedStyle returning null, its possible modernizr test results are inaccurate');
        }
      }
    } else {
      result = !pseudo && elem.currentStyle && elem.currentStyle[prop];
    }

    return result;
  }

  ;

  /**
   * Modernizr.mq tests a given media query, live against the current state of the window
   * adapted from matchMedia polyfill by Scott Jehl and Paul Irish
   * gist.github.com/786768
   *
   * @memberOf Modernizr
   * @name Modernizr.mq
   * @optionName Modernizr.mq()
   * @optionProp mq
   * @access public
   * @function mq
   * @param {string} mq - String of the media query we want to test
   * @returns {boolean}
   * @example
   * Modernizr.mq allows for you to programmatically check if the current browser
   * window state matches a media query.
   *
   * ```js
   *  var query = Modernizr.mq('(min-width: 900px)');
   *
   *  if (query) {
   *    // the browser window is larger than 900px
   *  }
   * ```
   *
   * Only valid media queries are supported, therefore you must always include values
   * with your media query
   *
   * ```js
   * // good
   *  Modernizr.mq('(min-width: 900px)');
   *
   * // bad
   *  Modernizr.mq('min-width');
   * ```
   *
   * If you would just like to test that media queries are supported in general, use
   *
   * ```js
   *  Modernizr.mq('only all'); // true if MQ are supported, false if not
   * ```
   *
   * Note that if the browser does not support media queries (e.g. old IE) mq will
   * always return false.
   */
  var mq = (function() {
    var matchMedia = window.matchMedia || window.msMatchMedia;
    if (matchMedia) {
      return function(mq) {
        var mql = matchMedia(mq);
        return mql && mql.matches || false;
      };
    }

    return function(mq) {
      var bool = false;

      injectElementWithStyles('@media ' + mq + ' { #modernizr { position: absolute; } }', function(node) {
        bool = computedStyle(node, null, 'position') === 'absolute';
      });

      return bool;
    };
  })();

  ModernizrProto.mq = mq;

  

  /**
   * contains checks to see if a string contains another string
   *
   * @access private
   * @function contains
   * @param {string} str - The string we want to check for substrings
   * @param {string} substr - The substring we want to search the first string for
   * @returns {boolean} true if and only if the first string 'str' contains the second string 'substr'
   */
  function contains(str, substr) {
    return !!~('' + str).indexOf(substr);
  }

  ;

  /**
   * Create our "modernizr" element that we do most feature tests on.
   *
   * @access private
   */
  var modElem = {
    elem: createElement('modernizr')
  };

  // Clean up this element
  Modernizr._q.push(function() {
    delete modElem.elem;
  });

  

  var mStyle = {
    style: modElem.elem.style
  };

  // kill ref for gc, must happen before mod.elem is removed, so we unshift on to
  // the front of the queue.
  Modernizr._q.unshift(function() {
    delete mStyle.style;
  });

  

  /**
   * domToCSS takes a camelCase string and converts it to hyphen-case
   * e.g. boxSizing -> box-sizing
   *
   * @access private
   * @function domToCSS
   * @param {string} name - String name of camelCase prop we want to convert
   * @returns {string} The hyphen-case version of the supplied name
   */
  function domToCSS(name) {
    return name.replace(/([A-Z])/g, function(str, m1) {
      return '-' + m1.toLowerCase();
    }).replace(/^ms-/, '-ms-');
  }

  ;

  /**
   * nativeTestProps allows for us to use native feature detection functionality if available.
   * some prefixed form, or false, in the case of an unsupported rule
   *
   * @access private
   * @function nativeTestProps
   * @param {Array} props - An array of property names
   * @param {string} value - A string representing the value we want to check via @supports
   * @returns {boolean|undefined} A boolean when @supports exists, undefined otherwise
   */
  // Accepts a list of property names and a single value
  // Returns `undefined` if native detection not available
  function nativeTestProps(props, value) {
    var i = props.length;
    // Start with the JS API: https://www.w3.org/TR/css3-conditional/#the-css-interface
    if ('CSS' in window && 'supports' in window.CSS) {
      // Try every prefixed variant of the property
      while (i--) {
        if (window.CSS.supports(domToCSS(props[i]), value)) {
          return true;
        }
      }
      return false;
    }
    // Otherwise fall back to at-rule (for Opera 12.x)
    else if ('CSSSupportsRule' in window) {
      // Build a condition string for every prefixed variant
      var conditionText = [];
      while (i--) {
        conditionText.push('(' + domToCSS(props[i]) + ':' + value + ')');
      }
      conditionText = conditionText.join(' or ');
      return injectElementWithStyles('@supports (' + conditionText + ') { #modernizr { position: absolute; } }', function(node) {
        return computedStyle(node, null, 'position') === 'absolute';
      });
    }
    return undefined;
  }
  ;

  /**
   * cssToDOM takes a hyphen-case string and converts it to camelCase
   * e.g. box-sizing -> boxSizing
   *
   * @access private
   * @function cssToDOM
   * @param {string} name - String name of hyphen-case prop we want to convert
   * @returns {string} The camelCase version of the supplied name
   */
  function cssToDOM(name) {
    return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) {
      return m1 + m2.toUpperCase();
    }).replace(/^-/, '');
  }

  ;

  // testProps is a generic CSS / DOM property test.

  // In testing support for a given CSS property, it's legit to test:
  //    `elem.style[styleName] !== undefined`
  // If the property is supported it will return an empty string,
  // if unsupported it will return undefined.

  // We'll take advantage of this quick test and skip setting a style
  // on our modernizr element, but instead just testing undefined vs
  // empty string.

  // Property names can be provided in either camelCase or hyphen-case.

  function testProps(props, prefixed, value, skipValueTest) {
    skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;

    // Try native detect first
    if (!is(value, 'undefined')) {
      var result = nativeTestProps(props, value);
      if (!is(result, 'undefined')) {
        return result;
      }
    }

    // Otherwise do it properly
    var afterInit, i, propsLength, prop, before;

    // If we don't have a style element, that means we're running async or after
    // the core tests, so we'll need to create our own elements to use.

    // Inside of an SVG element, in certain browsers, the `style` element is only
    // defined for valid tags. Therefore, if `modernizr` does not have one, we
    // fall back to a less used element and hope for the best.
    // For strict XHTML browsers the hardly used samp element is used.
    var elems = ['modernizr', 'tspan', 'samp'];
    while (!mStyle.style && elems.length) {
      afterInit = true;
      mStyle.modElem = createElement(elems.shift());
      mStyle.style = mStyle.modElem.style;
    }

    // Delete the objects if we created them.
    function cleanElems() {
      if (afterInit) {
        delete mStyle.style;
        delete mStyle.modElem;
      }
    }

    propsLength = props.length;
    for (i = 0; i < propsLength; i++) {
      prop = props[i];
      before = mStyle.style[prop];

      if (contains(prop, '-')) {
        prop = cssToDOM(prop);
      }

      if (mStyle.style[prop] !== undefined) {

        // If value to test has been passed in, do a set-and-check test.
        // 0 (integer) is a valid property value, so check that `value` isn't
        // undefined, rather than just checking it's truthy.
        if (!skipValueTest && !is(value, 'undefined')) {

          // Needs a try catch block because of old IE. This is slow, but will
          // be avoided in most cases because `skipValueTest` will be used.
          try {
            mStyle.style[prop] = value;
          } catch (e) {}

          // If the property value has changed, we assume the value used is
          // supported. If `value` is empty string, it'll fail here (because
          // it hasn't changed), which matches how browsers have implemented
          // CSS.supports()
          if (mStyle.style[prop] !== before) {
            cleanElems();
            return prefixed === 'pfx' ? prop : true;
          }
        }
        // Otherwise just return true, or the property name if this is a
        // `prefixed()` call
        else {
          cleanElems();
          return prefixed === 'pfx' ? prop : true;
        }
      }
    }
    cleanElems();
    return false;
  }

  ;

  /**
   * fnBind is a super small [bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) polyfill.
   *
   * @access private
   * @function fnBind
   * @param {Function} fn - a function you want to change `this` reference to
   * @param {object} that - the `this` you want to call the function with
   * @returns {Function} The wrapped version of the supplied function
   */
  function fnBind(fn, that) {
    return function() {
      return fn.apply(that, arguments);
    };
  }

  ;

  /**
   * testDOMProps is a generic DOM property test; if a browser supports
   *   a certain property, it won't return undefined for it.
   *
   * @access private
   * @function testDOMProps
   * @param {Array<string>} props - An array of properties to test for
   * @param {object} obj - An object or Element you want to use to test the parameters again
   * @param {boolean|object} elem - An Element to bind the property lookup again. Use `false` to prevent the check
   * @returns {boolean|*} returns `false` if the prop is unsupported, otherwise the value that is supported
   */
  function testDOMProps(props, obj, elem) {
    var item;

    for (var i in props) {
      if (props[i] in obj) {

        // return the property name as a string
        if (elem === false) {
          return props[i];
        }

        item = obj[props[i]];

        // let's bind a function
        if (is(item, 'function')) {
          // bind to obj unless overridden
          return fnBind(item, elem || obj);
        }

        // return the unbound function or obj or value
        return item;
      }
    }
    return false;
  }

  ;

  /**
   * testPropsAll tests a list of DOM properties we want to check against.
   * We specify literally ALL possible (known and/or likely) properties on
   * the element including the non-vendor prefixed one, for forward-
   * compatibility.
   *
   * @access private
   * @function testPropsAll
   * @param {string} prop - A string of the property to test for
   * @param {string|object} [prefixed] - An object to check the prefixed properties on. Use a string to skip
   * @param {HTMLElement|SVGElement} [elem] - An element used to test the property and value against
   * @param {string} [value] - A string of a css value
   * @param {boolean} [skipValueTest] - An boolean representing if you want to test if value sticks when set
   * @returns {string|boolean} returns the string version of the property, or `false` if it is unsupported
   */
  function testPropsAll(prop, prefixed, elem, value, skipValueTest) {

    var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
      props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');

    // did they call .prefixed('boxSizing') or are we just testing a prop?
    if (is(prefixed, 'string') || is(prefixed, 'undefined')) {
      return testProps(props, prefixed, value, skipValueTest);

      // otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
    } else {
      props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
      return testDOMProps(props, prefixed, elem);
    }
  }

  // Modernizr.testAllProps() investigates whether a given style property,
  // or any of its vendor-prefixed variants, is recognized
  //
  // Note that the property names must be provided in the camelCase variant.
  // Modernizr.testAllProps('boxSizing')
  ModernizrProto.testAllProps = testPropsAll;

  

  /**
   * prefixed returns the prefixed or nonprefixed property name variant of your input
   *
   * @memberOf Modernizr
   * @name Modernizr.prefixed
   * @optionName Modernizr.prefixed()
   * @optionProp prefixed
   * @access public
   * @function prefixed
   * @param {string} prop - String name of the property to test for
   * @param {object} [obj] - An object to test for the prefixed properties on
   * @param {HTMLElement} [elem] - An element used to test specific properties against
   * @returns {string|boolean} The string representing the (possibly prefixed) valid
   * version of the property, or `false` when it is unsupported.
   * @example
   *
   * Modernizr.prefixed takes a string css value in the DOM style camelCase (as
   * opposed to the css style hyphen-case) form and returns the (possibly prefixed)
   * version of that property that the browser actually supports.
   *
   * For example, in older Firefox...
   * ```js
   * prefixed('boxSizing')
   * ```
   * returns 'MozBoxSizing'
   *
   * In newer Firefox, as well as any other browser that support the unprefixed
   * version would simply return `boxSizing`. Any browser that does not support
   * the property at all, it will return `false`.
   *
   * By default, prefixed is checked against a DOM element. If you want to check
   * for a property on another object, just pass it as a second argument
   *
   * ```js
   * var rAF = prefixed('requestAnimationFrame', window);
   *
   * raf(function() {
   *  renderFunction();
   * })
   * ```
   *
   * Note that this will return _the actual function_ - not the name of the function.
   * If you need the actual name of the property, pass in `false` as a third argument
   *
   * ```js
   * var rAFProp = prefixed('requestAnimationFrame', window, false);
   *
   * rafProp === 'WebkitRequestAnimationFrame' // in older webkit
   * ```
   *
   * One common use case for prefixed is if you're trying to determine which transition
   * end event to bind to, you might do something like...
   * ```js
   * var transEndEventNames = {
   *     'WebkitTransition' : 'webkitTransitionEnd', * Saf 6, Android Browser
   *     'MozTransition'    : 'transitionend',       * only for FF < 15
   *     'transition'       : 'transitionend'        * IE10, Opera, Chrome, FF 15+, Saf 7+
   * };
   *
   * var transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
   * ```
   *
   * If you want a similar lookup, but in hyphen-case, you can use [prefixedCSS](#modernizr-prefixedcss).
   */
  var prefixed = ModernizrProto.prefixed = function(prop, obj, elem) {
    if (prop.indexOf('@') === 0) {
      return atRule(prop);
    }

    if (prop.indexOf('-') !== -1) {
      // Convert hyphen-case to camelCase
      prop = cssToDOM(prop);
    }
    if (!obj) {
      return testPropsAll(prop, 'pfx');
    } else {
      // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
      return testPropsAll(prop, obj, elem);
    }
  };

  

  /**
   * List of property values to set for css tests. See ticket #21
   * https://github.com/modernizr/modernizr/issues/21
   *
   * @memberOf Modernizr
   * @name Modernizr._prefixes
   * @optionName Modernizr._prefixes
   * @optionProp prefixes
   * @access public
   * @example
   *
   * Modernizr._prefixes is the internal list of prefixes that we test against
   * inside of things like [prefixed](#modernizr-prefixed) and [prefixedCSS](#-code-modernizr-prefixedcss). It is simply
   * an array of hyphen-case vendor prefixes you can use within your code.
   *
   * Some common use cases include
   *
   * Generating all possible prefixed version of a CSS property
   * ```js
   * var rule = Modernizr._prefixes.join('transform: rotate(20deg); ');
   *
   * rule === 'transform: rotate(20deg); webkit-transform: rotate(20deg); moz-transform: rotate(20deg); o-transform: rotate(20deg); ms-transform: rotate(20deg);'
   * ```
   *
   * Generating all possible prefixed version of a CSS value
   * ```js
   * rule = 'display:' +  Modernizr._prefixes.join('flex; display:') + 'flex';
   *
   * rule === 'display:flex; display:-webkit-flex; display:-moz-flex; display:-o-flex; display:-ms-flex; display:flex'
   * ```
   */
  // we use ['',''] rather than an empty array in order to allow a pattern of .`join()`ing prefixes to test
  // values in feature detects to continue to work
  var prefixes = (ModernizrProto._config.usePrefixes ? ' -webkit- -moz- -o- -ms- '.split(' ') : ['','']);

  // expose these for the plugin API. Look in the source for how to join() them against your input
  ModernizrProto._prefixes = prefixes;

  

  /**
   * prefixedCSS is just like [prefixed](#modernizr-prefixed), but the returned values are in
   * hyphen-case (e.g. `box-sizing`) rather than camelCase (boxSizing).
   *
   * @memberOf Modernizr
   * @name Modernizr.prefixedCSS
   * @optionName Modernizr.prefixedCSS()
   * @optionProp prefixedCSS
   * @access public
   * @function prefixedCSS
   * @param {string} prop - String name of the property to test for
   * @returns {string|boolean} The string representing the (possibly prefixed)
   * valid version of the property, or `false` when it is unsupported.
   * @example
   *
   * `Modernizr.prefixedCSS` is like `Modernizr.prefixed`, but returns the result
   * in hyphenated form
   *
   * ```js
   * Modernizr.prefixedCSS('transition') // '-moz-transition' in old Firefox
   * ```
   *
   * Since it is only useful for CSS style properties, it can only be tested against
   * an HTMLElement.
   *
   * Properties can be passed as both the DOM style camelCase or CSS style hyphen-case.
   */
  var prefixedCSS = ModernizrProto.prefixedCSS = function(prop) {
    var prefixedProp = prefixed(prop);
    return prefixedProp && domToCSS(prefixedProp);
  };

  

  /**
   * testAllProps determines whether a given CSS property is supported in the browser
   *
   * @memberOf Modernizr
   * @name Modernizr.testAllProps
   * @optionName Modernizr.testAllProps()
   * @optionProp testAllProps
   * @access public
   * @function testAllProps
   * @param {string} prop - String naming the property to test (either camelCase or hyphen-case)
   * @param {string} [value] - String of the value to test
   * @param {boolean} [skipValueTest=false] - Whether to skip testing that the value is supported when using non-native detection
   * @returns {string|boolean} returns the string version of the property, or `false` if it is unsupported
   * @example
   *
   * testAllProps determines whether a given CSS property, in some prefixed form,
   * is supported by the browser.
   *
   * ```js
   * testAllProps('boxSizing')  // true
   * ```
   *
   * It can optionally be given a CSS value in string form to test if a property
   * value is valid
   *
   * ```js
   * testAllProps('display', 'block') // true
   * testAllProps('display', 'penguin') // false
   * ```
   *
   * A boolean can be passed as a third parameter to skip the value check when
   * native detection (@supports) isn't available.
   *
   * ```js
   * testAllProps('shapeOutside', 'content-box', true);
   * ```
   */
  function testAllProps(prop, value, skipValueTest) {
    return testPropsAll(prop, undefined, undefined, value, skipValueTest);
  }

  ModernizrProto.testAllProps = testAllProps;

  

  /**
   * testProp() investigates whether a given style property is recognized
   * Property names can be provided in either camelCase or hyphen-case.
   *
   * @memberOf Modernizr
   * @name Modernizr.testProp
   * @access public
   * @optionName Modernizr.testProp()
   * @optionProp testProp
   * @function testProp
   * @param {string} prop - Name of the CSS property to check
   * @param {string} [value] - Name of the CSS value to check
   * @param {boolean} [useValue] - Whether or not to check the value if @supports isn't supported
   * @returns {boolean} an empty string if the property is supported, undefined if its unsupported
   * @example
   *
   * Just like [testAllProps](#modernizr-testallprops), only it does not check any vendor prefixed
   * version of the string.
   *
   * Note that the property name must be provided in camelCase (e.g. boxSizing not box-sizing)
   *
   * ```js
   * Modernizr.testProp('pointerEvents')  // true
   * ```
   *
   * You can also provide a value as an optional second argument to check if a
   * specific value is supported
   *
   * ```js
   * Modernizr.testProp('pointerEvents', 'none') // true
   * Modernizr.testProp('pointerEvents', 'penguin') // false
   * ```
   */
  var testProp = ModernizrProto.testProp = function(prop, value, useValue) {
    return testProps([prop], undefined, value, useValue);
  };

  

  /**
   * testStyles injects an element with style element and some CSS rules
   *
   * @memberOf Modernizr
   * @name Modernizr.testStyles
   * @optionName Modernizr.testStyles()
   * @optionProp testStyles
   * @access public
   * @function testStyles
   * @param {string} rule - String representing a css rule
   * @param {Function} callback - A function that is used to test the injected element
   * @param {number} [nodes] - An integer representing the number of additional nodes you want injected
   * @param {string[]} [testnames] - An array of strings that are used as ids for the additional nodes
   * @returns {boolean}
   * @example
   *
   * `Modernizr.testStyles` takes a CSS rule and injects it onto the current page
   * along with (possibly multiple) DOM elements. This lets you check for features
   * that can not be detected by simply checking the [IDL](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Interface_development_guide/IDL_interface_rules).
   *
   * ```js
   * Modernizr.testStyles('#modernizr { width: 9px; color: papayawhip; }', function(elem, rule) {
   *   // elem is the first DOM node in the page (by default #modernizr)
   *   // rule is the first argument you supplied - the CSS rule in string form
   *
   *   addTest('widthworks', elem.style.width === '9px')
   * });
   * ```
   *
   * If your test requires multiple nodes, you can include a third argument
   * indicating how many additional div elements to include on the page. The
   * additional nodes are injected as children of the `elem` that is returned as
   * the first argument to the callback.
   *
   * ```js
   * Modernizr.testStyles('#modernizr {width: 1px}; #modernizr2 {width: 2px}', function(elem) {
   *   document.getElementById('modernizr').style.width === '1px'; // true
   *   document.getElementById('modernizr2').style.width === '2px'; // true
   *   elem.firstChild === document.getElementById('modernizr2'); // true
   * }, 1);
   * ```
   *
   * By default, all of the additional elements have an ID of `modernizr[n]`, where
   * `n` is its index (e.g. the first additional, second overall is `#modernizr2`,
   * the second additional is `#modernizr3`, etc.).
   * If you want to have more meaningful IDs for your function, you can provide
   * them as the fourth argument, as an array of strings
   *
   * ```js
   * Modernizr.testStyles('#foo {width: 10px}; #bar {height: 20px}', function(elem) {
   *   elem.firstChild === document.getElementById('foo'); // true
   *   elem.lastChild === document.getElementById('bar'); // true
   * }, 2, ['foo', 'bar']);
   * ```
   */
  var testStyles = ModernizrProto.testStyles = injectElementWithStyles;
  
/*!
{
  "name": "Flexbox",
  "property": "flexbox",
  "caniuse": "flexbox",
  "tags": ["css"],
  "notes": [{
    "name": "The _new_ flexbox",
    "href": "https://www.w3.org/TR/css-flexbox-1/"
  }],
  "warnings": [
    "A `true` result for this detect does not imply that the `flex-wrap` property is supported; see the `flexwrap` detect."
  ]
}
!*/
/* DOC
Detects support for the Flexible Box Layout model, a.k.a. Flexbox, which allows easy manipulation of layout order and sizing within a container.
*/

  Modernizr.addTest('flexbox', testAllProps('flexBasis', '1px', true));

/*!
{
  "name": "Flexbox (legacy)",
  "property": "flexboxlegacy",
  "tags": ["css"],
  "polyfills": ["flexie"],
  "notes": [{
    "name": "The _old_ flexbox",
    "href": "https://www.w3.org/TR/2009/WD-css3-flexbox-20090723/"
  }]
}
!*/

  Modernizr.addTest('flexboxlegacy', testAllProps('boxDirection', 'reverse', true));

/*!
{
  "name": "Canvas",
  "property": "canvas",
  "caniuse": "canvas",
  "tags": ["canvas", "graphics"],
  "polyfills": ["flashcanvas", "excanvas", "slcanvas", "fxcanvas"]
}
!*/
/* DOC
Detects support for the `<canvas>` element for 2D drawing.
*/

  // On the S60 and BB Storm, getContext exists, but always returns undefined
  // so we actually have to call getContext() to verify
  // github.com/Modernizr/Modernizr/issues/issue/97/
  Modernizr.addTest('canvas', function() {
    var elem = createElement('canvas');
    return !!(elem.getContext && elem.getContext('2d'));
  });

/*!
{
  "name": "Canvas text",
  "property": "canvastext",
  "caniuse": "canvas-text",
  "tags": ["canvas", "graphics"],
  "polyfills": ["canvastext"]
}
!*/
/* DOC
Detects support for the text APIs for `<canvas>` elements.
*/

  Modernizr.addTest('canvastext', function() {
    if (Modernizr.canvas === false) {
      return false;
    }
    return typeof createElement('canvas').getContext('2d').fillText === 'function';
  });

/*!
{
  "name": "WebGL",
  "property": "webgl",
  "caniuse": "webgl",
  "tags": ["webgl", "graphics"],
  "polyfills": ["jebgl", "cwebgl", "iewebgl"]
}
!*/

  Modernizr.addTest('webgl', function() {
    return 'WebGLRenderingContext' in window;
  });

/*!
{
  "name": "Force Touch Events",
  "property": "forcetouch",
  "authors": ["Kraig Walker"],
  "notes": [{
    "name": "Responding to Force Touch Events from JavaScript",
    "href": "https://developer.apple.com/library/archive/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html"
  }]
}
!*/
/* DOC
Tests whether the browser supports the detection of Force Touch Events.
Force Touch Events allow custom behaviours and interactions to take place based on the given pressure or change in pressure from a compatible trackpad.

Force Touch events are available in OS X 10.11 and later on devices equipped with Force Touch trackpads.
*/

  Modernizr.addTest('forcetouch', function() {
    // github.com/Modernizr/Modernizr/issues/1613
    // Test if the browser supports the force touch event progression (see notes link)
    if (!hasEvent(prefixed('mouseforcewillbegin', window, false), window)) {
      return false;
    }

    // Test if the browser provides thresholds defining a "force touch" from a normal touch/click event
    return MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN && MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN;
  });

/*!
{
  "name": "Geolocation API",
  "property": "geolocation",
  "caniuse": "geolocation",
  "tags": ["media"],
  "notes": [{
    "name": "MDN Docs",
    "href": "https://developer.mozilla.org/en-US/docs/WebAPI/Using_geolocation"
  }],
  "polyfills": [
    "joshuabell-polyfill",
    "webshims",
    "geo-location-javascript",
    "geolocation-api-polyfill"
  ]
}
!*/
/* DOC
Detects support for the Geolocation API for users to provide their location to web applications.
*/

  // geolocation is often considered a trivial feature detect...
  // Turns out, it's quite tricky to get right:
  //
  // Using !!navigator.geolocation does two things we don't want. It:
  //   1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
  //   2. Disables page caching in WebKit: webk.it/43956
  //
  // Meanwhile, in Firefox < 8, an about:config setting could expose
  // a false positive that would throw an exception: bugzil.la/688158

  Modernizr.addTest('geolocation', 'geolocation' in navigator);

/*!
{
  "name": "Hashchange event",
  "property": "hashchange",
  "caniuse": "hashchange",
  "tags": ["history"],
  "notes": [{
    "name": "MDN Docs",
    "href": "https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange"
  }],
  "polyfills": [
    "jquery-hashchange",
    "moo-historymanager",
    "jquery-ajaxy",
    "hasher",
    "shistory"
  ]
}
!*/
/* DOC
Detects support for the `hashchange` event, fired when the current location fragment changes.
*/

  Modernizr.addTest('hashchange', function() {
    if (hasEvent('hashchange', window) === false) {
      return false;
    }

    // documentMode logic from YUI to filter out IE8 Compat Mode
    //   which false positives.
    return (document.documentMode === undefined || document.documentMode > 7);
  });

/*!
{
  "name": "postMessage",
  "property": "postmessage",
  "caniuse": "x-doc-messaging",
  "notes": [{
    "name": "W3C Spec",
    "href": "https://www.w3.org/TR/webmessaging/#crossDocumentMessages"
  }],
  "polyfills": ["easyxdm", "postmessage-jquery"],
  "knownBugs": ["structuredclones - Android 2&3 can not send a structured clone of dates, filelists or regexps"],
  "warnings": ["Some old WebKit versions have bugs. Stick with object, array, number and pixeldata to be safe."]
}
!*/
/* DOC
Detects support for the `window.postMessage` protocol for cross-document messaging.
`Modernizr.postmessage.structuredclones` reports if `postMessage` can send objects.
*/

  var bool = true;
  try {
    window.postMessage({ toString: function () { bool = false; } }, '*');
  } catch (e) {}

  Modernizr.addTest('postmessage', new Boolean('postMessage' in window));
  Modernizr.addTest('postmessage.structuredclones', bool);

/*!
{
  "name": "Web SQL Database",
  "property": "websqldatabase",
  "caniuse": "sql-storage",
  "tags": ["storage"]
}
!*/

  // Chrome incognito mode used to throw an exception when using openDatabase
  // It doesn't anymore.
  Modernizr.addTest('websqldatabase', 'openDatabase' in window);

/*!
{
  "name": "IndexedDB",
  "property": "indexeddb",
  "caniuse": "indexeddb",
  "tags": ["storage"],
  "polyfills": ["indexeddb"],
  "async": true
}
!*/
/* DOC
Detects support for the IndexedDB client-side storage API (final spec).
*/

  // Vendors had inconsistent prefixing with the experimental Indexed DB:
  // - Webkit's implementation is accessible through webkitIndexedDB
  // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
  // For speed, we don't test the legacy (and beta-only) indexedDB

  Modernizr.addAsyncTest(function() {

    var indexeddb;

    try {
      // Firefox throws a Security Error when cookies are disabled
      indexeddb = prefixed('indexedDB', window);
    } catch (e) {
    }

    if (indexeddb) {
      var testDBName = 'modernizr-' + Math.random();
      var req;
      try {
        req = indexeddb.open(testDBName);
      } catch (e) {
        addTest('indexeddb', false);
        return;
      }

      req.onerror = function(event) {
        if (req.error && (req.error.name === 'InvalidStateError' || req.error.name === 'UnknownError')) {
          addTest('indexeddb', false);
          event.preventDefault();
        } else {
          addTest('indexeddb', true);
          detectDeleteDatabase(indexeddb, testDBName);
        }
      };

      req.onsuccess = function() {
        addTest('indexeddb', true);
        detectDeleteDatabase(indexeddb, testDBName);
      };
    } else {
      addTest('indexeddb', false);
    }
  });

  function detectDeleteDatabase(indexeddb, testDBName) {
    var deleteReq = indexeddb.deleteDatabase(testDBName);
    deleteReq.onsuccess = function() {
      addTest('indexeddb.deletedatabase', true);
    };
    deleteReq.onerror = function() {
      addTest('indexeddb.deletedatabase', false);
    };
  }

;
/*!
{
  "name": "History API",
  "property": "history",
  "caniuse": "history",
  "tags": ["history"],
  "authors": ["Hay Kranen", "Alexander Farkas"],
  "notes": [{
    "name": "W3C Spec",
    "href": "https://www.w3.org/TR/html51/browsers.html#the-history-interface"
  }, {
    "name": "MDN Docs",
    "href": "https://developer.mozilla.org/en-US/docs/Web/API/window.history"
  }],
  "polyfills": ["historyjs", "html5historyapi"]
}
!*/
/* DOC
Detects support for the History API for manipulating the browser session history.
*/

  Modernizr.addTest('history', function() {
    // Issue #733
    // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support
    // Unfortunately support is really buggy and there is no clean way to detect
    // these bugs, so we fall back to a user agent sniff :(
    var ua = navigator.userAgent;
    
    // Some browsers allow to have empty userAgent.
    // Therefore, we need to check ua before using "indexOf" on it.
    if(!ua) {
      return false;
    }

    // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies
    // itself as 'Mobile Safari' as well, nor Windows Phone (issue #1471).
    if ((ua.indexOf('Android 2.') !== -1 ||
        (ua.indexOf('Android 4.0') !== -1)) &&
        ua.indexOf('Mobile Safari') !== -1 &&
        ua.indexOf('Chrome') === -1 &&
        ua.indexOf('Windows Phone') === -1 &&
    // Since all documents on file:// share an origin, the History apis are
    // blocked there as well
        location.protocol !== 'file:'
    ) {
      return false;
    }

    // Return the regular check
    return (window.history && 'pushState' in window.history);
  });

/*!
{
  "name": "WebSockets Support",
  "property": "websockets",
  "authors": ["Phread (@fearphage)", "Mike Sherov (@mikesherov)", "Burak Yigit Kaya (@BYK)"],
  "caniuse": "websockets",
  "tags": ["html5"],
  "warnings": [
    "This test will reject any old version of WebSockets even if it is not prefixed such as in Safari 5.1"
  ],
  "notes": [{
    "name": "CLOSING State and Spec",
    "href": "https://www.w3.org/TR/websockets/#the-websocket-interface"
  }],
  "polyfills": [
    "sockjs",
    "socketio",
    "kaazing-websocket-gateway",
    "websocketjs",
    "atmosphere",
    "graceful-websocket",
    "portal",
    "datachannel"
  ]
}
!*/

  var supports = false;
  try {
    supports = 'WebSocket' in window && window.WebSocket.CLOSING === 2;
  } catch (e) {}
  Modernizr.addTest('websockets', supports);

/*!
{
  "name": "CSS rgba",
  "caniuse": "css3-colors",
  "property": "rgba",
  "tags": ["css"],
  "notes": [{
    "name": "CSSTricks Tutorial",
    "href": "https://css-tricks.com/rgba-browser-support/"
  }]
}
!*/

  Modernizr.addTest('rgba', function() {
    var style = createElement('a').style;
    style.cssText = 'background-color:rgba(150,255,150,.5)';

    return ('' + style.backgroundColor).indexOf('rgba') > -1;
  });

/*!
{
  "name": "CSS HSLA Colors",
  "caniuse": "css3-colors",
  "property": "hsla",
  "tags": ["css"]
}
!*/

  Modernizr.addTest('hsla', function() {
    var style = createElement('a').style;
    style.cssText = 'background-color:hsla(120,40%,100%,.5)';
    return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla');
  });

/*!
{
  "name": "CSS Multiple Backgrounds",
  "caniuse": "multibackgrounds",
  "property": "multiplebgs",
  "tags": ["css"]
}
!*/

  // Setting multiple images AND a color on the background shorthand property
  // and then querying the style.background property value for the number of
  // occurrences of "url(" is a reliable method for detecting ACTUAL support for this!

  Modernizr.addTest('multiplebgs', function() {
    var style = createElement('a').style;
    style.cssText = 'background:url(https://),url(https://),red url(https://)';

    // If the UA supports multiple backgrounds, there should be three occurrences
    // of the string "url(" in the return value for elemStyle.background
    return (/(url\s*\(.*?){3}/).test(style.background);
  });

/*!
{
  "name": "Background Size",
  "property": "backgroundsize",
  "tags": ["css"],
  "knownBugs": ["This will false positive in Opera Mini - https://github.com/Modernizr/Modernizr/issues/396"],
  "notes": [{
    "name": "Related Issue",
    "href": "https://github.com/Modernizr/Modernizr/issues/396"
  }]
}
!*/

  Modernizr.addTest('backgroundsize', testAllProps('backgroundSize', '100%', true));

/*!
{
  "name": "Border Image",
  "property": "borderimage",
  "caniuse": "border-image",
  "polyfills": ["css3pie"],
  "knownBugs": ["Android < 2.0 is true, but has a broken implementation"],
  "tags": ["css"]
}
!*/

  Modernizr.addTest('borderimage', testAllProps('borderImage', 'url() 1', true));

/*!
{
  "name": "Border Radius",
  "property": "borderradius",
  "caniuse": "border-radius",
  "polyfills": ["css3pie"],
  "tags": ["css"],
  "notes": [{
    "name": "Comprehensive Compat Chart",
    "href": "https://muddledramblings.com/table-of-css3-border-radius-compliance"
  }]
}
!*/

  Modernizr.addTest('borderradius', testAllProps('borderRadius', '0px', true));

/*!
{
  "name": "Box Shadow",
  "property": "boxshadow",
  "caniuse": "css-boxshadow",
  "tags": ["css"],
  "knownBugs": [
    "WebOS false positives on this test.",
    "The Kindle Silk browser false positives"
  ]
}
!*/

  Modernizr.addTest('boxshadow', testAllProps('boxShadow', '1px 1px', true));

/*!
{
  "name": "CSS textshadow",
  "property": "textshadow",
  "caniuse": "css-textshadow",
  "tags": ["css"],
  "knownBugs": ["FF3.0 will false positive on this test"]
}
!*/

  Modernizr.addTest('textshadow', testProp('textShadow', '1px 1px'));

/*!
{
  "name": "CSS Opacity",
  "caniuse": "css-opacity",
  "property": "opacity",
  "tags": ["css"]
}
!*/

  // Browsers that actually have CSS Opacity implemented have done so
  // according to spec, which means their return values are within the
  // range of [0.0,1.0] - including the leading zero.

  Modernizr.addTest('opacity', function() {
    var style = createElement('a').style;
    style.cssText = prefixes.join('opacity:.55;');

    // The non-literal . in this regex is intentional:
    // German Chrome returns this value as 0,55
    // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
    return (/^0.55$/).test(style.opacity);
  });

/*!
{
  "name": "CSS Animations",
  "property": "cssanimations",
  "caniuse": "css-animation",
  "polyfills": ["transformie", "csssandpaper"],
  "tags": ["css"],
  "warnings": ["Android < 4 will pass this test, but can only animate a single property at a time"],
  "notes": [{
    "name": "Article: 'Dispelling the Android CSS animation myths'",
    "href": "https://web.archive.org/web/20180602074607/https://daneden.me/2011/12/14/putting-up-with-androids-bullshit/"
  }]
}
!*/
/* DOC
Detects whether or not elements can be animated using CSS
*/

  Modernizr.addTest('cssanimations', testAllProps('animationName', 'a', true));

/*!
{
  "name": "CSS Columns",
  "property": "csscolumns",
  "caniuse": "multicolumn",
  "polyfills": ["css3multicolumnjs"],
  "tags": ["css"]
}
!*/


  (function() {

    Modernizr.addTest('csscolumns', function() {
      var bool = false;
      var test = testAllProps('columnCount');
      try {
        bool = !!test;
        if (bool) {
          bool = new Boolean(bool);
        }
      } catch (e) {}

      return bool;
    });

    var props = ['Width', 'Span', 'Fill', 'Gap', 'Rule', 'RuleColor', 'RuleStyle', 'RuleWidth', 'BreakBefore', 'BreakAfter', 'BreakInside'];
    var name, test;

    for (var i = 0; i < props.length; i++) {
      name = props[i].toLowerCase();
      test = testAllProps('column' + props[i]);

      // break-before, break-after & break-inside are not "column"-prefixed in spec
      if (name === 'breakbefore' || name === 'breakafter' || name === 'breakinside') {
        test = test || testAllProps(props[i]);
      }

      Modernizr.addTest('csscolumns.' + name, test);
    }
  })();

/*!
{
  "name": "CSS Gradients",
  "caniuse": "css-gradients",
  "property": "cssgradients",
  "tags": ["css"],
  "knownBugs": ["False-positives on webOS (https://github.com/Modernizr/Modernizr/issues/202)"],
  "notes": [{
    "name": "Webkit Gradient Syntax",
    "href": "https://webkit.org/blog/175/introducing-css-gradients/"
  }, {
    "name": "Linear Gradient Syntax",
    "href": "https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient"
  }, {
    "name": "W3C Spec",
    "href": "https://drafts.csswg.org/css-images-3/#gradients"
  }]
}
!*/


  Modernizr.addTest('cssgradients', function() {

    var str1 = 'background-image:';
    var str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));';
    var css = '';
    var angle;

    for (var i = 0, len = prefixes.length - 1; i < len; i++) {
      angle = (i === 0 ? 'to ' : '');
      css += str1 + prefixes[i] + 'linear-gradient(' + angle + 'left top, #9f9, white);';
    }

    if (Modernizr._config.usePrefixes) {
    // legacy webkit syntax (TODO:: remove when syntax not in use anymore)
      css += str1 + '-webkit-' + str2;
    }

    var elem = createElement('a');
    var style = elem.style;
    style.cssText = css;

    // IE6 returns undefined so cast to string
    return ('' + style.backgroundImage).indexOf('gradient') > -1;
  });

/*!
{
  "name": "CSS Reflections",
  "caniuse": "css-reflections",
  "property": "cssreflections",
  "tags": ["css"]
}
!*/

  Modernizr.addTest('cssreflections', testAllProps('boxReflect', 'above', true));

/*!
{
  "name": "CSS Transforms",
  "property": "csstransforms",
  "caniuse": "transforms2d",
  "tags": ["css"]
}
!*/

  Modernizr.addTest('csstransforms', function() {
    // Android < 3.0 is buggy, so we sniff and reject it
    // https://github.com/Modernizr/Modernizr/issues/903
    return navigator.userAgent.indexOf('Android 2.') === -1 &&
           testAllProps('transform', 'scale(1)', true);
  });

/*!
{
  "name": "CSS Supports",
  "property": "supports",
  "caniuse": "css-featurequeries",
  "tags": ["css"],
  "builderAliases": ["css_supports"],
  "notes": [{
    "name": "W3C Spec (The @supports rule)",
    "href": "https://dev.w3.org/csswg/css3-conditional/#at-supports"
  }, {
    "name": "Related Github Issue",
    "href": "https://github.com/Modernizr/Modernizr/issues/648"
  }, {
    "name": "W3C Spec (The CSSSupportsRule interface)",
    "href": "https://dev.w3.org/csswg/css3-conditional/#the-csssupportsrule-interface"
  }]
}
!*/

  var newSyntax = 'CSS' in window && 'supports' in window.CSS;
  var oldSyntax = 'supportsCSS' in window;
  Modernizr.addTest('supports', newSyntax || oldSyntax);

/*!
{
  "name": "CSS Transforms 3D",
  "property": "csstransforms3d",
  "caniuse": "transforms3d",
  "tags": ["css"],
  "warnings": [
    "Chrome may occasionally fail this test on some systems; more info: https://bugs.chromium.org/p/chromium/issues/detail?id=129004"
  ]
}
!*/

  Modernizr.addTest('csstransforms3d', function() {
    return !!testAllProps('perspective', '1px', true);
  });

/*!
{
  "name": "CSS Transitions",
  "property": "csstransitions",
  "caniuse": "css-transitions",
  "tags": ["css"]
}
!*/

  Modernizr.addTest('csstransitions', testAllProps('transition', 'all', true));

/*!
{
  "name": "@font-face",
  "property": "fontface",
  "authors": ["Diego Perini", "Mat Marquis"],
  "tags": ["css"],
  "knownBugs": [
    "False Positive: WebOS https://github.com/Modernizr/Modernizr/issues/342",
    "False Positive: WP7 https://github.com/Modernizr/Modernizr/issues/538"
  ],
  "notes": [{
    "name": "@font-face detection routine by Diego Perini",
    "href": "http://javascript.nwbox.com/CSSSupport/"
  }, {
    "name": "Filament Group @font-face compatibility research",
    "href": "https://docs.google.com/presentation/d/1n4NyG4uPRjAA8zn_pSQ_Ket0RhcWC6QlZ6LMjKeECo0/edit#slide=id.p"
  }, {
    "name": "Filament Grunticon/@font-face device testing results",
    "href": "https://docs.google.com/spreadsheet/ccc?key=0Ag5_yGvxpINRdHFYeUJPNnZMWUZKR2ItMEpRTXZPdUE#gid=0"
  }, {
    "name": "CSS fonts on Android",
    "href": "https://stackoverflow.com/questions/3200069/css-fonts-on-android"
  }, {
    "name": "@font-face and Android",
    "href": "http://archivist.incutio.com/viewlist/css-discuss/115960"
  }]
}
!*/

  var unsupportedUserAgent = (function() {
    var ua = navigator.userAgent;
    var webos = ua.match(/w(eb)?osbrowser/gi);
    var wppre8 = ua.match(/windows phone/gi) && ua.match(/iemobile\/([0-9])+/gi) && parseFloat(RegExp.$1) >= 9;
    return webos || wppre8;
  }());
  if (unsupportedUserAgent) {
    Modernizr.addTest('fontface', false);
  } else {
    testStyles('@font-face {font-family:"font";src:url("https://")}', function(node, rule) {
      var style = document.getElementById('smodernizr');
      var sheet = style.sheet || style.styleSheet;
      var cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
      var bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
      Modernizr.addTest('fontface', bool);
    });
  }
;
/*!
{
  "name": "CSS Generated Content",
  "property": "generatedcontent",
  "tags": ["css"],
  "warnings": ["Android won't return correct height for anything below 7px #738"],
  "notes": [{
    "name": "W3C Spec",
    "href": "https://www.w3.org/TR/css3-selectors/#gen-content"
  }, {
    "name": "MDN Docs on :before",
    "href": "https://developer.mozilla.org/en-US/docs/Web/CSS/::before"
  }, {
    "name": "MDN Docs on :after",
    "href": "https://developer.mozilla.org/en-US/docs/Web/CSS/::after"
  }]
}
!*/

  testStyles('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}', function(node) {
    // See bug report on why this value is 6 crbug.com/608142
    Modernizr.addTest('generatedcontent', node.offsetHeight >= 6);
  });

/*!
{
  "name": "HTML5 Video",
  "property": "video",
  "caniuse": "video",
  "tags": ["html5", "video", "media"],
  "knownBugs": ["Without QuickTime, `Modernizr.video.h264` will be `undefined`; https://github.com/Modernizr/Modernizr/issues/546"],
  "polyfills": [
    "html5media",
    "mediaelementjs",
    "sublimevideo",
    "videojs",
    "leanbackplayer",
    "videoforeverybody"
  ]
}
!*/
/* DOC
Detects support for the video element, as well as testing what types of content it supports.

Subproperties are provided to describe support for `ogg`, `h264`, `h265`, `webm`, `vp9`, `hls` and `av1` formats, e.g.:

```javascript
Modernizr.video         // true
Modernizr.video.ogg     // 'probably'
```
*/

  // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
  //                     thx to NielsLeenheer and zcorpan

  // Note: in some older browsers, "no" was a return value instead of empty string.
  //   It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
  //   It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5
  (function() {
    var elem = createElement('video');

    Modernizr.addTest('video', function() {
      var bool = false;
      try {
        bool = !!elem.canPlayType;
        if (bool) {
          bool = new Boolean(bool);
        }
      } catch (e) {}

      return bool;
    });

    // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
    try {
      if (!!elem.canPlayType) {
        Modernizr.addTest('video.ogg', elem.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ''));

        // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
        Modernizr.addTest('video.h264', elem.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ''));
        Modernizr.addTest('video.h265', elem.canPlayType('video/mp4; codecs="hev1"').replace(/^no$/, ''));
        Modernizr.addTest('video.webm', elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, ''));
        Modernizr.addTest('video.vp9', elem.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, ''));
        Modernizr.addTest('video.hls', elem.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, ''));
        Modernizr.addTest('video.av1', elem.canPlayType('video/mp4; codecs="av01"').replace(/^no$/, ''));
      }
    } catch (e) {}
  })();

/*!
{
  "name": "HTML5 Audio Element",
  "property": "audio",
  "caniuse": "audio",
  "tags": ["html5", "audio", "media"],
  "notes": [{
    "name": "MDN Docs",
    "href": "https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements"
  }]
}
!*/
/* DOC
Detects support of the audio element, as well as testing what types of content it supports.

Subproperties are provided to describe support for `ogg`, `mp3`,`opus`, `wav` and `m4a` formats, e.g.:

```javascript
Modernizr.audio         // true
Modernizr.audio.ogg     // 'probably'
```
*/

  // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
  //                     thx to NielsLeenheer and zcorpan

  // Note: in some older browsers, "no" was a return value instead of empty string.
  //   It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
  //   It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5
  (function() {
    var elem = createElement('audio');

    Modernizr.addTest('audio', function() {
      var bool = false;
      try {
        bool = !!elem.canPlayType;
        if (bool) {
          bool = new Boolean(bool);
        }
      } catch (e) {}

      return bool;
    });

    // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
    try {
      if (!!elem.canPlayType) {
        Modernizr.addTest('audio.ogg', elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ''));
        Modernizr.addTest('audio.mp3', elem.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, ''));
        Modernizr.addTest('audio.opus', elem.canPlayType('audio/ogg; codecs="opus"') ||
          elem.canPlayType('audio/webm; codecs="opus"').replace(/^no$/, ''));
        Modernizr.addTest('audio.wav', elem.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ''));
        Modernizr.addTest('audio.m4a', (elem.canPlayType('audio/x-m4a;') ||
          elem.canPlayType('audio/aac;')).replace(/^no$/, ''));
      }
    } catch (e) {}
  })();

/*!
{
  "name": "Local Storage",
  "property": "localstorage",
  "caniuse": "namevalue-storage",
  "tags": ["storage"],
  "polyfills": [
    "joshuabell-polyfill",
    "cupcake",
    "storagepolyfill",
    "amplifyjs",
    "yui-cacheoffline"
  ]
}
!*/

  // In FF4, if disabled, window.localStorage should === null.

  // Normally, we could not test that directly and need to do a
  //   `('localStorage' in window)` test first because otherwise Firefox will
  //   throw bugzil.la/365772 if cookies are disabled

  // Similarly, in Chrome with "Block third-party cookies and site data" enabled,
  // attempting to access `window.sessionStorage` will throw an exception. crbug.com/357625

  // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
  // will throw the exception:
  //   QUOTA_EXCEEDED_ERROR DOM Exception 22.
  // Peculiarly, getItem and removeItem calls do not throw.

  // Because we are forced to try/catch this, we'll go aggressive.

  // Just FWIW: IE8 Compat mode supports these features completely:
  //   www.quirksmode.org/dom/html5.html
  // But IE8 doesn't support either with local files

  Modernizr.addTest('localstorage', function() {
    var mod = 'modernizr';
    try {
      localStorage.setItem(mod, mod);
      localStorage.removeItem(mod);
      return true;
    } catch (e) {
      return false;
    }
  });

/*!
{
  "name": "Session Storage",
  "property": "sessionstorage",
  "tags": ["storage"],
  "polyfills": ["joshuabell-polyfill", "cupcake", "sessionstorage"]
}
!*/

  // Because we are forced to try/catch this, we'll go aggressive.

  // Just FWIW: IE8 Compat mode supports these features completely:
  //   www.quirksmode.org/dom/html5.html
  // But IE8 doesn't support either with local files
  Modernizr.addTest('sessionstorage', function() {
    var mod = 'modernizr';
    try {
      sessionStorage.setItem(mod, mod);
      sessionStorage.removeItem(mod);
      return true;
    } catch (e) {
      return false;
    }
  });

/*!
{
  "name": "Web Workers",
  "property": "webworkers",
  "caniuse": "webworkers",
  "tags": ["performance", "workers"],
  "notes": [{
    "name": "W3C Spec",
    "href": "https://www.w3.org/TR/workers/"
  }, {
    "name": "HTML5 Rocks Tutorial",
    "href": "https://www.html5rocks.com/en/tutorials/workers/basics/"
  }, {
    "name": "MDN Docs",
    "href": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers"
  }],
  "polyfills": ["fakeworker", "html5shims"]
}
!*/
/* DOC
Detects support for the basic `Worker` API from the Web Workers spec. Web Workers provide a simple means for web content to run scripts in background threads.
*/

  Modernizr.addTest('webworkers', 'Worker' in window);

/*!
{
  "name": "Application Cache",
  "property": "applicationcache",
  "caniuse": "offline-apps",
  "tags": ["storage", "offline"],
  "notes": [{
    "name": "MDN Docs",
    "href": "https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache"
  }],
  "polyfills": ["html5gears"]
}
!*/
/* DOC
Detects support for the Application Cache, for storing data to enable web-based applications run offline.

The API has been [heavily criticized](https://alistapart.com/article/application-cache-is-a-douchebag) and discussions are underway to address this.
*/

  Modernizr.addTest('applicationcache', 'applicationCache' in window);

/*!
{
  "name": "SVG",
  "property": "svg",
  "caniuse": "svg",
  "tags": ["svg"],
  "authors": ["Erik Dahlstrom"],
  "polyfills": [
    "svgweb",
    "raphael",
    "amplesdk",
    "canvg",
    "svg-boilerplate",
    "sie",
    "dojogfx",
    "fabricjs"
  ]
}
!*/
/* DOC
Detects support for SVG in `<embed>` or `<object>` elements.
*/

  Modernizr.addTest('svg', !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect);

/*!
{
  "name": "Inline SVG",
  "property": "inlinesvg",
  "caniuse": "svg-html5",
  "tags": ["svg"],
  "notes": [{
    "name": "Test page",
    "href": "https://paulirish.com/demo/inline-svg"
  }, {
    "name": "Test page and results",
    "href": "https://codepen.io/eltonmesquita/full/GgXbvo/"
  }],
  "polyfills": ["inline-svg-polyfill"],
  "knownBugs": ["False negative on some Chromia browsers."]
}
!*/
/* DOC
Detects support for inline SVG in HTML (not within XHTML).
*/

  Modernizr.addTest('inlinesvg', function() {
    var div = createElement('div');
    div.innerHTML = '<svg/>';
    return (typeof SVGRect !== 'undefined' && div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';
  });


  /**
   * Object.prototype.toString can be used with every object and allows you to
   * get its class easily. Abstracting it off of an object prevents situations
   * where the toString property has been overridden
   *
   * @access private
   * @function toStringFn
   * @returns {Function} An abstracted toString function
   */
  var toStringFn = ({}).toString;
  
/*!
{
  "name": "SVG SMIL animation",
  "property": "smil",
  "caniuse": "svg-smil",
  "tags": ["svg"],
  "notes": [{
  "name": "W3C Spec",
  "href": "https://www.w3.org/AudioVideo/"
  }]
}
!*/

  // SVG SMIL animation
  Modernizr.addTest('smil', function() {
    return !!document.createElementNS &&
      /SVGAnimate/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'animate')));
  });

/*!
{
  "name": "SVG clip paths",
  "property": "svgclippaths",
  "tags": ["svg"],
  "notes": [{
    "name": "Demo",
    "href": "http://srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg"
  }]
}
!*/
/* DOC
Detects support for clip paths in SVG (only, not on HTML content).

See [this discussion](https://github.com/Modernizr/Modernizr/issues/213) regarding applying SVG clip paths to HTML content.
*/

  Modernizr.addTest('svgclippaths', function() {
    return !!document.createElementNS &&
      /SVGClipPath/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'clipPath')));
  });


  // Run each test
  testRunner();

  // Remove the "no-js" class if it exists
  setClasses(classes);

  delete ModernizrProto.addTest;
  delete ModernizrProto.addAsyncTest;

  // Run the things that are supposed to run after the tests
  for (var i = 0; i < Modernizr._q.length; i++) {
    Modernizr._q[i]();
  }

  // Leak Modernizr namespace
  scriptGlobalObject.Modernizr = Modernizr;


;

})(window, window, document);
;
/*
 AngularJS v1.8.2
 (c) 2010-2020 Google LLC. http://angularjs.org
 License: MIT
*/
(function(z){'use strict';function ve(a){if(D(a))w(a.objectMaxDepth)&&(Xb.objectMaxDepth=Yb(a.objectMaxDepth)?a.objectMaxDepth:NaN),w(a.urlErrorParamsEnabled)&&Ga(a.urlErrorParamsEnabled)&&(Xb.urlErrorParamsEnabled=a.urlErrorParamsEnabled);else return Xb}function Yb(a){return X(a)&&0<a}function F(a,b){b=b||Error;return function(){var d=arguments[0],c;c="["+(a?a+":":"")+d+"] http://errors.angularjs.org/1.8.2/"+(a?a+"/":"")+d;for(d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,
f;f=arguments[d];f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof f?"undefined":"string"!=typeof f?JSON.stringify(f):f;c+=e(f)}return new b(c)}}function za(a){if(null==a||$a(a))return!1;if(H(a)||C(a)||x&&a instanceof x)return!0;var b="length"in Object(a)&&a.length;return X(b)&&(0<=b&&b-1 in a||"function"===typeof a.item)}function r(a,b,d){var c,e;if(a)if(B(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(H(a)||
za(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==r)a.forEach(b,d,a);else if(Pc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)ta.call(a,c)&&b.call(d,a[c],c,a);return a}function Qc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Zb(a){return function(b,d){a(d,b)}}function we(){return++qb}
function $b(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(D(g)||B(g))for(var k=Object.keys(g),h=0,l=k.length;h<l;h++){var m=k[h],p=g[m];d&&D(p)?ha(p)?a[m]=new Date(p.valueOf()):ab(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):ac(p)?a[m]=p.clone():"__proto__"!==m&&(D(a[m])||(a[m]=H(p)?[]:{}),$b(a[m],[p],!0)):a[m]=p}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function S(a){return $b(a,Ha.call(arguments,1),!1)}function xe(a){return $b(a,Ha.call(arguments,1),!0)}function fa(a){return parseInt(a,
10)}function bc(a,b){return S(Object.create(a),b)}function E(){}function Ta(a){return a}function ia(a){return function(){return a}}function cc(a){return B(a.toString)&&a.toString!==la}function A(a){return"undefined"===typeof a}function w(a){return"undefined"!==typeof a}function D(a){return null!==a&&"object"===typeof a}function Pc(a){return null!==a&&"object"===typeof a&&!Rc(a)}function C(a){return"string"===typeof a}function X(a){return"number"===typeof a}function ha(a){return"[object Date]"===la.call(a)}
function H(a){return Array.isArray(a)||a instanceof Array}function dc(a){switch(la.call(a)){case "[object Error]":return!0;case "[object Exception]":return!0;case "[object DOMException]":return!0;default:return a instanceof Error}}function B(a){return"function"===typeof a}function ab(a){return"[object RegExp]"===la.call(a)}function $a(a){return a&&a.window===a}function bb(a){return a&&a.$evalAsync&&a.$watch}function Ga(a){return"boolean"===typeof a}function ye(a){return a&&X(a.length)&&ze.test(la.call(a))}
function ac(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function Ae(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function ua(a){return K(a.nodeName||a[0]&&a[0].nodeName)}function cb(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function Ia(a,b,d){function c(a,b,c){c--;if(0>c)return"...";var d=b.$$hashKey,f;if(H(a)){f=0;for(var g=a.length;f<g;f++)b.push(e(a[f],c))}else if(Pc(a))for(f in a)b[f]=e(a[f],c);else if(a&&"function"===typeof a.hasOwnProperty)for(f in a)a.hasOwnProperty(f)&&
(b[f]=e(a[f],c));else for(f in a)ta.call(a,f)&&(b[f]=e(a[f],c));d?b.$$hashKey=d:delete b.$$hashKey;return b}function e(a,b){if(!D(a))return a;var d=g.indexOf(a);if(-1!==d)return k[d];if($a(a)||bb(a))throw oa("cpws");var d=!1,e=f(a);void 0===e&&(e=H(a)?[]:Object.create(Rc(a)),d=!0);g.push(a);k.push(e);return d?c(a,e,b):e}function f(a){switch(la.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(e(a.buffer),
a.byteOffset,a.length);case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(B(a.cloneNode))return a.cloneNode(!0)}
var g=[],k=[];d=Yb(d)?d:NaN;if(b){if(ye(b)||"[object ArrayBuffer]"===la.call(b))throw oa("cpta");if(a===b)throw oa("cpi");H(b)?b.length=0:r(b,function(a,c){"$$hashKey"!==c&&delete b[c]});g.push(a);k.push(b);return c(a,b,d)}return e(a,d)}function ec(a,b){return a===b||a!==a&&b!==b}function va(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d===typeof b&&"object"===d)if(H(a)){if(!H(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!va(a[c],
b[c]))return!1;return!0}}else{if(ha(a))return ha(b)?ec(a.getTime(),b.getTime()):!1;if(ab(a))return ab(b)?a.toString()===b.toString():!1;if(bb(a)||bb(b)||$a(a)||$a(b)||H(b)||ha(b)||ab(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!B(a[c])){if(!va(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&w(b[c])&&!B(b[c]))return!1;return!0}return!1}function db(a,b,d){return a.concat(Ha.call(b,d))}function Va(a,b){var d=2<arguments.length?Ha.call(arguments,2):[];return!B(b)||b instanceof
RegExp?b:d.length?function(){return arguments.length?b.apply(a,db(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Sc(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:$a(b)?d="$WINDOW":b&&z.document===b?d="$DOCUMENT":bb(b)&&(d="$SCOPE");return d}function eb(a,b){if(!A(a))return X(b)||(b=b?2:null),JSON.stringify(a,Sc,b)}function Tc(a){return C(a)?JSON.parse(a):a}function fc(a,b){a=a.replace(Be,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+
a)/6E4;return Y(d)?b:d}function Uc(a,b){a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function gc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=fc(b,c);return Uc(a,d*(b-c))}function Aa(a){a=x(a).clone().empty();var b=x("<div></div>").append(a).html();try{return a[0].nodeType===Pa?K(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+K(b)})}catch(d){return K(b)}}function Vc(a){try{return decodeURIComponent(a)}catch(b){}}function hc(a){var b={};r((a||"").split("&"),
function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Vc(e),w(e)&&(f=w(f)?Vc(f):!0,ta.call(b,e)?H(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Ce(a){var b=[];r(a,function(a,c){H(a)?r(a,function(a){b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))}):b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))});return b.length?b.join("&"):""}function ic(a){return ba(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ba(a,
b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function De(a,b){var d,c,e=Qa.length;for(c=0;c<e;++c)if(d=Qa[c]+b,C(d=a.getAttribute(d)))return d;return null}function Ee(a,b){var d,c,e={};r(Qa,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});r(Qa,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});
d&&(Fe?(e.strictDi=null!==De(d,"strict-di"),b(d,c?[c]:[],e)):z.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match."))}function Wc(a,b,d){D(d)||(d={});d=S({strictDi:!1},d);var c=function(){a=x(a);if(a.injector()){var c=a[0]===z.document?"document":Aa(a);throw oa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",
function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=fb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;z&&e.test(z.name)&&(d.debugInfoEnabled=!0,z.name=z.name.replace(e,""));if(z&&!f.test(z.name))return c();z.name=z.name.replace(f,"");ca.resumeBootstrap=function(a){r(a,function(a){b.push(a)});return c()};B(ca.resumeDeferredBootstrap)&&
ca.resumeDeferredBootstrap()}function Ge(){z.name="NG_ENABLE_DEBUG_INFO!"+z.name;z.location.reload()}function He(a){a=ca.element(a).injector();if(!a)throw oa("test");return a.get("$$testability")}function Xc(a,b){b=b||"_";return a.replace(Ie,function(a,c){return(c?b:"")+a.toLowerCase()})}function Je(){var a;if(!Yc){var b=rb();(sb=A(b)?z.jQuery:b?z[b]:void 0)&&sb.fn.on?(x=sb,S(sb.fn,{scope:Wa.scope,isolateScope:Wa.isolateScope,controller:Wa.controller,injector:Wa.injector,inheritedData:Wa.inheritedData})):
x=U;a=x.cleanData;x.cleanData=function(b){for(var c,e=0,f;null!=(f=b[e]);e++)(c=(x._data(f)||{}).events)&&c.$destroy&&x(f).triggerHandler("$destroy");a(b)};ca.element=x;Yc=!0}}function Ke(){U.legacyXHTMLReplacement=!0}function gb(a,b,d){if(!a)throw oa("areq",b||"?",d||"required");return a}function tb(a,b,d){d&&H(a)&&(a=a[a.length-1]);gb(B(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ja(a,b){if("hasOwnProperty"===a)throw oa("badname",
b);}function Le(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g<f;g++)c=b[g],a&&(a=(e=a)[c]);return!d&&B(a)?Va(e,a):a}function ub(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=x(Ha.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function jc(a){if(null==a)return"";switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=!cc(a)||H(a)||ha(a)?eb(a):a.toString()}return a}function Me(a){function b(a,
b,c){return a[b]||(a[b]=c())}var d=F("$injector"),c=F("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||F;return b(a,"module",function(){var a={};return function(f,g,k){var h={};if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&(a[f]=null);return b(a,f,function(){function a(b,c,d,f){f||(f=e);return function(){f[d||"push"]([b,c,arguments]);return t}}function b(a,c,d){d||(d=e);return function(b,e){e&&B(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return t}}if(!g)throw d("nomod",
f);var e=[],n=[],s=[],G=a("$injector","invoke","push",n),t={_invokeQueue:e,_configBlocks:n,_runBlocks:s,info:function(a){if(w(a)){if(!D(a))throw c("aobj","value");h=a;return this}return h},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider",
"register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:G,run:function(a){s.push(a);return this}};k&&G(k);return t})}})}function ja(a,b){if(H(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(D(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function Ne(a,b){var d=[];Yb(b)&&(a=ca.copy(a,null,b));return JSON.stringify(a,function(a,b){b=Sc(a,b);if(D(b)){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}
function Oe(a){S(a,{errorHandlingConfig:ve,bootstrap:Wc,copy:Ia,extend:S,merge:xe,equals:va,element:x,forEach:r,injector:fb,noop:E,bind:Va,toJson:eb,fromJson:Tc,identity:Ta,isUndefined:A,isDefined:w,isString:C,isFunction:B,isObject:D,isNumber:X,isElement:ac,isArray:H,version:Pe,isDate:ha,callbacks:{$$counter:0},getTestability:He,reloadWithDebugInfo:Ge,UNSAFE_restoreLegacyJqLiteXHTMLReplacement:Ke,$$minErr:F,$$csp:Ba,$$encodeUriSegment:ic,$$encodeUriQuery:ba,$$lowercase:K,$$stringify:jc,$$uppercase:vb});
lc=Me(z);lc("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Qe});a.provider("$compile",Zc).directive({a:Re,input:$c,textarea:$c,form:Se,script:Te,select:Ue,option:Ve,ngBind:We,ngBindHtml:Xe,ngBindTemplate:Ye,ngClass:Ze,ngClassEven:$e,ngClassOdd:af,ngCloak:bf,ngController:cf,ngForm:df,ngHide:ef,ngIf:ff,ngInclude:gf,ngInit:hf,ngNonBindable:jf,ngPluralize:kf,ngRef:lf,ngRepeat:mf,ngShow:nf,ngStyle:of,ngSwitch:pf,ngSwitchWhen:qf,ngSwitchDefault:rf,ngOptions:sf,ngTransclude:tf,ngModel:uf,
ngList:vf,ngChange:wf,pattern:ad,ngPattern:ad,required:bd,ngRequired:bd,minlength:cd,ngMinlength:cd,maxlength:dd,ngMaxlength:dd,ngValue:xf,ngModelOptions:yf}).directive({ngInclude:zf,input:Af}).directive(wb).directive(ed);a.provider({$anchorScroll:Bf,$animate:Cf,$animateCss:Df,$$animateJs:Ef,$$animateQueue:Ff,$$AnimateRunner:Gf,$$animateAsyncRun:Hf,$browser:If,$cacheFactory:Jf,$controller:Kf,$document:Lf,$$isDocumentHidden:Mf,$exceptionHandler:Nf,$filter:fd,$$forceReflow:Of,$interpolate:Pf,$interval:Qf,
$$intervalFactory:Rf,$http:Sf,$httpParamSerializer:Tf,$httpParamSerializerJQLike:Uf,$httpBackend:Vf,$xhrFactory:Wf,$jsonpCallbacks:Xf,$location:Yf,$log:Zf,$parse:$f,$rootScope:ag,$q:bg,$$q:cg,$sce:dg,$sceDelegate:eg,$sniffer:fg,$$taskTrackerFactory:gg,$templateCache:hg,$templateRequest:ig,$$testability:jg,$timeout:kg,$window:lg,$$rAF:mg,$$jqLite:ng,$$Map:og,$$cookieReader:pg})}]).info({angularVersion:"1.8.2"})}function xb(a,b){return b.toUpperCase()}function yb(a){return a.replace(qg,xb)}function mc(a){a=
a.nodeType;return 1===a||!a||9===a}function gd(a,b){var d,c,e,f=b.createDocumentFragment(),g=[],k;if(nc.test(a)){d=f.appendChild(b.createElement("div"));c=(rg.exec(a)||["",""])[1].toLowerCase();e=U.legacyXHTMLReplacement?a.replace(sg,"<$1></$2>"):a;if(10>wa)for(c=hb[c]||hb._default,d.innerHTML=c[1]+e+c[2],k=c[0];k--;)d=d.firstChild;else{c=qa[c]||[];for(k=c.length;-1<--k;)d.appendChild(z.document.createElement(c[k])),d=d.firstChild;d.innerHTML=e}g=db(g,d.childNodes);d=f.firstChild;d.textContent=""}else g.push(b.createTextNode(a));
f.textContent="";f.innerHTML="";r(g,function(a){f.appendChild(a)});return f}function U(a){if(a instanceof U)return a;var b;C(a)&&(a=V(a),b=!0);if(!(this instanceof U)){if(b&&"<"!==a.charAt(0))throw oc("nosel");return new U(a)}if(b){b=z.document;var d;a=(d=tg.exec(a))?[b.createElement(d[1])]:(d=gd(a,b))?d.childNodes:[];pc(this,a)}else B(a)?hd(a):pc(this,a)}function qc(a){return a.cloneNode(!0)}function zb(a,b){!b&&mc(a)&&x.cleanData([a]);a.querySelectorAll&&x.cleanData(a.querySelectorAll("*"))}function id(a){for(var b in a)return!1;
return!0}function jd(a){var b=a.ng339,d=b&&Ka[b],c=d&&d.events,d=d&&d.data;d&&!id(d)||c&&!id(c)||(delete Ka[b],a.ng339=void 0)}function kd(a,b,d,c){if(w(c))throw oc("offargs");var e=(c=Ab(a))&&c.events,f=c&&c.handle;if(f){if(b){var g=function(b){var c=e[b];w(d)&&cb(c||[],d);w(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};r(b.split(" "),function(a){g(a);Bb[a]&&g(Bb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b];jd(a)}}function rc(a,b){var d=a.ng339;if(d=
d&&Ka[d])b?delete d.data[b]:d.data={},jd(a)}function Ab(a,b){var d=a.ng339,d=d&&Ka[d];b&&!d&&(a.ng339=d=++ug,d=Ka[d]={events:{},data:{},handle:void 0});return d}function sc(a,b,d){if(mc(a)){var c,e=w(d),f=!e&&b&&!D(b),g=!b;a=(a=Ab(a,!f))&&a.data;if(e)a[yb(b)]=d;else{if(g)return a;if(f)return a&&a[yb(b)];for(c in b)a[yb(c)]=b[c]}}}function Cb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function Db(a,b){if(b&&a.setAttribute){var d=
(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=V(a);c=c.replace(" "+a+" "," ")});c!==d&&a.setAttribute("class",V(c))}}function Eb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=V(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});c!==d&&a.setAttribute("class",V(c))}}function pc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=
0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function ld(a,b){return Fb(a,"$"+(b||"ngController")+"Controller")}function Fb(a,b,d){9===a.nodeType&&(a=a.documentElement);for(b=H(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(w(d=x.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function md(a){for(zb(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Gb(a,b){b||zb(a);var d=a.parentNode;d&&d.removeChild(a)}function vg(a,b){b=b||z;if("complete"===b.document.readyState)b.setTimeout(a);
else x(b).on("load",a)}function hd(a){function b(){z.document.removeEventListener("DOMContentLoaded",b);z.removeEventListener("load",b);a()}"complete"===z.document.readyState?z.setTimeout(a):(z.document.addEventListener("DOMContentLoaded",b),z.addEventListener("load",b))}function nd(a,b){var d=Hb[b.toLowerCase()];return d&&od[ua(a)]&&d}function wg(a,b){var d=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(A(c.immediatePropagationStopped)){var k=
c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();k&&k.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var h=f.specialHandlerWrapper||xg;1<g&&(f=ja(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||h(a,c,f[l])}};d.elem=a;return d}function xg(a,b,d){d.call(a,b)}function yg(a,b,d){var c=b.relatedTarget;c&&(c===a||zg.call(a,c))||d.call(a,b)}function ng(){this.$get=
function(){return S(U,{hasClass:function(a,b){a.attr&&(a=a[0]);return Cb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return Eb(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return Db(a,b)}})}}function La(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||we)():d+":"+a}function pd(){this._keys=[];this._values=[];this._lastKey=NaN;this._lastIndex=-1}function qd(a){a=Function.prototype.toString.call(a).replace(Ag,
"");return a.match(Bg)||a.match(Cg)}function Dg(a){return(a=qd(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function fb(a,b){function d(a){return function(b,c){if(D(b))r(b,Zb(a));else return a(b,c)}}function c(a,b){Ja(a,"service");if(B(b)||H(b))b=n.instantiate(b);if(!b.$get)throw Ca("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=t.invoke(b,this);if(A(c))throw Ca("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){gb(A(a)||
H(a),"modulesToLoad","not an array");var b=[],c;r(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=n.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.set(a,!0);try{C(a)?(c=lc(a),t.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):B(a)?b.push(n.invoke(a)):H(a)?b.push(n.invoke(a)):tb(a,"module")}catch(e){throw H(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ca("modulerr",
a,e.stack||e.message||e);}}});return b}function k(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===h)throw Ca("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=h,a[b]=c(b,e),a[b]}catch(f){throw a[b]===h&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=fb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];if("string"!==typeof l)throw Ca("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&
(d=c,c=null);c=e(a,c,d);H(a)&&(a=a[a.length-1]);d=a;if(wa||"function"!==typeof d)d=!1;else{var f=d.$$ngIsClass;Ga(f)||(f=d.$$ngIsClass=/^class\b/.test(Function.prototype.toString.call(d)));d=f}return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=H(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}
b=!0===b;var h={},l=[],m=new Ib,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,ia(b),!1)}),constant:d(function(a,b){Ja(a,"constant");p[a]=b;s[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},n=p.$injector=k(p,function(a,b){ca.isString(b)&&l.push(b);throw Ca("unpr",l.join(" <- "));}),s={},
G=k(s,function(a,b){var c=n.get(a+"Provider",b);return t.invoke(c.$get,c,void 0,a)}),t=G;p.$injectorProvider={$get:ia(G)};t.modules=n.modules=T();var N=g(a),t=G.get("$injector");t.strictDi=b;r(N,function(a){a&&t.invoke(a)});t.loadNewModules=function(a){r(g(a),function(a){a&&t.invoke(a)})};return t}function Bf(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===
ua(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;B(c)?c=c():ac(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):X(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=C(a)?a:X(a)?a.toString():d.hash();var b;a?(b=k.getElementById(a))?f(b):(b=e(k.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var k=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===
b&&""===a||vg(function(){c.$evalAsync(g)})});return g}]}function ib(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;H(a)&&(a=a.join(" "));H(b)&&(b=b.join(" "));return a+" "+b}function Eg(a){C(a)&&(a=a.split(" "));var b=T();r(a,function(a){a.length&&(b[a]=!0)});return b}function ra(a){return D(a)?a:{}}function Fg(a,b,d,c,e){function f(){pa=null;k()}function g(){t=y();t=A(t)?null:t;va(t,P)&&(t=P);N=P=t}function k(){var a=N;g();if(v!==h.url()||a!==t)v=h.url(),N=t,r(J,function(a){a(h.url(),t)})}
var h=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,s={},G=e(d);h.isMock=!1;h.$$completeOutstandingRequest=G.completeTask;h.$$incOutstandingRequestCount=G.incTaskCount;h.notifyWhenNoOutstandingRequests=G.notifyWhenNoPendingTasks;var t,N,v=l.href,kc=b.find("base"),pa=null,y=c.history?function(){try{return m.state}catch(a){}}:E;g();h.url=function(b,d,e){A(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=N===e;b=ga(b).href;if(v===b&&(!c.history||f))return h;
var k=v&&Da(v)===Da(b);v=b;N=e;!c.history||k&&f?(k||(pa=b),d?l.replace(b):k?(d=l,e=b,f=e.indexOf("#"),e=-1===f?"":e.substr(f),d.hash=e):l.href=b,l.href!==b&&(pa=b)):(m[d?"replaceState":"pushState"](e,"",b),g());pa&&(pa=b);return h}return(pa||l.href).replace(/#$/,"")};h.state=function(){return t};var J=[],I=!1,P=null;h.onUrlChange=function(b){if(!I){if(c.history)x(a).on("popstate",f);x(a).on("hashchange",f);I=!0}J.push(b);return b};h.$$applicationDestroyed=function(){x(a).off("hashchange popstate",
f)};h.$$checkUrlChange=k;h.baseHref=function(){var a=kc.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""};h.defer=function(a,b,c){var d;b=b||0;c=c||G.DEFAULT_TASK_TYPE;G.incTaskCount(c);d=p(function(){delete s[d];G.completeTask(a,c)},b);s[d]=c;return d};h.defer.cancel=function(a){if(s.hasOwnProperty(a)){var b=s[a];delete s[a];n(a);G.completeTask(E,b);return!0}return!1}}function If(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(a,b,d,c,e){return new Fg(a,
c,b,d,e)}]}function Jf(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw F("$cacheFactory")("iid",a);var g=0,k=S({},c,{id:a}),h=T(),l=c&&c.capacity||Number.MAX_VALUE,m=T(),p=null,n=null;return b[a]={put:function(a,b){if(!A(b)){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in h||g++;h[a]=b;g>l&&this.remove(n.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=
m[a];if(!b)return;e(b)}return h[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p);b===n&&(n=b.n);f(b.n,b.p);delete m[a]}a in h&&(delete h[a],g--)},removeAll:function(){h=T();g=0;m=T();p=n=null},destroy:function(){m=k=h=null;delete b[a]},info:function(){return S({},k,{size:g})}}}var b={};a.info=function(){var a={};r(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function hg(){this.$get=["$cacheFactory",function(a){return a("templates")}]}
function Zc(a,b){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=T();r(a,function(a,f){a=a.trim();if(a in p)e[f]=p[a];else{var g=a.match(d);if(!g)throw $("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(p[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==K(b))throw $("baddir",a);if(a!==a.trim())throw $("baddir",a);}function e(a){var b=a.require||a.controller&&
a.name;!H(b)&&D(b)&&r(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)});return b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,k=/(([\w-]+)(?::([^;]+))?;?)/,h=Ae("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=T();this.directive=function pa(b,d){gb(b,"name");Ja(b,"directive");C(b)?(c(b),gb(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];r(f[b],function(f,
g){try{var h=a.invoke(f);B(h)?h={compile:ia(h)}:!h.compile&&h.link&&(h.compile=ia(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||b;h.require=e(h);var k=h,l=h.restrict;if(l&&(!C(l)||!/[EACM]/.test(l)))throw $("badrestrict",l,b);k.restrict=l||"EA";h.$$moduleName=f.$$moduleName;d.push(h)}catch(m){c(m)}});return d}])),f[b].push(d)):r(b,Zb(pa));return this};this.component=function y(a,b){function c(a){function e(b){return B(b)||H(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:
b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Gg(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",require:b.require};r(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}if(!C(a))return r(a,Zb(Va(this,y))),this;var d=b.controller||function(){};r(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,B(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,
c)};this.aHrefSanitizationTrustedUrlList=function(a){return w(a)?(b.aHrefSanitizationTrustedUrlList(a),this):b.aHrefSanitizationTrustedUrlList()};Object.defineProperty(this,"aHrefSanitizationWhitelist",{get:function(){return this.aHrefSanitizationTrustedUrlList},set:function(a){this.aHrefSanitizationTrustedUrlList=a}});this.imgSrcSanitizationTrustedUrlList=function(a){return w(a)?(b.imgSrcSanitizationTrustedUrlList(a),this):b.imgSrcSanitizationTrustedUrlList()};Object.defineProperty(this,"imgSrcSanitizationWhitelist",
{get:function(){return this.imgSrcSanitizationTrustedUrlList},set:function(a){this.imgSrcSanitizationTrustedUrlList=a}});var n=!0;this.debugInfoEnabled=function(a){return w(a)?(n=a,this):n};var s=!1;this.strictComponentBindingsEnabled=function(a){return w(a)?(s=a,this):s};var G=10;this.onChangesTtl=function(a){return arguments.length?(G=a,this):G};var t=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(t=a,this):t};var N=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?
(N=a,this):N};var v=T();this.addPropertySecurityContext=function(a,b,c){var d=a.toLowerCase()+"|"+b.toLowerCase();if(d in v&&v[d]!==c)throw $("ctxoverride",a,b,v[d],c);v[d]=c;return this};(function(){function a(b,c){r(c,function(a){v[a.toLowerCase()]=b})}a(W.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]);a(W.CSS,["*|style"]);a(W.URL,"area|href area|ping a|href a|ping blockquote|cite body|background del|cite input|src ins|cite q|cite".split(" "));a(W.MEDIA_URL,"audio|src img|src img|srcset source|src source|srcset track|src video|src video|poster".split(" "));
a(W.RESOURCE_URL,"*|formAction applet|code applet|codebase base|href embed|src frame|src form|action head|profile html|manifest iframe|src link|href media|src object|codebase object|data script|src".split(" "))})();this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(a,b,c,e,p,M,L,u,R){function q(){try{if(!--Ja)throw Ua=void 0,$("infchng",G);L.$apply(function(){for(var a=0,b=Ua.length;a<b;++a)try{Ua[a]()}catch(d){c(d)}Ua=
void 0})}finally{Ja++}}function ma(a,b){if(!a)return a;if(!C(a))throw $("srcset",b,a.toString());for(var c="",d=V(a),e=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,e=/\s/.test(d)?e:/(,)/,d=d.split(e),e=Math.floor(d.length/2),f=0;f<e;f++)var g=2*f,c=c+u.getTrustedMediaUrl(V(d[g])),c=c+(" "+V(d[g+1]));d=V(d[2*f]).split(/\s/);c+=u.getTrustedMediaUrl(V(d[0]));2===d.length&&(c+=" "+V(d[1]));return c}function w(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr=
{};this.$$element=a}function O(a,b,c){Fa.innerHTML="<span "+b+">";b=Fa.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function sa(a,b){try{a.addClass(b)}catch(c){}}function da(a,b,c,d,e){a instanceof x||(a=x(a));var f=Xa(a,b,a,c,d,e);da.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw $("multilink");gb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;
h&&h.$$boundTransclude&&(h=h.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ua(d)&&la.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==g?x(ja(g,x("<div></div>").append(a).html())):c?Wa.clone.call(a):a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);da.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,h);c||(a=f=null);return d}}function Xa(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,I,t;if(n)for(t=Array(c.length),m=0;m<h.length;m+=3)f=h[m],t[f]=c[f];else t=c;m=0;for(p=h.length;m<
p;)k=t[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),da.$$addScopeInfo(x(k),l)):l=a,I=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,I)):f&&f(a,k.childNodes,void 0,e)}for(var h=[],k=H(a)||a instanceof x,l,m,p,I,n,t=0;t<a.length;t++){l=new w;11===wa&&jb(a,t,k);m=tc(a[t],[],l,0===t?d:void 0,e);(f=m.length?aa(m,a[t],l,b,c,null,[],[],f):null)&&f.scope&&da.$$addScopeClass(l.$$element);l=f&&f.terminal||!(p=a[t].childNodes)||!p.length?null:Xa(p,
f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(t,f,l),I=!0,n=n||f;f=null}return I?g:null}function jb(a,b,c){var d=a[b],e=d.parentNode,f;if(d.nodeType===Pa)for(;;){f=e?d.nextSibling:a[b+1];if(!f||f.nodeType!==Pa)break;d.nodeValue+=f.nodeValue;f.parentNode&&f.parentNode.removeChild(f);c&&f===a[b+1]&&a.splice(b+1,1)}}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,
futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function tc(a,b,d,e,f){var g=d.$attr,h;switch(a.nodeType){case 1:h=ua(a);Y(b,xa(h),"E",e,f);for(var l,m,n,t,J,s=a.attributes,v=0,G=s&&s.length;v<G;v++){var P=!1,N=!1,r=!1,y=!1,u=!1,M;l=s[v];m=l.name;t=l.value;n=xa(m.toLowerCase());(J=n.match(Ra))?(r="Attr"===J[1],y="Prop"===J[1],u="On"===J[1],m=m.replace(rd,"").toLowerCase().substr(4+J[1].length).replace(/_(.)/g,function(a,b){return b.toUpperCase()})):
(M=n.match(Sa))&&ca(M[1])&&(P=m,N=m.substr(0,m.length-5)+"end",m=m.substr(0,m.length-6));if(y||u)d[n]=t,g[n]=l.name,y?Ea(a,b,n,m):b.push(sd(p,L,c,n,m,!1));else{n=xa(m.toLowerCase());g[n]=m;if(r||!d.hasOwnProperty(n))d[n]=t,nd(a,n)&&(d[n]=!0);Ia(a,b,t,n,r);Y(b,n,"A",e,f,P,N)}}"input"===h&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off");if(!Qa)break;g=a.className;D(g)&&(g=g.animVal);if(C(g)&&""!==g)for(;a=k.exec(g);)n=xa(a[2]),Y(b,n,"C",e,f)&&(d[n]=V(a[3])),g=g.substr(a.index+
a[0].length);break;case Pa:na(b,a.nodeValue);break;case 8:if(!Oa)break;F(a,b,d,e,f)}b.sort(ia);return b}function F(a,b,c,d,e){try{var f=g.exec(a.nodeValue);if(f){var h=xa(f[1]);Y(b,h,"M",d,e)&&(c[h]=V(f[2]))}}catch(k){}}function U(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw $("uterdir",b,c);1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return x(d)}function W(a,b,c){return function(d,e,f,g,h){e=U(e[0],
b,c);return a(d,e,f,g,h)}}function Z(a,b,c,d,e,f){var g;return a?da(b,c,d,e,f):function(){g||(g=da(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function aa(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=W(a,c,d));a.require=u.require;a.directiveName=Q;if(s===u||u.$$isolateScope)a=Ba(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=W(b,c,d));b.require=u.require;b.directiveName=Q;if(s===u||u.$$isolateScope)b=Ba(b,{isolateScope:!0});k.push(b)}}function p(a,e,f,g,l){function m(a,b,c,d){var e;bb(a)||
(d=c,c=b,b=a,a=void 0);N&&(e=P);c||(c=N?Q.parent():Q);if(d){var f=l.$$slots[d];if(f)return f(a,b,e,c,R);if(A(f))throw $("noslot",d,Aa(Q));}else return l(a,b,e,c,R)}var n,u,L,y,G,P,M,Q;b===f?(g=d,Q=d.$$element):(Q=x(f),g=new w(Q,d));G=e;s?y=e.$new(!0):t&&(G=e.$parent);l&&(M=m,M.$$boundTransclude=l,M.isSlotFilled=function(a){return!!l.$$slots[a]});J&&(P=ea(Q,g,M,J,y,e,s));s&&(da.$$addScopeInfo(Q,y,!0,!(v&&(v===s||v===s.$$originalDirective))),da.$$addScopeClass(Q,!0),y.$$isolateBindings=s.$$isolateBindings,
u=Da(e,g,y,y.$$isolateBindings,s),u.removeWatches&&y.$on("$destroy",u.removeWatches));for(n in P){u=J[n];L=P[n];var Hg=u.$$bindings.bindToController;L.instance=L();Q.data("$"+u.name+"Controller",L.instance);L.bindingInfo=Da(G,g,L.instance,Hg,u)}r(J,function(a,b){var c=a.require;a.bindToController&&!H(c)&&D(c)&&S(P[b].instance,X(b,c,Q,P))});r(P,function(a){var b=a.instance;if(B(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(B(b.$onInit))try{b.$onInit()}catch(e){c(e)}B(b.$doCheck)&&
(G.$watch(function(){b.$doCheck()}),b.$doCheck());B(b.$onDestroy)&&G.$on("$destroy",function(){b.$onDestroy()})});n=0;for(u=h.length;n<u;n++)L=h[n],Ca(L,L.isolateScope?y:e,Q,g,L.require&&X(L.directiveName,L.require,Q,P),M);var R=e;s&&(s.template||null===s.templateUrl)&&(R=y);a&&a(R,f.childNodes,void 0,l);for(n=k.length-1;0<=n;n--)L=k[n],Ca(L,L.isolateScope?y:e,Q,g,L.require&&X(L.directiveName,L.require,Q,P),M);r(P,function(a){a=a.instance;B(a.$postLink)&&a.$postLink()})}l=l||{};for(var n=-Number.MAX_VALUE,
t=l.newScopeDirective,J=l.controllerDirectives,s=l.newIsolateScopeDirective,v=l.templateDirective,L=l.nonTlbTranscludeDirective,G=!1,P=!1,N=l.hasElementTranscludeDirective,y=d.$$element=x(b),u,Q,M,R=e,q,ma=!1,Jb=!1,O,sa=0,C=a.length;sa<C;sa++){u=a[sa];var E=u.$$start,jb=u.$$end;E&&(y=U(b,E,jb));M=void 0;if(n>u.priority)break;if(O=u.scope)u.templateUrl||(D(O)?(ba("new/isolated scope",s||t,u,y),s=u):ba("new/isolated scope",s,u,y)),t=t||u;Q=u.name;if(!ma&&(u.replace&&(u.templateUrl||u.template)||u.transclude&&
!u.$$tlb)){for(O=sa+1;ma=a[O++];)if(ma.transclude&&!ma.$$tlb||ma.replace&&(ma.templateUrl||ma.template)){Jb=!0;break}ma=!0}!u.templateUrl&&u.controller&&(J=J||T(),ba("'"+Q+"' controller",J[Q],u,y),J[Q]=u);if(O=u.transclude)if(G=!0,u.$$tlb||(ba("transclusion",L,u,y),L=u),"element"===O)N=!0,n=u.priority,M=y,y=d.$$element=x(da.$$createComment(Q,d[Q])),b=y[0],oa(f,Ha.call(M,0),b),R=Z(Jb,M,e,n,g&&g.name,{nonTlbTranscludeDirective:L});else{var ka=T();if(D(O)){M=z.document.createDocumentFragment();var Xa=
T(),F=T();r(O,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Xa[a]=b;ka[b]=null;F[b]=c});r(y.contents(),function(a){var b=Xa[xa(ua(a))];b?(F[b]=!0,ka[b]=ka[b]||z.document.createDocumentFragment(),ka[b].appendChild(a)):M.appendChild(a)});r(F,function(a,b){if(!a)throw $("reqslot",b);});for(var K in ka)ka[K]&&(R=x(ka[K].childNodes),ka[K]=Z(Jb,R,e));M=x(M.childNodes)}else M=x(qc(b)).contents();y.empty();R=Z(Jb,M,e,void 0,void 0,{needsNewScope:u.$$isolateScope||u.$$newScope});R.$$slots=ka}if(u.template)if(P=
!0,ba("template",v,u,y),v=u,O=B(u.template)?u.template(y,d):u.template,O=Na(O),u.replace){g=u;M=nc.test(O)?td(ja(u.templateNamespace,V(O))):[];b=M[0];if(1!==M.length||1!==b.nodeType)throw $("tplrt",Q,"");oa(f,y,b);C={$attr:{}};O=tc(b,[],C);var Ig=a.splice(sa+1,a.length-(sa+1));(s||t)&&fa(O,s,t);a=a.concat(O).concat(Ig);ga(d,C);C=a.length}else y.html(O);if(u.templateUrl)P=!0,ba("template",v,u,y),v=u,u.replace&&(g=u),p=ha(a.splice(sa,a.length-sa),y,d,f,G&&R,h,k,{controllerDirectives:J,newScopeDirective:t!==
u&&t,newIsolateScopeDirective:s,templateDirective:v,nonTlbTranscludeDirective:L}),C=a.length;else if(u.compile)try{q=u.compile(y,d,R);var Y=u.$$originalDirective||u;B(q)?m(null,Va(Y,q),E,jb):q&&m(Va(Y,q.pre),Va(Y,q.post),E,jb)}catch(ca){c(ca,Aa(y))}u.terminal&&(p.terminal=!0,n=Math.max(n,u.priority))}p.scope=t&&!0===t.scope;p.transcludeOnThisElement=G;p.templateOnThisElement=P;p.transclude=R;l.hasElementTranscludeDirective=N;return p}function X(a,b,c,d){var e;if(C(b)){var f=b.match(l);b=b.substring(f[0].length);
var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e="^^"===g&&c[0]&&9===c[0].nodeType?null:g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw $("ctreq",b,a);}else if(H(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=X(a,b[g],c,d);else D(b)&&(e={},r(b,function(b,f){e[f]=X(a,b,c,d)}));return e||null}function ea(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===
p&&(p=b[l.name]);m=M(p,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function fa(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=bc(a[d],{$$isolateScope:b,$$newScope:c})}function Y(b,c,e,g,h,k,l){if(c===h)return null;var m=null;if(f.hasOwnProperty(c)){h=a.get(c+"Directive");for(var p=0,n=h.length;p<n;p++)if(c=h[p],(A(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=bc(c,{$$start:k,$$end:l}));if(!c.$$bindings){var I=m=c,t=c.name,u={isolateScope:null,bindToController:null};
D(I.scope)&&(!0===I.bindToController?(u.bindToController=d(I.scope,t,!0),u.isolateScope={}):u.isolateScope=d(I.scope,t,!1));D(I.bindToController)&&(u.bindToController=d(I.bindToController,t,!0));if(u.bindToController&&!I.controller)throw $("noctrl",t);m=m.$$bindings=u;D(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c);m=c}}return m}function ca(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if(b=c[d],b.multiElement)return!0;return!1}function ga(a,b){var c=
b.$attr,d=a.$attr;r(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,e){a.hasOwnProperty(e)||"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ha(a,b,d,f,g,h,k,l){var m=[],p,n,t=b[0],u=a.shift(),J=bc(u,{templateUrl:null,transclude:null,replace:null,$$originalDirective:u}),s=B(u.templateUrl)?u.templateUrl(b,d):u.templateUrl,L=u.templateNamespace;b.empty();e(s).then(function(c){var e,
I;c=Na(c);if(u.replace){c=nc.test(c)?td(ja(L,V(c))):[];e=c[0];if(1!==c.length||1!==e.nodeType)throw $("tplrt",u.name,s);c={$attr:{}};oa(f,b,e);var v=tc(e,[],c);D(u.scope)&&fa(v,!0);a=v.concat(a);ga(d,c)}else e=t,b.html(c);a.unshift(J);p=aa(a,e,d,g,b,u,h,k,l);r(f,function(a,c){a===e&&(f[c]=b[0])});for(n=Xa(b[0].childNodes,g);m.length;){c=m.shift();I=m.shift();var y=m.shift(),P=m.shift(),v=b[0];if(!c.$$destroyed){if(I!==t){var G=I.className;l.hasElementTranscludeDirective&&u.replace||(v=qc(e));oa(y,
x(I),v);sa(x(v),G)}I=p.transcludeOnThisElement?ka(c,p.transclude,P):P;p(n,c,v,f,I)}}m=null}).catch(function(a){dc(a)&&c(a)});return function(a,b,c,d,e){a=e;b.$$destroyed||(m?m.push(b,c,d,a):(p.transcludeOnThisElement&&(a=ka(b,p.transclude,e)),p(n,b,c,d,a)))}}function ia(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function ba(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw $("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),
a,Aa(d));}function na(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&da.$$addBindingClass(a);return function(a,c){var e=c.parent();b||da.$$addBindingClass(e);da.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ja(a,b){a=K(a||"html");switch(a){case "svg":case "math":var c=z.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function qa(a,b){if("srcdoc"===
b)return u.HTML;if("src"===b||"ngSrc"===b)return-1===["img","video","audio","source","track"].indexOf(a)?u.RESOURCE_URL:u.MEDIA_URL;if("xlinkHref"===b)return"image"===a?u.MEDIA_URL:"a"===a?u.URL:u.RESOURCE_URL;if("form"===a&&"action"===b||"base"===a&&"href"===b||"link"===a&&"href"===b)return u.RESOURCE_URL;if("a"===a&&("href"===b||"ngHref"===b))return u.URL}function ya(a,b){var c=b.toLowerCase();return v[a+"|"+c]||v["*|"+c]}function za(a){return ma(u.valueOf(a),"ng-prop-srcset")}function Ea(a,b,c,
d){if(m.test(d))throw $("nodomevents");a=ua(a);var e=ya(a,d),f=Ta;"srcset"!==d||"img"!==a&&"source"!==a?e&&(f=u.getTrusted.bind(u,e)):f=za;b.push({priority:100,compile:function(a,b){var e=p(b[c]),g=p(b[c],function(a){return u.valueOf(a)});return{pre:function(a,b){function c(){var g=e(a);b[0][d]=f(g)}c();a.$watch(g,c)}}}})}function Ia(a,c,d,e,f){var g=ua(a),k=qa(g,e),l=h[e]||f,p=b(d,!f,k,l);if(p){if("multiple"===e&&"select"===g)throw $("selmulti",Aa(a));if(m.test(e))throw $("nodomevents");c.push({priority:100,
compile:function(){return{pre:function(a,c,f){c=f.$$observers||(f.$$observers=T());var g=f[e];g!==d&&(p=g&&b(g,!0,k,l),d=g);p&&(f[e]=p(a),(c[e]||(c[e]=[])).$$inter=!0,(f.$$observers&&f.$$observers[e].$$scope||a).$watch(p,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function oa(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]===d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&
(a.context=c);break}f&&f.replaceChild(c,d);a=z.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);x.hasData(d)&&(x.data(c,x.data(d)),x(d).off("$destroy"));x.cleanData(a.querySelectorAll("*"));for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function Ba(a,b){return S(function(){return a.apply(null,arguments)},a,b)}function Ca(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,Aa(d))}}function ra(a,b){if(s)throw $("missingattr",a,b);}function Da(a,c,d,e,f){function g(b,c,e){B(d.$onChanges)&&
!ec(c,e)&&(Ua||(a.$$postDigest(q),Ua=[]),m||(m={},Ua.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Kb(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;r(e,function(e,h){var m=e.attrName,n=e.optional,I,t,u,s;switch(e.mode){case "@":n||ta.call(c,m)||(ra(m,f.name),d[h]=c[m]=void 0);n=c.$observe(m,function(a){if(C(a)||Ga(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;I=c[m];C(I)?d[h]=b(I)(a):Ga(I)&&(d[h]=I);l[h]=new Kb(uc,d[h]);k.push(n);break;case "=":if(!ta.call(c,m)){if(n)break;ra(m,
f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);s=t.literal?va:ec;u=t.assign||function(){I=d[h]=t(a);throw $("nonassign",c[m],m,f.name);};I=d[h]=t(a);n=function(b){s(b,d[h])||(s(b,I)?u(a,b=d[h]):d[h]=b);return I=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,t.literal);k.push(n);break;case "<":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);var v=t.literal,L=d[h]=t(a);l[h]=new Kb(uc,d[h]);n=a[e.collection?"$watchCollection":"$watch"](t,
function(a,b){if(b===a){if(b===L||v&&va(b,L))return;b=L}g(h,a,b);d[h]=a});k.push(n);break;case "&":n||ta.call(c,m)||ra(m,f.name);t=c.hasOwnProperty(m)?p(c[m]):E;if(t===E&&n)break;d[h]=function(b){return t(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ma=/^\w/,Fa=z.document.createElement("div"),Oa=t,Qa=N,Ja=G,Ua;w.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&R.addClass(this.$$element,a)},$removeClass:function(a){a&&
0<a.length&&R.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=ud(a,b);c&&c.length&&R.addClass(this.$$element,c);(c=ud(b,a))&&c.length&&R.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=nd(this.$$element[0],a),g=vd[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Xc(a,"-"));"img"===ua(this.$$element)&&"srcset"===a&&(this[a]=b=ma(b,"$set('srcset', value)"));!1!==d&&(null===b||A(b)?this.$$element.removeAttr(e):
Ma.test(e)?f&&!1===b?this.$$element.removeAttr(e):this.$$element.attr(e,b):O(this.$$element[0],e,b));(a=this.$$observers)&&r(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);L.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||A(c[a])||b(c[a])});return function(){cb(e,b)}}};var Ka=b.startSymbol(),La=b.endSymbol(),Na="{{"===Ka&&"}}"===La?Ta:function(a){return a.replace(/\{\{/g,Ka).replace(/}}/g,La)},Ra=
/^ng(Attr|Prop|On)([A-Z].*)$/,Sa=/^(.+)Start$/;da.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];H(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:E;da.$$addBindingClass=n?function(a){sa(a,"ng-binding")}:E;da.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:E;da.$$addScopeClass=n?function(a,b){sa(a,b?"ng-isolate-scope":"ng-scope")}:E;da.$$createComment=function(a,b){var c="";n&&(c=" "+(a||"")+": ",b&&(c+=b+" "));return z.document.createComment(c)};
return da}]}function Kb(a,b){this.previousValue=a;this.currentValue=b}function xa(a){return a.replace(rd,"").replace(Jg,function(a,d,c){return c?d.toUpperCase():d})}function ud(a,b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],k=0;k<e.length;k++)if(g===e[k])continue a;d+=(0<d.length?" ":"")+g}return d}function td(a){a=x(a);var b=a.length;if(1>=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Pa&&""===d.nodeValue.trim())&&Kg.call(a,b,1)}return a}
function Gg(a,b){if(b&&C(b))return b;if(C(a)){var d=wd.exec(a);if(d)return d[3]}}function Kf(){var a={};this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,d){Ja(b,"controller");D(b)?S(a,b):a[b]=d};this.$get=["$injector",function(b){function d(a,b,d,g){if(!a||!D(a.$scope))throw F("$controller")("noscp",g,b);a.$scope[b]=d}return function(c,e,f,g){var k,h,l;f=!0===f;g&&C(g)&&(l=g);if(C(c)){g=c.match(wd);if(!g)throw xd("ctrlfmt",c);h=g[1];l=l||g[3];c=a.hasOwnProperty(h)?a[h]:Le(e.$scope,
h,!0);if(!c)throw xd("ctrlreg",h);tb(c,h,!0)}if(f)return f=(H(c)?c[c.length-1]:c).prototype,k=Object.create(f||null),l&&d(e,l,k,h||c.name),S(function(){var a=b.invoke(c,k,e,h);a!==k&&(D(a)||B(a))&&(k=a,l&&d(e,l,k,h||c.name));return k},{instance:k,identifier:l});k=b.instantiate(c,e,h);l&&d(e,l,k,h||c.name);return k}}]}function Lf(){this.$get=["$window",function(a){return x(a.document)}]}function Mf(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;
a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]}function Nf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function vc(a){return D(a)?ha(a)?a.toISOString():eb(a):a}function Tf(){this.$get=function(){return function(a){if(!a)return"";var b=[];Qc(a,function(a,c){null===a||A(a)||B(a)||(H(a)?r(a,function(a){b.push(ba(c)+"="+ba(vc(a)))}):b.push(ba(c)+"="+ba(vc(a))))});return b.join("&")}}}function Uf(){this.$get=
function(){return function(a){function b(a,e,f){H(a)?r(a,function(a,c){b(a,e+"["+(D(a)?c:"")+"]")}):D(a)&&!ha(a)?Qc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):(B(a)&&(a=a()),d.push(ba(e)+"="+(null==a?"":ba(vc(a)))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function wc(a,b){if(C(a)){var d=a.replace(Lg,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(yd),e;(e=c)||(e=(e=d.match(Mg))&&Ng[e[0]].test(d));if(e)try{a=Tc(d)}catch(f){if(!c)return a;throw Lb("baddata",a,f);}}}return a}
function zd(a){var b=T(),d;C(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=K(V(a.substr(0,d)));a=V(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):D(a)&&r(a,function(a,d){var f=K(d),g=V(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function Ad(a){var b;return function(d){b||(b=zd(a));return d?(d=b[K(d)],void 0===d&&(d=null),d):b}}function Bd(a,b,d,c){if(B(c))return c(a,b,d);r(c,function(c){a=c(a,b,d)});return a}function Sf(){var a=this.defaults={transformResponse:[wc],transformRequest:[function(a){return D(a)&&
"[object File]"!==la.call(a)&&"[object Blob]"!==la.call(a)&&"[object FormData]"!==la.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ja(xc),put:ja(xc),patch:ja(xc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return w(a)?(b=!!a,this):b};var d=this.interceptors=[],c=this.xsrfTrustedOrigins=[];Object.defineProperty(this,"xsrfWhitelistedOrigins",
{get:function(){return this.xsrfTrustedOrigins},set:function(a){this.xsrfTrustedOrigins=a}});this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,f,g,k,h,l,m,p){function n(b){function c(a,b){for(var d=0,e=b.length;d<e;){var f=b[d++],g=b[d++];a=a.then(f,g)}b.length=0;return a}function d(a,b){var c,e={};r(a,function(a,d){B(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}function f(a){var b=S({},a);b.data=Bd(a.data,a.headers,a.status,g.transformResponse);
a=a.status;return 200<=a&&300>a?b:l.reject(b)}if(!D(b))throw F("$http")("badreq",b);if(!C(p.valueOf(b.url)))throw F("$http")("badreq",b.url);var g=S({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},b);g.headers=function(b){var c=a.headers,e=S({},b.headers),f,g,h,c=S({},c.common,c[K(b.method)]);a:for(f in c){g=K(f);for(h in e)if(K(h)===g)continue a;e[f]=c[f]}return d(e,ja(b))}(b);g.method=
vb(g.method);g.paramSerializer=C(g.paramSerializer)?m.get(g.paramSerializer):g.paramSerializer;e.$$incOutstandingRequestCount("$http");var h=[],k=[];b=l.resolve(g);r(v,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&k.push(a.response,a.responseError)});b=c(b,h);b=b.then(function(b){var c=b.headers,d=Bd(b.data,Ad(c),void 0,b.transformRequest);A(d)&&r(c,function(a,b){"content-type"===K(b)&&delete c[b]});A(b.withCredentials)&&!A(a.withCredentials)&&
(b.withCredentials=a.withCredentials);return s(b,d).then(f,f)});b=c(b,k);return b=b.finally(function(){e.$$completeOutstandingRequest(E,"$http")})}function s(c,d){function e(a){if(a){var c={};r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function k(a,c,d,e,f){function g(){m(c,a,d,e,f)}R&&(200<=a&&300>a?R.put(O,[a,c,zd(d),e,f]):R.remove(O));b?h.$applyAsync(g):(g(),h.$$phase||h.$apply())}function m(a,b,d,e,f){b=-1<=b?b:0;(200<=b&&300>
b?L.resolve:L.reject)({data:a,status:b,headers:Ad(d),config:c,statusText:e,xhrStatus:f})}function s(a){m(a.data,a.status,ja(a.headers()),a.statusText,a.xhrStatus)}function v(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var L=l.defer(),u=L.promise,R,q,ma=c.headers,x="jsonp"===K(c.method),O=c.url;x?O=p.getTrustedResourceUrl(O):C(O)||(O=p.valueOf(O));O=G(O,c.paramSerializer(c.params));x&&(O=t(O,c.jsonpCallbackParam));n.pendingRequests.push(c);u.then(v,v);!c.cache&&!a.cache||
!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(R=D(c.cache)?c.cache:D(a.cache)?a.cache:N);R&&(q=R.get(O),w(q)?q&&B(q.then)?q.then(s,s):H(q)?m(q[1],q[0],ja(q[2]),q[3],q[4]):m(q,200,{},"OK","complete"):R.put(O,u));A(q)&&((q=kc(c.url)?g()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(ma[c.xsrfHeaderName||a.xsrfHeaderName]=q),f(c.method,O,d,k,ma,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers)));return u}function G(a,b){0<b.length&&(a+=(-1===a.indexOf("?")?
"?":"&")+b);return a}function t(a,b){var c=a.split("?");if(2<c.length)throw Lb("badjsonp",a);c=hc(c[1]);r(c,function(c,d){if("JSON_CALLBACK"===c)throw Lb("badjsonp",a);if(d===b)throw Lb("badjsonp",b,a);});return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var N=k("$http");a.paramSerializer=C(a.paramSerializer)?m.get(a.paramSerializer):a.paramSerializer;var v=[];r(d,function(a){v.unshift(C(a)?m.get(a):m.invoke(a))});var kc=Og(c);n.pendingRequests=[];(function(a){r(arguments,function(a){n[a]=
function(b,c){return n(S({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){n[a]=function(b,c,d){return n(S({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function Wf(){this.$get=function(){return function(){return new z.XMLHttpRequest}}}function Vf(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return Pg(a,c,a.defer,b,d[0])}]}function Pg(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",
b);var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m);f.removeEventListener("error",m);e.body.removeChild(f);f=null;var g=-1,s="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),s=a.type,g="error"===a.type?404:200);d&&d(g,s)};f.addEventListener("load",m);f.addEventListener("error",m);e.body.appendChild(f);return m}return function(e,k,h,l,m,p,n,s,G,t){function N(a){J="timeout"===a;pa&&pa();y&&y.abort()}function v(a,
b,c,e,f,g){w(P)&&d.cancel(P);pa=y=null;a(b,c,e,f,g)}k=k||a.url();if("jsonp"===K(e))var q=c.createCallback(k),pa=f(k,q,function(a,b){var d=200===a&&c.getResponse(q);v(l,a,d,"",b,"complete");c.removeCallback(q)});else{var y=b(e,k),J=!1;y.open(e,k,!0);r(m,function(a,b){w(a)&&y.setRequestHeader(b,a)});y.onload=function(){var a=y.statusText||"",b="response"in y?y.response:y.responseText,c=1223===y.status?204:y.status;0===c&&(c=b?200:"file"===ga(k).protocol?404:0);v(l,c,b,y.getAllResponseHeaders(),a,"complete")};
y.onerror=function(){v(l,-1,null,null,"","error")};y.ontimeout=function(){v(l,-1,null,null,"","timeout")};y.onabort=function(){v(l,-1,null,null,"",J?"timeout":"abort")};r(G,function(a,b){y.addEventListener(b,a)});r(t,function(a,b){y.upload.addEventListener(b,a)});n&&(y.withCredentials=!0);if(s)try{y.responseType=s}catch(I){if("json"!==s)throw I;}y.send(A(h)?null:h)}if(0<p)var P=d(function(){N("timeout")},p);else p&&B(p.then)&&p.then(function(){N(w(p.$$timeoutId)?"timeout":"abort")})}}function Pf(){var a=
"{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function k(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function h(f,h,n,p){function v(a){try{return a=n&&!r?e.getTrusted(n,a):e.valueOf(a),p&&!w(a)?a:jc(a)}catch(b){c(Ma.interr(f,b))}}var r=n===e.URL||n===e.MEDIA_URL;if(!f.length||
-1===f.indexOf(a)){if(h)return;h=g(f);r&&(h=e.getTrusted(n,h));h=ia(h);h.exp=f;h.expressions=[];h.$$watchDelegate=k;return h}p=!!p;for(var q,y,J=0,I=[],P,Q=f.length,M=[],L=[],u;J<Q;)if(-1!==(q=f.indexOf(a,J))&&-1!==(y=f.indexOf(b,q+l)))J!==q&&M.push(g(f.substring(J,q))),J=f.substring(q+l,y),I.push(J),J=y+m,L.push(M.length),M.push("");else{J!==Q&&M.push(g(f.substring(J)));break}u=1===M.length&&1===L.length;var R=r&&u?void 0:v;P=I.map(function(a){return d(a,R)});if(!h||I.length){var x=function(a){for(var b=
0,c=I.length;b<c;b++){if(p&&A(a[b]))return;M[L[b]]=a[b]}if(r)return e.getTrusted(n,u?M[0]:M.join(""));n&&1<M.length&&Ma.throwNoconcat(f);return M.join("")};return S(function(a){var b=0,d=I.length,e=Array(d);try{for(;b<d;b++)e[b]=P[b](a);return x(e)}catch(g){c(Ma.interr(f,g))}},{exp:f,expressions:I,$$watchDelegate:function(a,b){var c;return a.$watchGroup(P,function(d,e){var f=x(d);b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,
f),"g");h.startSymbol=function(){return a};h.endSymbol=function(){return b};return h}]}function Qf(){this.$get=["$$intervalFactory","$window",function(a,b){var d={},c=function(a){b.clearInterval(a);delete d[a]},e=a(function(a,c,e){a=b.setInterval(a,c);d[a]=e;return a},c);e.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Qg("badprom");if(!d.hasOwnProperty(a.$$intervalId))return!1;a=a.$$intervalId;var b=d[a],e=b.promise;e.$$state&&(e.$$state.pur=!0);b.reject("canceled");
c(a);return!0};return e}]}function Rf(){this.$get=["$browser","$q","$$q","$rootScope",function(a,b,d,c){return function(e,f){return function(g,k,h,l){function m(){p?g.apply(null,n):g(s)}var p=4<arguments.length,n=p?Ha.call(arguments,4):[],s=0,G=w(l)&&!l,t=(G?d:b).defer(),r=t.promise;h=w(h)?h:0;r.$$intervalId=e(function(){G?a.defer(m):c.$evalAsync(m);t.notify(s++);0<h&&s>=h&&(t.resolve(s),f(r.$$intervalId));G||c.$apply()},k,t,G);return r}}}]}function Cd(a,b){var d=ga(a);b.$$protocol=d.protocol;b.$$host=
d.hostname;b.$$port=fa(d.port)||Rg[d.protocol]||null}function Dd(a,b,d){if(Sg.test(a))throw kb("badpath",a);var c="/"!==a.charAt(0);c&&(a="/"+a);a=ga(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/");b.$$path=d;b.$$search=hc(a.search);b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function yc(a,b){return a.slice(0,
b.length)===b}function ya(a,b){if(yc(b,a))return b.substr(a.length)}function Da(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function zc(a,b,d){this.$$html5=!0;d=d||"";Cd(a,this);this.$$parse=function(a){var d=ya(b,a);if(!C(d))throw kb("ipthprfx",a,b);Dd(d,this,!0);this.$$path||(this.$$path="/");this.$$compose()};this.$$normalizeUrl=function(a){return b+a.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;w(f=ya(a,c))?(g=f,g=d&&w(f=ya(d,f))?
b+(ya("/",f)||f):a+g):w(f=ya(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function Ac(a,b,d){Cd(a,this);this.$$parse=function(c){var e=ya(a,c)||ya(b,c),f;A(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",A(e)&&(a=c,this.replace())):(f=ya(d,e),A(f)&&(f=e));Dd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;yc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$normalizeUrl=function(b){return a+(b?d+b:"")};this.$$parseLinkUrl=function(b,
d){return Da(a)===Da(b)?(this.$$parse(b),!0):!1}}function Ed(a,b,d){this.$$html5=!0;Ac.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===Da(c)?f=c:(g=ya(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$normalizeUrl=function(b){return a+d+b}}function Mb(a){return function(){return this[a]}}function Fd(a,b){return function(d){if(A(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Yf(){var a="!",
b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return w(b)?(a=b,this):a};this.html5Mode=function(a){if(Ga(a))return b.enabled=a,this;if(D(a)){Ga(a.enabled)&&(b.enabled=a.enabled);Ga(a.requireBase)&&(b.requireBase=a.requireBase);if(Ga(a.rewriteLinks)||C(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function k(a,b){return a===b||ga(a).href===ga(b).href}function h(a,
b,d){var e=m.url(),f=m.$$state;try{c.url(a,b,d),m.$$state=c.state()}catch(g){throw m.url(e),m.$$state=f,g;}}function l(a,b){d.$broadcast("$locationChangeSuccess",m.absUrl(),a,m.$$state,b)}var m,p;p=c.baseHref();var n=c.url(),s;if(b.enabled){if(!p&&b.requireBase)throw kb("nobase");s=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(p||"/");p=e.history?zc:Ed}else s=Da(n),p=Ac;var r=s.substr(0,Da(s).lastIndexOf("/")+1);m=new p(s,r,"#"+a);m.$$parseLinkUrl(n,n);m.$$state=c.state();var t=/^\s*(javascript|mailto):/i;
f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var g=x(a.target);"a"!==ua(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;if(!C(e)||!A(g.attr(e))){var e=g.prop("href"),h=g.attr("href")||g.attr("xlink:href");D(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ga(e.animVal).href);t.test(e)||!e||g.attr("target")||a.isDefaultPrevented()||!m.$$parseLinkUrl(e,h)||(a.preventDefault(),m.absUrl()!==c.url()&&d.$apply())}}});m.absUrl()!==
n&&c.url(m.absUrl(),!0);var N=!0;c.onUrlChange(function(a,b){yc(a,r)?(d.$evalAsync(function(){var c=m.absUrl(),e=m.$$state,f;m.$$parse(a);m.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;m.absUrl()===a&&(f?(m.$$parse(c),m.$$state=e,h(c,!1,e)):(N=!1,l(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(N||m.$$urlUpdatedByLocation){m.$$urlUpdatedByLocation=!1;var a=c.url(),b=m.absUrl(),f=c.state(),g=m.$$replace,n=!k(a,b)||m.$$html5&&e.history&&f!==
m.$$state;if(N||n)N=!1,d.$evalAsync(function(){var b=m.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,m.$$state,f).defaultPrevented;m.absUrl()===b&&(c?(m.$$parse(a),m.$$state=f):(n&&h(b,g,f===m.$$state?null:m.$$state),l(a,f)))})}m.$$replace=!1});return m}]}function Zf(){var a=!0,b=this;this.debugEnabled=function(b){return w(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){dc(a)&&(a.stack&&f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&
(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||E;return function(){var a=[];r(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e,b,a)}}var f=wa||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Tg(a){return a+""}function Ug(a,b){return"undefined"!==typeof a?a:
b}function Gd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Vg(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!==a.operator?1:!1;case q.CallExpression:return!1}return void 0===b?Hd:b}function Z(a,b,d){var c,e,f=a.isPure=Vg(a,d);switch(a.type){case q.Program:c=!0;r(a.body,function(a){Z(a.expression,b,f);c=c&&a.expression.constant});a.constant=c;break;case q.Literal:a.constant=!0;a.toWatch=
[];break;case q.UnaryExpression:Z(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:Z(a.test,b,f);Z(a.alternate,b,f);Z(a.consequent,b,f);a.constant=a.test.constant&&
a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1;a.toWatch=[a];break;case q.MemberExpression:Z(a.object,b,f);a.computed&&Z(a.property,b,f);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];r(a.arguments,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case q.AssignmentExpression:Z(a.left,
b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case q.ArrayExpression:c=!0;e=[];r(a.elements,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=e;break;case q.ObjectExpression:c=!0;e=[];r(a.properties,function(a){Z(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(Z(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,a.key.toWatch))});a.constant=c;a.toWatch=e;break;case q.ThisExpression:a.constant=
!1;a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Id(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Jd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function Kd(a){if(1===a.body.length&&Jd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function Ld(a){this.$filter=a}function Md(a){this.$filter=a}function Nb(a,b,d){this.ast=
new q(a,d);this.astCompiler=d.csp?new Md(b):new Ld(b)}function Bc(a){return B(a.valueOf)?a.valueOf():Wg.call(a)}function $f(){var a=T(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral=function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,f;switch(typeof b){case "string":return f=b=b.trim(),d=a[f],d||(d=new Ob(G),d=(new Nb(d,e,G)).parse(b),a[f]=p(d)),s(d,c);case "function":return s(b,c);default:return s(E,
c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Bc(a),"object"!==typeof a||c)?a===b||a!==a&&b!==b:!1}function k(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Bc(b));return h},b,c,e)}for(var l=[],m=[],n=0,p=f.length;n<p;n++)l[n]=g,m[n]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var k=f[c](a);if(b||(b=!g(k,l[c],f[c].isPure)))m[c]=k,l[c]=k&&Bc(k)}b&&
(h=d(a,void 0,void 0,m));return h},b,c,e)}function h(a,b,c,d,e){function f(){h(m)&&k()}function g(a,b,c,d){m=u&&d?d[0]:n(a,b,c,d);h(m)&&a.$$postDigest(f);return s(m)}var h=d.literal?l:w,k,m,n=d.$$intercepted||d,s=d.$$interceptor||Ta,u=d.inputs&&!n.inputs;g.literal=d.literal;g.constant=d.constant;g.inputs=d.inputs;p(g);return k=a.$watch(g,b,c,e)}function l(a){var b=!0;r(a,function(a){w(a)||(b=!1)});return b}function m(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function p(a){a.constant?
a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=h:a.inputs&&(a.$$watchDelegate=k);return a}function n(a,b){function c(d){return b(a(d))}c.$stateful=a.$stateful||b.$stateful;c.$$pure=a.$$pure&&b.$$pure;return c}function s(a,b){if(!b)return a;a.$$interceptor&&(b=n(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){d=c&&g?g[0]:a(d,e,f,g);return b(d)};d.$$intercepted=a;d.$$interceptor=b;d.literal=a.literal;d.oneTime=a.oneTime;d.constant=a.constant;b.$stateful||(c=!a.inputs,d.inputs=a.inputs?
a.inputs:[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===Hd?function(b){return a(b)}:a})));return p(d)}var G={csp:Ba().noUnsafeEval,literals:Ia(b),isIdentifierStart:B(d)&&d,isIdentifierContinue:B(c)&&c};f.$$getAst=function(a){var b=new Ob(G);return(new Nb(b,e,G)).getAst(a).ast};return f}]}function bg(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Nd(function(a){b.$evalAsync(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):
a}}function cg(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Nd(function(a){b.defer(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Nd(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){h(a,b)};this.reject=function(b){m(a,b)};this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!w&&x.length;){var a=x.shift();if(!a.pur){a.pur=!0;var c=a.value,c="Possibly unhandled rejection: "+
("function"===typeof c?c.toString().replace(/ \{[\s\S]*$/,""):A(c)?"undefined":"string"!==typeof c?Ne(c,void 0):c);dc(a.value)?b(a.value,c):b(c)}}}function k(c){!d||c.pending||2!==c.status||c.pur||(0===w&&0===x.length&&a(g),x.push(c));!c.processScheduled&&c.pending&&(c.processScheduled=!0,++w,a(function(){var e,f,k;k=c.pending;c.processScheduled=!1;c.pending=void 0;try{for(var l=0,n=k.length;l<n;++l){c.pur=!0;f=k[l][0];e=k[l][c.status];try{B(e)?h(f,e(c.value)):1===c.status?h(f,c.value):m(f,c.value)}catch(p){m(f,
p),p&&!0===p.$$passToExceptionHandler&&b(p)}}}finally{--w,d&&0===w&&a(g)}}))}function h(a,b){a.$$state.status||(b===a?p(a,v("qcycle",b)):l(a,b))}function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{if(D(b)||B(b))f=b.then;B(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(h){d(h)}}function m(a,b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b;a.$$state.status=2;k(a.$$state)}function n(c,
d){var e=c.$$state.pending;0>=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0];a=e[f][3];try{n(c,B(a)?a(d):d)}catch(h){b(h)}}})}function s(a){var b=new f;m(b,a);return b}function G(a,b,c){var d=null;try{B(c)&&(d=c())}catch(e){return s(e)}return d&&B(d.then)?d.then(function(){return b(a)},s):b(a)}function t(a,b,c,d){var e=new f;h(e,a);return e.then(b,c,d)}function q(a){if(!B(a))throw v("norslvr",a);var b=new f;a(function(a){h(b,a)},function(a){m(b,a)});return b}
var v=F("$q",TypeError),w=0,x=[];S(f.prototype,{then:function(a,b,c){if(A(a)&&A(b)&&A(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&k(this.$$state);return d},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return G(b,y,a)},function(b){return G(b,s,a)},b)}});var y=t;q.prototype=f.prototype;q.defer=c;q.reject=s;q.when=t;q.resolve=y;q.all=function(a){var b=new f,c=
0,d=H(a)?[]:{};r(a,function(a,e){c++;t(a).then(function(a){d[e]=a;--c||h(b,d)},function(a){m(b,a)})});0===c&&h(b,d);return b};q.race=function(a){var b=c();r(a,function(a){t(a).then(b.resolve,b.reject)});return b.promise};return q}function mg(){this.$get=["$window","$timeout",function(a,b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:
function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function ag(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++qb;this.$$ChildScope=null;this.$$suspended=!1}b.prototype=a;return b}var b=10,d=F("$rootScope"),c=null,e=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",
function(f,g,k){function h(a){a.currentScope.$$destroyed=!0}function l(a){9===wa&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function m(){this.$id=++qb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$suspended=this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=
0;this.$$isolateBindings=null}function p(a){if(v.$$phase)throw d("inprog",v.$$phase);v.$$phase=a}function n(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function s(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function G(){}function t(){for(;y.length;)try{y.shift()()}catch(a){f(a)}e=null}function q(){null===e&&(e=k.defer(function(){v.$apply(t)},null,"$applyAsync"))}m.prototype={constructor:m,$new:function(b,c){var d;c=c||this;b?(d=new m,
d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!==this)&&d.$on("$destroy",h);return d},$watch:function(a,b,d,e){var f=g(a);b=B(b)?b:E;if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,a);var h=this,k=h.$$watchers,l={fn:b,last:G,get:f,exp:e||a,eq:!!d};c=null;k||(k=h.$$watchers=[],k.$$digestWatchIndex=-1);k.unshift(l);
k.$$digestWatchIndex++;n(this,1);return function(){var a=cb(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--);c=null}},$watchGroup:function(a,b){function c(){h=!1;try{k?(k=!1,b(e,e,g)):b(e,d,g)}finally{for(var f=0;f<a.length;f++)d[f]=e[f]}}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});r(a,function(a,
b){var d=g.$watch(a,function(a){e[b]=a;h||(h=!0,g.$evalAsync(c))});f.push(d)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!A(e)){if(D(e))if(za(e))for(f!==n&&(f=n,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==p&&(f=p={},t=0,l++);a=0;for(b in e)ta.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,
f)ta.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$$pure=g(a).literal;c.$stateful=!c.$$pure;var d=this,e,f,h,k=1<b.length,l=0,m=g(a,c),n=[],p={},s=!0,t=0;return this.$watch(m,function(){s?(s=!1,b(e,e,d)):b(e,h,d);if(k)if(D(e))if(za(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,h,l,m,n,s,r=b,q,y=w.length?v:this,N=[],A,z;p("$digest");k.$$checkUrlChange();this===v&&null!==e&&(k.defer.cancel(e),
t());c=null;do{s=!1;q=y;for(n=0;n<w.length;n++){try{z=w[n],l=z.fn,l(z.scope,z.locals)}catch(C){f(C)}c=null}w.length=0;a:do{if(n=!q.$$suspended&&q.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if(m=a.get,(g=m(q))!==(h=a.last)&&!(a.eq?va(g,h):Y(g)&&Y(h)))s=!0,c=a,a.last=a.eq?Ia(g,null):g,l=a.fn,l(g,h===G?g:h,q),5>r&&(A=4-r,N[A]||(N[A]=[]),N[A].push({msg:B(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:h}));else if(a===c){s=
!1;break a}}catch(E){f(E)}if(!(n=!q.$$suspended&&q.$$watchersCount&&q.$$childHead||q!==y&&q.$$nextSibling))for(;q!==y&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((s||w.length)&&!r--)throw v.$$phase=null,d("infdig",b,N);}while(s||w.length);for(v.$$phase=null;J<x.length;)try{x[J++]()}catch(D){f(D)}x.length=J=0;k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var a=
this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===v&&k.$$applicationDestroyed();n(this,-this.$$watchersCount);for(var b in this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=
this.$evalAsync=this.$applyAsync=E;this.$on=this.$watch=this.$watchGroup=function(){return E};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){v.$$phase||w.length||k.defer(function(){w.length&&v.$digest()},null,"$evalAsync");w.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){x.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{v.$$phase=null}}catch(b){f(b)}finally{try{v.$digest()}catch(c){throw f(c),
c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&y.push(b);a=g(a);q()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],s(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=
!0},defaultPrevented:!1},k=db([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){f(n)}else d.splice(l,1),l--,m--;if(g)break;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=db([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||
[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var v=new m,w=v.$$asyncQueue=[],x=v.$$postDigestQueue=[],y=v.$$applyAsyncQueue=[],J=0;return v}]}function Qe(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationTrustedUrlList=function(b){return w(b)?
(a=b,this):a};this.imgSrcSanitizationTrustedUrlList=function(a){return w(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f=ga(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Xg(a){if("self"===a)return a;if(C(a)){if(-1<a.indexOf("***"))throw Ea("iwcard",a);a=Od(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*");return new RegExp("^"+a+"$")}if(ab(a))return new RegExp("^"+a.source+"$");throw Ea("imatcher");}function Pd(a){var b=[];w(a)&&r(a,function(a){b.push(Xg(a))});
return b}function eg(){this.SCE_CONTEXTS=W;var a=["self"],b=[];this.trustedResourceUrlList=function(b){arguments.length&&(a=Pd(b));return a};Object.defineProperty(this,"resourceUrlWhitelist",{get:function(){return this.trustedResourceUrlList},set:function(a){this.trustedResourceUrlList=a}});this.bannedResourceUrlList=function(a){arguments.length&&(b=Pd(a));return b};Object.defineProperty(this,"resourceUrlBlacklist",{get:function(){return this.bannedResourceUrlList},set:function(a){this.bannedResourceUrlList=
a}});this.$get=["$injector","$$sanitizeUri",function(d,c){function e(a,b){var c;"self"===a?(c=Cc(b,Qd))||(z.document.baseURI?c=z.document.baseURI:(Na||(Na=z.document.createElement("a"),Na.href=".",Na=Na.cloneNode(!1)),c=Na.href),c=Cc(b,c)):c=!!a.exec(b.href);return c}function f(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};
return b}var g=function(a){throw Ea("unsafe");};d.has("$sanitize")&&(g=d.get("$sanitize"));var k=f(),h={};h[W.HTML]=f(k);h[W.CSS]=f(k);h[W.MEDIA_URL]=f(k);h[W.URL]=f(h[W.MEDIA_URL]);h[W.JS]=f(k);h[W.RESOURCE_URL]=f(h[W.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ea("icontext",a,b);if(null===b||A(b)||""===b)return b;if("string"!==typeof b)throw Ea("itype",a);return new c(b)},getTrusted:function(d,f){if(null===f||A(f)||""===f)return f;var k=h.hasOwnProperty(d)?
h[d]:null;if(k&&f instanceof k)return f.$$unwrapTrustedValue();B(f.$$unwrapTrustedValue)&&(f=f.$$unwrapTrustedValue());if(d===W.MEDIA_URL||d===W.URL)return c(f.toString(),d===W.MEDIA_URL);if(d===W.RESOURCE_URL){var k=ga(f.toString()),n,s,r=!1;n=0;for(s=a.length;n<s;n++)if(e(a[n],k)){r=!0;break}if(r)for(n=0,s=b.length;n<s;n++)if(e(b[n],k)){r=!1;break}if(r)return f;throw Ea("insecurl",f.toString());}if(d===W.HTML)return g(f);throw Ea("unsafe");},valueOf:function(a){return a instanceof k?a.$$unwrapTrustedValue():
a}}}]}function dg(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>wa)throw Ea("iequirks");var c=ja(W);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Ta);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;r(W,
function(a,b){var d=K(b);c[("parse_as_"+d).replace(Dc,xb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Dc,xb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Dc,xb)]=function(b){return g(a,b)}});return c}]}function fg(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=fa((/android (\d+)/.exec(K((a.navigator||{}).userAgent))||
[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},k=g.body&&g.body.style,h=!1,l=!1;k&&(h=!!("transition"in k||"webkitTransition"in k),l=!!("animation"in k||"webkitAnimation"in k));return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===a&&wa)return!1;if(A(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ba(),transitions:h,animations:l,android:e}}]}function gg(){this.$get=ia(function(a){return new Yg(a)})}function Yg(a){function b(){var a=e.pop();return a&&
a.cb}function d(a){for(var b=e.length-1;0<=b;--b){var c=e[b];if(c.type===a)return e.splice(b,1),c.cb}}var c={},e=[],f=this.ALL_TASKS_TYPE="$$all$$",g=this.DEFAULT_TASK_TYPE="$$default$$";this.completeTask=function(e,h){h=h||g;try{e()}finally{var l;l=h||g;c[l]&&(c[l]--,c[f]--);l=c[h];var m=c[f];if(!m||!l)for(l=m?d:b;m=l(h);)try{m()}catch(p){a.error(p)}}};this.incTaskCount=function(a){a=a||g;c[a]=(c[a]||0)+1;c[f]=(c[f]||0)+1};this.notifyWhenNoPendingTasks=function(a,b){b=b||f;c[b]?e.push({type:b,cb:a}):
a()}}function ig(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(k,h){g.totalPendingRequests++;if(!C(k)||A(d.get(k)))k=f.getTrustedResourceUrl(k);var l=c.defaults&&c.defaults.transformResponse;H(l)?l=l.filter(function(a){return a!==wc}):l===wc&&(l=null);return c.get(k,S({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return d.put(k,a.data)},
function(a){h||(a=Zg("tpload",k,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function jg(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var c=ca.element(a).data("$binding");c&&r(c,function(c){d?(new RegExp("(^|\\s)"+Od(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-",
"data-ng-","ng\\:"],k=0;k<g.length;++k){var h=a.querySelectorAll("["+g[k]+"model"+(d?"=":"*=")+'"'+b+'"]');if(h.length)return h}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function kg(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,h,l){B(f)||(l=h,h=f,f=E);var m=Ha.call(arguments,3),p=w(l)&&!l,n=(p?c:d).defer(),s=n.promise,r;
r=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[s.$$timeoutId]}p||a.$apply()},h,"$timeout");s.$$timeoutId=r;g[r]=n;return s}var g={};f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw $g("badprom");if(!g.hasOwnProperty(a.$$timeoutId))return!1;a=a.$$timeoutId;var c=g[a],d=c.promise;d.$$state&&(d.$$state.pur=!0);c.reject("canceled");delete g[a];return b.defer.cancel(a)};return f}]}function ga(a){if(!C(a))return a;wa&&(aa.setAttribute("href",
a),a=aa.href);aa.setAttribute("href",a);a=aa.hostname;!ah&&-1<a.indexOf(":")&&(a="["+a+"]");return{href:aa.href,protocol:aa.protocol?aa.protocol.replace(/:$/,""):"",host:aa.host,search:aa.search?aa.search.replace(/^\?/,""):"",hash:aa.hash?aa.hash.replace(/^#/,""):"",hostname:a,port:aa.port,pathname:"/"===aa.pathname.charAt(0)?aa.pathname:"/"+aa.pathname}}function Og(a){var b=[Qd].concat(a.map(ga));return function(a){a=ga(a);return b.some(Cc.bind(null,a))}}function Cc(a,b){a=ga(a);b=ga(b);return a.protocol===
b.protocol&&a.host===b.host}function lg(){this.$get=ia(z)}function Rd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},c={},e="";return function(){var a,g,k,h,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(e=a,a=e.split("; "),c={},k=0;k<a.length;k++)g=a[k],h=g.indexOf("="),0<h&&(l=b(g.substring(0,h)),A(c[l])&&(c[l]=b(g.substring(h+1))));return c}}function pg(){this.$get=Rd}function fd(a){function b(d,c){if(D(d)){var e={};r(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+
"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",Sd);b("date",Td);b("filter",bh);b("json",ch);b("limitTo",dh);b("lowercase",eh);b("number",Ud);b("orderBy",Vd);b("uppercase",fh)}function bh(){return function(a,b,d,c){if(!za(a)){if(null==a)return a;throw F("filter")("notarray",a);}c=c||"$";var e;switch(Ec(b)){case "function":break;case "boolean":case "null":case "number":case "string":e=!0;case "object":b=gh(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,
b)}}function gh(a,b,d,c){var e=D(a)&&d in a;!0===b?b=va:B(b)||(b=function(a,b){if(A(a))return!1;if(null===a||null===b)return a===b;if(D(b)||D(a)&&!cc(a))return!1;a=K(""+a);b=K(""+b);return-1!==a.indexOf(b)});return function(f){return e&&!D(f)?Fa(f,a[d],b,d,!1):Fa(f,a,b,d,c)}}function Fa(a,b,d,c,e,f){var g=Ec(a),k=Ec(b);if("string"===k&&"!"===b.charAt(0))return!Fa(a,b.substring(1),d,c,e);if(H(a))return a.some(function(a){return Fa(a,b,d,c,e)});switch(g){case "object":var h;if(e){for(h in a)if(h.charAt&&
"$"!==h.charAt(0)&&Fa(a[h],b,d,c,!0))return!0;return f?!1:Fa(a,b,d,c,!1)}if("object"===k){for(h in b)if(f=b[h],!B(f)&&!A(f)&&(g=h===c,!Fa(g?a:a[h],f,d,c,g,g)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function Ec(a){return null===a?"null":typeof a}function Sd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){A(c)&&(c=b.CURRENCY_SYM);A(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Wd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,
c)}}function Ud(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Wd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function hh(a){var b=0,d,c,e,f,g;-1<(c=a.indexOf(Xd))&&(a=a.replace(Xd,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Fc;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Fc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Yd&&(d=d.splice(0,Yd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function ih(a,
b,d,c){var e=a.d,f=e.length-a.i;b=A(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Wd(a,b,d,c,e){if(!C(a)&&!X(a)||isNaN(a))return"";
var f=!isFinite(a),g=!1,k=Math.abs(a)+"",h="";if(f)h="\u221e";else{g=hh(k);ih(g,e,b.minFrac,b.maxFrac);h=g.d;k=g.i;e=g.e;f=[];for(g=h.reduce(function(a,b){return a&&!b},!0);0>k;)h.unshift(0),k++;0<k?f=h.splice(k,h.length):(f=h,h=[0]);k=[];for(h.length>=b.lgSize&&k.unshift(h.splice(-b.lgSize,h.length).join(""));h.length>b.gSize;)k.unshift(h.splice(-b.gSize,h.length).join(""));h.length&&k.unshift(h.join(""));h=k.join(d);f.length&&(h+=c+f.join(""));e&&(h+="e+"+e)}return 0>a&&!g?b.negPre+h+b.negSuf:b.posPre+
h+b.posSuf}function Pb(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=Fc+a;d&&(a=a.substr(a.length-b));return e+a}function ea(a,b,d,c,e){d=d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12===d&&(f=12);return Pb(f,b,c,e)}}function lb(a,b,d){return function(c,e){var f=c["get"+a](),g=vb((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Zd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function $d(a){return function(b){var d=
Zd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Pb(b,a)}}function Gc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Td(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=fa(b[9]+b[10]),g=fa(b[9]+b[11]));k.call(a,fa(b[1]),fa(b[2])-1,fa(b[3]));f=fa(b[4]||0)-f;g=fa(b[5]||0)-g;k=fa(b[6]||0);b=Math.round(1E3*parseFloat("0."+
(b[7]||0)));h.call(a,f,g,k,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",k=[],h,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;C(c)&&(c=jh.test(c)?fa(c):b(c));X(c)&&(c=new Date(c));if(!ha(c)||!isFinite(c.getTime()))return c;for(;d;)(l=kh.exec(d))?(k=db(k,l,1),d=k.pop()):(k.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=fc(f,m),c=gc(c,f,!0));r(k,function(b){h=lh[b];g+=h?h(c,a.DATETIME_FORMATS,
m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ch(){return function(a,b){A(b)&&(b=2);return eb(a,b)}}function dh(){return function(a,b,d){b=Infinity===Math.abs(Number(b))?Number(b):fa(b);if(Y(b))return a;X(a)&&(a=a.toString());if(!za(a))return a;d=!d||isNaN(d)?0:fa(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Hc(a,d,d+b):0===d?Hc(a,b,a.length):Hc(a,Math.max(0,d+b),d)}}function Hc(a,b,d){return C(a)?a.slice(b,d):Ha.call(a,b,d)}function Vd(a){function b(b){return b.map(function(b){var c=
1,d=Ta;if(B(b))d=b;else if(C(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e=d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,h=b.type;if(d===h){var h=a.value,l=b.value;"string"===d?(h=h.toLowerCase(),l=l.toLowerCase()):"object"===d&&(D(h)&&(h=a.index),D(l)&&(l=b.index));h!==l&&(c=
h<l?-1:1)}else c="undefined"===d?1:"undefined"===h?-1:"null"===d?1:"null"===h?-1:d<h?-1:1;return c}return function(a,f,g,k){if(null==a)return a;if(!za(a))throw F("orderBy")("notarray",a);H(f)||(f=[f]);0===f.length&&(f=["+"]);var h=b(f),l=g?-1:1,m=B(k)?k:c;a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:h.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="null";else if("object"===c)a:{if(B(e.valueOf)&&(e=e.valueOf(),d(e)))break a;
cc(e)&&(e=e.toString(),d(e))}return{value:e,type:c,index:b}})}});a.sort(function(a,b){for(var d=0,e=h.length;d<e;d++){var f=m(a.predicateValues[d],b.predicateValues[d]);if(f)return f*h[d].descending*l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l});return a=a.map(function(a){return a.value})}}function Ra(a){B(a)&&(a={link:a});a.restrict=a.restrict||"AC";return ia(a)}function Qb(a,b,d,c,e){this.$$controls=[];this.$error={};this.$$success={};this.$pending=void 0;this.$name=e(b.name||
b.ngForm||"")(d);this.$dirty=!1;this.$valid=this.$pristine=!0;this.$submitted=this.$invalid=!1;this.$$parentForm=mb;this.$$element=a;this.$$animate=c;ae(this)}function ae(a){a.$$classCache={};a.$$classCache[be]=!(a.$$classCache[nb]=a.$$element.hasClass(nb))}function ce(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Xc(c,"-"):"";b(a,nb+
c,!0===d);b(a,be+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,k){A(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,k)):(this.$pending&&e(this.$pending,a,k),de(this.$pending)&&(this.$pending=void 0));Ga(g)?g?(e(this.$error,a,k),c(this.$$success,a,k)):(c(this.$error,a,k),e(this.$$success,a,k)):(e(this.$error,a,k),e(this.$$success,a,k));this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=
de(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid));g=this.$pending&&this.$pending[a]?void 0:this.$error[a]?!1:this.$$success[a]?!0:null;d(this,a,g);this.$$parentForm.$setValidity(a,g,this)}}function de(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Ic(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Sa(a,b,d,c,e,f){var g=K(b[0].type);if(!e.android){var k=!1;b.on("compositionstart",function(){k=!0});b.on("compositionupdate",
function(a){if(A(a.data)||""===a.data)k=!1});b.on("compositionend",function(){k=!1;l()})}var h,l=function(a){h&&(f.defer.cancel(h),h=null);if(!k){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=V(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var m=function(a,b,c){h||(h=f.defer(function(){h=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||
m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(ee[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!h){var b=this.validity,c=b.badInput,d=b.typeMismatch;h=f.defer(function(){h=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Rb(a,b){return function(d,c){var e,f;if(ha(d))return d;if(C(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-
1)&&(d=d.substring(1,d.length-1));if(mh.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),e=new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0),100>f.yyyy&&e.setFullYear(f.yyyy),e}return NaN}}function ob(a,b,d,c){return function(e,f,g,k,h,l,m,
p){function n(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function s(a){return w(a)&&!ha(a)?r(a)||void 0:a}function r(a,b){var c=k.$options.getOption("timezone");v&&v!==c&&(b=Uc(b,fc(v)));var e=d(a,b);!isNaN(e)&&c&&(e=gc(e,c));return e}Jc(e,f,g,k,a);Sa(e,f,g,k,h,l);var t="time"===a||"datetimelocal"===a,q,v;k.$parsers.push(function(c){if(k.$isEmpty(c))return null;if(b.test(c))return r(c,q);k.$$parserName=a});k.$formatters.push(function(a){if(a&&!ha(a))throw pb("datefmt",a);if(n(a)){q=a;var b=
k.$options.getOption("timezone");b&&(v=b,q=gc(q,b,!0));var d=c;t&&C(k.$options.getOption("timeSecondsFormat"))&&(d=c.replace("ss.sss",k.$options.getOption("timeSecondsFormat")).replace(/:$/,""));a=m("date")(a,d,b);t&&k.$options.getOption("timeStripZeroSeconds")&&(a=a.replace(/(?::00)?(?:\.000)?$/,""));return a}v=q=null;return""});if(w(g.min)||g.ngMin){var x=g.min||p(g.ngMin)(e),z=s(x);k.$validators.min=function(a){return!n(a)||A(z)||d(a)>=z};g.$observe("min",function(a){a!==x&&(z=s(a),x=a,k.$validate())})}if(w(g.max)||
g.ngMax){var y=g.max||p(g.ngMax)(e),J=s(y);k.$validators.max=function(a){return!n(a)||A(J)||d(a)<=J};g.$observe("max",function(a){a!==y&&(J=s(a),y=a,k.$validate())})}}}function Jc(a,b,d,c,e){(c.$$hasNativeValidators=D(b[0].validity))&&c.$parsers.push(function(a){var d=b.prop("validity")||{};if(d.badInput||d.typeMismatch)c.$$parserName=e;else return a})}function fe(a){a.$parsers.push(function(b){if(a.$isEmpty(b))return null;if(nh.test(b))return parseFloat(b);a.$$parserName="number"});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!X(b))throw pb("numfmt",
b);b=b.toString()}return b})}function na(a){w(a)&&!X(a)&&(a=parseFloat(a));return Y(a)?void 0:a}function Kc(a){var b=a.toString(),d=b.indexOf(".");return-1===d?-1<a&&1>a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ge(a,b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Kc(a):0,k=e?Kc(b):0,h=f?Kc(d):0,g=Math.max(g,k,h),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function he(a,b,d,c,e){if(w(c)){a=
a(c);if(!a.constant)throw pb("constexpr",d,c);return a(b)}return e}function Lc(a,b){function d(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e===b[m])continue a;c.push(e)}return c}function c(a){if(!a)return a;var b=a;H(a)?b=a.map(c).join(" "):D(a)?b=Object.keys(a).filter(function(b){return a[b]}).join(" "):C(a)||(b=a+"");return b}a="ngClass"+a;var e;return["$parse",function(f){return{restrict:"AC",link:function(g,
k,h){function l(a,b){var c=[];r(a,function(a){if(0<b||p[a])p[a]=(p[a]||0)+b,p[a]===+(0<b)&&c.push(a)});return c.join(" ")}function m(a){if(a===b){var c=s,c=l(c&&c.split(" "),1);h.$addClass(c)}else c=s,c=l(c&&c.split(" "),-1),h.$removeClass(c);n=a}var p=k.data("$classCounts"),n=!0,s;p||(p=T(),k.data("$classCounts",p));"ngClass"!==a&&(e||(e=f("$index",function(a){return a&1})),g.$watch(e,m));g.$watch(f(h[a],c),function(a){if(n===b){var c=s&&s.split(" "),e=a&&a.split(" "),f=d(c,e),c=d(e,c),f=l(f,-1),
c=l(c,1);h.$addClass(c);h.$removeClass(f)}s=a})}}}]}function sd(a,b,d,c,e,f){return{restrict:"A",compile:function(g,k){var h=a(k[c]);return function(a,c){c.on(e,function(c){var e=function(){h(a,{$event:c})};if(b.$$phase)if(f)a.$evalAsync(e);else try{e()}catch(g){d(g)}else a.$apply(e)})}}}}function Sb(a,b,d,c,e,f,g,k,h){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=
[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=h(d.name||"",!1)(a);this.$$parentForm=mb;this.$options=Tb;this.$$updateEvents="";this.$$updateEventHandler=this.$$updateEventHandler.bind(this);this.$$parsedNgModel=e(d.ngModel);this.$$parsedNgModelAssign=this.$$parsedNgModel.assign;this.$$ngModelGet=this.$$parsedNgModel;this.$$ngModelSet=this.$$parsedNgModelAssign;this.$$pendingDebounce=
null;this.$$parserValid=void 0;this.$$parserName="parse";this.$$currentValidationRunId=0;this.$$scope=a;this.$$rootScope=a.$root;this.$$attr=d;this.$$element=c;this.$$animate=f;this.$$timeout=g;this.$$parse=e;this.$$q=k;this.$$exceptionHandler=b;ae(this);oh(this)}function oh(a){a.$$scope.$watch(function(b){b=a.$$ngModelGet(b);b===a.$modelValue||a.$modelValue!==a.$modelValue&&b!==b||a.$$setModelValue(b);return b})}function Mc(a){this.$$options=a}function ie(a,b){r(b,function(b,c){w(a[c])||(a[c]=b)})}
function Oa(a,b){a.prop("selected",b);a.attr("selected",b)}function je(a,b,d){if(a){C(a)&&(a=new RegExp("^"+a+"$"));if(!a.test)throw F("ngPattern")("noregexp",b,a,Aa(d));return a}}function Ub(a){a=fa(a);return Y(a)?-1:a}var Xb={objectMaxDepth:5,urlErrorParamsEnabled:!0},ke=/^\/(.+)\/([a-z]*)$/,ta=Object.prototype.hasOwnProperty,K=function(a){return C(a)?a.toLowerCase():a},vb=function(a){return C(a)?a.toUpperCase():a},wa,x,sb,Ha=[].slice,Kg=[].splice,ph=[].push,la=Object.prototype.toString,Rc=Object.getPrototypeOf,
oa=F("ng"),ca=z.angular||(z.angular={}),lc,qb=0;wa=z.document.documentMode;var Y=Number.isNaN||function(a){return a!==a};E.$inject=[];Ta.$inject=[];var ze=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,V=function(a){return C(a)?a.trim():a},Od=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ba=function(){if(!w(Ba.rules)){var a=z.document.querySelector("[ng-csp]")||z.document.querySelector("[data-ng-csp]");if(a){var b=
a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ba.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ba;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ba.rules},rb=function(){if(w(rb.name_))return rb.name_;var a,b,d=Qa.length,c,e;for(b=0;b<d;++b)if(c=Qa[b],a=z.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+"jq");break}return rb.name_=e},Be=/:/g,Qa=["ng-",
"data-ng-","ng:","x-ng-"],Fe=function(a){var b=a.currentScript;if(!b)return!0;if(!(b instanceof z.HTMLScriptElement||b instanceof z.SVGScriptElement))return!1;b=b.attributes;return[b.getNamedItem("src"),b.getNamedItem("href"),b.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");c.href=b.value;if(a.location.origin===c.origin)return!0;switch(c.protocol){case "http:":case "https:":case "ftp:":case "blob:":case "file:":case "data:":return!0;default:return!1}})}(z.document),
Ie=/[A-Z]/g,Yc=!1,Pa=3,Pe={full:"1.8.2",major:1,minor:8,dot:2,codeName:"meteoric-mining"};U.expando="ng339";var Ka=U.cache={},ug=1;U._data=function(a){return this.cache[a[this.expando]]||{}};var qg=/-([a-z])/g,qh=/^-ms-/,Bb={mouseleave:"mouseout",mouseenter:"mouseover"},oc=F("jqLite"),tg=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,nc=/<|&#?\w+;/,rg=/<([\w:-]+)/,sg=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,qa={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr",
"tbody","table"]};qa.tbody=qa.tfoot=qa.colgroup=qa.caption=qa.thead;qa.th=qa.td;var hb={option:[1,'<select multiple="multiple">',"</select>"],_default:[0,"",""]},Nc;for(Nc in qa){var le=qa[Nc],me=le.slice().reverse();hb[Nc]=[me.length,"<"+me.join("><")+">","</"+le.join("></")+">"]}hb.optgroup=hb.option;var zg=z.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Wa=U.prototype={ready:hd,toString:function(){var a=[];r(this,function(b){a.push(""+b)});return"["+a.join(", ")+
"]"},eq:function(a){return 0<=a?x(this[a]):x(this[this.length+a])},length:0,push:ph,sort:[].sort,splice:[].splice},Hb={};r("multiple selected checked disabled readOnly required open".split(" "),function(a){Hb[K(a)]=a});var od={};r("input select option textarea button form details".split(" "),function(a){od[a]=!0});var vd={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:sc,removeData:rc,hasData:function(a){for(var b in Ka[a.ng339])return!0;
return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)rc(a[b]),kd(a[b])}},function(a,b){U[b]=a});r({data:sc,inheritedData:Fb,scope:function(a){return x.data(a,"$scope")||Fb(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return x.data(a,"$isolateScope")||x.data(a,"$isolateScopeNoTemplate")},controller:ld,injector:function(a){return Fb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Cb,css:function(a,b,d){b=yb(b.replace(qh,"ms-"));if(w(d))a.style[b]=
d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Pa&&2!==c&&8!==c&&a.getAttribute){var c=K(b),e=Hb[c];if(w(d))null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,e?c:d);else return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a}},prop:function(a,b,d){if(w(d))a[b]=d;else return a[b]},text:function(){function a(a,d){if(A(d)){var c=a.nodeType;return 1===c||c===Pa?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(A(b)){if(a.multiple&&"select"===
ua(a)){var d=[];r(a.options,function(a){a.selected&&d.push(a.value||a.text)});return d}return a.value}a.value=b},html:function(a,b){if(A(b))return a.innerHTML;zb(a,!0);a.innerHTML=b},empty:md},function(a,b){U.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==md&&A(2===a.length&&a!==Cb&&a!==ld?b:c)){if(D(b)){for(e=0;e<g;e++)if(a===sc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=A(e)?Math.min(g,1):g;for(f=0;f<g;f++){var k=a(this[f],b,c);e=e?e+k:k}return e}for(e=0;e<g;e++)a(this[e],
b,c);return this}});r({removeData:rc,on:function(a,b,d,c){if(w(c))throw oc("onargs");if(mc(a)){c=Ab(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=wg(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,k=function(b,c,g){var k=e[b];k||(k=e[b]=[],k.specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f));k.push(d)};g--;)b=c[g],Bb[b]?(k(Bb[b],yg),k(b,void 0,!0)):k(b)}},off:kd,one:function(a,b,d){a=x(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,
b){var d,c=a.parentNode;zb(a);r(new U(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];r(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var d=a.nodeType;if(1===d||11===d){b=new U(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;r(new U(b),function(b){a.insertBefore(b,d)})}},
wrap:function(a,b){var d=x(b).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a);d.appendChild(a)},remove:Gb,detach:function(a){Gb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;if(c){b=new U(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}}},addClass:Eb,removeClass:Db,toggleClass:function(a,b,d){b&&r(b.split(" "),function(b){var e=d;A(e)&&(e=!Cb(a,b));(e?Eb:Db)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},
find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:qc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=Ab(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:E,type:f,target:a},b.type&&(c=S(c,
b)),b=ja(g),e=d?[c].concat(d):[c],r(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){U.prototype[b]=function(b,c,e){for(var f,g=0,k=this.length;g<k;g++)A(f)?(f=a(this[g],b,c,e),w(f)&&(f=x(f))):pc(f,a(this[g],b,c,e));return w(f)?f:this}});U.prototype.bind=U.prototype.on;U.prototype.unbind=U.prototype.off;var rh=Object.create(null);pd.prototype={_idx:function(a){a!==this._lastKey&&(this._lastKey=a,this._lastIndex=this._keys.indexOf(a));return this._lastIndex},_transformKey:function(a){return Y(a)?
rh:a},get:function(a){a=this._transformKey(a);a=this._idx(a);if(-1!==a)return this._values[a]},has:function(a){a=this._transformKey(a);return-1!==this._idx(a)},set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length);this._keys[d]=a;this._values[d]=b},delete:function(a){a=this._transformKey(a);a=this._idx(a);if(-1===a)return!1;this._keys.splice(a,1);this._values.splice(a,1);this._lastKey=NaN;this._lastIndex=-1;return!0}};var Ib=pd,og=[function(){this.$get=
[function(){return Ib}]}],Bg=/^([^(]+?)=>/,Cg=/^[^(]*\(\s*([^)]*)\)/m,sh=/,/,th=/^\s*(_?)(\S+?)\1\s*$/,Ag=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ca=F("$injector");fb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw C(d)&&d||(d=a.name||Dg(a)),Ca("strictdi",d);b=qd(a);r(b[1].split(sh),function(a){a.replace(th,function(a,b,d){c.push(d)})})}a.$inject=c}}else H(a)?(b=a.length-1,tb(a[b],"fn"),c=a.slice(0,b)):tb(a,"fn",!0);return c};var ne=F("$animate"),
Ef=function(){this.$get=E},Ff=function(){var a=new Ib,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=C(b)?b.split(" "):H(b)?b:[],r(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){r(b,function(b){var c=a.get(b);if(c){var d=Eg(b.attr("class")),e="",f="";r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});r(b,function(a){e&&Eb(a,e);f&&Db(a,f)});a.delete(b)}});b.length=0}return{enabled:E,on:E,off:E,pin:E,push:function(g,
k,h,l){l&&l();h=h||{};h.from&&g.css(h.from);h.to&&g.css(h.to);if(h.addClass||h.removeClass)if(k=h.addClass,l=h.removeClass,h=a.get(g)||{},k=e(h,k,!0),l=e(h,l,!1),k||l)a.set(g,h),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},Cf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw ne("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g;a.factory(g,
d)};this.customFilter=function(a){1===arguments.length&&(c=B(a)?a:null);return c};this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,ne("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,
off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,"enter",ra(l))},move:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,"move",ra(l))},leave:function(b,c){return a.push(b,"leave",ra(c),function(){b.remove()})},addClass:function(b,c,d){d=ra(d);d.addClass=ib(d.addclass,c);return a.push(b,"addClass",d)},removeClass:function(b,c,d){d=ra(d);d.removeClass=ib(d.removeClass,
c);return a.push(b,"removeClass",d)},setClass:function(b,c,d,f){f=ra(f);f.addClass=ib(f.addClass,c);f.removeClass=ib(f.removeClass,d);return a.push(b,"setClass",f)},animate:function(b,c,d,f,m){m=ra(m);m.from=m.from?S(m.from,c):c;m.to=m.to?S(m.to,d):d;m.tempClasses=ib(m.tempClasses,f||"ng-inline-animate");return a.push(b,"animate",m)}}}]}],Hf=function(){this.$get=["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=
!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},Gf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){c()?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;r(a,function(a){a.done(c)})};
f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:E,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&
this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(r(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return f}]},Df=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&
(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);k||h.complete();k=!0});return h}var g=e||{};g.$$prepared||(g=Ia(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var k,h=new d;return{start:f,end:f}}}]},$=F("$compile"),uc=new function(){};Zc.$inject=["$provide","$$sanitizeUriProvider"];Kb.prototype.isFirstChange=function(){return this.previousValue===uc};var rd=/^((?:x|data)[:\-_])/i,Jg=
/[:\-_]+(.)/g,xd=F("$controller"),wd=/^(\S+)(\s+as\s+([\w$]+))?$/,Of=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof x&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},yd="application/json",xc={"Content-Type":yd+";charset=utf-8"},Mg=/^\[|^\{(?!\{)/,Ng={"[":/]$/,"{":/}$/},Lg=/^\)]\}',?\n/,Lb=F("$http"),Ma=ca.$interpolateMinErr=F("$interpolate");Ma.throwNoconcat=function(a){throw Ma("noconcat",a);};Ma.interr=function(a,b){return Ma("interr",a,b.toString())};
var Qg=F("$interval"),Xf=function(){this.$get=function(){function a(a){var b=function(a){b.data=a;b.called=!0};b.id=a;return b}var b=ca.callbacks,d={};return{createCallback:function(c){c="_"+(b.$$counter++).toString(36);var e="angular.callbacks."+c,f=a(c);d[e]=b[c]=f;return e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id];delete d[a]}}}},uh=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Rg={http:80,https:443,ftp:21},kb=F("$location"),
Sg=/^\s*[\\/]{2,}/,vh={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){for(var a=this.$$path,b=this.$$hash,d=Ce(this.$$search),b=b?"#"+ic(b):"",a=a.split("/"),c=a.length;c--;)a[c]=ic(a[c].replace(/%2F/g,"/"));this.$$url=a.join("/")+(d?"?"+d:"")+b;this.$$absUrl=this.$$normalizeUrl(this.$$url);this.$$urlUpdatedByLocation=!0},absUrl:Mb("$$absUrl"),url:function(a){if(A(a))return this.$$url;var b=uh.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||
"");this.hash(b[5]||"");return this},protocol:Mb("$$protocol"),host:Mb("$$host"),port:Mb("$$port"),path:Fd("$$path",function(a){a=null!==a?a.toString():"";return"/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(C(a)||X(a))a=a.toString(),this.$$search=hc(a);else if(D(a))a=Ia(a,{}),r(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw kb("isrcharg");break;default:A(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();
return this},hash:Fd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};r([Ed,Ac,zc],function(a){a.prototype=Object.create(vh);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==zc||!this.$$html5)throw kb("nostate");this.$$state=A(b)?null:b;this.$$urlUpdatedByLocation=!0;return this}});var Ya=F("$parse"),Wg={}.constructor.prototype.valueOf,Vb=T();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Vb[a]=
!0});var wh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Ob=function(a){this.options=a};Ob.prototype={constructor:Ob,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,
text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var b=a+this.peek(),d=b+this.peek(2),c=Vb[b],e=Vb[d];Vb[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===
typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},
isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=
w(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Ya("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=K(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,
text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+
1,this.index+5),e.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=wh[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var q=function(a,b){this.lexer=a;this.options=b};q.Program="Program";q.ExpressionStatement="ExpressionStatement";q.AssignmentExpression="AssignmentExpression";q.ConditionalExpression=
"ConditionalExpression";q.LogicalExpression="LogicalExpression";q.BinaryExpression="BinaryExpression";q.UnaryExpression="UnaryExpression";q.CallExpression="CallExpression";q.MemberExpression="MemberExpression";q.Identifier="Identifier";q.Literal="Literal";q.ArrayExpression="ArrayExpression";q.Property="Property";q.ObjectExpression="ObjectExpression";q.ThisExpression="ThisExpression";q.LocalsExpression="LocalsExpression";q.NGValueParameter="NGValueParameter";q.prototype={ast:function(a){this.text=
a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},
expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Jd(a))throw Ya("lval");a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,
operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:b.text,
left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},
primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=Ia(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",
this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());
return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");
return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:q.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),
b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");return{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Ya("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Ya("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Ya("ueoe",
this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}};var Hd=2;Ld.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],
body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};Z(a,b.$filter);var d="",c;this.stage="assign";if(c=Kd(a))this.state.computing="assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l");c=Id(a.body);b.stage="inputs";r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d;var k=b.nextId();b.recurse(a,k);b.return_(k);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage=
"main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,Tg,Ug,Gd);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+
";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},
recurse:function(a,b,d,c,e,f){var g,k,h=this,l,m,p;c=c||E;if(!f&&w(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){h.recurse(b.expression,void 0,void 0,function(a){k=a});c!==a.body.length-1?h.current().body.push(k,";"):h.return_(k)});break;case q.Literal:m=this.escape(a.value);this.assign(b,m);c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,
void 0,function(a){k=a});m=a.operator+"("+this.ifDefined(k,0)+")";this.assign(b,m);c(m);break;case q.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){k=a});m="+"===a.operator?this.plus(g,k):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(k,0):"("+g+")"+a.operator+"("+k+")";this.assign(b,m);c(m);break;case q.LogicalExpression:b=b||this.nextId();h.recurse(a.left,b);h.if_("&&"===a.operator?b:h.not(b),h.lazyRecurse(a.right,
b));c(b);break;case q.ConditionalExpression:b=b||this.nextId();h.recurse(a.test,b);h.if_(b,h.lazyRecurse(a.alternate,b),h.lazyRecurse(a.consequent,b));c(b);break;case q.Identifier:b=b||this.nextId();d&&(d.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",a.name)),function(){h.if_("inputs"===h.stage||"s",function(){e&&1!==e&&h.if_(h.isNull(h.nonComputedMember("s",a.name)),
h.lazyAssign(h.nonComputedMember("s",a.name),"{}"));h.assign(b,h.nonComputedMember("s",a.name))})},b&&h.lazyAssign(b,h.nonComputedMember("l",a.name)));c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();h.recurse(a.object,g,void 0,function(){h.if_(h.notNull(g),function(){a.computed?(k=h.nextId(),h.recurse(a.property,k),h.getStringValue(k),e&&1!==e&&h.if_(h.not(h.computedMember(g,k)),h.lazyAssign(h.computedMember(g,k),"{}")),m=h.computedMember(g,k),h.assign(b,
m),d&&(d.computed=!0,d.name=k)):(e&&1!==e&&h.if_(h.isNull(h.nonComputedMember(g,a.property.name)),h.lazyAssign(h.nonComputedMember(g,a.property.name),"{}")),m=h.nonComputedMember(g,a.property.name),h.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){h.assign(b,"undefined")});c(b)},!!e);break;case q.CallExpression:b=b||this.nextId();a.filter?(k=h.filter(a.callee.name),l=[],r(a.arguments,function(a){var b=h.nextId();h.recurse(a,b);l.push(b)}),m=k+"("+l.join(",")+")",h.assign(b,m),c(b)):
(k=h.nextId(),g={},l=[],h.recurse(a.callee,k,g,function(){h.if_(h.notNull(k),function(){r(a.arguments,function(b){h.recurse(b,a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m=g.name?h.member(g.context,g.name,g.computed)+"("+l.join(",")+")":k+"("+l.join(",")+")";h.assign(b,m)},function(){h.assign(b,"undefined")});c(b)}));break;case q.AssignmentExpression:k=this.nextId();g={};this.recurse(a.left,void 0,g,function(){h.if_(h.notNull(g.context),function(){h.recurse(a.right,k);m=h.member(g.context,
g.name,g.computed)+a.operator+k;h.assign(b,m);c(b||m)})},1);break;case q.ArrayExpression:l=[];r(a.elements,function(b){h.recurse(b,a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case q.ObjectExpression:l=[];p=!1;r(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed?(g=h.nextId(),h.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value;k=h.nextId();
h.recurse(a.value,k);h.assign(h.member(b,g,a.computed),k)})):(r(a.properties,function(b){h.recurse(b.value,a.constant?void 0:h.nextId(),void 0,function(a){l.push(h.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case q.ThisExpression:this.assign(b,"s");c(b||"s");break;case q.LocalsExpression:this.assign(b,"l");c(b||"l");break;case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+
b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,
b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,
b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(C(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(X(a))return a.toString();if(!0===a)return"true";if(!1===
a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Ya("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};Md.prototype={compile:function(a){var b=this;Z(a,b.$filter);var d,c;if(d=Kd(a))c=this.recurse(d);d=Id(a.body);var e;d&&(e=[],r(d,function(a,c){var d=b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];r(a.body,
function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?E:1===a.body.length?f[0]:function(a,b){var c;r(f,function(d){c=d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:return c=this.recurse(a.left),
e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,
e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,d,f));a=e.apply(void 0,p,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var p=e(a,c,d,f),n;if(null!=p.value){n=[];for(var s=0;s<g.length;++s)n.push(g[s](a,c,d,f));n=p.value.apply(p.context,n)}return b?
{value:n}:n};case q.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=c(a,d,f,g);a=e(a,d,f,g);p.context[p.name]=a;return b?{value:a}:a};case q.ArrayExpression:return g=[],r(a.elements,function(a){g.push(f.recurse(a))}),function(a,c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case q.ObjectExpression:return g=[],r(a.properties,function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):
g.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case q.ThisExpression:return function(a){return b?{value:a}:a};case q.LocalsExpression:return function(a,c){return b?{value:c}:c};case q.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,
c,e,f){d=a(d,c,e,f);d=w(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=w(d)?-d:-0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=Gd(k,c);return d?{value:k}:k}},"binary-":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=(w(k)?k:0)-(w(c)?c:0);return d?{value:k}:k}},"binary*":function(a,b,
d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,
e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=
a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k)?b(e,f,g,k):d(e,f,g,k);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=
e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:e}},computedMember:function(a,b,d,c){return function(e,f,g,k){var h=a(e,f,g,k),l,m;null!=h&&(l=b(e,f,g,k),l+="",c&&1!==c&&h&&!h[l]&&(h[l]={}),m=h[l]);return d?{context:h,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0;return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,
c,e,f){return f?f[b]:a(d,c,e)}}};Nb.prototype={constructor:Nb,parse:function(a){a=this.getAst(a);var b=this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression);b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"===a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),
oneTime:b}}};var Ea=F("$sce"),W={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Dc=/_([a-z])/g,Zg=F("$templateRequest"),$g=F("$timeout"),aa=z.document.createElement("a"),Qd=ga(z.location.href),Na;aa.href="http://[::1]";var ah="[::1]"===aa.hostname;Rd.$inject=["$document"];fd.$inject=["$provide"];var Yd=22,Xd=".",Fc="0";Sd.$inject=["$locale"];Ud.$inject=["$locale"];var lh={yyyy:ea("FullYear",4,0,!1,!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),
MMMM:lb("Month"),MMM:lb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:lb("Month",!1,!0),dd:ea("Date",2),d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:lb("Day"),EEE:lb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Pb(Math[0<a?"floor":"ceil"](a/60),2)+Pb(Math.abs(a%60),2))},
ww:$d(2),w:$d(1),G:Gc,GG:Gc,GGG:Gc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},kh=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,jh=/^-?\d+$/;Td.$inject=["$locale"];var eh=ia(K),fh=ia(vb);Vd.$inject=["$parse"];var Re=ia({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===la.call(b.prop("href"))?"xlink:href":"href";
b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),wb={};r(Hb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=xa("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});wb[c]=function(){return{restrict:"A",priority:100,link:e}}}});r(vd,function(a,b){wb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(ke))){e.$set("ngPattern",new RegExp(c[1],
c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});r(["src","srcset","href"],function(a){var b=xa("ng-"+a);wb[b]=["$sce",function(d){return{priority:99,link:function(c,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===la.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null);f.$set(b,d.getTrustedMediaUrl(f[b]));f.$observe(b,function(b){b?(f.$set(k,b),wa&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}]});var mb={$addControl:E,$getControls:ia([]),$$renameControl:function(a,
b){a.$name=b},$removeControl:E,$setValidity:E,$setDirty:E,$setPristine:E,$setSubmitted:E,$$setSubmitted:E};Qb.$inject=["$element","$attrs","$scope","$animate","$interpolate"];Qb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ja(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$getControls:function(){return ja(this.$$controls)},
$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name];r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);r(this.$error,function(b,d){this.$setValidity(d,null,a)},this);r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);cb(this.$$controls,a);a.$$parentForm=mb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,
Wb);this.$dirty=!0;this.$pristine=!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,Za,Wb+" ng-submitted");this.$dirty=!1;this.$pristine=!0;this.$submitted=!1;r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==mb;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,
"ng-submitted");this.$submitted=!0;r(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}};ce({clazz:Qb,set:function(a,b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var oe=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||E}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Qb,compile:function(d,f){d.addClass(Za).addClass(nb);
var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var s=g?c(p.$name):E;g&&(s(a,p),e.$observe(g,function(b){p.$name!==b&&(s(a,void 0),p.$$parentForm.$$renameControl(p,b),s=c(p.$name),s(a,p))}));
d.on("$destroy",function(){p.$$parentForm.$removeControl(p);s(a,void 0);S(p,mb)})}}}}}]},Se=oe(),df=oe(!0),mh=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,xh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,yh=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,
nh=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,pe=/^(\d{4,})-(\d{2})-(\d{2})$/,qe=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Oc=/^(\d{4,})-W(\d\d)$/,re=/^(\d{4,})-(\d\d)$/,se=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ee=T();r(["date","datetime-local","month","time","week"],function(a){ee[a]=!0});var te={text:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Ic(c)},date:ob("date",pe,Rb(pe,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":ob("datetimelocal",qe,Rb(qe,"yyyy MM dd HH mm ss sss".split(" ")),
"yyyy-MM-ddTHH:mm:ss.sss"),time:ob("time",se,Rb(se,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:ob("week",Oc,function(a,b){if(ha(a))return a;if(C(a)){Oc.lastIndex=0;var d=Oc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,k=0,h=Zd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),k=b.getMilliseconds());return new Date(c,0,h.getDate()+e,d,f,g,k)}}return NaN},"yyyy-Www"),month:ob("month",re,Rb(re,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f,g,k){Jc(a,b,d,c,"number");fe(c);Sa(a,
b,d,c,e,f);var h;if(w(d.min)||d.ngMin){var l=d.min||k(d.ngMin)(a);h=na(l);c.$validators.min=function(a,b){return c.$isEmpty(b)||A(h)||b>=h};d.$observe("min",function(a){a!==l&&(h=na(a),l=a,c.$validate())})}if(w(d.max)||d.ngMax){var m=d.max||k(d.ngMax)(a),p=na(m);c.$validators.max=function(a,b){return c.$isEmpty(b)||A(p)||b<=p};d.$observe("max",function(a){a!==m&&(p=na(a),m=a,c.$validate())})}if(w(d.step)||d.ngStep){var n=d.step||k(d.ngStep)(a),s=na(n);c.$validators.step=function(a,b){return c.$isEmpty(b)||
A(s)||ge(b,h||0,s)};d.$observe("step",function(a){a!==n&&(s=na(a),n=a,c.$validate())})}},url:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Ic(c);c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||xh.test(d)}},email:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Ic(c);c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||yh.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==V(d.ngTrim);A(d.name)&&b.attr("name",++qb);b.on("change",function(a){var g;b[0].checked&&(g=d.value,e&&(g=
V(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=V(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,c){b.attr(a,d[a]);var e=d[a];d.$observe(a,function(a){a!==e&&(e=a,c(a))})}function k(a){p=na(a);Y(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function h(a){n=na(a);Y(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())}function l(a){s=
na(a);Y(c.$modelValue)||(m?c.$viewValue!==b.val()&&c.$setViewValue(b.val()):c.$validate())}Jc(a,b,d,c,"range");fe(c);Sa(a,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?0:void 0,n=m?100:void 0,s=m?1:void 0,r=b[0].validity;a=w(d.min);e=w(d.max);f=w(d.step);var q=c.$render;c.$render=m&&w(r.rangeUnderflow)&&w(r.rangeOverflow)?function(){q();c.$setViewValue(b.val())}:q;a&&(p=na(d.min),c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||A(p)||b>=p},g("min",k));
e&&(n=na(d.max),c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||A(n)||b<=n},g("max",h));f&&(s=na(d.step),c.$validators.step=m?function(){return!r.stepMismatch}:function(a,b){return c.$isEmpty(b)||A(s)||ge(b,p||0,s)},g("step",l))},checkbox:function(a,b,d,c,e,f,g,k){var h=he(k,a,"ngTrueValue",d.ngTrueValue,!0),l=he(k,a,"ngFalseValue",d.ngFalseValue,!1);b.on("change",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=
function(a){return!1===a};c.$formatters.push(function(a){return va(a,h)});c.$parsers.push(function(a){return a?h:l})},hidden:E,button:E,submit:E,reset:E,file:E},$c=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,k){k[0]&&(te[K(g.type)]||te.text)(e,f,g,k[0],b,a,d,c)}}}}],Af=function(){var a={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(a){this.setAttribute("value",a)}};
return{restrict:"E",priority:200,compile:function(b,d){if("hidden"===K(d.type))return{pre:function(b,d,f,g){b=d[0];b.parentNode&&b.parentNode.insertBefore(b,b.nextSibling);Object.defineProperty&&Object.defineProperty(b,"value",a)}}}}},zh=/^(true|false|\d+)$/,xf=function(){function a(a,d,c){var e=w(c)?c:9===wa?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return zh.test(d.ngValue)?function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,
function(b){a(d,f,b)})}}}},We=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=jc(a)})}}}}],Ye=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=A(a)?"":a})}}}}],
Xe=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],wf=ia({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Ze=Lc("",!0),af=Lc("Odd",0),$e=Lc("Even",1),bf=Ra({compile:function(a,
b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),cf=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],ed={},Ah={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=xa("ng-"+a);ed[b]=["$parse","$rootScope","$exceptionHandler",function(d,c,e){return sd(d,c,e,b,a,Ah[a])}]});var ff=["$animate","$compile",function(a,b){return{multiElement:!0,
transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var k,h,l;d.$watch(e.ngIf,function(d){d?h||g(function(d,f){h=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);k={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),h&&(h.$destroy(),h=null),k&&(l=ub(k.clone),a.leave(l).done(function(a){!1!==a&&(l=null)}),k=null))})}}}],gf=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",
controller:ca.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",k=e.autoscroll;return function(c,e,m,p,n){var r=0,q,t,x,v=function(){t&&(t.remove(),t=null);q&&(q.$destroy(),q=null);x&&(d.leave(x).done(function(a){!1!==a&&(t=null)}),t=x,x=null)};c.$watch(f,function(f){var m=function(a){!1===a||!w(k)||k&&!c.$eval(k)||b()},t=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&t===r){var b=c.$new();p.template=a;a=n(b,function(a){v();d.enter(a,null,e).done(m)});q=b;x=a;q.$emit("$includeContentLoaded",
f);c.$eval(g)}},function(){c.$$destroyed||t!==r||(v(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(v(),p.template=null)})}}}}],zf=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){la.call(d[0]).match(/SVG/)?(d.empty(),a(gd(e.template,z.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],hf=Ra({priority:450,compile:function(){return{pre:function(a,
b,d){a.$eval(d.ngInit)}}}}),vf=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!A(a)){var b=[];a&&r(a.split(g),function(a){a&&b.push(f?V(a):a)});return b}});c.$formatters.push(function(a){if(H(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},nb="ng-valid",be="ng-invalid",Za="ng-pristine",Wb="ng-dirty",pb=F("ngModel");Sb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");
Sb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);B(c)&&(c=a(b));return c};this.$$ngModelSet=function(a,c){B(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw pb("nonassign",this.$$attr.ngModel,Aa(this.$$element));},$render:E,$isEmpty:function(a){return A(a)||
""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,"ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Wb);this.$$animate.addClass(this.$$element,Za)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,
Za);this.$$animate.addClass(this.$$element,Wb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=!0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!Y(this.$modelValue)){var a=
this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!==c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;r(h.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(r(h.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;r(h.$asyncValidators,function(e,
g){var h=e(a,b);if(!h||!B(h.then))throw pb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?h.$$q.all(c).then(function(){g(d)},E):g(!0)}function f(a,b){k===h.$$currentValidationRunId&&h.$setValidity(a,b)}function g(a){k===h.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var k=this.$$currentValidationRunId,h=this;(function(){var a=h.$$parserName;if(A(h.$$parserValid))f(a,null);else return h.$$parserValid||(r(h.$validators,function(a,
b){f(b,null)}),r(h.$asyncValidators,function(a,b){f(b,null)})),f(a,h.$$parserValid),h.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce);if(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;this.$$parserValid=
A(a)?void 0:!0;this.$setValidity(this.$$parserName,null);this.$$parserName="parse";if(this.$$parserValid)for(var d=0;d<this.$parsers.length;d++)if(a=this.$parsers[d](a),A(a)){this.$$parserValid=!1;break}Y(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var c=this.$modelValue,e=this.$options.getOption("allowInvalid");this.$$rawModelValue=a;e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope());this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=
d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue);r(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=a;this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");X(b[a])?b=b[a]:X(b["default"])&&-1===this.$options.getOption("updateOn").indexOf(a)?
b=b["default"]:X(b["*"])&&(b=b["*"]);this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},$overrideModelOptions:function(a){this.$options=this.$options.createChild(a);this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=
a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,E))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a;this.$$parserValid=void 0;this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler);if(this.$$updateEvents=this.$options.getOption("updateOn"))this.$$element.on(this.$$updateEvents,
this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}};ce({clazz:Sb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var uf=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Sb,priority:1,compile:function(b){b.addClass(Za).addClass("ng-untouched").addClass(nb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm;if(f=f[2])g.$options=f.$options;g.$$initGetterSetters();b.$addControl(g);
e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){k.$setTouched()}var k=f[0];k.$$setUpdateOnEvents();c.on("blur",function(){k.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Tb,Bh=/(\s+|^)default(\s+|$)/;Mc.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;a=S({},a);r(a,function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=
this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=V(d.replace(Bh,function(){a.updateOnDefault=!0;return" "})))},this);b&&(delete a["*"],ie(a,this.$$options));ie(a,Tb.$$options);return new Mc(a)}};Tb=new Mc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var yf=function(){function a(a,d){this.$$attrs=a;this.$$scope=d}a.$inject=["$attrs","$scope"];a.prototype={$onInit:function(){var a=
this.parentCtrl?this.parentCtrl.$options:Tb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}};return{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},jf=Ra({terminal:!0,priority:1E3}),Ch=F("ngOptions"),Dh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
sf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!r&&za(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var p=a.match(Dh);if(!p)throw Ch("iexp",a,Aa(b));var n=p[5]||p[7],r=p[6];a=/ as /.test(p[0])&&p[1];var q=p[9];b=d(p[2]?p[1]:n);var t=a&&d(a)||b,w=q&&d(q),v=q?function(a,b){return w(c,b)}:function(a){return La(a)},
x=function(a,b){return v(a,B(a,b))},A=d(p[2]||p[1]),y=d(p[3]||""),J=d(p[4]||""),I=d(p[8]),z={},B=r?function(a,b){z[r]=b;z[n]=a;return z}:function(a){z[n]=a;return z};return{trackBy:q,getTrackByValue:x,getWatchables:d(I,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var k=a===d?g:d[g],l=a[k],k=B(l,k),l=v(l,k);b.push(l);if(p[2]||p[1])l=A(c,k),b.push(l);p[4]&&(k=J(c,k),b.push(k))}return b}),getOptions:function(){for(var a=[],b={},d=I(c)||[],g=f(d),k=g.length,n=0;n<k;n++){var p=d===
g?n:g[n],r=B(d[p],p),s=t(c,r),p=v(s,r),w=A(c,r),z=y(c,r),r=J(c,r),s=new e(p,s,w,z,r);a.push(s);b[p]=s}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[x(a)]},getViewValueFromOption:function(a){return q?Ia(a.viewValue):a.viewValue}}}}}var e=z.document.createElement("option"),f=z.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=E},post:function(d,k,h,l){function m(a){var b=(a=v.getOptionFromViewValue(a))&&
a.element;b&&!b.selected&&(b.selected=!0);return a}function p(a,b){a.element=b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);b.value=a.selectValue}var n=l[0],q=l[1],A=h.multiple;l=0;for(var t=k.children(),z=t.length;l<z;l++)if(""===t[l].value){n.hasEmptyOption=!0;n.emptyOption=t.eq(l);break}k.empty();l=!!n.emptyOption;x(e.cloneNode(!1)).val("?");var v,B=c(h.ngOptions,k,d),C=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"};A?(n.writeValue=
function(a){if(v){var b=a&&a.map(m)||[];v.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)})}},n.readValue=function(){var a=k.val()||[],b=[];r(a,function(a){(a=v.selectValueMap[a])&&!a.disabled&&b.push(v.getViewValueFromOption(a))});return b},B.trackBy&&d.$watchCollection(function(){if(H(q.$viewValue))return q.$viewValue.map(function(a){return B.getTrackByValue(a)})},function(){q.$render()})):(n.writeValue=function(a){if(v){var b=k[0].options[k[0].selectedIndex],
c=v.getOptionFromViewValue(a);b&&b.removeAttribute("selected");c?(k[0].value!==c.selectValue&&(n.removeUnknownOption(),k[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a)}},n.readValue=function(){var a=v.selectValueMap[k.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),v.getViewValueFromOption(a)):null},B.trackBy&&d.$watch(function(){return B.getTrackByValue(q.$viewValue)},function(){q.$render()}));
l&&(a(n.emptyOption)(d),k.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),q.$render(),b.on("$destroy",function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1;n.emptyOption=void 0;a&&q.$render()}))}):n.emptyOption.removeClass("ng-scope"));d.$watchCollection(B.getWatchables,function(){var a=v&&n.readValue();if(v)for(var b=v.items.length-1;0<=b;b--){var c=
v.items[b];w(c.group)?Gb(c.element.parentNode):Gb(c.element)}v=B.getOptions();var d={};v.items.forEach(function(a){var b;if(w(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),C.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b);var c=e.cloneNode(!1);b.appendChild(c);p(a,c)}else b=e.cloneNode(!1),C.appendChild(b),p(a,b)});k[0].appendChild(C);q.$render();q.$isEmpty(a)||(b=n.readValue(),(B.trackBy||A?va(a,b):a===b)||(q.$setViewValue(b),q.$render()))})}}}}],kf=["$locale","$interpolate","$log",
function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,k){function h(a){g.text(a||"")}var l=k.count,m=k.$attr.when&&g.attr(k.$attr.when),p=k.offset||0,n=f.$eval(m)||{},q={},w=b.startSymbol(),t=b.endSymbol(),x=w+l+"-"+p+t,v=ca.noop,z;r(k,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+K(c[2]),n[c]=g.attr(k.$attr[b]))});r(n,function(a,d){q[d]=b(a.replace(c,x))});f.$watch(l,function(b){var c=parseFloat(b),e=Y(c);e||c in n||(c=a.pluralCat(c-p));c===z||e&&Y(z)||(v(),e=q[c],A(e)?
(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),v=E,h()):v=f.$watch(e,h),z=c)})}}}],ue=F("ngRef"),lf=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,d){var c=xa(ua(b)),e=a(d.ngRef),f=e.assign||function(){throw ue("nonassign",d.ngRef);};return function(a,b,h){var l;if(h.hasOwnProperty("ngRefRead"))if("$element"===h.ngRefRead)l=b;else{if(l=b.data("$"+h.ngRefRead+"Controller"),!l)throw ue("noctrl",h.ngRefRead,d.ngRef);}else l=b.data("$"+c+"Controller");l=
l||b;f(a,l);b.on("$destroy",function(){e(a)===l&&f(a,null)})}}}}],mf=["$parse","$animate","$compile",function(a,b,d){var c=F("ngRepeat"),e=function(a,b,c,d,e,f,g){a[c]=d;e&&(a[e]=f);a.$index=b;a.$first=0===b;a.$last=b===g-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))},f=function(a,b,c){return La(c)},g=function(a,b){return b};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(k,h){var l=h.ngRepeat,m=d.$$createComment("end ngRepeat",
l),p=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!p)throw c("iexp",l);var n=p[1],q=p[2],w=p[3],t=p[4],p=n.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);if(!p)throw c("iidexp",n);var x=p[3]||p[1],v=p[2];if(w&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(w)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(w)))throw c("badident",w);var A;if(t){var z={$id:La},y=a(t);A=function(a,b,c,d){v&&
(z[v]=b);z[x]=c;z.$index=d;return y(a,z)}}return function(a,d,h,k,n){var p=T();a.$watchCollection(q,function(h){var k,q,t=d[0],s,y=T(),B,C,E,D,H,F,K;w&&(a[w]=h);if(za(h))H=h,q=A||f;else for(K in q=A||g,H=[],h)ta.call(h,K)&&"$"!==K.charAt(0)&&H.push(K);B=H.length;K=Array(B);for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],D=q(a,C,E,k),p[D])F=p[D],delete p[D],y[D]=F,K[k]=F;else{if(y[D])throw r(K,function(a){a&&a.scope&&(p[a.id]=a)}),c("dupes",l,D,E);K[k]={id:D,scope:void 0,clone:void 0};y[D]=!0}z&&(z[x]=void 0);
for(s in p){F=p[s];D=ub(F.clone);b.leave(D);if(D[0].parentNode)for(k=0,q=D.length;k<q;k++)D[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],F=K[k],F.scope){s=t;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);F.clone[0]!==s&&b.move(ub(F.clone),null,t);t=F.clone[F.clone.length-1];e(F.scope,k,x,E,v,C,B)}else n(function(a,c){F.scope=c;var d=m.cloneNode(!1);a[a.length++]=d;b.enter(a,null,t);t=d;F.clone=a;y[F.id]=F;e(F.scope,k,x,E,v,C,B)});p=y})}}}}],nf=["$animate",function(a){return{restrict:"A",
multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],ef=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],of=Ra(function(a,b,d){a.$watchCollection(d.ngStyle,function(a,d){d&&a!==d&&r(d,function(a,c){b.css(c,"")});a&&b.css(a)})}),pf=["$animate","$compile",function(a,
b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],k=[],h=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){for(var d,e;h.length;)a.cancel(h.pop());d=0;for(e=l.length;d<e;++d){var q=ub(k[d].clone);l[d].$destroy();(h[d]=a.leave(q)).done(m(h,d))}k.length=0;l.length=0;(g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");
k.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],qf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){a=d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,b,c){return c[b-1]!==a});r(a,function(a){c.cases["!"+a]=c.cases["!"+a]||[];c.cases["!"+a].push({transclude:e,element:b})})}}),rf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,
element:b})}}),Eh=F("ngTransclude"),tf=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());b.empty();return function(a,b,f,g,k){function h(){d(a,function(a){b.append(a)})}if(!k)throw Eh("orphan",Aa(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude="");f=f.ngTransclude||f.ngTranscludeSlot;k(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Pa||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(h(),c.$destroy())},
null,f);f&&!k.isSlotFilled(f)&&h()}}}}],Te=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],Fh={$setViewValue:E,$render:E},Gh=["$element","$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1;e.ngModelCtrl.$render()}))}function c(a){k||(k=!0,b.$$postDigest(function(){b.$$destroyed||(k=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Ib;e.selectValueMap=
{};e.ngModelCtrl=Fh;e.multiple=!1;e.unknownOption=x(z.document.createElement("option"));e.hasEmptyOption=!1;e.emptyOption=void 0;e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);a.prepend(e.unknownOption);Oa(e.unknownOption,!0);a.val(b)};e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);Oa(e.unknownOption,!0);a.val(b)};e.generateUnknownOptionValue=function(a){return"? "+La(a)+" ?"};e.removeUnknownOption=function(){e.unknownOption.parent()&&
e.unknownOption.remove()};e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Oa(e.emptyOption,!0))};e.unselectEmptyOption=function(){e.hasEmptyOption&&Oa(e.emptyOption,!1)};b.$on("$destroy",function(){e.renderUnknownOption=E});e.readValue=function(){var b=a.val(),b=b in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null};e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Oa(x(c),!1);e.hasOption(b)?(e.removeUnknownOption(),c=La(b),a.val(c in e.selectValueMap?
c:b),Oa(x(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)};e.addOption=function(a,b){if(8!==b[0].nodeType){Ja(a,'"option value"');""===a&&(e.hasEmptyOption=!0,e.emptyOption=b);var c=f.get(a)||0;f.set(a,c+1);d()}};e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))};e.hasOption=function(a){return!!f.get(a)};e.$hasEmptyOption=function(){return e.hasEmptyOption};e.$isUnknownOptionSelected=function(){return a[0].options[0]===
e.unknownOption[0]};e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};e.selectUnknownOrEmptyOption=function(a){null==a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)};var g=!1,k=!1;e.registerOption=function(a,b,f,g,k){if(f.$attr.ngValue){var q,r;f.$observe("value",function(a){var d,f=b.prop("selected");w(r)&&(e.removeOption(q),delete e.selectValueMap[r],
d=!0);r=La(a);q=a;e.selectValueMap[r]=a;e.addOption(a,b);b.attr("value",r);d&&f&&c()})}else g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");w(q)&&(e.removeOption(q),d=!0);q=a;e.addOption(a,b);d&&f&&c()}):k?a.$watch(k,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d);e.addOption(a,b);d&&g&&c()}):e.addOption(f.value,b);f.$observe("disabled",function(a){if("true"===a||a&&b.prop("selected"))e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render())});
b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b);d();(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Ue=function(){return{restrict:"E",require:["select","?ngModel"],controller:Gh,priority:1,link:{pre:function(a,b,d,c){var e=c[0],f=c[1];if(f){if(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption();a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple){e.multiple=!0;e.readValue=function(){var a=[];r(b.find("option"),function(b){b.selected&&!b.disabled&&
(b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))});return a};e.writeValue=function(a){r(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Oa(x(b),c)})};var g,k=NaN;a.$watch(function(){k!==f.$viewValue||va(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());k=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}else e.registerOption=E},post:function(a,b,d,c){var e=
c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},Ve=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;w(d.ngValue)||(w(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text()));return function(a,b,d){var h=b.parent();(h=h.data("$selectController")||h.parent().data("$selectController"))&&h.registerOption(a,b,d,c,e)}}}}],bd=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=
c.hasOwnProperty("required")||a(c.ngRequired)(b);c.ngRequired||(c.required=!0);e.$validators.required=function(a,b){return!f||!e.$isEmpty(b)};c.$observe("required",function(a){f!==a&&(f=a,e.$validate())})}}}}],ad=["$parse",function(a){return{restrict:"A",require:"?ngModel",compile:function(b,d){var c,e;d.ngPattern&&(c=d.ngPattern,e="/"===d.ngPattern.charAt(0)&&ke.test(d.ngPattern)?function(){return d.ngPattern}:a(d.ngPattern));return function(a,b,d,h){if(h){var l=d.pattern;d.ngPattern?l=e(a):c=d.pattern;
var m=je(l,c,b);d.$observe("pattern",function(a){var d=m;m=je(a,c,b);(d&&d.toString())!==(m&&m.toString())&&h.$validate()});h.$validators.pattern=function(a,b){return h.$isEmpty(b)||A(m)||m.test(b)}}}}}}],dd=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.maxlength||a(c.ngMaxlength)(b),g=Ub(f);c.$observe("maxlength",function(a){f!==a&&(g=Ub(a),f=a,e.$validate())});e.$validators.maxlength=function(a,b){return 0>g||e.$isEmpty(b)||b.length<=g}}}}}],cd=
["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.minlength||a(c.ngMinlength)(b),g=Ub(f)||-1;c.$observe("minlength",function(a){f!==a&&(g=Ub(a)||-1,f=a,e.$validate())});e.$validators.minlength=function(a,b){return e.$isEmpty(b)||b.length>=g}}}}}];z.angular.bootstrap?z.console&&console.log("WARNING: Tried to load AngularJS more than once."):(Je(),Oe(ca),ca.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==
b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),
WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,
c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),x(function(){Ee(z.document,Wc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(window.angular.element("<style>").text('@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}'));
//# sourceMappingURL=angular.min.js.map
;
/*
 * Pointer Events Polyfill: Adds support for the style attribute "pointer-events: none" to browsers without this feature (namely, IE).
 * (c) 2013, Kent Mewhort, licensed under BSD. See LICENSE.txt for details.
 */

// constructor
function PointerEventsPolyfill(options){
    // set defaults
    this.options = {
        selector: '*',
        mouseEvents: ['click','dblclick','mousedown','mouseup'],
        usePolyfillIf: function(){
            if(navigator.appName == 'Microsoft Internet Explorer')
            {
                var agent = navigator.userAgent;
                if (agent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/) != null){
                    var version = parseFloat( RegExp.$1 );
                    if(version < 11)
                        return true;
                }
            }
            return false;
        }
    };
    if(options){
        var obj = this;
        $.each(options, function(k,v){
            obj.options[k] = v;
        });
    }

    if(this.options.usePolyfillIf())
        this.register_mouse_events();
}

// singleton initializer
PointerEventsPolyfill.initialize = function(options){
    if(PointerEventsPolyfill.singleton == null)
        PointerEventsPolyfill.singleton = new PointerEventsPolyfill(options);
    return PointerEventsPolyfill.singleton;
};

// handle mouse events w/ support for pointer-events: none
PointerEventsPolyfill.prototype.register_mouse_events = function(){
    // register on all elements (and all future elements) matching the selector
    $(document).on(this.options.mouseEvents.join(" "), this.options.selector, function(e){
        if($(this).css('pointer-events') == 'none'){
            // peak at the element below
            var origDisplayAttribute = $(this).css('display');
            $(this).css('display','none');

            var underneathElem = document.elementFromPoint(e.clientX, e.clientY);

            if(origDisplayAttribute)
                $(this)
                    .css('display', origDisplayAttribute);
            else
                $(this).css('display','');

            // fire the mouse event on the element below
            e.target = underneathElem;
            $(underneathElem).trigger(e).trigger('focus');

            return false;
        }
        return true;
    });
};;
// IE console.log disable errors
if (typeof console === "undefined" || typeof console.log === "undefined") {
	console = {};
	console.log = function() {};
}

// Initialize pointer-events polyfill
$(document).ready(function() {
	PointerEventsPolyfill.initialize({});
	$("a.help-centre-view-more-link.show-for-small-only").on(
		"click",
		function() {
			$(this)
				.prev("ol")
				.find("li.hide-for-small-only")
				.each(function() {
					$(this).removeClass("hide-for-small-only");
				});
			$(this).removeClass("show-for-small-only");
			$(this).hide();
		}
	);

	// init zurb foundation js
	// ITSEC-848 | 1. Removed foundation since its not required as css generated by optima. 2. security issue raised due to old version
	//$(document).foundation();

	$(".pl01-header-mobile-login a").on("click", function() {
		var IS_IPAD = navigator.userAgent.match(/iPad/i) != null,
			IS_IPHONE =
				!IS_IPAD &&
				(navigator.userAgent.match(/iPhone/i) != null ||
					navigator.userAgent.match(/iPod/i) != null),
			IS_IOS = IS_IPAD || IS_IPHONE,
			IS_ANDROID =
				!IS_IOS && navigator.userAgent.match(/android/i) != null;

		var ele = $(this);

		//schema of the app
		var deepLink = ele.data("deep_link");

		// Market address for android and iphone
		var market_a = ele.data("market_link_android");
		var market_i = ele.data("market_link_apple");

		if (IS_ANDROID) {
			setTimeout(function() {
				location.href = market_a;
			}, 1000);

			location.href = deepLink;
		} else if (IS_IOS) {
			location.href = market_i;
		} else {
			alert("android and iOS only");
		}

		event.preventDefault();
	});
	$(".pl75-videoplaylist-thumb").on("click", function() {
		// stop all video
		$(".video-iframe").each(function() {
			this.contentWindow.postMessage(
				'{"event":"command","func":"stopVideo","args":""}',
				"*"
			);
		});
		// hide all video frames
		$(".video-iframe").hide();
	});
	// Add empty alt text to all images with no alt text
	$("img:not([alt])").attr("alt", "");

	$("#jsSidenav").each(function(index, val) {
		var $root = $(val);

		$(val)
			.find(".has-navdropdown")
			.on("click", function(event) {
				window.location.href = $(event.target)
					.closest("a")
					.attr("href");
			});

		var $active = $(val).find(".is-active");
		// desktop sidenav
		if ($(window).width() >= 897) {
			while (
				typeof $active[0] !== "undefined" &&
				$active[0] !== $root[0]
			) {
				if ($active.hasClass("has-navdropdown")) {
					$active.addClass("is-visible");
				}
				$active = $active.parent();
			}
		}
	});

	$(".jsLoginBtn").on("click", function() {
		$("body").toggleClass("loginBtn--active");
	});

	$(window).on("resize", function() {
		$(".pl01-header-secondary-nav .has-navdropdown").removeClass(
			"hover, moved"
		);
	});
	
	var featureCount = $('.pl11-tab-content-body').children('.pl22-rich-content,.pl12-right-hand-side-icon-expanders').length;
	if(featureCount>0){
		var searchCount = parseInt($('#search-count').html());
		searchCount = featureCount + searchCount;
		$('#search-count').html(searchCount);
		$('#no-result').hide();
	}
});

$(window).ready(function() {
	//----------------------------------------------------------------------------
	//this function uses built in foundation conditional code at top of page to check for Internet Explorer versions less than IE10
	//it then adds the automplete off attribute to the form tag
	if ($(".lt-ie10").length) {
		$("form").attr("autocomplete", "off");
	}
});

// set a cookie
// Example: setCookie('cookie1','testcookie',7); (7days)
// Example: setCookie('cookie1','testcookie',Number.MAX_VALUE); (forever)
function setCookie(cname, cvalue, exdays) {
	var d = new Date();
	d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
	var expires = "expires=" + d.toUTCString();
	document.cookie = cname + "=" + cvalue + "; " + expires;
}
// get a cookie
// Example: getCookie('cookie1')
function getCookie(cname) {
	var name = cname + "=";
	var ca = document.cookie.split(";");
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == " ") c = c.substring(1);
		if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
	}
	return "";
}
// erase a cookie
// Example: eraseCookie('cookie1')
function eraseCookie(name) {
	setCookie(name, "", -1);
}
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Toggle a class on any element, put "data-toggle-target" attribute on any element
 * Example: <a href="" data-toggle-target=".search-input" data-toggle-class="is-active" data-toggle-hide="menu">Show Search</a>
 *
 * data-toggle-target = the reference to the element to apply the class to
 * data-toggle-class = class to toggle on or off
 * data-toggle-hide = target(s) of other elements to hide
 * data-toggle-hide-outside = (boolean) hide if clicking outside
 * data-toggle-focus = focus an element after applying toggle class
 * data-toggle-clickthrough = allows click through if true, blocks all by default
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'genericToggle',
        defaults = {
            data_target : "toggle-target",
            data_class : "toggle-class",
            data_hide : "toggle-hide",
            data_hide_outside : "toggle-hide-outside",
            data_focus : "toggle-focus",
            data_clickthrough : "toggle-clickthrough"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        //init events
        scope.setupEvents(scope);
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var data_target = $el.data(scope.options.data_target);
        var data_class = $el.data(scope.options.data_class);
        var data_hide = $el.data(scope.options.data_hide);
        var data_hide_outside = $el.data(scope.options.data_hide_outside);
        var data_focus = $el.data(scope.options.data_focus);
        var data_clickthrough = $el.data(scope.options.clickthrough);
        $el.click(function(e){
            $(data_target).toggleClass(data_class);
            // if hide is set hide other elements afterwards (data-toggle-hide=".pl01-header-search-container")
            if (data_hide){
                var targets = data_hide.split(',');
                for (var i in targets){
                    var target_reference = targets[i];
                    var $target = $("[data-toggle-target='"+target_reference+"']");
                    var target_class = $target.data(scope.options.data_class);
                    $(target_reference).removeClass(target_class);
                }
            }
            if (data_focus) {
                setTimeout(function(){
                    $(data_focus).focus();
                }, 10);
            }
            if (data_clickthrough !== true){
                e.preventDefault();
                e.stopPropagation();
            }
            // trigger a window resize event to refresh the layout if needed
            $(window).trigger('resize');

            // fix issue with menu not showing on mobile when at the top of page
			if ($("body").scrollTop() === 0) {
				if ($("body").hasClass("is-navigation-toggled")) {
					$("body").addClass("is-header-stuck");
				}else{
					$("body").removeClass("is-header-stuck");
				}
			}
        });

        // hide when clicking outside
        if (data_hide_outside === true){
            $('html').click(function(e) {
                //Hide the menus if visible
                scope.hideOutside(scope, data_target, data_class, e);
            });
        }
    };

    // hide if clicking outside container
    Plugin.prototype.hideOutside = function(scope, data_target, data_class, e) {
        // dont do anything if clicking on data-toggle-target
        if ($(e.target).parents(data_target)){
            $(data_target).removeClass(data_class);
            // trigger a window resize event to refresh the layout if needed
            $(window).trigger('resize');
        }
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $("[data-toggle-target]").genericToggle();
    });

})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Collapsible Menu Jquery Plugin
 *
 * Manages Open and close the menu panels, attach to the outer panel element "menu-tab"
 * any .menu-item will be automatically wired up to receive the click on .menu-link
 * if "menu-mobile-content" exists then the content will be copied to the "menu-desktop-content" element
 * passing in options menu_opened_initially: false will not open the first item initially
 *
 *  On init we remove the href from all menu-link's so that we dont trigger a hash change
 *  when clicked, we can then use the title to update the hash and trigger navigation
 *
 *  If data-collapsible-disable="true" then we dont instantiate the menu as back end will do everything required
 *  to initialise it, the links on the menu are not stripped and no content is copied to the desktop view,
 *  exverything will be managed by back end
 *  Example: <div class="menu-tab" role="navigation" aria-label="page sub menu" data-collapsible-disable="true">
 *
 * Note: Content copied from mobile to desktop will have the id's stripped off input elements and any choice made within the desktop view will also be made on mobile to maintain state
 *
 * Note: If a collapsible menu occurs within a tab such as pl03-icon-expander we only initialise after tab is constructed and content displayed. Also the hash update will not occur within tabs.
 *
 * Structure:
 * .menu-tab > .menu-sub-menu > .menu-list > .menu-item > .menu-link
 * .menu-tab > .menu-sub-menu > .menu-list > .menu-item > .menu-mobile-content
 * .menu-tab > .menu-desktop-content
 *
 * Example structure of markup (menu-tab):
 * <div class="menu-tab">
        <div class="menu-sub-menu">
            <ul class="menu-list">
                <li class="menu-item is-active">
                    <a id="uid1" href="#uid1" class="menu-link">
                        <h2>Menu Item 1<span class="menu-link-chevron"></span></h2>
                    </a>
                    <div class="menu-mobile-content" aria-label="menu content">
                        <p>content 1</p>
                    </div>
                </li>
                <li class="menu-item">
                    <a id="uid2" href="#uid2" class="menu-link">
                        <h2>Menu Item 2<span class="menu-link-chevron"></span></h2>
                    </a>
                    <div class="menu-mobile-content" aria-label="menu content">
                        <p>content 2</p>
                    </div>
                </li>
            </ul>
        </div>
         <div class="row menu-desktop-content" aria-hidden="true">
             <!-- dynamic content injected from menu -->
             <p>
             Desktop Content
             </p>
         </div>
 </div>
 *
 * Example structure of markup (menu-footer-tab):
 * <div class="menu-footer-tab row" role="navigation" aria-label="footer links">

 <!-- Products -->
 <div class="medium-4 large-2 columns menu-footer-item">
     <div class="menu-link-wrapper">
         <a id="footer-products" href="#footer-products" class="menu-footer-link">
         <h3 class="menu-footer-title">Products</h3>
         </a>
     </div>
         <div class="menu-footer-content" aria-label="section links">
             <ul>
                 <li>
                 <a href="#" class="pl08-footer-nav-link" title="Accounts">Accounts</a>
                 </li>
                 <li>
                 <a href="#" class="pl08-footer-nav-link" title="Credit card">Credit card</a>
                 </li>
             </ul>
         </div>
     </div>
 </div>
 *
 * Example Usage:
 * $(".menu-tab").collapsibleMenu();
 * $(".menu-footer-tab").collapsibleMenu({   menu_tab: ".menu-footer-tab",
                                             menu_item: ".menu-footer-item",
                                             menu_link: ".menu-footer-link",
                                             menu_opened_initially: false
                                             });
 */

;(function ( $, window, document, undefined ) {

    //Global variables

    // Create the defaults once
    var pluginName = 'collapsibleMenu',
        defaults = {
            menu_tab : ".menu-tab", // top level menu container, contains the menu items
            menu_item : ".menu-item", // menu list item (gets the is-active applied after menu-link clicked)
            menu_link : ".menu-link-anchor", // menu link (a href)
            menu_mobile_content : ".menu-mobile-content", // menu items mobile content
            menu_desktop_content : ".menu-desktop-content", // desktop content container filled with mobile-content
            menu_opened_initially: true, // if menu is initially open, send false will open no menu items
            tab_container : ".tab-container" // name of tab container
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;

        // a different menu type can be created which is constructed entirely by the back end, this means
        // no setup is required from front end, so when the menu is disabled we no longer strip
        // hrefs and load content as this is all done by back end and the links for the menu simply act as urls
        // and dont load the content of the mobile menu
        var menu_disable = $(this.element).data("collapsible-disable");
        if (menu_disable !== true) {
            // don't instantiate events if within a tab structure
            // as we need to do this after the tab content is rendered
            var withinTabContainer = $(this.element).closest(this.options.tab_container).length;
            if (!withinTabContainer || this.options.loadTabContentContainer){
                this.init();
            }
        }

    }

    Plugin.prototype.init = function () {
        var scope = this;

        //init events
        scope.setupEvents(scope);

        // strip href from each item so we don't navigate to element via hashtag anchor placement
        scope.removeHrefs(scope);

        // setup each menu-tab to open the first item if no location.hash required
        scope.initTab(scope);

        // add hash change monitoring to update the menu item when going back in the browser
        $(window).on("hashchange", $.proxy(scope.hashChanged, scope));

        // expose trigger event to inform all tabs when we have click on one
        // prevents hashchange from firing when clicking
        $(scope.element).bind("menuTabClicked", $.proxy(scope.menuTabClicked, scope));
        $(scope.element).bind("menuTabClickedDisabled", $.proxy(scope.menuTabClickedDisabled, scope));

    };

    // setup each menu-tab to open the first item if no location.hash required
    Plugin.prototype.initTab = function(scope) {
        var $menu_tab = $(scope.element); // menu-tab
        // check if location hash set and navigate to menu item if it is
        if (!scope.hasHash(scope, $menu_tab)){
            // only open if menu_opened_initially = true
            if (scope.options.menu_opened_initially) {
                // trigger first menu item if not navigating to a hash
                scope.triggerFirstMenuItem(scope, $menu_tab);
            }
        }
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        // wire up all general panels open/close
        var $menu_links = $el.find(scope.options.menu_link);
        $.each($menu_links, function(i, el) {
            $(el).click($.proxy(scope.menuClicked, scope));
        });
    };

    // strip href from all links
    Plugin.prototype.removeHrefs = function(scope) {
        var $el = $(scope.element);
        var $menu_links = $el.find(scope.options.menu_link);
        $.each($menu_links, function(i, el) {
            $(el).attr("href", "");
        });
    };

    // show menu item when clicked, adds is-active and copies mobile-content to desktop content
    Plugin.prototype.menuClicked = function(e) {
        var scope = this;
        var $menu_clicked = $(e.currentTarget);

        // prevent hashchange from triggering when clicking on a menu item
        $menu_tabs = $(scope.options.menu_tab);
        $.each($menu_tabs, function(i, menu_tab) {
            $(menu_tab).trigger("menuTabClicked");
        });

        // current menu tab
        $active_menu_tab = $menu_clicked.closest(scope.options.menu_tab);

        // current menu item
        $menu_item = $menu_clicked.parents(scope.options.menu_item);

        if (!$menu_item.hasClass("is-active")){

            // put the mobile content into the desktop view
            $menu_mobile_content = $menu_item.find(scope.options.menu_mobile_content);
            if ($menu_mobile_content.length){
                $menu_desktop_content = $(scope.element).find(scope.options.menu_desktop_content);

                // clear existing desktop content to flush events and bindings (manages garbage collection)
                $menu_desktop_content.find(".menu-desktop-inner").remove();
                $menu_desktop_content.html("<div class='menu-desktop-inner'></div>");
                $menu_desktop_content.find(".menu-desktop-inner").html($menu_mobile_content.html());

                // As the desktop content is copied from the mobile content their will be
                // situations when we need to instantiate content once the desktop view is rendered
                scope.bindInputsAndMaintainState(scope, $menu_mobile_content, $menu_desktop_content);
                scope.instantiateDesktopControllers(scope, $menu_mobile_content, $menu_desktop_content);
            }

            // remove all is-active's from other menus
            scope.deselectAllMenus(scope, $active_menu_tab);

            // add is-active to clicked menu
            $menu_item.addClass("is-active");

        }else{
            // if already active and on mobile allow menu to collapse
            if ($( window ).width() < 898) {
                // remove all is-active's from other menus
                scope.deselectAllMenus(scope, $active_menu_tab);
                e.preventDefault();
                e.stopPropagation();
                return;
            }
        }

        // only trigger scroll for menu-item clicked not for default triggered menu
        // and only update hash when collapsible menu is not within a tab
        var $tab_container = $menu_clicked.parents(scope.options.tab_container);
        if (scope.triggeredFirstMenuItem !== true && $tab_container.length === 0){
            // scroll to menu-item clicked
            var scrollTop = $("body").scrollTop();
            scope.scrollMenuItem(scope, $menu_item);
            window.location.hash = $menu_item.title;
            // on desktop don't scroll to hash clicked
            if ($( window ).width() >= 704) {
                $("body").scrollTop(scrollTop);
            }
        }
        scope.triggeredFirstMenuItem = false;

        // stop event propagation so that the hashchange does not trigger a page navigation
        e.preventDefault();
        e.stopPropagation();

        // reset menuItemClicked flag so that hash can respond to events if changed
        setTimeout(function(){
             $menu_tabs = $(scope.options.menu_tab);
             $.each($menu_tabs, function(i, menu_tab) {
                $(menu_tab).trigger("menuTabClickedDisabled");
             });
        },100);
    };

    // Handle maintaining input state in mobile and desktop views
    // anytime inputs change on desktop the mobile view is updated and the post back
    // uses the mobile name/value pairs as name is stripped from the desktop view
    // so as to not have duplicate form values
    Plugin.prototype.bindInputsAndMaintainState = function(scope, $menu_mobile_content, $menu_desktop_content) {

        // copy mobile input values to desktop view so state is maintained
        var $mobileInputs = $menu_mobile_content.find("input");
        if ($mobileInputs.length){
            $.each($mobileInputs, function(i, input) {
                var $this = $(this);
                $desktopInput = $($menu_desktop_content.find("input")[i]);
                var isCheckable = $this.is(':radio,:checkbox');
                if (isCheckable) {
                    $desktopInput.prop('checked', this.checked);
                } else {
                    $desktopInput.val($this.val());
                }
            });

            // when inputs change on desktop update the mobile view
            var $inputs = $menu_desktop_content.find("input");
            $.each($inputs, function(i, input) {
                // strip off id for desktop view
                $(input).attr("id", "");
                /* ":input" selector includes all form controls*/
                $(input).on("change", function(e){
                    // keep original form elements bound to desktop versions
                    var $this = $(this);
                    var bindingName = $this.attr("name");
                    var $bindingEl = $menu_mobile_content.find("[name='"+bindingName+"']");
                    var isCheckable = $this.is(':radio,:checkbox');
                    if (isCheckable) {
                        $bindingEl.prop('checked', this.checked);
                    } else {
                        $bindingEl.val($this.val());
                    }
                });
            });
        }

    };

    // instantiate interactive controllers (tabs, toggle-class, carousel, etc) within desktop view after being rendered
    Plugin.prototype.instantiateDesktopControllers = function(scope, $menu_mobile_content, $menu_desktop_content) {
        // re-activate the apply button and compare loans on desktop module
        $menu_desktop_content.find(".pl57-apply").applyButton({loadFromCollapsibleMenuDesktopView:true});
        $menu_desktop_content.find(".pl13-product-module").compareLoans({loadFromCollapsibleMenuDesktopView:true});
        // re-activate tabs
        $menu_desktop_content.find(".tab-container").tabMenu({loadFromCollapsibleMenuDesktopView:true});
        // re-activate toggles
        $menu_desktop_content.find("[data-toggle-target]").genericToggle({loadFromCollapsibleMenuDesktopView:true});
    };

    // scroll to menu-item clicked
    Plugin.prototype.scrollMenuItem = function(scope, $menu_item) {
        // scroll to menu item for mobile only
        if ($( window ).width() < 704) {
            setTimeout(function(){
                $("body").animate({scrollTop: $menu_item.offset().top}, 0);
            }, 0);
        }
    };

    // open the first menu-item
    Plugin.prototype.triggerFirstMenuItem = function(scope, $menu_tab) {
        // trigger first menu item
        scope.triggeredFirstMenuItem = true;
        $menu_tab.find(scope.options.menu_item + ":first-child " + scope.options.menu_link).trigger("click");
    };

    // Remove is-active from all menu-item's in menu-tab
    Plugin.prototype.deselectAllMenus = function(scope, $active_menu_tab) {
        $active_menu_tab.find(scope.options.menu_item).removeClass("is-active");
    };

    // check if returning to a particular location in a menu
    // Example www.url.com/#uid3
    Plugin.prototype.hasHash = function(scope, $menu_tab) {
        var $el = $(scope.element);
        // remove location # from hash string
        var locationTitle = window.location.hash.replace("#", "");
        $menu_link = $menu_tab.find(scope.options.menu_link+"[title='" + locationTitle + "']");
        if ($menu_link.length){
            var $menu_item = $menu_link.parents(scope.options.menu_item);
            if (!$menu_item.hasClass("is-active")){
                // open menu
                $menu_link.trigger("click");
            }else{
                // scroll to menu
                scope.scrollMenuItem(scope, $menu_item);
            }
            return true;
        }else{
            return false;
        }
    };

    // The hash has changed by either going back or manually changing it
    // Example www.url.com/#uid4
    Plugin.prototype.hashChanged = function() {
        scope = this;
        if (scope.menuItemClicked !== true){
            // confirm hash exists in menu (title)
            var locationTitle = window.location.hash.replace("#", "");
            $menu_link = $(this.element).find(scope.options.menu_link+"[title='" + locationTitle + "']");
            if ($menu_link.length) {
                scope.initTab(scope);
            }
        }
        scope.menuItemClicked = false;
    };

    /*****************************/
    // Public triggers
    /*****************************/

    // trigger menuTabClicked, informs all menu-tab that we have a click not a hashchange
    Plugin.prototype.menuTabClicked = function(e) {
        scope = this;
        scope.menuItemClicked = true;
    };
    // trigger menuTabClickedDisabled, reset menItemClicked
    Plugin.prototype.menuTabClickedDisabled = function(e) {
        scope = this;
        scope.menuItemClicked = false;
    };

    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).ready(function() {
        //init on page automatically
        //$(".menu-tab").collapsibleMenu(); // Disabled for v1.3.14 - pl11 Tabs Update. Now uses jquery.jtabs.js
        $(".menu-footer-tab").collapsibleMenu({ menu_tab: ".menu-footer-tab",
            menu_item: ".menu-footer-item",
            menu_link: ".menu-footer-link",
            menu_opened_initially: false
        });
    });


})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Carousel Menu Jquery Plugin
 *
 * Manages attaching the owl carousel to elements
 * owlOptions - can be passed in to setup the owl options
 * disableAfter - if set to false the owl carousel wont disable, else pass in a number,
 * example - 768 to disable the carousel above screen sizes of 768
 *
 * Dependencies:
 * Owl Carousel 1.3.2
 * http://owlgraphic.com/owlcarousel
 *
 */

;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'carousel',
        defaults = {
            owlOptions : { owlOptions:{
                                afterInit : function(elem){
                                    var that = this;
                                    that.owlControls.appendTo(elem);
                                },
                                stagePadding: 30,
                                loop:false,
                                margin:10,
                                navigation:false,
                                items : false, //0 items above 1113px browser width
                                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                                itemsTablet: [600,1], //1 item between 600 and 0
                                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
                            }},
            disableAfter : 897 // disable carousel after a a certain screen size, re-enables when reduced
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.owlInstance = false;

        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;

        // window resize listener
        if (!(scope.options.disableAfter === undefined || scope.options.disableAfter === false)){
            if ($(window).width()<=scope.options.disableAfter){
                //create owl
                scope.createOwl(scope);
            }
            $(window).on("resize", $.proxy(scope.windowResize, scope));
        }else{
            //create owl
            scope.createOwl(scope);
        }

        // on resize adjust height to largest carousel item
        $(window).on("resize", scope.debounce($.proxy(scope.adjustHeight, scope)));

    };

    // adjust height based of maximum .owl-item height
    Plugin.prototype.adjustHeight = function(cat) {
    	var scope = this;
    	var $el = $(scope.element);
    	$el.find(".owl-wrapper-outer").css("height", "");
    	$el.find(".owl-item .pl09-hero-banner-carousel").css("height", "");
		var maxHeightOwlItem = 0;
		$el.find(".owl-item").each(function(i, el) {
			var itemHeight = $(el).height();
			if (itemHeight > maxHeightOwlItem) {
				maxHeightOwlItem = itemHeight;
			}
		});
		$el.find(".owl-wrapper-outer").height(maxHeightOwlItem);
		$el.find(".owl-item .pl09-hero-banner-carousel").height(maxHeightOwlItem);
	}

    // create owl
    Plugin.prototype.createOwl = function(scope) {
        var $el = $(scope.element);
        if (!scope.owlInstance){
            scope.owlInstance = $el.owlCarousel(scope.options.owlOptions).data('owlCarousel');
        }
    };

    // destroy owl
    Plugin.prototype.destroyOwl = function(scope) {
        if (scope.owlInstance){
            scope.owlInstance.destroy();
            scope.owlInstance = false;
        }
    };

    // Check if we owl carousel needs to be created or destroyed based on disableAfter breakpoint
    Plugin.prototype.windowResize = function() {
        scope = this;
        if ($(window).width()>scope.options.disableAfter){
            scope.destroyOwl(scope);
        }
        if ($(window).width()<=scope.options.disableAfter){
            scope.createOwl(scope);
        }
    };

    /**
	 * Debounce
	 * @param func
	 * @param duration
	 * @param timeout
	 * @returns {function}
	 */
	Plugin.prototype.debounce = function(func, duration, timeout) {
		return function() {
			var args = arguments;
			clearTimeout(timeout);
			timeout = setTimeout(function() {
				func.apply(null , args);
			}, duration || 200);
		};
	};

    /*****************************/
    // Public triggers
    /*****************************/

    // trigger menuTabClicked, informs all menu-tab that we have a click not a hashchange
    Plugin.prototype.menuTabClicked = function(e) {
        scope = this;
        scope.menuItemClicked = true;
    };
    // trigger menuTabClickedDisabled, reset menItemClicked
    Plugin.prototype.menuTabClickedDisabled = function(e) {
        scope = this;
        scope.menuItemClicked = false;
    };

    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        //init on page automatically

        $(".pl18-portrait:not([class*=pl18-portrait-with-quote])").find(".pl18-portrait-carousel").carousel(
            { owlOptions:{
                afterInit : function(elem){
                    var that = this;
                    that.owlControls.appendTo(elem);
                },
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                items : false, //0 items above 1113px browser width
                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: 897
            }
        );

        $(".pl18-portrait-with-quote").find(".pl18-portrait-carousel").carousel(
            { owlOptions:{
                afterInit : function(elem){
                    var that = this;
                    that.owlControls.appendTo(elem);
                },
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                items : false, //0 items above 1113px browser width
                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: 897
            }
        );

        $('.pl55-3-column-text-carousel').carousel(
            { owlOptions:{
                afterInit : function(elem){
                    var that = this;
                    that.owlControls.appendTo(elem);
                },
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                items : false, //0 items above 1113px browser width
                itemsDesktop : [1113,3], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: 897
            }
        );

        $('.pl02-carousel-carousel').carousel(
            { owlOptions:{
                stagePadding: 30,
                margin:10,
                navigation:false, // Display "next" and "prev" buttons.
                singleItem:true,
                addClassActive: true, // Add "active" classes on visible items. Works with any numbers of items on screen
                autoPlay: true, // If you set autoPlay: true default speed will be 5 seconds.
                stopOnHover: true, // Stop autoplay on mouse hover
                autoHeight: false // Add height to owl-wrapper-outer so you can use diffrent heights on slides. Use it only for one item per page setting.
            },
                disableAfter: false // don't disable at certain breakpoints, so always show carousel
            }
        );

        /* Removed News Ticker Carousel
        $('.pl58-news-ticker-list').carousel(
            { owlOptions:{
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:false,
                pagination: false,
                addClassActive: true, // Add "active" classes on visible items. Works with any numbers of items on screen
                autoPlay: 8000, // If you set autoPlay: true default speed will be 5 seconds.
                stopOnHover: true, // Stop autoplay on mouse hover
                items : 2, //0 items above 1113px browser width
                itemsDesktop : [1113,2], //3 items between 1113px and 898px
                itemsDesktopSmall : [897,2], // 2 items betweem 897px and 601px
                itemsTablet: [600,1], //1 item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: false
            }
        );*/

        //Simple test to determine how many list items are present and whether or not owl carousel is added/removed accordingly
        //Rule is that if there is less than or equal to three items then there is no need to have owl carousel.
        var requiredListItems = $('li .pl04-icon-carousel-img');

        var testOutcome = "";

		(function (inputs) {

			//if (inputs.length > 3) {
			//	testOutcome = false;

			//} else {
			//	requiredListItems.parent().addClass('pl04-icon-carousel-limited-number');
			//	testOutcome = 897;
			//}

			  //modified this condition since its failing carousel alignment if there is less than or equal to three items for tmb.
			if (inputs.length != 0) {
				requiredListItems.parent().addClass('pl04-icon-carousel-limited-number');
				testOutcome = 897;
            } else {
				testOutcome = false;
            }
		})(requiredListItems);

		//DC-3583 PL04 icon carousel - removing additional border in second row
		let carousel = document.querySelectorAll('.pl04-icon-carousel-container');
		carousel.forEach(function (icon) {
			for (let i = 0; i <= icon.children.length; i++)
			{
				if (i % 4 == 0 && icon.children[i] != null)
				{
						icon.children[i].style.borderLeft = 'none';
				}
			}
		});

        $('.pl04-icon-carousel-container').carousel(
            { owlOptions:{
                stagePadding: 30,
                loop:false,
                margin:10,
                navigation:true,
                pagination: false,
                addClassActive: true, // Add "active" classes on visible items. Works with any numbers of items on screen
                stopOnHover: true, // Stop autoplay on mouse hover
                items : 4, //x items above 1113px browser width
                itemsDesktop : [1113,4], //x items between 1113px and 898px
                itemsDesktopSmall : [897,3], // x items betweem 897px and 601px
                itemsTablet: [600,2], //x item between 600 and 0
                itemsMobile : false // itemsMobile disabled - inherit from itemsTablet option
            },
                disableAfter: testOutcome,
                afterInit: (function () {
                    $('.pl04-icon-carousel-loading').hide();
                    $('.pl04-icon-carousel-wrapper').css("visibility", "visible");
                })()
            }
        );
    });

})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Search Header, handles clicking on the search icon
 * focusing and resizing the field and submitting
 * attaches class "is-expand" to extend the search bar
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'searchHeader',
        defaults = {
            search_form_button: '.search-form-button',
            search_field : ".search-field"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        //init events
        scope.setupEvents(scope);
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var $search_form_button = $el.find(scope.options.search_form_button);
        $search_form_button.click(function(e){
            var $search_field = $el.find(scope.options.search_field);
            if ($search_field.val()===""){
                if ($el.hasClass("is-expand-search")) {
                    $el.removeClass("is-expand-search");
                }else{
                    $search_field.focus();
                    $el.addClass("is-expand-search");
                }
                e.preventDefault();
                e.stopPropagation();
            }
        });
        var $search_field = $el.find(scope.options.search_field);
        $search_field.focus(function(e){
            if (!$el.hasClass("is-expand-search")) {
                $el.addClass("is-expand-search");
            }
        });
        // hide search if clicking away after being active
        $search_field.blur(function(e){
            $el.removeClass("is-expand-search");
        });
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl01-header").searchHeader();
    });

})( jQuery, window, document );
;
'function' != typeof Object.create &&
	(Object.create = function(t) {
		function e() {}
		return (e.prototype = t), new e();
	}),
	(function(l, p, m) {
		var o = {
			init: function(t, e) {
				var o = this;
				(o.$elem = l(e)), (o.options = l.extend({}, l.fn.owlCarousel.options, o.$elem.data(), t)), (o.userOptions = t), o.loadContent();
			},
			loadContent: function() {
				var t,
					i = this;
				'function' == typeof i.options.beforeInit && i.options.beforeInit.apply(this, [i.$elem]),
					'string' == typeof i.options.jsonPath
						? ((t = i.options.jsonPath),
						  l.getJSON(t, function(t) {
								var e,
									o = '';
								if ('function' == typeof i.options.jsonSuccess) i.options.jsonSuccess.apply(this, [t]);
								else {
									for (e in t.owl) t.owl.hasOwnProperty(e) && (o += t.owl[e].item);
									i.$elem.html(o);
								}
								i.logIn();
						  }))
						: i.logIn();
			},
			logIn: function() {
				var t = this;
				t.$elem.data('owl-originalStyles', t.$elem.attr('style')).data('owl-originalClasses', t.$elem.attr('class')),
					t.$elem.css({ opacity: 0 }),
					(t.orignalItems = t.options.items),
					t.checkBrowser(),
					(t.wrapperWidth = 0),
					(t.checkVisible = null),
					t.setVars();
			},
			setVars: function() {
				var t = this;
				if (0 === t.$elem.children().length) return !1;
				t.baseClass(),
					t.eventTypes(),
					(t.$userItems = t.$elem.children()),
					(t.itemsAmount = t.$userItems.length),
					t.wrapItems(),
					(t.$owlItems = t.$elem.find('.owl-item')),
					(t.$owlWrapper = t.$elem.find('.owl-wrapper')),
					(t.playDirection = 'next'),
					(t.prevItem = 0),
					(t.prevArr = [0]),
					(t.currentItem = 0),
					t.customEvents(),
					t.onStartup();
			},
			onStartup: function() {
				var t = this;
				t.updateItems(),
					t.calculateAll(),
					t.buildControls(),
					t.updateControls(),
					t.response(),
					t.moveEvents(),
					t.stopOnHover(),
					t.owlStatus(),
					!1 !== t.options.transitionStyle && t.transitionTypes(t.options.transitionStyle),
					!0 === t.options.autoPlay && (t.options.autoPlay = 5e3),
					t.play(),
					t.$elem.find('.owl-wrapper').css('display', 'block'),
					t.$elem.is(':visible') ? t.$elem.css('opacity', 1) : t.watchVisibility(),
					(t.onstartup = !1),
					t.eachMoveUpdate(),
					'function' == typeof t.options.afterInit && t.options.afterInit.apply(this, [t.$elem]);
			},
			eachMoveUpdate: function() {
				var t = this;
				!0 === t.options.lazyLoad && t.lazyLoad(),
					!0 === t.options.autoHeight && t.autoHeight(),
					t.onVisibleItems(),
					'function' == typeof t.options.afterAction && t.options.afterAction.apply(this, [t.$elem]);
			},
			updateVars: function() {
				var t = this;
				'function' == typeof t.options.beforeUpdate && t.options.beforeUpdate.apply(this, [t.$elem]),
					t.watchVisibility(),
					t.updateItems(),
					t.calculateAll(),
					t.updatePosition(),
					t.updateControls(),
					t.eachMoveUpdate(),
					'function' == typeof t.options.afterUpdate && t.options.afterUpdate.apply(this, [t.$elem]);
			},
			reload: function() {
				var t = this;
				p.setTimeout(function() {
					t.updateVars();
				}, 0);
			},
			watchVisibility: function() {
				var t = this;
				if (!1 !== t.$elem.is(':visible')) return !1;
				t.$elem.css({ opacity: 0 }),
					p.clearInterval(t.autoPlayInterval),
					p.clearInterval(t.checkVisible),
					(t.checkVisible = p.setInterval(function() {
						t.$elem.is(':visible') && (t.reload(), t.$elem.animate({ opacity: 1 }, 200), p.clearInterval(t.checkVisible));
					}, 500));
			},
			wrapItems: function() {
				var t = this;
				t.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>'),
					t.$elem.find('.owl-wrapper').wrap('<div class="owl-wrapper-outer">'),
					(t.wrapperOuter = t.$elem.find('.owl-wrapper-outer')),
					t.$elem.css('display', 'block');
			},
			baseClass: function() {
				var t = this,
					e = t.$elem.hasClass(t.options.baseClass),
					o = t.$elem.hasClass(t.options.theme);
				e || t.$elem.addClass(t.options.baseClass), o || t.$elem.addClass(t.options.theme);
			},
			updateItems: function() {
				var t,
					e,
					o = this;
				if (!1 === o.options.responsive) return !1;
				if (!0 === o.options.singleItem)
					return (
						(o.options.items = o.orignalItems = 1),
						(o.options.itemsCustom = !1),
						(o.options.itemsDesktop = !1),
						(o.options.itemsDesktopSmall = !1),
						(o.options.itemsTablet = !1),
						(o.options.itemsTabletSmall = !1),
						(o.options.itemsMobile = !1)
					);
				if (
					((t = l(o.options.responsiveBaseWidth).width()) > (o.options.itemsDesktop[0] || o.orignalItems) && (o.options.items = o.orignalItems),
					!1 !== o.options.itemsCustom)
				)
					for (
						o.options.itemsCustom.sort(function(t, e) {
							return t[0] - e[0];
						}),
							e = 0;
						e < o.options.itemsCustom.length;
						e += 1
					)
						o.options.itemsCustom[e][0] <= t && (o.options.items = o.options.itemsCustom[e][1]);
				else
					t <= o.options.itemsDesktop[0] && !1 !== o.options.itemsDesktop && (o.options.items = o.options.itemsDesktop[1]),
						t <= o.options.itemsDesktopSmall[0] && !1 !== o.options.itemsDesktopSmall && (o.options.items = o.options.itemsDesktopSmall[1]),
						t <= o.options.itemsTablet[0] && !1 !== o.options.itemsTablet && (o.options.items = o.options.itemsTablet[1]),
						t <= o.options.itemsTabletSmall[0] && !1 !== o.options.itemsTabletSmall && (o.options.items = o.options.itemsTabletSmall[1]),
						t <= o.options.itemsMobile[0] && !1 !== o.options.itemsMobile && (o.options.items = o.options.itemsMobile[1]);
				o.options.items > o.itemsAmount && !0 === o.options.itemsScaleUp && (o.options.items = o.itemsAmount);
			},
			response: function() {
				var t,
					e,
					o = this;
				if (!0 !== o.options.responsive) return !1;
				(e = l(p).width()),
					(o.resizer = function() {
						l(p).width() !== e &&
							(!1 !== o.options.autoPlay && p.clearInterval(o.autoPlayInterval),
							p.clearTimeout(t),
							(t = p.setTimeout(function() {
								(e = l(p).width()), o.updateVars();
							}, o.options.responsiveRefreshRate)));
					}),
					l(p).resize(o.resizer);
			},
			updatePosition: function() {
				var t = this;
				t.jumpTo(t.currentItem), !1 !== t.options.autoPlay && t.checkAp();
			},
			appendItemsSizes: function() {
				var o = this,
					i = 0,
					s = o.itemsAmount - o.options.items;
				o.$owlItems.each(function(t) {
					var e = l(this);
					e.css({ width: o.itemWidth }).data('owl-item', Number(t)),
						(t % o.options.items != 0 && t !== s) || s < t || (i += 1),
						e.data('owl-roundPages', i);
				});
			},
			appendWrapperSizes: function() {
				var t = this,
					e = t.$owlItems.length * t.itemWidth;
				t.$owlWrapper.css({ width: 2 * e, left: 0 }), t.appendItemsSizes();
			},
			calculateAll: function() {
				var t = this;
				t.calculateWidth(), t.appendWrapperSizes(), t.loops(), t.max();
			},
			calculateWidth: function() {
				var t = this;
				t.itemWidth = Math.round(t.$elem.width() / t.options.items);
			},
			max: function() {
				var t = this,
					e = -1 * (t.itemsAmount * t.itemWidth - t.options.items * t.itemWidth);
				return (
					t.options.items > t.itemsAmount
						? ((e = t.maximumItem = 0), (t.maximumPixels = 0))
						: ((t.maximumItem = t.itemsAmount - t.options.items), (t.maximumPixels = e)),
					e
				);
			},
			min: function() {
				return 0;
			},
			loops: function() {
				var t,
					e,
					o = this,
					i = 0,
					s = 0;
				for (o.positionsInArray = [0], o.pagesInArray = [], t = 0; t < o.itemsAmount; t += 1)
					(s += o.itemWidth),
						o.positionsInArray.push(-s),
						!0 === o.options.scrollPerPage &&
							(e = l(o.$owlItems[t]).data('owl-roundPages')) !== i &&
							((o.pagesInArray[i] = o.positionsInArray[t]), (i = e));
			},
			buildControls: function() {
				var t = this;
				(!0 !== t.options.navigation && !0 !== t.options.pagination) ||
					(t.owlControls = l('<div class="owl-controls"/>')
						.toggleClass('clickable', !t.browser.isTouch)
						.appendTo(t.$elem)),
					!0 === t.options.pagination && (t.buildPagination(), t.buildPause()),
					!0 === t.options.navigation && t.buildButtons();
			},
			buildButtons: function() {
				var e = this,
					t = l('<div class="owl-buttons"/>');
				e.owlControls.append(t),
					(e.buttonPrev = l('<div/>', { class: 'owl-prev', html: e.options.navigationText[0] || '' })),
					(e.buttonNext = l('<div/>', { class: 'owl-next', html: e.options.navigationText[1] || '' })),
					t.append(e.buttonPrev).append(e.buttonNext),
					t.on('touchstart.owlControls mousedown.owlControls', 'div[class^="owl"]', function(t) {
						t.preventDefault();
					}),
					t.on('touchend.owlControls mouseup.owlControls', 'div[class^="owl"]', function(t) {
						t.preventDefault(), l(this).hasClass('owl-next') ? e.next() : e.prev();
					});
			},
			buildPause: function() {
				var t = this;
				(t.ctrlBtn = l('<div class="owl-ctrl owl-pause"></div>')),
					t.owlControls.prepend(t.ctrlBtn),
					t.ctrlBtn.on('click', function() {
						t.ctrlBtn.hasClass('owl-pause')
							? (t.ctrlBtn.trigger('owl.stop'), t.ctrlBtn.removeClass('owl-pause').addClass('owl-play'))
							: (t.ctrlBtn.trigger('owl.play', t.options.autoPlay), t.ctrlBtn.removeClass('owl-play').addClass('owl-pause'));
					});
			},
			buildPagination: function() {
				var e = this;
				(e.paginationWrapper = l('<div class="owl-pagination"/>')),
					e.owlControls.append(e.paginationWrapper),
					e.paginationWrapper.on('touchend.owlControls mouseup.owlControls', '.owl-page', function(t) {
						t.preventDefault(), Number(l(this).data('owl-page')) !== e.currentItem && e.goTo(Number(l(this).data('owl-page')), !0);
					});
			},
			updatePagination: function() {
				var t,
					e,
					o,
					i,
					s,
					n,
					a = this;
				if (!1 === a.options.pagination) return !1;
				for (a.paginationWrapper.html(''), t = 0, e = a.itemsAmount - (a.itemsAmount % a.options.items), i = 0; i < a.itemsAmount; i += 1)
					i % a.options.items == 0 &&
						((t += 1),
						e === i && (o = a.itemsAmount - a.options.items),
						(s = l('<div/>', { class: 'owl-page' })),
						(n = l('<span></span>', {
							text: !0 === a.options.paginationNumbers ? t : '',
							class: !0 === a.options.paginationNumbers ? 'owl-numbers' : ''
						})),
						s.append(n),
						s.data('owl-page', e === i ? o : i),
						s.data('owl-roundPages', t),
						a.paginationWrapper.append(s));
				a.checkPagination();
			},
			checkPagination: function() {
				var t = this;
				if (!1 === t.options.pagination) return !1;
				t.paginationWrapper.find('.owl-page').each(function() {
					l(this).data('owl-roundPages') === l(t.$owlItems[t.currentItem]).data('owl-roundPages') &&
						(t.paginationWrapper.find('.owl-page').removeClass('active'), l(this).addClass('active'));
				});
			},
			checkNavigation: function() {
				var t = this;
				if (!1 === t.options.navigation) return !1;
				!1 === t.options.rewindNav &&
					(0 === t.currentItem && 0 === t.maximumItem
						? (t.buttonPrev.addClass('disabled'), t.buttonNext.addClass('disabled'))
						: 0 === t.currentItem && 0 !== t.maximumItem
							? (t.buttonPrev.addClass('disabled'), t.buttonNext.removeClass('disabled'))
							: t.currentItem === t.maximumItem
								? (t.buttonPrev.removeClass('disabled'), t.buttonNext.addClass('disabled'))
								: 0 !== t.currentItem &&
								  t.currentItem !== t.maximumItem &&
								  (t.buttonPrev.removeClass('disabled'), t.buttonNext.removeClass('disabled')));
			},
			updateControls: function() {
				var t = this;
				t.updatePagination(), t.checkNavigation(), t.owlControls && (t.options.items >= t.itemsAmount ? t.owlControls.hide() : t.owlControls.show());
			},
			destroyControls: function() {
				this.owlControls && this.owlControls.remove();
			},
			next: function(t) {
				var e = this;
				if (e.isTransition) return !1;
				if (
					((e.currentItem += !0 === e.options.scrollPerPage ? e.options.items : 1),
					e.currentItem > e.maximumItem + (!0 === e.options.scrollPerPage ? e.options.items - 1 : 0))
				) {
					if (!0 !== e.options.rewindNav) return (e.currentItem = e.maximumItem), !1;
					(e.currentItem = 0), (t = 'rewind');
				}
				e.goTo(e.currentItem, t);
			},
			prev: function(t) {
				var e = this;
				if (e.isTransition) return !1;
				if (
					(!0 === e.options.scrollPerPage && 0 < e.currentItem && e.currentItem < e.options.items
						? (e.currentItem = 0)
						: (e.currentItem -= !0 === e.options.scrollPerPage ? e.options.items : 1),
					e.currentItem < 0)
				) {
					if (!0 !== e.options.rewindNav) return (e.currentItem = 0), !1;
					(e.currentItem = e.maximumItem), (t = 'rewind');
				}
				e.goTo(e.currentItem, t);
			},
			goTo: function(t, e, o) {
				var i,
					s = this;
				return (
					!s.isTransition &&
					('function' == typeof s.options.beforeMove && s.options.beforeMove.apply(this, [s.$elem]),
					t >= s.maximumItem ? (t = s.maximumItem) : t <= 0 && (t = 0),
					(s.currentItem = s.owl.currentItem = t),
					!1 !== s.options.transitionStyle && 'drag' !== o && 1 === s.options.items && !0 === s.browser.support3d
						? (s.swapSpeed(0),
						  !0 === s.browser.support3d ? s.transition3d(s.positionsInArray[t]) : s.css2slide(s.positionsInArray[t], 1),
						  s.afterGo(),
						  s.singleItemTransition(),
						  !1)
						: ((i = s.positionsInArray[t]),
						  !0 === s.browser.support3d
								? (!(s.isCss3Finish = !1) === e
										? (s.swapSpeed('paginationSpeed'),
										  p.setTimeout(function() {
												s.isCss3Finish = !0;
										  }, s.options.paginationSpeed))
										: 'rewind' === e
											? (s.swapSpeed(s.options.rewindSpeed),
											  p.setTimeout(function() {
													s.isCss3Finish = !0;
											  }, s.options.rewindSpeed))
											: (s.swapSpeed('slideSpeed'),
											  p.setTimeout(function() {
													s.isCss3Finish = !0;
											  }, s.options.slideSpeed)),
								  s.transition3d(i))
								: !0 === e
									? s.css2slide(i, s.options.paginationSpeed)
									: 'rewind' === e
										? s.css2slide(i, s.options.rewindSpeed)
										: s.css2slide(i, s.options.slideSpeed),
						  void s.afterGo()))
				);
			},
			jumpTo: function(t) {
				var e = this;
				'function' == typeof e.options.beforeMove && e.options.beforeMove.apply(this, [e.$elem]),
					t >= e.maximumItem || -1 === t ? (t = e.maximumItem) : t <= 0 && (t = 0),
					e.swapSpeed(0),
					!0 === e.browser.support3d ? e.transition3d(e.positionsInArray[t]) : e.css2slide(e.positionsInArray[t], 1),
					(e.currentItem = e.owl.currentItem = t),
					e.afterGo();
			},
			afterGo: function() {
				var t = this;
				t.prevArr.push(t.currentItem),
					(t.prevItem = t.owl.prevItem = t.prevArr[t.prevArr.length - 2]),
					t.prevArr.shift(0),
					t.prevItem !== t.currentItem && (t.checkPagination(), t.checkNavigation(), t.eachMoveUpdate(), !1 !== t.options.autoPlay && t.checkAp()),
					'function' == typeof t.options.afterMove && t.prevItem !== t.currentItem && t.options.afterMove.apply(this, [t.$elem]);
			},
			stop: function() {
				(this.apStatus = 'stop'), p.clearInterval(this.autoPlayInterval);
			},
			checkAp: function() {
				'stop' !== this.apStatus && this.play();
			},
			play: function() {
				var t = this;
				if (!(t.apStatus = 'play') === t.options.autoPlay) return !1;
				p.clearInterval(t.autoPlayInterval),
					(t.autoPlayInterval = p.setInterval(function() {
						t.next(!0);
					}, t.options.autoPlay));
			},
			swapSpeed: function(t) {
				var e = this;
				'slideSpeed' === t
					? e.$owlWrapper.css(e.addCssSpeed(e.options.slideSpeed))
					: 'paginationSpeed' === t
						? e.$owlWrapper.css(e.addCssSpeed(e.options.paginationSpeed))
						: 'string' != typeof t && e.$owlWrapper.css(e.addCssSpeed(t));
			},
			addCssSpeed: function(t) {
				return {
					'-webkit-transition': 'all ' + t + 'ms ease',
					'-moz-transition': 'all ' + t + 'ms ease',
					'-o-transition': 'all ' + t + 'ms ease',
					transition: 'all ' + t + 'ms ease'
				};
			},
			removeTransition: function() {
				return { '-webkit-transition': '', '-moz-transition': '', '-o-transition': '', transition: '' };
			},
			doTranslate: function(t) {
				return {
					'-webkit-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					'-moz-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					'-o-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					'-ms-transform': 'translate3d(' + t + 'px, 0px, 0px)',
					transform: 'translate3d(' + t + 'px, 0px,0px)'
				};
			},
			transition3d: function(t) {
				this.$owlWrapper.css(this.doTranslate(t));
			},
			css2move: function(t) {
				this.$owlWrapper.css({ left: t });
			},
			css2slide: function(t, e) {
				var o = this;
				(o.isCssFinish = !1),
					o.$owlWrapper.stop(!0, !0).animate(
						{ left: t },
						{
							duration: e || o.options.slideSpeed,
							complete: function() {
								o.isCssFinish = !0;
							}
						}
					);
			},
			checkBrowser: function() {
				var t,
					e,
					o,
					i,
					s = 'translate3d(0px, 0px, 0px)',
					n = m.createElement('div');
				(n.style.cssText = '  -moz-transform:' + s + '; -ms-transform:' + s + '; -o-transform:' + s + '; -webkit-transform:' + s + '; transform:' + s),
					(t = /translate3d\(0px, 0px, 0px\)/g),
					(o = null !== (e = n.style.cssText.match(t)) && 1 === e.length),
					(i = 'ontouchstart' in p || p.navigator.msMaxTouchPoints),
					(this.browser = { support3d: o, isTouch: i });
			},
			moveEvents: function() {
				(!1 === this.options.mouseDrag && !1 === this.options.touchDrag) || (this.gestures(), this.disabledEvents());
			},
			eventTypes: function() {
				var t = this,
					e = ['s', 'e', 'x'];
				(t.ev_types = {}),
					!0 === t.options.mouseDrag && !0 === t.options.touchDrag
						? (e = ['touchstart.owl mousedown.owl', 'touchmove.owl mousemove.owl', 'touchend.owl touchcancel.owl mouseup.owl'])
						: !1 === t.options.mouseDrag && !0 === t.options.touchDrag
							? (e = ['touchstart.owl', 'touchmove.owl', 'touchend.owl touchcancel.owl'])
							: !0 === t.options.mouseDrag && !1 === t.options.touchDrag && (e = ['mousedown.owl', 'mousemove.owl', 'mouseup.owl']),
					(t.ev_types.start = e[0]),
					(t.ev_types.move = e[1]),
					(t.ev_types.end = e[2]);
			},
			disabledEvents: function() {
				this.$elem.on('dragstart.owl', function(t) {
					t.preventDefault();
				}),
					this.$elem.on('mousedown.disableTextSelect', function(t) {
						return l(t.target).is('input, textarea, select, option');
					});
			},
			gestures: function() {
				var n = this,
					a = {
						offsetX: 0,
						offsetY: 0,
						baseElWidth: 0,
						relativePos: 0,
						position: null,
						minSwipe: null,
						maxSwipe: null,
						sliding: null,
						dargging: null,
						targetElement: null
					};
				function s(t) {
					if (void 0 !== t.touches) return { x: t.touches[0].pageX, y: t.touches[0].pageY };
					if (void 0 === t.touches) {
						if (void 0 !== t.pageX) return { x: t.pageX, y: t.pageY };
						if (void 0 === t.pageX) return { x: t.clientX, y: t.clientY };
					}
				}
				function r(t) {
					'on' === t
						? (l(m).on(n.ev_types.move, e), l(m).on(n.ev_types.end, o))
						: 'off' === t && (l(m).off(n.ev_types.move), l(m).off(n.ev_types.end));
				}
				function e(t) {
					var e,
						o,
						i = t.originalEvent || t || p.event;
					(n.newPosX = s(i).x - a.offsetX),
						(n.newPosY = s(i).y - a.offsetY),
						(n.newRelativeX = n.newPosX - a.relativePos),
						'function' == typeof n.options.startDragging &&
							!0 !== a.dragging &&
							0 !== n.newRelativeX &&
							((a.dragging = !0), n.options.startDragging.apply(n, [n.$elem])),
						(8 < n.newRelativeX || n.newRelativeX < -8) &&
							!0 === n.browser.isTouch &&
							(void 0 !== i.preventDefault ? i.preventDefault() : (i.returnValue = !1), (a.sliding = !0)),
						(10 < n.newPosY || n.newPosY < -10) && !1 === a.sliding && l(m).off('touchmove.owl'),
						(e = function() {
							return n.newRelativeX / 5;
						}),
						(o = function() {
							return n.maximumPixels + n.newRelativeX / 5;
						}),
						(n.newPosX = Math.max(Math.min(n.newPosX, e()), o())),
						!0 === n.browser.support3d ? n.transition3d(n.newPosX) : n.css2move(n.newPosX);
				}
				function o(t) {
					var e,
						o,
						i,
						s = t.originalEvent || t || p.event;
					(s.target = s.target || s.srcElement),
						!(a.dragging = !1) !== n.browser.isTouch && n.$owlWrapper.removeClass('grabbing'),
						n.newRelativeX < 0 ? (n.dragDirection = n.owl.dragDirection = 'left') : (n.dragDirection = n.owl.dragDirection = 'right'),
						0 !== n.newRelativeX &&
							((e = n.getNewPosition()),
							n.goTo(e, !1, 'drag'),
							a.targetElement === s.target &&
								!0 !== n.browser.isTouch &&
								(l(s.target).on('click.disable', function(t) {
									t.stopImmediatePropagation(), t.stopPropagation(), t.preventDefault(), l(t.target).off('click.disable');
								}),
								(i = (o = l._data(s.target, 'events').click).pop()),
								o.splice(0, 0, i))),
						r('off');
				}
				(n.isCssFinish = !0),
					n.$elem.on(n.ev_types.start, '.owl-wrapper', function(t) {
						var e,
							o = t.originalEvent || t || p.event;
						if (3 === o.which) return !1;
						if (!(n.itemsAmount <= n.options.items)) {
							if (!1 === n.isCssFinish && !n.options.dragBeforeAnimFinish) return !1;
							if (!1 === n.isCss3Finish && !n.options.dragBeforeAnimFinish) return !1;
							!1 !== n.options.autoPlay && p.clearInterval(n.autoPlayInterval),
								!0 === n.browser.isTouch || n.$owlWrapper.hasClass('grabbing') || n.$owlWrapper.addClass('grabbing'),
								(n.newPosX = 0),
								(n.newRelativeX = 0),
								l(this).css(n.removeTransition()),
								(e = l(this).position()),
								(a.relativePos = e.left),
								(a.offsetX = s(o).x - e.left),
								(a.offsetY = s(o).y - e.top),
								r('on'),
								(a.sliding = !1),
								(a.targetElement = o.target || o.srcElement);
						}
					});
			},
			getNewPosition: function() {
				var t = this,
					e = t.closestItem();
				return e > t.maximumItem ? ((t.currentItem = t.maximumItem), (e = t.maximumItem)) : 0 <= t.newPosX && ((e = 0), (t.currentItem = 0)), e;
			},
			closestItem: function() {
				var o = this,
					i = !0 === o.options.scrollPerPage ? o.pagesInArray : o.positionsInArray,
					s = o.newPosX,
					n = null;
				return (
					l.each(i, function(t, e) {
						s - o.itemWidth / 20 > i[t + 1] && s - o.itemWidth / 20 < e && 'left' === o.moveDirection()
							? ((n = e), !0 === o.options.scrollPerPage ? (o.currentItem = l.inArray(n, o.positionsInArray)) : (o.currentItem = t))
							: s + o.itemWidth / 20 < e &&
							  s + o.itemWidth / 20 > (i[t + 1] || i[t] - o.itemWidth) &&
							  'right' === o.moveDirection() &&
							  (!0 === o.options.scrollPerPage
									? ((n = i[t + 1] || i[i.length - 1]), (o.currentItem = l.inArray(n, o.positionsInArray)))
									: ((n = i[t + 1]), (o.currentItem = t + 1)));
					}),
					o.currentItem
				);
			},
			moveDirection: function() {
				var t;
				return this.newRelativeX < 0 ? ((t = 'right'), (this.playDirection = 'next')) : ((t = 'left'), (this.playDirection = 'prev')), t;
			},
			customEvents: function() {
				var o = this;
				o.$elem.on('owl.next', function() {
					o.next();
				}),
					o.$elem.on('owl.prev', function() {
						o.prev();
					}),
					o.$elem.on('owl.play', function(t, e) {
						(o.options.autoPlay = e), o.play(), (o.hoverStatus = 'play');
					}),
					o.$elem.on('owl.stop', function() {
						o.stop(), (o.hoverStatus = 'stop');
					}),
					o.$elem.on('owl.goTo', function(t, e) {
						o.goTo(e);
					}),
					o.$elem.on('owl.jumpTo', function(t, e) {
						o.jumpTo(e);
					});
			},
			stopOnHover: function() {
				var t = this;
				!0 === t.options.stopOnHover &&
					!0 !== t.browser.isTouch &&
					!1 !== t.options.autoPlay &&
					(t.$elem.on('mouseover', function() {
						t.stop();
					}),
					t.$elem.on('mouseout', function() {
						'stop' !== t.hoverStatus && t.play();
					}));
			},
			lazyLoad: function() {
				var t,
					e,
					o,
					i,
					s = this;
				if (!1 === s.options.lazyLoad) return !1;
				for (t = 0; t < s.itemsAmount; t += 1)
					'loaded' !== (e = l(s.$owlItems[t])).data('owl-loaded') &&
						((o = e.data('owl-item')),
						'string' == typeof (i = e.find('.lazyOwl')).data('src')
							? (void 0 === e.data('owl-loaded') && (i.hide(), e.addClass('loading').data('owl-loaded', 'checked')),
							  (!0 !== s.options.lazyFollow || o >= s.currentItem) && o < s.currentItem + s.options.items && i.length && s.lazyPreload(e, i))
							: e.data('owl-loaded', 'loaded'));
			},
			lazyPreload: function(t, e) {
				var o,
					i = this,
					s = 0;
				function n() {
					t.data('owl-loaded', 'loaded').removeClass('loading'),
						e.removeAttr('data-src'),
						'fade' === i.options.lazyEffect ? e.fadeIn(400) : e.show(),
						'function' == typeof i.options.afterLazyLoad && i.options.afterLazyLoad.apply(this, [i.$elem]);
				}
				'DIV' === e.prop('tagName') ? (e.css('background-image', 'url(' + e.data('src') + ')'), (o = !0)) : (e[0].src = e.data('src')),
					(function t() {
						(s += 1), i.completeImg(e.get(0)) || !0 === o ? n() : s <= 100 ? p.setTimeout(t, 100) : n();
					})();
			},
			autoHeight: function() {
				var e,
					o = this,
					i = l(o.$owlItems[o.currentItem]).find('img');
				function s() {
					var t = l(o.$owlItems[o.currentItem]).height();
					o.wrapperOuter.css('height', t + 'px'),
						o.wrapperOuter.hasClass('autoHeight') ||
							p.setTimeout(function() {
								o.wrapperOuter.addClass('autoHeight');
							}, 0);
				}
				void 0 !== i.get(0)
					? ((e = 0),
					  (function t() {
							(e += 1), o.completeImg(i.get(0)) ? s() : e <= 100 ? p.setTimeout(t, 100) : o.wrapperOuter.css('height', '');
					  })())
					: s();
			},
			completeImg: function(t) {
				return !!t.complete && ('undefined' === typeof t.naturalWidth || 0 !== t.naturalWidth);
			},
			onVisibleItems: function() {
				var t,
					e = this;
				for (
					!0 === e.options.addClassActive && e.$owlItems.removeClass('active'), e.visibleItems = [], t = e.currentItem;
					t < e.currentItem + e.options.items;
					t += 1
				)
					e.visibleItems.push(t), !0 === e.options.addClassActive && l(e.$owlItems[t]).addClass('active');
				e.owl.visibleItems = e.visibleItems;
			},
			transitionTypes: function(t) {
				(this.outClass = 'owl-' + t + '-out'), (this.inClass = 'owl-' + t + '-in');
			},
			singleItemTransition: function() {
				var t,
					e = this,
					o = e.outClass,
					i = e.inClass,
					s = e.$owlItems.eq(e.currentItem),
					n = e.$owlItems.eq(e.prevItem),
					a = Math.abs(e.positionsInArray[e.currentItem]) + e.positionsInArray[e.prevItem],
					r = Math.abs(e.positionsInArray[e.currentItem]) + e.itemWidth / 2,
					l = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
				(e.isTransition = !0),
					e.$owlWrapper
						.addClass('owl-origin')
						.css({ '-webkit-transform-origin': r + 'px', '-moz-perspective-origin': r + 'px', 'perspective-origin': r + 'px' }),
					n
						.css(((t = a), { position: 'relative', left: t + 'px' }))
						.addClass(o)
						.on(l, function() {
							(e.endPrev = !0), n.off(l), e.clearTransStyle(n, o);
						}),
					s.addClass(i).on(l, function() {
						(e.endCurrent = !0), s.off(l), e.clearTransStyle(s, i);
					});
			},
			clearTransStyle: function(t, e) {
				var o = this;
				t.css({ position: '', left: '' }).removeClass(e),
					o.endPrev && o.endCurrent && (o.$owlWrapper.removeClass('owl-origin'), (o.endPrev = !1), (o.endCurrent = !1), (o.isTransition = !1));
			},
			owlStatus: function() {
				var t = this;
				t.owl = {
					userOptions: t.userOptions,
					baseElement: t.$elem,
					userItems: t.$userItems,
					owlItems: t.$owlItems,
					currentItem: t.currentItem,
					prevItem: t.prevItem,
					visibleItems: t.visibleItems,
					isTouch: t.browser.isTouch,
					browser: t.browser,
					dragDirection: t.dragDirection
				};
			},
			clearEvents: function() {
				this.$elem.off('.owl owl mousedown.disableTextSelect'), l(m).off('.owl owl'), l(p).off('resize', this.resizer);
			},
			unWrap: function() {
				var t = this;
				0 !== t.$elem.children().length && (t.$owlWrapper.unwrap(), t.$userItems.unwrap().unwrap(), t.owlControls && t.owlControls.remove()),
					t.clearEvents(),
					t.$elem.attr('style', t.$elem.data('owl-originalStyles') || '').attr('class', t.$elem.data('owl-originalClasses'));
			},
			destroy: function() {
				this.stop(), p.clearInterval(this.checkVisible), this.unWrap(), this.$elem.removeData();
			},
			reinit: function(t) {
				var e = l.extend({}, this.userOptions, t);
				this.unWrap(), this.init(e, this.$elem);
			},
			addItem: function(t, e) {
				var o,
					i = this;
				return (
					!!t &&
					(0 === i.$elem.children().length
						? (i.$elem.append(t), i.setVars(), !1)
						: (i.unWrap(),
						  (o = void 0 === e || -1 === e ? -1 : e) >= i.$userItems.length || -1 === o
								? i.$userItems.eq(-1).after(t)
								: i.$userItems.eq(o).before(t),
						  void i.setVars()))
				);
			},
			removeItem: function(t) {
				var e;
				if (0 === this.$elem.children().length) return !1;
				(e = void 0 === t || -1 === t ? -1 : t), this.unWrap(), this.$userItems.eq(e).remove(), this.setVars();
			}
		};
		(l.fn.owlCarousel = function(e) {
			return this.each(function() {
				if (!0 === l(this).data('owl-init')) return !1;
				l(this).data('owl-init', !0);
				var t = Object.create(o);
				t.init(e, this), l.data(this, 'owlCarousel', t);
			});
		}),
			(l.fn.owlCarousel.options = {
				items: 5,
				itemsCustom: !1,
				itemsDesktop: [1199, 4],
				itemsDesktopSmall: [979, 3],
				itemsTablet: [768, 2],
				itemsTabletSmall: !1,
				itemsMobile: [479, 1],
				singleItem: !1,
				itemsScaleUp: !1,
				slideSpeed: 200,
				paginationSpeed: 800,
				rewindSpeed: 1e3,
				autoPlay: !1,
				stopOnHover: !1,
				navigation: !1,
				navigationText: ['prev', 'next'],
				rewindNav: !0,
				scrollPerPage: !1,
				pagination: !0,
				paginationNumbers: !1,
				responsive: !0,
				responsiveRefreshRate: 200,
				responsiveBaseWidth: p,
				baseClass: 'owl-carousel',
				theme: 'owl-theme',
				lazyLoad: !1,
				lazyFollow: !0,
				lazyEffect: 'fade',
				autoHeight: !1,
				jsonPath: !1,
				jsonSuccess: !1,
				dragBeforeAnimFinish: !0,
				mouseDrag: !0,
				touchDrag: !0,
				addClassActive: !1,
				transitionStyle: !1,
				beforeUpdate: !1,
				afterUpdate: !1,
				beforeInit: !1,
				afterInit: !1,
				beforeMove: !1,
				afterMove: !1,
				afterAction: !1,
				startDragging: !1,
				afterLazyLoad: !1
			});
	})(jQuery, window, document);
;
/*
Version: 2.1.8
Date:2017-09-11
 */
var StringMask = (function() {
	var tokens = {
		'0': {pattern: /\d/, _default: '0'},
		'9': {pattern: /\d/, optional: true},
		'#': {pattern: /\d/, optional: true, recursive: true},
		'S': {pattern: /[a-zA-Z]/},
		'$': {escape: true} 
	};
	var isEscaped = function(pattern, pos) {
		var count = 0;
		var i = pos - 1;
		var token = {escape: true};
		while (i >= 0 && token && token.escape) {
			token = tokens[pattern.charAt(i)];
			count += token && token.escape ? 1 : 0;
			i--;
		}
		return count > 0 && count%2 === 1;	
	};
	var calcOptionalNumbersToUse = function(pattern, value) {
		var numbersInP = pattern.replace(/[^0]/g,'').length;
		var numbersInV = value.replace(/[^\d]/g,'').length;
		return numbersInV - numbersInP;
	};
	var concatChar = function(text, character, options) {
		if (options.reverse) return character + text;
		return text + character;
	};
	var hasMoreTokens = function(pattern, pos, inc) {
		var pc = pattern.charAt(pos);
		var token = tokens[pc];
		if (pc === '') return false;
		return token && !token.escape ? true : hasMoreTokens(pattern, pos + inc, inc);
	};
	var insertChar = function(text, char, position) {
		var t = text.split('');
		t.splice(position >= 0 ? position: 0, 0, char);
		return t.join('');
	};
	var StringMask = function(pattern, opt) {
		this.options = opt || {};
		this.options = {
			reverse: this.options.reverse || false,
			usedefaults: this.options.usedefaults || this.options.reverse
		};
		this.pattern = pattern;

		StringMask.prototype.process = function proccess(value) {
			if (!value) return '';
			value = value + '';
			var pattern2 = this.pattern;
			var valid = true;
			var formatted = '';
			var valuePos = this.options.reverse ? value.length - 1 : 0;
			var optionalNumbersToUse = calcOptionalNumbersToUse(pattern2, value);
			var escapeNext = false;
			var recursive = [];
			var inRecursiveMode = false;

			var steps = {
				start: this.options.reverse ? pattern2.length - 1 : 0,
				end: this.options.reverse ? -1 : pattern2.length,
				inc: this.options.reverse ? -1 : 1
			};

			var continueCondition = function(options) {
				if (!inRecursiveMode && hasMoreTokens(pattern2, i, steps.inc)) {
					return true;
				} else if (!inRecursiveMode) {
					inRecursiveMode = recursive.length > 0;
				}

				if (inRecursiveMode) {
					var pc = recursive.shift();
					recursive.push(pc);
					if (options.reverse && valuePos >= 0) {
						i++;
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					} else if (!options.reverse && valuePos < value.length) {
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					}
				}
				return i < pattern2.length && i >= 0;
			};

			for (var i = steps.start; continueCondition(this.options); i = i + steps.inc) {
				var pc = pattern2.charAt(i);
				var vc = value.charAt(valuePos);
				var token = tokens[pc];
				if (!inRecursiveMode || vc) {
					if (this.options.reverse && isEscaped(pattern2, i)) {
						formatted = concatChar(formatted, pc, this.options);
						i = i + steps.inc;
						continue;
					} else if (!this.options.reverse && escapeNext) {
						formatted = concatChar(formatted, pc, this.options);
						escapeNext = false;
						continue;
					} else if (!this.options.reverse && token && token.escape) {
						escapeNext = true;
						continue;
					}
				}

				if (!inRecursiveMode && token && token.recursive) {
					recursive.push(pc);
				} else if (inRecursiveMode && !vc) {
					if (!token || !token.recursive) formatted = concatChar(formatted, pc, this.options);
					continue;
				} else if (recursive.length > 0 && token && !token.recursive) {
					// Recursive tokens most be the last tokens of the pattern
					valid = false;
					continue;
				} else if (!inRecursiveMode && recursive.length > 0 && !vc) {
					continue;
				}

				if (!token) {
					formatted = concatChar(formatted, pc, this.options);
					if (!inRecursiveMode && recursive.length) {
						recursive.push(pc);
					}
				} else if (token.optional) {
					if (token.pattern.test(vc) && optionalNumbersToUse) {
						formatted = concatChar(formatted, vc, this.options);
						valuePos = valuePos + steps.inc;
						optionalNumbersToUse--;
					} else if (recursive.length > 0 && vc) {
						valid = false;
						break;
					}
				} else if (token.pattern.test(vc)) {
					formatted = concatChar(formatted, vc, this.options);
					valuePos = valuePos + steps.inc;
				} else if (!vc && token._default && this.options.usedefaults) {
					formatted = concatChar(formatted, token._default, this.options);
				} else {
					valid = false;
					break;
				}
			}

			return {result: formatted, valid: valid};
		};

		StringMask.prototype.apply = function(value) {
			return this.process(value).result;
		};

		StringMask.prototype.validate = function(value) {
			return this.process(value).valid;
		};
	};

	StringMask.process = function(value, pattern, options) {
		return new StringMask(pattern, options).process(value);
	};

	StringMask.apply = function(value, pattern, options) {
		return new StringMask(pattern, options).apply(value);
	};

	StringMask.validate = function(value, pattern, options) {
		return new StringMask(pattern, options).validate(value);
	};

	return StringMask;
}());

/** Used to determine if values are of the language type Object */
var objectTypes = {
	'boolean': false,
	'function': true,
	'object': true,
	'number': false,
	'string': false,
	'undefined': false
};

if (objectTypes[typeof module]) {
	module.exports = StringMask;	
}
;
/*
Version: 2.1.8
Date:2017-09-11
 */
/**
 * angular-mask
 * Personalized input masks for AngularJS
 * @version v1.2.5
 * @link http://github.com/assisrafael/angular-input-masks
 * @license MIT
 */
(function (angular) {

var StringMask = (function() {
	var tokens = {
		'0': {pattern: /\d/, _default: '0'},
		'9': {pattern: /\d/, optional: true},
		'#': {pattern: /\d/, optional: true, recursive: true},
		'S': {pattern: /[a-zA-Z]/},
		'$': {escape: true}
	};
	var isEscaped = function(pattern, pos) {
		var count = 0;
		var i = pos - 1;
		var token = {escape: true};
		while (i >= 0 && token && token.escape) {
			token = tokens[pattern.charAt(i)];
			count += token && token.escape ? 1 : 0;
			i--;
		}
		return count > 0 && count%2 === 1;
	};
	var calcOptionalNumbersToUse = function(pattern, value) {
		var numbersInP = pattern.replace(/[^0]/g,'').length;
		var numbersInV = value.replace(/[^\d]/g,'').length;
		return numbersInV - numbersInP;
	};
	var concatChar = function(text, character, options) {
		if (options.reverse) return character + text;
		return text + character;
	};
	var hasMoreTokens = function(pattern, pos, inc) {
		var pc = pattern.charAt(pos);
		var token = tokens[pc];
		if (pc === '') return false;
		return token && !token.escape ? true : hasMoreTokens(pattern, pos + inc, inc);
	};
	var insertChar = function(text, char, position) {
		var t = text.split('');
		t.splice(position >= 0 ? position: 0, 0, char);
		return t.join('');
	};
	var StringMask = function(pattern, opt) {
		this.options = opt || {};
		this.options = {
			reverse: this.options.reverse || false,
			usedefaults: this.options.usedefaults || this.options.reverse
		};
		this.pattern = pattern;

		StringMask.prototype.process = function proccess(value) {
			if (!value) return '';
			value = value + '';
			var pattern2 = this.pattern;
			var valid = true;
			var formatted = '';
			var valuePos = this.options.reverse ? value.length - 1 : 0;
			var optionalNumbersToUse = calcOptionalNumbersToUse(pattern2, value);
			var escapeNext = false;
			var recursive = [];
			var inRecursiveMode = false;

			var steps = {
				start: this.options.reverse ? pattern2.length - 1 : 0,
				end: this.options.reverse ? -1 : pattern2.length,
				inc: this.options.reverse ? -1 : 1
			};

			var continueCondition = function(options) {
				if (!inRecursiveMode && hasMoreTokens(pattern2, i, steps.inc)) {
					return true;
				} else if (!inRecursiveMode) {
					inRecursiveMode = recursive.length > 0;
				}

				if (inRecursiveMode) {
					var pc = recursive.shift();
					recursive.push(pc);
					if (options.reverse && valuePos >= 0) {
						i++;
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					} else if (!options.reverse && valuePos < value.length) {
						pattern2 = insertChar(pattern2, pc, i);
						return true;
					}
				}
				return i < pattern2.length && i >= 0;
			};

			for (var i = steps.start; continueCondition(this.options); i = i + steps.inc) {
				var pc = pattern2.charAt(i);
				var vc = value.charAt(valuePos);
				var token = tokens[pc];
				if (!inRecursiveMode || vc) {
					if (this.options.reverse && isEscaped(pattern2, i)) {
						formatted = concatChar(formatted, pc, this.options);
						i = i + steps.inc;
						continue;
					} else if (!this.options.reverse && escapeNext) {
						formatted = concatChar(formatted, pc, this.options);
						escapeNext = false;
						continue;
					} else if (!this.options.reverse && token && token.escape) {
						escapeNext = true;
						continue;
					}
				}

				if (!inRecursiveMode && token && token.recursive) {
					recursive.push(pc);
				} else if (inRecursiveMode && !vc) {
					if (!token || !token.recursive) formatted = concatChar(formatted, pc, this.options);
					continue;
				} else if (recursive.length > 0 && token && !token.recursive) {
					// Recursive tokens most be the last tokens of the pattern
					valid = false;
					continue;
				} else if (!inRecursiveMode && recursive.length > 0 && !vc) {
					continue;
				}

				if (!token) {
					formatted = concatChar(formatted, pc, this.options);
					if (!inRecursiveMode && recursive.length) {
						recursive.push(pc);
					}
				} else if (token.optional) {
					if (token.pattern.test(vc) && optionalNumbersToUse) {
						formatted = concatChar(formatted, vc, this.options);
						valuePos = valuePos + steps.inc;
						optionalNumbersToUse--;
					} else if (recursive.length > 0 && vc) {
						valid = false;
						break;
					}
				} else if (token.pattern.test(vc)) {
					formatted = concatChar(formatted, vc, this.options);
					valuePos = valuePos + steps.inc;
				} else if (!vc && token._default && this.options.usedefaults) {
					formatted = concatChar(formatted, token._default, this.options);
				} else {
					valid = false;
					break;
				}
			}

			return {result: formatted, valid: valid};
		};

		StringMask.prototype.apply = function(value) {
			return this.process(value).result;
		};

		StringMask.prototype.validate = function(value) {
			return this.process(value).valid;
		};
	};

	StringMask.process = function(value, pattern, options) {
		return new StringMask(pattern, options).process(value);
	};

	StringMask.apply = function(value, pattern, options) {
		return new StringMask(pattern, options).apply(value);
	};

	StringMask.validate = function(value, pattern, options) {
		return new StringMask(pattern, options).validate(value);
	};

	return StringMask;
}());

/** Used to determine if values are of the language type Object */
var objectTypes = {
	'boolean': false,
	'function': true,
	'object': true,
	'number': false,
	'string': false,
	'undefined': false
};

if (objectTypes[typeof module]) {
	module.exports = StringMask;
}

/**
 * br-validations
 * A library of validations applicable to several Brazilian data like I.E., CNPJ, CPF and others
 * @version v0.2.2
 * @link http://github.com/the-darc/br-validations
 * @license MIT
 */
(function () {
  var root = this;
var CNPJ = {};

CNPJ.validate = function(c) {
	var b = [6,5,4,3,2,9,8,7,6,5,4,3,2];
	c = c.replace(/[^\d]/g,'');

	var r = /^(0{14}|1{14}|2{14}|3{14}|4{14}|5{14}|6{14}|7{14}|8{14}|9{14})$/;
	if (!c || c.length !== 14 || r.test(c)) {
		return false;
	}
	c = c.split('');

	for (var i = 0, n = 0; i < 12; i++) {
		n += c[i] * b[i+1];
	}
	n = 11 - n%11;
	n = n >= 10 ? 0 : n;
	if (parseInt(c[12]) !== n)  {
		return false;
	}

	for (i = 0, n = 0; i <= 12; i++) {
		n += c[i] * b[i];
	}
	n = 11 - n%11;
	n = n >= 10 ? 0 : n;
	if (parseInt(c[13]) !== n)  {
		return false;
	}
	return true;
};


var CPF = {};

CPF.validate = function(cpf) {
	cpf = cpf.replace(/[^\d]+/g,'');
	var r = /^(0{11}|1{11}|2{11}|3{11}|4{11}|5{11}|6{11}|7{11}|8{11}|9{11})$/;
	if (!cpf || cpf.length !== 11 || r.test(cpf)) {
		return false;
	}
	function validateDigit(digit) {
		var add = 0;
		var init = digit - 9;
		for (var i = 0; i < 9; i ++) {
			add += parseInt(cpf.charAt(i + init)) * (i+1);
		}
		return (add%11)%10 === parseInt(cpf.charAt(digit));
	}
	return validateDigit(9) && validateDigit(10);
};

var IE = function(uf) {
	if (!(this instanceof IE)) {
		return new IE(uf);
	}

	this.rules = IErules[uf] || [];
	this.rule;
	IE.prototype._defineRule = function(value) {
		this.rule = undefined;
		for (var r = 0; r < this.rules.length && this.rule === undefined; r++) {
			var str = value.replace(/[^\d]/g,'');
			var ruleCandidate = this.rules[r];
			if (str.length === ruleCandidate.chars && (!ruleCandidate.match || ruleCandidate.match.test(value))) {
				this.rule = ruleCandidate;
			}
		}
		return !!this.rule;
	};

	IE.prototype.validate = function(value) {
		if (!value || !this._defineRule(value)) {
			return false;
		}
		return this.rule.validate(value);
	};
};

var IErules = {};

var algorithmSteps = {
	handleStr: {
		onlyNumbers: function(str) {
			return str.replace(/[^\d]/g,'').split('');
		},
		mgSpec: function(str) {
			var s = str.replace(/[^\d]/g,'');
			s = s.substr(0,3)+'0'+s.substr(3, s.length);
			return s.split('');
		}
	},
	sum: {
		normalSum: function(handledStr, pesos) {
			var nums = handledStr;
			var sum = 0;
			for (var i = 0; i < pesos.length; i++) {
				sum += parseInt(nums[i]) * pesos[i];
			}
			return sum;
		},
		individualSum: function(handledStr, pesos) {
			var nums = handledStr;
			var sum = 0;
			for (var i = 0; i < pesos.length; i++) {
				var mult = parseInt(nums[i]) * pesos[i];
				sum += mult%10 + parseInt(mult/10);
			}
			return sum;
		},
		apSpec: function(handledStr, pesos) {
			var sum = this.normalSum(handledStr, pesos);
			var ref = handledStr.join('');
			if (ref >= '030000010' && ref <= '030170009') {
				return sum + 5;
			}
			if (ref >= '030170010' && ref <= '030190229') {
				return sum + 9;
			}
			return sum;
		}
	},
	rest: {
		mod11: function(sum) {
			return sum%11;
		},
		mod10: function(sum) {
			return sum%10;
		},
		mod9: function(sum) {
			return sum%9;
		}
	},
	expectedDV: {
		minusRestOf11: function(rest) {
			return rest < 2 ? 0 : 11 - rest;
		},
		minusRestOf11v2: function(rest) {
			return rest < 2 ? 11 - rest - 10 : 11 - rest;
		},
		minusRestOf10: function(rest) {
			return rest < 1 ? 0 : 10 - rest;
		},
		mod10: function(rest) {
			return rest%10;
		},
		goSpec: function(rest, handledStr) {
			var ref = handledStr.join('');
			if (rest === 1) {
				return ref >= '101031050' && ref <= '101199979' ? 1 : 0;
			}
			return rest === 0 ? 0 : 11 - rest;
		},
		apSpec: function(rest, handledStr) {
			var ref = handledStr.join('');
			if (rest === 0) {
				return ref >= '030170010' && ref <= '030190229' ? 1 : 0;
			}
			return rest === 1 ? 0 : 11 - rest;
		},
		voidFn: function(rest) {
			return rest;
		}
	}
};


/**
 * options {
 *     pesos: Array of values used to operate in sum step
 *     dvPos: Position of the DV to validate considering the handledStr
 *     algorithmSteps: The four DV's validation algorithm steps names
 * }
 */
function validateDV(value, options) {
	var steps = options.algorithmSteps;

	// Step 01: Handle String
	var handledStr = algorithmSteps.handleStr[steps[0]](value);

	// Step 02: Sum chars
	var sum = algorithmSteps.sum[steps[1]](handledStr, options.pesos);

	// Step 03: Rest calculation
	var rest = algorithmSteps.rest[steps[2]](sum);

	// Fixed Step: Get current DV
	var currentDV = parseInt(handledStr[options.dvpos]);

	// Step 04: Expected DV calculation
	var expectedDV = algorithmSteps.expectedDV[steps[3]](rest, handledStr);

	// Fixed step: DV verification
	return currentDV === expectedDV;
}

function validateIE(value, rule) {
	if (rule.match && !rule.match.test(value)) {
		return false;
	}
	for (var i = 0; i < rule.dvs.length; i++) {
		// console.log('>> >> dv'+i);
		if (!validateDV(value, rule.dvs[i])) {
			return false;
		}
	}
	return true;
}

IErules.PE = [{
	//mask: new StringMask('0000000-00'),
	chars: 9,
	dvs: [{
		dvpos: 7,
		pesos: [8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// mask: new StringMask('00.0.000.0000000-0'),
	chars: 14,
	pesos: [[1,2,3,4,5,9,8,7,6,5,4,3,2]],
	dvs: [{
		dvpos: 13,
		pesos: [5,4,3,2,1,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11v2']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RS = [{
	// mask: new StringMask('000/0000000'),
	chars: 10,
	dvs: [{
		dvpos: 9,
		pesos: [2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AC = [{
	// mask: new StringMask('00.000.000/000-00'),
	chars: 13,
	match: /^01/,
	dvs: [{
		dvpos: 11,
		pesos: [4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 12,
		pesos: [5,4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MG = [{
	// mask: new StringMask('000.000.000/0000'),
	chars: 13,
	dvs: [{
		dvpos: 12,
		pesos: [1,2,1,2,1,2,1,2,1,2,1,2],
		algorithmSteps: ['mgSpec', 'individualSum', 'mod10', 'minusRestOf10']
	},{
		dvpos: 12,
		pesos: [3,2,11,10,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.SP = [{
	// mask: new StringMask('000.000.000.000'),
	chars: 12,
	match: /^[0-9]/,
	dvs: [{
		dvpos: 8,
		pesos: [1,3,4,5,6,7,8,10],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'mod10']
	},{
		dvpos: 11,
		pesos: [3,2,10,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'mod10']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// mask: new StringMask('P-00000000.0/000')
	chars: 12,
	match: /^P/i,
	dvs: [{
		dvpos: 8,
		pesos: [1,3,4,5,6,7,8,10],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'mod10']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.DF = [{
	// mask: new StringMask('00000000000-00'),
	chars: 13,
	dvs: [{
		dvpos: 11,
		pesos: [4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 12,
		pesos: [5,4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.ES = [{
	// mask: new StringMask('000.000.00-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.BA = [{
	// mask: new StringMask('000000-00')
	chars: 8,
	match: /^[0123458]/,
	dvs: [{
		dvpos: 7,
		pesos: [7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	},{
		dvpos: 6,
		pesos: [8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	chars: 8,
	match: /^[679]/,
	dvs: [{
		dvpos: 7,
		pesos: [7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 6,
		pesos: [8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// mask: new StringMask('0000000-00')
	chars: 9,
	match: /^[0-9][0123458]/,
	dvs: [{
		dvpos: 8,
		pesos: [8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	},{
		dvpos: 7,
		pesos: [9,8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod10', 'minusRestOf10']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	chars: 9,
	match: /^[0-9][679]/,
	dvs: [{
		dvpos: 8,
		pesos: [8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 7,
		pesos: [9,8,7,6,5,4,3,0,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AM = [{
	//mask: new StringMask('00.000.000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RN = [{
	// {mask: new StringMask('00.000.000-0')
	chars: 9,
	match: /^20/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
},{
	// {mask: new StringMask('00.0.000.000-0'), chars: 10}
	chars: 10,
	match: /^20/,
	dvs: [{
		dvpos: 8,
		pesos: [10,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RO = [{
	// mask: new StringMask('0000000000000-0')
	chars: 14,
	dvs: [{
		dvpos: 13,
		pesos: [6,5,4,3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PR = [{
	// mask: new StringMask('00000000-00')
	chars: 10,
	dvs: [{
		dvpos: 8,
		pesos: [3,2,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	},{
		dvpos: 9,
		pesos: [4,3,2,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.SC = [{
	// {mask: new StringMask('000.000.000'), uf: 'SANTA CATARINA'}
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RJ = [{
	// {mask: new StringMask('00.000.00-0'), uf: 'RIO DE JANEIRO'}
	chars: 8,
	dvs: [{
		dvpos: 7,
		pesos: [2,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PA = [{
	// {mask: new StringMask('00-000000-0')
	chars: 9,
	match: /^15/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.SE = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PB = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.CE = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.PI = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MA = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^12/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MT = [{
	// {mask: new StringMask('0000000000-0')
	chars: 11,
	dvs: [{
		dvpos: 10,
		pesos: [3,2,9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.MS = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^28/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.TO = [{
	// {mask: new StringMask('00000000000'),
	chars: 11,
	match: /^[0-9]{2}((0[123])|(99))/,
	dvs: [{
		dvpos: 10,
		pesos: [9,8,0,0,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AL = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^24[03578]/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'minusRestOf11']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.RR = [{
	// {mask: new StringMask('00000000-0')
	chars: 9,
	match: /^24/,
	dvs: [{
		dvpos: 8,
		pesos: [1,2,3,4,5,6,7,8],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod9', 'voidFn']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.GO = [{
	// {mask: new StringMask('00.000.000-0')
	chars: 9,
	match: /^1[015]/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'normalSum', 'mod11', 'goSpec']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

IErules.AP = [{
	// {mask: new StringMask('000000000')
	chars: 9,
	match: /^03/,
	dvs: [{
		dvpos: 8,
		pesos: [9,8,7,6,5,4,3,2],
		algorithmSteps: ['onlyNumbers', 'apSpec', 'mod11', 'apSpec']
	}],
	validate: function(value) { return validateIE(value, this); }
}];

var BrV = {
   ie: IE,
   cpf: CPF,
   cnpj: CNPJ
};
var objectTypes = {
	'function': true,
	'object': true
};
if (objectTypes[typeof module]) {
	module.exports = BrV;
} else {
	root.BrV = BrV;
}
}.call(this));
(function() {
	'use strict';

	function maxValidator(ctrl, value, limit) {
		var max = parseFloat(limit);
		var validity = ctrl.$isEmpty(value) || isNaN(max)|| value <= max;
		ctrl.$setValidity('max', validity);
		return value;
	}

	function minValidator(ctrl, value, limit) {
		var min = parseFloat(limit);
		var validity = ctrl.$isEmpty(value) || isNaN(min) || value >= min;
		ctrl.$setValidity('min', validity);
		return value;
	}

	var cnpjPattern = new StringMask('00.000.000\/0000-00');
	var cpfPattern = new StringMask('000.000.000-00');

	function numberViewMask (decimals, decimalDelimiter, thousandsDelimiter) {
		var mask = '#' + thousandsDelimiter + '##0';

		if(decimals > 0) {
			mask += decimalDelimiter;
			for (var i = 0; i < decimals; i++) {
				mask += '0';
			}
		}

		return new StringMask(mask, {
			reverse:true
		});
	}

	function numberModelMask (decimals) {
		var mask = '###0';

		if(decimals > 0) {
			mask += '.';
			for (var i = 0; i < decimals; i++) {
				mask += '0';
			}
		}

		return new StringMask(mask, {
			reverse:true
		});
	}

	function clearDelimitersAndLeadingZeros (value) {
		var cleanValue = value.replace(/^-/,'').replace(/^0*/, '');
		cleanValue = cleanValue.replace(/[^0-9]/g, '');
		return cleanValue;
	}

	function preparePercentageToFormatter (value, decimals) {
		return clearDelimitersAndLeadingZeros((parseFloat(value)*100).toFixed(decimals));
	}

	function prepareNumberToFormatter (value, decimals) {
		return clearDelimitersAndLeadingZeros((parseFloat(value)).toFixed(decimals));
	}

	function validateBrPhoneNumber (ctrl, value) {
		var valid = ctrl.$isEmpty(value) || value.length === 10 || value.length === 11;
		ctrl.$setValidity('br-phone-number', valid);
		return value;
	}

	function validateCPF (ctrl, value) {
		var valid = ctrl.$isEmpty(value) || BrV.cpf.validate(value);
		ctrl.$setValidity('cpf', valid);
		return value;
	}

	function validateCNPJ (ctrl, value) {
		var valid = ctrl.$isEmpty(value) || BrV.cnpj.validate(value);
		ctrl.$setValidity('cnpj', valid);
		return value;
	}

	function validateCPForCNPJ (ctrl, value) {
		if(!value || value.length <= 11) {
			validateCNPJ(ctrl, '');
			return validateCPF(ctrl, value);
		}else {
			validateCPF(ctrl, '');
			return validateCNPJ(ctrl, value);
		}
	}

	function uiBrCpfMask() {
		function applyCpfMask (value) {
			if(!value) {
				return value;
			}
			var formatedValue = cpfPattern.apply(value);
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCpfMask(validateCPF(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if(!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]/g,'');
					var formatedValue = applyCpfMask(actualNumber);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue.replace(/[^\d]+/g,'');
				});

				ctrl.$parsers.push(function(value) {
					return validateCPF(ctrl, value);
				});
			}
		};
	}

	function uiBrCnpjMask() {
		function applyCnpjMask (value) {
			if(!value) {
				return value;
			}
			var formatedValue = cnpjPattern.apply(value);
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCnpjMask(validateCNPJ(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if(!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]+/g,'');
					var formatedValue = applyCnpjMask(actualNumber);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue.replace(/[^\d]+/g,'');
				});

				ctrl.$parsers.push(function(value) {
					return validateCNPJ(ctrl, value);
				});
			}
		};
	}

	function uiBrCpfCnpjMask() {
		function applyCpfCnpjMask (value) {
			if(!value) {
				return value;
			}
			var formatedValue;
			if (value.length > 11) {
				formatedValue = cnpjPattern.apply(value);
			} else {
				formatedValue = cpfPattern.apply(value);
			}
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCpfCnpjMask(validateCPForCNPJ(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if(!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]+/g,'');
					var formatedValue = applyCpfCnpjMask(actualNumber);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue.replace(/[^\d]+/g,'');
				});

				ctrl.$parsers.push(function(value) {
					return validateCPForCNPJ(ctrl, value);
				});
			}
		};
	}

	angular.module('ui.utils.masks', [])
	.directive('uiPercentageMask', ['$locale', '$parse', function ($locale, $parse) {
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				var decimalDelimiter = $locale.NUMBER_FORMATS.DECIMAL_SEP,
					thousandsDelimiter = $locale.NUMBER_FORMATS.GROUP_SEP,
					decimals = parseInt(attrs.uiPercentageMask);

				if (!ctrl) {
					return;
				}

				if (angular.isDefined(attrs.uiHideGroupSep)){
					thousandsDelimiter = '';
				}

				if(isNaN(decimals)) {
					decimals = 2;
				}
				var numberDecimals = decimals + 2;
				var viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter),
					modelMask = numberModelMask(numberDecimals);

				ctrl.$formatters.push(function(value) {
					if(!value) {
						return value;
					}

					var valueToFormat = preparePercentageToFormatter(value, decimals);
					return viewMask.apply(valueToFormat) + ' %';
				});

				function parse(value) {
					if(!value) {
						return value;
					}

					var valueToFormat = clearDelimitersAndLeadingZeros(value) || '0';
					if(value.length > 1 && value.indexOf('%') === -1) {
						valueToFormat = valueToFormat.slice(0,valueToFormat.length-1);
					}
					var formatedValue = viewMask.apply(valueToFormat) + ' %';
					var actualNumber = parseFloat(modelMask.apply(valueToFormat));

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return actualNumber;
				}

				ctrl.$parsers.push(parse);

				if (attrs.uiPercentageMask) {
					scope.$watch(attrs.uiPercentageMask, function(decimals) {
						if(isNaN(decimals)) {
							decimals = 2;
						}
						numberDecimals = decimals + 2;
						viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter);
						modelMask = numberModelMask(numberDecimals);

						parse(ctrl.$viewValue || '');
					});
				}

				if(attrs.min){
					ctrl.$parsers.push(function(value) {
						var min = $parse(attrs.min)(scope);
						return minValidator(ctrl, value, min);
					});

					scope.$watch('min', function(value) {
						minValidator(ctrl, ctrl.$modelValue, value);
					});
				}

				if(attrs.max) {
					ctrl.$parsers.push(function(value) {
						var max = $parse(attrs.max)(scope);
						return maxValidator(ctrl, value, max);
					});

					scope.$watch('max', function(value) {
						maxValidator(ctrl, ctrl.$modelValue, value);
					});
				}
			}
		};
	}])
	.directive('uiNumberMask', ['$locale', '$parse', function ($locale, $parse) {
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				var decimalDelimiter = $locale.NUMBER_FORMATS.DECIMAL_SEP,
					thousandsDelimiter = $locale.NUMBER_FORMATS.GROUP_SEP,
					decimals = $parse(attrs.uiNumberMask)(scope);

				if (!ctrl) {
					return;
				}

				if (angular.isDefined(attrs.uiHideGroupSep)){
					thousandsDelimiter = '';
				}

				if(isNaN(decimals)) {
					decimals = 2;
				}
				var viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter),
					modelMask = numberModelMask(decimals);

				function parse(value) {
					if(!value) {
						return value;
					}

					var valueToFormat = clearDelimitersAndLeadingZeros(value) || '0';
					var formatedValue = viewMask.apply(valueToFormat);
					var actualNumber = parseFloat(modelMask.apply(valueToFormat));

					if(angular.isDefined(attrs.uiNegativeNumber)){
						var isNegative = (value[0] === '-'),
							needsToInvertSign = (value.slice(-1) === '-');

						//only apply the minus sign if it is negative or(exclusive) needs to be negative and the number is different from zero
						if(needsToInvertSign ^ isNegative && !!actualNumber) {
							actualNumber *= -1;
							formatedValue = '-' + formatedValue;
						}
					}

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return actualNumber;
				}

				ctrl.$formatters.push(function(value) {
					var prefix = '';
					if(angular.isDefined(attrs.uiNegativeNumber) && value < 0){
						prefix = '-';
					}

					if(!value) {
						return value;
					}

					var valueToFormat = prepareNumberToFormatter(value, decimals);
					return prefix + viewMask.apply(valueToFormat);
				});

				ctrl.$parsers.push(parse);

				if (attrs.uiNumberMask) {
					scope.$watch(attrs.uiNumberMask, function(decimals) {
						if(isNaN(decimals)) {
							decimals = 2;
						}
						viewMask = numberViewMask(decimals, decimalDelimiter, thousandsDelimiter);
						modelMask = numberModelMask(decimals);

						parse(ctrl.$viewValue || '');
					});
				}

				if(attrs.min){
					ctrl.$parsers.push(function(value) {
						var min = $parse(attrs.min)(scope);
						return minValidator(ctrl, value, min);
					});

					scope.$watch(attrs.min, function(value) {
						minValidator(ctrl, ctrl.$modelValue, value);
					});
				}

				if(attrs.max) {
					ctrl.$parsers.push(function(value) {
						var max = $parse(attrs.max)(scope);
						return maxValidator(ctrl, value, max);
					});

					scope.$watch(attrs.max, function(value) {
						maxValidator(ctrl, ctrl.$modelValue, value);
					});
				}
			}
		};
	}])
	.directive('uiBrCpfMask', [uiBrCpfMask])
	.directive('uiBrCnpjMask', [uiBrCnpjMask])
	.directive('uiBrCpfcnpjMask', [uiBrCpfCnpjMask])
	// deprecated: will be removed in the next major version
	.directive('uiCpfMask', [uiBrCpfMask])
	// deprecated: will be removed in the next major version
	.directive('uiCnpjMask', [uiBrCnpjMask])
	// deprecated: will be removed in the next major version
	.directive('uiCpfcnpjMask', [uiBrCpfCnpjMask])
	.directive('uiMoneyMask', ['$locale', '$parse', function ($locale, $parse) {
		return {
			restrict: 'A',
			require: '?ngModel',
			link: function (scope, element, attrs, ctrl) {
				var decimalDelimiter = $locale.NUMBER_FORMATS.DECIMAL_SEP,
					thousandsDelimiter = $locale.NUMBER_FORMATS.GROUP_SEP,
					currencySym = $locale.NUMBER_FORMATS.CURRENCY_SYM,
					decimals = parseInt(attrs.uiMoneyMask);

				if (!ctrl) {
					return;
				}

				if (angular.isDefined(attrs.uiHideGroupSep)){
					thousandsDelimiter = '';
				}

				if(isNaN(decimals)) {
					decimals = 2;
				}
				var decimalsPattern = decimals > 0 ? decimalDelimiter + new Array(decimals + 1).join('0') : '';
				var maskPattern = currencySym+' #'+thousandsDelimiter+'##0'+decimalsPattern;
				var moneyMask = new StringMask(maskPattern, {reverse: true});

				ctrl.$formatters.push(function(value) {
					if(angular.isUndefined(value)) {
						return value;
					}

					var valueToFormat = prepareNumberToFormatter(value, decimals);
					return moneyMask.apply(valueToFormat);
				});

				function parse(value) {
					if (!value) {
						return value;
					}

					var actualNumber = value.replace(/[^\d]+/g,'');
					actualNumber = actualNumber.replace(/^[0]+([1-9])/,'$1');
					var formatedValue = moneyMask.apply(actualNumber);

					if (value !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return formatedValue ? parseInt(formatedValue.replace(/[^\d]+/g,''))/Math.pow(10,decimals) : null;
				}

				ctrl.$parsers.push(parse);

				if (attrs.uiMoneyMask) {
					scope.$watch(attrs.uiMoneyMask, function(decimals) {
						if(isNaN(decimals)) {
							decimals = 2;
						}
						decimalsPattern = decimals > 0 ? decimalDelimiter + new Array(decimals + 1).join('0') : '';
						maskPattern = currencySym+' #'+thousandsDelimiter+'##0'+decimalsPattern;
						moneyMask = new StringMask(maskPattern, {reverse: true});

						parse(ctrl.$viewValue || '');
					});
				}

				if(attrs.min){
					ctrl.$parsers.push(function(value) {
						var min = $parse(attrs.min)(scope);
						return minValidator(ctrl, value, min);
					});

					scope.$watch(attrs.min, function(value) {
						minValidator(ctrl, ctrl.$modelValue, value);
					});
				}

				if(attrs.max) {
					ctrl.$parsers.push(function(value) {
						var max = $parse(attrs.max)(scope);
						return maxValidator(ctrl, value, max);
					});

					scope.$watch(attrs.max, function(value) {
						maxValidator(ctrl, ctrl.$modelValue, value);
					});
				}
			}
		};
	}])
	.directive('uiBrPhoneNumber',function() {
		/**
		 * FIXME: all numbers will have 9 digits after 2016.
		 * see http://portal.embratel.com.br/embratel/9-digito/
		 */
		var phoneMask8D = new StringMask('(00) 0000-0000'),
			phoneMask9D = new StringMask('(00) 00000-0000');

		function clearValue (value) {
			if(!value) {
				return value;
			}

			return value.replace(/[^0-9]/g, '');
		}

		function applyPhoneMask (value) {
			if(!value) {
				return value;
			}

			var formatedValue;
			if(value.length < 11){
				formatedValue = phoneMask8D.apply(value);
			}else{
				formatedValue = phoneMask9D.apply(value);
			}

			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function(scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyPhoneMask(validateBrPhoneNumber(ctrl, value));
				});

				ctrl.$parsers.push(function(value) {
					if (!value) {
						return value;
					}

					var cleanValue = clearValue(value);
					var formatedValue = applyPhoneMask(cleanValue);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return clearValue(formatedValue);
				});

				ctrl.$parsers.push(function(value) {
					return validateBrPhoneNumber(ctrl, value);
				});
			}
		};
	})
	.directive('uiBrCepMask',function() {
		var cepMask = new StringMask('00000-000');

		function clearValue (value) {
			if(!value) {
				return value;
			}

			return value.replace(/[^0-9]/g, '');
		}

		function applyCepMask (value, ctrl) {
			if(!value) {
				ctrl.$setValidity('cep', true);
				return value;
			}
			var processed = cepMask.process(value);
			ctrl.$setValidity('cep', processed.valid);
			var formatedValue = processed.result;
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function(scope, element, attrs, ctrl) {
				if (!ctrl) {
					return;
				}

				ctrl.$formatters.push(function(value) {
					return applyCepMask(value, ctrl);
				});

				ctrl.$parsers.push(function(value) {
					if (!value) {
						return applyCepMask(value, ctrl);
					}

					var cleanValue = clearValue(value);
					var formatedValue = applyCepMask(cleanValue, ctrl);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					return clearValue(formatedValue);
				});
			}
		};
	})
	.directive('uiBrIeMask', ['$parse', function($parse) {

		var ieMasks = {
			'AC': [{mask: new StringMask('00.000.000/000-00')}],
			'AL': [{mask: new StringMask('000000000')}],
			'AM': [{mask: new StringMask('00.000.000-0')}],
			'AP': [{mask: new StringMask('000000000')}],
			'BA': [{chars: 8, mask: new StringMask('000000-00')},
				   {mask: new StringMask('0000000-00')}],
			'CE': [{mask: new StringMask('00000000-0')}],
			'DF': [{mask: new StringMask('00000000000-00')}],
			'ES': [{mask: new StringMask('00000000-0')}],
			'GO': [{mask: new StringMask('00.000.000-0')}],
			'MA': [{mask: new StringMask('000000000')}],
			'MG': [{mask: new StringMask('000.000.000/0000')}],
			'MS': [{mask: new StringMask('000000000')}],
			'MT': [{mask: new StringMask('0000000000-0')}],
			'PA': [{mask: new StringMask('00-000000-0')}],
			'PB': [{mask: new StringMask('00000000-0')}],
			'PE': [{chars: 9, mask: new StringMask('0000000-00')},
				   {mask: new StringMask('00.0.000.0000000-0')}],
			'PI': [{mask: new StringMask('000000000')}],
			'PR': [{mask: new StringMask('000.00000-00')}],
			'RJ': [{mask: new StringMask('00.000.00-0')}],
			'RN': [{chars: 9, mask: new StringMask('00.000.000-0')},
				   {mask: new StringMask('00.0.000.000-0')}],
			'RO': [{mask: new StringMask('0000000000000-0')}],
			'RR': [{mask: new StringMask('00000000-0')}],
			'RS': [{mask: new StringMask('000/0000000')}],
			'SC': [{mask: new StringMask('000.000.000')}],
			'SE': [{mask: new StringMask('00000000-0')}],
			'SP': [{mask: new StringMask('000.000.000.000')},
				   {mask: new StringMask('-00000000.0/000')}],
			'TO': [{mask: new StringMask('00000000000')}]
		};

		function clearValue (value) {
			if(!value) {
				return value;
			}
			return value.replace(/[^0-9]/g, '');
		}

		function getMask(uf, value) {
			if(!uf || !ieMasks[uf]) {
				return undefined;
			}
			var _uf = uf.toUpperCase();
			if (_uf === 'SP' && /^P/i.test(value)) {
				return ieMasks.SP[1].mask;
			}
			var masks = ieMasks[uf];
			var i = 0;
			while(masks[i].chars && masks[i].chars < clearValue(value).length && i < masks.length - 1) {
				i++;
			}
			return masks[i].mask;
		}

		function applyIEMask (value, uf, ctrl) {
			var mask = getMask(uf, value);
			if(!value || !mask) {
				ctrl.$setValidity('ie', true);
				return value;
			}
			var processed = mask.process(clearValue(value));
			ctrl.$setValidity('ie', BrV.ie(uf).validate(value));
			var formatedValue = processed.result;
			if (uf && uf.toUpperCase() === 'SP' && /^p/i.test(value)) {
				return 'P'+(formatedValue ? formatedValue.trim().replace(/[^0-9]$/, '') : '');
			}
			if(!formatedValue) {
				return formatedValue;
			}
			return formatedValue.trim().replace(/[^0-9]$/, '');
		}

		return {
			restrict: 'A',
			require: '?ngModel',
			link: function(scope, element, attrs, ctrl) {
				var state = $parse(attrs.uiBrIeMask)(scope);

				if (!ctrl) {
					return;
				}

				scope.$watch(attrs.uiBrIeMask, function(newState) {
					state = newState;
					applyIEMask(ctrl.$viewValue, state, ctrl);
				});

				ctrl.$formatters.push(function(value) {
					return applyIEMask(value, state, ctrl);
				});

				ctrl.$parsers.push(function(value) {
					if (!value) {
						return applyIEMask(value, state, ctrl);
					}

					var formatedValue = applyIEMask(value, state, ctrl);

					if (ctrl.$viewValue !== formatedValue) {
						ctrl.$setViewValue(formatedValue);
						ctrl.$render();
					}

					if (state && state.toUpperCase() === 'SP' && /^p/i.test(value)) {
						return 'P'+clearValue(formatedValue);
					}
					return clearValue(formatedValue);
				});
			}
		};
	}]);
})();

})(angular);
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 */


// the semi-colon before the function invocation is a safety
// net against concatenated scripts and/or other plugins
// that are not closed properly.
;(function ( $, window, document, undefined ) {

    // undefined is used here as the undefined global
    // variable in ECMAScript 3 and is mutable (i.e. it can
    // be changed by someone else). undefined isn't really
    // being passed in so we can ensure that its value is
    // truly undefined. In ES5, undefined can no longer be
    // modified.

    // window and document are passed through as local
    // variables rather than as globals, because this (slightly)
    // quickens the resolution process and can be more
    // efficiently minified (especially when both are
    // regularly referenced in your plugin).

    // Create the defaults once
    var pluginName = 'imageload',
        defaults = {
            propertyName: "value"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);

        // jQuery has an extend method that merges the
        // contents of two or more objects, storing the
        // result in the first object. The first object
        // is generally empty because we don't want to alter
        // the default options for future instances of the plugin
        this.options = $.extend( {}, defaults, options) ;

        this._defaults = defaults;
        this._name = pluginName;

        this.init();
    }

    Plugin.prototype.init = function () {
        // Place initialization logic here
        // You already have access to the DOM element and
        // the options via the instance, e.g. this.element
        // and this.options
        this.eventInitiate();
    };

    /**
     * Intiaite Event listener
     */
    Plugin.prototype.eventInitiate = function () {
        var scope = this;
        this.element.one('load', function() {
            scope.setState();
        }).each(function() {
                if(this.complete) $(this).load();
        });
    };


    /**
     * Apply active state to module
     */
    Plugin.prototype.setState = function () {
        this.element.addClass("is-active");
    };





    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

})( jQuery, window, document );;
$( document ).ready(function() {

    // load header images from data-src
    // get the data-src for all inject-images so we can set the background image
    $(".inject-image").each(function(v,k){
        var sourceimg = $(k).find(".source-image").data("src");
        $(k).css('background-image', 'url(' + sourceimg + ')');

        //extra code if we want to do a picturefill type of fix to replace images
        //var windowWidth = $(window).width() ;
        //var loadImageStr = "";
        //if (windowWidth < 560) {
        //    loadImageStr = "w=700";
        //}else if (windowWidth < 897) {
        //    loadImageStr = "w=1000";
        //}else if (windowWidth < 1100) {
        //    loadImageStr = "w=1200";
        //}else{
        //    loadImageStr = "w=1600";
        //}
        // $(k).css('background-image', 'url(' + sourceimg +  "?" + loadImageStr + ')');

    });

});;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Manages the Apply button which has the following states:
 * The following 2 classes will be applied by BAD to .pl57-apply
 * can-show-one - have already logged in and have a cookie so when clicking on Apply we don't show 2 buttons
 * can-show-two - have not logged in so we show the 2 buttons
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'applyButton',
        defaults = {
            step2_target : ".pl57-apply-step-two",
            button_apply : ".button-apply"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        var $el = $(scope.element);

        // check if we should show two buttons when apply is clicked
        if ($el.hasClass("can-show-two")) {
            //init events
            scope.setupEvents(scope);
        }
    };

    // add managing events on apply button
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var $button_apply = $el.find(scope.options.button_apply);
        var id = '#' + $button_apply.attr('id');

        $(id).on('click', function(e) {
            e.preventDefault();

            $el.addClass("show-step2");

            $(window).trigger('resize');
        });
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl57-apply").applyButton();
    });

})( jQuery, window, document );


$(window).on('load',function() {
    $(document).on('click', '#pl53-reset-btn1', function(){
         location.reload();
    });
});

;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Manages the Compare Loans Button on the Product Family Page
 * As the user selects the compare tick for each loan the compare loan button will update with the number of loans selected
 * When no loans are selected the compare loan button is disabled
 *
 * Note: Mobile view and desktop view will be kept in sync to show the Compare text
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'compareLoans',
        defaults = {
            compare_loans_button : ".compare-loans-button",
            compare_loan_check : ".compare-loan-check",
            data_compare_text : "compare-text", // data holds text string to replace
            data_replace_compare_text : "|0|" // match text and replace with number of loans selected
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        var $el = $(scope.element);
        scope.setupEvents(scope);
        $.proxy(scope.updateCompareButton, scope)();
    };

    // update on change to any checkboxes
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        // wire change to input
        var compare_loan_checks = $el.find(scope.options.compare_loan_check + " input");
        $.each(compare_loan_checks, function(i, el) {
            $(el).on("change", $.proxy(scope.updateCompareButton, scope));
        });
        // wire blocking of compare button if nothing checked
        var $compare_loans_button = $el.find(scope.options.compare_loans_button);
        $compare_loans_button.on("click", function(e){
            if ($compare_loans_button.hasClass("disabled")){
                e.preventDefault();
            }
        });
    };

    // update the copy of the compare button
    Plugin.prototype.updateCompareButton = function() {
        scope = this;
        var $el = $(scope.element);
        var numberChecked = 0;
        // determine which buttons have been checked
        var compare_loan_checks = $el.find(scope.options.compare_loan_check);
        $.each(compare_loan_checks, function(i, el) {
            var isChecked = $(el).find("input").is(":checked");
            if (isChecked){
                numberChecked++;
            }
        });
        // update the compare button text with the number of checkboxes selected
        var $compare_loans_button = $el.find(scope.options.compare_loans_button);
        var data_compare_text = $compare_loans_button.data(scope.options.data_compare_text);
        if (data_compare_text == undefined) {
            data_compare_text = "Compare |0| Loans";
        }
        if (numberChecked < 2){
            data_compare_text = data_compare_text.replace(scope.options.data_replace_compare_text, "");
            $compare_loans_button.val(data_compare_text); // "Compare loans"
            $compare_loans_button.addClass("disabled");
        }else{
            data_compare_text = data_compare_text.replace(scope.options.data_replace_compare_text, numberChecked);
            $compare_loans_button.val(data_compare_text); // "Compare " + numberChecked + " loans"
            $compare_loans_button.removeClass("disabled");
        }
    };

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl13-product-module").compareLoans();
    });

})( jQuery, window, document );
;
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-09
 */
/*
Version: 1.4.1
Date:2014-10-16
 */
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Tabs Menu Jquery Plugin
 *
 * Manages showing the tab content for each tab menu item, attach to the outer panel element "tab-container"
 * any .tab-menu-item will be automatically wired up to receive the click on .tab-menu-link
 * if "tab-menu-content" exists then the content will be copied to the "tab-content-container" element
 *
 * On init we remove the href from all tab-menu-link's so that we don't trigger a hash change on page,
 * we can then use the title to update the hash and trigger navigation off the title text,
 * currently hash base navigation is disabled as we have menu hashes already on collapsible menus
 *
 * Structure:
 * .tab-container > .tab-menu > ul > .tab-menu-item > div > .tab-menu-link
 * .tab-container > .tab-menu > ul > .tab-menu-item > .tab-menu-content
 * .tab-container > .tab-content-container
 *
 * Because we can have tabs within a collapsible menu within a tab container we need to specify the depth we go down so we don't go too deep.
 *
 * The .tab-content-container is always shown unlike on the collapsible menu where the mobile and desktop view are swapped in and out as the view port changes. With tabs the .tab-menu-content is just to keep the document outline valid and content is copied from here to the .tab-content-container when the .tab-menu-link is clicked.
 *
 * All wiring of events is only done after content is moved to .tab-content-container, this occurs initially due to triggerFirstMenuItem,
 * and after that everytime a tab is clicked. There is no need to bind events to the .tab-menu-content as this is never used and never seen visually.
 *
 * Example structure of markup (tab-container):
 * <div class="tab-container">
     <div class="tab-menu">
         <ul>
             <li class="tab-menu-item is-active">
                <div>
                     <a href="uid1" class="tab-menu-link" title="Board of directors">
                         <img class="tab-menu-img-active" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-rol.png"/>
                         <img class="tab-menu-img-standard" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-std.png"/>
                         <h4 class="tab-menu-title" aria-label="Board of directors">Board of directors</h4>
                     </a>
                 </div>
                 <!-- tab menu content start -->
                 <div class="tab-menu-content">

                 </div>
                 <!-- tab menu content end -->
             </li>
             <li class="tab-menu-item">
                <div>
                     <a href="uid2" class="tab-menu-link" title="Management">
                         <img class="tab-menu-img-active" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-rol.png"/>
                         <img class="tab-menu-img-standard" src="assets/primary/imgs/placeholder/responsiveimages/button-our-people-std.png"/>
                         <h4 class="tab-menu-title" aria-label="Board of directors">Management</h4>
                     </a>
                </div>
                 <div class="tab-menu-content">

                 </div>
             </li>
         </ul>
     </div>
     <!-- Content for Tabs Injected Here -->
     <div class="tab-content-container">

     </div>
 </div>
 *
 * Example Usage:
 * $(".tab-container").tabMenu();
 */

;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'tabMenu',
        defaults = {
            tabs : ".tab-container", // top level menu container, contains the menu items
            tab_menu : ".tab-menu", // contains all tab menu items (not the ".tab-content-container" container)
            tab_menu_item : ".tab-menu-item", // menu list item (gets the is-active applied after menu-link clicked)
            tab_menu_link : ".tab-menu-link", // menu link (a href)
            tab_menu_content : ".tab-menu-content", // menu items content
            tab_content_container : ".tab-content-container", // content container filled with tab-menu-content
            menu_tab : ".menu-tab", // top level menu container, contains the menu items
            menu_mobile_content : ".menu-mobile-content", // menu items mobile content
            menu_desktop_content : ".menu-desktop-content" // desktop content container filled with mobile-content
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;

        // Only initialise tabs, desktop view (".tab-content-container") is initialised after content is loaded in view
        // other events for tabs within tabs or collapsible menus will be instantiated after loading content into desktop view.
        // If the tab contains a collapsible menu we don't initialise tabs as this will be called when
        // the collapsible menu content is loaded "loadFromCollapsibleMenuDesktopView" will be sent as an
        // option by the collapsible menu to initiate the tab.
        var withinTabMenuContent = $(this.element).closest(this.options.tab_menu_content).length;
        var withinTabContentContainer = $(this.element).closest(this.options.tab_content_container).length;
        if ((!withinTabMenuContent && !withinTabContentContainer) || this.options.loadFromCollapsibleMenuDesktopView || this.options.loadTabContentContainer) {
            this.init();
        }

    }

    Plugin.prototype.init = function () {
        var scope = this;

        //init events
        scope.setupEvents(scope);

        // strip href from each item so we don't navigate to element via hashtag anchor placement
        scope.removeHrefs(scope);

        // setup each menu-tab to open the first item if no location.hash required
        scope.initTab(scope);

    };

    // setup each menu-tab to open the first item if no location.hash required
    Plugin.prototype.initTab = function(scope) {
        var $menu_tab = $(scope.element); // menu-tab
        // check if location hash set and navigate to menu item if it is
        if (!scope.hasHash(scope, $menu_tab)){
            // trigger first menu item if not navigating to a hash
            scope.triggerFirstMenuItem(scope, $menu_tab);
        }
    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        // wire up all general panels open/close
        var $tab_menu_links = $el.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + " > div > " + scope.options.tab_menu_link);
        $.each($tab_menu_links, function(i, el) {
            $(el).click($.proxy(scope.menuClicked, scope));
        });
    };

    // strip href from all links
    Plugin.prototype.removeHrefs = function(scope) {
        var $el = $(scope.element);
        var $tab_menu_links = $el.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + " > div > " + scope.options.tab_menu_link);
        $.each($tab_menu_links, function(i, el) {
            $(el).attr("href", "");
        });
    };

    // show menu item when clicked, adds is-active and copies mobile-content to desktop content
    Plugin.prototype.menuClicked = function(e) {
        var scope = this;
        var $menu_clicked = $(e.currentTarget);

        // current menu tab
        $menu_tab = $menu_clicked.closest(scope.options.tabs);

        // current menu item
        $tab_menu_item = $menu_clicked.closest(scope.options.tab_menu_item);

        if (!$tab_menu_item.hasClass("is-active")){
            // put the menu content into the tab view
            $tab_menu_content = $tab_menu_item.find("> " + scope.options.tab_menu_content);

            // remove all is-active's from other menus
            scope.deselectAllMenus(scope, $menu_tab);

            // add is-active to clicked menu
            $tab_menu_item.addClass("is-active");

            // copy content to desktop view
            if ($tab_menu_content.length){
                $tab_content_container = $(scope.element).find("> " + scope.options.tab_content_container);
                $tab_content_container.html($tab_menu_content.html());

                // load controllers in tab-content-container, their are
                // situations when we need to instantiate content once the desktop view is rendered
                //setTimeout(function(){
                scope.instantiateDesktopControllers(scope, $tab_content_container);
                //},0);
            }
        }

        // only trigger scroll for menu-item clicked not for default triggered menu
        /*if (scope.triggeredFirstMenuItem !== true){
            // scroll to menu-item clicked
            var scrollTop = $("body").scrollTop();
            scope.scrollMenuItem(scope, $tab_menu_item);
            window.location.hash = $tab_menu_item.context.title;
            // on desktop don't scroll to hash clicked
            if ($( window ).width() >= 704) {
                $("body").scrollTop(scrollTop);
            }
        }
        scope.triggeredFirstMenuItem = false;*/

        // keep mobile and desktop collapsible view in sync if within a collapsible menu
        scope.keepMobileDesktopTabsInSync(scope, $menu_tab, $menu_clicked);
        
        scope.triggeredFirstMenuItem = false;

        // stop event propagation so that the hashchange does not trigger a page navigation
        e.preventDefault();
        e.stopPropagation();

    };

    // keep mobile and desktop collapsible view in sync if within a collapsible menu
    Plugin.prototype.keepMobileDesktopTabsInSync = function(scope, $menu_tab, $menu_clicked) {
        var $collapsible_menu_tab = $menu_clicked.closest(scope.options.menu_tab);
        if ($collapsible_menu_tab.length){
            var withinMobile = $menu_clicked.closest(scope.options.menu_mobile_content).length;
            var withinDesktop = $menu_clicked.closest(scope.options.menu_desktop_content).length;
            if (!scope.triggeredFirstMenuItem){
                var locationTitle = $menu_clicked.attr("title");
                if (withinMobile){
                    // trigger desktop click
                    var $desktopRef = $collapsible_menu_tab.find(scope.options.menu_desktop_content);
                    var $tab_menu_item_desktop = $desktopRef.find(scope.options.tab_menu_link+"[title='" + locationTitle + "']");
                    if ($tab_menu_item_desktop.length){
                        scope.triggeredFirstMenuItem = true;
                        $tab_menu_item_desktop.trigger("click");
                    }
                }
                if (withinDesktop){
                    // trigger desktop click
                    var $mobileRef = $collapsible_menu_tab.find(scope.options.menu_mobile_content);
                    var $tab_menu_item_mobile = $mobileRef.find(scope.options.tab_menu_link+"[title='" + locationTitle + "']");
                    if ($tab_menu_item_mobile.length){
                        scope.triggeredFirstMenuItem = true;
                        $tab_menu_item_mobile.trigger("click");
                    }
                }
            }
        }
    };

    // instantiate interactive controllers (tabs, toggle-class, carousel, etc) within desktop view after being rendered
    Plugin.prototype.instantiateDesktopControllers = function(scope, $tab_content_container) {
        // re-activate the apply button and compare loans on desktop module
        //$tab_content_container.find(".pl57-apply").applyButton({loadFromCollapsibleMenuDesktopView:true});
        //$tab_content_container.find(".pl13-product-module").compareLoans({loadFromCollapsibleMenuDesktopView:true});
        // re-activate collapsible menus
        $tab_content_container.find(".menu-tab").collapsibleMenu({loadTabContentContainer:true});
        // re-activate tabs (load tabs in tab-content-container)
        $tab_content_container.find(".tab-container").tabMenu({loadTabContentContainer:true});
        // re-activate toggles
        $tab_content_container.find("[data-toggle-target]").genericToggle({loadTabContentContainer:true});
    };

    // scroll to menu-item clicked
    Plugin.prototype.scrollMenuItem = function(scope, $tab_menu_item) {
        // scroll to menu item for mobile only
        if ($( window ).width() < 704) {
            setTimeout(function(){
                $("body").animate({scrollTop: $tab_menu_item.offset().top}, 0);
            }, 0);
        }
    };

    // open the first menu-item
    Plugin.prototype.triggerFirstMenuItem = function(scope, $menu_tabs) {
        // trigger first menu item
        scope.triggeredFirstMenuItem = true;
        $.each($menu_tabs, function(i, el) {
            $(el).find(" > " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + ":first-child " + " > div > " +scope.options.tab_menu_link).trigger("click");
        });
    };

    // Remove is-active from all menu-item's in menu-tab
    Plugin.prototype.deselectAllMenus = function(scope, $menu_tab) {
        var $tab_menu_items = $menu_tab.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item);
        $.each($tab_menu_items, function(i, el) {
            $(el).removeClass("is-active");
        });
    };

    // check if returning to a particular location in a menu
    // Example www.url.com/#uid3
    Plugin.prototype.hasHash = function(scope, $menu_tab) {
        var $el = $(scope.element);
        // remove location # from hash string
        var locationTitle = window.location.hash.replace("#", "");
        $tab_menu_link = $menu_tab.find("> " + scope.options.tab_menu + " > ul > " + scope.options.tab_menu_item + " > div > " + scope.options.tab_menu_link+"[title='" + locationTitle + "']");
        if ($tab_menu_link.length){
            var $menu_item = $tab_menu_link.closest(scope.options.tab_menu_item);
            if (!$menu_item.hasClass("is-active")){
                // open menu
                $tab_menu_link.trigger("click");
            }else{
                // scroll to menu
                scope.scrollMenuItem(scope, $menu_item);
            }
            return true;
        }else{
            return false;
        }
    };

    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).ready(function() {
        //init on page automatically
        $(".tab-container").tabMenu();
    });


})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Manage closing of a notification and setting the cookie value for the notification
 * Example: <div class="pl68-notification" data-cookie="cookie1">
 *
 * data-cookie = name of cookie to set when close clicked
 */
;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'notification',
        defaults = {
            data_cookie : "cookie",
            link_close : ".pl68-notification-close"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        var $el = $(scope.element);

        // set cookie value
        scope._cookie_name = $el.data(scope.options.data_cookie);

        //init events
        scope.setupEvents(scope);

    };

    // add events to items
    Plugin.prototype.setupEvents = function(scope) {
        var $el = $(scope.element);
        var $link_close = $el.find(scope.options.link_close);
        $link_close.click($.proxy(scope.closeClicked, scope));
    };

    // remove notification and set cookie
    Plugin.prototype.closeClicked = function(e) {
        var scope = this;
        var $link_clicked = $(e.currentTarget);
        setCookie(scope._cookie_name,'true',Number.MAX_VALUE);
        $(scope.element).remove();
        $("body").hide(0).show(); // fixes bug on ie9/10 where page height is not being rendered correctly after notification being removed
        e.preventDefault();
        e.stopPropagation();
    }

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load',function() {
        $(".pl68-notification").notification();
    });

})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Floating Social, fixes the social bar below the left-hand-tabs
 *
 */
;
(function ($, window, document, undefined) {

    // Create the defaults once
    var pluginName = 'floatingSocial',
        defaults = {
            floating_element: ".pl54-floating-social",  // The Element we want to float
            floating_container: ".pl11-tabs",           // The Element container that defines the floating state bounds
            mobile_social_target: "#main-content"       // The Element to target when inserting the social mobile content
        };

    // Constructor
    function Plugin(element, options) {
        this.element = $(element);
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // Element we need to fix
        scope.floatingElm = $(scope.element);

        // Element container
        scope.floatingCtr = scope.floatingElm.closest(scope.options.floating_container);

        // Set up window scroll and resize event listener and trigger on init
        $(window).on('scroll resize', function () {

            // Update the state
            scope.updateFixedState(scope);

        }).trigger('scroll');

	    // add social replicator so mobile version has a copy of the social buttons
	    scope.socialReplicator(scope);

    };

	//make a copy of the HTML content for mobile view

	Plugin.prototype.socialReplicator = function (scope) {
		var exists = $(scope.options.mobile_social_target + " .pl54-floating-social-copy").length;
		if (!exists) {
			$($(scope.options.floating_element)[0]).clone().appendTo(scope.options.mobile_social_target).addClass("pl54-floating-social-copy");
		}
	}

    // Update fixed element state
    Plugin.prototype.updateFixedState = function (scope, dims) {

        if (scope.floatingCtr.offset() == undefined){
            return;
        }

        // get some dimensions
        var elmH = scope.floatingElm.outerHeight(),
            ctrH = scope.floatingCtr.outerHeight(),
            winTop = $(window).scrollTop(),
            ctrTop = scope.floatingCtr.offset().top + elmH,
            ctrBot = ctrTop + (ctrH - elmH);

        // Toggle the is-fixed state
        if (winTop > ctrTop && winTop < ctrBot) {

            // Add is-fixed state and remove is-absolute state
            // if the viewport is between the top and bottom of the container
            scope.floatingElm.addClass('is-fixed').removeClass('is-absolute');

	        if (winTop > (ctrBot - elmH)) {

                // Add is-absolute state and remove is-fixed state
                // if the base of our sticky element hits the base of the container
                scope.floatingElm.addClass('is-absolute').removeClass('is-fixed');
            }

        } else {

            // Remove is-fixed and is-absolute states if the viewport is not focused over the container
            scope.floatingElm.removeClass('is-fixed is-absolute');

        }

	    // mobile view (stick element when tab within view)
	    if ($(window).width() < 897) {
		    // make sure footer is not in view
		    var footerIsInView = this.inView($("#main-footer")[0]);
		    if (footerIsInView) {
			    $(scope.options.floating_element + "-copy").removeClass("is-fixed");
		    } else {
			    this.checkWithinView(scope, $(scope.options.floating_container));
		    }
	    }
    };

	// check if element is within view and if so add is-fixed
	Plugin.prototype.checkWithinView = function (scope, $el) {
		var isInView = this.inView($el[0]);
		if (isInView) {
			$(scope.options.floating_element + "-copy").addClass("is-fixed"); // .pl54-floating-social-copy
		}else{
			$(scope.options.floating_element + "-copy").removeClass("is-fixed");
		}
	}

	// get window size
	Plugin.prototype.getWindowSize = function () {
		var winW,WinH = 0;
		if (document.body && document.body.offsetWidth) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
		if (document.compatMode == 'CSS1Compat' &&
				document.documentElement &&
				document.documentElement.offsetWidth) {
			winW = document.documentElement.offsetWidth;
			winH = document.documentElement.offsetHeight;
		}
		if (window.innerWidth && window.innerHeight) {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		return {w:winW, h:winH};
	}

	// Calculate if element in view
	Plugin.prototype.inView = function (element) {
    if (element) {
      var winSize = this.getWindowSize();
      var box = element.getBoundingClientRect();
      if ((box.bottom < 0) || (box.top > winSize.h)){
        return false;
      }
      return true;
    }else{
      return false;
    }

	}

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin(this, options));
            }
        });
    };

})(jQuery, window, document);



//Social Sharing Pop up script

(function ($) {

	$.fn.socialpop = function(url, h, w) {

		var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
		var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;

		width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
		height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

		var left = ((width / 2) - (w / 2)) + dualScreenLeft;
		var top = ((height / 2) - (h / 2)) + dualScreenTop;

		var newwindow = window.open(url,'Share','height=' + h + ',width=' + w + ',top=' + top + ',left=' + left);

		if (window.focus) {
			newwindow.focus();
		}
	};

	$('.social-share-pop').on('click', function(e) {
		e.preventDefault();
		var url = $(this).attr('href');
		$(this).socialpop(url, 400, 600);
	});

}(jQuery));


$(window).on('load',function () {

	$(".pl54-floating-social").floatingSocial();

});


;
/*!
 * jStuck v1.0.3
 */

(function ($, window, document, undefined) {
	"use strict";

	// Defaults
	var pluginName = 'jStuck', defaults = {
		base:   undefined,     // the containing element (bounds)
		state:  undefined,     // the state to apply
		clone:  false,         // should we be cloned to maintain document integrity?
		self:   false,         // should we offset by our own height?
		above:  false,         // element list eg: .element, .element-two, #el
		buffer: {              // top and bottom buffer in pixels
			top:0,
			bottom:0
		},
		align:  false,         // do we need to be aligned?
		desktopBreakpoint: 897 // Breakpoint for desktop screen (same as the CSS @media query)
	};

	// Constructor
	function Plugin(element, options) {
		this.element = element;
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this.stuck = {};
		this.dims = {};
		this._name = pluginName;
		this.init();
	}

	// Initialize...
	Plugin.prototype.init = function () {
		var scope = this;

		// Reference the element once only
		scope.options.element = $(scope.element);

		// Is touch enabled?
		scope.options.isTouchEnabled = typeof Modernizr !== 'undefined' && Modernizr.touch;

		// Get the settings from the data-jstuck attributes
		var data = scope.options.element.data();
		scope.options.base          = data.jstuckContainer;
		scope.options.state         = data.jstuckState;
		scope.options.clone         = data.jstuckClone || false;
		scope.options.selfType      = data.jstuckOffsetSelf;
		scope.options.self          = data.jstuckOffsetSelf || false;
		scope.options.above         = data.jstuckOffsetTop || false;
		scope.options.align         = data.jstuckAlign || false;
		scope.options.fixiOS        = data.jstuckFixios || false;
		scope.options.scrollBack    = data.jstuckScrollBack || false;
		scope.options.disableDesktop = data.jstuckDisableDesktop;

		// Set some flags for the scrollback option
		scope.options.isInit        = true;  // Initializing phase
		scope.options.touching      = true;  // User is touching the screen
		scope.options.animated      = false; // jQuery animation in action

		// get buffer
		if (data.jstuckOffsetBuffer) {
			scope.options.buffer.top    = $.isNumeric(data.jstuckOffsetBuffer.top) ? data.jstuckOffsetBuffer.top : scope.calculateHeight(scope, data.jstuckOffsetBuffer.top) || 0;
			scope.options.buffer.bottom = $.isNumeric(data.jstuckOffsetBuffer.bottom) ? data.jstuckOffsetBuffer.bottom : scope.calculateHeight(scope, data.jstuckOffsetBuffer.bottom) || 0;
		}

		// Get the base element where we apply the states
		scope.stuck.base = $(scope.options.base);

		// Setup
		scope.setup(scope);

		// Set up clone if required
		if (scope.options.clone) {
			scope.setUpClone(scope);
		}

		// Stuckify
		scope.stuckify(scope);

		// Force apply
		$(window).trigger('scroll');
	};

	/**
	 * Stuck Setup
	 * @param scope
	 */
	Plugin.prototype.setup = function(scope) {

		// Get dims
		scope.dims.offsetTop       = $(window).scrollTop();
		scope.dims.stuckHeight     = scope.options.element.outerHeight();
		scope.dims.containerHeight = scope.stuck.base.outerHeight();
		scope.dims.heightAbove     = scope.getHeightAbove(scope);
		scope.dims.lastScrollPos   = scope.dims.offsetTop;

		// Update is_desktop global
		scope.dims.is_desktop = scope.isDesktop(scope);

	};

	/**
	 * Set alignment if needed
	 * @param scope
	 * @param cleanup
	 */
	Plugin.prototype.setAlignment = function(scope, cleanup) {

		// only apply if ne need to
		if (!$(scope.options.base).is(':visible')) {
			cleanup = true;
		}

		// Update the alignment if we have set it...
		if (scope.options.align && scope.dims.is_desktop) {

			// cleanup by default
			scope.options.element.removeAttr('style');

			if (!cleanup) {
				if (scope.options.align === 'right') {
					// right is tricky
					scope.options.element.css({right: $(window).width() - (scope.stuck.base.offset().left + scope.stuck.base.outerWidth()) + 'px'});
				}

				if (scope.options.align === 'left') {
					// left is easy
					scope.options.element.css({left: scope.stuck.base.offset().left + 'px'});
				}
			}

		}
	};

	/**
	 * Set up clone if we need one
	 * @param scope
	 */
	Plugin.prototype.setUpClone = function(scope) {

		// If we're not already stuck
		if (!scope.stuck.base.is('.' + scope.options.state)) {

			// Create a clone of our element
			scope.stuck.clone = scope.options.element.clone();

			// Empty it, set it's height, insert it into the dom, class it and hide it
			scope.stuck.clone
				.css({'height': scope.dims.stuckHeight})
				.insertBefore(scope.options.element)
				.removeClass('jstuck')
				.addClass('is-stuck-clone')
				.empty();
		}

	};

	/**
	 * Get Height Above
	 * @param scope
	 * @returns {number}
	 */
	Plugin.prototype.getHeightAbove = function(scope) {

		// by default zero it out
		var height = 0;

		// if we have a height to calculate
		if (scope.options.above !== false) {
			height = scope.calculateHeight(scope, scope.options.above);
		}

		// return the height
		return height;
	};

	/**
	 * Calculate Height of x elements
	 */
	Plugin.prototype.calculateHeight = function(scope, selectors) {
		var height = 0;

		// Get all of the elements in the elementsAbove array that are visible
		var $els = $(selectors).filter(function () {
			return $(this).is(':visible');
		});

		// Loop through them and add up their heights
		$els.each(function () {
			height = height + $(this).outerHeight();
		});

		return height;
	};

	/**
	 * Detect touch for its duration
	 */
	Plugin.prototype.checkTouching = function(scope) {

		// Requires modernizr touch test because we don't want this on a non-touch enabled device
		if ( scope.options.isTouchEnabled ) {

			// On Click or TouchStart we are touching
			$(window).on('click touchstart', function(e) {

				// Set the global option to true
				scope.options.touching = true;

			// On TouchEnd we are no longer touching
			}).on('touchend', function() {

				// Set the global option to false
				scope.options.touching = false;

			});
		}

	};

	/**
	 * Stuck Events
	 * @param scope
	 */
	Plugin.prototype.stuckify = function (scope) {

		// Set up the test for touch events
		scope.checkTouching(scope);

		// Window resize event
		$(window).on('resize', scope.debounce( function () {

			// Update is_desktop global
			scope.dims.is_desktop = scope.isDesktop(scope);

      // if switching from mobile with menu open to desktop we have to close the menu
      if (scope.dims.is_desktop && ($("body").hasClass("is-navigation-toggled") || $("body").hasClass("is-header-stuck"))){
        $("body").removeClass("is-navigation-toggled");
        $("body").removeClass("is-header-stuck");
      }

			// Get dims
			scope.dims.offsetTop       = $(window).scrollTop();
			scope.dims.stuckHeight     = scope.options.element.outerHeight();
			scope.dims.containerHeight = scope.stuck.base.outerHeight();
			scope.dims.heightAbove     = scope.getHeightAbove(scope);
			scope.dims.lastScrollPos   = scope.dims.offsetTop;

			// we need to trigger a scroll but only on touch enabled devices
			if ( scope.options.isTouchEnabled ) {
				$(window).trigger('scroll');
			}

			// adjust the clone height if there is one
			if (scope.options.clone) {
				scope.stuck.clone.css({'height': scope.dims.stuckHeight});
			}

		})).trigger('resize');

		// Define some properties
		var elmH = 0, ctrH, winTop, ctrTop, ctrBot, to, isAnimated;

		// On scroll
		$(window).on('scroll', function () {

			// unstick when on desktop
			if (scope.dims.is_desktop && scope.options.disableDesktop) {
				scope.unstick(scope);
				return;
			}

			// Responsive self offset checking...
			scope.options.self = (scope.options.selfType === 'desktop' && scope.dims.is_desktop) || false;

			// Update dims
			scope.dims.offsetTop = scope.options.self !== false ? $(window).scrollTop() - scope.dims.stuckHeight: $(window).scrollTop();

			// if we just started scrolling check the height above again
			if (scope.dims.offsetTop < 1) {
				scope.dims.heightAbove = scope.getHeightAbove(scope);
			}

			// get some dimensions
			elmH   = scope.dims.stuckHeight;
			ctrH   = scope.dims.containerHeight;
			winTop = scope.dims.offsetTop;
			ctrTop = scope.stuck.base.offset().top + elmH;
			ctrBot = ctrTop + (ctrH - elmH);

			// adjust the clone height if there is one
			if (scope.options.clone) {
				scope.stuck.clone.css({'height': elmH});
			}

			// if the element height zero's we should void the result
			if (elmH <= 0) {
				return;
			}

			// Adjust for non-self offsetting elements
			if (scope.options.self === false) {
				ctrTop = ctrTop - elmH;
			}

			// adjust top buffer
			if (scope.options.buffer.top > 0) {
				ctrTop = (ctrTop - scope.options.buffer.top);
			}

			// adjust bottom buffer
			if (scope.options.buffer.bottom > 0) {
				ctrBot = (ctrBot - scope.options.buffer.bottom);
			}

			// adjust top buffer for height above
			if (scope.dims.heightAbove > 0) {
				ctrTop = scope.dims.heightAbove;
			}

			// are we scrolling down
			if (winTop < ctrTop) {
				scope.outsideAbove(scope);
			}

			// or up?
			if (winTop > ctrBot) {
				scope.outsideBelow(scope);
			}

			// Toggle states
			if (winTop > ctrTop && winTop < ctrBot) {

				// only apply if ne need to
				if (!$(scope.options.base).is(':visible')) {
					return;
				}

				// Add stuck state and remove stopped state
				// if the viewport is between the top and bottom of the container
				scope.stick(scope);

				// Do the scrollBack
				scope.doScrollBack(scope, winTop, elmH, to, isAnimated);


				if (winTop > (ctrBot - elmH)) {
					// Add stopped state and remove stuck state
					// if the base of our sticky element hits the base of the container
					scope.stop(scope);
				}

			} else {

				// Remove stuck and stopped states if the viewport is not focused over the container
				scope.unstick(scope);

				// if scrolling to top from say a #top we update to make sure menu is shown when scrollTop equals 0
				if (winTop === 0) {
					scope.show();
				}

			}

		});

		// fix iOS (because it's very silly) if we have asked for it...
		if (scope.options.fixiOS !== false) {
			scope.fixSillyPhones(scope);
		}

	};

	/**
	 * doScrollBack, shows and hides the element depending on the scroll position
	 * @param scope
	 * @param winTop
	 * @param elmH
	 * @param to
	 * @param isAnimated
	 */
	Plugin.prototype.doScrollBack = function(scope, winTop, elmH, to, isAnimated) {

		// If we have set the option but only if we're not in the initialization phase
		if (!scope.options.is_desktop && scope.options.scrollBack && !scope.options.isInit) {

			// Check if the scroll event is being triggered by a jquery animation event (i.e. you clicked on a tab on mobile)
			isAnimated = $("html, body").is(':animated');

			// If it is animated
			if (isAnimated) {

				scope.dims.lastScrollPos = 0;

				// We don't know which way the scroll is going to go so hide the element regardless
				scope.hide();

			}

			// If the screen is not being touched (default is true for non-touch devices)
			// And the scroll event is not a jquery animation event
			// Basically this cancels excess updates fiering while the screen is freescrolling
			if (scope.options.touching && !isAnimated)  {

				// Set an internal watcher to let us know when the scroll has stopped
				clearTimeout(to);
				to = setTimeout(function() {

					// Otherwise this is an upscroll so show the element
					scope.show();

					// If we have moved below the bottom of the element
					if (winTop >= elmH && winTop >= scope.dims.lastScrollPos){

						// This is a downscroll so hide the element
						scope.hide();
					}

					// Update the last scroll position
					scope.dims.lastScrollPos = winTop;

				}, 20);

			}

		}

		// This is no longer the initialization phase
		scope.options.isInit = false;

	};

	/**
	 * Fix Silly Phones (i.e. iOS)
	 */
	Plugin.prototype.fixSillyPhones = function(scope) {

		// For iOS devices we need to obscure the fixed header when the keyboard is toggled
		// due to the many problems with the way the position:fixed property is handled on these devices!
		// We can't simply reset the position though because it is not possible to calculate it after
		// a programmatic scroll is triggered, so we can only hide it and show it again on blur.

		// Yucky sniffing...
		var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );

		// If it is not a silly phone just stop here...
		if (!iOS) {
			return;
		}

		// If it is a silly phone we need to do some work
		var $element = $(scope.options.fixiOS);

		// Whatch all inputs and textareas on focus and blur
		$(document).on('focus', 'input, textarea', function (e) {

			// Avoid this action within stuck elements
			if ($(e.target).closest(scope.options.fixiOS).length) {
				return;
			}

			// Hide the header
			$element.hide();

			// If we scoll again show the header but that's it
			$(window).on('scroll', function() {
				$element.show();
			});

		}).on('blur', 'input, textarea', function (e) {

			// Avoid this action within stuck elements
			if ($(e.target).closest(scope.options.fixiOS).length) {
				return;
			}

			// Show the header
			$element.show();
		});
	};

	// Above or Below?
	Plugin.prototype.outsideAbove = function(scope) {
		scope.stuck.base.addClass('is-outside-above').removeClass('is-outside-below');
	};

	Plugin.prototype.outsideBelow = function(scope) {
		scope.stuck.base.addClass('is-outside-below').removeClass('is-outside-above');
	};

	// Stick the Element
	Plugin.prototype.stick = function (scope) {
		// update states
		scope.stuck.base.addClass(scope.options.state).removeClass(scope.options.state + '-stopped');

		// update alignment
		scope.setAlignment(scope, false);
	};

	// Stop the Element
	Plugin.prototype.stop = function (scope) {
		// update states
		scope.stuck.base.addClass(scope.options.state + '-stopped').removeClass(scope.options.state);

		// update alignment
		scope.setAlignment(scope, true);
	};

	// Un-stick the Element
	Plugin.prototype.unstick = function (scope) {
		// update states
		scope.stuck.base.removeClass(scope.options.state).removeClass(scope.options.state + '-stopped');

		// update alignment
		scope.setAlignment(scope, true);
	};

	// Hide on scroll back
	Plugin.prototype.hide = function() {
		var scope = this;
		scope.stuck.base.addClass(scope.options.state + '-obscured');
	};

	// show
	Plugin.prototype.show = function() {
		var scope = this;
		scope.stuck.base.removeClass(scope.options.state + '-obscured');
	};

	/**
	 * Viewport Dimensions for CSS breakpoint Sync
	 * @returns {{width: *, height: *}}
	 */
	Plugin.prototype.viewport = function () {

		// http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript

		var e = window,
			a = 'inner';

		if (!('innerWidth' in window )) {

			a = 'client';
			e = document.documentElement || document.body;

		}

		// Return the viewport width that matches CSS @media queries
		return {width: e[a + 'Width'], height: e[a + 'Height']};

	};

	/**
	 * Check for desktop
	 * @param scope
	 * @returns {boolean}
	 */
	Plugin.prototype.isDesktop = function (scope) {

		// Return true/false based on screen width
		return (scope.viewport().width >= scope.options.desktopBreakpoint);

	};

	/**
	 * Debounce
	 * @param func
	 * @param duration
	 * @param timeout
	 * @returns {function}
	 */
	Plugin.prototype.debounce = function(func, duration, timeout) {
		return function() {
			var args = arguments;
			clearTimeout(timeout);
			timeout = setTimeout(function() {
				func.apply(null , args);
			}, duration || 25);
		};
	};

	// Constructor Wrapper
	$.fn[pluginName] = function (options) {
		return this.each(function () {
			if (!$.data(this, 'plugin_' + pluginName)) {
				$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
			}
		});
	};

	// Init
	$(window).on('load',function () {
	// $(document).ready(function() {
		$('.jstuck').jStuck();
	});

})(jQuery, window, document);
;
/*
Version: 2.1.8
Date:2017-09-11
 */
/*! rangeslider.js - v0.3.9 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return 0===a.offsetWidth||0===a.offsetHeight||a.open===!1?!0:!1}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){"undefined"!=typeof a.open&&(a.open=a.open?!1:!0)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;e>i;i++)g[i]=d[i].style.display,d[i].style.display="block",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;e>j;j++)c(d[j]),d[j].style.display=g[j],d[j].style.height="",d[j].style.overflow="",d[j].style.visibility=""}return h}function h(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},l,e),this.polyfill=this.options.polyfill,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.polyfill&&k)return!1;this.identifier="js-"+i+"-"+j++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.min=parseFloat(this.$element[0].getAttribute("min")||0),this.max=parseFloat(this.$element[0].getAttribute("max")||100),this.value=parseFloat(this.$element[0].value||this.min+(this.max-this.min)/2),this.step=parseFloat(this.$element[0].getAttribute("step")||1),this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update()},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}var i="rangeslider",j=0,k=b(),l={polyfill:!0,rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]};h.prototype.init=function(){this.onInit&&"function"==typeof this.onInit&&this.onInit(),this.update()},h.prototype.update=function(){this.handleWidth=g(this.$handle[0],"offsetWidth"),this.rangeWidth=g(this.$range[0],"offsetWidth"),this.maxHandleX=this.rangeWidth-this.handleWidth,this.grabX=this.handleWidth/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position)},h.prototype.handleDown=function(a){if(a.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),!((" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect().left,d=this.getPositionFromNode(this.$handle[0])-c;this.setPosition(b-this.grabX),b>=d&&b<d+this.handleWidth&&(this.grabX=b-d)}},h.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a);this.setPosition(b-this.grabX)},h.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},h.prototype.cap=function(a,b,c){return b>a?b:a>c?c:a},h.prototype.setPosition=function(a){var b,c;b=this.getValueFromPosition(this.cap(a,0,this.maxHandleX)),c=this.getPositionFromValue(b),this.$fill[0].style.width=c+this.grabX+"px",this.$handle[0].style.left=c+"px",this.setValue(b),this.position=c,this.value=b,this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(c,b)},h.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},h.prototype.getRelativePosition=function(a){var b=this.$range[0].getBoundingClientRect().left,c=0;return"undefined"!=typeof a.pageX?c=a.pageX:"undefined"!=typeof a.originalEvent.clientX?c=a.originalEvent.clientX:a.originalEvent.touches&&a.originalEvent.touches[0]&&"undefined"!=typeof a.originalEvent.touches[0].clientX?c=a.originalEvent.touches[0].clientX:a.currentPoint&&"undefined"!=typeof a.currentPoint.x&&(c=a.currentPoint.x),c-b},h.prototype.getPositionFromValue=function(a){var b,c;return b=(a-this.min)/(this.max-this.min),c=b*this.maxHandleX},h.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandleX||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},h.prototype.setValue=function(a){a!==this.value&&this.$element.val(a).trigger("change",{origin:this.identifier})},h.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+i),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[i]=function(b){return this.each(function(){var c=a(this),d=c.data("plugin_"+i);d||c.data("plugin_"+i,d=new h(this,b)),"string"==typeof b&&d[b]()})}});;
/*!
 * Range Slider GUI
 *
 * Dependencies:
 * rangeslider.js - v0.3.5 | https://github.com/andreruffert/rangeslider.js
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'rangeSlider', defaults = {

        // Base elements
        rangeContainer: '.form-field-range',                    // The range input container element

        // Range Type
        rangeType: 'number',                                    // The type of range [number/duration]

        // Range Step Markers
        rangeStepMarkers: true,                                 // Show the step markers for ranges with a step value defined (override with data-show-steps="true/false")
        rangeStepMarkersMax: 25,                                // The maximum number of step markers to generate, try to keep things in perspective :) (set to 25 due to sub-pixel layout issues in safari)
        rangeStepsClass: 'rangeslider-steps',                   // The steps container class
        rangeStepsOffsetClass: 'rangeslider-steps-offsetter',   // The steps offsetter class (used to align markers tot he handle)
        rangeStepClass: 'rangeslider-step',                     // The step marker class

        // Range Output
        rangeNumberOutput: true,                                // Do we add a number input element to display the current value? (override with data-show-number="true/false")
        rangeNumberClass: 'form-range-number-input',            // The number input classname to apply

        // RangeSlider.js options
        rangeSliderOptions: {                                   // The options to pass to rangeslider.js

            // Feature detection the default is `true`.
            // Set this to `false` if you want to use
            // the polyfill also in Browsers which support
            // the native <input type="range"> element.
            polyfill: false,

            // Default CSS classes
            rangeClass: 'rangeslider-bar',
            fillClass: 'rangeslider-fill',
            handleClass: 'rangeslider-handle'

            // Callback functions
            //onInit: function() {},
            //onSlide: function(position, value) {},
            //onSlideEnd: function(position, value) {}
        }
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // The range input element
        scope.rangeSlider = $(scope.element);

        // The type of range we're working with (number or duration?)
        scope.rangeType = typeof scope.rangeSlider.data("range-type") !== 'undefined' ? scope.rangeSlider.data("range-type") : scope.options.rangeType;

        // The range container element
        scope.rangeContainer = scope.rangeSlider.closest(scope.options.rangeContainer);

        // Check if we are overriding the show range number default from the markup
        scope.rangeShowNumber = typeof scope.rangeSlider.data("show-number") !== 'undefined' ? scope.rangeSlider.data("show-number") : scope.options.rangeNumberOutput;

        // Set up the number input
        !scope.rangeShowNumber || scope.buildRangeNumber(scope);

        // If this input has a step attribute
        if (typeof scope.rangeSlider.attr('step') !== 'undefined') {

            // Check if we are overriding the show range steps default from the markup
            scope.rangeShowSteps = typeof scope.rangeSlider.data("show-markers") !== 'undefined' ? scope.rangeSlider.data("show-markers") : scope.options.rangeStepMarkers;

            // Set up step markers
            !scope.rangeShowSteps || scope.buildStepMarkers(scope);

        }

        // If this is a duration type we need to do some extra work so lets set up a callback to help us out
        scope.options.rangeSliderOptions.onSlide = function(position, value) {

            scope.rangeType !== 'duration' || scope.updateDurationData(scope, value);

        };

        // Initialize rangeslider.js with options
        scope.rangeSlider.rangeslider(scope.options.rangeSliderOptions);

        // Find the range slider bar
        scope.rangeBar = scope.rangeContainer.find('.' + scope.options.rangeSliderOptions.rangeClass);

        // Listen to mouse events on the bar
        scope.rangeBarEvents(scope);

    };

    // Build the number input
    Plugin.prototype.buildRangeNumber = function (scope) {

        // Create a number input that we can use to display our current value
        // We can simply clone our range input an make some minor adjustments
        // because we want both elements to mirror min, max and step values...
        scope.rangeNumber = $('<input />')
            .attr('class', scope.options.rangeNumberClass)
            .attr('type', 'number')
            .attr('id', scope.rangeSlider.attr('name') + '-number')
            .attr('name', '') // We don't want the extra input to post data
            .removeAttr('data-ng-model');

        // Place the number input before the range input
        scope.rangeSlider.before(scope.rangeNumber);

        // store the default max in data because we may need to adjust it at some stage
        scope.rangeNumber.data('max', scope.rangeNumber.attr('max'));

        // if this is a duration range we need to do a little more scaffolding
        if (scope.rangeType === 'duration' ) {

            // wrap the range number to give us some structure
            scope.rangeNumber.wrap('<div class="' + scope.options.rangeNumberClass + '-wrap">');

            // Set up our duration output
            scope.rangeTypeOutput = $('<span class="rangeslider-' + scope.rangeType + '" />');

            // Place the range type output after the number field
            scope.rangeNumber.after(scope.rangeTypeOutput);

            // disallow text selection for IE8
            scope.rangeTypeOutput.unselectable = "on";
        }

        // IE11 needs some help pre-populating the number element so we trigger the change event right away
        // FireFox 33.0 (32.0.3 and presumably lower) fails to set the value to the actual value in favour of the min value
        scope.rangeNumber.val(scope.rangeSlider.val()).trigger('keyup');

        // Set up event listeners
        scope.rangeChangeEvents(scope);

    };

    // Update the duration data and output
    Plugin.prototype.updateDurationData = function(scope, value) {

        // make sure the min value is 0
        scope.rangeSlider.attr('min', 0).val(value);

        // Set the output text
        scope.rangeTypeOutputText = value > 1 ? 'years' : 'year';

        // Reset the max to it's original value
        scope.rangeNumber.attr('max', scope.rangeNumber.data('max'));

        // if we are at the minimum value this is 6 months!
        if (value < 1) {

            // reset the min value before we submit
            scope.rangeSlider.attr('min', 0.5).val(0.5);

            // adjust the output
            scope.rangeNumber.val(6);

            // Set the output text
            scope.rangeTypeOutputText = 'months';

            // If the max is less than or equal to 6
            if ( scope.rangeNumber.data('max') <= 6 ) {

                // Temporarily increment the max to allow us to increase the number from 6 months again
                scope.rangeNumber.attr('max', 7);

            }
        }

        scope.rangeTypeOutput.text(scope.rangeTypeOutputText);

    };

    // Build step markers
    Plugin.prototype.buildStepMarkers = function (scope) {

        // Create elements
        var $steps = $('<div/>').addClass(scope.options.rangeStepsClass);

        // Get the range max and divide it by step
        var min = parseInt(scope.rangeSlider.attr('min')),
            max = parseInt(scope.rangeSlider.attr('max')),
            step = parseInt(scope.rangeSlider.attr('step')),
            steps = max / step;

        // Set the maximum steps if it exceeds out Max Markers setting
        steps = steps > scope.options.rangeStepMarkersMax ? scope.options.rangeStepMarkersMax : steps;

        // Get percentage width of step elements
        var percent = 100 / steps;

        // Create an element for offsetting the steps from the edges
        var $offsetter = $('<div/>').addClass(scope.options.rangeStepsOffsetClass);

        // Append the offsetter
        $steps.append($offsetter);

        // Apply offset
        $offsetter.css({
            'margin-left': '-' + (percent / 2) + '%',
            'margin-right': '-' + (percent / 2) + '%'
        });

        // Adjust for less than 10 steps by adding an additional marker and re-calculating percent
        //if (steps < 10) {
        if(min <= 0) {
            steps++;
            percent = 100 / steps;
        }

        // Append steps
        for (var i = 0; i < steps; i++) {
            $offsetter.append($('<div/>').addClass(scope.options.rangeStepClass).css({width: percent + '%'}));
        }

        // Insert the step markers before the range slider
        scope.rangeSlider.before($steps);

    };

    // Listen to events on the rangeslider bar
    Plugin.prototype.rangeBarEvents = function(scope) {

        // Capture mouse events on the rangeslider bar
        scope.rangeBar.on('mousedown', function(e) {

            // apply focus to the range input
            scope.rangeSlider.trigger('focus');

        }).on('mouseup', function(e) {

            // Blur the range slider input
            scope.rangeSlider.trigger('blur');

        });

    };

    // Range change event listeners
    Plugin.prototype.rangeChangeEvents = function (scope) {

        // Range input change listener
        scope.rangeSlider.on('change', function (e) {

            var value = parseInt($(this).val());

            // Set the value
            scope.rangeNumber.val(value);

        });

        // Range input change listener
        scope.rangeNumber.on('change', function (e) {

            // Get the value
            var value = parseInt($(this).val());

            // If this is a duration range type
            if (scope.rangeType === 'duration') {

                // And we're currently displaying 6 months
                if (scope.oldValue === 6 && scope.rangeTypeOutputText === 'months') {

                    // And the slider value is 0 (or 0.5 for 6 months)
                    if (scope.rangeSlider.val() < 1) {

                        // If we're going down
                        if (value < 6) {

                            // Preset the value to 6
                            $(this).val(6);

                            // And leave it at that
                            return false;

                        }

                        // Preset the value to 6
                        $(this).val(1);

                        // Set the value to 0
                        value = 0;
                    }
                }
            }

            // Set the value
            scope.rangeSlider.val(value).trigger('change');

        });

        // Number input value trap
        scope.rangeNumber.on('mousedown keydown', function(e) {

            // Store the old value
            scope.oldValue =  parseInt($(this).val());

        });

        // Number input mousewheel event
        scope.rangeNumber.on('mousewheel', function() {

            // Get the value
            scope.oldValue = parseInt($(this).val());

            // Get this
            var _self = this;

            // Do this in a time out so the event has time to register
            setTimeout(function(){

                // Update input value
                var value = parseInt($(_self).val());

                // Trigger the change
                $(_self).val(value).trigger('change');

            }, 0);

        });

    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    // Removed as this is now managed by the angular directive formRangeSlider
    /*$(window).on('load',function () {
        $(".form-range-slider").each(function (index, element) {
            $(this).rangeSlider();
        });
    });*/

})(jQuery, window, document);
;
/*!
 * Plugin Name
 *
 * Plugin Description
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'prettyFileStyle', defaults = {

        prettyLabelClass:   '.form-file-label',                                 // The label
        prettyInputClass:   '.form-file-input',                                 // The input
        prettyButtonClass:  'button button-primary form-button-file-upload',    // The class to append to the generated button
        prettyButtonText:   'Browse...',                                        // The button text
        prettyStatusClass:  'form-input',                                       // The class to append to the generated status element
        prettyStatusText:   'No file selected.'                                 // The status text
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // The input container
        scope.prettyFile = $(scope.element);

        // The label and input elements
        scope.prettyLabel = scope.prettyFile.find(scope.options.prettyLabelClass);
        scope.prettyInput = scope.prettyFile.find(scope.options.prettyInputClass);

        // First check if this is IE8 or lower
        try {

            // If this is IE8 < it will fail to change the type attribute on an input
            scope.prettyInput.clone().attr('type', 'text');

        } catch (e) {

            // That failed so call it a day!
            return false;

        }

        // Build and modify
        scope.buildPrettyBits(scope);

    };

    // Build pretty bits
    Plugin.prototype.buildPrettyBits = function (scope) {

        // Add some new classes
        scope.prettyLabel.addClass('pretty-filestyle-label');
        scope.prettyInput.addClass('pretty-filestyle-input');

        // Build some new elements
        scope.prettyWrap = $('<div class="pretty-filestyle-wrap"/>');
        scope.prettyStatus = $('<div class="' + scope.options.prettyStatusClass + ' pretty-filestyle-status">' + scope.options.prettyStatusText + '</div>');
        scope.prettyButton = $('<button class="' + scope.options.prettyButtonClass + ' pretty-filestyle-button" type="button" tabindex="-1">' + scope.options.prettyButtonText + '</button>');

        // Wrap the input and insert the dummy controls
        scope.prettyInput
            .wrap(scope.prettyWrap)
            .after(scope.prettyButton)
            .after(scope.prettyStatus);

        // Set up event listeners
        scope.prettyFileEvents(scope);

    };

    // Set up event listeners
    Plugin.prototype.prettyFileEvents = function(scope) {

        // Start listening
         scope.prettyInput.on('change', function (e) {

             // Get the input value
             var $input = $(this),
                 value = $input.val().split('\\'),
                 val = value[value.length - 1] || scope.options.prettyStatusText;

             scope.prettyStatus.text(val);

         }).trigger('change');

        /*

         $parent = $input.closest('.pretty-filestyle')
         $status = $parent.find('.pretty-filestyle-status');

         $parent.addClass('is-empty');
         $status.text($status.attr('data-originaltext'));

         if (val !== '') {
         $status.text(val);
         $parent.find('.button-upload').show();
         } else {
         $parent.find('input[type=submit]').hide();
         }

         if ($parent.find('img').attr('src') !== '') {
         $parent.removeClass('is-empty');
         //$parent.find('.button-upload').hide();
         $parent.find('.button-save').show();
         }

         }

         */
    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load',function () {
        $('.pretty-filestyle').each(function (index, element) {
            $(this).prettyFileStyle();
        });
    });

})(jQuery, window, document);
;
/*!
 * Number Input Replacer
 *
 * Plugin Description
 * Modifies the behaviour of the standard HTML5 number input
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults'.
    var pluginName = 'prettyNumberStyle', defaults = {

        prettyLabelClass:       '.form-input-label',    // The label
        prettyInputClass:       '.form-input',          // The input
        prettyNumberMin:        0,                      // Min allowed value, can be set by min attribute
        prettyNumberMax:        99,                     // Max allowed value, can be set by max attribute
        prettyNumberStep:       1,                      // Steps for each value update
        prettyNumberDelay:      500,                    // The delay to apply on mousedown + hold
        prettyNumberInterval:   50,                     // The interval to apply on mousedown + hold after delay
        prettyNumberButtons: {
            inc: {
                className: 'button button-primary form-button-number-toggle',
                text: '+'
            },
            dec: {
                className: 'button button-primary form-button-number-toggle',
                text: '-'
            }
        }
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {

        var scope = this;

        // The Element
        scope.prettyNumber = $(scope.element);

        // The input
        scope.prettyNumberInput = scope.prettyNumber.find(scope.options.prettyInputClass);

        // The label
        scope.prettyNumberLabel = scope.prettyNumber.find(scope.options.prettyLabelClass);

        // Add some classes
        scope.prettyNumberInput.addClass('pretty-numberstyle-input');
        scope.prettyNumberLabel.addClass('pretty-numberstyle-label');

        // Change it to a text input so we don't have to deal with the browser controls, we're taking care of the behaviour
        try {
            
            scope.prettyNumberInput.attr('type', 'text');
            
        } catch (e) {
            
            // IE8 will fail to change the type but that's ok because it doesn't have a default UI to manage...
            
        }

        // Build buttons
        scope.prettyNumberInc = $('<button class="' + scope.options.prettyNumberButtons.inc.className + ' pretty-numberstyle-button inc" type="button">' + scope.options.prettyNumberButtons.inc.text + '</button>').prop('inc', true);
        scope.prettyNumberDec = $('<button class="' + scope.options.prettyNumberButtons.dec.className + ' pretty-numberstyle-button dec" type="button">' + scope.options.prettyNumberButtons.dec.text + '</button>').prop('inc', false);

        // Place the buttons either side of the input
        scope.prettyNumberInput.before(scope.prettyNumberDec);
        scope.prettyNumberInput.after(scope.prettyNumberInc);

        // See if we have min and max defaults
        scope.prettyNumberMin = typeof scope.prettyNumberInput.attr('min') !== 'undefined' ? scope.prettyNumberInput.attr('min') : scope.options.prettyNumberMin;
        scope.prettyNumberMax = typeof scope.prettyNumberInput.attr('max') !== 'undefined' ? scope.prettyNumberInput.attr('max') : scope.options.prettyNumberMax;

        // See if we have a step default
        scope.prettyNumberStep = typeof scope.prettyNumberInput.attr('step') !== 'undefined' ? Number(scope.prettyNumberInput.attr('step')) : Number(scope.options.prettyNumberStep);

        // Listen to toggle events
        scope.toggleEvents(scope);

        // Listen to the input
        scope.inputEvents(scope);

    };

    // Toggle event listeners
    Plugin.prototype.toggleEvents = function (scope, i) {

        // Listen to clicks and mouse down
        scope.prettyNumber.find('.button').on('click mousedown', function (e) {

            // Prevent the default action
            e.preventDefault();

            // Find the direction (-/+)
            var dir = $(this).prop('inc');

            // Get the current value
            var v = scope.prettyNumberInput.val();

            // If this is a click do nothing because it will fire a double update, only update on mouse down
            if (e.type !== 'click') {

                // Set the value once
                scope.setValue(scope, dir, v);

                // Set interval with a delay so we can update repeatedly on mouse hold while mimicking browser behaviour
                var time = scope.options.prettyNumberDelay,
                    interval = function () {

                        // Clear the interval
                        clearInterval(i);

                        // Get the current value
                        var v = scope.prettyNumberInput.val();

                        // Set the value
                        scope.setValue(scope, dir, v);

                        // Adjust the interval after the first run
                        time = time === scope.options.prettyNumberDelay ? scope.options.prettyNumberInterval : time;

                        // Reset the interval with the new time
                        i = setInterval(interval, time);

                    };

                // Set the initial interval
                i = setInterval(interval, time);

            }

            // Listen to mouse up and leave
        }).on('mouseup mouseleave', function () {

            // Clear the interval
            clearInterval(i);

        });

    };

    // Set value
    Plugin.prototype.setValue = function (scope, dir, v) {

        // Make sure we're working with a number and strip leading zero's
        v = parseInt(v, 10);

        // Do the increment/decrement dir === true = up, dir !== true = down
        if (dir) {

            // Increment if < max
            if (v < scope.prettyNumberMax) {
                v += scope.prettyNumberStep;
                v = Math.min(v, scope.prettyNumberMax);
            }

        } else {

            // Decrement if > min
            if (v > scope.prettyNumberMin) {
                v -= scope.prettyNumberStep;
                v = Math.max(v, scope.prettyNumberMin);
            }

        }

        // Make sure we never allow anything but numbers
        if (isNaN(v) || v === '') {

            // Set to min if we have empty value or NaN
            v = scope.prettyNumberMin;

        }

        /*
         * TODO: need to get step rounding working...

         // Round the value according to step
         var rounded = Math.round(v / scope.prettyNumberStep) * scope.prettyNumberStep;

         console.log('val ' + v);
         console.log('rnd ' + rounded);

         */

        // Update the input value
        scope.prettyNumberInput.val(v).trigger('change');

    };

    // Input events
    Plugin.prototype.inputEvents = function (scope, i) {

        // Listen for key down
        scope.prettyNumberInput.on('keydown', function (e) {

            // Get the current value
            var v = parseInt(scope.prettyNumberInput.val());

            // If this is an up or down key we should increment
            scope.keyboardNav(scope, e, v);

            // Listen for click and key up
        }).on('click keyup', function (e) {

            // Get the current value
            var v = scope.prettyNumberInput.val();

            // Enforce numeric input
            if (isNaN(v)) {

                // Not a number so try to extract a number
                v = parseInt(v);

                // If still not a number default to min
                v = isNaN(v) ? scope.prettyNumberMin : v;

                // Update the value if it's not a number
                scope.prettyNumberInput.val(v).trigger('change');

            }

            // Make sure the value is in range
            if (!isNaN(v) && parseInt(v) > scope.prettyNumberMax) {

                // Set to max if it's a number higher than max
                scope.prettyNumberInput.val(scope.prettyNumberMax).trigger('change');

            }

            // Listen for blur
        }).on('blur', function () {

            // Get the current value
            var v = scope.prettyNumberInput.val();

            // Enforce numeric input
            if (v === '') {

                // Update the value if it's not a number
                scope.prettyNumberInput.val(scope.prettyNumberMin).trigger('change');

            }

        });

    };

    // Key up/down...
    Plugin.prototype.keyboardNav = function (scope, e, v, dir) {

        // Get the key code for the current keydown
        var key = (e.keyCode ? e.keyCode : e.which);

        // If it's the up or down key we can set the value
        if (key === 38 || key === 40) {

            // Prevent default action
            e.preventDefault();

            // 38 = up, 40 = down
            dir = key === 38;

            // Set the value
            scope.setValue(scope, dir, v);

        }

    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load',function () {
        $(".pretty-numberstyle").each(function (index, element) {
            $(this).prettyNumberStyle();
        });
    });

})(jQuery, window, document);
;
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-09
 */
/*
Version: 1.4.20
Date:2014-11-14
 */
/*!
 * Plugin Name Query Address Service
 *
 */
;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'queryAddressService', defaults = {

        qasMethod:              'GET',          // AJAX request method
        emptyOnFocus:           true,           // Should the input be emptied on focus?
        qasInputParentClass:    'form-field'    // The class name of the elements surrounding inputs

    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {
        var scope = this;

        // The Input
        scope.qasInput = $(scope.element);

        // The input container
        scope.qasContainer = scope.qasInput.closest('.form-qas-container');

        // The output container
        scope.qasOutput = $('<div/>').addClass('form-qas-output');

        // Append the output container
        scope.qasInput.after(scope.qasOutput);

        // The request URI
        scope.qasRequestURI = typeof scope.qasInput.data('requesturi') !== 'undefined' ? scope.qasInput.data('requesturi') : false;
        scope.qasMonikerURI = typeof scope.qasInput.data('monikeruri') !== 'undefined' ? scope.qasInput.data('monikeruri') : false;

        // If the URI does't exist we can stop now... we can't do any more!
        if (!scope.qasRequestURI) return false;

        // Force auto complete off...
        scope.qasInput.attr('autocomplete', 'off');

        // Create the manual entry element
        scope.qasManual = $('<li/>').append($('<a/>').attr('href', '#').text('Enter manually'));

        // Set up our inputs
        scope.qasInputs = {
            unitNumber: $('*[ng-model=' + scope.qasInput.data('unit-number') + ']'),
            streetNumber: $('*[ng-model=' + scope.qasInput.data('street-number') + ']'),
            streetName: $('*[ng-model=' + scope.qasInput.data('street-name') + ']'),
            streetType: $('*[ng-model=' + scope.qasInput.data('street-type') + ']'),
            suburb: $('*[ng-model=' + scope.qasInput.data('suburb') + ']'),
            state: $('*[ng-model=' + scope.qasInput.data('state') + ']'),
            postcode: $('*[ng-model=' + scope.qasInput.data('postcode') + ']')
        };

        // Hide/Show the inputs
        scope.hideShowInputs(scope, false);

        // Build an address lookup link
        scope.addressLookupLink(scope);

        // Input focus event listener
        scope.focusEvent(scope);

        // Input mouse event listener
        scope.mouseEvent(scope);

        // Input change listener
        scope.watchInput(scope);

    };

    // Hide and show the inputs
    Plugin.prototype.hideShowInputs = function(scope, show) {

        // Set up a simple toggle
        function vis($el) {
            show ? $el.show() : $el.hide();
        }

        // Hide/Show our inputs
        vis(scope.qasInputs.unitNumber.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.streetNumber.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.streetName.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.streetType.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.suburb.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.state.closest('.' + scope.options.qasInputParentClass));
        vis(scope.qasInputs.postcode.closest('.' + scope.options.qasInputParentClass));

    };

    // Update input values
    Plugin.prototype.updateInputVals = function(scope, result) {

        scope.qasInputs.unitNumber.val(result.UnitNumber || '');
        scope.qasInputs.streetNumber.val(result.StreetNumber || '');
        scope.qasInputs.streetName.val(result.StreetName || '');
        scope.qasInputs.streetType.val(result.StreetType || '');
        scope.qasInputs.suburb.val(result.Suburb || '');
        scope.qasInputs.state.val(result.State || '');
        scope.qasInputs.postcode.val(result.Postcode || '');

    };

    // Build a show search link and wire it up
    Plugin.prototype.addressLookupLink = function(scope) {

        // Create a new form field
        scope.qasShowSearchField = $('<div class="' + scope.options.qasInputParentClass + '"/>');

        // Create the link
        scope.qasShowSearch = $('<a href="#">Lookup Address</a>');

        // Append the link to the field
        scope.qasShowSearchField.append(scope.qasShowSearch);

        // Hide the link
        scope.qasShowSearchField.hide();

        // Wire it up
        scope.qasShowSearch.on('click', function(e) {

            // show the container
            scope.qasContainer.show();

            // Hide this
            scope.qasShowSearchField.hide();

            // Deactivate input
            scope.qasInput.removeClass('is-activated');

            // Update the values
            scope.updateInputVals(scope, []);

            // Hide inputs
            scope.hideShowInputs(scope, false);

        });

        // Insert the link
        scope.qasContainer.before(scope.qasShowSearchField);

    };

    // Input focus event listener
    Plugin.prototype.focusEvent = function (scope) {

        scope.qasInput.on('focus', function (e) {

            // Should we empty the field on focus
            !scope.options.emptyOnFocus || $(this).val('');

            $(this).trigger('keyup');

        }).on('blur', function(e) {

            // This kills everything!!!

            //setTimeout(function(){

                //scope.qasInput.val('').trigger('keyup');

            //},100);

        });

    };

    // Input mouse event listener
    Plugin.prototype.mouseEvent = function (scope) {

        scope.qasContainer.on('mouseover', function (e) {

            // Mouse in use
            $(this).removeClass('is-keyboard');

        })
            .on('mouseout', function (e) {

                // Mouse not in use
                scope.qasContainer.find('.is-active').removeClass('is-active');
                $(this).addClass('is-keyboard');

            });

    };

    // Input keyboard event listeners
    Plugin.prototype.watchInput = function (scope) {

        // By default treat the key as any
        scope.isNav = false;

        // On keydown check to see if this is a navigation key (up/down)
        scope.qasInput.on('keydown', function (event) {

            // Check keys
            scope.keyboardNav(scope, event);

        })

            // On keyup we need to request or data and update the input and list
            .on('keyup', function (event) {

                if (scope.isNav !== true) {

                    // The current term
                    var term = $(this).val();

                    // Store the initial value before we update the input...
                    scope.initialValue = term;

                    // Do the request
                    if (term && term != '') {
                        $.ajax({
                            type: scope.options.qasMethod,
                            dataType: 'json',
                            contentType: 'application/json;charset=UTF-8',
                            url: scope.qasRequestURI,
                            data: JSON.stringify({ address: term }),
                            success: function (data) {

                                // Parse the result
                                var result = JSON.parse(data);

                                // Create the output list
                                scope.qasList = $('<ul/>');

                                // Create the result items
                                $.each(result.data, function (index, value) {

                                    // Create item
                                    var $item = $('<li/>');

                                    // Attach event listeners to the item
                                    $item.data('moniker', value.moniker).text(value.text).on('click', function (e) {

                                        scope.qasInput.val(value.text);
                                        scope.qasOutput.empty();

                                        scope.getFormattedAddress(scope, value.moniker);

                                    });

                                    // Append the item to the list
                                    scope.qasList.append($item);

                                    // Add mouse listener to the item
                                    $item.on('mouseover', function (e) {

                                        // Mouse in use
                                        scope.qasContainer.find('.is-active').removeClass('is-active');
                                        $(this).addClass('is-active');

                                    });

                                });

                                // Apply activated class to input
                                scope.qasInput.addClass('is-activated');

                                // Append the manual entry item
                                scope.qasList.append(scope.qasManual);

                                // Listen to clicks on the Manual entry link
                                scope.qasManual.on('click', function (e) {

                                    // No going back from here
                                    scope.qasContainer.hide();

                                    // Show the address lookup link
                                    scope.qasShowSearchField.show();

                                    // Empty the output
                                    scope.qasOutput.empty();

                                    // Deactivate input
                                    scope.qasInput.removeClass('is-activated');

                                    // Show the inputs
                                    scope.hideShowInputs(scope, true);

                                });

                                // Empty the output and re-append the new data
                                scope.qasOutput.empty().append(scope.qasList);

                            }
                        });

                    } else {

                        // Remove activated class from the input
                        scope.qasInput.removeClass('is-activated');

                        // Empty the output
                        scope.qasOutput.empty();
                    }
                }
            });

    };

    // Get formatted address
    Plugin.prototype.getFormattedAddress = function (scope, value) {

        // Do the request
        $.ajax({
            type: scope.options.qasMethod,
            dataType: 'json',
            contentType: 'application/json;charset=UTF-8',
            url: scope.qasMonikerURI,
            data: JSON.stringify({ moniker: value }),
            success: function (data) {

                // Parse the data
                var result = JSON.parse(data);

                if (result) {

                    // Populate the inputs
                    scope.updateInputVals(scope, result);

                    // Remove the search input, no going back from here!
                    scope.qasContainer.hide();

                    // Show the address lookup link
                    scope.qasShowSearchField.show();

                    // Show the inputs
                    scope.hideShowInputs(scope, true);
                }
            }
        });

    };

    // key up/down...
    Plugin.prototype.keyboardNav = function (scope, e) {

        var key = (e.keyCode ? e.keyCode : e.which);

        scope.isNav = false;

        if (key === 38 || key === 40) {

            scope.qasContainer.addClass('is-keyboard');

            // down
            if (key === 40) {
                scope.nextItem(scope);
            }

            // up
            if (key === 38) {
                scope.prevItem(scope);
            }

            // set isNav true...
            scope.isNav = true;

        }

        // enter/return should trigger the same action as a click (mousedown)
        if (key === 13) {

            // Trigger the mousedown event on the selected item
            scope.qasOutput.find('.is-active').trigger('click');

        }
    };

    // move down...
    Plugin.prototype.nextItem = function (scope, first) {

        var $active = scope.qasContainer.find('.is-active');

        if (!$active.length) {
            scope.currentItem = scope.qasList.find('li:first-child');
        } else {
            scope.currentItem = $active.next().length ? $active.next() : scope.qasList.find('li:first-child');
        }

        $active.removeClass('is-active');
        $(scope.currentItem).addClass('is-active');
        scope.updateValue(scope, false);
    };

    // move up...
    Plugin.prototype.prevItem = function (scope) {

        var $active = scope.qasContainer.find('.is-active'),
            reset = false;

        if (!$active.prev().length) {
            reset = true;
            scope.currentItem = undefined;
        } else {
            scope.currentItem = $active.prev();
        }

        if (typeof scope.currentItem !== 'undefined') {
            $active.removeClass('is-active');
            $(scope.currentItem).addClass('is-active');
        }

        // update the value...
        scope.updateValue(scope, reset);

    };

    // update value
    Plugin.prototype.updateValue = function (scope, reset) {
        if (reset === true) {
            // restore the initial value...
            $(scope.input).val(scope.initialValue);
        } else {
            // update the value...
            $(scope.input).val($(scope.currentItem).text());
        }
    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    //$(window).load(function () {
    //    $(".form-qas-input").each(function (index, element) {
    //        $(this).queryAddressService();
    //    });
    //});

})(jQuery, window, document);
;
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-21
 */
/*
Version: 2.1.3
Date:2016-11-09
 */
/*
Version: 1.4.4
Date:2014-10-23
 */
/*!
 * Number Input Replacer
 *
 * Plugin Description
 * Modifies the behaviour of the standard HTML5 number input
 *
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'counter_toggle', defaults = {

    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {
        var scope = this;

        scope.doSomething(scope);
    };

    // Do Something...
    Plugin.prototype.doSomething = function (scope) {

    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load', function () {
        $(".form-input-counter-toggle").each(function (index, element) {
            $(this).counter_toggle();
        });
    });

})(jQuery, window, document);
;
/*!
 * jTabs v1.0.2 (v1.3.14 - Tabs Update).
 */

;
(function ($, window, document, undefined) {

	// Defaults
	var pluginName = 'tabsMenuSimplified', defaults = {
		tabMain: '.jtabs',                  // Main Tabs Element $(this)
		tabInpt: '.jtabs-is-active-id',     // Hidden input used for sending current tab id to the server on post
		tabMenu: '.jtab-menu',              // Mobile Menu
		tabList: '.jtab-list',              // Desktop Content
		tabItem: '.jtab-menu-item',         // Mobile Menu Tab Element
		tabTabs: '.jtab-menu-link',         // Tab Link Container
		tabLink: '.jtab-menu-link-anchor',  // Tab Anchor (<a href="">)
		tabScrl: '.pl11-tabs',              // Nested tab set types that require scrollTop adjustments
		tabCtnr: '.tab-content-container',  // The tab container (the element that has the tab ID)
		desktopBreakpoint: 897              // Breakpoint for desktop screen (same as the CSS @media query)
	};

	// Constructor
	function Plugin(element, options) {

		this.element = element;
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();

	}

	// Initialize...
	Plugin.prototype.init = function () {

		var scope = this;

		// Make the tabs element a little easier to reference
		scope.tabs = $(scope.element);

		// Is this set of tabs nested?
		scope.tabs.is_nested = scope.tabs.parents(scope.options.tabMain).length ? true : false;

		// Check if this tab set should update the scrollTop when nested
		scope.tabs.is_scrollto = !scope.tabs.is_nested || scope.tabs.is(scope.options.tabScrl);

		// Get the hidden input element used to sent current tab id to the server
		scope.tabs.input = scope.tabs.find(scope.options.tabInpt).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Get the mobile tab menu element, filter by depth
		scope.tabs.menu = scope.tabs.find(scope.options.tabMenu).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Get the main tab list (content) element, filter by depth
		scope.tabs.list = scope.tabs.find(scope.options.tabList).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Get the tab links, filter by depth
		scope.tabs.links = scope.tabs.find(scope.options.tabLink).filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		});

		// Check to se if we've manually set the is-active state
		scope.tabs.active = scope.tabs.find('.is-active').filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		}).find(scope.options.tabLink).attr('href');

		// Set up tab click event
		scope.tabMenuEvents(scope);

		// Activate the first tab
		scope.initActiveTab(scope);

		//Restore position of page if a form submit button has been hit and .NET initiates function
		if (typeof WebForm_RestoreScrollPosition !== 'undefined'){
			WebForm_RestoreScrollPosition();
		}


	};

	// Initialize the active tab
	Plugin.prototype.initActiveTab = function (scope) {

		// If there is a target_id Check if it has a match
		var target_id = scope.checkLocationHash(scope);

		// Get the hash of the is-active tab
		target_id = target_id || scope.tabs.active;

		// If there is no hash match set target_id to the first tab in scope unless this is jtabs-pages
		if (!$(scope.element).is('.jtabs-pages')) {
			if (scope.tabs.is_hash_match === false && !scope.tabs.active) {
				target_id = scope.tabs.links.first().attr('href');
			}
		}

		// If there is no target set target_id to the first tab in scope
		target_id = target_id || scope.tabs.links.first().attr('href');

		// Collect toggles and targets
		var collection = scope.collectToggles(scope, target_id);

		// Toggle the active state
		scope.toggleActiveTab(scope, collection.toggles, collection.target);

	};

	// Check the location hash for an existing tab ID
	Plugin.prototype.checkLocationHash = function (scope) {

		// Check if the window contains a hash
		var target_id = window.location.hash;

		// Check if we are linking to an anchor within a tab
		target_id = scope.findAnchors(scope, target_id) || target_id;

		// Check if there is a matching anchor with the same hash
		scope.findMatches(scope, target_id);

		// On load we should avoid scrolling if we have a hash
		// BUG - PL11 - Left Hand tabs
		// http://jira.dt.com.au/browse/TMBSC-487
		// if (scope.tabs.is_desktop) {
		//
		//     // Force no scroll
		//     !scope.tabs.is_hash_match || $(window).scrollTop(0);
		//
		// }

		// Return the target_id
		return target_id;

	};

	// Find anchors within tabs
	Plugin.prototype.findAnchors = function(scope, target_id) {

		// Sanitize the target_id
		var tid = target_id.replace('#', '');

		// If there is a hash
		if ( tid !== '' ) {

			// Get any elements with either a name or id matching the target_id
			scope.tabs.anchors = scope.tabs.find('*[id="' + tid + '"], *[name="' + tid + '"]').filter(function () {

				// As long as they are not part of the tabs interface
				return !$(this).is(scope.options.tabCtnr);

			});

			// Then look for the tab in which the element was found so we can activate it
			target_id = '#' + $(scope.tabs.anchors[0]).closest(scope.options.tabCtnr).attr('id');

			// Return the Hash
			return target_id;

		}

		// Or return nothing
		return false;

	};

	// Find toggles that match the hash
	Plugin.prototype.findMatches = function (scope, target_id) {

		// Collect links with a href that matches the current hash
		var $matches = scope.tabs.find(scope.options.tabLink + '[href="' + target_id + '"]');

		// Define a is_hash_match global that we can access later
		scope.tabs.is_hash_match = $matches.length ? true : false;

	};

	// Set up tab menu events
	Plugin.prototype.tabMenuEvents = function (scope) {

		// Window resize
		$(window).on('resize', function () {

			// Update is_desktop global
			scope.tabs.is_desktop = scope.isDesktop(scope);

			// Handle hash change
			scope.desktopHashChangeHandler(scope);

		}).trigger('resize');

		// Listen to click on all tab links
		scope.tabs.links.on('click', function (event) {

			// handle page tabs which send a url and an id
			// href="product-family-new-menu1/#menu-item-1"
			if ($(scope.element).is('.jtabs-pages')) {
				console.log('go');
				window.location.href = $(this).attr('href');
			}

			var menuTop = ($('.jtab-menu').offset().top)-($(window).scrollTop()); //get the offset top of the element

			//Get the current vertical  position on the page
			var currentPosition = $(document).scrollTop();

			// Get the target ID
			var target_id = $(this).attr('href');

			var animationTime = 300;

			// If we've activated a nested tab we don't want to update the hash
			if (scope.tabs.is_nested) {
				// Prevent default action
				event.preventDefault();

				// Update the is-active states
				scope.refreshToggles(scope, target_id);

				// Update Scroll Top if we're not on desktop
				scope.tabs.is_desktop || (!scope.tabs.is_scrollto || $(window).scrollTop($(this).offset().top));
			} else {

				if (target_id.indexOf("#") == -1) {
					var $isActive = $(this).closest('.menu-item.is-active');
					var $isDeactive = $(this).closest('.menu-item.is-deactive');
					if ($isActive.length) {
						// deactive
						if (!scope.tabs.is_desktop) {
							$isActive.removeClass("is-active");
							$isActive.addClass("is-deactive");
						}
						event.preventDefault();
					}
					if ($isDeactive.length) {
						// deactive
						if (!scope.tabs.is_desktop) {
							$isDeactive.addClass("is-active");
							$isDeactive.removeClass("is-deactive");
						}
						event.preventDefault();
					}
					return;
				}

				// If we're on desktop and we're not nested, we want to update the location.hash without scrolling
				if (scope.tabs.is_desktop) {

					// Get the window top
					// BUG - PL11 - Left Hand tabs
					// http://jira.dt.com.au/browse/TMBSC-487
					//var top = $(window).scrollTop();
					var top = scope.tabs.offset().top;

					// handle page tabs which send a url and an id
					// href="product-family-new-menu1/#menu-item-1"
					if (target_id.charAt(0) === "#") {

						// Update the window.location.hash
						window.location.hash = target_id.replace('#', '');

						event.preventDefault();
					}

					// What happens now is a bit of a back and forth in that
					// Page goes to anchor tag then immediately goes back to original
					//position on the page, then over animationTime amount of miliseconds
					//scrolls back to element positon including offset height
					if(menuTop > 1) {

						$(window).scrollTop(currentPosition);

						setTimeout(function () {
							$('html,body').animate({
								scrollTop: top
							}, animationTime);
						}, 10);
					}
					else {

						$(window).scrollTop(top);
					}


				} else {

					// handle page tabs which send a url and an id
					// href="product-family-new-menu1/#menu-item-1"
					if (target_id.charAt(0) === "#") {

						// Update the window.location.hash
						window.location.hash = target_id.replace('#', '');

						event.preventDefault();
					}

					setTimeout(function(){
						$('html, body').animate({
							scrollTop: $("#" + target_id.split("#")[1]).offset().top
						}, 500);
					},10);

					// Update the is-active states
					scope.refreshToggles(scope, target_id);

				}

			}

		});

	};

	// Viewport Dimensions for CSS breakpoint Sync
	Plugin.prototype.viewport = function () {

		// http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript

		var e = window,
			a = 'inner';

		if (!('innerWidth' in window )) {

			a = 'client';
			e = document.documentElement || document.body;

		}

		// Return the viewport width that matches CSS @media queries
		return { width: e[ a + 'Width' ], height: e[ a + 'Height' ] };

	};

	// Check for desktop
	Plugin.prototype.isDesktop = function (scope) {

		// Return true/false based on screen width
		return (scope.viewport().width >= scope.options.desktopBreakpoint);

	};

	// Manual hash change handler for desktop only
	Plugin.prototype.desktopHashChangeHandler = function (scope) {

		// Handle the change
		$(window).on('hashchange', function (e) {

			// If we've clicked on an anchor we need to update the target tab, otherwise just send the hash
			var target_id = scope.findAnchors(scope, window.location.hash) || window.location.hash;

			// Update the is-active states on desktop, do nothing for mobile
			!scope.tabs.is_desktop || scope.refreshToggles(scope, target_id);

		});

	};

	// Refresh toggle states
	Plugin.prototype.refreshToggles = function (scope, target_id) {

		// Check if there is a matching anchor with the same hash
		scope.findMatches(scope, target_id);

		// Collect toggles and targets
		var collection = scope.collectToggles(scope, target_id);

		// page tabs
		if (target_id.charAt(0) === "#") {
			// Toggle the active state
			scope.toggleActiveTab(scope, collection.toggles, collection.target);
		}else{
			// Toggle the active state
			scope.toggleActivePageTab(scope, collection.toggles, collection.target);
		}

	};

	// Build a collection of associated toggles and their target element
	Plugin.prototype.collectToggles = function (scope, target_id) {

		// Get the target element
		var $target = $("#" + target_id.split("#")[1]);

		// Bind the tab menu link to the tab list link
		var $toggles = scope.tabs.find(scope.options.tabLink + '[href="' + target_id + '"]');

		// Return our collection object
		return {
			"toggles": $toggles,
			"target": $target
		}

	};

	// Toggle active state
	Plugin.prototype.toggleActiveTab = function (scope, $toggles, $target) {

		// Remove active states, filter by depth
		!scope.tabs.is_hash_match || scope.tabs.find('.jtab-menu-item.is-active').filter(function () {
			return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
		}).removeClass('is-active');

		// Apply is active state to the required elements
		$toggles.closest(scope.options.tabItem).addClass('is-active');

		// If the current tab is clicked
		if ($target.attr('id') === scope.tabs.input.val()) {

			// And we're in the mobile device layout
			if (!scope.tabs.is_desktop) {

				// Deactivate the tab
				scope.tabs.find('.jtab-menu-item.is-active').filter(function () {
					return $(this).closest(scope.options.tabMain)[0] === scope.tabs[0];
				}).removeClass('is-active');

				// Update the hidden input used to send the current tab id to the server on post
				scope.tabs.input.val('');
			}

		} else {

			// Update the hidden input used to send the current tab id to the server on post
			scope.tabs.input.val($target.attr('id'));

		}

		// Get the current target
		var $innerTarget = $('*:target');

		// If it's not a tab
		if (typeof $innerTarget.offset() !== 'undefined' && !$innerTarget.is(scope.options.tabCtnr)) {

			// Scroll to it
			$(window).scrollTop($innerTarget.offset().top);
			setTimeout(function(){
				$(window).scrollTop($innerTarget.offset().top);
			}, 1);

		}

		// if pages tab navigation and on mobile the scroll to tab
		if (scope.tabs.hasClass("jtabs-pages")) {
			setTimeout(function(){
				$innerTarget = $('*:target');
				if ($innerTarget.length && scope.tabs.find(".pl11-tabs-nav").is(':hidden')){
		            $(window).scrollTop($innerTarget.offset().top);
		            $innerTarget.parents(".jtab-menu-item").addClass("is-active");
		        }

		        // if page tabs and we have the pl14 list with icon module (pl14-list-with-icons) previous then we activate the list item that matches the url path
		        // there are 2 matching scenarios, 1 will be an actual page match and another will be a parent match
		        var pl14ModulesPrevious = scope.tabs.prevAll(".pl14-list-with-icons");
	        	if (pl14ModulesPrevious.length) {
	        		var origin = window.location.origin,
	        			pathname = window.location.pathname,
		        		$el,
		        		href,
		        		wholeUrlMatch = false;
		        	// check if matching with whole url
	        		$(pl14ModulesPrevious[0]).find("a").each(function(i, v) {
		        		$el = $(v);
		        		href = $(v).attr("href");
		        		// normalise (strip origin http://www.tmbank.com.au)
						href = href.replace(origin, "");
		        		if (href !== "" && href === pathname) {
		        			$el.addClass("is-active");
		        			wholeUrlMatch = true;
		        		}
		        	});
		        	// check if matching with parent url
		        	if (!wholeUrlMatch) {
		        		$(pl14ModulesPrevious[0]).find("a").each(function(i, v) {
			        		$el = $(v);
			        		href = $(v).attr("href");
			        		// normalise (strip origin http://www.tmbank.com.au)
							href = href.replace(origin, "");
			        		var currentSection = href.substr(0, href.lastIndexOf("/"));
			        		var currentLocationSection = pathname.substr(0, pathname.lastIndexOf("/"));
			        		if (currentSection !== ""  && currentSection === currentLocationSection) {
			        			$el.addClass("is-active");
			        		}
			        	});
		        	}
	        	}
			}, 1);
		}

	};

	// Toggle active state for page tabs
	Plugin.prototype.toggleActivePageTab = function (scope, $toggles, $target) {

		// If the current tab is clicked
		if ($target.attr('id') === scope.tabs.input.val()) {

			$toggles.closest(scope.options.tabItem).toggleClass('is-active');

		}else{
			return;
		}

		//$toggles.closest(scope.options.tabItem).addClass('is-active');
	  
		// Get the current target
		var $innerTarget = $('*:target');

		// If it's not a tab
		if (typeof $innerTarget.offset() !== 'undefined' && !$innerTarget.is(scope.options.tabCtnr)) {

			// Scroll to it
			$(window).scrollTop($innerTarget.offset().top);
			setTimeout(function(){
				$(window).scrollTop($innerTarget.offset().top);
			}, 1);

		}

	};

	// Constructor Wrapper
	$.fn[pluginName] = function (options) {

		return this.each(function () {
			if (!$.data(this, 'plugin_' + pluginName)) {
				$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
			}
		});

	};

	// Init
	$(window).on('load', function () {

		// Only initialize for the pl11 & pl03 module based tabs
		$(".jtabs").each(function (index, element) {
			$(this).tabsMenuSimplified();
		});

	});

})(jQuery, window, document);
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 * Help Centre View More Jquery Plugin
 *
 * Manages hiding more that the set number of questions on mobile and showing them
 * Also expand and collapse on mobile
 */

;(function ( $, window, document, undefined ) {

    // Create the defaults once
    var pluginName = 'helpCentreViewMore',
        defaults = {
            sel_question_items : "li", // question item
            sel_mobile_count: "help-centre-mobile-count",
            sel_add_class_to_more: "help-centre-add-class",
            sel_view_more: ".help-centre-view-more-link",
            sel_mobile_expand: ".help-centre-expand",
            sel_show_content_on_desktop: "help-centre-show-content-on-desktop",
            sel_allow_expanding: "help-centre-allow-expanding",
            collapsedClass: "is-collapsed-mobile"
        };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = element;
        this.options = $.extend( {}, defaults, options) ;
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {
        var scope = this;
        // Reference the element once only
		scope.options.element = $(scope.element);

        var $el = $(scope.options.element);
        scope.addClassToMore = $el.data(scope.options.sel_add_class_to_more) || "hide";
		scope.popularMobileCount = $el.data(scope.options.sel_mobile_count) || 5;
		scope.allowExpanding = $el.data(scope.options.sel_allow_expanding) || false;

        // all questions
		scope.questions = $el.find(scope.options.sel_question_items);

        // if more questions than counter ("data-help-centre-mobile-count") then hide those
        if (scope.questions.length > scope.popularMobileCount) {
        	this.initQuestionsViewPopular(scope);
        }

        //init events
        scope.setupEvents(scope);

    };

    Plugin.prototype.initQuestionsViewPopular = function (scope) {
    	var $el = $(scope.options.element);
    	$.each(scope.questions, function(i, v){
    		if (i >= scope.popularMobileCount) {
    			$(v).addClass(scope.addClassToMore);
    		}
    	});
    }

    Plugin.prototype.setupEvents = function (scope) {
    	var $el = $(scope.options.element);

    	if (scope.allowExpanding) {
    		//view more (expand other items)
    		var $viewMore = $el.find(scope.options.sel_view_more);
    		$viewMore.on("click", function(){
    			$(this).removeClass("show-for-small-only").hide();
    			scope.questions.removeClass(scope.addClassToMore);
    		});
    	}


    	// expand mobile
    	var showOnDesktop = $el.hasClass(scope.options.sel_show_content_on_desktop);
    	var $expandLink = $el.find(scope.options.sel_mobile_expand);
    	$expandLink.on("click", function(e){
    		if ($(window).width() < 689 || !showOnDesktop) {
    			if ($el.hasClass(scope.options.collapsedClass)) {
	    			$el.removeClass(scope.options.collapsedClass);
	    		}else{
	    			$el.addClass(scope.options.collapsedClass);
	    		}
	    		e.preventDefault();
	    		e.stopPropagation();
    		}
    	});
    }


    /*****************************/

    // A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).ready(function() {
        //init on page automatically
        $(".help-centre-view-more").helpCentreViewMore();
    });


})( jQuery, window, document );
;
/*!
 * jQuery lightweight plugin boilerplate
 * Original author: @ajpiano
 * Further changes, comments: @addyosmani
 * Licensed under the MIT license
 *
 * ..............................................................................
 *
 *
 *
 * Dependencies:
 * jquery.autocomplete.min.js - https://github.com/devbridge/jQuery-Autocomplete
 *
 */

;(function ($, window, document, undefined) {
    var pluginName = 'fieldAutocomplete', defaults = {

    autocompleteOptions:   {
        serviceUrl: false,
        maxHeight: 300,
        noSuggestionNotice: "No results"
    }
    };

    // The actual plugin constructor
    function Plugin( element, options ) {
        this.element = $(element);
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    Plugin.prototype.init = function () {

        var scope = this;

        // The input element
        scope.autocompleteInput = $(scope.element);

        // Save request Uri
        scope.requestUri = scope.autocompleteInput.attr('data-request-uri') || false;
        scope.options.autocompleteOptions.serviceUrl = scope.requestUri;

        // Save no suggestions text
        scope.options.autocompleteOptions.noSuggestionNotice = scope.autocompleteInput.attr('data-noresults-text') || scope.options.autocompleteOptions.noSuggestionNotice;

        // Setup onSelect action
        scope.options.autocompleteOptions.onSelect = function (suggestion) {
            scope.autocompleteInput.val(suggestion.value).trigger('input');
        };

        // Initialize jquery.autocomplete.min.js with options
        scope.autocompleteInput.autocomplete(scope.options.autocompleteOptions);

    };



    // Constructor Wrapper
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    // Init
    // Removed - Initialised with Angular
    // $(window).on('load',function() {
    //     $(".form-field-autocomplete > .form-input").each(function (index, element) {
    //         $(this).fieldAutocomplete();
    //     });
    // });

})(jQuery, window, document);;
/*!
 * Table Sticky Bits (header/left column)
 */

;
(function ($, window, document, undefined) {

    // Defaults
    var pluginName = 'tableStickyBits', defaults = {
        tableStickyHeader: true,
        tableStickyColumn: true,
        tableStickyScrollX: false, // TODO: build a better scrollbar for this...
        tableMinColumns: 3
    };

    // Constructor
    function Plugin(element, options) {
        this.element = element;
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = pluginName;
        this.init();
    }

    // Initialize...
    Plugin.prototype.init = function () {
        var scope = this;
        if ($(scope.element).find('thead').length > 0 && $(scope.element).find('th').length > 0) {
            scope.setUpStickyBits(scope);
        }
    };

    // Set up the Sticky Bits
    Plugin.prototype.setUpStickyBits = function (scope) {
        scope.options.table = $(scope.element);
        scope.options.header = scope.options.table.find('thead').clone();
        scope.options.column = scope.options.table.find('thead, tbody').clone();
        scope.options.container = scope.options.table.closest('.table-sticky-bits-container');

        // Get the top left cell, we'll need its dimensions later
        scope.options.topLeft = scope.options.table.find('tr:eq(0) th:eq(0)');

        // Not yet ready to build header and column
        scope.options.headerReady = false;
        scope.options.columnReady = false;

        // Set up Header and Column components if required
        !scope.options.tableStickyColumn || scope.setUpColumn(scope);
        !scope.options.tableStickyHeader || scope.setUpHeader(scope);

        scope.buildStickyBits(scope);
    };

    // Set up Header
    Plugin.prototype.setUpHeader = function (scope) {

        // Build Header Clone & Wrapper
        scope.options.stH = $('<table class="table-sticky-bits-header" />');
        scope.options.stHw = $('<div class="table-sticky-bits-header-wrapper" />');

        scope.options.headerReady = true;
    };

    // Set up Column
    Plugin.prototype.setUpColumn = function (scope) {

        // Build Column Clone & Wrapper
        scope.options.stC = $('<table class="table-sticky-bits-column" />');
        scope.options.stCw = $('<div class="table-sticky-bits-column-wrapper" />');

        // Build Intersect Element & Wrapper
        scope.options.stI = $('<table class="table-sticky-bits-intersect" />');
        scope.options.stI.append(scope.options.intersect);
        scope.options.stIw = $('<div class="table-sticky-bits-intersect-wrapper" />');

        scope.options.columnReady = true;
    };

    // Build Sticky Bits
    Plugin.prototype.buildStickyBits = function (scope) {

        // Wrap the table
        scope.options.table.wrap('<div class="table-sticky-bits-wrapper" />');
        scope.options.stW = scope.options.table.parent('.table-sticky-bits-wrapper');

        !scope.options.columnReady || scope.buildColumn(scope);
        !scope.options.headerReady || scope.buildHeader(scope);


        // Place the Sticky Column & Intersect after the Sticky Table Wrapper
        if (scope.options.columnReady === true) {
            // order is important here
            scope.options.container.append(scope.options.stIw);
            scope.options.container.append(scope.options.stCw);
        }

        // Place the Sticky Table Header after the Sticky Table Wrapper
        if (scope.options.headerReady === true) {
            // order is important here
            scope.options.container.append(scope.options.stHw);
        }

        // Set up Scrollbar X if required
        if (scope.options.tableStickyScrollX && scope.options.columnReady) {
            scope.setUpScrollbar(scope);
        }

        // Init apply buttons
        scope.applyButton(scope);

        // Start watching events
        scope.stickyEvents(scope);

    };

    // Init apply buttons
    Plugin.prototype.applyButton = function(scope) {

        // Some seriously funky binding needed here due to the cloned header
        scope.options.header.find(".pl57-apply").each( function(el) {
            var $button_apply = $(this).find('.button-apply');
            var id = '#' + $button_apply.attr('id');

            $button_apply.on('click', function(e) {
                e.preventDefault();
                $(id).trigger('click');
            });

        }).applyButton();

    };

    Plugin.prototype.stickyEvents = function(scope) {

        // Remove selected columns
        $('.table-sticky-bits-remove-column').on('click', function(event) {
            event.preventDefault();
            scope.removeColumn(scope, event);
        });

        // Toggle sections
        $('.table-sticky-bits-toggle-rows').find('th:eq(0)').on('click', function(event) {
            event.preventDefault();
            scope.toggleSection(scope, event)
        });

        // Watch Scrolling on the table wrapper
        //if (scope.options.tableStickyScrollX === true) {
            scope.options.table.parent('.table-sticky-bits-wrapper').scroll(function () {
                !scope.options.headerReady || scope.repositionStickyHeader(scope);
                !scope.options.columnReady || scope.repositionStickyColumn(scope);
            });
        //}

        // Watch the window
        $(window).resize(function () {
            scope.adjustDimensions(scope);
            !scope.options.headerReady || scope.repositionStickyHeader(scope);
            !scope.options.columnReady || scope.repositionStickyColumn(scope);
        })
        .scroll(function () {
            !scope.options.headerReady || scope.repositionStickyHeader(scope);
            !scope.options.columnReady || scope.repositionStickyColumn(scope);
        })
        .trigger('resize');

        // Set widths
        //scope.adjustDimensions(scope);

    };

    // Build Header
    Plugin.prototype.buildHeader = function(scope) {

        // Append the Cloned Header to it's table and append the table to it's Wrapper
        scope.options.stHw.append(scope.options.stH.append(scope.options.header));

    };

    // Build Column
    Plugin.prototype.buildColumn = function(scope) {
        // Append the Column wrapper to the table Wrapper
        scope.options.stC.append(scope.options.column)
            .find('thead th:gt(0)').css({visibility: 'hidden'})
            .end()
            .find('tbody td').css({visibility: 'hidden'});

        // Append the Cloned Column to it's Wrapper
        scope.options.stCw.append(scope.options.stC);

        // Append the Intersecting Cell (top left corner cell) to the Sticky Column
        //scope.options.stIw.append(scope.options.stI);
        scope.options.stIw.append(scope.options.stI.html('<thead><tr><th>' + scope.options.topLeft.html() + '</th></tr></thead>'));

    };

    // Set up Scrollbar
    Plugin.prototype.setUpScrollbar = function(scope) {
        // If we need scrollbars we should custom build a sticky footer scroll solution with a div and scroller

        /*
        // This has been removed.
        // at the moment we're using perfect scrollbar...
        scope.options.stW.perfectScrollbar({
            suppressScrollY: true
        });
        */
    };

    // Reposition Header
    Plugin.prototype.repositionStickyHeader = function(scope) {

        var winBot = $(window).scrollTop() + $(window).height(),
            header = scope.options.stH.outerHeight() + 10,
            tabTop = scope.options.table.offset().top + header,
            tabBot = tabTop + (scope.options.table.outerHeight() - header);


        // move to scroll bar function
        if (tabBot > winBot && tabTop < winBot) {
            $('.table-sticky-bits-wrapper').addClass('is-scrollbar-fixed');
        } else {
            $('.table-sticky-bits-wrapper').removeClass('is-scrollbar-fixed');
        }

        var lOffset = scope.options.table.position().left;

        if ($(window).scrollTop() > scope.options.table.offset().top && $(window).scrollTop() < ( tabBot - header*2 )) {

            scope.options.container.addClass('is-header-fixed').removeClass('is-header-abs');

            scope.options.stH.css({
                left: lOffset
            });

        } else {

            if ($(window).scrollTop() < tabBot) {

                scope.options.container.addClass('is-header-abs').removeClass('is-header-fixed');

                // if the table fits inside the window we don't need to position the header
                if (scope.options.table.outerHeight() < winBot && $(window).scrollTop() < tabTop ) {
                    scope.options.container.removeClass('is-header-abs');
                }

                scope.options.stH.css({
                    left: (scope.options.container.width() < scope.options.table.outerWidth()) ? lOffset : 'auto'
                });

                scope.options.stHw.css({
                    bottom: header + 14
                });

                scope.options.stI.css({
                    bottom: header + 14 + 10
                });

            } else {

                scope.options.container.removeClass('is-header-fixed is-header-abs');

            }
        }
    };

    // Reposition Column
    Plugin.prototype.repositionStickyColumn = function(scope) {
        if (scope.options.container.width() < scope.options.table.outerWidth()) {
            scope.options.container.addClass('is-column-fixed');
        } else {
            scope.options.container.removeClass('is-column-fixed');
        }
    };

    // Adjust Dimensions
    Plugin.prototype.adjustDimensions = function(scope) {

        // Set the width's and heights of the cells, this is fine if we weren't responsive
        // FIXME: but it doesn't work as intended on a responsive page!
        scope.options.table.find('thead th')
            .each(function (i) {
                scope.options.stH.find('th').eq(i).width($(this).width());
            })
            .end()
            .find('tr').each(function (i) {
                // scope.options.stC.find('tr').eq(i).height($(this).height());
                // scope.options.stI.find('tr').eq(i).height($(this).height());
            });

        // Set height of Sticky Header Wrapper
        scope.options.stHw.css({
            height: scope.options.header.height() + 10,
            width: scope.options.container.width(),
            left: scope.options.container.offset().left
        });

        // Set width of sticky table head
        // scope.options.stH.width(scope.options.table.width());

        // Set width of sticky table col
        scope.options.stCw.width(scope.options.topLeft.outerWidth());

        // set the intersect height
        scope.options.stI.css({
                height: scope.options.header.height(),
                width: scope.options.topLeft.outerWidth() + 5,
                left: scope.options.container.offset().left
            })
            .find('th:eq(0)')
            .css({
                height: scope.options.header.height(),
                width: scope.options.topLeft.outerWidth()
            })
    };

    // Remove Column
    Plugin.prototype.removeColumn = function(scope, event) {
        // Get the index of the column we clicked in
        var idx = $(event.target).closest('th').index(),
            rmv = $(event.target).closest('tr').find('.table-sticky-bits-remove-column');

        // Then run through the table and remove the unwanted cells
        scope.options.container.find("table tr").each(function (index) {

            // on the first iteration look for the number of columns left
            if (index < 1) {

                // if there is less than the min columns to show, remove the remove buttons
                if (rmv.length <= scope.options.tableMinColumns) {
                    rmv.remove();
                    $( '.pl53-comparison-table-column-title' ).css( "padding-top", "1.5em" );
                }
            }

            // remove the column
            $(this).find("td, th").eq(idx).remove();

        });

        // Trigger window resize to adjust the table if needed
        $(window).trigger('resize');
    };

    // Toggle Sections
    Plugin.prototype.toggleSection = function(scope, event) {
        // Get the index of the tbody we're toggling
        // NOTE: we're not toggling thead but we need to include it in the search so our indexes match up
        var idx = $(event.target).closest('thead, tbody').index();

        // Then run through the table and hide the selected tbody
        scope.options.container.find('table').each( function() {
            $(this).find('thead, tbody').eq(idx).toggleClass('is-section-hidden');
        });

        // Trigger window resize to adjust the table if needed
        $(window).trigger('resize');
    };

    // Constructor Wrapper
    $.fn[pluginName] = function (options) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName, new Plugin(this, options));
            }
        });
    };

    // Init
    $(window).on('load', function () {
        $('.table-sticky-bits').tableStickyBits();
    });

})(jQuery, window, document);
;
//! moment.js
//! version : 2.30.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : e.moment = t() }(this, function () {
	"use strict"; function e() { return G.apply(null, arguments) } function t(e) { G = e } function n(e) { return e instanceof Array || "[object Array]" === Object.prototype.toString.call(e) } function s(e) { return null != e && "[object Object]" === Object.prototype.toString.call(e) } function i(e, t) { return Object.prototype.hasOwnProperty.call(e, t) } function r(e) { var t; if (Object.getOwnPropertyNames) return 0 === Object.getOwnPropertyNames(e).length; for (t in e) if (i(e, t)) return !1; return !0 } function a(e) { return void 0 === e } function o(e) { return "number" == typeof e || "[object Number]" === Object.prototype.toString.call(e) } function u(e) { return e instanceof Date || "[object Date]" === Object.prototype.toString.call(e) } function l(e, t) { var n, s = [], i = e.length; for (n = 0; n < i; ++n)s.push(t(e[n], n)); return s } function d(e, t) { for (var n in t) i(t, n) && (e[n] = t[n]); return i(t, "toString") && (e.toString = t.toString), i(t, "valueOf") && (e.valueOf = t.valueOf), e } function h(e, t, n, s) { return t8(e, t, n, s, !0).utc() } function c(e) { return null == e._pf && (e._pf = { empty: !1, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: !1, invalidEra: null, invalidMonth: null, invalidFormat: !1, userInvalidated: !1, iso: !1, parsedDateParts: [], era: null, meridiem: null, rfc2822: !1, weekdayMismatch: !1 }), e._pf } function f(e) { var t = null, n = !1, s = e._d && !isNaN(e._d.getTime()); return (s && (t = c(e), n = A.call(t.parsedDateParts, function (e) { return null != e }), s = t.overflow < 0 && !t.empty && !t.invalidEra && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n), e._strict && (s = s && 0 === t.charsLeftOver && 0 === t.unusedTokens.length && void 0 === t.bigHour)), null != Object.isFrozen && Object.isFrozen(e)) ? s : (e._isValid = s, e._isValid) } function m(e) { var t = h(NaN); return null != e ? d(c(t), e) : c(t).userInvalidated = !0, t } A = Array.prototype.some ? Array.prototype.some : function (e) { var t, n = Object(this), s = n.length >>> 0; for (t = 0; t < s; t++)if (t in n && e.call(this, n[t], t, n)) return !0; return !1 }; var $, y, g = e.momentProperties = [], _ = !1; function w(e, t) { var n, s, i, r = g.length; if (a(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), a(t._i) || (e._i = t._i), a(t._f) || (e._f = t._f), a(t._l) || (e._l = t._l), a(t._strict) || (e._strict = t._strict), a(t._tzm) || (e._tzm = t._tzm), a(t._isUTC) || (e._isUTC = t._isUTC), a(t._offset) || (e._offset = t._offset), a(t._pf) || (e._pf = c(t)), a(t._locale) || (e._locale = t._locale), r > 0) for (n = 0; n < r; n++)a(i = t[s = g[n]]) || (e[s] = i); return e } function v(t) { w(this, t), this._d = new Date(null != t._d ? t._d.getTime() : NaN), this.isValid() || (this._d = new Date(NaN)), !1 === _ && (_ = !0, e.updateOffset(this), _ = !1) } function k(e) { return e instanceof v || null != e && null != e._isAMomentObject } function p(t) { !1 === e.suppressDeprecationWarnings && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + t) } function Y(t, n) { var s = !0; return d(function () { if (null != e.deprecationHandler && e.deprecationHandler(null, t), s) { var r, a, o, u = [], l = arguments.length; for (a = 0; a < l; a++) { if (r = "", "object" == typeof arguments[a]) { for (o in r += "\n[" + a + "] ", arguments[0]) i(arguments[0], o) && (r += o + ": " + arguments[0][o] + ", "); r = r.slice(0, -2) } else r = arguments[a]; u.push(r) } p(t + "\nArguments: " + Array.prototype.slice.call(u).join("") + "\n" + Error().stack), s = !1 } return n.apply(this, arguments) }, n) } var M = {}; function S(t, n) { null != e.deprecationHandler && e.deprecationHandler(t, n), M[t] || (p(n), M[t] = !0) } function D(e) { return "undefined" != typeof Function && e instanceof Function || "[object Function]" === Object.prototype.toString.call(e) } function O(e, t) { var n, r = d({}, e); for (n in t) i(t, n) && (s(e[n]) && s(t[n]) ? (r[n] = {}, d(r[n], e[n]), d(r[n], t[n])) : null != t[n] ? r[n] = t[n] : delete r[n]); for (n in e) i(e, n) && !i(t, n) && s(e[n]) && (r[n] = d({}, r[n])); return r } function T(e) { null != e && this.set(e) } function b(e, t, n) { var s = "" + Math.abs(e); return (e >= 0 ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, t - s.length)).toString().substr(1) + s } e.suppressDeprecationWarnings = !1, e.deprecationHandler = null, I = Object.keys ? Object.keys : function (e) { var t, n = []; for (t in e) i(e, t) && n.push(t); return n }; var x = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, W = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, P = {}, C = {}; function N(e, t, n, s) { var i = s; "string" == typeof s && (i = function () { return this[s]() }), e && (C[e] = i), t && (C[t[0]] = function () { return b(i.apply(this, arguments), t[1], t[2]) }), n && (C[n] = function () { return this.localeData().ordinal(i.apply(this, arguments), e) }) } function U(e) { return e.match(/\[[\s\S]/) ? e.replace(/^\[|\]$/g, "") : e.replace(/\\/g, "") } function H(e, t) { return e.isValid() ? (P[t = R(t, e.localeData())] = P[t] || function e(t) { var n, s, i = t.match(x); for (n = 0, s = i.length; n < s; n++)C[i[n]] ? i[n] = C[i[n]] : i[n] = U(i[n]); return function (e) { var n, r = ""; for (n = 0; n < s; n++)r += D(i[n]) ? i[n].call(e, t) : i[n]; return r } }(t), P[t](e)) : e.localeData().invalidDate() } function R(e, t) { var n = 5; function s(e) { return t.longDateFormat(e) || e } for (W.lastIndex = 0; n >= 0 && W.test(e);)e = e.replace(W, s), W.lastIndex = 0, n -= 1; return e } var F = { D: "date", dates: "date", date: "date", d: "day", days: "day", day: "day", e: "weekday", weekdays: "weekday", weekday: "weekday", E: "isoWeekday", isoweekdays: "isoWeekday", isoweekday: "isoWeekday", DDD: "dayOfYear", dayofyears: "dayOfYear", dayofyear: "dayOfYear", h: "hour", hours: "hour", hour: "hour", ms: "millisecond", milliseconds: "millisecond", millisecond: "millisecond", m: "minute", minutes: "minute", minute: "minute", M: "month", months: "month", month: "month", Q: "quarter", quarters: "quarter", quarter: "quarter", s: "second", seconds: "second", second: "second", gg: "weekYear", weekyears: "weekYear", weekyear: "weekYear", GG: "isoWeekYear", isoweekyears: "isoWeekYear", isoweekyear: "isoWeekYear", w: "week", weeks: "week", week: "week", W: "isoWeek", isoweeks: "isoWeek", isoweek: "isoWeek", y: "year", years: "year", year: "year" }; function L(e) { return "string" == typeof e ? F[e] || F[e.toLowerCase()] : void 0 } function V(e) { var t, n, s = {}; for (n in e) i(e, n) && (t = L(n)) && (s[t] = e[n]); return s } var G, A, I, E, j = { date: 9, day: 11, weekday: 11, isoWeekday: 11, dayOfYear: 4, hour: 13, millisecond: 16, minute: 14, month: 8, quarter: 7, second: 15, weekYear: 1, isoWeekYear: 1, week: 5, isoWeek: 5, year: 1 }, Z = /\d/, z = /\d\d/, q = /\d{3}/, B = /\d{4}/, J = /[+-]?\d{6}/, Q = /\d\d?/, X = /\d\d\d\d?/, K = /\d\d\d\d\d\d?/, ee = /\d{1,3}/, et = /\d{1,4}/, en = /[+-]?\d{1,6}/, es = /\d+/, ei = /[+-]?\d+/, er = /Z|[+-]\d\d:?\d\d/gi, ea = /Z|[+-]\d\d(?::?\d\d)?/gi, eo = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, eu = /^[1-9]\d?/, el = /^([1-9]\d|\d)/; function ed(e, t, n) { E[e] = D(t) ? t : function (e, s) { return e && n ? n : t } } function eh(e, t) { var n; return i(E, e) ? E[e](t._strict, t._locale) : RegExp((n = e, ec(n.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (e, t, n, s, i) { return t || n || s || i })))) } function ec(e) { return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") } function ef(e) { return e < 0 ? Math.ceil(e) || 0 : Math.floor(e) } function em(e) { var t = +e, n = 0; return 0 !== t && isFinite(t) && (n = ef(t)), n } E = {}; var e$ = {}; function e8(e, t) { var n, s, i = t; for ("string" == typeof e && (e = [e]), o(t) && (i = function (e, n) { n[t] = em(e) }), s = e.length, n = 0; n < s; n++)e$[e[n]] = i } function ey(e, t) { e8(e, function (e, n, s, i) { s._w = s._w || {}, t(e, s._w, s, i) }) } function eg(e, t, n) { null != t && i(e$, e) && e$[e](t, n._a, n, e) } function e_(e) { return e % 4 == 0 && e % 100 != 0 || e % 400 == 0 } function ew(e) { return e_(e) ? 366 : 365 } N("Y", 0, 0, function () { var e = this.year(); return e <= 9999 ? b(e, 4) : "+" + e }), N(0, ["YY", 2], 0, function () { return this.year() % 100 }), N(0, ["YYYY", 4], 0, "year"), N(0, ["YYYYY", 5], 0, "year"), N(0, ["YYYYYY", 6, !0], 0, "year"), ed("Y", ei), ed("YY", Q, z), ed("YYYY", et, B), ed("YYYYY", en, J), ed("YYYYYY", en, J), e8(["YYYYY", "YYYYYY"], 0), e8("YYYY", function (t, n) { n[0] = 2 === t.length ? e.parseTwoDigitYear(t) : em(t) }), e8("YY", function (t, n) { n[0] = e.parseTwoDigitYear(t) }), e8("Y", function (e, t) { t[0] = parseInt(e, 10) }), e.parseTwoDigitYear = function (e) { return em(e) + (em(e) > 68 ? 1900 : 2e3) }; var ev = ek("FullYear", !0); function ek(t, n) { return function (s) { return null != s ? (eY(this, t, s), e.updateOffset(this, n), this) : ep(this, t) } } function ep(e, t) { if (!e.isValid()) return NaN; var n = e._d, s = e._isUTC; switch (t) { case "Milliseconds": return s ? n.getUTCMilliseconds() : n.getMilliseconds(); case "Seconds": return s ? n.getUTCSeconds() : n.getSeconds(); case "Minutes": return s ? n.getUTCMinutes() : n.getMinutes(); case "Hours": return s ? n.getUTCHours() : n.getHours(); case "Date": return s ? n.getUTCDate() : n.getDate(); case "Day": return s ? n.getUTCDay() : n.getDay(); case "Month": return s ? n.getUTCMonth() : n.getMonth(); case "FullYear": return s ? n.getUTCFullYear() : n.getFullYear(); default: return NaN } } function eY(e, t, n) { var s, i, r, a, o; if (!(!e.isValid() || isNaN(n))) { switch (s = e._d, i = e._isUTC, t) { case "Milliseconds": return void (i ? s.setUTCMilliseconds(n) : s.setMilliseconds(n)); case "Seconds": return void (i ? s.setUTCSeconds(n) : s.setSeconds(n)); case "Minutes": return void (i ? s.setUTCMinutes(n) : s.setMinutes(n)); case "Hours": return void (i ? s.setUTCHours(n) : s.setHours(n)); case "Date": return void (i ? s.setUTCDate(n) : s.setDate(n)); case "FullYear": break; default: return }r = n, a = e.month(), o = 29 !== (o = e.date()) || 1 !== a || e_(r) ? o : 28, i ? s.setUTCFullYear(r, a, o) : s.setFullYear(r, a, o) } } function eM(e, t) { if (isNaN(e) || isNaN(t)) return NaN; var n, s = ((n = t) % 12 + 12) % 12; return e += (t - s) / 12, 1 === s ? e_(e) ? 29 : 28 : 31 - s % 7 % 2 } e3 = Array.prototype.indexOf ? Array.prototype.indexOf : function (e) { var t; for (t = 0; t < this.length; ++t)if (this[t] === e) return t; return -1 }, N("M", ["MM", 2], "Mo", function () { return this.month() + 1 }), N("MMM", 0, 0, function (e) { return this.localeData().monthsShort(this, e) }), N("MMMM", 0, 0, function (e) { return this.localeData().months(this, e) }), ed("M", Q, eu), ed("MM", Q, z), ed("MMM", function (e, t) { return t.monthsShortRegex(e) }), ed("MMMM", function (e, t) { return t.monthsRegex(e) }), e8(["M", "MM"], function (e, t) { t[1] = em(e) - 1 }), e8(["MMM", "MMMM"], function (e, t, n, s) { var i = n._locale.monthsParse(e, s, n._strict); null != i ? t[1] = i : c(n).invalidMonth = e }); var eS = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), eD = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), eO = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, eT = eo, eb = eo; function e0(e, t, n) { var s, i, r, a = e.toLocaleLowerCase(); if (!this._monthsParse) for (s = 0, this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []; s < 12; ++s)r = h([2e3, s]), this._shortMonthsParse[s] = this.monthsShort(r, "").toLocaleLowerCase(), this._longMonthsParse[s] = this.months(r, "").toLocaleLowerCase(); return n ? "MMM" === t ? -1 !== (i = e3.call(this._shortMonthsParse, a)) ? i : null : -1 !== (i = e3.call(this._longMonthsParse, a)) ? i : null : "MMM" === t ? -1 !== (i = e3.call(this._shortMonthsParse, a)) ? i : -1 !== (i = e3.call(this._longMonthsParse, a)) ? i : null : -1 !== (i = e3.call(this._longMonthsParse, a)) ? i : -1 !== (i = e3.call(this._shortMonthsParse, a)) ? i : null } function ex(e, t) { if (!e.isValid()) return e; if ("string" == typeof t) { if (/^\d+$/.test(t)) t = em(t); else if (!o(t = e.localeData().monthsParse(t))) return e } var n = t, s = e.date(); return s = s < 29 ? s : Math.min(s, eM(e.year(), n)), e._isUTC ? e._d.setUTCMonth(n, s) : e._d.setMonth(n, s), e } function eW(t) { return null != t ? (ex(this, t), e.updateOffset(this, !0), this) : ep(this, "Month") } function eP() { function e(e, t) { return t.length - e.length } var t, n, s, i, r = [], a = [], o = []; for (t = 0; t < 12; t++)n = h([2e3, t]), s = ec(this.monthsShort(n, "")), i = ec(this.months(n, "")), r.push(s), a.push(i), o.push(i), o.push(s); r.sort(e), a.sort(e), o.sort(e), this._monthsRegex = RegExp("^(" + o.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = RegExp("^(" + a.join("|") + ")", "i"), this._monthsShortStrictRegex = RegExp("^(" + r.join("|") + ")", "i") } function eC(e, t, n, s, i, r, a) { var o; return e < 100 && e >= 0 ? isFinite((o = new Date(e + 400, t, n, s, i, r, a)).getFullYear()) && o.setFullYear(e) : o = new Date(e, t, n, s, i, r, a), o } function eN(e) { var t, n; return e < 100 && e >= 0 ? (n = Array.prototype.slice.call(arguments), n[0] = e + 400, isFinite((t = new Date(Date.UTC.apply(null, n))).getUTCFullYear()) && t.setUTCFullYear(e)) : t = new Date(Date.UTC.apply(null, arguments)), t } function eU(e, t, n) { var s = 7 + t - n; return -((7 + eN(e, 0, s).getUTCDay() - t) % 7) + s - 1 } function eH(e, t, n, s, i) { var r, a, o = eU(e, s, i), u = 1 + 7 * (t - 1) + (7 + n - s) % 7 + o; return u <= 0 ? a = ew(r = e - 1) + u : u > ew(e) ? (r = e + 1, a = u - ew(e)) : (r = e, a = u), { year: r, dayOfYear: a } } function eR(e, t, n) { var s, i, r = eU(e.year(), t, n), a = Math.floor((e.dayOfYear() - r - 1) / 7) + 1; return a < 1 ? s = a + e2(i = e.year() - 1, t, n) : a > e2(e.year(), t, n) ? (s = a - e2(e.year(), t, n), i = e.year() + 1) : (i = e.year(), s = a), { week: s, year: i } } function e2(e, t, n) { var s = eU(e, t, n), i = eU(e + 1, t, n); return (ew(e) - s + i) / 7 } function e4(e, t) { return e.slice(t, 7).concat(e.slice(0, t)) } N("w", ["ww", 2], "wo", "week"), N("W", ["WW", 2], "Wo", "isoWeek"), ed("w", Q, eu), ed("ww", Q, z), ed("W", Q, eu), ed("WW", Q, z), ey(["w", "ww", "W", "WW"], function (e, t, n, s) { t[s.substr(0, 1)] = em(e) }), N("d", 0, "do", "day"), N("dd", 0, 0, function (e) { return this.localeData().weekdaysMin(this, e) }), N("ddd", 0, 0, function (e) { return this.localeData().weekdaysShort(this, e) }), N("dddd", 0, 0, function (e) { return this.localeData().weekdays(this, e) }), N("e", 0, 0, "weekday"), N("E", 0, 0, "isoWeekday"), ed("d", Q), ed("e", Q), ed("E", Q), ed("dd", function (e, t) { return t.weekdaysMinRegex(e) }), ed("ddd", function (e, t) { return t.weekdaysShortRegex(e) }), ed("dddd", function (e, t) { return t.weekdaysRegex(e) }), ey(["dd", "ddd", "dddd"], function (e, t, n, s) { var i = n._locale.weekdaysParse(e, s, n._strict); null != i ? t.d = i : c(n).invalidWeekday = e }), ey(["d", "e", "E"], function (e, t, n, s) { t[s] = em(e) }); var eF = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), eL = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), eV = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), eG = eo, e1 = eo, eA = eo; function eI(e, t, n) { var s, i, r, a = e.toLocaleLowerCase(); if (!this._weekdaysParse) for (s = 0, this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = []; s < 7; ++s)r = h([2e3, 1]).day(s), this._minWeekdaysParse[s] = this.weekdaysMin(r, "").toLocaleLowerCase(), this._shortWeekdaysParse[s] = this.weekdaysShort(r, "").toLocaleLowerCase(), this._weekdaysParse[s] = this.weekdays(r, "").toLocaleLowerCase(); return n ? "dddd" === t ? -1 !== (i = e3.call(this._weekdaysParse, a)) ? i : null : "ddd" === t ? -1 !== (i = e3.call(this._shortWeekdaysParse, a)) ? i : null : -1 !== (i = e3.call(this._minWeekdaysParse, a)) ? i : null : "dddd" === t ? -1 !== (i = e3.call(this._weekdaysParse, a)) || -1 !== (i = e3.call(this._shortWeekdaysParse, a)) ? i : -1 !== (i = e3.call(this._minWeekdaysParse, a)) ? i : null : "ddd" === t ? -1 !== (i = e3.call(this._shortWeekdaysParse, a)) || -1 !== (i = e3.call(this._weekdaysParse, a)) ? i : -1 !== (i = e3.call(this._minWeekdaysParse, a)) ? i : null : -1 !== (i = e3.call(this._minWeekdaysParse, a)) || -1 !== (i = e3.call(this._weekdaysParse, a)) ? i : -1 !== (i = e3.call(this._shortWeekdaysParse, a)) ? i : null } function e7() { function e(e, t) { return t.length - e.length } var t, n, s, i, r, a = [], o = [], u = [], l = []; for (t = 0; t < 7; t++)n = h([2e3, 1]).day(t), s = ec(this.weekdaysMin(n, "")), i = ec(this.weekdaysShort(n, "")), r = ec(this.weekdays(n, "")), a.push(s), o.push(i), u.push(r), l.push(s), l.push(i), l.push(r); a.sort(e), o.sort(e), u.sort(e), l.sort(e), this._weekdaysRegex = RegExp("^(" + l.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = RegExp("^(" + u.join("|") + ")", "i"), this._weekdaysShortStrictRegex = RegExp("^(" + o.join("|") + ")", "i"), this._weekdaysMinStrictRegex = RegExp("^(" + a.join("|") + ")", "i") } function eE() { return this.hours() % 12 || 12 } function e5(e, t) { N(e, 0, 0, function () { return this.localeData().meridiem(this.hours(), this.minutes(), t) }) } function ej(e, t) { return t._meridiemParse } N("H", ["HH", 2], 0, "hour"), N("h", ["hh", 2], 0, eE), N("k", ["kk", 2], 0, function e() { return this.hours() || 24 }), N("hmm", 0, 0, function () { return "" + eE.apply(this) + b(this.minutes(), 2) }), N("hmmss", 0, 0, function () { return "" + eE.apply(this) + b(this.minutes(), 2) + b(this.seconds(), 2) }), N("Hmm", 0, 0, function () { return "" + this.hours() + b(this.minutes(), 2) }), N("Hmmss", 0, 0, function () { return "" + this.hours() + b(this.minutes(), 2) + b(this.seconds(), 2) }), e5("a", !0), e5("A", !1), ed("a", ej), ed("A", ej), ed("H", Q, el), ed("h", Q, eu), ed("k", Q, eu), ed("HH", Q, z), ed("hh", Q, z), ed("kk", Q, z), ed("hmm", X), ed("hmmss", K), ed("Hmm", X), ed("Hmmss", K), e8(["H", "HH"], 3), e8(["k", "kk"], function (e, t, n) { var s = em(e); t[3] = 24 === s ? 0 : s }), e8(["a", "A"], function (e, t, n) { n._isPm = n._locale.isPM(e), n._meridiem = e }), e8(["h", "hh"], function (e, t, n) { t[3] = em(e), c(n).bigHour = !0 }), e8("hmm", function (e, t, n) { var s = e.length - 2; t[3] = em(e.substr(0, s)), t[4] = em(e.substr(s)), c(n).bigHour = !0 }), e8("hmmss", function (e, t, n) { var s = e.length - 4, i = e.length - 2; t[3] = em(e.substr(0, s)), t[4] = em(e.substr(s, 2)), t[5] = em(e.substr(i)), c(n).bigHour = !0 }), e8("Hmm", function (e, t, n) { var s = e.length - 2; t[3] = em(e.substr(0, s)), t[4] = em(e.substr(s)) }), e8("Hmmss", function (e, t, n) { var s = e.length - 4, i = e.length - 2; t[3] = em(e.substr(0, s)), t[4] = em(e.substr(s, 2)), t[5] = em(e.substr(i)) }); var e3, eZ, ez = ek("Hours", !0), e6 = { calendar: { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, longDateFormat: { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, invalidDate: "Invalid date", ordinal: "%d", dayOfMonthOrdinalParse: /\d{1,2}/, relativeTime: { future: "in %s", past: "%s ago", s: "a few seconds", ss: "%d seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", w: "a week", ww: "%d weeks", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, months: eS, monthsShort: eD, week: { dow: 0, doy: 6 }, weekdays: eF, weekdaysMin: eV, weekdaysShort: eL, meridiemParse: /[ap]\.?m?\.?/i }, e9 = {}, eq = {}; function eB(e, t) { var n, s = Math.min(e.length, t.length); for (n = 0; n < s; n += 1)if (e[n] !== t[n]) return n; return s } function eJ(e) { return e ? e.toLowerCase().replace("_", "-") : e } function eQ(e) { var t, n, s = null; if (void 0 === e9[e] && "undefined" != typeof module && module && module.exports && (n = e) && n.match("^[^/\\\\]*$")) try { s = eZ._abbr, (t = require)("./locale/" + e), eX(s) } catch (i) { e9[e] = null } return e9[e] } function eX(e, t) { var n; return e && ((n = a(t) ? te(e) : eK(e, t)) ? eZ = n : "undefined" != typeof console && console.warn && console.warn("Locale " + e + " not found. Did you forget to load it?")), eZ._abbr } function eK(e, t) { if (null === t) return delete e9[e], null; var n, s = e6; if (t.abbr = e, null != e9[e]) S("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."), s = e9[e]._config; else if (null != t.parentLocale) { if (null != e9[t.parentLocale]) s = e9[t.parentLocale]._config; else { if (null == (n = eQ(t.parentLocale))) return eq[t.parentLocale] || (eq[t.parentLocale] = []), eq[t.parentLocale].push({ name: e, config: t }), null; s = n._config } } return e9[e] = new T(O(s, t)), eq[e] && eq[e].forEach(function (e) { eK(e.name, e.config) }), eX(e), e9[e] } function te(e) { var t; if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return eZ; if (!n(e)) { if (t = eQ(e)) return t; e = [e] } return function e(t) { for (var n, s, i, r, a = 0; a < t.length;) { for (n = (r = eJ(t[a]).split("-")).length, s = (s = eJ(t[a + 1])) ? s.split("-") : null; n > 0;) { if (i = eQ(r.slice(0, n).join("-"))) return i; if (s && s.length >= n && eB(r, s) >= n - 1) break; n-- } a++ } return eZ }(e) } function tt(e) { var t, n = e._a; return n && -2 === c(e).overflow && (t = n[1] < 0 || n[1] > 11 ? 1 : n[2] < 1 || n[2] > eM(n[0], n[1]) ? 2 : n[3] < 0 || n[3] > 24 || 24 === n[3] && (0 !== n[4] || 0 !== n[5] || 0 !== n[6]) ? 3 : n[4] < 0 || n[4] > 59 ? 4 : n[5] < 0 || n[5] > 59 ? 5 : n[6] < 0 || n[6] > 999 ? 6 : -1, c(e)._overflowDayOfYear && (t < 0 || t > 2) && (t = 2), c(e)._overflowWeeks && -1 === t && (t = 7), c(e)._overflowWeekday && -1 === t && (t = 8), c(e).overflow = t), e } var tn = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, ts = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, ti = /Z|[+-]\d\d(?::?\d\d)?/, tr = [["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], ["GGGG-[W]WW", /\d{4}-W\d\d/, !1], ["YYYY-DDD", /\d{4}-\d{3}/], ["YYYY-MM", /\d{4}-\d\d/, !1], ["YYYYYYMMDD", /[+-]\d{10}/], ["YYYYMMDD", /\d{8}/], ["GGGG[W]WWE", /\d{4}W\d{3}/], ["GGGG[W]WW", /\d{4}W\d{2}/, !1], ["YYYYDDD", /\d{7}/], ["YYYYMM", /\d{6}/, !1], ["YYYY", /\d{4}/, !1],], ta = [["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], ["HH:mm:ss", /\d\d:\d\d:\d\d/], ["HH:mm", /\d\d:\d\d/], ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], ["HHmmss", /\d\d\d\d\d\d/], ["HHmm", /\d\d\d\d/], ["HH", /\d\d/],], to = /^\/?Date\((-?\d+)/i, tu = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, tl = { UT: 0, GMT: 0, EDT: -240, EST: -300, CDT: -300, CST: -360, MDT: -360, MST: -420, PDT: -420, PST: -480 }; function td(e) { var t, n, s, i, r, a, o = e._i, u = tn.exec(o) || ts.exec(o), l = tr.length, d = ta.length; if (u) { for (t = 0, c(e).iso = !0, n = l; t < n; t++)if (tr[t][1].exec(u[1])) { i = tr[t][0], s = !1 !== tr[t][2]; break } if (null == i) { e._isValid = !1; return } if (u[3]) { for (t = 0, n = d; t < n; t++)if (ta[t][1].exec(u[3])) { r = (u[2] || " ") + ta[t][0]; break } if (null == r) { e._isValid = !1; return } } if (!s && null != r) { e._isValid = !1; return } if (u[4]) { if (ti.exec(u[4])) a = "Z"; else { e._isValid = !1; return } } e._f = i + (r || "") + (a || ""), tm(e) } else e._isValid = !1 } function th(e) { var t, n, s, i, r, a, o, u, l, d, h, f = tu.exec((d = e._i).replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "")); if (f) { if (h = (s = f[4], i = f[3], r = f[2], a = f[5], o = f[6], u = f[7], l = [(t = s, n = parseInt(t, 10), n <= 49 ? 2e3 + n : n <= 999 ? 1900 + n : n), eD.indexOf(i), parseInt(r, 10), parseInt(a, 10), parseInt(o, 10),], u && l.push(parseInt(u, 10)), l), !function e(t, n, s) { if (t) { var i; if (eL.indexOf(t) !== new Date(n[0], n[1], n[2]).getDay()) return c(s).weekdayMismatch = !0, s._isValid = !1, !1 } return !0 }(f[1], h, e)) return; e._a = h, e._tzm = function e(t, n, s) { if (t) return tl[t]; if (n) return 0; var i = parseInt(s, 10), r = i % 100; return 60 * ((i - r) / 100) + r }(f[8], f[9], f[10]), e._d = eN.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), c(e).rfc2822 = !0 } else e._isValid = !1 } function tc(e, t, n) { return null != e ? e : null != t ? t : n } function tf(t) { var n, s, i, r, a, o, u, l, d, h, f, m, $, y, g, _, w, v = []; if (!t._d) { for (g = (f = t, m = new Date(e.now()), f._useUTC ? [m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(),] : [m.getFullYear(), m.getMonth(), m.getDate()]), t._w && null == t._a[2] && null == t._a[1] && (n = t, null != (s = n._w).GG || null != s.W || null != s.E ? (o = 1, u = 4, i = tc(s.GG, n._a[0], eR(ty(), 1, 4).year), r = tc(s.W, 1), ((a = tc(s.E, 1)) < 1 || a > 7) && (d = !0)) : (o = n._locale._week.dow, u = n._locale._week.doy, h = eR(ty(), o, u), i = tc(s.gg, n._a[0], h.year), r = tc(s.w, h.week), null != s.d ? ((a = s.d) < 0 || a > 6) && (d = !0) : null != s.e ? (a = s.e + o, (s.e < 0 || s.e > 6) && (d = !0)) : a = o), r < 1 || r > e2(i, o, u) ? c(n)._overflowWeeks = !0 : null != d ? c(n)._overflowWeekday = !0 : (l = eH(i, r, a, o, u), n._a[0] = l.year, n._dayOfYear = l.dayOfYear)), null != t._dayOfYear && (w = tc(t._a[0], g[0]), (t._dayOfYear > ew(w) || 0 === t._dayOfYear) && (c(t)._overflowDayOfYear = !0), y = eN(w, 0, t._dayOfYear), t._a[1] = y.getUTCMonth(), t._a[2] = y.getUTCDate()), $ = 0; $ < 3 && null == t._a[$]; ++$)t._a[$] = v[$] = g[$]; for (; $ < 7; $++)t._a[$] = v[$] = null == t._a[$] ? 2 === $ ? 1 : 0 : t._a[$]; 24 === t._a[3] && 0 === t._a[4] && 0 === t._a[5] && 0 === t._a[6] && (t._nextDay = !0, t._a[3] = 0), t._d = (t._useUTC ? eN : eC).apply(null, v), _ = t._useUTC ? t._d.getUTCDay() : t._d.getDay(), null != t._tzm && t._d.setUTCMinutes(t._d.getUTCMinutes() - t._tzm), t._nextDay && (t._a[3] = 24), t._w && void 0 !== t._w.d && t._w.d !== _ && (c(t).weekdayMismatch = !0) } } function tm(t) { if (t._f === e.ISO_8601) { td(t); return } if (t._f === e.RFC_2822) { th(t); return } t._a = [], c(t).empty = !0; var n, s, i, r, a, o, u, l, d, h, f, m = "" + t._i, $ = m.length, y = 0; for (a = 0, f = (u = R(t._f, t._locale).match(x) || []).length; a < f; a++)l = u[a], (o = (m.match(eh(l, t)) || [])[0]) && ((d = m.substr(0, m.indexOf(o))).length > 0 && c(t).unusedInput.push(d), m = m.slice(m.indexOf(o) + o.length), y += o.length), C[l] ? (o ? c(t).empty = !1 : c(t).unusedTokens.push(l), eg(l, o, t)) : t._strict && !o && c(t).unusedTokens.push(l); c(t).charsLeftOver = $ - y, m.length > 0 && c(t).unusedInput.push(m), t._a[3] <= 12 && !0 === c(t).bigHour && t._a[3] > 0 && (c(t).bigHour = void 0), c(t).parsedDateParts = t._a.slice(0), c(t).meridiem = t._meridiem, t._a[3] = (n = t._locale, s = t._a[3], i = t._meridiem, null == i ? s : null != n.meridiemHour ? n.meridiemHour(s, i) : (null != n.isPM && ((r = n.isPM(i)) && s < 12 && (s += 12), r || 12 !== s || (s = 0)), s)), null !== (h = c(t).era) && (t._a[0] = t._locale.erasConvertYear(h, t._a[0])), tf(t), tt(t) } function t$(t) { var i, r, h = t._i, $ = t._f; return (t._locale = t._locale || te(t._l), null === h || void 0 === $ && "" === h) ? m({ nullInput: !0 }) : ("string" == typeof h && (t._i = h = t._locale.preparse(h)), k(h)) ? new v(tt(h)) : (u(h) ? t._d = h : n($) ? function e(t) { var n, s, i, r, a, o, u = !1, l = t._f.length; if (0 === l) { c(t).invalidFormat = !0, t._d = new Date(NaN); return } for (r = 0; r < l; r++)a = 0, o = !1, n = w({}, t), null != t._useUTC && (n._useUTC = t._useUTC), n._f = t._f[r], tm(n), f(n) && (o = !0), a += c(n).charsLeftOver, a += 10 * c(n).unusedTokens.length, c(n).score = a, u ? a < i && (i = a, s = n) : (null == i || a < i || o) && (i = a, s = n, o && (u = !0)); d(t, s || n) }(t) : $ ? tm(t) : (i = t, r = i._i, a(r) ? i._d = new Date(e.now()) : u(r) ? i._d = new Date(r.valueOf()) : "string" == typeof r ? function t(n) { var s = to.exec(n._i); if (null !== s) { n._d = new Date(+s[1]); return } if (td(n), !1 === n._isValid) delete n._isValid, th(n), !1 === n._isValid && (delete n._isValid, n._strict ? n._isValid = !1 : e.createFromInputFallback(n)) }(i) : n(r) ? (i._a = l(r.slice(0), function (e) { return parseInt(e, 10) }), tf(i)) : s(r) ? function e(t) { if (!t._d) { var n = V(t._i), s = void 0 === n.day ? n.date : n.day; t._a = l([n.year, n.month, s, n.hour, n.minute, n.second, n.millisecond], function (e) { return e && parseInt(e, 10) }), tf(t) } }(i) : o(r) ? i._d = new Date(r) : e.createFromInputFallback(i)), f(t) || (t._d = null), t) } function t8(e, t, i, a, o) { var u, l, d = {}; return (!0 === t || !1 === t) && (a = t, t = void 0), (!0 === i || !1 === i) && (a = i, i = void 0), (s(e) && r(e) || n(e) && 0 === e.length) && (e = void 0), d._isAMomentObject = !0, d._useUTC = d._isUTC = o, d._l = i, d._i = e, d._f = t, d._strict = a, u = d, (l = new v(tt(t$(u))))._nextDay && (l.add(1, "d"), l._nextDay = void 0), l } function ty(e, t, n, s) { return t8(e, t, n, s, !1) } e.createFromInputFallback = Y("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function (e) { e._d = new Date(e._i + (e._useUTC ? " UTC" : "")) }), e.ISO_8601 = function () { }, e.RFC_2822 = function () { }; var tg = Y("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function () { var e = ty.apply(null, arguments); return this.isValid() && e.isValid() ? e < this ? this : e : m() }), t_ = Y("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function () { var e = ty.apply(null, arguments); return this.isValid() && e.isValid() ? e > this ? this : e : m() }); function tw(e, t) { var s, i; if (1 === t.length && n(t[0]) && (t = t[0]), !t.length) return ty(); for (i = 1, s = t[0]; i < t.length; ++i)(!t[i].isValid() || t[i][e](s)) && (s = t[i]); return s } var tv = function () { return Date.now ? Date.now() : +new Date }, tk = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond",]; function tp(e) { var t = V(e), n = t.year || 0, s = t.quarter || 0, r = t.month || 0, a = t.week || t.isoWeek || 0, o = t.day || 0, u = t.hour || 0, l = t.minute || 0, d = t.second || 0, h = t.millisecond || 0; this._isValid = function e(t) { var n, s, r = !1, a = tk.length; for (n in t) if (i(t, n) && !(-1 !== e3.call(tk, n) && (null == t[n] || !isNaN(t[n])))) return !1; for (s = 0; s < a; ++s)if (t[tk[s]]) { if (r) return !1; parseFloat(t[tk[s]]) !== em(t[tk[s]]) && (r = !0) } return !0 }(t), this._milliseconds = +h + 1e3 * d + 6e4 * l + 36e5 * u, this._days = +o + 7 * a, this._months = +r + 3 * s + 12 * n, this._data = {}, this._locale = te(), this._bubble() } function tY(e) { return e instanceof tp } function tM(e) { return e < 0 ? -1 * Math.round(-1 * e) : Math.round(e) } function tS(e, t) { N(e, 0, 0, function () { var e = this.utcOffset(), n = "+"; return e < 0 && (e = -e, n = "-"), n + b(~~(e / 60), 2) + t + b(~~e % 60, 2) }) } tS("Z", ":"), tS("ZZ", ""), ed("Z", ea), ed("ZZ", ea), e8(["Z", "ZZ"], function (e, t, n) { n._useUTC = !0, n._tzm = tO(ea, e) }); var tD = /([\+\-]|\d\d)/gi; function tO(e, t) { var n, s, i, r = (t || "").match(e); return null === r ? null : 0 === (i = +(60 * (s = ((n = r[r.length - 1] || []) + "").match(tD) || ["-", 0, 0])[1]) + em(s[2])) ? 0 : "+" === s[0] ? i : -i } function tT(t, n) { var s, i; return n._isUTC ? (s = n.clone(), i = (k(t) || u(t) ? t.valueOf() : ty(t).valueOf()) - s.valueOf(), s._d.setTime(s._d.valueOf() + i), e.updateOffset(s, !1), s) : ty(t).local() } function tb(e) { return -Math.round(e._d.getTimezoneOffset()) } function t0() { return !!this.isValid() && this._isUTC && 0 === this._offset } e.updateOffset = function () { }; var tx = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, tW = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function tP(e, t) { var n, s, r, a, u, l, d = e, h = null; return tY(e) ? d = { ms: e._milliseconds, d: e._days, M: e._months } : o(e) || !isNaN(+e) ? (d = {}, t ? d[t] = +e : d.milliseconds = +e) : (h = tx.exec(e)) ? (n = "-" === h[1] ? -1 : 1, d = { y: 0, d: em(h[2]) * n, h: em(h[3]) * n, m: em(h[4]) * n, s: em(h[5]) * n, ms: em(tM(1e3 * h[6])) * n }) : (h = tW.exec(e)) ? (n = "-" === h[1] ? -1 : 1, d = { y: tC(h[2], n), M: tC(h[3], n), w: tC(h[4], n), d: tC(h[5], n), h: tC(h[6], n), m: tC(h[7], n), s: tC(h[8], n) }) : null == d ? d = {} : "object" == typeof d && ("from" in d || "to" in d) && (r = (a = ty(d.from), u = ty(d.to), a.isValid() && u.isValid() ? (u = tT(u, a), a.isBefore(u) ? l = tN(a, u) : ((l = tN(u, a)).milliseconds = -l.milliseconds, l.months = -l.months), l) : { milliseconds: 0, months: 0 }), (d = {}).ms = r.milliseconds, d.M = r.months), s = new tp(d), tY(e) && i(e, "_locale") && (s._locale = e._locale), tY(e) && i(e, "_isValid") && (s._isValid = e._isValid), s } function tC(e, t) { var n = e && parseFloat(e.replace(",", ".")); return (isNaN(n) ? 0 : n) * t } function tN(e, t) { var n = {}; return n.months = t.month() - e.month() + (t.year() - e.year()) * 12, e.clone().add(n.months, "M").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, "M"), n } function tU(e, t) { return function (n, s) { var i, r; return null === s || isNaN(+s) || (S(t, "moment()." + t + "(period, number) is deprecated. Please use moment()." + t + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."), r = n, n = s, s = r), i = tP(n, s), tH(this, i, e), this } } function tH(t, n, s, i) { var r = n._milliseconds, a = tM(n._days), o = tM(n._months); t.isValid() && (i = null == i || i, o && ex(t, ep(t, "Month") + o * s), a && eY(t, "Date", ep(t, "Date") + a * s), r && t._d.setTime(t._d.valueOf() + r * s), i && e.updateOffset(t, a || o)) } tP.fn = tp.prototype, tP.invalid = function e() { return tP(NaN) }; var tR = tU(1, "add"), t2 = tU(-1, "subtract"); function t4(e) { return "string" == typeof e || e instanceof String } function tF(e, t) { if (e.date() < t.date()) return -tF(t, e); var n, s, i = (t.year() - e.year()) * 12 + (t.month() - e.month()), r = e.clone().add(i, "months"); return s = t - r < 0 ? (t - r) / (r - (n = e.clone().add(i - 1, "months"))) : (t - r) / ((n = e.clone().add(i + 1, "months")) - r), -(i + s) || 0 } function tL(e) { var t; return void 0 === e ? this._locale._abbr : (null != (t = te(e)) && (this._locale = t), this) } e.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ", e.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]"; var tV = Y("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (e) { return void 0 === e ? this.localeData() : this.locale(e) }); function tG() { return this._locale } var t1 = 36e5, tA = 3506328 * t1; function tI(e, t) { return (e % t + t) % t } function t7(e, t, n) { return e < 100 && e >= 0 ? new Date(e + 400, t, n) - tA : new Date(e, t, n).valueOf() } function tE(e, t, n) { return e < 100 && e >= 0 ? Date.UTC(e + 400, t, n) - tA : Date.UTC(e, t, n) } function t5(e, t) { return t.erasAbbrRegex(e) } function tj() { var e, t, n, s, i, r = [], a = [], o = [], u = [], l = this.eras(); for (e = 0, t = l.length; e < t; ++e)n = ec(l[e].name), s = ec(l[e].abbr), i = ec(l[e].narrow), a.push(n), r.push(s), o.push(i), u.push(n), u.push(s), u.push(i); this._erasRegex = RegExp("^(" + u.join("|") + ")", "i"), this._erasNameRegex = RegExp("^(" + a.join("|") + ")", "i"), this._erasAbbrRegex = RegExp("^(" + r.join("|") + ")", "i"), this._erasNarrowRegex = RegExp("^(" + o.join("|") + ")", "i") } function t3(e, t) { N(0, [e, e.length], 0, t) } function tZ(e, t, n, s, i) { var r; return null == e ? eR(this, s, i).year : (r = e2(e, s, i), t > r && (t = r), tz.call(this, e, t, n, s, i)) } function tz(e, t, n, s, i) { var r = eH(e, t, n, s, i), a = eN(r.year, 0, r.dayOfYear); return this.year(a.getUTCFullYear()), this.month(a.getUTCMonth()), this.date(a.getUTCDate()), this } N("N", 0, 0, "eraAbbr"), N("NN", 0, 0, "eraAbbr"), N("NNN", 0, 0, "eraAbbr"), N("NNNN", 0, 0, "eraName"), N("NNNNN", 0, 0, "eraNarrow"), N("y", ["y", 1], "yo", "eraYear"), N("y", ["yy", 2], 0, "eraYear"), N("y", ["yyy", 3], 0, "eraYear"), N("y", ["yyyy", 4], 0, "eraYear"), ed("N", t5), ed("NN", t5), ed("NNN", t5), ed("NNNN", function e(t, n) { return n.erasNameRegex(t) }), ed("NNNNN", function e(t, n) { return n.erasNarrowRegex(t) }), e8(["N", "NN", "NNN", "NNNN", "NNNNN"], function (e, t, n, s) { var i = n._locale.erasParse(e, s, n._strict); i ? c(n).era = i : c(n).invalidEra = e }), ed("y", es), ed("yy", es), ed("yyy", es), ed("yyyy", es), ed("yo", function e(t, n) { return n._eraYearOrdinalRegex || es }), e8(["y", "yy", "yyy", "yyyy"], 0), e8(["yo"], function (e, t, n, s) { var i; n._locale._eraYearOrdinalRegex && (i = e.match(n._locale._eraYearOrdinalRegex)), n._locale.eraYearOrdinalParse ? t[0] = n._locale.eraYearOrdinalParse(e, i) : t[0] = parseInt(e, 10) }), N(0, ["gg", 2], 0, function () { return this.weekYear() % 100 }), N(0, ["GG", 2], 0, function () { return this.isoWeekYear() % 100 }), t3("gggg", "weekYear"), t3("ggggg", "weekYear"), t3("GGGG", "isoWeekYear"), t3("GGGGG", "isoWeekYear"), ed("G", ei), ed("g", ei), ed("GG", Q, z), ed("gg", Q, z), ed("GGGG", et, B), ed("gggg", et, B), ed("GGGGG", en, J), ed("ggggg", en, J), ey(["gggg", "ggggg", "GGGG", "GGGGG"], function (e, t, n, s) { t[s.substr(0, 2)] = em(e) }), ey(["gg", "GG"], function (t, n, s, i) { n[i] = e.parseTwoDigitYear(t) }), N("Q", 0, "Qo", "quarter"), ed("Q", Z), e8("Q", function (e, t) { t[1] = (em(e) - 1) * 3 }), N("D", ["DD", 2], "Do", "date"), ed("D", Q, eu), ed("DD", Q, z), ed("Do", function (e, t) { return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient }), e8(["D", "DD"], 2), e8("Do", function (e, t) { t[2] = em(e.match(Q)[0]) }); var t6 = ek("Date", !0); N("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), ed("DDD", ee), ed("DDDD", q), e8(["DDD", "DDDD"], function (e, t, n) { n._dayOfYear = em(e) }), N("m", ["mm", 2], 0, "minute"), ed("m", Q, el), ed("mm", Q, z), e8(["m", "mm"], 4); var t9 = ek("Minutes", !1); N("s", ["ss", 2], 0, "second"), ed("s", Q, el), ed("ss", Q, z), e8(["s", "ss"], 5); var tq = ek("Seconds", !1); for (N("S", 0, 0, function () { return ~~(this.millisecond() / 100) }), N(0, ["SS", 2], 0, function () { return ~~(this.millisecond() / 10) }), N(0, ["SSS", 3], 0, "millisecond"), N(0, ["SSSS", 4], 0, function () { return 10 * this.millisecond() }), N(0, ["SSSSS", 5], 0, function () { return 100 * this.millisecond() }), N(0, ["SSSSSS", 6], 0, function () { return 1e3 * this.millisecond() }), N(0, ["SSSSSSS", 7], 0, function () { return 1e4 * this.millisecond() }), N(0, ["SSSSSSSS", 8], 0, function () { return 1e5 * this.millisecond() }), N(0, ["SSSSSSSSS", 9], 0, function () { return 1e6 * this.millisecond() }), ed("S", ee, Z), ed("SS", ee, z), ed("SSS", ee, q), $ = "SSSS"; $.length <= 9; $ += "S")ed($, es); function tB(e, t) { t[6] = em(("0." + e) * 1e3) } for ($ = "S"; $.length <= 9; $ += "S")e8($, tB); y = ek("Milliseconds", !1), N("z", 0, 0, "zoneAbbr"), N("zz", 0, 0, "zoneName"); var tJ = v.prototype; function tQ(e) { return e } tJ.add = tR, tJ.calendar = function t(a, l) { if (1 === arguments.length) { if (arguments[0]) { var d, h, c, f; if (d = arguments[0], k(d) || u(d) || t4(d) || o(d) || (h = d, c = n(h), f = !1, c && (f = 0 === h.filter(function (e) { return !o(e) && t4(h) }).length), c && f) || function e(t) { var n, a, o = s(t) && !r(t), u = !1, l = ["years", "year", "y", "months", "month", "M", "days", "day", "d", "dates", "date", "D", "hours", "hour", "h", "minutes", "minute", "m", "seconds", "second", "s", "milliseconds", "millisecond", "ms",], d = l.length; for (n = 0; n < d; n += 1)a = l[n], u = u || i(t, a); return o && u }(d) || null == d) a = arguments[0], l = void 0; else (function e(t) { var n, a, o = s(t) && !r(t), u = !1, l = ["sameDay", "nextDay", "lastDay", "nextWeek", "lastWeek", "sameElse",]; for (n = 0; n < l.length; n += 1)a = l[n], u = u || i(t, a); return o && u })(arguments[0]) && (l = arguments[0], a = void 0) } else a = void 0, l = void 0 } var m = a || ty(), $ = tT(m, this).startOf("day"), y = e.calendarFormat(this, $) || "sameElse", g = l && (D(l[y]) ? l[y].call(this, m) : l[y]); return this.format(g || this.localeData().calendar(y, this, ty(m))) }, tJ.clone = function e() { return new v(this) }, tJ.diff = function e(t, n, s) { var i, r, a; if (!this.isValid() || !(i = tT(t, this)).isValid()) return NaN; switch (r = (i.utcOffset() - this.utcOffset()) * 6e4, n = L(n)) { case "year": a = tF(this, i) / 12; break; case "month": a = tF(this, i); break; case "quarter": a = tF(this, i) / 3; break; case "second": a = (this - i) / 1e3; break; case "minute": a = (this - i) / 6e4; break; case "hour": a = (this - i) / 36e5; break; case "day": a = (this - i - r) / 864e5; break; case "week": a = (this - i - r) / 6048e5; break; default: a = this - i }return s ? a : ef(a) }, tJ.endOf = function t(n) { var s, i; if (void 0 === (n = L(n)) || "millisecond" === n || !this.isValid()) return this; switch (i = this._isUTC ? tE : t7, n) { case "year": s = i(this.year() + 1, 0, 1) - 1; break; case "quarter": s = i(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; break; case "month": s = i(this.year(), this.month() + 1, 1) - 1; break; case "week": s = i(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; break; case "isoWeek": s = i(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; break; case "day": case "date": s = i(this.year(), this.month(), this.date() + 1) - 1; break; case "hour": s = this._d.valueOf(), s += t1 - tI(s + (this._isUTC ? 0 : 6e4 * this.utcOffset()), t1) - 1; break; case "minute": s = this._d.valueOf(), s += 6e4 - tI(s, 6e4) - 1; break; case "second": s = this._d.valueOf(), s += 1e3 - tI(s, 1e3) - 1 }return this._d.setTime(s), e.updateOffset(this, !0), this }, tJ.format = function t(n) { n || (n = this.isUtc() ? e.defaultFormatUtc : e.defaultFormat); var s = H(this, n); return this.localeData().postformat(s) }, tJ.from = function e(t, n) { return this.isValid() && (k(t) && t.isValid() || ty(t).isValid()) ? tP({ to: this, from: t }).locale(this.locale()).humanize(!n) : this.localeData().invalidDate() }, tJ.fromNow = function e(t) { return this.from(ty(), t) }, tJ.to = function e(t, n) { return this.isValid() && (k(t) && t.isValid() || ty(t).isValid()) ? tP({ from: this, to: t }).locale(this.locale()).humanize(!n) : this.localeData().invalidDate() }, tJ.toNow = function e(t) { return this.to(ty(), t) }, tJ.get = function e(t) { return D(this[t = L(t)]) ? this[t]() : this }, tJ.invalidAt = function e() { return c(this).overflow }, tJ.isAfter = function e(t, n) { var s = k(t) ? t : ty(t); return !!(this.isValid() && s.isValid()) && ("millisecond" === (n = L(n) || "millisecond") ? this.valueOf() > s.valueOf() : s.valueOf() < this.clone().startOf(n).valueOf()) }, tJ.isBefore = function e(t, n) { var s = k(t) ? t : ty(t); return !!(this.isValid() && s.isValid()) && ("millisecond" === (n = L(n) || "millisecond") ? this.valueOf() < s.valueOf() : this.clone().endOf(n).valueOf() < s.valueOf()) }, tJ.isBetween = function e(t, n, s, i) { var r = k(t) ? t : ty(t), a = k(n) ? n : ty(n); return !!(this.isValid() && r.isValid() && a.isValid()) && ("(" === (i = i || "()")[0] ? this.isAfter(r, s) : !this.isBefore(r, s)) && (")" === i[1] ? this.isBefore(a, s) : !this.isAfter(a, s)) }, tJ.isSame = function e(t, n) { var s, i = k(t) ? t : ty(t); return !!(this.isValid() && i.isValid()) && ("millisecond" === (n = L(n) || "millisecond") ? this.valueOf() === i.valueOf() : (s = i.valueOf(), this.clone().startOf(n).valueOf() <= s && s <= this.clone().endOf(n).valueOf())) }, tJ.isSameOrAfter = function e(t, n) { return this.isSame(t, n) || this.isAfter(t, n) }, tJ.isSameOrBefore = function e(t, n) { return this.isSame(t, n) || this.isBefore(t, n) }, tJ.isValid = function e() { return f(this) }, tJ.lang = tV, tJ.locale = tL, tJ.localeData = tG, tJ.max = t_, tJ.min = tg, tJ.parsingFlags = function e() { return d({}, c(this)) }, tJ.set = function e(t, n) { if ("object" == typeof t) { var s, r = function e(t) { var n, s = []; for (n in t) i(t, n) && s.push({ unit: n, priority: j[n] }); return s.sort(function (e, t) { return e.priority - t.priority }), s }(t = V(t)), a = r.length; for (s = 0; s < a; s++)this[r[s].unit](t[r[s].unit]) } else if (D(this[t = L(t)])) return this[t](n); return this }, tJ.startOf = function t(n) { var s, i; if (void 0 === (n = L(n)) || "millisecond" === n || !this.isValid()) return this; switch (i = this._isUTC ? tE : t7, n) { case "year": s = i(this.year(), 0, 1); break; case "quarter": s = i(this.year(), this.month() - this.month() % 3, 1); break; case "month": s = i(this.year(), this.month(), 1); break; case "week": s = i(this.year(), this.month(), this.date() - this.weekday()); break; case "isoWeek": s = i(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); break; case "day": case "date": s = i(this.year(), this.month(), this.date()); break; case "hour": s = this._d.valueOf(), s -= tI(s + (this._isUTC ? 0 : 6e4 * this.utcOffset()), t1); break; case "minute": s = this._d.valueOf(), s -= tI(s, 6e4); break; case "second": s = this._d.valueOf(), s -= tI(s, 1e3) }return this._d.setTime(s), e.updateOffset(this, !0), this }, tJ.subtract = t2, tJ.toArray = function e() { return [this.year(), this.month(), this.date(), this.hour(), this.minute(), this.second(), this.millisecond(),] }, tJ.toObject = function e() { return { years: this.year(), months: this.month(), date: this.date(), hours: this.hours(), minutes: this.minutes(), seconds: this.seconds(), milliseconds: this.milliseconds() } }, tJ.toDate = function e() { return new Date(this.valueOf()) }, tJ.toISOString = function e(t) { if (!this.isValid()) return null; var n = !0 !== t, s = n ? this.clone().utc() : this; return 0 > s.year() || s.year() > 9999 ? H(s, n ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ") : D(Date.prototype.toISOString) ? n ? this.toDate().toISOString() : new Date(this.valueOf() + 6e4 * this.utcOffset()).toISOString().replace("Z", H(s, "Z")) : H(s, n ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ") }, tJ.inspect = function e() { if (!this.isValid()) return "moment.invalid(/* " + this._i + " */)"; var t, n, s, i, r = "moment", a = ""; return this.isLocal() || (r = 0 === this.utcOffset() ? "moment.utc" : "moment.parseZone", a = "Z"), t = "[" + r + '("]', n = 0 <= this.year() && 9999 >= this.year() ? "YYYY" : "YYYYYY", s = "-MM-DD[T]HH:mm:ss.SSS", i = a + '[")]', this.format(t + n + s + i) }, "undefined" != typeof Symbol && null != Symbol.for && (tJ[Symbol.for("nodejs.util.inspect.custom")] = function () { return "Moment<" + this.format() + ">" }), tJ.toJSON = function e() { return this.isValid() ? this.toISOString() : null }, tJ.toString = function e() { return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ") }, tJ.unix = function e() { return Math.floor(this.valueOf() / 1e3) }, tJ.valueOf = function e() { return this._d.valueOf() - 6e4 * (this._offset || 0) }, tJ.creationData = function e() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict } }, tJ.eraName = function e() { var t, n, s, i = this.localeData().eras(); for (t = 0, n = i.length; t < n; ++t)if (s = this.clone().startOf("day").valueOf(), i[t].since <= s && s <= i[t].until || i[t].until <= s && s <= i[t].since) return i[t].name; return "" }, tJ.eraNarrow = function e() { var t, n, s, i = this.localeData().eras(); for (t = 0, n = i.length; t < n; ++t)if (s = this.clone().startOf("day").valueOf(), i[t].since <= s && s <= i[t].until || i[t].until <= s && s <= i[t].since) return i[t].narrow; return "" }, tJ.eraAbbr = function e() { var t, n, s, i = this.localeData().eras(); for (t = 0, n = i.length; t < n; ++t)if (s = this.clone().startOf("day").valueOf(), i[t].since <= s && s <= i[t].until || i[t].until <= s && s <= i[t].since) return i[t].abbr; return "" }, tJ.eraYear = function t() { var n, s, i, r, a = this.localeData().eras(); for (n = 0, s = a.length; n < s; ++n)if (i = a[n].since <= a[n].until ? 1 : -1, r = this.clone().startOf("day").valueOf(), a[n].since <= r && r <= a[n].until || a[n].until <= r && r <= a[n].since) return (this.year() - e(a[n].since).year()) * i + a[n].offset; return this.year() }, tJ.year = ev, tJ.isLeapYear = function e() { return e_(this.year()) }, tJ.weekYear = function e(t) { return tZ.call(this, t, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy) }, tJ.isoWeekYear = function e(t) { return tZ.call(this, t, this.isoWeek(), this.isoWeekday(), 1, 4) }, tJ.quarter = tJ.quarters = function e(t) { return null == t ? Math.ceil((this.month() + 1) / 3) : this.month((t - 1) * 3 + this.month() % 3) }, tJ.month = eW, tJ.daysInMonth = function e() { return eM(this.year(), this.month()) }, tJ.week = tJ.weeks = function e(t) { var n = this.localeData().week(this); return null == t ? n : this.add((t - n) * 7, "d") }, tJ.isoWeek = tJ.isoWeeks = function e(t) { var n = eR(this, 1, 4).week; return null == t ? n : this.add((t - n) * 7, "d") }, tJ.weeksInYear = function e() { var t = this.localeData()._week; return e2(this.year(), t.dow, t.doy) }, tJ.weeksInWeekYear = function e() { var t = this.localeData()._week; return e2(this.weekYear(), t.dow, t.doy) }, tJ.isoWeeksInYear = function e() { return e2(this.year(), 1, 4) }, tJ.isoWeeksInISOWeekYear = function e() { return e2(this.isoWeekYear(), 1, 4) }, tJ.date = t6, tJ.day = tJ.days = function e(t) { if (!this.isValid()) return null != t ? this : NaN; var n, s, i = ep(this, "Day"); return null == t ? i : (t = (n = t, s = this.localeData(), "string" != typeof n ? n : isNaN(n) ? "number" == typeof (n = s.weekdaysParse(n)) ? n : null : parseInt(n, 10)), this.add(t - i, "d")) }, tJ.weekday = function e(t) { if (!this.isValid()) return null != t ? this : NaN; var n = (this.day() + 7 - this.localeData()._week.dow) % 7; return null == t ? n : this.add(t - n, "d") }, tJ.isoWeekday = function e(t) { if (!this.isValid()) return null != t ? this : NaN; if (null == t) return this.day() || 7; var n, s, i = (n = t, s = this.localeData(), "string" == typeof n ? s.weekdaysParse(n) % 7 || 7 : isNaN(n) ? null : n); return this.day(this.day() % 7 ? i : i - 7) }, tJ.dayOfYear = function e(t) { var n = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; return null == t ? n : this.add(t - n, "d") }, tJ.hour = tJ.hours = ez, tJ.minute = tJ.minutes = t9, tJ.second = tJ.seconds = tq, tJ.millisecond = tJ.milliseconds = y, tJ.utcOffset = function t(n, s, i) { var r, a = this._offset || 0; if (!this.isValid()) return null != n ? this : NaN; if (null == n) return this._isUTC ? a : tb(this); if ("string" == typeof n) { if (null === (n = tO(ea, n))) return this } else 16 > Math.abs(n) && !i && (n *= 60); return !this._isUTC && s && (r = tb(this)), this._offset = n, this._isUTC = !0, null != r && this.add(r, "m"), a === n || (!s || this._changeInProgress ? tH(this, tP(n - a, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, e.updateOffset(this, !0), this._changeInProgress = null)), this }, tJ.utc = function e(t) { return this.utcOffset(0, t) }, tJ.local = function e(t) { return this._isUTC && (this.utcOffset(0, t), this._isUTC = !1, t && this.subtract(tb(this), "m")), this }, tJ.parseZone = function e() { if (null != this._tzm) this.utcOffset(this._tzm, !1, !0); else if ("string" == typeof this._i) { var t = tO(er, this._i); null != t ? this.utcOffset(t) : this.utcOffset(0, !0) } return this }, tJ.hasAlignedHourOffset = function e(t) { return !!this.isValid() && (t = t ? ty(t).utcOffset() : 0, (this.utcOffset() - t) % 60 == 0) }, tJ.isDST = function e() { return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() }, tJ.isLocal = function e() { return !!this.isValid() && !this._isUTC }, tJ.isUtcOffset = function e() { return !!this.isValid() && this._isUTC }, tJ.isUtc = t0, tJ.isUTC = t0, tJ.zoneAbbr = function e() { return this._isUTC ? "UTC" : "" }, tJ.zoneName = function e() { return this._isUTC ? "Coordinated Universal Time" : "" }, tJ.dates = Y("dates accessor is deprecated. Use date instead.", t6), tJ.months = Y("months accessor is deprecated. Use month instead", eW), tJ.years = Y("years accessor is deprecated. Use year instead", ev), tJ.zone = Y("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", function e(t, n) { return null != t ? ("string" != typeof t && (t = -t), this.utcOffset(t, n), this) : -this.utcOffset() }), tJ.isDSTShifted = Y("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function e() { if (!a(this._isDSTShifted)) return this._isDSTShifted; var t, n = {}; return w(n, this), (n = t$(n))._a ? (t = n._isUTC ? h(n._a) : ty(n._a), this._isDSTShifted = this.isValid() && function e(t, n, s) { var i, r = Math.min(t.length, n.length), a = Math.abs(t.length - n.length), o = 0; for (i = 0; i < r; i++)(s && t[i] !== n[i] || !s && em(t[i]) !== em(n[i])) && o++; return o + a }(n._a, t.toArray()) > 0) : this._isDSTShifted = !1, this._isDSTShifted }); var tX = T.prototype; function tK(e, t, n, s) { var i = te(), r = h().set(s, t); return i[n](r, e) } function ne(e, t, n) { if (o(e) && (t = e, e = void 0), e = e || "", null != t) return tK(e, t, n, "month"); var s, i = []; for (s = 0; s < 12; s++)i[s] = tK(e, s, n, "month"); return i } function nt(e, t, n, s) { "boolean" == typeof e ? (o(t) && (n = t, t = void 0), t = t || "") : (n = t = e, e = !1, o(t) && (n = t, t = void 0), t = t || ""); var i, r = te(), a = e ? r._week.dow : 0, u = []; if (null != n) return tK(t, (n + a) % 7, s, "day"); for (i = 0; i < 7; i++)u[i] = tK(t, (i + a) % 7, s, "day"); return u } tX.calendar = function e(t, n, s) { var i = this._calendar[t] || this._calendar.sameElse; return D(i) ? i.call(n, s) : i }, tX.longDateFormat = function e(t) { var n = this._longDateFormat[t], s = this._longDateFormat[t.toUpperCase()]; return n || !s ? n : (this._longDateFormat[t] = s.match(x).map(function (e) { return "MMMM" === e || "MM" === e || "DD" === e || "dddd" === e ? e.slice(1) : e }).join(""), this._longDateFormat[t]) }, tX.invalidDate = function e() { return this._invalidDate }, tX.ordinal = function e(t) { return this._ordinal.replace("%d", t) }, tX.preparse = tQ, tX.postformat = tQ, tX.relativeTime = function e(t, n, s, i) { var r = this._relativeTime[s]; return D(r) ? r(t, n, s, i) : r.replace(/%d/i, t) }, tX.pastFuture = function e(t, n) { var s = this._relativeTime[t > 0 ? "future" : "past"]; return D(s) ? s(n) : s.replace(/%s/i, n) }, tX.set = function e(t) { var n, s; for (s in t) i(t, s) && (D(n = t[s]) ? this[s] = n : this["_" + s] = n); this._config = t, this._dayOfMonthOrdinalParseLenient = RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source) }, tX.eras = function t(n, s) { var i, r, a, o = this._eras || te("en")._eras; for (i = 0, r = o.length; i < r; ++i)switch ("string" == typeof o[i].since && (a = e(o[i].since).startOf("day"), o[i].since = a.valueOf()), typeof o[i].until) { case "undefined": o[i].until = Infinity; break; case "string": a = e(o[i].until).startOf("day").valueOf(), o[i].until = a.valueOf() }return o }, tX.erasParse = function e(t, n, s) { var i, r, a, o, u, l = this.eras(); for (i = 0, t = t.toUpperCase(), r = l.length; i < r; ++i)if (a = l[i].name.toUpperCase(), o = l[i].abbr.toUpperCase(), u = l[i].narrow.toUpperCase(), s) switch (n) { case "N": case "NN": case "NNN": if (o === t) return l[i]; break; case "NNNN": if (a === t) return l[i]; break; case "NNNNN": if (u === t) return l[i] } else if ([a, o, u].indexOf(t) >= 0) return l[i] }, tX.erasConvertYear = function t(n, s) { var i = n.since <= n.until ? 1 : -1; return void 0 === s ? e(n.since).year() : e(n.since).year() + (s - n.offset) * i }, tX.erasAbbrRegex = function e(t) { return i(this, "_erasAbbrRegex") || tj.call(this), t ? this._erasAbbrRegex : this._erasRegex }, tX.erasNameRegex = function e(t) { return i(this, "_erasNameRegex") || tj.call(this), t ? this._erasNameRegex : this._erasRegex }, tX.erasNarrowRegex = function e(t) { return i(this, "_erasNarrowRegex") || tj.call(this), t ? this._erasNarrowRegex : this._erasRegex }, tX.months = function e(t, s) { return t ? n(this._months) ? this._months[t.month()] : this._months[(this._months.isFormat || eO).test(s) ? "format" : "standalone"][t.month()] : n(this._months) ? this._months : this._months.standalone }, tX.monthsShort = function e(t, s) { return t ? n(this._monthsShort) ? this._monthsShort[t.month()] : this._monthsShort[eO.test(s) ? "format" : "standalone"][t.month()] : n(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone }, tX.monthsParse = function e(t, n, s) { var i, r, a; if (this._monthsParseExact) return e0.call(this, t, n, s); for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), i = 0; i < 12; i++) { if (r = h([2e3, i]), s && !this._longMonthsParse[i] && (this._longMonthsParse[i] = RegExp("^" + this.months(r, "").replace(".", "") + "$", "i"), this._shortMonthsParse[i] = RegExp("^" + this.monthsShort(r, "").replace(".", "") + "$", "i")), s || this._monthsParse[i] || (a = "^" + this.months(r, "") + "|^" + this.monthsShort(r, ""), this._monthsParse[i] = RegExp(a.replace(".", ""), "i")), s && "MMMM" === n && this._longMonthsParse[i].test(t)) return i; if (s && "MMM" === n && this._shortMonthsParse[i].test(t)) return i; if (!s && this._monthsParse[i].test(t)) return i } }, tX.monthsRegex = function e(t) { return this._monthsParseExact ? (i(this, "_monthsRegex") || eP.call(this), t) ? this._monthsStrictRegex : this._monthsRegex : (i(this, "_monthsRegex") || (this._monthsRegex = eb), this._monthsStrictRegex && t ? this._monthsStrictRegex : this._monthsRegex) }, tX.monthsShortRegex = function e(t) { return this._monthsParseExact ? (i(this, "_monthsRegex") || eP.call(this), t) ? this._monthsShortStrictRegex : this._monthsShortRegex : (i(this, "_monthsShortRegex") || (this._monthsShortRegex = eT), this._monthsShortStrictRegex && t ? this._monthsShortStrictRegex : this._monthsShortRegex) }, tX.week = function e(t) { return eR(t, this._week.dow, this._week.doy).week }, tX.firstDayOfYear = function e() { return this._week.doy }, tX.firstDayOfWeek = function e() { return this._week.dow }, tX.weekdays = function e(t, s) { var i = n(this._weekdays) ? this._weekdays : this._weekdays[t && !0 !== t && this._weekdays.isFormat.test(s) ? "format" : "standalone"]; return !0 === t ? e4(i, this._week.dow) : t ? i[t.day()] : i }, tX.weekdaysMin = function e(t) { return !0 === t ? e4(this._weekdaysMin, this._week.dow) : t ? this._weekdaysMin[t.day()] : this._weekdaysMin }, tX.weekdaysShort = function e(t) { return !0 === t ? e4(this._weekdaysShort, this._week.dow) : t ? this._weekdaysShort[t.day()] : this._weekdaysShort }, tX.weekdaysParse = function e(t, n, s) { var i, r, a; if (this._weekdaysParseExact) return eI.call(this, t, n, s); for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), i = 0; i < 7; i++) { if (r = h([2e3, 1]).day(i), s && !this._fullWeekdaysParse[i] && (this._fullWeekdaysParse[i] = RegExp("^" + this.weekdays(r, "").replace(".", "\\.?") + "$", "i"), this._shortWeekdaysParse[i] = RegExp("^" + this.weekdaysShort(r, "").replace(".", "\\.?") + "$", "i"), this._minWeekdaysParse[i] = RegExp("^" + this.weekdaysMin(r, "").replace(".", "\\.?") + "$", "i")), this._weekdaysParse[i] || (a = "^" + this.weekdays(r, "") + "|^" + this.weekdaysShort(r, "") + "|^" + this.weekdaysMin(r, ""), this._weekdaysParse[i] = RegExp(a.replace(".", ""), "i")), s && "dddd" === n && this._fullWeekdaysParse[i].test(t)) return i; if (s && "ddd" === n && this._shortWeekdaysParse[i].test(t)) return i; if (s && "dd" === n && this._minWeekdaysParse[i].test(t)) return i; else if (!s && this._weekdaysParse[i].test(t)) return i } }, tX.weekdaysRegex = function e(t) { return this._weekdaysParseExact ? (i(this, "_weekdaysRegex") || e7.call(this), t) ? this._weekdaysStrictRegex : this._weekdaysRegex : (i(this, "_weekdaysRegex") || (this._weekdaysRegex = eG), this._weekdaysStrictRegex && t ? this._weekdaysStrictRegex : this._weekdaysRegex) }, tX.weekdaysShortRegex = function e(t) { return this._weekdaysParseExact ? (i(this, "_weekdaysRegex") || e7.call(this), t) ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex : (i(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = e1), this._weekdaysShortStrictRegex && t ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) }, tX.weekdaysMinRegex = function e(t) { return this._weekdaysParseExact ? (i(this, "_weekdaysRegex") || e7.call(this), t) ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex : (i(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = eA), this._weekdaysMinStrictRegex && t ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) }, tX.isPM = function e(t) { return "p" === (t + "").toLowerCase().charAt(0) }, tX.meridiem = function e(t, n, s) { return t > 11 ? s ? "pm" : "PM" : s ? "am" : "AM" }, eX("en", { eras: [{ since: "0001-01-01", until: Infinity, offset: 1, name: "Anno Domini", narrow: "AD", abbr: "AD" }, { since: "0000-12-31", until: -1 / 0, offset: 1, name: "Before Christ", narrow: "BC", abbr: "BC" },], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (e) { var t = e % 10, n = 1 === em(e % 100 / 10) ? "th" : 1 === t ? "st" : 2 === t ? "nd" : 3 === t ? "rd" : "th"; return e + n } }), e.lang = Y("moment.lang is deprecated. Use moment.locale instead.", eX), e.langData = Y("moment.langData is deprecated. Use moment.localeData instead.", te); var nn = Math.abs; function ns(e, t, n, s) { var i = tP(t, n); return e._milliseconds += s * i._milliseconds, e._days += s * i._days, e._months += s * i._months, e._bubble() } function ni(e) { return e < 0 ? Math.floor(e) : Math.ceil(e) } function nr(e) { return 4800 * e / 146097 } function na(e) { return 146097 * e / 4800 } function no(e) { return function () { return this.as(e) } } var nu = no("ms"), nl = no("s"), nd = no("m"), nh = no("h"), nc = no("d"), nf = no("w"), nm = no("M"), n$ = no("Q"), n8 = no("y"); function ny(e) { return function () { return this.isValid() ? this._data[e] : NaN } } var ng = ny("milliseconds"), n_ = ny("seconds"), nw = ny("minutes"), nv = ny("hours"), nk = ny("days"), np = ny("months"), nY = ny("years"), nM = Math.round, nS = { ss: 44, s: 45, m: 45, h: 22, d: 26, w: null, M: 11 }; function nD(e, t, n, s, i) { return i.relativeTime(t || 1, !!n, e, s) } var nO = Math.abs; function nT(e) { return (e > 0) - (e < 0) || +e } function nb() { if (!this.isValid()) return this.localeData().invalidDate(); var e, t, n, s, i, r, a, o, u = nO(this._milliseconds) / 1e3, l = nO(this._days), d = nO(this._months), h = this.asSeconds(); return h ? (e = ef(u / 60), t = ef(e / 60), u %= 60, e %= 60, n = ef(d / 12), d %= 12, s = u ? u.toFixed(3).replace(/\.?0+$/, "") : "", i = h < 0 ? "-" : "", r = nT(this._months) !== nT(h) ? "-" : "", a = nT(this._days) !== nT(h) ? "-" : "", o = nT(this._milliseconds) !== nT(h) ? "-" : "", i + "P" + (n ? r + n + "Y" : "") + (d ? r + d + "M" : "") + (l ? a + l + "D" : "") + (t || e || u ? "T" : "") + (t ? o + t + "H" : "") + (e ? o + e + "M" : "") + (u ? o + s + "S" : "")) : "P0D" } var n0, nx = tp.prototype; return nx.isValid = function e() { return this._isValid }, nx.abs = function e() { var t = this._data; return this._milliseconds = nn(this._milliseconds), this._days = nn(this._days), this._months = nn(this._months), t.milliseconds = nn(t.milliseconds), t.seconds = nn(t.seconds), t.minutes = nn(t.minutes), t.hours = nn(t.hours), t.months = nn(t.months), t.years = nn(t.years), this }, nx.add = function e(t, n) { return ns(this, t, n, 1) }, nx.subtract = function e(t, n) { return ns(this, t, n, -1) }, nx.as = function e(t) { if (!this.isValid()) return NaN; var n, s, i = this._milliseconds; if ("month" === (t = L(t)) || "quarter" === t || "year" === t) switch (n = this._days + i / 864e5, s = this._months + nr(n), t) { case "month": return s; case "quarter": return s / 3; case "year": return s / 12 } else switch (n = this._days + Math.round(na(this._months)), t) { case "week": return n / 7 + i / 6048e5; case "day": return n + i / 864e5; case "hour": return 24 * n + i / 36e5; case "minute": return 1440 * n + i / 6e4; case "second": return 86400 * n + i / 1e3; case "millisecond": return Math.floor(864e5 * n) + i; default: throw Error("Unknown unit " + t) } }, nx.asMilliseconds = nu, nx.asSeconds = nl, nx.asMinutes = nd, nx.asHours = nh, nx.asDays = nc, nx.asWeeks = nf, nx.asMonths = nm, nx.asQuarters = n$, nx.asYears = n8, nx.valueOf = nu, nx._bubble = function e() { var t, n, s, i, r, a = this._milliseconds, o = this._days, u = this._months, l = this._data; return a >= 0 && o >= 0 && u >= 0 || a <= 0 && o <= 0 && u <= 0 || (a += 864e5 * ni(na(u) + o), o = 0, u = 0), l.milliseconds = a % 1e3, t = ef(a / 1e3), l.seconds = t % 60, n = ef(t / 60), l.minutes = n % 60, s = ef(n / 60), l.hours = s % 24, o += ef(s / 24), u += r = ef(nr(o)), o -= ni(na(r)), i = ef(u / 12), u %= 12, l.days = o, l.months = u, l.years = i, this }, nx.clone = function e() { return tP(this) }, nx.get = function e(t) { return t = L(t), this.isValid() ? this[t + "s"]() : NaN }, nx.milliseconds = ng, nx.seconds = n_, nx.minutes = nw, nx.hours = nv, nx.days = nk, nx.weeks = function e() { return ef(this.days() / 7) }, nx.months = np, nx.years = nY, nx.humanize = function e(t, n) { if (!this.isValid()) return this.localeData().invalidDate(); var s, i, r, a, o, u, l, d, h, c, f, m, $, y, g, _ = !1, w = nS; return "object" == typeof t && (n = t, t = !1), "boolean" == typeof t && (_ = t), "object" == typeof n && (w = Object.assign({}, nS, n), null != n.s && null == n.ss && (w.ss = n.s - 1)), s = this.localeData(), i = (r = this, a = !_, o = w, u = s, l = tP(r).abs(), d = nM(l.as("s")), h = nM(l.as("m")), c = nM(l.as("h")), f = nM(l.as("d")), m = nM(l.as("M")), $ = nM(l.as("w")), y = nM(l.as("y")), g = d <= o.ss && ["s", d] || d < o.s && ["ss", d] || h <= 1 && ["m"] || h < o.m && ["mm", h] || c <= 1 && ["h"] || c < o.h && ["hh", c] || f <= 1 && ["d"] || f < o.d && ["dd", f], null != o.w && (g = g || $ <= 1 && ["w"] || $ < o.w && ["ww", $]), (g = g || m <= 1 && ["M"] || m < o.M && ["MM", m] || y <= 1 && ["y"] || ["yy", y])[2] = a, g[3] = +r > 0, g[4] = u, nD.apply(null, g)), _ && (i = s.pastFuture(+this, i)), s.postformat(i) }, nx.toISOString = nb, nx.toString = nb, nx.toJSON = nb, nx.locale = tL, nx.localeData = tG, nx.toIsoString = Y("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", nb), nx.lang = tV, N("X", 0, 0, "unix"), N("x", 0, 0, "valueOf"), ed("x", ei), ed("X", /[+-]?\d+(\.\d{1,3})?/), e8("X", function (e, t, n) { n._d = new Date(1e3 * parseFloat(e)) }), e8("x", function (e, t, n) { n._d = new Date(em(e)) }),//! moment.js
		e.version = "2.30.1", G = n0 = ty, e.fn = tJ, e.min = function e() { var t = [].slice.call(arguments, 0); return tw("isBefore", t) }, e.max = function e() { var t = [].slice.call(arguments, 0); return tw("isAfter", t) }, e.now = tv, e.utc = h, e.unix = function e(t) { return ty(1e3 * t) }, e.months = function e(t, n) { return ne(t, n, "months") }, e.isDate = u, e.locale = eX, e.invalid = m, e.duration = tP, e.isMoment = k, e.weekdays = function e(t, n, s) { return nt(t, n, s, "weekdays") }, e.parseZone = function e() { return ty.apply(null, arguments).parseZone() }, e.localeData = te, e.isDuration = tY, e.monthsShort = function e(t, n) { return ne(t, n, "monthsShort") }, e.weekdaysMin = function e(t, n, s) { return nt(t, n, s, "weekdaysMin") }, e.defineLocale = eK, e.updateLocale = function e(t, n) { if (null != n) { var s, i, r = e6; null != e9[t] && null != e9[t].parentLocale ? e9[t].set(O(e9[t]._config, n)) : (null != (i = eQ(t)) && (r = i._config), n = O(r, n), null == i && (n.abbr = t), (s = new T(n)).parentLocale = e9[t], e9[t] = s), eX(t) } else null != e9[t] && (null != e9[t].parentLocale ? (e9[t] = e9[t].parentLocale, t === eX() && eX(t)) : null != e9[t] && delete e9[t]); return e9[t] }, e.locales = function e() { return I(e9) }, e.weekdaysShort = function e(t, n, s) { return nt(t, n, s, "weekdaysShort") }, e.normalizeUnits = L, e.relativeTimeRounding = function e(t) { return void 0 === t ? nM : "function" == typeof t && (nM = t, !0) }, e.relativeTimeThreshold = function e(t, n) { return void 0 !== nS[t] && (void 0 === n ? nS[t] : (nS[t] = n, "s" === t && (nS.ss = n - 1), !0)) }, e.calendarFormat = function e(t, n) { var s = t.diff(n, "days", !0); return s < -6 ? "sameElse" : s < -1 ? "lastWeek" : s < 0 ? "lastDay" : s < 1 ? "sameDay" : s < 2 ? "nextDay" : s < 7 ? "nextWeek" : "sameElse" }, e.prototype = tJ, e.HTML5_FMT = { DATETIME_LOCAL: "YYYY-MM-DDTHH:mm", DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss", DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS", DATE: "YYYY-MM-DD", TIME: "HH:mm", TIME_SECONDS: "HH:mm:ss", TIME_MS: "HH:mm:ss.SSS", WEEK: "GGGG-[W]WW", MONTH: "YYYY-MM" }, e
});
;
/*!
 * Pikaday
 *
 * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
 */

(function (root, factory)
{
    'use strict';

    var moment;
    if (typeof exports === 'object') {
        // CommonJS module
        // Load moment.js as an optional dependency
        try { moment = require('moment'); } catch (e) {}
        module.exports = factory(moment);
    } else if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(function (req)
        {
            // Load moment.js as an optional dependency
            var id = 'moment';
            moment = req.defined && req.defined(id) ? req(id) : undefined;
            return factory(moment);
        });
    } else {
        root.Pikaday = factory(root.moment);
    }
}(this, function (moment)
{
    'use strict';

    /**
     * feature detection and helper functions
     */
    var hasMoment = typeof moment === 'function',

    hasEventListeners = !!window.addEventListener,

    document = window.document,

    sto = window.setTimeout,

    addEvent = function(el, e, callback, capture)
    {
        if (hasEventListeners) {
            el.addEventListener(e, callback, !!capture);
        } else {
            el.attachEvent('on' + e, callback);
        }
    },

    removeEvent = function(el, e, callback, capture)
    {
        if (hasEventListeners) {
            el.removeEventListener(e, callback, !!capture);
        } else {
            el.detachEvent('on' + e, callback);
        }
    },

    fireEvent = function(el, eventName, data)
    {
        var ev;

        if (document.createEvent) {
            ev = document.createEvent('HTMLEvents');
            ev.initEvent(eventName, true, false);
            ev = extend(ev, data);
            el.dispatchEvent(ev);
        } else if (document.createEventObject) {
            ev = document.createEventObject();
            ev = extend(ev, data);
            el.fireEvent('on' + eventName, ev);
        }
    },

    trim = function(str)
    {
        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
    },

    hasClass = function(el, cn)
    {
        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
    },

    addClass = function(el, cn)
    {
        if (!hasClass(el, cn)) {
            el.className = (el.className === '') ? cn : el.className + ' ' + cn;
        }
    },

    removeClass = function(el, cn)
    {
        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));
    },

    isArray = function(obj)
    {
        return (/Array/).test(Object.prototype.toString.call(obj));
    },

    isDate = function(obj)
    {
        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
    },

    isLeapYear = function(year)
    {
        // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951
        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
    },

    getDaysInMonth = function(year, month)
    {
        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
    },

    setToStartOfDay = function(date)
    {
        if (isDate(date)) date.setHours(0,0,0,0);
    },

    compareDates = function(a,b)
    {
        // weak date comparison (use setToStartOfDay(date) to ensure correct result)
        return a.getTime() === b.getTime();
    },

    extend = function(to, from, overwrite)
    {
        var prop, hasProp;
        for (prop in from) {
            hasProp = to[prop] !== undefined;
            if (hasProp && typeof from[prop] === 'object' && from[prop].nodeName === undefined) {
                if (isDate(from[prop])) {
                    if (overwrite) {
                        to[prop] = new Date(from[prop].getTime());
                    }
                }
                else if (isArray(from[prop])) {
                    if (overwrite) {
                        to[prop] = from[prop].slice(0);
                    }
                } else {
                    to[prop] = extend({}, from[prop], overwrite);
                }
            } else if (overwrite || !hasProp) {
                to[prop] = from[prop];
            }
        }
        return to;
    },

    adjustCalendar = function(calendar) {
        if (calendar.month < 0) {
            calendar.year -= Math.ceil(Math.abs(calendar.month)/12);
            calendar.month += 12;
        }
        if (calendar.month > 11) {
            calendar.year += Math.floor(Math.abs(calendar.month)/12);
            calendar.month -= 12;
        }
        return calendar;
    },

    /**
     * defaults and localisation
     */
    defaults = {

        // bind the picker to a form field
        field: null,

        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)
        bound: undefined,

        // position of the datepicker, relative to the field (default to bottom & left)
        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)
        position: 'bottom left',

        // the default output format for `.toString()` and `field` value
        format: 'YYYY-MM-DD',

        // the initial date to view when first opened
        defaultDate: null,

        // make the `defaultDate` the initial selected value
        setDefaultDate: false,

        // first day of week (0: Sunday, 1: Monday etc)
        firstDay: 0,

        // the minimum/earliest date that can be selected
        minDate: null,
        // the maximum/latest date that can be selected
        maxDate: null,

        // number of years either side, or array of upper/lower range
        yearRange: 10,

        // show week numbers at head of row
        showWeekNumber: false,

        // used internally (don't config outside)
        minYear: 0,
        maxYear: 9999,
        minMonth: undefined,
        maxMonth: undefined,

        isRTL: false,

        // Additional text to append to the year in the calendar title
        yearSuffix: '',

        // Render the month after year in the calendar title
        showMonthAfterYear: false,

        // how many months are visible
        numberOfMonths: 1,

        // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)
        // only used for the first display or when a selected date is not visible
        mainCalendar: 'left',

        // Specify a DOM element to render the calendar in
        container: undefined,

        // internationalization
        i18n: {
            previousMonth : 'Previous Month',
            nextMonth     : 'Next Month',
            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
        },

        // callback function
        onSelect: null,
        onOpen: null,
        onClose: null,
        onDraw: null
    },


    /**
     * templating functions to abstract HTML rendering
     */
    renderDayName = function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    },

    renderDay = function(d, m, y, isSelected, isToday, isDisabled, isEmpty)
    {
        if (isEmpty) {
            return '<td class="is-empty"></td>';
        }
        var arr = [];
        if (isDisabled) {
            arr.push('is-disabled');
        }
        if (isToday) {
            arr.push('is-today');
        }
        if (isSelected) {
            arr.push('is-selected');
        }
        return '<td data-day="' + d + '" class="' + arr.join(' ') + '">' +
                 '<button class="pika-button pika-day" type="button" ' +
                    'data-pika-year="' + y + '" data-pika-month="' + m + '" data-pika-day="' + d + '">' +
                        d +
                 '</button>' +
               '</td>';
    },

    renderWeek = function (d, m, y) {
        // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.
        var onejan = new Date(y, 0, 1),
            weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);
        return '<td class="pika-week">' + weekNum + '</td>';
    },

    renderRow = function(days, isRTL)
    {
        return '<tr>' + (isRTL ? days.reverse() : days).join('') + '</tr>';
    },

    renderBody = function(rows)
    {
        return '<tbody>' + rows.join('') + '</tbody>';
    },

    renderHead = function(opts)
    {
        var i, arr = [];
        if (opts.showWeekNumber) {
            arr.push('<th></th>');
        }
        for (i = 0; i < 7; i++) {
            arr.push('<th scope="col"><abbr title="' + renderDayName(opts, i) + '">' + renderDayName(opts, i, true) + '</abbr></th>');
        }
        return '<thead>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</thead>';
    },

    renderTitle = function(instance, c, year, month, refYear)
    {
        var i, j, arr,
            opts = instance._o,
            isMinYear = year === opts.minYear,
            isMaxYear = year === opts.maxYear,
            html = '<div class="pika-title">',
            monthHtml,
            yearHtml,
            prev = true,
            next = true;

        for (arr = [], i = 0; i < 12; i++) {
            arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' +
                (i === month ? ' selected': '') +
                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? 'disabled' : '') + '>' +
                opts.i18n.months[i] + '</option>');
        }
        monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month">' + arr.join('') + '</select></div>';

        if (isArray(opts.yearRange)) {
            i = opts.yearRange[0];
            j = opts.yearRange[1] + 1;
        } else {
            i = year - opts.yearRange;
            j = 1 + year + opts.yearRange;
        }

        for (arr = []; i < j && i <= opts.maxYear; i++) {
            if (i >= opts.minYear) {
                arr.push('<option value="' + i + '"' + (i === year ? ' selected': '') + '>' + (i) + '</option>');
            }
        }
        yearHtml = '<div class="pika-label">' + year + opts.yearSuffix + '<select class="pika-select pika-select-year">' + arr.join('') + '</select></div>';

        if (opts.showMonthAfterYear) {
            html += yearHtml + monthHtml;
        } else {
            html += monthHtml + yearHtml;
        }

        if (isMinYear && (month === 0 || opts.minMonth >= month)) {
            prev = false;
        }

        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {
            next = false;
        }

        if (c === 0) {
            html += '<button class="pika-prev' + (prev ? '' : ' is-disabled') + '" type="button">' + opts.i18n.previousMonth + '</button>';
        }
        if (c === (instance._o.numberOfMonths - 1) ) {
            html += '<button class="pika-next' + (next ? '' : ' is-disabled') + '" type="button">' + opts.i18n.nextMonth + '</button>';
        }

        return html += '</div>';
    },

    renderTable = function(opts, data)
    {
        return '<table cellpadding="0" cellspacing="0" class="pika-table">' + renderHead(opts) + renderBody(data) + '</table>';
    },


    /**
     * Pikaday constructor
     */
    Pikaday = function(options)
    {
        var self = this,
            opts = self.config(options);

        self._onMouseDown = function(e)
        {
            if (!self._v) {
                return;
            }
            e = e || window.event;
            var target = e.target || e.srcElement;
            if (!target) {
                return;
            }

            if (!hasClass(target, 'is-disabled')) {
                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) {
                    self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));
                    if (opts.bound) {
                        sto(function() {
                            self.hide();
                            if (opts.field) {
                                opts.field.blur();
                            }
                        }, 100);
                    }
                    return;
                }
                else if (hasClass(target, 'pika-prev')) {
                    self.prevMonth();
                }
                else if (hasClass(target, 'pika-next')) {
                    self.nextMonth();
                }
            }
            if (!hasClass(target, 'pika-select')) {
                if (e.preventDefault) {
                    e.preventDefault();
                } else {
                    e.returnValue = false;
                    return false;
                }
            } else {
                self._c = true;
            }
        };

        self._onChange = function(e)
        {
            e = e || window.event;
            var target = e.target || e.srcElement;
            if (!target) {
                return;
            }
            if (hasClass(target, 'pika-select-month')) {
                self.gotoMonth(target.value);
            }
            else if (hasClass(target, 'pika-select-year')) {
                self.gotoYear(target.value);
            }
        };

        self._onInputChange = function(e)
        {
            var date;

            if (e.firedBy === self) {
                return;
            }
            if (hasMoment) {
                date = moment(opts.field.value, opts.format);
                date = (date && date.isValid()) ? date.toDate() : null;
            }
            else {
                date = new Date(Date.parse(opts.field.value));
            }
            self.setDate(isDate(date) ? date : null);
            if (!self._v) {
                self.show();
            }
        };

        self._onInputFocus = function()
        {
            self.show();
        };

        self._onInputClick = function()
        {
            self.show();
        };

        self._onInputBlur = function()
        {
            if (!self._c) {
                self._b = sto(function() {
                    self.hide();
                }, 50);
            }
            self._c = false;
        };

        self._onClick = function(e)
        {
            e = e || window.event;
            var target = e.target || e.srcElement,
                pEl = target;
            if (!target) {
                return;
            }
            if (!hasEventListeners && hasClass(target, 'pika-select')) {
                if (!target.onchange) {
                    target.setAttribute('onchange', 'return;');
                    addEvent(target, 'change', self._onChange);
                }
            }
            do {
                if (hasClass(pEl, 'pika-single')) {
                    return;
                }
            }
            while ((pEl = pEl.parentNode));
            if (self._v && target !== opts.trigger) {
                self.hide();
            }
        };

        self.el = document.createElement('div');
        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '');

        addEvent(self.el, 'mousedown', self._onMouseDown, true);
        addEvent(self.el, 'change', self._onChange);

        if (opts.field) {
            if (opts.container) {
                opts.container.appendChild(self.el);
            } else if (opts.bound) {
                document.body.appendChild(self.el);
            } else {
                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);
            }
            addEvent(opts.field, 'change', self._onInputChange);

            if (!opts.defaultDate) {
                if (hasMoment && opts.field.value) {
                    opts.defaultDate = moment(opts.field.value, opts.format).toDate();
                } else {
                    opts.defaultDate = new Date(Date.parse(opts.field.value));
                }
                opts.setDefaultDate = true;
            }
        }

        var defDate = opts.defaultDate;

        if (isDate(defDate)) {
            if (opts.setDefaultDate) {
                self.setDate(defDate, true);
            } else {
                self.gotoDate(defDate);
            }
        } else {
            self.gotoDate(new Date());
        }

        if (opts.bound) {
            this.hide();
            self.el.className += ' is-bound';
            addEvent(opts.trigger, 'click', self._onInputClick);
            addEvent(opts.trigger, 'focus', self._onInputFocus);
            addEvent(opts.trigger, 'blur', self._onInputBlur);
        } else {
            this.show();
        }
    };


    /**
     * public Pikaday API
     */
    Pikaday.prototype = {


        /**
         * configure functionality
         */
        config: function(options)
        {
            if (!this._o) {
                this._o = extend({}, defaults, true);
            }

            var opts = extend(this._o, options, true);

            opts.isRTL = !!opts.isRTL;

            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;

            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);

            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;

            var nom = parseInt(opts.numberOfMonths, 10) || 1;
            opts.numberOfMonths = nom > 4 ? 4 : nom;

            if (!isDate(opts.minDate)) {
                opts.minDate = false;
            }
            if (!isDate(opts.maxDate)) {
                opts.maxDate = false;
            }
            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {
                opts.maxDate = opts.minDate = false;
            }
            if (opts.minDate) {
                setToStartOfDay(opts.minDate);
                opts.minYear  = opts.minDate.getFullYear();
                opts.minMonth = opts.minDate.getMonth();
            }
            if (opts.maxDate) {
                setToStartOfDay(opts.maxDate);
                opts.maxYear  = opts.maxDate.getFullYear();
                opts.maxMonth = opts.maxDate.getMonth();
            }

            if (isArray(opts.yearRange)) {
                var fallback = new Date().getFullYear() - 10;
                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;
                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;
            } else {
                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;
                if (opts.yearRange > 100) {
                    opts.yearRange = 100;
                }
            }

            return opts;
        },

        /**
         * return a formatted string of the current selection (using Moment.js if available)
         */
        toString: function(format)
        {
            return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
        },

        /**
         * return a Moment.js object of the current selection (if available)
         */
        getMoment: function()
        {
            return hasMoment ? moment(this._d) : null;
        },

        /**
         * set the current selection from a Moment.js object (if available)
         */
        setMoment: function(date, preventOnSelect)
        {
            if (hasMoment && moment.isMoment(date)) {
                this.setDate(date.toDate(), preventOnSelect);
            }
        },

        /**
         * return a Date object of the current selection
         */
        getDate: function()
        {
            return isDate(this._d) ? new Date(this._d.getTime()) : null;
        },

        /**
         * set the current selection
         */
        setDate: function(date, preventOnSelect)
        {
            if (!date) {
                this._d = null;
                return this.draw();
            }
            if (typeof date === 'string') {
                date = new Date(Date.parse(date));
            }
            if (!isDate(date)) {
                return;
            }

            var min = this._o.minDate,
                max = this._o.maxDate;

            if (isDate(min) && date < min) {
                date = min;
            } else if (isDate(max) && date > max) {
                date = max;
            }

            this._d = new Date(date.getTime());
            setToStartOfDay(this._d);
            this.gotoDate(this._d);

            if (this._o.field) {
                this._o.field.value = this.toString();
                fireEvent(this._o.field, 'change', { firedBy: this });
            }
            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
                this._o.onSelect.call(this, this.getDate());
            }
        },

        /**
         * change view to a specific date
         */
        gotoDate: function(date)
        {
            var newCalendar = true;

            if (!isDate(date)) {
                return;
            }

            if (this.calendars) {
                var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),
                    lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),
                    visibleDate = date.getTime();
                // get the end of the month
                lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);
                lastVisibleDate.setDate(lastVisibleDate.getDate()-1);
                newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);
            }

            if (newCalendar) {
                this.calendars = [{
                    month: date.getMonth(),
                    year: date.getFullYear()
                }];
                if (this._o.mainCalendar === 'right') {
                    this.calendars[0].month += 1 - this._o.numberOfMonths;
                }
            }

            this.adjustCalendars();
        },

        adjustCalendars: function() {
            this.calendars[0] = adjustCalendar(this.calendars[0]);
            for (var c = 1; c < this._o.numberOfMonths; c++) {
                this.calendars[c] = adjustCalendar({
                    month: this.calendars[0].month + c,
                    year: this.calendars[0].year
                });
            }
            this.draw();
        },

        gotoToday: function()
        {
            this.gotoDate(new Date());
        },

        /**
         * change view to a specific month (zero-index, e.g. 0: January)
         */
        gotoMonth: function(month)
        {
            if (!isNaN(month)) {
                this.calendars[0].month = parseInt(month, 10);
                this.adjustCalendars();
            }
        },

        nextMonth: function()
        {
            this.calendars[0].month++;
            this.adjustCalendars();
        },

        prevMonth: function()
        {
            this.calendars[0].month--;
            this.adjustCalendars();
        },

        /**
         * change view to a specific full year (e.g. "2012")
         */
        gotoYear: function(year)
        {
            if (!isNaN(year)) {
                this.calendars[0].year = parseInt(year, 10);
                this.adjustCalendars();
            }
        },

        /**
         * change the minDate
         */
        setMinDate: function(value)
        {
            this._o.minDate = value;
        },

        /**
         * change the maxDate
         */
        setMaxDate: function(value)
        {
            this._o.maxDate = value;
        },

        /**
         * refresh the HTML
         */
        draw: function(force)
        {
            if (!this._v && !force) {
                return;
            }
            var opts = this._o,
                minYear = opts.minYear,
                maxYear = opts.maxYear,
                minMonth = opts.minMonth,
                maxMonth = opts.maxMonth,
                html = '';

            if (this._y <= minYear) {
                this._y = minYear;
                if (!isNaN(minMonth) && this._m < minMonth) {
                    this._m = minMonth;
                }
            }
            if (this._y >= maxYear) {
                this._y = maxYear;
                if (!isNaN(maxMonth) && this._m > maxMonth) {
                    this._m = maxMonth;
                }
            }

            for (var c = 0; c < opts.numberOfMonths; c++) {
                html += '<div class="pika-lendar">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '</div>';
            }

            this.el.innerHTML = html;

            if (opts.bound) {
                if(opts.field.type !== 'hidden') {
                    sto(function() {
                        opts.trigger.focus();
                    }, 1);
                }
            }

            if (typeof this._o.onDraw === 'function') {
                var self = this;
                sto(function() {
                    self._o.onDraw.call(self);
                }, 0);
            }
        },

        adjustPosition: function()
        {
            if (this._o.container) return;
            var field = this._o.trigger, pEl = field,
            width = this.el.offsetWidth, height = this.el.offsetHeight,
            viewportWidth = window.innerWidth || document.documentElement.clientWidth,
            viewportHeight = window.innerHeight || document.documentElement.clientHeight,
            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop,
            left, top, clientRect;

            if (typeof field.getBoundingClientRect === 'function') {
                clientRect = field.getBoundingClientRect();
                left = clientRect.left + window.pageXOffset;
                top = clientRect.bottom + window.pageYOffset;
            } else {
                left = pEl.offsetLeft;
                top  = pEl.offsetTop + pEl.offsetHeight;
                while((pEl = pEl.offsetParent)) {
                    left += pEl.offsetLeft;
                    top  += pEl.offsetTop;
                }
            }

            // default position is bottom & left
            if (left + width > viewportWidth ||
                (
                    this._o.position.indexOf('right') > -1 &&
                    left - width + field.offsetWidth > 0
                )
            ) {
                left = left - width + field.offsetWidth;
            }
            if (top + height > viewportHeight + scrollTop ||
                (
                    this._o.position.indexOf('top') > -1 &&
                    top - height - field.offsetHeight > 0
                )
            ) {
                top = top - height - field.offsetHeight;
            }
            this.el.style.cssText = [
                'position: absolute',
                'left: ' + left + 'px',
                'top: ' + top + 'px'
            ].join(';');
        },

        /**
         * render HTML for a particular month
         */
        render: function(year, month)
        {
            var opts   = this._o,
                now    = new Date(),
                days   = getDaysInMonth(year, month),
                before = new Date(year, month, 1).getDay(),
                data   = [],
                row    = [];
            setToStartOfDay(now);
            if (opts.firstDay > 0) {
                before -= opts.firstDay;
                if (before < 0) {
                    before += 7;
                }
            }
            var cells = days + before,
                after = cells;
            while(after > 7) {
                after -= 7;
            }
            cells += 7 - after;
            for (var i = 0, r = 0; i < cells; i++)
            {
                var day = new Date(year, month, 1 + (i - before)),
                    isDisabled = (opts.minDate && day < opts.minDate) || (opts.maxDate && day > opts.maxDate),
                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,
                    isToday = compareDates(day, now),
                    isEmpty = i < before || i >= (days + before);

                row.push(renderDay(1 + (i - before), month, year, isSelected, isToday, isDisabled, isEmpty));

                if (++r === 7) {
                    if (opts.showWeekNumber) {
                        row.unshift(renderWeek(i - before, month, year));
                    }
                    data.push(renderRow(row, opts.isRTL));
                    row = [];
                    r = 0;
                }
            }
            return renderTable(opts, data);
        },

        isVisible: function()
        {
            return this._v;
        },

        show: function()
        {
            if (!this._v) {
                removeClass(this.el, 'is-hidden');
                this._v = true;
                this.draw();
                if (this._o.bound) {
                    addEvent(document, 'click', this._onClick);
                    this.adjustPosition();
                }
                if (typeof this._o.onOpen === 'function') {
                    this._o.onOpen.call(this);
                }
            }
        },

        hide: function()
        {
            var v = this._v;
            if (v !== false) {
                if (this._o.bound) {
                    removeEvent(document, 'click', this._onClick);
                }
                this.el.style.cssText = '';
                addClass(this.el, 'is-hidden');
                this._v = false;
                if (v !== undefined && typeof this._o.onClose === 'function') {
                    this._o.onClose.call(this);
                }
            }
        },

        /**
         * GAME OVER
         */
        destroy: function()
        {
            this.hide();
            removeEvent(this.el, 'mousedown', this._onMouseDown, true);
            removeEvent(this.el, 'change', this._onChange);
            if (this._o.field) {
                removeEvent(this._o.field, 'change', this._onInputChange);
                if (this._o.bound) {
                    removeEvent(this._o.trigger, 'click', this._onInputClick);
                    removeEvent(this._o.trigger, 'focus', this._onInputFocus);
                    removeEvent(this._o.trigger, 'blur', this._onInputBlur);
                }
            }
            if (this.el.parentNode) {
                this.el.parentNode.removeChild(this.el);
            }
        }

    };

    return Pikaday;

}));
;
'use strict';

angular.module('angularPikaday', [])
  .directive('pikaday', function() {
  return {
    restrict: 'A',
    scope: {
      pikaday: '='
    },
    link: function (scope, elem, attrs) {

      var picker = new Pikaday({

        field: elem[0],
        trigger: document.getElementById(attrs.triggerId),
        bound: attrs.bound !== 'false',
        position: attrs.position || '',
        format: attrs.format || 'ddd MMM D YYYY', // Requires Moment.js for custom formatting
        defaultDate: !attrs.defaultDate || moment(attrs.defaultDate, attrs.format).toDate(),
        setDefaultDate: attrs.setDefaultDate === 'true',
        firstDay: attrs.firstDay ? parseInt(attrs.firstDay) : 0,
        minDate: !attrs.minDate || moment(attrs.minDate, attrs.format).toDate(),
        maxDate: !attrs.maxDate || moment(attrs.maxDate, attrs.format).toDate(),
        yearRange: attrs.yearRange ? JSON.parse(attrs.yearRange) : [1930, new Date().getFullYear() + 84], // Accepts int (10) or 2 elem array ([1992, 1998]) as strings
        isRTL: attrs.isRTL === 'true',
        i18n: {
          previousMonth : 'Previous Month',
          nextMonth     : 'Next Month',
          months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],
          weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
          weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
        },
        yearSuffix: attrs.yearSuffix || '',
        showMonthAfterYear: attrs.showMonthAfterYear === 'true',

        onSelect: function () {
          setTimeout(function(){
            scope.$apply();
          });
        }
      });
      scope.pikaday = picker;

      scope.$on('$destroy', function () {
        picker.destroy();
      });

      // re-adjust position after change
      $( window ).on( "orientationchange", function( event ) {
          setTimeout(function(){
              picker.adjustPosition();
          },500);
      });

    }
  };
});
;
/*
Version: 2.1.5
Date:2017-01-06
 */
/**
 Bootstrap
**/
(function (exports) {
    var ns = 'app';
    exports[ns] = angular.module(ns, ['angularPikaday', 'ui.utils.masks', 'ngResource', 'ngSanitize', 'webchatApp.callback', 'webchatApp.webchat']);
}((typeof exports === 'undefined') ? window : exports));


/**
 *  change angular from {{ to [[
 */
(function (exports) {
    (function (exports) {
        exports.config(['$interpolateProvider', function ($interpolateProvider) {
            $interpolateProvider.startSymbol('[[').endSymbol(']]');
        }]);
    })((typeof exports === 'undefined') ? window : exports);
})(app);







;
/**
 * FACTORY - Dt Readi Map Factory
 * Map model managing data to all readi directives gets request marker data from service.
 */
(function(module) {
    module.factory('dtRediMapFactory', ['$q', '$http', 'EventService', '$timeout',  function($q, $http, EventService, $timeout) {

        /**
         * Properties
         * @type {Array}
         * @private
         */
        var _mapCallback,
        	_markers = {data: {
                "GetAtmsByLocationResult": [

                    {
                        "Latitude": "-33.8592593",
                        "Longitude": "151.207865",
                        "ShopName": "Clocktower Shopping Centre",
                        "Name": "The Rocks",
                        "Address": "35 Harrington Street",
                        "Suburb": "The Rocks",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Distance": "164 meters",
                        "DepositCapability": "No",
						"OpeningClosingTimes": "Business Hours"
                    },
                    {
                        "Latitude": "-33.86162",
                        "Longitude": "151.2111",
                        "ShopName": "Circular Quay 2",
                        "Name": "Sydney",
                        "Address": "Alfred Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "Westpac",
                        "Distance": "200 kms",
                        "DepositCapability": "Yes",
						"OpeningClosingTimes": "SetHours/ 24/7"
                    },
                    {
                        "Latitude": "-33.86162",
                        "Longitude": "151.2111",
                        "ShopName": "Circular Quay 1",
                        "Name": "Sydney",
                        "Address": "Alfred Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Distance": 239.13851509658264
                    },
                    {
                        "Latitude": "-33.86259",
                        "Longitude": "151.21154",
                        "ShopName": "AMP Plaza",
                        "Name": "Sydney",
                        "Address": "50 Bridge Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 349.56588382192228
                    },
                    {
                        "Latitude": "-33.8643145",
                        "Longitude": "151.2115936",
                        "ShopName": "Governor Phillip Tower",
                        "Name": "Sydney",
                        "Address": "1 Farrer Place",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 521.20348952916481
                    },
                    {
                        "Latitude": "-33.8645483",
                        "Longitude": "151.2073834",
                        "ShopName": "Australia Square",
                        "Name": "Sydney",
                        "Address": "264 George Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 539.4008904828554
                    },
                    {
                        "Latitude": "-33.864861",
                        "Longitude": "151.20905",
                        "ShopName": "10 Spring Street",
                        "Name": "Sydney",
                        "Address": "10 Spring Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 541.95122090793711
                    },
                    {
                        "Latitude": "-33.86473",
                        "Longitude": "151.20676",
                        "ShopName": "Metcentre",
                        "Name": "Sydney",
                        "Address": "273 George Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 580.19444828640542
                    },
                    {
                        "Latitude": "-33.85753338",
                        "Longitude": "151.21494054",
                        "ShopName": "Sydney Opera House",
                        "Name": "Sydney",
                        "Address": "Macquarie Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 580.98607453074032
                    },
                    {
                        "Latitude": "-33.8648987",
                        "Longitude": "151.2070098",
                        "ShopName": "Metcentre2",
                        "Name": "Sydney",
                        "Address": "273 George Street",
                        "Suburb": "Sydney",
                        "ZipCode": "2000",
                        "State": "NSW",
                        "Source": "NAB",
                        "Distance": 588.22876697028653
                    }
                ]
            }
            };


        /**
         * Events for dispatching
         * @type {{ON_DATA_UPDATE: string, ON_MAP_POSITION_UPDATE: string}}
         */
        var events = {
            ON_DATA_UPDATE: 'dt.redi.map.factory.on.data.update',
            ON_MAP_POSITION_UPDATE: 'dt.redi.map.factory.on.map.position.update'
        };

        /**
         * Return markers
         * @returns {Array}
         */
        function getMakers() {
            return _markers.data;
        };

        /**
         * Set map to specific location
         * @param obj
         */
        function showDirection(obj) {
            if(angular.isUndefined(obj)) return;
            EventService.dispatch(events.ON_MAP_POSITION_UPDATE, obj);
            // when a item in the menu is clicked we also open the infoWindow for the marker
            if (obj.marker) {
            	new google.maps.event.trigger(obj.marker, 'click');
            	obj.marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1);
            }
        };

        /**
         * Ajax request for new location dataset
         */
        function requestLocation(obj, apiURL) {
            if(angular.isUndefined(apiURL)) throw  'Require apiURL';
            if(angular.isUndefined(obj)) throw 'Request object required';

           $http({
                method: 'POST',
                url: apiURL,
                data: JSON.stringify(obj),
                responseType: 'JSON'
           }).then(
                function (data) {
                  var result =  angular.fromJson(JSON.parse(data.data));
                   EventService.dispatch(events.ON_DATA_UPDATE, { status: 'success', result: result});
               },
               function(e) {
                   EventService.dispatch(events.ON_DATA_UPDATE, { status: 'error', result: {}});
               }
           );
        };

        /**
         * Public accessor
         */
        return {
            getMakers: getMakers,
            showDirection: showDirection,
            requestLocation: requestLocation,
            events: events
        };
    }]);
} (app));







/**
 * DIRECTIVE - DT Readi Search -
 */
(function(module) {
    module.directive('dtRediSearch', ['dtRediMapFactory','GeoService', function(dtReadiMapFactory, GeoService) {
        return {
            restrict: 'A',
            scope: true,
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                //Todo - need validation requirements.

                /**
                 * Search field model
                 * @type {string}
                 */
                $scope.searchResult;

                /**
                 * HTML5 Lat long - applied here due to be the core component for all location request to api.
                 * (OPTIONAL FEATURE)
                 */
                GeoService().then(function(position) {
                    if(angular.isUndefined(position)) return;
                    makeRequestByLatLon(position);
                });

                /**
                 * Provide lat lon this would occur from geoservice.
                 * @param latlon
                 */
                function makeRequestByLatLon(latlon) {
                    if(angular.isUndefined(latlon)) throw 'Lat Lon required';
                    dtReadiMapFactory.requestLocation(latlon, $attrs.apiLatlonUrl);
                };


                /*
                Initiate Google place insert reference from the input element.
                 */
                if(angular.isUndefined($attrs.inputEl)) throw 'Please specify Input element';
                var inputEl = $element.find($attrs.inputEl);


                var opt = {
                    componentRestrictions: {country: "au"}
                };
                var autocomplete = new google.maps.places.Autocomplete(inputEl[0], opt);

                // over ride event listeners on input so we can detect enter key and select first item from dropdown
                (function pacSelectFirst(input) {
                    // store the original event binding function
                    var _addEventListener = (input.addEventListener) ? input.addEventListener : input.attachEvent;

                    function addEventListenerWrapper(type, listener) {
                        // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected,
                        // and then trigger the original listener.
                        if (type == "keydown") {
                            var orig_listener = listener;
                            listener = function(event) {
                                var suggestion_selected = $(".pac-item-selected").length > 0;
                                if (event.which == 13 && !suggestion_selected) {
                                    var simulated_downarrow = $.Event("keydown", {
                                        keyCode: 40,
                                        which: 40
                                    });
                                    orig_listener.apply(input, [simulated_downarrow]);
                                }

                                orig_listener.apply(input, [event]);
                            };
                        }

                        _addEventListener.apply(input, [type, listener]);
                    }

                    input.addEventListener = addEventListenerWrapper;
                    input.attachEvent = addEventListenerWrapper;
                    autocomplete = new google.maps.places.Autocomplete(input, opt);

                })(inputEl[0]);

                /**
                 * Reset the input value on focus
                 */
                inputEl.attr("data-previous-value","");
                inputEl.on("focus", function() {
                    var $el = $(this);
                    $el.attr("data-previous-value", $el.val()).val("");
                }).on("blur", function() {
                    var $el = $(this);
                    $el.val($el.attr("data-previous-value")).attr("data-previous-value","");
                });

                /**
                 * Event - User enters location
                 */
                google.maps.event.addListener(autocomplete, 'place_changed', function() {

                    var place = autocomplete.getPlace();
                    // console.log('place', place);
                    if (!place.geometry) {
                		return;
                    }

                    //Todo - validate if this is the correct lat, lng
                    var obj = {
                        lat:    place.geometry.location.lat(),
                        lng:    place.geometry.location.lng()
                    };

                    makeRequestByLatLon(obj);
                });






                $scope.isInputInvalid = function(type, requirement) {
                    return $scope.formSearch[type].$error[requirement] && !$scope.formSearch[type].$pristine;
                };

                /**
                 * Return ture if the form is invalid
                 * @returns {boolean|Oc.$invalid|*|Ue.$invalid|Ue.$setValidity.$invalid|FormController.$invalid}
                 */
                $scope.isSearchInvalid = function() {
                    return $scope.formSearch.$invalid;
                };

            }]
        };
    }]);
} (app));




/**
 * DIRECTIVE - DT Readi Map - Display google map with locations of Readi ATM's.
 * Display custom pins.
 */
(function(module) {
    module.directive('dtRediMap', ['dtRediMapFactory',  function(dtReadiMapFactory) {
        return {
            restrict: 'A',
            scope: { markerIcon: '@', mapZoom: '@' },
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                //Todo - 2. Suburb / Postcode request field / create service to make request with required param

                var _isInit = true;

                /**
                 * Generate map instance
                 * @type {exports.ecmaIdentifiers.Map}
                 * @private
                 */
                var _mapInstance = _getMapInstance($element[0]), _markerCollection;


                // marker arrays, used to store marker points so we can clear when re-drawing data
                var markersArray = [];
                // array of info windows for each marker
                var infoWindowArray = [];


                /**
                 * EVENT - ON DATA UPDATE
                 */
                $scope.$on(dtReadiMapFactory.events.ON_DATA_UPDATE, function(e, value) {
                	if(value.status === 'success') {
                        if(angular.isUndefined(value.result.data)) return;

                        _markerCollection = value.result.data;

                        // Apply markers onto map based on request, this needs to be hooked up to a service.
                        _applyMarkers(_mapInstance, _markerCollection, $scope.markerIcon);

                    } else {
                		/*// console.log("Test Data", dtReadiMapFactory.getMakers().GetAtmsByLocationResult);
                		_markerCollection = dtReadiMapFactory.getMakers();
                		_applyMarkers(_mapInstance, _markerCollection.GetAtmsByLocationResult, $scope.markerIcon);*/
                    }
                });




                /**
                 * Event - Map position update
                 */
                $scope.$on(dtReadiMapFactory.events.ON_MAP_POSITION_UPDATE, function(e, value) {
                    var lat = value.Latitude, lon = value.Longitude;
                    _setMapPosition(_mapInstance, lat, lon);
                    _setMapZoom(_mapInstance, parseInt($scope.mapZoom));
                });




                /**
                 * Return instance of map
                 * @param element
                 * @param options
                 * @returns {exports.ecmaIdentifiers.Map}
                 * @private
                 */
                function _getMapInstance(element, options) {
                    if(typeof google === 'undefined') return;
                    var currentOptions,
                        defaultOptions = {
                            zoom: 4,
                            center: new google.maps.LatLng( -28, 134),
                            panControl: true,
                            zoomControl: true,
                            mapTypeControl: false,
                            scaleControl: false,
                            streetViewControl: false,
                            overviewMapControl: false
                        };
                    options = options || {};
                    currentOptions = angular.extend(defaultOptions, options);
                    return  new google.maps.Map(element, currentOptions);
                };



                /**
                 * Set position of map
                 * @param map
                 * @param lat
                 * @param lon
                 * @private
                 */
                function _setMapPosition(map,lat, lon) {
                    if(angular.isUndefined(map)) throw 'Map instance required';
                    if(angular.isUndefined(lat)) throw 'Require Lat value';
                    if(angular.isUndefined(lon)) throw 'Require Lon Value';
                    map.setCenter(new google.maps.LatLng( lat, lon ));
                };


                /**
                 * Set zoom position from 0 - 20
                 * @param map
                 * @param zoom
                 * @private
                 */
                function _setMapZoom(map, zoom) {
                    if(angular.isUndefined(map)) throw 'Map instance required';
                    if(angular.isUndefined(zoom)) throw 'Require Map zoom value';
                    map.setZoom(zoom);
                };


                /**
                 * Apply markers to map,
                 * @param map
                 * @param collection
                 * @param icon
                 * @private
                 */
                function _applyMarkers(map, collection, icon, shadow) {
                    if(angular.isUndefined(collection)) throw 'Marker collection required';

                    // clear markers already added to the map
                    _clearOverlays();

                    angular.forEach(collection, function(item, index) {
                        var latLon = getGoogleLatLon(item.Latitude, item.Longitude);
                        // icon name replaces <number> with the index value
                        var iconName = icon.replace("<number>", (index+1));
                        var marker = _addIcon(map, latLon, iconName, item);
                        markersArray.push(marker);
                        item.marker = marker;
                    });

                };

                /**
                 * Apply map icon to map
                 * @param map
                 * @param obj
                 * @private
                 */
                function _addIcon (map, latlon, icon, item) {
                    if(angular.isUndefined(latlon)) throw 'Google LatLon Instance required';
                    if(angular.isUndefined(map)) throw 'Map instance required';
                    if(angular.isUndefined(google)) throw 'Google library required';

                    // shape of clickable region
                    var shape = {
						coords: [0,21,22,0,42,22,22,46],
						type: 'poly'
					};
					// marker information
                    var marker = new google.maps.Marker({
                        position: latlon,
                        map: map,
                        icon: icon,
      					shape: shape
                    });

                    //console.log('item', item);

                    var contentStringRdr,
                    	openningAndDeposit = "",
                    	_depositCapability = (item.DepositCapability) ? '<b>Accepts Deposits:</b> ' + item.DepositCapability + '<br>' : "",
                    	_openningClosingTimes = (item.OpeningClosingTimes) ? '<b>Opening Times:</b> ' + item.OpeningClosingTimes + '<br>' : "",
                        _source = (item.Source) ? 'This ATM is operated by ' + item.Source + '<br>' : "";

                     if (_depositCapability || _openningClosingTimes) {
                     	openningAndDeposit = '<p>' +
		                	_depositCapability+
		                	_openningClosingTimes+
		                	'</p>';
                     }
                	contentStringRdr = '<div class="pl26-redi-marker">'+
		                '<h2 class="pl26-redi-marker-shopname">' + item.ShopName + '</h2>'+
		                '<div class="pl26-redi-marker-content">'+
		                	'<p>' + item.Address + '<br>'+
		                	item.Suburb + ' ' + item.State + ' ' + item.ZipCode + '</p>'+
		                	'<p>' + item.Distance + '</p>'+
		                	openningAndDeposit +
		                	'<p>' +
		                	_source+
		                	'</p>'+
		                '</div>'+
	                '</div>';

                    // console.log(_source, _depositCapability, _openningClosingTimes);

		            var infowindow = new google.maps.InfoWindow({
		                content: contentStringRdr
		            });
		            infoWindowArray.push(infowindow);

                    // marker click
                    google.maps.event.addListener(marker, 'click', function() {
	                       // console.log('marker', marker);
	                       // map.setCenter(marker.getPosition());
						   _closeInfoWindows();
						   infowindow.open(map, marker);
						   // var markerPosition = marker.getPosition();
						   // 	var location = new google.maps.LatLng(markerPosition.lat(), markerPosition.lng() - .0001);
						   // 	map.panTo(location);
						   //
	                });
	                // marker hover
	                google.maps.event.addListener(marker, 'mouseover', function() {
	                       marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1);
	                });
                    return marker;

                };

                function _closeInfoWindows() {
                  for (var i=0; i<infoWindowArray.length; i++) {
                     infoWindowArray[i].close();
                  }
                }

                /**
                 * Clear map markers
                 * @param map
                 * @param obj
                 * @private
                 */
                function _clearOverlays () {
                    for (var i = 0; i < markersArray.length; i++ ) {
                        markersArray[i].setMap(null);
                    }
                    markersArray.length = 0;
                };

                /**
                 * Return google readable lat lon / May not need this.
                 * @param lat
                 * @param lon
                 * @returns {google.maps.LatLng}
                 */
                function getGoogleLatLon(lat, lon) {
                    if(angular.isUndefined(google)) throw 'Google library required';
                    return  new google.maps.LatLng(lat, lon);
                }


            }]
        };
    }]);
} (app));





/**
 * DIRECTIVE - DT Read List - Display list of locations
 * User can select list item and map will update to reflect location.
 */
(function(module) {
    module.directive('dtRediList', ['dtRediMapFactory', '$timeout',  function(dtReadiMapFactory, $timeout) {
        return {
            restrict: 'A',
            scope:false,
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                // Number of address per view
                $scope.itemsPerView = 3;

                // View state for more button
                $scope.isMore = true;
                $scope.isActive = false;

                $scope.markers = [];




                /**
                 * EVENT - ON DATA UPDATE
                 */
                $scope.$on(dtReadiMapFactory.events.ON_DATA_UPDATE, function(e, value) {
                    if(value.status === 'success') {

                        if(angular.isUndefined(value.result.data)) return;

                        $scope.markers = value.result.data;

                        //Make list visible when results are available.
                        $scope.isActive = true;

                        _determineLimitRange();
                        _setDefaultLocation();
                    } else {
                		/*// console.log("Test Data", dtReadiMapFactory.getMakers().GetAtmsByLocationResult);

                		$scope.markers = dtReadiMapFactory.getMakers().GetAtmsByLocationResult;

                		//Make list visible when results are available.
                		$scope.isActive = true;

                		_determineLimitRange();
                		_setDefaultLocation();*/
                    }
                });



                /**
                 * Show directions on map
                 */
                $scope.showDirections = function(e) {
                    dtReadiMapFactory.showDirection(this.item);
                    e.preventDefault();
                };


                /**
                 * Show more results
                 */
                $scope.showMore = function(event) {
                    _incrementLimitRange();
                    event.preventDefault();
                };

                /**
                 * In
                 * @returns {number}
                 */
                $scope.limit = function() {
                    var totalAmount = $scope.currentViews * $scope.totalViews;
                    return totalAmount;
                };

                /**
                 * Show default location, being the first in the marker index.
                 */
                function _setDefaultLocation() {
                    dtReadiMapFactory.showDirection( $scope.markers[0]);
                };

                /**
                 * Determine limit ragne
                 */
                function _determineLimitRange() {
                    // Total amount of views to manage
                    $scope.totalViews = Math.ceil($scope.markers.length / $scope.itemsPerView);
                    $scope.currentViews = 1;
                };

                /**
                 * Incremenet range.
                 */
                function _incrementLimitRange() {
                    //Increment the view count
                    $scope.currentViews += 1;

                    //Check if views has reached limit, minus one to prevent the more option to appear on final.
                    if($scope.currentViews >= ($scope.totalViews - 1)) {
                        //Set currentViews to total views
                        $scope.currentViews = $scope.totalViews;
                        //Hide show more button
                        $scope.isMore = false;
                    }
                };


            }]
        };
    }]);
} (app));


/**
 * Levarege HTML5 is supported to get position
 */
(function(module) {
    module.factory('GeoService', ['$q',function($q) {

        var _deferred = $q.defer();

        return function() {
            if (Modernizr.geolocation) {

                //Todo - determine if prefix is required for browser that are supported.
                navigator.geolocation.getCurrentPosition(function(position) {
                    var obj = {
                        lat: position.coords.latitude,
                        lng: position.coords.longitude
                    };

                    _deferred.resolve(obj);
                });
            } else {
                // no native support; maybe try a fallback?
                _deferred.reject();
            }
            return _deferred.promise;
        }
    }]);
} (app));
;


(function(module) {
    module.directive('calendarEvent', ['$compile', function($compile) {
        return {
            restrict: 'A',
            scope: false,
            terminal: true,
            priority: 1000,
            link: function($scope, $element, $attrs) {

                var targetPikadayEl = $element.find('[data-pikaday]'),
                    defaultDaysBetween = parseInt($attrs.defaultDays) || 30,
                    dateFormat = 'D/M/YYYY';

                //From Date
                angular.element(targetPikadayEl[0]).attr('data-default-date', moment().format(dateFormat));

                //To Date
                angular.element(targetPikadayEl[1]).attr('data-default-date', moment().add(defaultDaysBetween, 'days').format(dateFormat));
                $attrs.$set('data-ng-controller' , 'CalendarEventCtrl');
                $element.removeAttr('data-calendar-event');
                $compile($element)($scope);
            }
        }
    }]);
} (app));


/**
 * Directive to manage event list
 */
(function(module) {
    module.directive('calendarEventList', ['CalendarEventService', function(CalendarEventService) {
        return {
            restrict: 'A',
            scope: false,
            link: function($scope) {

                /**
                 * Event - on data update
                 */
                $scope.$on(CalendarEventService.events.ON_DATA_UPDATE, function(e, data) {
                    $scope.collection = data.result;
                });
            }
        }
    }]);
} (app));







/**
 * Filter for custom dates
 */
(function(module) {
    module.filter('event', [function() {
        return function(input, format) {
            if(angular.isUndefined(moment)) throw 'Moment.js required';
            var formatDate = moment(input.substr(0,input.search('T'))).format(format);
            return formatDate;
        }
    }]);
} (app));




//Controller
(function(module) {
   module.controller('CalendarEventCtrl', ['$scope', '$attrs', 'CalendarEventService', function($scope, $attrs,  CalendarEventService) {


       if(angular.isUndefined($attrs.apiUrl)) throw 'Define Events API To make request';

       /**
        * Models to capture dates
        * @type {string}
        */
       $scope.eventSelectModel = '';
       $scope.eventStateRegionsModel = '';

       /**
        * Event - on submit
        * @param e
        */
        $scope.onRequestEvents = function(e) {
            var obj = {
                type:  $scope.eventSelectModel,
                state:  $scope.eventStateRegionsModel,
                from: '\/Date(' + new Date( $scope.fromDatePicker._d).getTime() + ')\/' ,
                to: '\/Date(' + new Date( $scope.toDatePicker._d).getTime() + ')\/'
            };
            CalendarEventService.getEvents(obj, $attrs.apiUrl);
            if(angular.isUndefined(e)) return;
            e.preventDefault();
        };

       /**
        * Listen for date picker to be instantiated the initiate requst as default.
        */
        var unbindWatch = $scope.$watch('fromDatePicker._d', function(value) {
            if(angular.isUndefined(value)) return;
            setTimeout(function() {
                // only trigger the watch for the first occurence
                unbindWatch();
            }, 10);
            $scope.onRequestEvents();

        }, true);


   }]);

} (app));



//Directive
(function(module) {
    module.directive('calendarEventSelect', ['$timeout', function($timeout) {
        return {
            restrict: 'A',
            require: 'select',
            scope: {
                calendarEventSelect: '='
            },
            link: function($scope, $element) {
                if(angular.isUndefined($scope.calendarEventSelect)) throw 'Please define model';


                $scope.calendarEventSelect = $element[0].value;
                /**
                 * Native event for select change.
                 * @param e
                 */
                $element[0].onchange = function(e) {
                    var scope = this;
                    $timeout(function() {
                        $scope.calendarEventSelect  = scope.value;
                    });
                };
            }

        }
    }]);
} (app));






//CalendarEventService
(function(module) {

    module.factory('CalendarEventService', ['$http', 'EventService',  '$timeout', function($http, EventService, $timeout) {

        /**
         * Events
         * @type {{ON_DATA_UPDATE: string}}
         */
        var events = {
          ON_DATA_UPDATE: 'dt.calender.event.service.on.data.update'
        };


//        var _dummyData = {
//            "data":[
//                {
//                    "EventType":"Mobile Office",
//                    "Date":"2014-09-24T01:00:00",
//                    "TimeRange":"1.00 - 7.30 pm",
//                    "Address1":"Kareela Golf and Social Club",
//                    "Address2":"Bates Drive, Kareela, New South Wales, Australia",
//                    "LinkUrl":"",
//                    "LinkTitle":"Find out more"
//                },
//                {
//                    "EventType":"Community Event",
//                    "Date":"2014-09-25T02:00:00",
//                    "TimeRange":"2.00 - 11.00 pm",
//                    "Address1":"C.ex Coff's1",
//                    "Address2":"Vernon StCoffs Harbour NSW 2450Australia",
//                    "LinkUrl":"https://www.google.com/maps/place/C.ex+Coff's/@-30.295556,153.114912,17z/data=!3m1!4b1!4m2!3m1!1s0x6b9c0db4ab75e0f5:0x9f1c207992ede243",
//                    "LinkTitle":"Find out more"
//                },
//                {
//                    "EventType":"Business Centre",
//                    "Date":"2014-09-23T12:37:00",
//                    "TimeRange":"12.37 - 7.00 am",
//                    "Address1":"Nambucca Heads Rsl Club",
//                    "Address2":"Nelson Street, Nambucca Heads, New South Wales, Australia",
//                    "LinkUrl":"https://www.google.com/maps/place/Nambucca+Heads+Rsl+Club/@-30.645302,153.003182,17z/data=!3m1!4b1!4m2!3m1!1s0x6b9c2ff9d6890ee3:0x8e051993bfdfa670",
//                    "LinkTitle":"Find out more"
//                }
//            ]
//        };

        /**
         * Retreive events from http;
         * @param from
         * @param to
         */
        function getEvents(obj, apiURL) {

            if(angular.isUndefined(apiURL)) throw  'Require apiURL';
            if(angular.isUndefined(obj)) throw 'Request object required';


//            $timeout(function() {
//                EventService.dispatch(events.ON_DATA_UPDATE, { status: 'succss', result: _dummyData.data});
//            }, 500);

            $http({
                method: 'POST',
                url: apiURL,
                data: JSON.stringify(obj),
                responseType: 'JSON'
            }).then(
                function(data) {
                    var result = angular.fromJson(JSON.parse(data.data));
                    EventService.dispatch(events.ON_DATA_UPDATE, { status: 'success', result: result.data});
                    setTimeout(function(){
                    var currentTop = $(window).scrollTop(); // Fixes the fix below, which was causing IE10 to scroll to the up after clicking submit
                    $("body").hide(0).show(); // fixes bug on ie9/10 where page height is not being rendered correctly after new events loaded
                    $(window).scrollTop(currentTop);
                    },10);
                },
                function(e) {
                    EventService.dispatch(events.ON_DATA_UPDATE, { status: 'error', result: {}});
                }
            );
        };



        /**
         * Public accessor
         */
        return {
            events:events,
            getEvents: getEvents,
        }
    }]);
} (app));;


(function(module) {
    module.factory('EventService', ['$rootScope', function($rootScope) {
        return {
            dispatch: function(type, value) {
                if(angular.isUndefined(type)) throw 'Namespace required';
                return $rootScope.$broadcast(type, value);
            }
        }
    }]);
} (app));



(function(module) {
    module.directive('dtEnter', [function() {
        return {
            restrict: 'A',
            scope: false,
            link: function($scope, $element, $attrs) {
                $element.bind("keydown keypress", function(event) {

                    if(event.which === 13) {
                        $scope.$apply(function () {
                            $scope.$eval($attrs.dtEnter);
                        });
                        event.preventDefault();
                    }
                });
            }
        }
    }]);
} (app));;
/**
 * Manages the scope of the form.
 */
(function (module) {
    module.controller('FormCtrl', ['$scope', '$element', '$timeout',  function ($scope, $element, $timeout) {

        /**
         * Return false if the entire form group is invalid.
         * @returns {boolean}
         */
        $scope.isInvalid = function () {
            return $scope.formGroup.$invalid;
        };


        /**
         *  Force validation of all form elements.
         */
        $scope.validateForm = function(e) {

            setAllInputsDirty($scope);

            if($scope.formGroup.$invalid) {
                // Focus on the first field that is invalid, and scroll to
                focusOnFirstInvalid();
                e.preventDefault();
            }
        };

        /**
         * Reset form for all information in the model.
         */
        $scope.reset = function(e) {
            e.preventDefault();
                var collectionEl = $element.find('[name]');
                angular.forEach(collectionEl, function(el) {
                    el = angular.element(el);
                    el.val('');
                });
        };


        /**
         *
         */
        function initiateKeyPressListener() {
            $element.keypress(function(e) {
                if(e.which == 13) {
                    $timeout(function() {
                        $scope.validateForm(e);
                    });
                }
            });
        }



        // Focus on the first field that is invalid, and scroll to
        function focusOnFirstInvalid() {
            // Focus on the first field that is invalid, and scroll to
            var $firstInvalidEl = $element.find('.ng-invalid').first();
            if ($firstInvalidEl.length){
                $(window).scrollTop($firstInvalidEl.offset().top - 40);
                $firstInvalidEl.focus();
            }
        }

        function setAllInputsDirty(scope) {

            angular.forEach(scope, function(value, key) {

                // We skip non-form and non-inputs
                if (!value || value.$dirty === undefined) {
                    return;
                }

                // Recursively applying same method on all forms included in the form
                if (value.$addControl) {
                    return setAllInputsDirty(value);
                }
                // Setting inputs to $dirty, but re-applying its content in itself
                if (value.$setViewValue) {
                    value.$setDirty();
                    return value.$setViewValue(value.$viewValue);
                }
            });
        }



        initiateKeyPressListener();

    }]);
}(app));

/**
 * data-form-date-duration directive manages display if with 2 years of current date.
 * Example: <div    data-form-date-Duration
 *                  data-form-date-begin="input_1Model"
 *                  data-form-date-end=""
 *                  data-form-date-result="dateModel">
 *         </div>
 */
(function(module) {
    module.directive('formDateDuration', [function() {
        return {
            restrict: 'A',
            scope: {formDateBegin: '=', formDateEnd: '=', formDateResult: '='},
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                /**
                 * Event - start date update
                 */
                $scope.$watch('formDateBegin', function(newVal) {
                    getDuration();
                });

                /**
                 * Event - end date update
                 */
                $scope.$watch('end', function(newVal) {
                    getDuration();
                });


                /**
                 * Get begin and end date determine the difference in years
                 */
                function getDuration() {
                    var dateFormat = 'DD/MM/YYYY';
                    var startDate = $scope.formDateBegin || "";
                    var endDate = $scope.formDateEnd || moment().format(dateFormat);

                    var startM = moment(startDate, dateFormat),
                        endM = moment(endDate, dateFormat);

                    if(startM > endM) {
                        $scope.formDateResult = 0;
                        return;
                    }else{
                        $scope.formDateResult = Math.ceil(endM.diff(startM, 'years', true));
                    }

                }
            }]
    }
}]);
} (app));


/**
 * Dynamically apply 'data-ng-form', 'name="formGroup" and 'data-ng-controller='FormCtrl'
 * Keeps it clean and re-usable for integration
 */
(function(module) {
    module.directive('formController', ['$compile',
        function($compile) {
            return {
                restrict: 'A',
                terminal: true,
                priority: 1000,
                link: function link(scope,element, attrs) {
                    //Apply required attributes for from to work
                    attrs.$set('dataNgForm', '');
                    attrs.$set('name', 'formGroup');
                    attrs.$set('dataNgController', 'FormCtrl');
                    //Remove directive
                    element.removeAttr('data-form-controller');
                    //Compplie
                    $compile(element)(scope);
                }
            }
        }
    ]);
}(app));





/*
 * QAS Address Lookup directive
 */
(function(module) {
    module.directive('formInputQasController', ['qasService', function(qasService) {
        return {
            restrict: 'A',
            scope: true,
            controller: ['$scope', '$element', '$attrs', '$timeout', function($scope, $element, $attrs, $timeout) {

                $scope.isQASActive = true;
                $scope.isQASPOBoxActive = false;
                $scope.isQASResultsActive = false;


                if($attrs.formInputQasController.length > 0) {
                    //Convert from json to array
                    $scope[$attrs.qasAddressModel] = JSON.parse($attrs.formInputQasController);
                }


                /*
                 * Pre-populated address should be expanded by default but
                 * we need to check the QAS model field for the value.
                 */
                var targetEl = $element.find('[name]');
                if (targetEl.val() !== '' ) {
                    $scope.isQASActive = false;
                }

                /**
                 * Watch model update
                 */
                $scope.$watch('qasModel', function(newVal) {

                    if(angular.isUndefined(newVal)) return;
                    if ( newVal.length >= 4 ) {
                        $scope.initialValue = newVal;
                        // timeout removed because it was breaking functionality...

                        qasLookup($attrs.qasRequesturi, { address: newVal, includePobox: ($attrs.qasIncludePoBox === 'true') });

                    } else {
                        // if there is no search hide the output and clear the result
                        $scope.qasResult = '';
                        $scope.isQASResultsActive = false;
                    }

                });


                /**
                 * PO Box form will show if specified targetAttr is defined.
                 *
                 * @param targetAttr
                 * @param e
                 */
                $scope.qasAddAttr = function(targetAttr, e) {
                    $scope[$attrs.qasAddressModel] = $scope[$attrs.qasAddressModel] || {};
                    $scope[$attrs.qasAddressModel][targetAttr] = '';
                    clearObject();
                    e.preventDefault();
                };

                /**
                 * Street address will show if PO Box attribute is undefined.
                 *
                 * @param targetAttr
                 * @param e
                 */
                $scope.qasRemoveAttr = function(targetAttr, e) {
                    delete $scope[$attrs.qasAddressModel][targetAttr];
                    clearObject();
                    e.preventDefault();
                };


                /**
                 * Clear details in object when switching between Street address and Po Box to keep a consistent experience.
                 * By deleting the PO-Box attribute user will receive in concistent experience all other form elements would have in formation apart from PO -Box
                 */
                function clearObject() {
                    if(angular.isUndefined( $scope[$attrs.qasAddressModel])) return;
                    var obj = $scope[$attrs.qasAddressModel],
                        newObj = {};

                    for(var item in obj) {
                        var attr = obj[item];
                        newObj[item] = '';
                    }
                    $scope[$attrs.qasAddressModel] = angular.extend(obj, newObj)
                };


                /**
                 * Return true or false if Attribute on object is defined.
                 */
                $scope.qasAttrActive = function(targetAttr) {
                    if(angular.isUndefined($scope[$attrs.qasAddressModel])) return false;
                    if(angular.isUndefined($scope[$attrs.qasAddressModel][targetAttr])) return false;
                    return true;
                };



                /**
                 * Request address
                 */
                $scope.qasRequestAddress = function(e) {
                    var value = this.item.moniker,
                        valueText = this.item.text;
                    qasAddressDetail($attrs.qasMonikeruri, { moniker: value, text: valueText });
                    e.preventDefault();
                };

                /*
                 * Enter address manually
                 */
                $scope.qasManualAddress = function(e) {
                    $scope[$attrs.qasAddressModel] = {};
                    $scope.isQASActive = false;
                    e.preventDefault();
                };

                /*
                 * Address Lookup
                 */
                $scope.qasAddressLookup = function(e) {
                    $scope.isQASActive = true;
                    $scope.isQASResultsActive = false;
                    e.preventDefault();
                };

                /*
                 * Keyboard navigation
                 */
                $scope.qasKeyboard = function(e) {
                    $scope.keyPressed = (e.keyCode ? e.keyCode : e.which);
                    if ($scope.keyPressed === 38 || $scope.keyPressed === 40) {
                        if ($scope.keyPressed === 40) {
                            nextItem();
                        }
                        if ($scope.keyPressed === 38) {
                            prevItem();
                        }
                    }

                    if ($scope.keyPressed === 13) {
                        $timeout(function() {
                            $scope.currentItem.triggerHandler('click');
                        });
                    }
                };

                /*
                 * Keyboard navigation - move down...
                 */
                function nextItem(first) {
                    var $active = $element.find('ul li.is-active');
                    if (!$active.length) {
                        $scope.currentItem = $element.find('ul li:first-child');
                    } else {
                        $scope.currentItem = $active.next().length ? $active.next() : $element.find('ul li:first-child');
                    }
                    $active.removeClass('is-active');
                    $scope.currentItem.addClass('is-active');
                    targetEl.val($scope.currentItem.text());
                }

                /*
                 * Keyboard navigation - move up...
                 */
                function prevItem() {
                    var $active = $element.find('ul li.is-active'),
                        reset = false;
                    if (!$active.prev().length) {
                        reset = true;
                        $scope.currentItem = undefined;
                    } else {
                        $scope.currentItem = $active.prev();
                    }
                    if (typeof $scope.currentItem !== 'undefined') {
                        $active.removeClass('is-active');
                        $scope.currentItem.addClass('is-active');
                    }
                    if (reset === true) {
                        targetEl.val($scope.initialValue);
                    } else {
                        targetEl.val($scope.currentItem.text());
                    }
                }


                //Todo - Timeout to reduce amount of request occuring.
                //Todo - Error Handling Should do somekthing here.
                function qasLookup(url, value) {
                    qasService.request(url, value).then(
                        function (data, status) {
                            var result = angular.fromJson(JSON.parse(data.data));
                            $scope.qasResult = result.data;
                            $scope.isQASResultsActive = true;
                        },
                        function (data, status) {

                        }
                   );
                }


                //Todo - Error Handling Should do somekthing here.
                function qasAddressDetail(url, value) {
                    qasService.request(url, value).then(
                        function (data, status) {
                            var result = angular.fromJson(JSON.parse(data.data));
                            $scope[$attrs.qasAddressModel] = result;
                            $scope.isQASResultsActive = false;
                            $scope.isQASActive = false;
                        }, function (data, status) {

                        }
                    );
                }

            }]

        }
    }]);
} (app));


/**
 * Manage service request to qas
 */
(function(module) {
    module.factory('qasService', ['$http',function($http) {

        /**
         * Service to manage request to QAS
         * @param url
         * @returns {HttpPromise}
         */
        function request(url, obj) {

            return $http({
                method: 'POST',
                url: url,
                dataType: 'JSON',
                data: JSON.stringify(obj),
                headers: {
                    "Content-Type": "application/json;charset=UTF-8"
                }
            });

            // for testing
            //return $http.get(url);
        }

        return {
            request: request
        }

    }]);
} (app));

/**
 * Keep reference of name in scope for the 'formInputValidation' directive to validate against.
 */
(function(module) {
   module.directive('formInputController', ['$timeout',function($timeout) {
       return {
           restrict: 'A',
           controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

               var _inputEl = $element.find('[name]');
               this.inputName = _inputEl.attr('name');


               angular.forEach(_inputEl, function(item) {
                   var targetEl = angular.element(item),
                       elType = targetEl.attr('ui-money-mask') ? "number" : targetEl.attr('type'),
                       modelName = targetEl.attr('ng-model') || targetEl.attr('data-ng-model');

                   switch(elType) {
                       case 'checkbox':
                           $scope[modelName] = targetEl.is(':checked');
                           break;
                       case 'radio':
                           if(targetEl.is(':checked')) {
                               $scope[modelName] = targetEl.val();
                           }
                           break;
                       case 'number':
                           $scope[modelName] = parseInt(targetEl.val());
                           break;
                       default: {
                           $scope[modelName] = targetEl.val();
                       }
                   }

               });

               /*
                * If IE 9 or lower we need to re-apply placeholder text
                */
               if ($('.lt-ie10').length) {
                   $scope.$watch( function() {
                       return this.inputName;
                   }, function(newValue, oldValue) {
                       $timeout(function(){
                           _inputEl.placeholder();
                       }, 0);
                   });
               }

               if(angular.isUndefined($attrs.formInputDirty) || $attrs.formInputDirty !== 'true') {
                   this.isPristine = true;
               } else {
                   this.isPristine = false;
               }

           }]
       };
   }]);
} (app));

/**
 * Show Error message based on validation requirements on input element.
 */
(function(module) {
    module.directive('formInputValidation', [function() {
        return {
            restrict: 'A',
            require: '^formInputController',
            scope: true,
            link: function($scope, $element, $attrs, ctrl) {

                // Event - value has been added, manage async issue
                $scope.$watch('ctrl.isPristine', function() {
                    //Validate on page load
                    if(!ctrl.isPristine) {
                        $scope.isInputError();
                    }
                });


                /**
                 * View Event - validate form element
                 * @returns {*|boolean}
                 */
                $scope.isInputError = function() {

                    if(angular.isUndefined($scope.formGroup[ctrl.inputName])) return;

                    if(ctrl.isPristine) {
                        //Validate only when form element is not prestine
                        return $scope.formGroup[ctrl.inputName].$error[$attrs.formInputValidation] && !$scope.formGroup[ctrl.inputName].$pristine;
                    } else {
                        //Validate pristine or not
                        return $scope.formGroup[ctrl.inputName].$error[$attrs.formInputValidation];
                    }
                };
            }
        }
    }]);
} (app));



/**
 * Directive will modify the name attribute on input field.
 * - This will only effect form elements that are in the 'form-adder' directive.
 */
(function(module) {
    module.directive('formInput', ['$compile', function($compile) {


        /**
         * Generate a unique id
         * @returns {string}
         */
        function getUniqueID() {
            return Math.floor((1 + Math.random()) * 0x10000)
                .toString(16)
                .substring(1);
        };

        return {
            restrict: 'A',
            terminal: true,
            priority: 1000,
            link: function($scope, $element, $attrs) {

                //Apply directive 'data-form-input-controller' to main element.
                $attrs.$set('dataFormInputController', '');

                //Add data-ng-show to the 'data-form-input-validation' element
                $element.find('[data-form-input-validation]').attr('data-ng-show', 'isInputError()');

                //If in a ng-repeat then update name tag with the counter and a unique id
                if(!angular.isUndefined($scope.$index)) {

                    //var targetElName = targetEl.attr('name') + '-' + $scope.$parent.counter + '-' + getUniqueID();
                    // Removed the random identifier as requested by backend...

                    var targetEl = $element.find('[name]');

                    if($scope.$index !== 0) {
                        var targetElName = targetEl.attr('name') + '-' + $scope.$parent.counter;
                        targetEl.attr('name', targetElName);
                    }

                };

                //Remove 'data-form-input' directive before compling
                $element.removeAttr('data-form-input');

                //Compile changes.
                $compile($element)($scope);
            }
        }
    }]);
} (app));




/**
 * Dupliate form group elements
 */
(function(module) {
  module.directive('formDuplicator', ['$timeout', function($timeout) {
        return {
            restrict: 'A',
            scope: true,
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                //Default empty array
                $scope.formGroupCollection = [];
                // Add a persistent repeat counter
                $scope.counter = 0;

                //Define limit of duplication
                var _duplicatorLimit = parseInt($attrs.formDuplicatorLimit) || 20;


                /**
                 * Increase amount in group
                 */
                $scope.groupAdd = function(e) {
                    $scope._addToFormGroupCollection();
                    e.preventDefault();
                };

                /**
                 * View event - to remove item from index
                 * @param e
                 */
                $scope.groupRemove = function(e) {
                    $scope._removeFromFormGroupCollection(this.$index);
                    e.preventDefault();
                };


                /**
                 * Show remove button if there's more than 1
                 */
                $scope.showRemove = function() {
                    if($scope.formGroupCollection.length > 1) {
                        return true;
                    } else {
                        return false;
                    }
                };

                /**
                 * Have reached limit make button disabled.
                 */
                $scope.isAddLimit = function() {
                    return !($scope.formGroupCollection.length <= (_duplicatorLimit - 1));
                };


                /**
                 * Increase array by one
                 * @private
                 */
                $scope._addToFormGroupCollection = function(data) {
                    //If there is no data then push an empty object.
                    data = data || {};

                    //If reached limit do not proceed
                    if($scope.isAddLimit()) return;

                    // increment the counter, to update increment the name id, using $index is not persistent.
                    $scope.counter++;
                    $scope.formGroupCollection.push(data);
                };

                /**
                 * Remove from index based on index
                 * @param index
                 * @private
                 */
                $scope._removeFromFormGroupCollection = function(index) {
                    $scope.formGroupCollection.splice(index, 1);
                };





                ////IF JSON has been added then this is default content
                if($attrs.formDuplicator.length > 0) {
                    //Convert from json to array
                    var jsonCollection = JSON.parse($attrs.formDuplicator);
                    //Loop through and add to collection, need to call '_addToFormGroupCollection' to ensure the name attribute increments correctly.
                    angular.forEach(jsonCollection, function(item) {
                        $timeout(function() {
                            $scope._addToFormGroupCollection(item);
                        }, 0);
                    });
                } else {
                    //No default content then push empty
                    $scope._addToFormGroupCollection();
                }





            }]
        }
  }]);
} (app));





/**
 * Range Slider jQuery Instantiate, added as we need to have angular manage instantiating when range is added to the DOM
 */
(function(module) {
    module.directive('formRangeSlider', [function() {
        return {
            restrict: 'A',
            link: function(scope,element,attrs){
                element.rangeSlider();
            }
        }
    }]);
} (app));

/**
 * jQuery-Autocomplete Instantiate
  */
 (function(module) {
     module.directive('formAutocomplete', [function() {
         return {
             restrict: 'A',
             link: function(scope,element,attrs){
                 element.fieldAutocomplete();
             }
         };
     }]);
 } (app));

/**
 * data-form-loan-calculator directive manages updating the loan amount
 * Example: <div    data-form-loan-calculator
 *                  data-form-purchase-price="purchasePriceModel"
 *                  data-form-deposit-saved="depositSavedModel"
 *                  data-form-additional-borrowing="additionalBorrowingModel"
 *                  data-form-loan-amount-valid="loanAmountValidModel"
 *                  data-form-loan-result="loanModel"
 *                  data-form-loan-result-formatted="loanModelFormatted">
 *         </div>
 */
(function(module) {
    module.directive('formLoanCalculator', [function() {
        return {
            restrict: 'A',
            scope: {formPurchasePrice: '=', formDepositSaved: '=', formAdditionalBorrowing: '=', formLoanAmountValid: '=', formLoanResult: '=', formLoanResultFormatted: '='},
            controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                /**
                 * Event - purchase price update
                 */
                $scope.$watch('formPurchasePrice', function(newVal) {
                    if (newVal <=0) {
                        $element.find('[name=purchasePrice]').val("$ 0");
                    }
                    updateLoanAmount();
                });

                /**
                 * Event - deposit saved update
                 */
                $scope.$watch('formDepositSaved', function(newVal) {
                    if (newVal <=0) {
                        $element.find('[name=depositSaved]').val("$ 0");
                    }
                    updateLoanAmount();
                });

                /**
                 * Event - additional borrowing update
                 */
                $scope.$watch('formAdditionalBorrowing', function(newVal) {
                    if (newVal <=0) {
                        $element.find('[name=additionalBorrowing]').val("$ 0");
                    }
                    updateLoanAmount();
                });

                /**
                 * Update loan amount
                 */
                function updateLoanAmount() {
                    var purchase_price = ($scope.formPurchasePrice >= 0) ? $scope.formPurchasePrice: 0;
                    var deposit_saved = ($scope.formDepositSaved >= 0) ? $scope.formDepositSaved: 0;
                    var additional_borrowing = ($scope.formAdditionalBorrowing >= 0) ? $scope.formAdditionalBorrowing: 0;
                    var loanAmount = Number(purchase_price) - Number(deposit_saved) + Number(additional_borrowing);
                    $scope.formLoanAmountValid = (loanAmount > 0) ? "Your loan is valid": "";
                    $scope.formLoanResult = loanAmount;
                    $scope.formLoanResultFormatted = numberWithCommas(loanAmount);
                }

                function numberWithCommas(x) {
                    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                }

            }]
        }
    }]);
} (app));



(function(module) {
    module.filter('isEmpty', function() {
        return function(input) {
            if(angular.isUndefined(input)) {
                return true;
            }
            if(input.length === 0) {
                return true;
            } else {
                return false;
            }
        }
    });
}(app));


(function(module) {
    module.filter('or', function() {
        return function(input1, input2) {
            if(input1 || input2) {
                return true;
            } else {
                return false;
            }
        }
    });
}(app));
;
(function(exports) {
    (function(exports) {

        // simple directive to keep scope to form
        exports.directive('dtForm', [function() {
            return {
                restrict: 'A',
                scope: true,
                link: function(scope, element, attributes) {
                    // when submit on group clicked we dirty all inputs and block if group not valid
                    var $element = angular.element(element);

                    var $scopeSubmit = $element.find("[type='submit']");
                    $scopeSubmit.bind('click', function(e) {
                        // Remove the class pristine from all form elements.
                        $element.find('.ng-pristine').removeClass('ng-pristine');

                        // Get the form object.
                        var form = scope[attributes.name];
                        // Set all the fields to dirty and apply the changes on the scope so that
                        // validation errors are shown on submit only.
                        angular.forEach(form, function(formElement, fieldName) {
                            // If the fieldname starts with a '$' sign, it means it's an Angular
                            // property or function. Skip those items.
                            if (fieldName[0] === '$') return;

                            formElement.$pristine = false;
                            formElement.$dirty = true;
                        });

                        // Do not continue if the form is invalid.
                        if (form.$invalid) {
                            e.preventDefault();
                            // Focus on the first field that is invalid.
                            $element.find('.ng-invalid').first().focus();
                            return false;
                        }else{
                            // allow submit
                        }
                    });
                },

                controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {

                }]
            };
        }]);

    } ((typeof exports === 'undefined')? window : exports));
} (app));
;
$(document).ready(function() {
  var switched = false;
  var updateTables = function() {
    if (($(window).width() < 780) && !switched ){
      switched = true;
      $("table.responsive").each(function(i, element) {
        splitTable($(element));
      });
      return true;
    }
    else if (switched && ($(window).width() > 780)) {
      switched = false;
      $("table.responsive").each(function(i, element) {
        unsplitTable($(element));
      });
    }
  };
   
  $(window).on('load', updateTables);
  $(window).on("redraw",function(){switched=false;updateTables();}); // An event to listen for
  $(window).on("resize", updateTables);
   
	
	function splitTable(original)
	{
		original.wrap("<div class='table-wrapper' />");
		
		var copy = original.clone();
		copy.find("td:not(:first-child), th:not(:first-child)").css("display", "none");
		copy.removeClass("responsive");
		
		original.closest(".table-wrapper").append(copy);
		copy.wrap("<div class='pinned' />");
		original.wrap("<div class='scrollable' />");

    setCellHeights(original, copy);
	}
	
	function unsplitTable(original) {
    original.closest(".table-wrapper").find(".pinned").remove();
    original.unwrap();
    original.unwrap();
	}

  function setCellHeights(original, copy) {
    var tr = original.find('tr'),
        tr_copy = copy.find('tr'),
        heights = [];

    tr.each(function (index) {
      var self = $(this),
          tx = self.find('th, td');

      tx.each(function () {
        var height = $(this).outerHeight(true);
        heights[index] = heights[index] || 0;
        if (height > heights[index]) heights[index] = height;
      });

    });

    tr_copy.each(function (index) {
      $(this).height(heights[index]);
    });
  }

});
;
(function ($, window, document, undefined) {
	var pluginName = 'timeline';

	// The actual plugin constructor
	function Plugin( element, options ) {
		this.element = $(element);
		this._name = pluginName;
		this.init();
	};

	Plugin.prototype.init = function () {
		var scope = this;
		var $el = $(scope.element);

		var	offset = .93;
		var timelineBlocks = $('.pl74-timeline-block'),
			offset = .93;
		// on scrolling, show/animate timeline blocks when enter the viewport
		$(window).on('scroll', function(){
			(!window.requestAnimationFrame)
				? setTimeout(function(){ showBlocks(timelineBlocks, offset); }, 100)
				: window.requestAnimationFrame(function(){ showBlocks(timelineBlocks, offset); });
		});
		collapseBlocks(scope);
		// hide timeline blocks which are outside the viewport
    	hideBlocks(timelineBlocks, offset);
	};


    // hide each timeline block when off screen
	function hideBlocks(blocks, offset) {
		var scope = this;
		var $el = $(scope.element);
		blocks.each(function(){
				( $(this).offset().top > $(window).scrollTop()+$(window).height()*offset ) && $(this).find('.pl74-timeline-content-icon, .pl74-timeline-content, .pl74-timeline-date').addClass('is-hidden');
			});
	}

	// show each timeline block when on screen
	function showBlocks(blocks, offset) {
		blocks.each(function(){
				( $(this).offset().top <= $(window).scrollTop()+$(window).height()*offset && $(this).find('.pl74-timeline-content-icon').hasClass('is-hidden') ) && $(this).find('.pl74-timeline-content-icon, .pl74-timeline-content, .pl74-timeline-date').removeClass('is-hidden').addClass('bounce-in');
			});
	}

	function collapseBlocks() {
		// all for non collapsible content 'content-noncollapsible'
	    $('.content-noncollapsible .pl74-timeline-content-dropdown').css('display','none');

	    // hide initially set collapsible content 'content-collapsible'
	    $('.content-collapsible .pl74-timeline-content-inner').css('display', 'none');

	    // expand collabsible content
		$('.content-collapsible .pl74-timeline-toggle').click(function(e){
			e.preventDefault();
			$(this).find('.pl74-timeline-content-dropdown').toggleClass('icon-arrow-up icon-arrow-down');
			$(this).parent().siblings('.pl74-timeline-content-inner').slideToggle('slow');
		});
	}


	$.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

	$(window).on('load', function () {
        $(".pl74-timeline-container").timeline();
    });

})(jQuery, window, document);
;
;
(function ($, window, document, undefined) {

	// Create the defaults once
	var pluginName = 'videoPlaylist',
		defaults = {
			vid_list_container : ".pl75-videoplaylist-container",
			arrow_left : ".pl75-videoplaylist-arrow-left",
			arrow_right : ".pl75-videoplaylist-arrow-right",
			vid_item : ".pl75-videoplaylist-item",
			vid_list : ".pl75-videoplaylist-list"
		};

	// The actual plugin constructor
	function Plugin( element, options ) {
		this.element = $(element);
		this.options = $.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	};

	Plugin.prototype.init = function () {
		var scope = this;
		var $el = $(scope.element);
		scope.buildVideoList(scope);
		scope.navVideoList(scope);
	};

	Plugin.prototype.navVideoList = function(scope) {
		var $el = $(scope.element);
		$el.find(scope.options.arrow_right).bind("click", function (event) {
	        event.preventDefault();
	        $el.find(scope.options.vid_list_container).stop().animate({
	            scrollLeft: "+=265"
	        }, 750);
	    });
	    $el.find(scope.options.arrow_left).bind("click", function (event) {
	        event.preventDefault();
	        $el.find(scope.options.vid_list_container).stop().animate({
	            scrollLeft: "-=265"
	        }, 750);
	    });
	};

	Plugin.prototype.buildVideoList = function(scope) {
		var $el = $(scope.element);
		var $vidItemWidth = $el.find(scope.options.vid_item).width();
	    var $vidItemNum = $el.find(scope.options.vid_item).length;

	    var $vidListWidth = $vidItemWidth*($vidItemNum+1);
	    $el.find(scope.options.vid_list).width($vidListWidth);

	    if ($vidItemNum <= 1) {
	    	$('.pl75-videoplaylist-arrows').addClass('hide-pl75-videoplaylist-arrows-mobile hide-pl75-videoplaylist-arrows-desktop');
	    }

	    else if ($vidItemNum == 2) {
	    	$('.pl75-videoplaylist-arrows').addClass('hide-pl75-videoplaylist-arrows-desktop');
	    }
	};

	// A really lightweight plugin wrapper around the constructor,
    // preventing against multiple instantiations
    $.fn[pluginName] = function ( options ) {
        return this.each(function () {
            if (!$.data(this, 'plugin_' + pluginName)) {
                $.data(this, 'plugin_' + pluginName,
                    new Plugin( this, options ));
            }
        });
    };

    $(window).on('load', function () {
        $(".pl75-videoplaylist").videoPlaylist();
    });


})(jQuery, window, document);;
/**
*  Ajax Autocomplete for jQuery, version 1.2.26
*  (c) 2014 Tomas Kirda
*
*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
*  For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
*/
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(a){"use strict";function b(c,d){var e=a.noop,f=this,g={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:b.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)},paramName:"query",transformResult:function(b){return"string"==typeof b?a.parseJSON(b):b},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};f.element=c,f.el=a(c),f.suggestions=[],f.badQueries=[],f.selectedIndex=-1,f.currentValue=f.element.value,f.intervalId=0,f.cachedResponse={},f.onChangeInterval=null,f.onChange=null,f.isLocal=!1,f.suggestionsContainer=null,f.noSuggestionsContainer=null,f.options=a.extend({},g,d),f.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},f.hint=null,f.hintValue="",f.selection=null,f.initialize(),f.setOptions(d)}var c=function(){return{escapeRegExChars:function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),d={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};b.utils=c,a.Autocomplete=b,b.formatResult=function(a,b){if(!b)return a.value;var d="("+c.escapeRegExChars(b)+")";return a.value.replace(new RegExp(d,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},b.prototype={killerFn:null,initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.killerFn=function(b){a(b.target).closest("."+d.options.containerClass).length||(d.killSuggestions(),d.disableKillerFn())},d.noSuggestionsContainer=a('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo),"auto"!==g.width&&c.css("width",g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){return d.select(a(this).data("index")),!1}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("input.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),a.el.val().length>=a.options.minChars&&a.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=c.options;a.extend(d,b),c.isLocal=a.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearInterval(a.onChangeInterval),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if("top"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()+"px"),c.css(i)}},enableKillerFn:function(){var b=this;a(document).on("click.autocomplete",b.killerFn)},disableKillerFn:function(){var b=this;a(document).off("click.autocomplete",b.killerFn)},killSuggestions:function(){var a=this;a.stopKillSuggestions(),a.intervalId=window.setInterval(function(){a.visible&&(a.options.preserveInput||a.el.val(a.currentValue),a.hide()),a.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===d.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case d.ESC:b.el.val(b.currentValue),b.hide();break;case d.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case d.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case d.RETURN:if(-1===b.selectedIndex)return void b.hide();b.select(b.selectedIndex);break;case d.UP:b.moveUp();break;case d.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case d.UP:case d.DOWN:return}clearInterval(b.onChangeInterval),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeInterval=setInterval(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearInterval(b.onChangeInterval),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.length<c.minChars?b.hide():b.getSuggestions(e))},isExactMatch:function(a){var b=this.suggestions;return 1===b.length&&b[0].value.toLowerCase()===a.toLowerCase()},getQuery:function(b){var c,d=this.options.delimiter;return d?(c=b.split(d),a.trim(c[c.length-1])):b},getSuggestionsLocal:function(b){var c,d=this,e=d.options,f=b.toLowerCase(),g=e.lookupFilter,h=parseInt(e.lookupLimit,10);return c={suggestions:a.grep(e.lookup,function(a){return g(a,b,f)})},h&&c.suggestions.length>h&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,d=h.ignoreParams?null:h.params,h.onSearchStart.call(g.element,h.params)!==!1){if(a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&a.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearInterval(b.onChangeInterval),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m="",n=function(a,c){var d=a.data[e];return b===d?"":(b=d,'<div class="autocomplete-group"><strong>'+b+"</strong></div>")};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+='<div class="'+h+'" data-index="'+a+'">'+f(b,g,a)+"</div>"}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j,c.suggestions),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children("."+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=a(b.suggestionsContainer),d=a(b.noSuggestionsContainer);this.adjustContainerWidth(),d.detach(),c.empty(),c.append(d),b.fixPosition(),c.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width&&(b=c.el.outerWidth(),e.css("width",b>0?b:300))},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),-1===a.inArray(b,["auto","bottom","top"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&!a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,f>e?a(c.suggestionsContainer).scrollTop(e):e>g&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||c.el.val(c.getValue(c.suggestions[b].value)),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),b.disableKillerFn(),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.autocomplete=a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return arguments.length?this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))}):this.first().data(e)}});;
/*
 AngularJS v1.7.8
 (c) 2010-2018 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(T,a){'use strict';function M(m,f){f=f||{};a.forEach(f,function(a,d){delete f[d]});for(var d in m)!m.hasOwnProperty(d)||"$"===d.charAt(0)&&"$"===d.charAt(1)||(f[d]=m[d]);return f}var B=a.$$minErr("$resource"),H=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;a.module("ngResource",["ng"]).info({angularVersion:"1.7.8"}).provider("$resource",function(){var m=/^https?:\/\/\[[^\]]*][^/]*/,f=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",
isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};this.$get=["$http","$log","$q","$timeout",function(d,F,G,N){function C(a,d){this.template=a;this.defaults=n({},f.defaults,d);this.urlParams={}}var O=a.noop,r=a.forEach,n=a.extend,R=a.copy,P=a.isArray,D=a.isDefined,x=a.isFunction,I=a.isNumber,y=a.$$encodeUriQuery,S=a.$$encodeUriSegment;C.prototype={setUrlParams:function(a,d,f){var g=this,c=f||g.template,s,h,n="",b=g.urlParams=Object.create(null);r(c.split(/\W/),function(a){if("hasOwnProperty"===
a)throw B("badname");!/^\d+$/.test(a)&&a&&(new RegExp("(^|[^\\\\]):"+a+"(\\W|$)")).test(c)&&(b[a]={isQueryParamValue:(new RegExp("\\?.*=:"+a+"(?:\\W|$)")).test(c)})});c=c.replace(/\\:/g,":");c=c.replace(m,function(b){n=b;return""});d=d||{};r(g.urlParams,function(b,a){s=d.hasOwnProperty(a)?d[a]:g.defaults[a];D(s)&&null!==s?(h=b.isQueryParamValue?y(s,!0):S(s),c=c.replace(new RegExp(":"+a+"(\\W|$)","g"),function(b,a){return h+a})):c=c.replace(new RegExp("(/?):"+a+"(\\W|$)","g"),function(b,a,e){return"/"===
e.charAt(0)?e:a+e})});g.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");a.url=n+c.replace(/\/(\\|%5C)\./,"/.");r(d,function(b,c){g.urlParams[c]||(a.params=a.params||{},a.params[c]=b)})}};return function(m,y,z,g){function c(b,c){var d={};c=n({},y,c);r(c,function(c,f){x(c)&&(c=c(b));var e;if(c&&c.charAt&&"@"===c.charAt(0)){e=b;var k=c.substr(1);if(null==k||""===k||"hasOwnProperty"===k||!H.test("."+k))throw B("badmember",k);for(var k=k.split("."),h=0,
n=k.length;h<n&&a.isDefined(e);h++){var g=k[h];e=null!==e?e[g]:void 0}}else e=c;d[f]=e});return d}function s(b){return b.resource}function h(b){M(b||{},this)}var Q=new C(m,g);z=n({},f.defaults.actions,z);h.prototype.toJSON=function(){var b=n({},this);delete b.$promise;delete b.$resolved;delete b.$cancelRequest;return b};r(z,function(b,a){var f=!0===b.hasBody||!1!==b.hasBody&&/^(POST|PUT|PATCH)$/i.test(b.method),g=b.timeout,m=D(b.cancellable)?b.cancellable:Q.defaults.cancellable;g&&!I(g)&&(F.debug("ngResource:\n  Only numeric values are allowed as `timeout`.\n  Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),
delete b.timeout,g=null);h[a]=function(e,k,J,y){function z(a){p.catch(O);null!==u&&u.resolve(a)}var K={},v,t,w;switch(arguments.length){case 4:w=y,t=J;case 3:case 2:if(x(k)){if(x(e)){t=e;w=k;break}t=k;w=J}else{K=e;v=k;t=J;break}case 1:x(e)?t=e:f?v=e:K=e;break;case 0:break;default:throw B("badargs",arguments.length);}var E=this instanceof h,l=E?v:b.isArray?[]:new h(v),q={},C=b.interceptor&&b.interceptor.request||void 0,D=b.interceptor&&b.interceptor.requestError||void 0,F=b.interceptor&&b.interceptor.response||
s,H=b.interceptor&&b.interceptor.responseError||G.reject,I=t?function(a){t(a,A.headers,A.status,A.statusText)}:void 0;w=w||void 0;var u,L,A;r(b,function(a,b){switch(b){default:q[b]=R(a);case "params":case "isArray":case "interceptor":case "cancellable":}});!E&&m&&(u=G.defer(),q.timeout=u.promise,g&&(L=N(u.resolve,g)));f&&(q.data=v);Q.setUrlParams(q,n({},c(v,b.params||{}),K),b.url);var p=G.resolve(q).then(C).catch(D).then(d),p=p.then(function(c){var e=c.data;if(e){if(P(e)!==!!b.isArray)throw B("badcfg",
a,b.isArray?"array":"object",P(e)?"array":"object",q.method,q.url);if(b.isArray)l.length=0,r(e,function(a){"object"===typeof a?l.push(new h(a)):l.push(a)});else{var d=l.$promise;M(e,l);l.$promise=d}}c.resource=l;A=c;return F(c)},function(a){a.resource=l;A=a;return H(a)}),p=p["finally"](function(){l.$resolved=!0;!E&&m&&(l.$cancelRequest=O,N.cancel(L),u=L=q.timeout=null)});p.then(I,w);return E?p:(l.$promise=p,l.$resolved=!1,m&&(l.$cancelRequest=z),l)};h.prototype["$"+a]=function(b,c,d){x(b)&&(d=c,c=
b,b={});b=h[a].call(this,b,this,c,d);return b.$promise||b}});return h}}]})})(window,window.angular);
//# sourceMappingURL=angular-resource.min.js.map
;
/*
 AngularJS v1.7.8
 (c) 2010-2018 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(s,c){'use strict';function P(c){var h=[];C(h,E).chars(c);return h.join("")}var D=c.$$minErr("$sanitize"),F,h,G,H,I,q,E,J,K,C;c.module("ngSanitize",[]).provider("$sanitize",function(){function f(a,e){return B(a.split(","),e)}function B(a,e){var d={},b;for(b=0;b<a.length;b++)d[e?q(a[b]):a[b]]=!0;return d}function t(a,e){e&&e.length&&h(a,B(e))}function Q(a){for(var e={},d=0,b=a.length;d<b;d++){var k=a[d];e[k.name]=k.value}return e}function L(a){return a.replace(/&/g,"&amp;").replace(z,function(a){var d=
a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(d-55296)+(a-56320)+65536)+";"}).replace(u,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,d=0,b=e.length;d<b;d++){var k=e[d],g=k.name.toLowerCase();if("xmlns:ns1"===g||0===g.lastIndexOf("ns1:",0))a.removeAttributeNode(k),d--,b--}(e=a.firstChild)&&A(e);a=v("nextSibling",a)}}function v(a,e){var d=e[a];if(d&&J.call(e,d))throw D("elclob",
e.outerHTML||e.outerText);return d}var y=!1,g=!1;this.$get=["$$sanitizeUri",function(a){y=!0;g&&h(m,l);return function(e){var d=[];K(e,C(d,function(b,d){return!/^unsafe:/.test(a(b,d))}));return d.join("")}}];this.enableSvg=function(a){return I(a)?(g=a,this):g};this.addValidElements=function(a){y||(H(a)&&(a={htmlElements:a}),t(l,a.svgElements),t(r,a.htmlVoidElements),t(m,a.htmlVoidElements),t(m,a.htmlElements));return this};this.addValidAttrs=function(a){y||h(M,B(a,!0));return this};F=c.bind;h=c.extend;
G=c.forEach;H=c.isArray;I=c.isDefined;q=c.$$lowercase;E=c.noop;K=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);var d=N(a);if(!d)return"";var b=5;do{if(0===b)throw D("uinput");b--;a=d.innerHTML;d=N(a)}while(a!==d.innerHTML);for(b=d.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(),Q(b.attributes));break;case 3:e.chars(b.textContent)}var k;if(!(k=b.firstChild)&&(1===b.nodeType&&e.end(b.nodeName.toLowerCase()),k=v("nextSibling",b),!k))for(;null==k;){b=
v("parentNode",b);if(b===d)break;k=v("nextSibling",b);1===b.nodeType&&e.end(b.nodeName.toLowerCase())}b=k}for(;b=d.firstChild;)d.removeChild(b)};C=function(a,e){var d=!1,b=F(a,a.push);return{start:function(a,g){a=q(a);!d&&w[a]&&(d=a);d||!0!==m[a]||(b("<"),b(a),G(g,function(d,g){var c=q(g),f="img"===a&&"src"===c||"background"===c;!0!==M[c]||!0===O[c]&&!e(d,f)||(b(" "),b(g),b('="'),b(L(d)),b('"'))}),b(">"))},end:function(a){a=q(a);d||!0!==m[a]||!0===r[a]||(b("</"),b(a),b(">"));a==d&&(d=!1)},chars:function(a){d||
b(L(a))}}};J=s.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)};var z=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/([^#-~ |!])/g,r=f("area,br,col,hr,img,wbr"),x=f("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),p=f("rp,rt"),n=h({},p,x),x=h({},x,f("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),p=h({},p,f("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),
l=f("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),w=f("script,style"),m=h({},r,x,p,n),O=f("background,cite,href,longdesc,src,xlink:href,xml:base"),n=f("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),
p=f("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
!0),M=h({},O,p,n),N=function(a,e){function d(b){b="<remove></remove>"+b;try{var d=(new a.DOMParser).parseFromString(b,"text/html").body;d.firstChild.remove();return d}catch(e){}}function b(a){c.innerHTML=a;e.documentMode&&A(c);return c}var g;if(e&&e.implementation)g=e.implementation.createHTMLDocument("inert");else throw D("noinert");var c=(g.documentElement||g.getDocumentElement()).querySelector("body");c.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>';return c.querySelector("svg")?
(c.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',c.querySelector("svg img")?d:b):function(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(d){return}var e=new a.XMLHttpRequest;e.responseType="document";e.open("GET","data:text/html;charset=utf-8,"+b,!1);e.send(null);b=e.response.body;b.firstChild.remove();return b}}(s,s.document)}).info({angularVersion:"1.7.8"});c.module("ngSanitize").filter("linky",["$sanitize",function(f){var h=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
t=/^mailto:/i,q=c.$$minErr("linky"),s=c.isDefined,A=c.isFunction,v=c.isObject,y=c.isString;return function(c,z,u){function r(c){c&&l.push(P(c))}function x(c,g){var f,a=p(c);l.push("<a ");for(f in a)l.push(f+'="'+a[f]+'" ');!s(z)||"target"in a||l.push('target="',z,'" ');l.push('href="',c.replace(/"/g,"&quot;"),'">');r(g);l.push("</a>")}if(null==c||""===c)return c;if(!y(c))throw q("notstring",c);for(var p=A(u)?u:v(u)?function(){return u}:function(){return{}},n=c,l=[],w,m;c=n.match(h);)w=c[0],c[2]||
c[4]||(w=(c[3]?"http://":"mailto:")+w),m=c.index,r(n.substr(0,m)),x(w,c[0].replace(t,"")),n=n.substring(m+c[0].length);r(n);return f(l.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map
;
(function() {

'use strict';

/*
 * Callback Controller
 */
angular.module('webchatApp.callback', []).
  controller('CallbackFormController', ['$scope','$resource','$sanitize', '$location', function($scope, $resource, $sanitize,$location) {
    $scope.name = '';
    $scope.phone = '';
    $scope.state = '';
    $scope.errNameReq = false;
    $scope.errPhoneReq = false;
    $scope.errStateReq = false;
    $scope.submitable = false;
    $scope.nameRegex = /\D{2,80}/;
    $scope.phoneRegex = /\d{6,10}/;
    $scope.open = true; 
    
    /*
     * validateUI()
     */
    $scope.validateUI = function () {
      var nameValid =  ($scope.name !== undefined) && $scope.nameRegex.test($scope.name),
          phoneValid = ($scope.phone !== undefined) && $scope.phoneRegex.test($scope.phone),
          stateValid = ($scope.state !== undefined) && ($scope.state !== '');
      
     if (nameValid && phoneValid && stateValid) {
        $scope.submitable = true;
        $scope.errPhoneReq = false;
        $scope.errNameReq = false;
        $scope.errStateReq = false;
        return;
      }
      
      if (!nameValid) {
        $scope.errNameReq = true;
        $scope.submitable = false;
      } else {
        $scope.errNameReq = false;
      }
      if (!phoneValid) {
        $scope.errPhoneReq = true;
        $scope.submitable = false;        
      } else {
        $scope.errPhoneReq = false;
      }
      if (!stateValid) {
          $scope.errStateReq = true;
          $scope.submitable = false;
      } else {
          $scope.errStateReq = false;
      }
    };
    
    /*
     * requestCallback()
     */
    $scope.requestCallback = function () {
      event.preventDefault();
      $scope.loading = true;
      var inin = $resource('/services/CicService.svc/RequestCallBack');

      var callbackRequest = {
        MemberName: $sanitize($scope.name),
        MemberPhone: $sanitize($scope.phone),
        MemberState: $sanitize($scope.state),
        FcSessionId: '', 
        FcFormId: 0
      };

      if (typeof(fc) !== 'undefined') {
        callbackRequest.FcSessionId = fc.sessionId;
        callbackRequest.FcFormId = parseInt(fc.formId);  
      }
      
      var saveRes = inin.save(callbackRequest, function(response) {
        $scope.showConfirmation = response.Success;
        $scope.error = !response.Success;
        $scope.loading = false;
      }, function(err) {
        $scope.loading = false;
        $scope.error = true;
      }); 
      $scope.callbackFormVisible = false;
    };
    /* * */
    
  }]);
  
}());;
(function() {

'use strict';

/* 
 * WebchatController
 */  
angular.module('webchatApp.webchat', []).
  controller('WebchatController', ['$scope', '$resource', '$window', '$location', '$sanitize', function ($scope, $resource, $window, $location, $sanitize) {
    $scope.chatFormVisible = false;
    $scope.name = '';
    $scope.memberNumber = '';
    $scope.phone = '';
    $scope.email = '';
    $scope.submitable = false;
    $scope.errNameReq = false;
    $scope.errEmailReq = false;
    $scope.nameRegex = /\D{2,80}/;
    $scope.emailRegex = /([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})/;
    
    var open = $resource('/services/CicService.svc/WebchatStatus');
    open.get(function(WebchatStatus) {
      $scope.open = WebchatStatus.success;
      $scope.chatFormVisible = false;
    });
    
    /*
     * validateUI() 
     */
    $scope.validateUI = function () {
      var nameValid =  ($scope.name !== undefined) && $scope.nameRegex.test($scope.name),
          emailValid = ($scope.email !== undefined) && $scope.emailRegex.test($scope.email);

      if (nameValid && emailValid) {
        $scope.submitable = true;
        $scope.errNameReq = false;
        $scope.errEmailReq = false;
        return;
      }
      
      if (!nameValid) {
        $scope.errNameReq = true;
        $scope.submitable = false;
      } else {
        $scope.errNameReq = false;
      }
      if (!emailValid) {
        $scope.errEmailReq = true;
        $scope.submitable = false;
      } else {
        $scope.errEmailReq = false;
      }
    };
    
    /*
     * startChat()
     */
    $scope.startChat = function (chatFrm) {
      event.preventDefault();
      var params = {
        'interactionType': 'Chat',
        'targetType': 'Workgroup',
        'memberName': $sanitize($scope.name),
        'memberEmail': $sanitize($scope.email),
        'target': 'General+enquiry',
        'memberEnquiry': 'Web chat enquiry initiated from web form page.'
      };
      
      if ($scope.phone !== undefined && /\d{6,10}/.exec($scope.phone)) {
        params.memberPhone = $scope.phone;
      }
      if ($scope.memberNumber !== undefined && /\d{2,6}/.exec($scope.memberNumber)) {
        params.memberNo = $scope.memberNumber;  
      }

      var popup = {
        opts: 'width=800,height=550,dependent=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes',
        name: 'TMBL Web Chat'
      };
      
      $window.open("https://webchat.tmbank.com.au/I3Root/index2.html?" + jQuery.param(params), popup.name, popup.ops);
      $scope.chatFormVisible = false;
      $scope.message = 'A web chat session has been started in a new window.';
    };

  }]);
    
}());
;
(function () {
    'use strict';
    var affixing = false,
        affixEnabled = false,
        mainFooter = {},
        pl19 = {},
        footerTop = 0;

    function afixBanner() {
        if (!affixEnabled) {
            return;
        }
        if (window.scrollY > (557-100)) {
            var origW = $('.pl19-text-banner').outerWidth();
            var newTop = 100;
            
            var footerDx = $('#main-footer').position().top - (window.scrollY + $('.pl19-text-banner').height() + 250);
            var footerAvoid = (footerDx <= 0);
            if (footerAvoid) {
                newTop = newTop + footerDx;
            }
            $('.pl19-text-banner').addClass('pl19-affix').attr('style', 'width:' + origW + 'px;top:' + newTop + 'px;');
        } else {
            pl19.removeClass('pl19-affix').attr('style', '');
        }        
    }
    
    function respond() {
        var currentWidth = $(document).width();
        
        if (currentWidth < 880) {
            affixEnabled = false;
            pl19.removeClass('pl19-affix').attr('style', '');
        } else {
            affixEnabled = document.affixPl19;
        }
    };
    
    function setupAffix() {
        $(window).on('scroll', afixBanner);
        $(window).on('resize', respond);
        
        affixEnabled = document.affixPl19; // set default state
        
        mainFooter = $('#main-footer');
        pl19 = $('.pl19-text-banner');

        footerTop = mainFooter.position().top;
                
        respond();
    };
    
    $(document).ready(function () {
        if (document.affixPl19) {
            setupAffix();
        }
        jQuery('.pl19-text-banner .hide-prejs').removeClass('hide-prejs');
    });

})();
;
